| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Performance Lab |
| 4 |
* Plugin URI: https://github.com/WordPress/performance |
| 5 |
* Description: Performance plugin from the WordPress Performance Team, which is a collection of standalone performance features. |
| 6 |
* Requires at least: 6.9 |
| 7 |
* Requires PHP: 7.4 |
| 8 |
* Version: 4.2.0 |
| 9 |
* Author: WordPress Performance Team |
| 10 |
* Author URI: https://make.wordpress.org/performance/ |
| 11 |
* License: GPLv2 or later |
| 12 |
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
| 13 |
* Text Domain: performance-lab |
| 14 |
* |
| 15 |
* @package performance-lab |
| 16 |
*/ |
| 17 |
|
| 18 |
declare( strict_types = 1 ); |
| 19 |
|
| 20 |
// @codeCoverageIgnoreStart |
| 21 |
if ( ! defined( 'ABSPATH' ) ) { |
| 22 |
exit; // Exit if accessed directly. |
| 23 |
} |
| 24 |
// @codeCoverageIgnoreEnd |
| 25 |
|
| 26 |
define( 'PERFLAB_VERSION', '4.2.0' ); |
| 27 |
define( 'PERFLAB_MAIN_FILE', __FILE__ ); |
| 28 |
define( 'PERFLAB_PLUGIN_DIR_PATH', plugin_dir_path( PERFLAB_MAIN_FILE ) ); |
| 29 |
define( 'PERFLAB_SCREEN', 'performance-lab' ); |
| 30 |
|
| 31 |
// If the constant isn't defined yet, it means the Performance Lab object cache file is not loaded. |
| 32 |
if ( ! defined( 'PERFLAB_OBJECT_CACHE_DROPIN_VERSION' ) ) { |
| 33 |
define( 'PERFLAB_OBJECT_CACHE_DROPIN_VERSION', false ); |
| 34 |
} |
| 35 |
define( 'PERFLAB_OBJECT_CACHE_DROPIN_LATEST_VERSION', 3 ); |
| 36 |
|
| 37 |
require_once __DIR__ . '/hooks.php'; |
| 38 |
|
| 39 |
// Load server-timing API. |
| 40 |
require_once PERFLAB_PLUGIN_DIR_PATH . 'includes/server-timing/class-perflab-server-timing-metric.php'; |
| 41 |
require_once PERFLAB_PLUGIN_DIR_PATH . 'includes/server-timing/class-perflab-server-timing.php'; |
| 42 |
require_once PERFLAB_PLUGIN_DIR_PATH . 'includes/server-timing/load.php'; |
| 43 |
require_once PERFLAB_PLUGIN_DIR_PATH . 'includes/server-timing/defaults.php'; |
| 44 |
|
| 45 |
// Load site health checks. |
| 46 |
require_once PERFLAB_PLUGIN_DIR_PATH . 'includes/site-health/load.php'; |
| 47 |
|
| 48 |
// Only load admin integration when in admin. |
| 49 |
if ( is_admin() ) { |
| 50 |
require_once PERFLAB_PLUGIN_DIR_PATH . 'includes/admin/load.php'; |
| 51 |
require_once PERFLAB_PLUGIN_DIR_PATH . 'includes/admin/server-timing.php'; |
| 52 |
require_once PERFLAB_PLUGIN_DIR_PATH . 'includes/admin/plugins.php'; |
| 53 |
} |
| 54 |
|
| 55 |
// Load REST API. |
| 56 |
require_once PERFLAB_PLUGIN_DIR_PATH . 'includes/admin/rest-api.php'; |
| 57 |
|