# xspeed/1.1.0/xspeed.php

xSpeed Cache: AI-Powered Performance Hub with MCP, Caching &amp; CDN, version 1.1.0. 86 lines.

- Page: https://pluginprobe.com/plugins/xspeed/1.1.0/code/xspeed.php
- Raw: https://pluginprobe.com/plugins/xspeed/1.1.0/raw/xspeed.php
- Modified: 2026-07-22T13:36:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/xspeed/1.1.0/code/xspeed.php#L10-L20`.

```php
<?php
/**
 * Plugin Name: xSpeed Cache
 * Description: Minimal, ultra-fast caching plugin for WordPress.
 * Version: 1.1.0
 * Requires at least: 6.0
 * Tested up to: 7.0
 * Requires PHP: 7.4
 * Author: WPDeveloper
 * Author URI: https://wpdeveloper.com
 * License: GPLv2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: xspeed
 *
 * @package XSpeed
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

define( 'XSPEED_VERSION', '1.1.0' );
define( 'XSPEED_FILE', __FILE__ );
define( 'XSPEED_DIR', plugin_dir_path( __FILE__ ) );
define( 'XSPEED_URL', plugin_dir_url( __FILE__ ) );
define( 'XSPEED_CACHE_DIR', WP_CONTENT_DIR . '/cache/xspeed' );

/**
 * Static-cache tree. Files written here are served directly by the
 * web server via the rewrite block in .htaccess, bypassing PHP for
 * every cache hit. Layout: `xspeed-static/{host}{request_uri}/index.html`.
 * Separate from XSPEED_CACHE_DIR so the PHP drop-in's flat-hash cache
 * stays intact as a fallback for cookied / query-string / nginx hosts.
 */
define( 'XSPEED_CACHE_STATIC_DIR', WP_CONTENT_DIR . '/cache/xspeed-static' );

/**
 * Free-API version. xspeed-pro reads this to decide if it speaks the
 * current Module / Module_Registry / Settings_Manager / Rest_Manager
 * contract. Bump on any breaking change to those interfaces — never on
 * additive change. See IMPLEMENTATION.md §1 and class-tier-registry.php.
 */
define( 'XSPEED_API_VERSION', 1 );

/**
 * WP Insights project token for opt-in usage analytics (Usage_Tracker). Routes
 * this plugin's anonymous diagnostics to its project on send.wpinsight.com.
 * Overridable via wp-config.php for staging/QA. Nothing is ever sent unless the
 * admin explicitly opts in during the setup wizard — see class-usage-tracker.php.
 *
 * The WP Insights item_id for xSpeed — the project hash send.wpinsight.com
 * keys this plugin's telemetry on. The tracker only sends after explicit
 * user opt-in (require_optin is forced true); this just identifies the
 * project on the initial registration handshake.
 */
if ( ! defined( 'XSPEED_INSIGHTS_ITEM_ID' ) ) {
	define( 'XSPEED_INSIGHTS_ITEM_ID', 'd2268aeacaa69d9f6d2f' );
}

spl_autoload_register(
	function ( $class ) {
		if ( strpos( $class, 'XSpeed\\' ) !== 0 ) {
			return;
		}
		$relative = str_replace( 'XSpeed\\', '', $class );
		$file     = XSPEED_DIR . 'includes/class-' . strtolower( str_replace( '_', '-', $relative ) ) . '.php';
		if ( file_exists( $file ) ) {
			require_once $file;
		}
	}
);

if ( file_exists( XSPEED_DIR . 'vendor/autoload.php' ) ) {
	require_once XSPEED_DIR . 'vendor/autoload.php';
}

register_activation_hook( __FILE__, array( 'XSpeed\\Plugin', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'XSpeed\\Plugin', 'deactivate' ) );

add_action(
	'plugins_loaded',
	function () {
		\XSpeed\Plugin::instance()->init();
	}
);

```
