| 1 |
<?php |
| 2 |
/** |
| 3 |
* Main plugin file. |
| 4 |
* |
| 5 |
* @package Bootstrap |
| 6 |
* @author Pierre Lannoy <https://pierre.lannoy.fr/>. |
| 7 |
* @since 1.0.0 |
| 8 |
* |
| 9 |
* @wordpress-plugin |
| 10 |
* Plugin Name: OPcache Manager |
| 11 |
* Plugin URI: https://github.com/Pierre-Lannoy/wp-opcache-manager |
| 12 |
* Description: OPcache statistics and management right in the WordPress admin dashboard. |
| 13 |
* Version: 2.1.0 |
| 14 |
* Requires at least: 5.2 |
| 15 |
* Requires PHP: 7.2 |
| 16 |
* Author: Pierre Lannoy |
| 17 |
* Author URI: https://pierre.lannoy.fr |
| 18 |
* License: GPLv3 |
| 19 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html |
| 20 |
* Network: true |
| 21 |
* Text Domain: opcache-manager |
| 22 |
* Domain Path: /languages |
| 23 |
*/ |
| 24 |
|
| 25 |
// If this file is called directly, abort. |
| 26 |
if ( ! defined( 'WPINC' ) ) { |
| 27 |
die; |
| 28 |
} |
| 29 |
|
| 30 |
require_once __DIR__ . '/init.php'; |
| 31 |
require_once __DIR__ . '/includes/system/class-option.php'; |
| 32 |
require_once __DIR__ . '/includes/system/class-environment.php'; |
| 33 |
require_once __DIR__ . '/autoload.php'; |
| 34 |
require_once __DIR__ . '/includes/libraries/class-libraries.php'; |
| 35 |
require_once __DIR__ . '/includes/libraries/autoload.php'; |
| 36 |
require_once __DIR__ . '/includes/features/class-wpcli.php'; |
| 37 |
|
| 38 |
/** |
| 39 |
* The code that runs during plugin activation. |
| 40 |
* |
| 41 |
* @since 1.0.0 |
| 42 |
*/ |
| 43 |
function opcm_activate() { |
| 44 |
OPcacheManager\Plugin\Activator::activate(); |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* The code that runs during plugin deactivation. |
| 49 |
* |
| 50 |
* @since 1.0.0 |
| 51 |
*/ |
| 52 |
function opcm_deactivate() { |
| 53 |
OPcacheManager\Plugin\Deactivator::deactivate(); |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* The code that runs during plugin uninstallation. |
| 58 |
* |
| 59 |
* @since 1.0.0 |
| 60 |
*/ |
| 61 |
function opcm_uninstall() { |
| 62 |
OPcacheManager\Plugin\Uninstaller::uninstall(); |
| 63 |
} |
| 64 |
|
| 65 |
/** |
| 66 |
* Begins execution of the plugin. |
| 67 |
* |
| 68 |
* @since 1.0.0 |
| 69 |
*/ |
| 70 |
function opcm_run() { |
| 71 |
\OPcacheManager\System\Logger::init(); |
| 72 |
$plugin = new OPcacheManager\Plugin\Core(); |
| 73 |
$plugin->run(); |
| 74 |
} |
| 75 |
|
| 76 |
register_activation_hook( __FILE__, 'opcm_activate' ); |
| 77 |
register_deactivation_hook( __FILE__, 'opcm_deactivate' ); |
| 78 |
register_uninstall_hook( __FILE__, 'opcm_uninstall' ); |
| 79 |
opcm_run(); |
| 80 |
|