| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The plugin bootstrap file |
| 5 |
* |
| 6 |
* This file is read by WordPress to generate the plugin information in the plugin |
| 7 |
* admin area. This file also includes all of the dependencies used by the plugin, |
| 8 |
* registers the activation and deactivation functions, and defines a function |
| 9 |
* that starts the plugin. |
| 10 |
* |
| 11 |
* @link http://www.fugu.fr |
| 12 |
* @since 1.0.0 |
| 13 |
* @package Maintenance_Switch |
| 14 |
* |
| 15 |
* @wordpress-plugin |
| 16 |
* Plugin Name: Maintenance Switch |
| 17 |
* Plugin URI: https://wordpress.org/plugins/maintenance-switch |
| 18 |
* Description: Customize easily and switch in one-click to (native) maintenance mode from your backend or frontend. |
| 19 |
* Version: 1.6.4 |
| 20 |
* Author: Fugu |
| 21 |
* Author URI: http://www.fugu.fr |
| 22 |
* License: GPL-2.0+ |
| 23 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 24 |
* Text Domain: maintenance-switch |
| 25 |
* Domain Path: /languages |
| 26 |
*/ |
| 27 |
|
| 28 |
// If this file is called directly, abort. |
| 29 |
if (!defined('WPINC')) { |
| 30 |
die; |
| 31 |
} |
| 32 |
|
| 33 |
/** |
| 34 |
* Path of the maintenance.php file. |
| 35 |
* @since 1.0.0 |
| 36 |
*/ |
| 37 |
define('MS_SLUG', 'maintenance-switch'); |
| 38 |
|
| 39 |
/** |
| 40 |
* Path of the maintenance.php file. |
| 41 |
* @since 1.3.6 |
| 42 |
*/ |
| 43 |
define('PLUGIN_VERSION', '1.6.0'); |
| 44 |
|
| 45 |
/** |
| 46 |
* The config file |
| 47 |
*/ |
| 48 |
require_once plugin_dir_path(__FILE__) . 'includes/config.php'; |
| 49 |
|
| 50 |
/** |
| 51 |
* The code that runs during plugin activation. |
| 52 |
* This action is documented in includes/class-maintenance-switch-activator.php |
| 53 |
*/ |
| 54 |
function activate_maintenance_switch() |
| 55 |
{ |
| 56 |
require_once plugin_dir_path(__FILE__) . 'includes/class-maintenance-switch-activator.php'; |
| 57 |
Maintenance_Switch_Activator::activate(); |
| 58 |
} |
| 59 |
|
| 60 |
/** |
| 61 |
* The code that runs during plugin deactivation. |
| 62 |
* This action is documented in includes/class-maintenance-switch-deactivator.php |
| 63 |
*/ |
| 64 |
function deactivate_maintenance_switch() |
| 65 |
{ |
| 66 |
require_once plugin_dir_path(__FILE__) . 'includes/class-maintenance-switch-deactivator.php'; |
| 67 |
Maintenance_Switch_Deactivator::deactivate(); |
| 68 |
} |
| 69 |
|
| 70 |
register_activation_hook(__FILE__, 'activate_maintenance_switch'); |
| 71 |
register_deactivation_hook(__FILE__, 'deactivate_maintenance_switch'); |
| 72 |
|
| 73 |
/** |
| 74 |
* The core plugin class that is used to define internationalization, |
| 75 |
* admin-specific hooks, and public-facing site hooks. |
| 76 |
*/ |
| 77 |
require plugin_dir_path(__FILE__) . 'includes/class-maintenance-switch.php'; |
| 78 |
|
| 79 |
/** |
| 80 |
* Begins execution of the plugin. |
| 81 |
* |
| 82 |
* Since everything within the plugin is registered via hooks, |
| 83 |
* then kicking off the plugin from this point in the file does |
| 84 |
* not affect the page life cycle. |
| 85 |
* |
| 86 |
* @since 1.0.0 |
| 87 |
*/ |
| 88 |
function run_maintenance_switch() |
| 89 |
{ |
| 90 |
|
| 91 |
$plugin = new Maintenance_Switch(); |
| 92 |
$plugin->run(); |
| 93 |
|
| 94 |
} |
| 95 |
run_maintenance_switch(); |
| 96 |
|