| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Watchful |
| 4 |
* Plugin URI: https://app.watchful.net |
| 5 |
* Description: Remote Website Management Plugin by Watchful |
| 6 |
* Version: 2.0.17 |
| 7 |
* Author: watchful |
| 8 |
* Author URI: https://watchful.net |
| 9 |
* License: GPLv2 or later |
| 10 |
* |
| 11 |
* @package watchful |
| 12 |
*/ |
| 13 |
|
| 14 |
if (!defined('ABSPATH')) { |
| 15 |
exit; // Exit if accessed directly. |
| 16 |
} |
| 17 |
|
| 18 |
require_once 'autoloader.php'; |
| 19 |
spl_autoload_register('watchful_class_loader'); |
| 20 |
|
| 21 |
if (!defined('WATCHFUL_PLUGIN_DIR')) { |
| 22 |
define('WATCHFUL_PLUGIN_DIR', plugin_dir_path(__FILE__)); |
| 23 |
} |
| 24 |
|
| 25 |
if (!defined('WATCHFUL_PLUGIN_CONTENT_DIR')) { |
| 26 |
define('WATCHFUL_PLUGIN_CONTENT_DIR', WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'watchful'); |
| 27 |
} |
| 28 |
|
| 29 |
if (!defined('WATCHFUL_VERSION')) { |
| 30 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 31 |
define('WATCHFUL_VERSION', get_plugin_data(__FILE__, false, false)['Version']); |
| 32 |
} |
| 33 |
|
| 34 |
register_activation_hook(__FILE__, array('watchful\Init', 'activation')); |
| 35 |
register_uninstall_hook(__FILE__, array('watchful\Init', 'uninstall')); |
| 36 |
|
| 37 |
// As soon as possible in the execution, we store the WP core version. |
| 38 |
Watchful\Controller\Core::remember_wp_version(); |
| 39 |
|
| 40 |
add_action('init', array('watchful\Init', 'wordpress_init')); |
| 41 |
|
| 42 |
add_action('admin_init', array('watchful\Init', 'admin_init')); |
| 43 |
|
| 44 |
add_action('plugins_loaded', array('watchful\Init', 'plugins_loaded')); |
| 45 |
|