PluginProbe
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN / 1.0.0
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN v1.0.0
1.3.3 1.3.2 1.3.1 1.3.0 1.2.4 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 All 29 releases
xspeed / includes / class-plugin.php

class-plugin.php in xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN 1.0.0, at includes/class-plugin.php

52 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main plugin bootstrap.
4 *
5 * @package XSpeed
6 */
7
8 namespace XSpeed;
9
10 defined( 'ABSPATH' ) || exit;
11
12 class Plugin {
13
14 private static $instance = null;
15
16 public static function instance() {
17 if ( null === self::$instance ) {
18 self::$instance = new self();
19 }
20 return self::$instance;
21 }
22
23 public function init() {
24 new Admin();
25 new Rest_Api();
26 new Cache();
27 new Minifier();
28 }
29
30 public static function activate() {
31 Settings::set_defaults();
32
33 if ( ! file_exists( XSPEED_CACHE_DIR ) ) {
34 wp_mkdir_p( XSPEED_CACHE_DIR );
35 }
36 Cache::write_silence( XSPEED_CACHE_DIR );
37
38 // Drop-in installation (advanced-cache.php) and the WP_CACHE constant
39 // edit happen only when the user explicitly enables caching from the
40 // admin UI — never on activation. See Cache::toggle() and
41 // Rest_Api::toggle_cache(). This is a WordPress.org review requirement.
42 }
43
44 public static function deactivate() {
45 Cache::remove_dropin();
46 Cache::set_wp_cache_constant( false );
47 Cache::purge_all();
48 Minifier::purge_minified();
49 Gzip::apply( false );
50 }
51 }
52