Repository navigation
Expand file tree
/
Copy pathwp-maintenance-mode.php
More file actions
executable file
·136 lines (121 loc) · 3.93 KB
/
Copy pathwp-maintenance-mode.php
File metadata and controls
executable file
·136 lines (121 loc) · 3.93 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/**
* LightStart
*
* Plugin Name: LightStart - Maintenance Mode, Coming Soon and Landing Page Builder
* 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 or landing page.
* Version: 2.6.24
* Author: Themeisle
* Author URI: https://themeisle.com/
* Twitter: themeisle
* GitHub Plugin URI: https://github.com/codeinwp/wp-maintenance-mode
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: wp-maintenance-mode
* Domain Path: /languages
* WordPress Available: yes
* Requires License: no
*/
defined( 'ABSPATH' ) || exit;
/**
* DEFINE PATHS
*/
define( 'WPMM_PATH', plugin_dir_path( __FILE__ ) );
define( 'WPMM_FILE', __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( 'WPMM_TEMPLATES_PATH', WPMM_PATH . 'assets/templates/' );
define( 'WPMM_PRODUCT_SLUG', basename( __DIR__ ) );
/**
* 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_TEMPLATES_URL', WPMM_URL . 'assets/templates/' );
/**
* OTHER DEFINES
*/
define( 'WPMM_ASSETS_SUFFIX', ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min' );
/**
* FUNCTIONS
*/
require_once WPMM_FUNCTIONS_PATH . 'hooks.php';
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' ) );
/**
* ABILITIES API
*/
require_once WPMM_CLASSES_PATH . 'wp-maintenance-mode-abilities.php';
WP_Maintenance_Mode_Abilities::init();
/**
* 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' ) );
}
add_filter( 'themeisle_sdk_products', 'wpmm_load_sdk' );
add_filter(
'wp_maintenance_mode_about_us_metadata',
function () {
return array(
'logo' => esc_url( WPMM_IMAGES_URL . 'icon.svg' ),
'location' => 'wp-maintenance-mode',
);
}
);
add_filter(
'wp_maintenance_mode_ai_connect_metadata',
function () {
return array(
'name' => 'LightStart',
'notice_cases' => array(
__( 'turn maintenance mode on or off', 'wp-maintenance-mode' ),
__( 'change who can bypass it', 'wp-maintenance-mode' ),
__( 'list your subscribers', 'wp-maintenance-mode' ),
),
'prompts' => array(
__( 'Turn on LightStart maintenance mode and let editors keep access.', 'wp-maintenance-mode' ),
__( 'Add my sales page to the maintenance-mode bypass list so the campaign stays live.', 'wp-maintenance-mode' ),
__( 'Give me the emails collected by my maintenance page since Monday.', 'wp-maintenance-mode' ),
),
'ability_prefix' => 'lightstart',
);
}
);
/**
* Filter products array.
*
* @param array $products products array.
*
* @return array
*/
function wpmm_load_sdk( $products ) {
$products[] = __FILE__;
return $products;
}
$autoload_path = __DIR__ . '/vendor/autoload.php';
if ( is_file( $autoload_path ) ) {
require_once $autoload_path;
}
add_filter(
'wp_maintenance_mode_load_promotions',
function () {
return array( 'otter' );
}
);