feat: implement Phase 1 - Core Page Cache and Admin Settings UI

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)
This commit is contained in:
2026-09-13 09:56:35 +02:00
parent 88a0531d90
commit 33099591f5
18 changed files with 1452 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
<?php
/**
* Plugin Name: WP Recache
* Plugin URI: https://gitea.cyanet.fr/kevin.bataille/wp-recache
* Description: Open source WordPress performance plugin - page caching, file optimization, image optimization
* Version: 1.0.0
* Requires at least: 5.8
* Requires PHP: 7.4
* Author: Kevin Bataille
* Author URI: https://gitea.cyanet.fr/kevin.bataille
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: wp-recache
* Domain Path: /languages
*/
defined('ABSPATH') || exit;
define('WP_RECACHE_VERSION', '1.0.0');
define('WP_RECACHE_PATH', plugin_dir_path(__FILE__));
define('WP_RECACHE_URL', plugin_dir_url(__FILE__));
define('WP_RECACHE_INC_PATH', WP_RECACHE_PATH . 'includes/');
define('WP_RECACHE_CACHE_PATH', WP_CONTENT_DIR . '/cache/wp-recache/');
require_once WP_RECACHE_INC_PATH . 'Common/Helpers.php';
/**
* Main plugin initialization.
*/
function wp_recache_init() {
if (is_admin()) {
require_once WP_RECACHE_INC_PATH . 'Admin/Admin.php';
$admin = new WP_Recache_Admin();
$admin->init();
}
if (WP_RECACHE_CACHE_ENABLED) {
require_once WP_RECACHE_INC_PATH . 'Cache/WPCache.php';
$cache = new WP_Recache_WPCache();
$cache->init();
}
}
/**
* Plugin activation.
*/
function wp_recache_activate() {
require_once WP_RECACHE_INC_PATH . 'Activator.php';
WP_Recache_Activator::activate();
}
register_activation_hook(__FILE__, 'wp_recache_activate');
/**
* Plugin deactivation.
*/
function wp_recache_deactivate() {
require_once WP_RECACHE_INC_PATH . 'Deactivator.php';
WP_Recache_Deactivator::deactivate();
}
register_deactivation_hook(__FILE__, 'wp_recache_deactivate');
add_action('plugins_loaded', 'wp_recache_init');