| @@ -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 |
| @@ -459,13 +464,19 @@ | ||
| 459 | 464 | return rest_ensure_response( $updated ); |
| 460 | 465 | } |
| 461 | 466 | |
| 462 | 467 | 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() ) ); | |
| 468 | + // The same core function `wp xspeed purge` runs, so the dashboard | |
| 469 | + // button and the CLI cannot clear different sets of stores — and the | |
| 470 | + // per-store report is available here for the UI to surface a store | |
| 471 | + // that was skipped or refused rather than flashing "cache cleared". | |
| 472 | + $report = Purge_Runner::run( array( 'all' ), __( 'dashboard', 'xspeed' ) ); | |
| 473 | + return rest_ensure_response( | |
| 474 | + array( | |
| 475 | + 'stats' => Cache::get_stats(), | |
| 476 | + 'report' => $report, | |
| 477 | + ) | |
| 478 | + ); | |
| 468 | 479 | } |
| 469 | 480 | |
| 470 | 481 | /** |
| 471 | 482 | * The "Cached Pages" drill-down: which pages are cached and how old they |