PluginProbe
Patchstack – WordPress & Plugins Security / 2.2.10
Patchstack – WordPress & Plugins Security v2.2.10
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
← All changes | includes/admin/menu.php +13 -7 trunk2.2.10 View file →
@@ -17,13 +17,8 @@
17 17 * @return void
18 18 */
19 19 public function __construct( $core ) {
20 20 parent::__construct( $core );
21 -
22 - if ( defined( 'PS_DISABLE_MENU' ) && PS_DISABLE_MENU ) {
23 - return;
24 - }
25 -
26 21 add_action( 'admin_head', [ $this, 'add_meta_nonce' ] );
27 22 add_action( 'admin_menu', [ $this, 'add_menu_pages' ] );
28 23 add_action( 'network_admin_menu', [ $this, 'network_menu' ] );
29 24 add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_styles' ] );
@@ -59,9 +54,11 @@
59 54 * @return void
60 55 */
61 56 public function network_menu() {
62 57 add_menu_page( 'Patchstack', 'Patchstack', 'manage_options', 'patchstack-multisite', [ $this->plugin->multisite, 'sites_section_callback' ] );
63 - add_submenu_page( 'patchstack-multisite', 'Activate', 'Activate', 'manage_options', 'patchstack-multisite-settings', [ $this, 'render_settings_page' ] );
58 + add_submenu_page( 'patchstack-multisite', 'Activate', 'Activate', 'manage_options', 'patchstack-multisite-settings&tab=multisite', [ $this->plugin->multisite, 'settings' ] );
59 + add_submenu_page( 'patchstack-multisite', 'Sites', 'Sites', 'manage_options', 'patchstack-multisite', [ $this->plugin->multisite, 'sites_section_callback' ] );
60 + add_submenu_page( 'patchstack-multisite', 'Settings', 'Settings', 'manage_options', 'patchstack-multisite-settings', [ $this, 'render_settings_page' ] );
64 61 }
65 62
66 63 /**
67 64 * Render the settings page.
@@ -82,10 +79,14 @@
82 79
83 80 // Load the Patchstack style on all Patchstack pages except site overview.
84 81 if ( isset( $screen->base, $_GET['page'] ) && stripos( $screen->base, 'patchstack' ) !== false && $_GET['page'] != 'patchstack-multisite' ) {
85 82 wp_enqueue_style( 'patchstack', $this->plugin->url . 'assets/css/patchstack.min.css', [], $this->plugin->version );
86 - wp_enqueue_style( 'patchstack-hint', 'https://cdnjs.cloudflare.com/ajax/libs/hint.css/3.0.0/hint.min.css', [], $this->plugin->version );
87 83 }
84 +
85 + // Only load the selectize CSS file on the firewall settings page.
86 + if ( isset( $screen->base ) && stripos( $screen->base, 'patchstack' ) !== false ) {
87 + wp_enqueue_style( 'patchstack-selectize', $this->plugin->url . 'assets/css/selectize.min.css', [ ], $this->plugin->version );
88 + }
88 89 }
89 90
90 91 /**
91 92 * Register the JavaScript for the admin area.
@@ -105,8 +106,13 @@
105 106 'nonce' => wp_create_nonce( 'patchstack-nonce' ),
106 107 'error_message' => esc_attr__( 'Sorry, there was a problem processing your request.', 'patchstack' ),
107 108 ]
108 109 );
110 + }
111 +
112 + // Only load the selectize library on the firewall settings page.
113 + if ( isset( $screen->base ) && stripos( $screen->base, 'patchstack' ) !== false ) {
114 + wp_enqueue_script( 'patchstack-selectize', $this->plugin->url . 'assets/js/selectize.min.js', [ ], $this->plugin->version );
109 115 }
110 116 }
111 117
112 118 /**