| @@ -425,8 +425,13 @@ | ||
| 425 | 425 | 'nginx_snippet' => Gzip::nginx_snippet(), |
| 426 | 426 | ), |
| 427 | 427 | 'rewrite_probe' => $rewrite_probe, |
| 428 | 428 | 'nginx_server_block' => Cache::full_nginx_server_block(), |
| 429 | + // What enabling the page cache would do to | |
| 430 | + // wp-content/advanced-cache.php. The dashboard discloses the | |
| 431 | + // replacement BEFORE the write when a leftover drop-in is | |
| 432 | + // already there; see Page_Cache_Detector::dropin_disclosure(). | |
| 433 | + 'dropin' => Page_Cache_Detector::dropin_disclosure(), | |
| 429 | 434 | // Separate Mobile Cache visibility (FBS-83145). `blocking` is |
| 430 | 435 | // true when mobile_separate is what's keeping the device-blind |
| 431 | 436 | // static fast path from installing on a rewrite-capable server; |
| 432 | 437 | // `needs_review` is true when a migration turned it on for us and |
| @@ -433,9 +438,16 @@ | ||
| 433 | 438 | // the user hasn't confirmed they actually need it. The dashboard |
| 434 | 439 | // renders a callout (+ "Check now" equality probe) from these. |
| 435 | 440 | 'mobile_separate' => array( |
| 436 | 441 | 'enabled' => ! empty( Settings::get()['cache_enabled'] ) ? (bool) ( Settings_Manager::get( 'cache' )['mobile_separate'] ?? false ) : false, |
| 437 | - 'blocking' => $rewrite_capable && 'mobile_separate' === Cache::static_rewrite_block_reason(), | |
| 442 | + // Gated to servers that HAVE a static fast path — see the | |
| 443 | + // matching comment in Admin::bootstrap_payload(): on IIS / | |
| 444 | + // unknown, block_reason still falls through to | |
| 445 | + // mobile_separate and reporting it as "blocking" would nag | |
| 446 | + // about a rewrite that does not exist there (#108). | |
| 447 | + // LiteSpeed joined the capable set with the opt-in (#509). | |
| 448 | + 'blocking' => ( $rewrite_capable || Server::LITESPEED === $server_type ) | |
| 449 | + && 'mobile_separate' === Cache::static_rewrite_block_reason(), | |
| 438 | 450 | 'needs_review' => Cache::mobile_separate_needs_review(), |
| 439 | 451 | ), |
| 440 | 452 | ) |
| 441 | 453 | ); |
| @@ -459,13 +471,19 @@ | ||
| 459 | 471 | return rest_ensure_response( $updated ); |
| 460 | 472 | } |
| 461 | 473 | |
| 462 | 474 | public function purge() { |
| 463 | - // purge_type( 'all' ) rather than purge_all() so the dashboard button | |
| 464 | - // behaves identically to the admin-bar "Purge All" — including | |
| 465 | - // clearing third-party render caches (Render_Caches). | |
| 466 | - Cache::purge_type( 'all', __( 'dashboard', 'xspeed' ) ); | |
| 467 | - return rest_ensure_response( array( 'stats' => Cache::get_stats() ) ); | |
| 475 | + // The same core function `wp xspeed purge` runs, so the dashboard | |
| 476 | + // button and the CLI cannot clear different sets of stores — and the | |
| 477 | + // per-store report is available here for the UI to surface a store | |
| 478 | + // that was skipped or refused rather than flashing "cache cleared". | |
| 479 | + $report = Purge_Runner::run( array( 'all' ), __( 'dashboard', 'xspeed' ) ); | |
| 480 | + return rest_ensure_response( | |
| 481 | + array( | |
| 482 | + 'stats' => Cache::get_stats(), | |
| 483 | + 'report' => $report, | |
| 484 | + ) | |
| 485 | + ); | |
| 468 | 486 | } |
| 469 | 487 | |
| 470 | 488 | /** |
| 471 | 489 | * The "Cached Pages" drill-down: which pages are cached and how old they |