| @@ -6,8 +6,13 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace MainWP\Dashboard; |
| 9 | 9 | |
| 10 | +// Exit if accessed directly. | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | + exit; | |
| 13 | +} | |
| 14 | + | |
| 10 | 15 | /** |
| 11 | 16 | * Class MainWP_Extensions_Groups |
| 12 | 17 | */ |
| 13 | 18 | class MainWP_Extensions_Groups { // phpcs:ignore Generic.Classes.OpeningBraceSameLine.ContentAfterBrace -- NOSONAR. |
| @@ -42,8 +47,19 @@ | ||
| 42 | 47 | |
| 43 | 48 | $submenu_pages = array( |
| 44 | 49 | array( |
| 45 | 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', | |
| 46 | 62 | 'page_title' => esc_html__( 'Backups', 'mainwp' ), |
| 47 | 63 | 'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-backups">' . esc_html__( 'Backups', 'mainwp' ) . $end_div, |
| 48 | 64 | 'capability' => 'read', |
| 49 | 65 | 'menu_slug' => 'Extensions-Mainwp-Backups', |
| @@ -97,19 +113,8 @@ | ||
| 97 | 113 | ), |
| 98 | 114 | ), |
| 99 | 115 | array( |
| 100 | 116 | 'parent_slug' => 'mainwp_tab', |
| 101 | - 'page_title' => esc_html__( 'Development', 'mainwp' ), | |
| 102 | - 'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-development">' . esc_html__( 'Development', 'mainwp' ) . $end_div, | |
| 103 | - 'capability' => 'read', | |
| 104 | - 'menu_slug' => 'Extensions-Mainwp-Development', | |
| 105 | - 'callback' => array( | |
| 106 | - static::class, | |
| 107 | - 'render_extensions_groups', | |
| 108 | - ), | |
| 109 | - ), | |
| 110 | - array( | |
| 111 | - 'parent_slug' => 'mainwp_tab', | |
| 112 | 117 | 'page_title' => esc_html__( 'Agency', 'mainwp' ), |
| 113 | 118 | 'menu_title' => '<div class="mainwp-hidden" id="mainwp-extensions-agency">' . esc_html__( 'Agency', 'mainwp' ) . $end_div, |
| 114 | 119 | 'capability' => 'read', |
| 115 | 120 | 'menu_slug' => 'Extensions-Mainwp-Agency', |
| @@ -143,18 +148,28 @@ | ||
| 143 | 148 | } |
| 144 | 149 | |
| 145 | 150 | $extensions_and_leftmenus = array( |
| 146 | 151 | array( |
| 147 | - 'title' => esc_html__( 'Backups', 'mainwp' ), | |
| 152 | + 'title' => esc_html__( 'Content Operations', 'mainwp' ), | |
| 148 | 153 | 'parent_key' => 'managesites', |
| 149 | - 'slug' => 'Extensions-Mainwp-Backups', | |
| 150 | - 'href' => 'admin.php?page=Extensions-Mainwp-Backups', | |
| 151 | - 'leftsub_order' => 8.1, | |
| 152 | - 'id' => 'mainwp-backups-extensions-category', | |
| 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', | |
| 153 | 158 | 'level' => 1, |
| 154 | 159 | ), |
| 155 | 160 | ); |
| 156 | 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 | + | |
| 157 | 172 | if ( defined( 'MAINWP_MODULE_API_BACKUPS_ENABLED' ) && MAINWP_MODULE_API_BACKUPS_ENABLED ) { |
| 158 | 173 | $extensions_and_leftmenus[] = array( |
| 159 | 174 | 'type' => 'extension', |
| 160 | 175 | 'title' => esc_html__( 'API Backups', 'mainwp' ), |
| @@ -299,9 +314,9 @@ | ||
| 299 | 314 | ); |
| 300 | 315 | |
| 301 | 316 | $extensions_and_leftmenus[] = array( |
| 302 | 317 | 'type' => 'extension', |
| 303 | - 'title' => esc_html__( 'iThemes Security', 'mainwp' ), | |
| 318 | + 'title' => esc_html__( 'Solid Security Integration', 'mainwp' ), | |
| 304 | 319 | 'slug' => 'mainwp-ithemes-security-extension/mainwp-ithemes-security-extension.php', |
| 305 | 320 | 'parent_key' => 'Extensions-Mainwp-Security', |
| 306 | 321 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Ithemes-Security-Extension', |
| 307 | 322 | 'leftsub_order_level2' => 7, |
| @@ -395,9 +410,9 @@ | ||
| 395 | 410 | 'level' => 1, |
| 396 | 411 | ); |
| 397 | 412 | |
| 398 | 413 | $extensions_and_leftmenus[] = array( |
| 399 | - 'title' => esc_html__( 'Basic Monitoring', 'mainwp' ), | |
| 414 | + 'title' => esc_html__( 'Monitoring', 'mainwp' ), | |
| 400 | 415 | 'parent_key' => 'Extensions-Mainwp-Monitoring', |
| 401 | 416 | 'slug' => 'MonitoringSites', |
| 402 | 417 | 'href' => 'admin.php?page=MonitoringSites', |
| 403 | 418 | 'leftsub_order_level2' => 0.5, |
| @@ -448,8 +463,19 @@ | ||
| 448 | 463 | 'active_path' => array( 'Extensions-Mainwp-Lighthouse-Extension' => 'managesites' ), |
| 449 | 464 | ); |
| 450 | 465 | |
| 451 | 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( | |
| 452 | 478 | 'title' => esc_html__( 'Agency', 'mainwp' ), |
| 453 | 479 | 'parent_key' => 'managesites', |
| 454 | 480 | 'slug' => 'Extensions-Mainwp-Agency', |
| 455 | 481 | 'href' => 'admin.php?page=Extensions-Mainwp-Agency', |
| @@ -491,43 +517,11 @@ | ||
| 491 | 517 | ); |
| 492 | 518 | |
| 493 | 519 | $extensions_and_leftmenus[] = array( |
| 494 | 520 | 'type' => 'extension', |
| 495 | - 'title' => esc_html__( 'WooCommerce Shortcuts', 'mainwp' ), | |
| 496 | - 'slug' => 'mainwp-woocommerce-shortcuts-extension/mainwp-woocommerce-shortcuts-extension.php', | |
| 497 | - 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 498 | - 'ext_page' => 'admin.php?page=Extensions-Mainwp-Woocommerce-Shortcuts-Extension', | |
| 499 | - 'leftsub_order_level2' => 1, | |
| 500 | - 'level' => 2, | |
| 501 | - 'active_path' => array( 'Extensions-Mainwp-Woocommerce-Shortcuts-Extension' => 'managesites' ), | |
| 502 | - ); | |
| 503 | - | |
| 504 | - $extensions_and_leftmenus[] = array( | |
| 505 | - 'type' => 'extension', | |
| 506 | - 'title' => esc_html__( 'WooCommerce Status', 'mainwp' ), | |
| 507 | - 'slug' => 'mainwp-woocommerce-status-extension/mainwp-woocommerce-status-extension.php', | |
| 508 | - 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 509 | - 'ext_page' => 'admin.php?page=Extensions-Mainwp-Woocommerce-Status-Extension', | |
| 510 | - 'leftsub_order_level2' => 2, | |
| 511 | - 'level' => 2, | |
| 512 | - 'active_path' => array( 'Extensions-Mainwp-Woocommerce-Status-Extension' => 'managesites' ), | |
| 513 | - ); | |
| 514 | - | |
| 515 | - $extensions_and_leftmenus[] = array( | |
| 516 | - 'title' => esc_html__( 'Development', 'mainwp' ), | |
| 517 | - 'parent_key' => 'managesites', | |
| 518 | - 'slug' => 'Extensions-Mainwp-Development', | |
| 519 | - 'href' => 'admin.php?page=Extensions-Mainwp-Development', | |
| 520 | - 'leftsub_order' => 8.6, | |
| 521 | - 'id' => 'mainwp-development-extensions-category', | |
| 522 | - 'level' => 1, | |
| 523 | - ); | |
| 524 | - | |
| 525 | - $extensions_and_leftmenus[] = array( | |
| 526 | - 'type' => 'extension', | |
| 527 | 521 | 'title' => esc_html__( 'Atarim', 'mainwp' ), |
| 528 | 522 | 'slug' => 'mainwp-atarim-extension/mainwp-atarim-extension.php', |
| 529 | - 'parent_key' => 'Extensions-Mainwp-Development', | |
| 523 | + 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 530 | 524 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Atarim-Extension', |
| 531 | 525 | 'leftsub_order_level2' => 1, |
| 532 | 526 | 'level' => 2, |
| 533 | 527 | 'active_path' => array( 'Extensions-Mainwp-Atarim-Extension' => 'managesites' ), |
| @@ -536,9 +530,9 @@ | ||
| 536 | 530 | $extensions_and_leftmenus[] = array( |
| 537 | 531 | 'type' => 'extension', |
| 538 | 532 | 'title' => esc_html__( 'Bulk Settings Manager', 'mainwp' ), |
| 539 | 533 | 'slug' => 'mainwp-bulk-settings-manager/mainwp-bulk-settings-manager.php', |
| 540 | - 'parent_key' => 'Extensions-Mainwp-Development', | |
| 534 | + 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 541 | 535 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Bulk-Settings-Manager', |
| 542 | 536 | 'leftsub_order_level2' => 2, |
| 543 | 537 | 'level' => 2, |
| 544 | 538 | 'active_path' => array( 'Extensions-Mainwp-Bulk-Settings-Manager' => 'managesites' ), |
| @@ -547,9 +541,9 @@ | ||
| 547 | 541 | $extensions_and_leftmenus[] = array( |
| 548 | 542 | 'type' => 'extension', |
| 549 | 543 | 'title' => esc_html__( 'Code Snippets', 'mainwp' ), |
| 550 | 544 | 'slug' => 'mainwp-code-snippets-extension/mainwp-code-snippets-extension.php', |
| 551 | - 'parent_key' => 'Extensions-Mainwp-Development', | |
| 545 | + 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 552 | 546 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Code-Snippets-Extension', |
| 553 | 547 | 'leftsub_order_level2' => 3, |
| 554 | 548 | 'level' => 2, |
| 555 | 549 | 'active_path' => array( 'Extensions-Mainwp-Code-Snippets-Extension' => 'managesites' ), |
| @@ -557,9 +551,9 @@ | ||
| 557 | 551 | $extensions_and_leftmenus[] = array( |
| 558 | 552 | 'type' => 'extension', |
| 559 | 553 | 'title' => esc_html__( 'Custom Dashboard', 'mainwp' ), |
| 560 | 554 | 'slug' => 'mainwp-custom-dashboard-extension/mainwp-custom-dashboard-extension.php', |
| 561 | - 'parent_key' => 'Extensions-Mainwp-Development', | |
| 555 | + 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 562 | 556 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Custom-Dashboard-Extension', |
| 563 | 557 | 'leftsub_order_level2' => 4, |
| 564 | 558 | 'level' => 2, |
| 565 | 559 | 'active_path' => array( 'Extensions-Mainwp-Custom-Dashboard-Extension' => 'managesites' ), |
| @@ -568,9 +562,9 @@ | ||
| 568 | 562 | $extensions_and_leftmenus[] = array( |
| 569 | 563 | 'type' => 'extension', |
| 570 | 564 | 'title' => esc_html__( 'Custom Post Type', 'mainwp' ), |
| 571 | 565 | 'slug' => 'mainwp-custom-post-types/mainwp-custom-post-types.php', |
| 572 | - 'parent_key' => 'Extensions-Mainwp-Development', | |
| 566 | + 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 573 | 567 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Custom-Post-Types', |
| 574 | 568 | 'leftsub_order_level2' => 5, |
| 575 | 569 | 'level' => 2, |
| 576 | 570 | 'active_path' => array( 'Extensions-Mainwp-Custom-Post-Types' => 'managesites' ), |
| @@ -579,9 +573,9 @@ | ||
| 579 | 573 | $extensions_and_leftmenus[] = array( |
| 580 | 574 | 'type' => 'extension', |
| 581 | 575 | 'title' => esc_html__( 'File Uploader', 'mainwp' ), |
| 582 | 576 | 'slug' => 'mainwp-file-uploader-extension/mainwp-file-uploader-extension.php', |
| 583 | - 'parent_key' => 'Extensions-Mainwp-Development', | |
| 577 | + 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 584 | 578 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-File-Uploader-Extension', |
| 585 | 579 | 'leftsub_order_level2' => 6, |
| 586 | 580 | 'level' => 2, |
| 587 | 581 | 'active_path' => array( 'Extensions-Mainwp-File-Uploader-Extension' => 'managesites' ), |
| @@ -590,9 +584,9 @@ | ||
| 590 | 584 | $extensions_and_leftmenus[] = array( |
| 591 | 585 | 'type' => 'extension', |
| 592 | 586 | 'title' => esc_html__( 'Pressable', 'mainwp' ), |
| 593 | 587 | 'slug' => 'mainwp-pressable-extension/mainwp-pressable-extension.php', |
| 594 | - 'parent_key' => 'Extensions-Mainwp-Development', | |
| 588 | + 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 595 | 589 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Pressable-Extension', |
| 596 | 590 | 'leftsub_order_level2' => 7, |
| 597 | 591 | 'level' => 2, |
| 598 | 592 | 'active_path' => array( 'Extensions-Mainwp-Pressable-Extension' => 'managesites' ), |
| @@ -601,9 +595,9 @@ | ||
| 601 | 595 | $extensions_and_leftmenus[] = array( |
| 602 | 596 | 'type' => 'extension', |
| 603 | 597 | 'title' => esc_html__( 'Staging', 'mainwp' ), |
| 604 | 598 | 'slug' => 'mainwp-staging-extension/mainwp-staging-extension.php', |
| 605 | - 'parent_key' => 'Extensions-Mainwp-Development', | |
| 599 | + 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 606 | 600 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Staging-Extension', |
| 607 | 601 | 'leftsub_order_level2' => 8, |
| 608 | 602 | 'level' => 2, |
| 609 | 603 | 'active_path' => array( 'Extensions-Mainwp-Staging-Extension' => 'managesites' ), |
| @@ -612,9 +606,9 @@ | ||
| 612 | 606 | $extensions_and_leftmenus[] = array( |
| 613 | 607 | 'type' => 'extension', |
| 614 | 608 | 'title' => esc_html__( 'URL Extractor', 'mainwp' ), |
| 615 | 609 | 'slug' => 'mainwp-url-extractor-extension/mainwp-url-extractor-extension.php', |
| 616 | - 'parent_key' => 'Extensions-Mainwp-Development', | |
| 610 | + 'parent_key' => 'Extensions-Mainwp-Administrative', | |
| 617 | 611 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Url-Extractor-Extension', |
| 618 | 612 | 'leftsub_order_level2' => 9, |
| 619 | 613 | 'level' => 2, |
| 620 | 614 | 'active_path' => array( 'Extensions-Mainwp-Url-Extractor-Extension' => 'managesites' ), |
| @@ -619,8 +613,19 @@ | ||
| 619 | 613 | 'level' => 2, |
| 620 | 614 | 'active_path' => array( 'Extensions-Mainwp-Url-Extractor-Extension' => 'managesites' ), |
| 621 | 615 | ); |
| 622 | 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 | + | |
| 623 | 628 | $extensions_and_leftmenus[] = array( |
| 624 | 629 | 'title' => esc_html__( 'Performance', 'mainwp' ), |
| 625 | 630 | 'parent_key' => 'managesites', |
| 626 | 631 | 'slug' => 'Extensions-Mainwp-Performance', |
| @@ -677,9 +682,9 @@ | ||
| 677 | 682 | $extensions_and_leftmenus[] = array( |
| 678 | 683 | 'type' => 'extension', |
| 679 | 684 | 'title' => esc_html__( 'Comments', 'mainwp' ), |
| 680 | 685 | 'slug' => 'mainwp-comments-extension/mainwp-comments-extension.php', |
| 681 | - 'parent_key' => 'PostBulkManage', | |
| 686 | + 'parent_key' => 'Extensions-Mainwp-Content-Operations', | |
| 682 | 687 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Comments-Extension', |
| 683 | 688 | 'leftsub_order_level2' => 2.1, |
| 684 | 689 | 'level' => 2, |
| 685 | 690 | 'active_path' => array( 'Extensions-Mainwp-Comments-Extension' => 'managesites' ), |
| @@ -686,19 +691,8 @@ | ||
| 686 | 691 | ); |
| 687 | 692 | |
| 688 | 693 | $extensions_and_leftmenus[] = array( |
| 689 | 694 | 'type' => 'extension', |
| 690 | - 'title' => esc_html__( 'Comments', 'mainwp' ), | |
| 691 | - 'slug' => 'mainwp-comments-extension/mainwp-comments-extension.php', | |
| 692 | - 'parent_key' => 'PageBulkManage', | |
| 693 | - 'ext_page' => 'admin.php?page=Extensions-Mainwp-Comments-Extension', | |
| 694 | - 'leftsub_order_level2' => 2.1, | |
| 695 | - 'level' => 2, | |
| 696 | - 'active_path' => array( 'Extensions-Mainwp-Comments-Extension' => 'managesites' ), | |
| 697 | - ); | |
| 698 | - | |
| 699 | - $extensions_and_leftmenus[] = array( | |
| 700 | - 'type' => 'extension', | |
| 701 | 695 | 'title' => esc_html__( 'Clone', 'mainwp' ), |
| 702 | 696 | 'slug' => 'mainwp-clone-extension/mainwp-clone-extension.php', |
| 703 | 697 | 'parent_key' => 'managesites', |
| 704 | 698 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Clone-Extension', |
| @@ -710,9 +704,9 @@ | ||
| 710 | 704 | $extensions_and_leftmenus[] = array( |
| 711 | 705 | 'type' => 'extension', |
| 712 | 706 | 'title' => esc_html__( 'Article Uploader', 'mainwp' ), |
| 713 | 707 | 'slug' => 'mainwp-article-uploader-extension/mainwp-article-uploader-extension.php', |
| 714 | - 'parent_key' => 'PostBulkManage', | |
| 708 | + 'parent_key' => 'Extensions-Mainwp-Content-Operations', | |
| 715 | 709 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Article-Uploader-Extension', |
| 716 | 710 | 'leftsub_order_level2' => 3, |
| 717 | 711 | 'level' => 2, |
| 718 | 712 | 'active_path' => array( 'Extensions-Mainwp-Article-Uploader-Extension' => 'managesites' ), |
| @@ -719,31 +713,22 @@ | ||
| 719 | 713 | ); |
| 720 | 714 | |
| 721 | 715 | $extensions_and_leftmenus[] = array( |
| 722 | 716 | 'type' => 'extension', |
| 723 | - 'title' => esc_html__( 'Post Dripper', 'mainwp' ), | |
| 724 | - 'slug' => 'mainwp-post-dripper-extension/mainwp-post-dripper-extension.php', | |
| 725 | - 'parent_key' => 'PostBulkManage', | |
| 726 | - 'ext_page' => 'admin.php?page=Extensions-Mainwp-Post-Dripper-Extension', | |
| 727 | - 'leftsub_order_level2' => 4, | |
| 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, | |
| 728 | 722 | 'level' => 2, |
| 723 | + 'active_path' => array( 'Extensions-Boilerplate-Extension' => 'managesites' ), | |
| 729 | 724 | ); |
| 730 | 725 | |
| 731 | 726 | $extensions_and_leftmenus[] = array( |
| 732 | 727 | 'type' => 'extension', |
| 733 | - 'title' => esc_html__( 'Post Plus', 'mainwp' ), | |
| 734 | - 'slug' => 'mainwp-post-plus-extension/mainwp-post-plus-extension.php', | |
| 735 | - 'parent_key' => 'PostBulkManage', | |
| 736 | - 'ext_page' => 'admin.php?page=Extensions-Mainwp-Post-Plus-Extension', | |
| 737 | - 'leftsub_order_level2' => 5, | |
| 738 | - 'level' => 2, | |
| 739 | - ); | |
| 740 | - | |
| 741 | - $extensions_and_leftmenus[] = array( | |
| 742 | - 'type' => 'extension', | |
| 743 | 728 | 'title' => esc_html__( 'Post Dripper', 'mainwp' ), |
| 744 | 729 | 'slug' => 'mainwp-post-dripper-extension/mainwp-post-dripper-extension.php', |
| 745 | - 'parent_key' => 'PageBulkManage', | |
| 730 | + 'parent_key' => 'Extensions-Mainwp-Content-Operations', | |
| 746 | 731 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Post-Dripper-Extension', |
| 747 | 732 | 'leftsub_order_level2' => 4, |
| 748 | 733 | 'level' => 2, |
| 749 | 734 | ); |
| @@ -751,9 +736,9 @@ | ||
| 751 | 736 | $extensions_and_leftmenus[] = array( |
| 752 | 737 | 'type' => 'extension', |
| 753 | 738 | 'title' => esc_html__( 'Post Plus', 'mainwp' ), |
| 754 | 739 | 'slug' => 'mainwp-post-plus-extension/mainwp-post-plus-extension.php', |
| 755 | - 'parent_key' => 'PageBulkManage', | |
| 740 | + 'parent_key' => 'Extensions-Mainwp-Content-Operations', | |
| 756 | 741 | 'ext_page' => 'admin.php?page=Extensions-Mainwp-Post-Plus-Extension', |
| 757 | 742 | 'leftsub_order_level2' => 5, |
| 758 | 743 | 'level' => 2, |
| 759 | 744 | ); |
| @@ -784,9 +769,9 @@ | ||
| 784 | 769 | $extensions_and_leftmenus[] = array( |
| 785 | 770 | 'type' => 'extension', |
| 786 | 771 | 'title' => esc_html__( 'WordPress SEO', 'mainwp' ), |
| 787 | 772 | 'slug' => 'wordpress-seo-extension/wordpress-seo-extension.php', |
| 788 | - 'parent_key' => 'PostBulkManage', | |
| 773 | + 'parent_key' => 'Extensions-Mainwp-Content-Operations', | |
| 789 | 774 | 'ext_page' => 'admin.php?page=Extensions-Wordpress-Seo-Extension', |
| 790 | 775 | 'leftsub_order_level2' => 6, |
| 791 | 776 | 'level' => 2, |
| 792 | 777 | ); |
| @@ -792,35 +777,17 @@ | ||
| 792 | 777 | ); |
| 793 | 778 | |
| 794 | 779 | $extensions_and_leftmenus[] = array( |
| 795 | 780 | 'type' => 'extension', |
| 796 | - 'title' => esc_html__( 'WordPress SEO', 'mainwp' ), | |
| 797 | - 'slug' => 'wordpress-seo-extension/wordpress-seo-extension.php', | |
| 798 | - 'parent_key' => 'PageBulkManage', | |
| 799 | - 'ext_page' => 'admin.php?page=Extensions-Wordpress-Seo-Extension', | |
| 800 | - 'leftsub_order_level2' => 6, | |
| 801 | - 'level' => 2, | |
| 802 | - ); | |
| 803 | - | |
| 804 | - $extensions_and_leftmenus[] = array( | |
| 805 | - 'type' => 'extension', | |
| 806 | 781 | 'title' => esc_html__( 'SEOPress', 'mainwp' ), |
| 807 | - 'slug' => 'seopress-for-mainwp/wp-seopress-mainwp.php', | |
| 808 | - 'parent_key' => 'PostBulkManage', | |
| 782 | + 'slug' => 'seopress-for-mainwp/seopress-for-mainwp.php', | |
| 783 | + 'parent_key' => 'Extensions-Mainwp-Content-Operations', | |
| 809 | 784 | 'ext_page' => 'admin.php?page=Extensions-Seopress-For-Mainwp', |
| 810 | 785 | 'leftsub_order_level2' => 6, |
| 811 | 786 | 'level' => 2, |
| 812 | 787 | ); |
| 813 | 788 | |
| 814 | - $extensions_and_leftmenus[] = array( | |
| 815 | - 'type' => 'extension', | |
| 816 | - 'title' => esc_html__( 'SEOPress', 'mainwp' ), | |
| 817 | - 'slug' => 'seopress-for-mainwp/seopress-for-mainwp.php', | |
| 818 | - 'parent_key' => 'PageBulkManage', | |
| 819 | - 'ext_page' => 'admin.php?page=Extensions-Seopress-For-Mainwp', | |
| 820 | - 'leftsub_order_level2' => 6, | |
| 821 | - 'level' => 2, | |
| 822 | - ); | |
| 789 | + $extensions_and_leftmenus = apply_filters( 'mainwp_menu_extensions_left_menu', $extensions_and_leftmenus ); | |
| 823 | 790 | |
| 824 | 791 | foreach ( $extensions_and_leftmenus as $item ) { |
| 825 | 792 | if ( isset( $item['type'] ) && 'extension' === $item['type'] ) { |
| 826 | 793 | static::add_extension_menu( $item ); |
| @@ -832,16 +799,16 @@ | ||
| 832 | 799 | // @NO_SONAR_END@ . |
| 833 | 800 | global $_mainwp_menu_active_slugs; |
| 834 | 801 | |
| 835 | 802 | $active_slugs = array( |
| 836 | - 'Extensions-Mainwp-Backups' => 'Extensions-Mainwp-Backups', | |
| 837 | - 'Extensions-Mainwp-Security' => 'Extensions-Mainwp-Security', | |
| 838 | - 'Extensions-Mainwp-Analytics' => 'Extensions-Mainwp-Analytics', | |
| 839 | - 'Extensions-Mainwp-Monitoring' => 'Extensions-Mainwp-Monitoring', | |
| 840 | - 'Extensions-Mainwp-Agency' => 'Extensions-Mainwp-Agency', | |
| 841 | - 'Extensions-Mainwp-Administrative' => 'Extensions-Mainwp-Administrative', | |
| 842 | - 'Extensions-Mainwp-Development' => 'Extensions-Mainwp-Development', | |
| 843 | - 'Extensions-Mainwp-Performance' => 'Extensions-Mainwp-Performance', | |
| 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', | |
| 844 | 811 | ); |
| 845 | 812 | // to fix activate menus state. |
| 846 | 813 | foreach ( $active_slugs as $item => $act_slug ) { |
| 847 | 814 | MainWP_Menu::set_menu_active_slugs( $item, $act_slug ); |
| @@ -938,12 +905,12 @@ | ||
| 938 | 905 | } elseif ( 'Extensions-Mainwp-Agency' === $_GET['page'] ) { |
| 939 | 906 | $get_ext_group[] = 'agency'; |
| 940 | 907 | } elseif ( 'Extensions-Mainwp-Administrative' === $_GET['page'] ) { |
| 941 | 908 | $get_ext_group[] = 'admin'; |
| 942 | - } elseif ( 'Extensions-Mainwp-Development' === $_GET['page'] ) { | |
| 943 | - $get_ext_group[] = 'development'; | |
| 944 | 909 | } elseif ( 'Extensions-Mainwp-Performance' === $_GET['page'] ) { |
| 945 | 910 | $get_ext_group[] = 'performance'; |
| 911 | + } elseif ( 'Extensions-Mainwp-Content-Operations' === $_GET['page'] ) { | |
| 912 | + $get_ext_group[] = 'content'; | |
| 946 | 913 | } |
| 947 | 914 | } |
| 948 | 915 | //phpcs:enable |
| 949 | 916 | |
| @@ -965,13 +932,13 @@ | ||
| 965 | 932 | |
| 966 | 933 | do_action( 'mainwp_pageheader_extensions' ); |
| 967 | 934 | ?> |
| 968 | 935 | <div class="ui segment"> |
| 969 | - <div class="ui four stackable cards" id="mainwp-extensions-list"> | |
| 936 | + <div class="ui three mainwp-cards cards" id="mainwp-extensions-list"> | |
| 970 | 937 | <?php if ( isset( $_GET['page'] ) && 'Extensions-Mainwp-Backups' === $_GET['page'] ) : //phpcs:ignore WordPress.Security.NonceVerification.Recommended ?> |
| 971 | 938 | <div class="ui extension card"> |
| 972 | 939 | <div class="content"> |
| 973 | - <img class="right floated mini ui image" alt="<?php esc_attr_e( 'Extension icon placeholder', 'mainwp' ); ?>" src="<?php echo esc_url( MAINWP_PLUGIN_URL ) . 'assets/images/extensions/placeholder.png'; ?>"> | |
| 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'; ?>"> | |
| 974 | 941 | <div class="header"><a href="admin.php?page=ManageApiBackups"><?php esc_html_e( 'API Backpus', 'mainwp' ); ?></a></div> |
| 975 | 942 | <a href="admin.php?page=ManageApiBackups" class="ui green ribbon label"><?php echo esc_html__( ' MainWP core feature', 'mainwp' ); ?></a> |
| 976 | 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> |
| 977 | 944 | </div> |
| @@ -979,50 +946,50 @@ | ||
| 979 | 946 | <?php endif; ?> |
| 980 | 947 | <?php if ( isset( $_GET['page'] ) && 'Extensions-Mainwp-Monitoring' === $_GET['page'] ) : //phpcs:ignore WordPress.Security.NonceVerification.Recommended ?> |
| 981 | 948 | <div class="ui extension card"> |
| 982 | 949 | <div class="content"> |
| 983 | - <img class="right floated mini ui image" alt="<?php esc_attr_e( 'Extension icon placeholder', 'mainwp' ); ?>" src="<?php echo esc_url( MAINWP_PLUGIN_URL ) . 'assets/images/extensions/placeholder.png'; ?>"> | |
| 984 | - <div class="header"><a href="admin.php?page=MonitoringSites"><?php esc_html_e( 'Basic Monitoring', 'mainwp' ); ?></a></div> | |
| 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> | |
| 985 | 952 | <a href="admin.php?page=MonitoringSites" class="ui green ribbon label"><?php echo esc_html__( 'MainWP core feature', 'mainwp' ); ?></a> |
| 986 | - <div class="description"><?php esc_html_e( 'The MainWP Basic 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> | |
| 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> | |
| 987 | 954 | </div> |
| 988 | 955 | </div> |
| 989 | 956 | <?php endif; ?> |
| 990 | - <?php if ( isset( $extensions ) && is_array( $extensions ) ) { ?> | |
| 991 | 957 | |
| 992 | - <?php foreach ( $extensions as $extension ) { ?> | |
| 993 | - <?php | |
| 994 | - if ( ! mainwp_current_user_have_right( 'extension', dirname( $extension['slug'] ) ) ) { | |
| 995 | - continue; | |
| 996 | - } | |
| 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 | + } | |
| 997 | 964 | |
| 998 | - if ( ! isset( $group_available_extensions[ dirname( $extension['slug'] ) ] ) ) { | |
| 999 | - continue; | |
| 1000 | - } | |
| 965 | + if ( ! isset( $group_available_extensions[ dirname( $extension['slug'] ) ] ) ) { | |
| 966 | + continue; | |
| 967 | + } | |
| 1001 | 968 | |
| 1002 | - if ( in_array( dirname( $extension['slug'] ), $excluded_extensions ) ) { | |
| 1003 | - continue; | |
| 1004 | - } | |
| 969 | + if ( in_array( dirname( $extension['slug'] ), $excluded_extensions ) ) { | |
| 970 | + continue; | |
| 971 | + } | |
| 1005 | 972 | |
| 1006 | - $extensions_data = isset( $group_available_extensions[ dirname( $extension['slug'] ) ] ) ? $group_available_extensions[ dirname( $extension['slug'] ) ] : array(); | |
| 973 | + $extensions_data = isset( $group_available_extensions[ dirname( $extension['slug'] ) ] ) ? $group_available_extensions[ dirname( $extension['slug'] ) ] : array(); | |
| 1007 | 974 | |
| 1008 | - if ( isset( $extensions_data['img'] ) && ! empty( $extensions_data['img'] ) ) { | |
| 1009 | - $img_url = $extensions_data['img']; | |
| 1010 | - } elseif ( isset( $extension['icon'] ) && ! empty( $extension['icon'] ) ) { | |
| 1011 | - $img_url = $extension['icon']; | |
| 1012 | - } elseif ( isset( $extension['iconURI'] ) && '' !== $extension['iconURI'] ) { | |
| 1013 | - $img_url = MainWP_Utility::remove_http_prefix( $extension['iconURI'] ); | |
| 1014 | - } else { | |
| 1015 | - $img_url = MAINWP_PLUGIN_URL . 'assets/images/extensions/placeholder.png'; | |
| 1016 | - } | |
| 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 | + } | |
| 1017 | 984 | |
| 1018 | - MainWP_Extensions_View::render_extension_card( $extension, $extension_update, $img_url, false, true ); | |
| 1019 | - ?> | |
| 985 | + MainWP_Extensions_View::render_extension_card( $extension, $extension_update, $img_url, false, true ); | |
| 986 | + ?> | |
| 1020 | 987 | |
| 1021 | - <?php } ?> | |
| 1022 | - <?php } ?> | |
| 988 | + <?php } ?> | |
| 989 | + <?php } ?> | |
| 1023 | 990 | |
| 1024 | - <?php if ( is_array( $extensions_disabled ) ) { ?> | |
| 991 | + <?php if ( is_array( $extensions_disabled ) ) { ?> | |
| 1025 | 992 | <?php foreach ( $extensions_disabled as $extension ) { ?> |
| 1026 | 993 | <?php |
| 1027 | 994 | $slug = dirname( $extension['slug'] ); |
| 1028 | 995 | |
| @@ -1048,13 +1015,12 @@ | ||
| 1048 | 1015 | |
| 1049 | 1016 | MainWP_Extensions_View::render_inactive_extension_card( $extension, $img_url, true ); |
| 1050 | 1017 | ?> |
| 1051 | 1018 | |
| 1052 | - <?php } ?> | |
| 1019 | + <?php } ?> | |
| 1020 | + <?php } ?> | |
| 1053 | 1021 | |
| 1054 | - <?php } ?> | |
| 1055 | - | |
| 1056 | - <?php if ( is_array( $extensions_not_installed ) ) { ?> | |
| 1022 | + <?php if ( is_array( $extensions_not_installed ) ) { ?> | |
| 1057 | 1023 | <?php foreach ( $extensions_not_installed as $slug => $extension ) { ?> |
| 1058 | 1024 | <?php |
| 1059 | 1025 | |
| 1060 | 1026 | if ( ! isset( $group_available_extensions[ $slug ] ) ) { |
| @@ -1072,15 +1038,12 @@ | ||
| 1072 | 1038 | } |
| 1073 | 1039 | |
| 1074 | 1040 | MainWP_Extensions_View::render_inactive_extension_card( $extension, $img_url ); |
| 1075 | 1041 | ?> |
| 1076 | - | |
| 1077 | - <?php } ?> | |
| 1078 | - | |
| 1079 | - <?php } ?> | |
| 1080 | - | |
| 1081 | - </div> | |
| 1042 | + <?php } ?> | |
| 1043 | + <?php } ?> | |
| 1044 | + </div> | |
| 1082 | 1045 | </div> |
| 1083 | - <?php | |
| 1084 | - do_action( 'mainwp_pagefooter_extensions' ); | |
| 1046 | + <?php | |
| 1047 | + do_action( 'mainwp_pagefooter_extensions' ); | |
| 1085 | 1048 | } |
| 1086 | 1049 | } |