-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwp-performance.php
More file actions
48 lines (40 loc) · 1.47 KB
/
Copy pathwp-performance.php
File metadata and controls
48 lines (40 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* Plugin Name: WP Performance
* Description: WP Performance Optimizer - cache & performance plugin.
* Version: 2.0.0
* Requires at least: 6.9
* Requires PHP: 8.1
* Author: Ante Laca
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: wpp
* Domain Path: /languages
*/
declare(strict_types=1);
use WPP\Foundation\Plugin;
if (! defined('ABSPATH')) {
exit;
}
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/inc/fragment-helpers.php';
define('WPP_VERSION', '2.0.0');
define('WPP_FILE', __FILE__);
define('WPP_DIR', plugin_dir_path(__FILE__));
define('WPP_URL', plugin_dir_url(__FILE__));
define('WPP_SLUG', 'wp-performance');
define('WPP_CACHE_DIR', trailingslashit(WP_CONTENT_DIR) . 'cache/wpp-cache/');
define('WPP_CACHE_URL', trailingslashit(WP_CONTENT_URL) . 'cache/wpp-cache/');
register_activation_hook(__FILE__, [Plugin::class, 'onActivation']);
register_deactivation_hook(__FILE__, [Plugin::class, 'onDeactivation']);
add_action('plugins_loaded', static function (): void {
Plugin::boot();
if (defined('WP_CLI') && WP_CLI) {
$cli = new WPP\Cli\CliCommands();
WP_CLI::add_command('wpp flush', [$cli, 'flush']);
WP_CLI::add_command('wpp flush-blocks', [$cli, 'flushBlocks']);
WP_CLI::add_command('wpp enable', [$cli, 'enable']);
WP_CLI::add_command('wpp disable', [$cli, 'disable']);
WP_CLI::add_command('wpp cleanup', [$cli, 'cleanup']);
}
});