forked from Codeinwp/wp-maintenance-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-maintenance-mode.php
executable file
·72 lines (64 loc) · 2.2 KB
/
wp-maintenance-mode.php
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* WP Maintenance Mode
*
* Plugin Name: WP Maintenance Mode
* Plugin URI: http://designmodo.com/
* Description: Adds a splash page to your site that lets visitors know your site is down for maintenance. It's perfect for a coming soon page.
* Version: 2.0.8
* Author: Designmodo
* Author URI: http://designmodo.com/
* Twitter: designmodo
* GitHub Plugin URI: https://github.com/Designmodocom/WP-Maintenance-Mode
* GitHub Branch: master
* Text Domain: wp-maintenance-mode
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Domain Path: /languages
*/
// Exit if accessed directly
if (!defined('ABSPATH'))
exit;
/**
* DEFINE PATHS
*/
define('WPMM_PATH', plugin_dir_path(__FILE__));
define('WPMM_CLASSES_PATH', WPMM_PATH . 'includes/classes/');
define('WPMM_FUNCTIONS_PATH', WPMM_PATH . 'includes/functions/');
define('WPMM_LANGUAGES_PATH', basename(WPMM_PATH) . '/languages/');
define('WPMM_VIEWS_PATH', WPMM_PATH . 'views/');
define('WPMM_CSS_PATH', WPMM_PATH . 'assets/css/');
/**
* DEFINE URLS
*/
define('WPMM_URL', plugin_dir_url(__FILE__));
define('WPMM_JS_URL', WPMM_URL . 'assets/js/');
define('WPMM_CSS_URL', WPMM_URL . 'assets/css/');
define('WPMM_IMAGES_URL', WPMM_URL . 'assets/images/');
define('WPMM_AUTHOR_UTM', '?utm_source=wpplugin&utm_medium=wpmaintenance');
/**
* OTHER DEFINES
*/
define('WPMM_ASSETS_SUFFIX', (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min');
/**
* FUNCTIONS
*/
require_once(WPMM_FUNCTIONS_PATH . 'helpers.php');
if (is_multisite() && !function_exists('is_plugin_active_for_network')) {
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
}
/**
* FRONTEND
*/
require_once(WPMM_CLASSES_PATH . 'wp-maintenance-mode-shortcodes.php');
require_once(WPMM_CLASSES_PATH . 'wp-maintenance-mode.php');
register_activation_hook(__FILE__, array('WP_Maintenance_Mode', 'activate'));
register_deactivation_hook(__FILE__, array('WP_Maintenance_Mode', 'deactivate'));
add_action('plugins_loaded', array('WP_Maintenance_Mode', 'get_instance'));
/**
* DASHBOARD
*/
if (is_admin()) {
require_once(WPMM_CLASSES_PATH . 'wp-maintenance-mode-admin.php');
add_action('plugins_loaded', array('WP_Maintenance_Mode_Admin', 'get_instance'));
}