Implement the core page caching functionality and admin settings interface for WP Recache plugin. This includes: - Plugin bootstrap with activation/deactivation handlers - Admin settings page with tabbed interface (Cache, Optimization, Advanced) - Admin bar integration for quick cache purging - Core page cache using output buffering - Cache file management with mobile device separation - Cache purge on post update/comment - Default URL exclusions (cart, checkout, account) - Cache statistics display - PHPUnit test suite setup - Docker-based development environment - PHPStan configuration for static analysis References: - Closes #1 (Core Page Cache) - Closes #8 (Admin Settings UI)
38 lines
721 B
PHP
38 lines
721 B
PHP
<?php
|
|
/**
|
|
* Plugin deactivation handler.
|
|
*
|
|
* @package WP_Recache
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
class WP_Recache_Deactivator {
|
|
|
|
/**
|
|
* Run deactivation routines.
|
|
*/
|
|
public static function deactivate() {
|
|
self::remove_advanced_cache();
|
|
self::flush_rewrite_rules();
|
|
}
|
|
|
|
/**
|
|
* Remove advanced-cache.php drop-in.
|
|
*/
|
|
private static function remove_advanced_cache() {
|
|
$advanced_cache = WP_CONTENT_DIR . '/advanced-cache.php';
|
|
|
|
if (file_exists($advanced_cache)) {
|
|
unlink($advanced_cache);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Flush rewrite rules.
|
|
*/
|
|
private static function flush_rewrite_rules() {
|
|
flush_rewrite_rules();
|
|
}
|
|
}
|