PluginProbe
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN / 1.0.2
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN v1.0.2
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 / xspeed.php

xspeed.php in xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN 1.0.2, at xspeed.php

71 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: xSpeed
4 * Description: Minimal, ultra-fast caching plugin for WordPress.
5 * Version: 1.0.2
6 * Requires at least: 6.0
7 * Tested up to: 7.0
8 * Requires PHP: 7.4
9 * Author: WPDeveloper
10 * Author URI: https://wpdeveloper.com
11 * License: GPLv2 or later
12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
13 * Text Domain: xspeed
14 *
15 * @package XSpeed
16 */
17
18 if ( ! defined( 'ABSPATH' ) ) {
19 exit;
20 }
21
22 define( 'XSPEED_VERSION', '1.0.2' );
23 define( 'XSPEED_FILE', __FILE__ );
24 define( 'XSPEED_DIR', plugin_dir_path( __FILE__ ) );
25 define( 'XSPEED_URL', plugin_dir_url( __FILE__ ) );
26 define( 'XSPEED_CACHE_DIR', WP_CONTENT_DIR . '/cache/xspeed' );
27
28 /**
29 * Static-cache tree. Files written here are served directly by the
30 * web server via the rewrite block in .htaccess, bypassing PHP for
31 * every cache hit. Layout: `xspeed-static/{host}{request_uri}/index.html`.
32 * Separate from XSPEED_CACHE_DIR so the PHP drop-in's flat-hash cache
33 * stays intact as a fallback for cookied / query-string / nginx hosts.
34 */
35 define( 'XSPEED_CACHE_STATIC_DIR', WP_CONTENT_DIR . '/cache/xspeed-static' );
36
37 /**
38 * Free-API version. xspeed-pro reads this to decide if it speaks the
39 * current Module / Module_Registry / Settings_Manager / Rest_Manager
40 * contract. Bump on any breaking change to those interfaces — never on
41 * additive change. See IMPLEMENTATION.md §1 and class-tier-registry.php.
42 */
43 define( 'XSPEED_API_VERSION', 1 );
44
45 spl_autoload_register(
46 function ( $class ) {
47 if ( strpos( $class, 'XSpeed\\' ) !== 0 ) {
48 return;
49 }
50 $relative = str_replace( 'XSpeed\\', '', $class );
51 $file = XSPEED_DIR . 'includes/class-' . strtolower( str_replace( '_', '-', $relative ) ) . '.php';
52 if ( file_exists( $file ) ) {
53 require_once $file;
54 }
55 }
56 );
57
58 if ( file_exists( XSPEED_DIR . 'vendor/autoload.php' ) ) {
59 require_once XSPEED_DIR . 'vendor/autoload.php';
60 }
61
62 register_activation_hook( __FILE__, array( 'XSpeed\\Plugin', 'activate' ) );
63 register_deactivation_hook( __FILE__, array( 'XSpeed\\Plugin', 'deactivate' ) );
64
65 add_action(
66 'plugins_loaded',
67 function () {
68 \XSpeed\Plugin::instance()->init();
69 }
70 );
71