| 1 |
<?php |
| 2 |
/** |
| 3 |
* MainWP Extension Groups Page |
| 4 |
* |
| 5 |
* @package MainWP/Dashboard |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace MainWP\Dashboard; |
| 9 |
|
| 10 |
// Exit if accessed directly. |
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* Class MainWP_Extensions_Groups |
| 17 |
*/ |
| 18 |
class MainWP_Extensions_Groups { // phpcs:ignore Generic.Classes.OpeningBraceSameLine.ContentAfterBrace -- NOSONAR. |
| 19 |
|
| 20 |
/** |
| 21 |
* Method get_class_name() |
| 22 |
* |
| 23 |
* Get Class Name. |
| 24 |
* |
| 25 |
* @return object Class name. |
| 26 |
*/ |
| 27 |
public static function get_class_name() { |
| 28 |
return __CLASS__; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Instantiate action hooks. |
| 33 |
*/ |
| 34 |
public static function init() { |
| 35 |
add_action( 'mainwp_admin_menu', array( static::get_class_name(), 'init_extensions_menu' ), 10, 2 ); |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Method init_extensions_menu() |
| 40 |
* |
| 41 |
* Initiate left Extensions menus. |
| 42 |
*/ |
| 43 |
public static function init_extensions_menu() { //phpcs:ignore -- NOSONAR - complex. |
| 44 |
|
| 45 |
// @NO_SONAR_START@ - duplicated issue. |
| 46 |
$end_div = '</div>'; |
| 47 |
|
| 48 |
$submenu_pages = array( |
| 49 |
array( |
| 50 |
'parent_slug' => 'mainwp_tab', |
| 51 |
'page_title' => esc_html__( 'Content Operations', 'mainwp' ), |
| 52 |
'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-content-operations">' . esc_html__( 'Content Operations', 'mainwp' ) . $end_div, |
| 53 |
'capability' => 'read', |
| 54 |
'menu_slug' => 'Extensions-Mainwp-Content-Operations', |
| 55 |
'callback' => array( |
| 56 |
static::class, |
| 57 |
'render_extensions_groups', |
| 58 |
), |
| 59 |
), |
| 60 |
array( |
| 61 |
'parent_slug' => 'mainwp_tab', |
| 62 |
'page_title' => esc_html__( 'Backups', 'mainwp' ), |
| 63 |
'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-backups">' . esc_html__( 'Backups', 'mainwp' ) . $end_div, |
| 64 |
'capability' => 'read', |
| 65 |
'menu_slug' => 'Extensions-Mainwp-Backups', |
| 66 |
'callback' => array( |
| 67 |
static::class, |
| 68 |
'render_extensions_groups', |
| 69 |
), |
| 70 |
), |
| 71 |
array( |
| 72 |
'parent_slug' => 'mainwp_tab', |
| 73 |
'page_title' => esc_html__( 'Security', 'mainwp' ), |
| 74 |
'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-security">' . esc_html__( 'Security', 'mainwp' ) . $end_div, |
| 75 |
'capability' => 'read', |
| 76 |
'menu_slug' => 'Extensions-Mainwp-Security', |
| 77 |
'callback' => array( |
| 78 |
static::class, |
| 79 |
'render_extensions_groups', |
| 80 |
), |
| 81 |
), |
| 82 |
array( |
| 83 |
'parent_slug' => 'mainwp_tab', |
| 84 |
'page_title' => esc_html__( 'Monitoring', 'mainwp' ), |
| 85 |
'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-monitoring">' . esc_html__( 'Monitoring', 'mainwp' ) . $end_div, |
| 86 |
'capability' => 'read', |
| 87 |
'menu_slug' => 'Extensions-Mainwp-Monitoring', |
| 88 |
'callback' => array( |
| 89 |
static::class, |
| 90 |
'render_extensions_groups', |
| 91 |
), |
| 92 |
), |
| 93 |
array( |
| 94 |
'parent_slug' => 'mainwp_tab', |
| 95 |
'page_title' => esc_html__( 'Analytics', 'mainwp' ), |
| 96 |
'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-analytics">' . esc_html__( 'Analytics', 'mainwp' ) . $end_div, |
| 97 |
'capability' => 'read', |
| 98 |
'menu_slug' => 'Extensions-Mainwp-Analytics', |
| 99 |
'callback' => array( |
| 100 |
static::class, |
| 101 |
'render_extensions_groups', |
| 102 |
), |
| 103 |
), |
| 104 |
array( |
| 105 |
'parent_slug' => 'mainwp_tab', |
| 106 |
'page_title' => esc_html__( 'Performance', 'mainwp' ), |
| 107 |
'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-performance">' . esc_html__( 'Performance', 'mainwp' ) . $end_div, |
| 108 |
'capability' => 'read', |
| 109 |
'menu_slug' => 'Extensions-Mainwp-Performance', |
| 110 |
'callback' => array( |
| 111 |
static::class, |
| 112 |
'render_extensions_groups', |
| 113 |
), |
| 114 |
), |
| 115 |
array( |
| 116 |
'parent_slug' => 'mainwp_tab', |
| 117 |
'page_title' => esc_html__( 'Agency', 'mainwp' ), |
| 118 |
'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-agency">' . esc_html__( 'Agency', 'mainwp' ) . $end_div, |
| 119 |
'capability' => 'read', |
| 120 |
'menu_slug' => 'Extensions-Mainwp-Agency', |
| 121 |
'callback' => array( |
| 122 |
static::class, |
| 123 |
'render_extensions_groups', |
| 124 |
), |
| 125 |
), |
| 126 |
array( |
| 127 |
'parent_slug' => 'mainwp_tab', |
| 128 |
'page_title' => esc_html__( 'Administrative', 'mainwp' ), |
| 129 |
'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-administrative">' . esc_html__( 'Administrative', 'mainwp' ) . $end_div, |
| 130 |
'capability' => 'read', |
| 131 |
'menu_slug' => 'Extensions-Mainwp-Administrative', |
| 132 |
'callback' => array( |
| 133 |
static::class, |
| 134 |
'render_extensions_groups', |
| 135 |
), |
| 136 |
), |
| 137 |
); |
| 138 |
|
| 139 |
foreach ( $submenu_pages as $item ) { |
| 140 |
add_submenu_page( |
| 141 |
$item['parent_slug'], |
| 142 |
$item['page_title'], |
| 143 |
$item['menu_title'], |
| 144 |
$item['capability'], |
| 145 |
$item['menu_slug'], |
| 146 |
$item['callback'], |
| 147 |
); |
| 148 |
} |
| 149 |
|
| 150 |
$extensions_and_leftmenus = array( |
| 151 |
array( |
| 152 |
'title' => esc_html__( 'Content Operations', 'mainwp' ), |
| 153 |
'parent_key' => 'managesites', |
| 154 |
'slug' => 'Extensions-Mainwp-Content-Operations', |
| 155 |
'href' => 'admin.php?page=Extensions-Mainwp-Content-Operations', |
| 156 |
'leftsub_order' => 8, |
| 157 |
'id' => 'mainwp-content-operations-extensions-category', |
| 158 |
'level' => 1, |
| 159 |
), |
| 160 |
); |
| 161 |
|
| 162 |
$extensions_and_leftmenus[] = array( |
| 163 |
'title' => esc_html__( 'Backups', 'mainwp' ), |
| 164 |
'parent_key' => 'managesites', |
| 165 |
'slug' => 'Extensions-Mainwp-Backups', |
| 166 |
'href' => 'admin.php?page=Extensions-Mainwp-Backups', |
| 167 |
'leftsub_order' => 8.1, |
| 168 |
'id' => 'mainwp-backups-extensions-category', |
| 169 |
'level' => 1, |
| 170 |
); |
| 171 |
|
| 172 |
if ( defined( 'MAINWP_MODULE_API_BACKUPS_ENABLED' ) && MAINWP_MODULE_API_BACKUPS_ENABLED ) { |
| 173 |
$extensions_and_leftmenus[] = array( |
| 174 |
'type' => 'extension', |
| 175 |
'title' => esc_html__( 'API Backups', 'mainwp' ), |
| 176 |
'slug' => 'mainwp-api-backpus', |
| 177 |
'parent_key' => 'Extensions-Mainwp-Backups', |
| 178 |
'ext_page' => 'admin.php?page=ManageApiBackups', |
| 179 |
'leftsub_order_level2' => 1, |
| 180 |
'level' => 2, |
| 181 |
'active_path' => array( 'ManageApiBackups' => 'managesites' ), |
| 182 |
); |
| 183 |
} |
| 184 |
|
| 185 |
$extensions_and_leftmenus[] = array( |
| 186 |
'type' => 'extension', |
| 187 |
'title' => esc_html__( 'BackWPup', 'mainwp' ), |
| 188 |
'slug' => 'mainwp-backwpup-extension/mainwp-backwpup-extension.php', |
| 189 |
'parent_key' => 'Extensions-Mainwp-Backups', |
| 190 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Backwpup-Extension', |
| 191 |
'leftsub_order_level2' => 2, |
| 192 |
'level' => 2, |
| 193 |
'active_path' => array( 'Extensions-Mainwp-Backwpup-Extension' => 'managesites' ), |
| 194 |
); |
| 195 |
|
| 196 |
$extensions_and_leftmenus[] = array( |
| 197 |
'type' => 'extension', |
| 198 |
'title' => esc_html__( 'UpdraftPlus', 'mainwp' ), |
| 199 |
'slug' => 'mainwp-updraftplus-extension/mainwp-updraftplus-extension.php', |
| 200 |
'parent_key' => 'Extensions-Mainwp-Backups', |
| 201 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Updraftplus-Extension', |
| 202 |
'leftsub_order_level2' => 3, |
| 203 |
'level' => 2, |
| 204 |
'active_path' => array( 'Extensions-Mainwp-Updraftplus-Extension' => 'managesites' ), |
| 205 |
); |
| 206 |
|
| 207 |
$extensions_and_leftmenus[] = array( |
| 208 |
'type' => 'extension', |
| 209 |
'title' => esc_html__( 'MainWP Buddy', 'mainwp' ), |
| 210 |
'slug' => 'mainwp-buddy-extension/mainwp-buddy-extension.php', |
| 211 |
'parent_key' => 'Extensions-Mainwp-Backups', |
| 212 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Buddy-Extension', |
| 213 |
'leftsub_order_level2' => 4, |
| 214 |
'level' => 2, |
| 215 |
'active_path' => array( 'Extensions-Mainwp-Buddy-Extension' => 'managesites' ), |
| 216 |
); |
| 217 |
|
| 218 |
$extensions_and_leftmenus[] = array( |
| 219 |
'type' => 'extension', |
| 220 |
'title' => esc_html__( 'Time Capsule', 'mainwp' ), |
| 221 |
'slug' => 'mainwp-timecapsule-extension/mainwp-timecapsule-extension.php', |
| 222 |
'parent_key' => 'Extensions-Mainwp-Backups', |
| 223 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Timecapsule-Extension', |
| 224 |
'leftsub_order_level2' => 5, |
| 225 |
'level' => 2, |
| 226 |
'active_path' => array( 'Extensions-Mainwp-Timecapsule-Extension' => 'managesites' ), |
| 227 |
); |
| 228 |
|
| 229 |
$extensions_and_leftmenus[] = array( |
| 230 |
'type' => 'extension', |
| 231 |
'title' => esc_html__( 'WPvivid Backup', 'mainwp' ), |
| 232 |
'slug' => 'wpvivid-backup-mainwp/wpvivid-backup-mainwp.php', |
| 233 |
'parent_key' => 'Extensions-Mainwp-Backups', |
| 234 |
'ext_page' => 'admin.php?page=Extensions-Wpvivid-Backup-Mainwp', |
| 235 |
'leftsub_order_level2' => 6, |
| 236 |
'level' => 2, |
| 237 |
'active_path' => array( 'Extensions-Wpvivid-Backup-Mainwp' => 'managesites' ), |
| 238 |
); |
| 239 |
|
| 240 |
$extensions_and_leftmenus[] = array( |
| 241 |
'title' => esc_html__( 'Security', 'mainwp' ), |
| 242 |
'parent_key' => 'managesites', |
| 243 |
'slug' => 'Extensions-Mainwp-Security', |
| 244 |
'href' => 'admin.php?page=Extensions-Mainwp-Security', |
| 245 |
'leftsub_order' => 8.2, |
| 246 |
'id' => 'mainwp-security-extensions-category', |
| 247 |
'level' => 1, |
| 248 |
); |
| 249 |
|
| 250 |
$extensions_and_leftmenus[] = array( |
| 251 |
'type' => 'extension', |
| 252 |
'title' => esc_html__( 'Activity Log for MainWP', 'mainwp' ), |
| 253 |
'slug' => 'activity-log-mainwp/activity-log-mainwp.php', |
| 254 |
'parent_key' => 'Extensions-Mainwp-Security', |
| 255 |
'ext_page' => 'admin.php?page=Extensions-Activity-Log-Mainwp', |
| 256 |
'leftsub_order_level2' => 1, |
| 257 |
'level' => 2, |
| 258 |
'active_path' => array( 'Extensions-Activity-Log-Mainwp' => 'managesites' ), |
| 259 |
); |
| 260 |
|
| 261 |
$extensions_and_leftmenus[] = array( |
| 262 |
'type' => 'extension', |
| 263 |
'title' => esc_html__( 'Dashboard Lock', 'mainwp' ), |
| 264 |
'slug' => 'mainwp-clean-and-lock-extension/mainwp-clean-and-lock-extension.php', |
| 265 |
'parent_key' => 'Extensions-Mainwp-Security', |
| 266 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Clean-And-Lock-Extension', |
| 267 |
'leftsub_order_level2' => 2, |
| 268 |
'level' => 2, |
| 269 |
'active_path' => array( 'Extensions-Mainwp-Clean-And-Lock-Extension' => 'managesites' ), |
| 270 |
); |
| 271 |
|
| 272 |
$extensions_and_leftmenus[] = array( |
| 273 |
'type' => 'extension', |
| 274 |
'title' => esc_html__( 'Jetpack Scan', 'mainwp' ), |
| 275 |
'slug' => 'mainwp-jetpack-scan-extension/mainwp-jetpack-scan-extension.php', |
| 276 |
'parent_key' => 'Extensions-Mainwp-Security', |
| 277 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Jetpack-Scan-Extension', |
| 278 |
'leftsub_order_level2' => 3, |
| 279 |
'level' => 2, |
| 280 |
'active_path' => array( 'Extensions-Mainwp-Jetpack-Scan-Extension' => 'managesites' ), |
| 281 |
); |
| 282 |
|
| 283 |
$extensions_and_leftmenus[] = array( |
| 284 |
'type' => 'extension', |
| 285 |
'title' => esc_html__( 'Jetpack Protect', 'mainwp' ), |
| 286 |
'slug' => 'mainwp-jetpack-protect-extension/mainwp-jetpack-protect-extension.php', |
| 287 |
'parent_key' => 'Extensions-Mainwp-Security', |
| 288 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Jetpack-Protect-Extension', |
| 289 |
'leftsub_order_level2' => 4, |
| 290 |
'level' => 2, |
| 291 |
'active_path' => array( 'Extensions-Mainwp-Jetpack-Protect-Extension' => 'managesites' ), |
| 292 |
); |
| 293 |
|
| 294 |
$extensions_and_leftmenus[] = array( |
| 295 |
'type' => 'extension', |
| 296 |
'title' => esc_html__( 'Security Ninja', 'mainwp' ), |
| 297 |
'slug' => 'security-ninja-for-mainwp/security-ninja-mainwp.php', |
| 298 |
'parent_key' => 'Extensions-Mainwp-Security', |
| 299 |
'ext_page' => 'admin.php?page=Extensions-Security-Ninja-For-Mainwp', |
| 300 |
'leftsub_order_level2' => 5, |
| 301 |
'level' => 2, |
| 302 |
'active_path' => array( 'Extensions-Security-Ninja-For-Mainwp' => 'managesites' ), |
| 303 |
); |
| 304 |
|
| 305 |
$extensions_and_leftmenus[] = array( |
| 306 |
'type' => 'extension', |
| 307 |
'title' => esc_html__( 'Sucuri', 'mainwp' ), |
| 308 |
'slug' => 'mainwp-sucuri-extension/mainwp-sucuri-extension.php', |
| 309 |
'parent_key' => 'Extensions-Mainwp-Security', |
| 310 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Sucuri-Extension', |
| 311 |
'leftsub_order_level2' => 6, |
| 312 |
'level' => 2, |
| 313 |
'active_path' => array( 'Extensions-Mainwp-Sucuri-Extension' => 'managesites' ), |
| 314 |
); |
| 315 |
|
| 316 |
$extensions_and_leftmenus[] = array( |
| 317 |
'type' => 'extension', |
| 318 |
'title' => esc_html__( 'Solid Security Integration', 'mainwp' ), |
| 319 |
'slug' => 'mainwp-ithemes-security-extension/mainwp-ithemes-security-extension.php', |
| 320 |
'parent_key' => 'Extensions-Mainwp-Security', |
| 321 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Ithemes-Security-Extension', |
| 322 |
'leftsub_order_level2' => 7, |
| 323 |
'level' => 2, |
| 324 |
'active_path' => array( 'Extensions-Mainwp-Ithemes-Security-Extension' => 'managesites' ), |
| 325 |
); |
| 326 |
|
| 327 |
$extensions_and_leftmenus[] = array( |
| 328 |
'type' => 'extension', |
| 329 |
'title' => esc_html__( 'Virusdie', 'mainwp' ), |
| 330 |
'slug' => 'mainwp-virusdie-extension/mainwp-virusdie-extension.php', |
| 331 |
'parent_key' => 'Extensions-Mainwp-Security', |
| 332 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Virusdie-Extension', |
| 333 |
'leftsub_order_level2' => 8, |
| 334 |
'level' => 2, |
| 335 |
'active_path' => array( 'Extensions-Mainwp-Virusdie-Extension' => 'managesites' ), |
| 336 |
); |
| 337 |
|
| 338 |
$extensions_and_leftmenus[] = array( |
| 339 |
'type' => 'extension', |
| 340 |
'title' => esc_html__( 'Vulnerability Checker', 'mainwp' ), |
| 341 |
'slug' => 'mainwp-vulnerability-checker-extension/mainwp-vulnerability-checker-extension.php', |
| 342 |
'parent_key' => 'Extensions-Mainwp-Security', |
| 343 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Vulnerability-Checker-Extension', |
| 344 |
'leftsub_order_level2' => 9, |
| 345 |
'level' => 2, |
| 346 |
'active_path' => array( 'Extensions-Mainwp-Vulnerability-Checker-Extension' => 'managesites' ), |
| 347 |
); |
| 348 |
|
| 349 |
$extensions_and_leftmenus[] = array( |
| 350 |
'type' => 'extension', |
| 351 |
'title' => esc_html__( 'Wordfence', 'mainwp' ), |
| 352 |
'slug' => 'mainwp-wordfence-extension/mainwp-wordfence-extension.php', |
| 353 |
'parent_key' => 'Extensions-Mainwp-Security', |
| 354 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Wordfence-Extension', |
| 355 |
'leftsub_order_level2' => 10, |
| 356 |
'level' => 2, |
| 357 |
'active_path' => array( 'Extensions-Mainwp-Wordfence-Extension' => 'managesites' ), |
| 358 |
); |
| 359 |
|
| 360 |
$extensions_and_leftmenus[] = array( |
| 361 |
'title' => esc_html__( 'Analytics', 'mainwp' ), |
| 362 |
'parent_key' => 'managesites', |
| 363 |
'slug' => 'Extensions-Mainwp-Analytics', |
| 364 |
'href' => 'admin.php?page=Extensions-Mainwp-Analytics', |
| 365 |
'leftsub_order' => 8.3, |
| 366 |
'id' => 'mainwp-analytics-extensions-category', |
| 367 |
'level' => 1, |
| 368 |
); |
| 369 |
|
| 370 |
$extensions_and_leftmenus[] = array( |
| 371 |
'type' => 'extension', |
| 372 |
'title' => esc_html__( 'Google Analytics', 'mainwp' ), |
| 373 |
'slug' => 'mainwp-google-analytics-extension/mainwp-google-analytics-extension.php', |
| 374 |
'parent_key' => 'Extensions-Mainwp-Analytics', |
| 375 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Google-Analytics-Extension', |
| 376 |
'leftsub_order_level2' => 1, |
| 377 |
'level' => 2, |
| 378 |
'active_path' => array( 'Extensions-Mainwp-Google-Analytics-Extension' => 'managesites' ), |
| 379 |
); |
| 380 |
|
| 381 |
$extensions_and_leftmenus[] = array( |
| 382 |
'type' => 'extension', |
| 383 |
'title' => esc_html__( 'Fathom', 'mainwp' ), |
| 384 |
'slug' => 'mainwp-fathom-extension/mainwp-fathom-extension.php', |
| 385 |
'parent_key' => 'Extensions-Mainwp-Analytics', |
| 386 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Fathom-Extension', |
| 387 |
'leftsub_order_level2' => 2, |
| 388 |
'level' => 2, |
| 389 |
'active_path' => array( 'Extensions-Mainwp-Fathom-Extension' => 'managesites' ), |
| 390 |
); |
| 391 |
|
| 392 |
$extensions_and_leftmenus[] = array( |
| 393 |
'type' => 'extension', |
| 394 |
'title' => esc_html__( 'Matomo', 'mainwp' ), |
| 395 |
'slug' => 'mainwp-piwik-extension/mainwp-piwik-extension.php', |
| 396 |
'parent_key' => 'Extensions-Mainwp-Analytics', |
| 397 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Piwik-Extension', |
| 398 |
'leftsub_order_level2' => 3, |
| 399 |
'level' => 2, |
| 400 |
'active_path' => array( 'Extensions-Mainwp-Piwik-Extension' => 'managesites' ), |
| 401 |
); |
| 402 |
|
| 403 |
$extensions_and_leftmenus[] = array( |
| 404 |
'title' => esc_html__( 'Monitoring', 'mainwp' ), |
| 405 |
'parent_key' => 'managesites', |
| 406 |
'slug' => 'Extensions-Mainwp-Monitoring', |
| 407 |
'href' => 'admin.php?page=Extensions-Mainwp-Monitoring', |
| 408 |
'leftsub_order' => 8.4, |
| 409 |
'id' => 'mainwp-monitoring-extensions-category', |
| 410 |
'level' => 1, |
| 411 |
); |
| 412 |
|
| 413 |
$extensions_and_leftmenus[] = array( |
| 414 |
'title' => esc_html__( 'Monitoring', 'mainwp' ), |
| 415 |
'parent_key' => 'Extensions-Mainwp-Monitoring', |
| 416 |
'slug' => 'MonitoringSites', |
| 417 |
'href' => 'admin.php?page=MonitoringSites', |
| 418 |
'leftsub_order_level2' => 0.5, |
| 419 |
'level' => 2, |
| 420 |
); |
| 421 |
|
| 422 |
$extensions_and_leftmenus[] = array( |
| 423 |
'type' => 'extension', |
| 424 |
'title' => esc_html__( 'Advanced Uptime Monitor', 'mainwp' ), |
| 425 |
'slug' => 'advanced-uptime-monitor-extension/advanced-uptime-monitor-extension.php', |
| 426 |
'parent_key' => 'Extensions-Mainwp-Monitoring', |
| 427 |
'ext_page' => 'admin.php?page=Extensions-Advanced-Uptime-Monitor-Extension', |
| 428 |
'leftsub_order_level2' => 1, |
| 429 |
'level' => 2, |
| 430 |
'active_path' => array( 'Extensions-Advanced-Uptime-Monitor-Extension' => 'managesites' ), |
| 431 |
); |
| 432 |
|
| 433 |
$extensions_and_leftmenus[] = array( |
| 434 |
'type' => 'extension', |
| 435 |
'title' => esc_html__( 'SSL Monitor', 'mainwp' ), |
| 436 |
'slug' => 'mainwp-ssl-monitor-extension/mainwp-ssl-monitor-extension.php', |
| 437 |
'parent_key' => 'Extensions-Mainwp-Monitoring', |
| 438 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Ssl-Monitor-Extension', |
| 439 |
'leftsub_order_level2' => 2, |
| 440 |
'level' => 2, |
| 441 |
'active_path' => array( 'Extensions-Mainwp-Ssl-Monitor-Extension' => 'managesites' ), |
| 442 |
); |
| 443 |
|
| 444 |
$extensions_and_leftmenus[] = array( |
| 445 |
'type' => 'extension', |
| 446 |
'title' => esc_html__( 'Domain Monitor', 'mainwp' ), |
| 447 |
'slug' => 'mainwp-domain-monitor-extension/mainwp-domain-monitor-extension.php', |
| 448 |
'parent_key' => 'Extensions-Mainwp-Monitoring', |
| 449 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Domain-Monitor-Extension', |
| 450 |
'leftsub_order_level2' => 3, |
| 451 |
'level' => 2, |
| 452 |
'active_path' => array( 'Extensions-Mainwp-Domain-Monitor-Extension' => 'managesites' ), |
| 453 |
); |
| 454 |
|
| 455 |
$extensions_and_leftmenus[] = array( |
| 456 |
'type' => 'extension', |
| 457 |
'title' => esc_html__( 'Lighthouse', 'mainwp' ), |
| 458 |
'slug' => 'mainwp-lighthouse-extension/mainwp-lighthouse-extension.php', |
| 459 |
'parent_key' => 'Extensions-Mainwp-Monitoring', |
| 460 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Lighthouse-Extension', |
| 461 |
'leftsub_order_level2' => 4, |
| 462 |
'level' => 2, |
| 463 |
'active_path' => array( 'Extensions-Mainwp-Lighthouse-Extension' => 'managesites' ), |
| 464 |
); |
| 465 |
|
| 466 |
$extensions_and_leftmenus[] = array( |
| 467 |
'type' => 'extension', |
| 468 |
'title' => esc_html__( 'WooCommerce Status', 'mainwp' ), |
| 469 |
'slug' => 'mainwp-woocommerce-status-extension/mainwp-woocommerce-status-extension.php', |
| 470 |
'parent_key' => 'Extensions-Mainwp-Monitoring', |
| 471 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Woocommerce-Status-Extension', |
| 472 |
'leftsub_order_level2' => 2, |
| 473 |
'level' => 2, |
| 474 |
'active_path' => array( 'Extensions-Mainwp-Woocommerce-Status-Extension' => 'managesites' ), |
| 475 |
); |
| 476 |
|
| 477 |
$extensions_and_leftmenus[] = array( |
| 478 |
'title' => esc_html__( 'Agency', 'mainwp' ), |
| 479 |
'parent_key' => 'managesites', |
| 480 |
'slug' => 'Extensions-Mainwp-Agency', |
| 481 |
'href' => 'admin.php?page=Extensions-Mainwp-Agency', |
| 482 |
'leftsub_order' => 8.4, |
| 483 |
'id' => 'mainwp-agency-extensions-category', |
| 484 |
'level' => 1, |
| 485 |
); |
| 486 |
|
| 487 |
$extensions_and_leftmenus[] = array( |
| 488 |
'type' => 'extension', |
| 489 |
'title' => esc_html__( 'White Label', 'mainwp' ), |
| 490 |
'slug' => 'mainwp-branding-extension/mainwp-branding-extension.php', |
| 491 |
'parent_key' => 'Extensions-Mainwp-Agency', |
| 492 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Branding-Extension', |
| 493 |
'leftsub_order_level2' => 1, |
| 494 |
'level' => 2, |
| 495 |
'active_path' => array( 'Extensions-Mainwp-Branding-Extension' => 'managesites' ), |
| 496 |
); |
| 497 |
|
| 498 |
$extensions_and_leftmenus[] = array( |
| 499 |
'type' => 'extension', |
| 500 |
'title' => esc_html__( 'Team Control', 'mainwp' ), |
| 501 |
'slug' => 'mainwp-team-control/mainwp-team-control.php', |
| 502 |
'parent_key' => 'Extensions-Mainwp-Agency', |
| 503 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Team-Control', |
| 504 |
'leftsub_order_level2' => 2, |
| 505 |
'level' => 2, |
| 506 |
'active_path' => array( 'Extensions-Mainwp-Team-Control' => 'managesites' ), |
| 507 |
); |
| 508 |
|
| 509 |
$extensions_and_leftmenus[] = array( |
| 510 |
'title' => esc_html__( 'Administrative', 'mainwp' ), |
| 511 |
'parent_key' => 'managesites', |
| 512 |
'slug' => 'Extensions-Mainwp-Administrative', |
| 513 |
'href' => 'admin.php?page=Extensions-Mainwp-Administrative', |
| 514 |
'leftsub_order' => 8.5, |
| 515 |
'id' => 'mainwp-administrative-extensions-category', |
| 516 |
'level' => 1, |
| 517 |
); |
| 518 |
|
| 519 |
$extensions_and_leftmenus[] = array( |
| 520 |
'type' => 'extension', |
| 521 |
'title' => esc_html__( 'Atarim', 'mainwp' ), |
| 522 |
'slug' => 'mainwp-atarim-extension/mainwp-atarim-extension.php', |
| 523 |
'parent_key' => 'Extensions-Mainwp-Administrative', |
| 524 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Atarim-Extension', |
| 525 |
'leftsub_order_level2' => 1, |
| 526 |
'level' => 2, |
| 527 |
'active_path' => array( 'Extensions-Mainwp-Atarim-Extension' => 'managesites' ), |
| 528 |
); |
| 529 |
|
| 530 |
$extensions_and_leftmenus[] = array( |
| 531 |
'type' => 'extension', |
| 532 |
'title' => esc_html__( 'Bulk Settings Manager', 'mainwp' ), |
| 533 |
'slug' => 'mainwp-bulk-settings-manager/mainwp-bulk-settings-manager.php', |
| 534 |
'parent_key' => 'Extensions-Mainwp-Administrative', |
| 535 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Bulk-Settings-Manager', |
| 536 |
'leftsub_order_level2' => 2, |
| 537 |
'level' => 2, |
| 538 |
'active_path' => array( 'Extensions-Mainwp-Bulk-Settings-Manager' => 'managesites' ), |
| 539 |
); |
| 540 |
|
| 541 |
$extensions_and_leftmenus[] = array( |
| 542 |
'type' => 'extension', |
| 543 |
'title' => esc_html__( 'Code Snippets', 'mainwp' ), |
| 544 |
'slug' => 'mainwp-code-snippets-extension/mainwp-code-snippets-extension.php', |
| 545 |
'parent_key' => 'Extensions-Mainwp-Administrative', |
| 546 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Code-Snippets-Extension', |
| 547 |
'leftsub_order_level2' => 3, |
| 548 |
'level' => 2, |
| 549 |
'active_path' => array( 'Extensions-Mainwp-Code-Snippets-Extension' => 'managesites' ), |
| 550 |
); |
| 551 |
$extensions_and_leftmenus[] = array( |
| 552 |
'type' => 'extension', |
| 553 |
'title' => esc_html__( 'Custom Dashboard', 'mainwp' ), |
| 554 |
'slug' => 'mainwp-custom-dashboard-extension/mainwp-custom-dashboard-extension.php', |
| 555 |
'parent_key' => 'Extensions-Mainwp-Administrative', |
| 556 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Custom-Dashboard-Extension', |
| 557 |
'leftsub_order_level2' => 4, |
| 558 |
'level' => 2, |
| 559 |
'active_path' => array( 'Extensions-Mainwp-Custom-Dashboard-Extension' => 'managesites' ), |
| 560 |
); |
| 561 |
|
| 562 |
$extensions_and_leftmenus[] = array( |
| 563 |
'type' => 'extension', |
| 564 |
'title' => esc_html__( 'Custom Post Type', 'mainwp' ), |
| 565 |
'slug' => 'mainwp-custom-post-types/mainwp-custom-post-types.php', |
| 566 |
'parent_key' => 'Extensions-Mainwp-Administrative', |
| 567 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Custom-Post-Types', |
| 568 |
'leftsub_order_level2' => 5, |
| 569 |
'level' => 2, |
| 570 |
'active_path' => array( 'Extensions-Mainwp-Custom-Post-Types' => 'managesites' ), |
| 571 |
); |
| 572 |
|
| 573 |
$extensions_and_leftmenus[] = array( |
| 574 |
'type' => 'extension', |
| 575 |
'title' => esc_html__( 'File Uploader', 'mainwp' ), |
| 576 |
'slug' => 'mainwp-file-uploader-extension/mainwp-file-uploader-extension.php', |
| 577 |
'parent_key' => 'Extensions-Mainwp-Administrative', |
| 578 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-File-Uploader-Extension', |
| 579 |
'leftsub_order_level2' => 6, |
| 580 |
'level' => 2, |
| 581 |
'active_path' => array( 'Extensions-Mainwp-File-Uploader-Extension' => 'managesites' ), |
| 582 |
); |
| 583 |
|
| 584 |
$extensions_and_leftmenus[] = array( |
| 585 |
'type' => 'extension', |
| 586 |
'title' => esc_html__( 'Pressable', 'mainwp' ), |
| 587 |
'slug' => 'mainwp-pressable-extension/mainwp-pressable-extension.php', |
| 588 |
'parent_key' => 'Extensions-Mainwp-Administrative', |
| 589 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Pressable-Extension', |
| 590 |
'leftsub_order_level2' => 7, |
| 591 |
'level' => 2, |
| 592 |
'active_path' => array( 'Extensions-Mainwp-Pressable-Extension' => 'managesites' ), |
| 593 |
); |
| 594 |
|
| 595 |
$extensions_and_leftmenus[] = array( |
| 596 |
'type' => 'extension', |
| 597 |
'title' => esc_html__( 'Staging', 'mainwp' ), |
| 598 |
'slug' => 'mainwp-staging-extension/mainwp-staging-extension.php', |
| 599 |
'parent_key' => 'Extensions-Mainwp-Administrative', |
| 600 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Staging-Extension', |
| 601 |
'leftsub_order_level2' => 8, |
| 602 |
'level' => 2, |
| 603 |
'active_path' => array( 'Extensions-Mainwp-Staging-Extension' => 'managesites' ), |
| 604 |
); |
| 605 |
|
| 606 |
$extensions_and_leftmenus[] = array( |
| 607 |
'type' => 'extension', |
| 608 |
'title' => esc_html__( 'URL Extractor', 'mainwp' ), |
| 609 |
'slug' => 'mainwp-url-extractor-extension/mainwp-url-extractor-extension.php', |
| 610 |
'parent_key' => 'Extensions-Mainwp-Administrative', |
| 611 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Url-Extractor-Extension', |
| 612 |
'leftsub_order_level2' => 9, |
| 613 |
'level' => 2, |
| 614 |
'active_path' => array( 'Extensions-Mainwp-Url-Extractor-Extension' => 'managesites' ), |
| 615 |
); |
| 616 |
|
| 617 |
$extensions_and_leftmenus[] = array( |
| 618 |
'type' => 'extension', |
| 619 |
'title' => esc_html__( 'WooCommerce Shortcuts', 'mainwp' ), |
| 620 |
'slug' => 'mainwp-woocommerce-shortcuts-extension/mainwp-woocommerce-shortcuts-extension.php', |
| 621 |
'parent_key' => 'Extensions-Mainwp-Administrative', |
| 622 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Woocommerce-Shortcuts-Extension', |
| 623 |
'leftsub_order_level2' => 1, |
| 624 |
'level' => 2, |
| 625 |
'active_path' => array( 'Extensions-Mainwp-Woocommerce-Shortcuts-Extension' => 'managesites' ), |
| 626 |
); |
| 627 |
|
| 628 |
$extensions_and_leftmenus[] = array( |
| 629 |
'title' => esc_html__( 'Performance', 'mainwp' ), |
| 630 |
'parent_key' => 'managesites', |
| 631 |
'slug' => 'Extensions-Mainwp-Performance', |
| 632 |
'href' => 'admin.php?page=Extensions-Mainwp-Performance', |
| 633 |
'leftsub_order' => 8.6, |
| 634 |
'id' => 'mainwp-performance-extensions-category', |
| 635 |
'level' => 1, |
| 636 |
); |
| 637 |
|
| 638 |
$extensions_and_leftmenus[] = array( |
| 639 |
'type' => 'extension', |
| 640 |
'title' => esc_html__( 'Cache Control', 'mainwp' ), |
| 641 |
'slug' => 'mainwp-cache-control-extension/mainwp-cache-control-extension.php', |
| 642 |
'parent_key' => 'Extensions-Mainwp-Performance', |
| 643 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Cache-Control-Extension', |
| 644 |
'leftsub_order_level2' => 1, |
| 645 |
'level' => 2, |
| 646 |
'active_path' => array( 'Extensions-Mainwp-Cache-Control-Extension' => 'managesites' ), |
| 647 |
); |
| 648 |
|
| 649 |
$extensions_and_leftmenus[] = array( |
| 650 |
'type' => 'extension', |
| 651 |
'title' => esc_html__( 'Maintenance', 'mainwp' ), |
| 652 |
'slug' => 'mainwp-maintenance-extension/mainwp-maintenance-extension.php', |
| 653 |
'parent_key' => 'Extensions-Mainwp-Performance', |
| 654 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Maintenance-Extension', |
| 655 |
'leftsub_order_level2' => 2, |
| 656 |
'level' => 2, |
| 657 |
'active_path' => array( 'Extensions-Mainwp-Maintenance-Extension' => 'managesites' ), |
| 658 |
); |
| 659 |
|
| 660 |
$extensions_and_leftmenus[] = array( |
| 661 |
'type' => 'extension', |
| 662 |
'title' => esc_html__( 'Rocket', 'mainwp' ), |
| 663 |
'slug' => 'mainwp-rocket-extension/mainwp-rocket-extension.php', |
| 664 |
'parent_key' => 'Extensions-Mainwp-Performance', |
| 665 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Rocket-Extension', |
| 666 |
'leftsub_order_level2' => 3, |
| 667 |
'level' => 2, |
| 668 |
'active_path' => array( 'Extensions-Mainwp-Rocket-Extension' => 'managesites' ), |
| 669 |
); |
| 670 |
|
| 671 |
$extensions_and_leftmenus[] = array( |
| 672 |
'type' => 'extension', |
| 673 |
'title' => esc_html__( 'WP Compress', 'mainwp' ), |
| 674 |
'slug' => 'wp-compress-mainwp/wp-compress-main-wp.php', |
| 675 |
'parent_key' => 'Extensions-Mainwp-Performance', |
| 676 |
'ext_page' => 'admin.php?page=Extensions-Wp-Compress-Mainwp', |
| 677 |
'leftsub_order_level2' => 4, |
| 678 |
'level' => 2, |
| 679 |
'active_path' => array( 'Extensions-Wp-Compress-Mainwp' => 'managesites' ), |
| 680 |
); |
| 681 |
|
| 682 |
$extensions_and_leftmenus[] = array( |
| 683 |
'type' => 'extension', |
| 684 |
'title' => esc_html__( 'Comments', 'mainwp' ), |
| 685 |
'slug' => 'mainwp-comments-extension/mainwp-comments-extension.php', |
| 686 |
'parent_key' => 'Extensions-Mainwp-Content-Operations', |
| 687 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Comments-Extension', |
| 688 |
'leftsub_order_level2' => 2.1, |
| 689 |
'level' => 2, |
| 690 |
'active_path' => array( 'Extensions-Mainwp-Comments-Extension' => 'managesites' ), |
| 691 |
); |
| 692 |
|
| 693 |
$extensions_and_leftmenus[] = array( |
| 694 |
'type' => 'extension', |
| 695 |
'title' => esc_html__( 'Clone', 'mainwp' ), |
| 696 |
'slug' => 'mainwp-clone-extension/mainwp-clone-extension.php', |
| 697 |
'parent_key' => 'managesites', |
| 698 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Clone-Extension', |
| 699 |
'leftsub_order_level2' => 5, |
| 700 |
'level' => 2, |
| 701 |
'active_path' => array( 'Extensions-Mainwp-Clone-Extension' => 'managesites' ), |
| 702 |
); |
| 703 |
|
| 704 |
$extensions_and_leftmenus[] = array( |
| 705 |
'type' => 'extension', |
| 706 |
'title' => esc_html__( 'Article Uploader', 'mainwp' ), |
| 707 |
'slug' => 'mainwp-article-uploader-extension/mainwp-article-uploader-extension.php', |
| 708 |
'parent_key' => 'Extensions-Mainwp-Content-Operations', |
| 709 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Article-Uploader-Extension', |
| 710 |
'leftsub_order_level2' => 3, |
| 711 |
'level' => 2, |
| 712 |
'active_path' => array( 'Extensions-Mainwp-Article-Uploader-Extension' => 'managesites' ), |
| 713 |
); |
| 714 |
|
| 715 |
$extensions_and_leftmenus[] = array( |
| 716 |
'type' => 'extension', |
| 717 |
'title' => esc_html__( 'Manage Boilerplates', 'mainwp' ), |
| 718 |
'slug' => 'boilerplate-extension/boilerplate-extension.php', |
| 719 |
'parent_key' => 'Extensions-Mainwp-Content-Operations', |
| 720 |
'ext_page' => 'admin.php?page=Extensions-Boilerplate-Extension', |
| 721 |
'leftsub_order_level2' => 2, |
| 722 |
'level' => 2, |
| 723 |
'active_path' => array( 'Extensions-Boilerplate-Extension' => 'managesites' ), |
| 724 |
); |
| 725 |
|
| 726 |
$extensions_and_leftmenus[] = array( |
| 727 |
'type' => 'extension', |
| 728 |
'title' => esc_html__( 'Post Dripper', 'mainwp' ), |
| 729 |
'slug' => 'mainwp-post-dripper-extension/mainwp-post-dripper-extension.php', |
| 730 |
'parent_key' => 'Extensions-Mainwp-Content-Operations', |
| 731 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Post-Dripper-Extension', |
| 732 |
'leftsub_order_level2' => 4, |
| 733 |
'level' => 2, |
| 734 |
); |
| 735 |
|
| 736 |
$extensions_and_leftmenus[] = array( |
| 737 |
'type' => 'extension', |
| 738 |
'title' => esc_html__( 'Post Plus', 'mainwp' ), |
| 739 |
'slug' => 'mainwp-post-plus-extension/mainwp-post-plus-extension.php', |
| 740 |
'parent_key' => 'Extensions-Mainwp-Content-Operations', |
| 741 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Post-Plus-Extension', |
| 742 |
'leftsub_order_level2' => 5, |
| 743 |
'level' => 2, |
| 744 |
); |
| 745 |
|
| 746 |
$extensions_and_leftmenus[] = array( |
| 747 |
'type' => 'extension', |
| 748 |
'title' => esc_html__( 'Pro Reports', 'mainwp' ), |
| 749 |
'slug' => 'mainwp-pro-reports-extension/mainwp-pro-reports-extension.php', |
| 750 |
'parent_key' => 'ManageClients', |
| 751 |
'ext_page' => 'admin.php?page=Extensions-Mainwp-Pro-Reports-Extension', |
| 752 |
'leftsub_order_level2' => 4, |
| 753 |
'level' => 2, |
| 754 |
'active_path' => array( 'Extensions-Mainwp-Pro-Reports-Extension' => 'ManageClients' ), |
| 755 |
); |
| 756 |
|
| 757 |
if ( defined( 'MAINWP_MODULE_COST_TRACKER_ENABLED' ) && MAINWP_MODULE_COST_TRACKER_ENABLED ) { |
| 758 |
$extensions_and_leftmenus[] = array( |
| 759 |
'type' => 'extension', |
| 760 |
'title' => esc_html__( 'Cost Tracker Assistant', 'mainwp' ), |
| 761 |
'slug' => 'mainwp-cost-tracker-assistant-extension/mainwp-cost-tracker-assistant-extension.php', |
| 762 |
'parent_key' => 'ManageCostTracker', |
| 763 |
'ext_page' => 'admin.php?page=ManageCostTracker', |
| 764 |
'leftsub_order_level2' => 4, |
| 765 |
'level' => 2, |
| 766 |
); |
| 767 |
} |
| 768 |
|
| 769 |
$extensions_and_leftmenus[] = array( |
| 770 |
'type' => 'extension', |
| 771 |
'title' => esc_html__( 'WordPress SEO', 'mainwp' ), |
| 772 |
'slug' => 'wordpress-seo-extension/wordpress-seo-extension.php', |
| 773 |
'parent_key' => 'Extensions-Mainwp-Content-Operations', |
| 774 |
'ext_page' => 'admin.php?page=Extensions-Wordpress-Seo-Extension', |
| 775 |
'leftsub_order_level2' => 6, |
| 776 |
'level' => 2, |
| 777 |
); |
| 778 |
|
| 779 |
$extensions_and_leftmenus[] = array( |
| 780 |
'type' => 'extension', |
| 781 |
'title' => esc_html__( 'SEOPress', 'mainwp' ), |
| 782 |
'slug' => 'seopress-for-mainwp/seopress-for-mainwp.php', |
| 783 |
'parent_key' => 'Extensions-Mainwp-Content-Operations', |
| 784 |
'ext_page' => 'admin.php?page=Extensions-Seopress-For-Mainwp', |
| 785 |
'leftsub_order_level2' => 6, |
| 786 |
'level' => 2, |
| 787 |
); |
| 788 |
|
| 789 |
$extensions_and_leftmenus = apply_filters( 'mainwp_menu_extensions_left_menu', $extensions_and_leftmenus ); |
| 790 |
|
| 791 |
foreach ( $extensions_and_leftmenus as $item ) { |
| 792 |
if ( isset( $item['type'] ) && 'extension' === $item['type'] ) { |
| 793 |
static::add_extension_menu( $item ); |
| 794 |
} else { |
| 795 |
$level = isset( $item['level'] ) ? intval( $item['level'] ) : 1; |
| 796 |
MainWP_Menu::add_left_menu( $item, $level ); |
| 797 |
} |
| 798 |
} |
| 799 |
// @NO_SONAR_END@ . |
| 800 |
global $_mainwp_menu_active_slugs; |
| 801 |
|
| 802 |
$active_slugs = array( |
| 803 |
'Extensions-Mainwp-Content-Operations' => 'Extensions-Mainwp-Content-Operations', |
| 804 |
'Extensions-Mainwp-Backups' => 'Extensions-Mainwp-Backups', |
| 805 |
'Extensions-Mainwp-Security' => 'Extensions-Mainwp-Security', |
| 806 |
'Extensions-Mainwp-Analytics' => 'Extensions-Mainwp-Analytics', |
| 807 |
'Extensions-Mainwp-Monitoring' => 'Extensions-Mainwp-Monitoring', |
| 808 |
'Extensions-Mainwp-Agency' => 'Extensions-Mainwp-Agency', |
| 809 |
'Extensions-Mainwp-Administrative' => 'Extensions-Mainwp-Administrative', |
| 810 |
'Extensions-Mainwp-Performance' => 'Extensions-Mainwp-Performance', |
| 811 |
); |
| 812 |
// to fix activate menus state. |
| 813 |
foreach ( $active_slugs as $item => $act_slug ) { |
| 814 |
MainWP_Menu::set_menu_active_slugs( $item, $act_slug ); |
| 815 |
} |
| 816 |
} |
| 817 |
|
| 818 |
/** |
| 819 |
* Method render_extensions_groups() |
| 820 |
* |
| 821 |
* @param string $plugin_slug The extension's slug. |
| 822 |
* |
| 823 |
* @return bool file existed. |
| 824 |
*/ |
| 825 |
public static function extension_is_installed( $plugin_slug ) { |
| 826 |
return file_exists( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $plugin_slug ) ? true : false; |
| 827 |
} |
| 828 |
|
| 829 |
/** |
| 830 |
* Method add_extension_menu() |
| 831 |
* |
| 832 |
* @param array $params The extension's params. |
| 833 |
*/ |
| 834 |
public static function add_extension_menu( $params = array() ) { |
| 835 |
|
| 836 |
$title = $params['title']; |
| 837 |
$ext_page = $params['ext_page']; |
| 838 |
$plugin_slug = $params['slug']; |
| 839 |
$parent_key = $params['parent_key']; |
| 840 |
$level = $params['level']; |
| 841 |
$nosubmenu = isset( $params['nosubmenu'] ) && $params['nosubmenu'] ? true : false; |
| 842 |
$leftsub_order = isset( $params['leftsub_order'] ) ? $params['leftsub_order'] : false; |
| 843 |
$leftsub_order_level2 = isset( $params['leftsub_order_level2'] ) ? $params['leftsub_order_level2'] : false; |
| 844 |
|
| 845 |
if ( 'mainwp-api-backpus' === $plugin_slug ) { |
| 846 |
$activated_ext = true; |
| 847 |
$href = $ext_page; |
| 848 |
} else { |
| 849 |
$activated_ext = is_plugin_active( $plugin_slug ) ? true : false; |
| 850 |
|
| 851 |
if ( $activated_ext ) { |
| 852 |
$href = $ext_page; |
| 853 |
} else { |
| 854 |
$href = '#'; |
| 855 |
//phpcs:disable Squiz.PHP.CommentedOutCode.Found |
| 856 |
// $href = 'admin.php?page=Extensions'; |
| 857 |
// if ( ! static::extension_is_installed( $plugin_slug ) ) { |
| 858 |
// $href .= '&message=install-ext-' . dirname( $plugin_slug ); |
| 859 |
// } |
| 860 |
//phpcs:enable |
| 861 |
} |
| 862 |
} |
| 863 |
|
| 864 |
$menu_params = array( |
| 865 |
'title' => $title, |
| 866 |
'parent_key' => $parent_key, |
| 867 |
'href' => $href, |
| 868 |
'nosubmenu' => $nosubmenu, |
| 869 |
'ext_status' => $activated_ext ? 'activated' : 'inactive', |
| 870 |
); |
| 871 |
|
| 872 |
if ( false !== $leftsub_order ) { |
| 873 |
$menu_params['leftsub_order'] = $leftsub_order; |
| 874 |
} |
| 875 |
|
| 876 |
if ( false !== $leftsub_order_level2 ) { |
| 877 |
$menu_params['leftsub_order_level2'] = $leftsub_order_level2; |
| 878 |
} |
| 879 |
|
| 880 |
if ( isset( $params['active_path'] ) ) { |
| 881 |
$menu_params['active_path'] = $params['active_path']; |
| 882 |
} |
| 883 |
MainWP_Menu::add_left_menu( $menu_params, $level ); |
| 884 |
} |
| 885 |
|
| 886 |
/** |
| 887 |
* Method render_extensions_groups() |
| 888 |
* |
| 889 |
* @return void |
| 890 |
*/ |
| 891 |
public static function render_extensions_groups() { //phpcs:ignore -- NOSONAR - complex method. |
| 892 |
|
| 893 |
$get_ext_group = array(); |
| 894 |
|
| 895 |
//phpcs:disable WordPress.Security.NonceVerification.Recommended |
| 896 |
if ( isset( $_GET['page'] ) ) { |
| 897 |
if ( 'Extensions-Mainwp-Backups' === $_GET['page'] ) { |
| 898 |
$get_ext_group[] = 'backup'; |
| 899 |
} elseif ( 'Extensions-Mainwp-Security' === $_GET['page'] ) { |
| 900 |
$get_ext_group[] = 'security'; |
| 901 |
} elseif ( 'Extensions-Mainwp-Analytics' === $_GET['page'] ) { |
| 902 |
$get_ext_group[] = 'visitor'; |
| 903 |
} elseif ( 'Extensions-Mainwp-Monitoring' === $_GET['page'] ) { |
| 904 |
$get_ext_group[] = 'monitoring'; |
| 905 |
} elseif ( 'Extensions-Mainwp-Agency' === $_GET['page'] ) { |
| 906 |
$get_ext_group[] = 'agency'; |
| 907 |
} elseif ( 'Extensions-Mainwp-Administrative' === $_GET['page'] ) { |
| 908 |
$get_ext_group[] = 'admin'; |
| 909 |
} elseif ( 'Extensions-Mainwp-Performance' === $_GET['page'] ) { |
| 910 |
$get_ext_group[] = 'performance'; |
| 911 |
} elseif ( 'Extensions-Mainwp-Content-Operations' === $_GET['page'] ) { |
| 912 |
$get_ext_group[] = 'content'; |
| 913 |
} |
| 914 |
} |
| 915 |
//phpcs:enable |
| 916 |
|
| 917 |
if ( empty( $get_ext_group ) ) { |
| 918 |
return; |
| 919 |
} |
| 920 |
|
| 921 |
$extension_update = get_site_transient( 'update_plugins' ); |
| 922 |
|
| 923 |
$extensions = MainWP_Extensions_Handler::get_extensions(); |
| 924 |
|
| 925 |
$group_available_extensions = MainWP_Extensions_View::get_available_extensions( false, $get_ext_group ); |
| 926 |
|
| 927 |
$extensions_disabled = MainWP_Extensions_Handler::get_extensions_disabled(); |
| 928 |
|
| 929 |
$extensions_not_installed = MainWP_Extensions_Handler::get_extensions_not_installed(); |
| 930 |
|
| 931 |
$excluded_extensions = array(); |
| 932 |
|
| 933 |
do_action( 'mainwp_pageheader_extensions' ); |
| 934 |
?> |
| 935 |
<div class="ui segment"> |
| 936 |
<div class="ui three mainwp-cards cards" id="mainwp-extensions-list"> |
| 937 |
<?php if ( isset( $_GET['page'] ) && 'Extensions-Mainwp-Backups' === $_GET['page'] ) : //phpcs:ignore WordPress.Security.NonceVerification.Recommended ?> |
| 938 |
<div class="ui extension card"> |
| 939 |
<div class="content"> |
| 940 |
<img class="right floated mini ui image" alt="<?php esc_attr_e( 'Add-on icon placeholder', 'mainwp' ); ?>" src="<?php echo esc_url( MAINWP_PLUGIN_URL ) . 'assets/images/extensions/placeholder.png'; ?>"> |
| 941 |
<div class="header"><a href="admin.php?page=ManageApiBackups"><?php esc_html_e( 'API Backpus', 'mainwp' ); ?></a></div> |
| 942 |
<a href="admin.php?page=ManageApiBackups" class="ui green ribbon label"><?php echo esc_html__( ' MainWP core feature', 'mainwp' ); ?></a> |
| 943 |
<div class="description"><?php esc_html_e( 'Manage host-side backups via REST API. Currently, the supported providers are Cloudways, GridPane, Digital Ocean, Linode, Vultr and cPanel.', 'mainwp' ); ?></div> |
| 944 |
</div> |
| 945 |
</div> |
| 946 |
<?php endif; ?> |
| 947 |
<?php if ( isset( $_GET['page'] ) && 'Extensions-Mainwp-Monitoring' === $_GET['page'] ) : //phpcs:ignore WordPress.Security.NonceVerification.Recommended ?> |
| 948 |
<div class="ui extension card"> |
| 949 |
<div class="content"> |
| 950 |
<img class="right floated mini ui image" alt="<?php esc_attr_e( 'Add-on icon placeholder', 'mainwp' ); ?>" src="<?php echo esc_url( MAINWP_PLUGIN_URL ) . 'assets/images/extensions/placeholder.png'; ?>"> |
| 951 |
<div class="header"><a href="admin.php?page=MonitoringSites"><?php esc_html_e( 'Uptime Monitoring', 'mainwp' ); ?></a></div> |
| 952 |
<a href="admin.php?page=MonitoringSites" class="ui green ribbon label"><?php echo esc_html__( 'MainWP core feature', 'mainwp' ); ?></a> |
| 953 |
<div class="description"><?php esc_html_e( 'The MainWP Uptime Monitoring function operates independently of third-party services, providing a straightforward and no-cost option for uptime monitoring across all your managed sites.', 'mainwp' ); ?></div> |
| 954 |
</div> |
| 955 |
</div> |
| 956 |
<?php endif; ?> |
| 957 |
|
| 958 |
<?php if ( isset( $extensions ) && is_array( $extensions ) ) { ?> |
| 959 |
<?php foreach ( $extensions as $extension ) { ?> |
| 960 |
<?php |
| 961 |
if ( ! \mainwp_current_user_can( 'extension', dirname( $extension['slug'] ) ) ) { |
| 962 |
continue; |
| 963 |
} |
| 964 |
|
| 965 |
if ( ! isset( $group_available_extensions[ dirname( $extension['slug'] ) ] ) ) { |
| 966 |
continue; |
| 967 |
} |
| 968 |
|
| 969 |
if ( in_array( dirname( $extension['slug'] ), $excluded_extensions ) ) { |
| 970 |
continue; |
| 971 |
} |
| 972 |
|
| 973 |
$extensions_data = isset( $group_available_extensions[ dirname( $extension['slug'] ) ] ) ? $group_available_extensions[ dirname( $extension['slug'] ) ] : array(); |
| 974 |
|
| 975 |
if ( isset( $extensions_data['img'] ) && ! empty( $extensions_data['img'] ) ) { |
| 976 |
$img_url = $extensions_data['img']; |
| 977 |
} elseif ( isset( $extension['icon'] ) && ! empty( $extension['icon'] ) ) { |
| 978 |
$img_url = $extension['icon']; |
| 979 |
} elseif ( isset( $extension['iconURI'] ) && '' !== $extension['iconURI'] ) { |
| 980 |
$img_url = MainWP_Utility::remove_http_prefix( $extension['iconURI'] ); |
| 981 |
} else { |
| 982 |
$img_url = MAINWP_PLUGIN_URL . 'assets/images/extensions/placeholder.png'; |
| 983 |
} |
| 984 |
|
| 985 |
MainWP_Extensions_View::render_extension_card( $extension, $extension_update, $img_url, false, true ); |
| 986 |
?> |
| 987 |
|
| 988 |
<?php } ?> |
| 989 |
<?php } ?> |
| 990 |
|
| 991 |
<?php if ( is_array( $extensions_disabled ) ) { ?> |
| 992 |
<?php foreach ( $extensions_disabled as $extension ) { ?> |
| 993 |
<?php |
| 994 |
$slug = dirname( $extension['slug'] ); |
| 995 |
|
| 996 |
if ( ! isset( $group_available_extensions[ $slug ] ) ) { |
| 997 |
continue; |
| 998 |
} |
| 999 |
|
| 1000 |
if ( in_array( $slug, $excluded_extensions ) ) { |
| 1001 |
continue; |
| 1002 |
} |
| 1003 |
|
| 1004 |
$extensions_data = $group_available_extensions[ $slug ]; |
| 1005 |
|
| 1006 |
if ( isset( $extensions_data['img'] ) && ! empty( $extensions_data['img'] ) ) { |
| 1007 |
$img_url = $extensions_data['img']; // icon from the available extensions in dashboard. |
| 1008 |
} elseif ( isset( $extension['icon'] ) && ! empty( $extension['icon'] ) ) { |
| 1009 |
$img_url = $extension['icon']; // icon from the get_this_extension(). |
| 1010 |
} elseif ( isset( $extension['iconURI'] ) && '' !== $extension['iconURI'] ) { |
| 1011 |
$img_url = MainWP_Utility::remove_http_prefix( $extension['iconURI'] ); // icon from the extension header. |
| 1012 |
} else { |
| 1013 |
$img_url = MAINWP_PLUGIN_URL . 'assets/images/extensions/placeholder.png'; |
| 1014 |
} |
| 1015 |
|
| 1016 |
MainWP_Extensions_View::render_inactive_extension_card( $extension, $img_url, true ); |
| 1017 |
?> |
| 1018 |
|
| 1019 |
<?php } ?> |
| 1020 |
<?php } ?> |
| 1021 |
|
| 1022 |
<?php if ( is_array( $extensions_not_installed ) ) { ?> |
| 1023 |
<?php foreach ( $extensions_not_installed as $slug => $extension ) { ?> |
| 1024 |
<?php |
| 1025 |
|
| 1026 |
if ( ! isset( $group_available_extensions[ $slug ] ) ) { |
| 1027 |
continue; |
| 1028 |
} |
| 1029 |
|
| 1030 |
if ( in_array( $slug, $excluded_extensions ) ) { |
| 1031 |
continue; |
| 1032 |
} |
| 1033 |
|
| 1034 |
if ( isset( $extension['img'] ) && ! empty( $extension['img'] ) ) { |
| 1035 |
$img_url = $extension['img']; // icon from the available extensions in dashboard. |
| 1036 |
} else { |
| 1037 |
$img_url = MAINWP_PLUGIN_URL . 'assets/images/extensions/placeholder.png'; |
| 1038 |
} |
| 1039 |
|
| 1040 |
MainWP_Extensions_View::render_inactive_extension_card( $extension, $img_url ); |
| 1041 |
?> |
| 1042 |
<?php } ?> |
| 1043 |
<?php } ?> |
| 1044 |
</div> |
| 1045 |
</div> |
| 1046 |
<?php |
| 1047 |
do_action( 'mainwp_pagefooter_extensions' ); |
| 1048 |
} |
| 1049 |
} |
| 1050 |
|