PluginProbe ʕ •ᴥ•ʔ
Admin and Site Enhancements (ASE) / 5.0.2
Admin and Site Enhancements (ASE) v5.0.2
9.1.1 9.1.0 9.0.2 9.0.1 9.0.0 8.9.2 8.9.1 8.9.0 8.8.8 8.8.7 8.8.6 8.8.5 8.8.4 8.8.3 8.8.2 8.8.1 8.8.0 8.7.3 8.7.2 8.7.1 8.2.1 8.2.2 8.2.3 8.3.0 8.3.1 8.3.2 8.4.0 8.4.1 8.4.2 8.5.0 8.5.1 8.5.2 8.6.0 8.6.1 8.6.2 8.7.0 5.0.1 5.0.2 5.0.2.1 5.0.2.2 5.0.2.3 5.0.2.4 5.1.0 5.2.0 5.2.1 5.2.10 5.2.11 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3.0 5.3.1 5.3.2 5.4.0 5.4.1 5.5.0 5.5.1 5.5.2 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.8.0 5.8.1 6.0.0 6.0.3 6.0.4 6.0.5 6.0.5.1 6.0.6 6.0.7 6.0.8.1 6.1.0 6.1.3 6.2.0 6.2.1 6.2.2 6.2.3 6.2.4 6.2.5 6.2.6 6.2.7 6.3.0 6.3.1 6.3.2 6.4.0 6.5.0 6.5.1 6.6.0 6.7.0 6.8.0 6.8.2 6.8.3 6.9.0 6.9.1 6.9.10 6.9.11 6.9.12 6.9.13.1 6.9.13.2 6.9.2 6.9.3 6.9.4 6.9.5 6.9.6 6.9.7 6.9.8 6.9.9 7.0.0 7.0.2 7.0.2.1 7.0.2.2 7.0.2.3 7.0.3 7.1.0 7.1.1 7.1.2 7.1.3 7.1.4 7.1.5 7.2.0 7.2.1 7.3.0 7.3.1 7.3.2 7.3.3 7.4.0 7.4.2 7.4.4 7.4.5 7.4.6 7.4.7 7.4.8 7.5.0 7.5.1 7.5.2 7.5.3 7.5.4 7.6.0 7.6.1 7.6.1.1 7.6.10 7.6.11 7.6.2 7.6.3 7.6.4 7.6.5 7.6.6 7.6.7 7.6.7.1 7.6.8 7.6.9 7.7.0 7.8.0 7.8.1 7.8.10 7.8.11 7.8.12 7.8.13 7.8.14 7.8.15 7.8.16 7.8.17 7.8.18 7.8.2 7.8.3 7.8.4 7.8.5 7.8.5.1 7.8.6 7.8.7 7.8.8 7.8.9 7.9.0 7.9.1 7.9.10 7.9.11 7.9.2 7.9.3 7.9.4 7.9.5 7.9.6 7.9.7 7.9.8 7.9.9 8.0.0 8.0.1 8.0.2 8.0.3 8.0.4 8.0.5 8.0.6 8.0.7 8.0.8 8.1.0 8.1.1 8.1.2 8.1.3 8.1.4 8.2.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 1.8.0 1.9.0 2.0.0 2.1.0 2.2.0 2.3.0 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.2.0 3.3.0 3.4.0 3.5.0 3.6.1 3.7.0 3.8.0 3.9.0 3.9.1 3.9.2 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.8.0 4.8.1 4.8.2 4.8.3 4.9.0 4.9.1 4.9.2 4.9.3 5.0.0
admin-site-enhancements / settings.php
admin-site-enhancements Last commit date
assets 3 years ago classes 3 years ago includes 3 years ago vendor 3 years ago LICENSE.md 3 years ago README.md 3 years ago admin-site-enhancements.php 3 years ago bootstrap.php 3 years ago settings.php 3 years ago
settings.php
418 lines
1 <?php
2
3 /**
4 * Register admin menu
5 *
6 * @since 1.0.0
7 */
8 function asenha_register_admin_menu() {
9
10 add_submenu_page(
11 'tools.php', // Parent page/menu
12 'Admin and Site Enhancements', // Browser tab/window title
13 'Enhancements', // Sube menu title
14 'manage_options', // Minimal user capabililty
15 ASENHA_SLUG, // Page slug. Shows up in URL.
16 'asenha_add_settings_page'
17 );
18
19 }
20
21 /**
22 * Create the settings page of the plugin
23 *
24 * @since 1.0.0
25 */
26 function asenha_add_settings_page() {
27 ?>
28 <div class="wrap asenha">
29
30 <div id="asenha-header" class="asenha-header">
31 <div class="asenha-header-left">
32 <h1 class="asenha-heading"><?php echo get_admin_page_title(); ?> <small><?php esc_html_e( 'by', 'admin-site-enhancements' ); ?> <a href="https://bowo.io/asenha-bw" target="_blank">Bowo</a></small></h1>
33 <!-- <a href="https://wordpress.org/plugins/admin-site-enhancements/" target="_blank" class="asenha-header-action"><span>&#8505;</span> <?php // esc_html_e( 'Info', 'admin-site-enhancements' ); ?></a> -->
34 </div>
35 <div class="asenha-header-right">
36 <a href="https://bowo.io/asenha-rvw" target="_blank" class="asenha-header-action"><span>&starf;</span> <?php esc_html_e( 'Review', 'admin-site-enhancements' ); ?></a>
37 <a href="https://bowo.io/asenha-fdbk" target="_blank" class="asenha-header-action">&#10010; <?php esc_html_e( 'Feedback', 'admin-site-enhancements' ); ?></a>
38 <a href="https://bowo.io/asenha-trnslt" target="_blank" class="asenha-header-action">&#9654; <?php esc_html_e( 'Translate', 'admin-site-enhancements' ); ?></a>
39 <div id="plugin-sponsor" class="button button-primary plugin-sponsor">&#10084;
40 <?php
41 esc_html_e( 'Sponsor', 'admin-site-enhancements' );
42 ?>
43 </div>
44 <a class="button button-primary asenha-save-button">Save Changes</a>
45 <div class="asenha-changes-saved" style="display:none;">Changes have been saved.</div>
46 </div>
47 </div>
48
49 <div class="asenha-body">
50 <form action="options.php" method="post">
51 <div class="asenha-vertical-tabs">
52 <div class="asenha-tab-buttons">
53 <input id="tab-content-management" type="radio" name="tabs" checked><label for="tab-content-management">Content Management</label>
54 <input id="tab-admin-interface" type="radio" name="tabs"><label for="tab-admin-interface">Admin Interface</label>
55 <input id="tab-login-logout" type="radio" name="tabs"><label for="tab-login-logout">Log In | Log Out</label>
56 <input id="tab-custom-code" type="radio" name="tabs"><label for="tab-custom-code">Custom Code</label>
57 <input id="tab-disable-components" type="radio" name="tabs"><label for="tab-disable-components">Disable Components</label>
58 <input id="tab-security" type="radio" name="tabs"><label for="tab-security">Security</label>
59 <input id="tab-optimizations" type="radio" name="tabs"><label for="tab-optimizations">Optimizations</label>
60 <input id="tab-utilities" type="radio" name="tabs"><label for="tab-utilities">Utilities</label>
61 </div>
62 <div class="asenha-tab-contents">
63 <section class="asenha-fields fields-content-management">
64 <table class="form-table" role="presentation">
65 <tbody></tbody>
66 </table>
67 </section>
68 <section class="asenha-fields fields-admin-interface">
69 <table class="form-table" role="presentation">
70 <tbody></tbody>
71 </table>
72 </section>
73 <section class="asenha-fields fields-login-logout">
74 <table class="form-table" role="presentation">
75 <tbody></tbody>
76 </table>
77 </section>
78 <section class="asenha-fields fields-custom-code">
79 <table class="form-table" role="presentation">
80 <tbody></tbody>
81 </table>
82 </section>
83 <section class="asenha-fields fields-disable-components">
84 <table class="form-table" role="presentation">
85 <tbody></tbody>
86 </table>
87 </section>
88 <section class="asenha-fields fields-security">
89 <table class="form-table" role="presentation">
90 <tbody></tbody>
91 </table>
92 </section>
93 <section class="asenha-fields fields-optimizations">
94 <table class="form-table" role="presentation">
95 <tbody></tbody>
96 </table>
97 </section>
98 <section class="asenha-fields fields-utilities">
99 <table class="form-table" role="presentation">
100 <tbody></tbody>
101 </table>
102 </section>
103 </div>
104 </div>
105 <div style="display:none;"><!-- Hide to prevent flash of fields appearing at the bottom of the page -->
106 <?php settings_fields( ASENHA_ID ); ?>
107 <?php do_settings_sections( ASENHA_SLUG ); ?>
108 <?php submit_button(
109 'Save Changes', // Button copy
110 'primary', // Type: 'primary', 'small', or 'large'
111 'submit', // The 'name' attribute
112 true, // Whether to wrap in <p> tag
113 array( 'id' => 'asenha-submit' ) // additional attributes
114 ); ?>
115 </div>
116 </form>
117 </div>
118
119 <div class="asenha-footer">
120 </div>
121
122 <div id="asenha-sponsor" class="cta-modal-content sponsorship" style="display:none;">
123 <div class="sponsorship-content">
124 <div class="sponsorship-header">
125 <div class="sponsorship-image">
126 <img src="<?php echo esc_attr( ASENHA_URL . 'assets/img/undraw_Programming_re_kg9v.png' ); ?>" />
127 </div>
128 <h2>Thank you for your interest in sponsoring!</h2>
129 </div>
130 <div class="sponsorship-content-sections">
131 <div class="sponsorship-info">
132 <p class="sponsorship-description">I love building <strong>useful and free <a href="https://bowo.io/asenha-other-plugins" target="_blank">plugins</a></strong>. Your sponsorship will help justify the time and effort I spend in <strong>developing and maintaining this plugin</strong>, so it can remain functional and be more useful for <strong>your personal project(s), paid dev work, client site(s) and/or agency workflow</strong>... hopefully for years to come.</p>
133 </div>
134 <div class="sponsorship-methods">
135 <p class="sponsorship-amount">Sponsorship can be <strong>as little as USD 1</strong>, monthly or one-time.</p>
136 <div class="sponsorship-method sponsor-via-github">
137 <a href="https://bowo.io/asenha-sp-gth" target="_blank" class="button button-primary button-hero sponsorship-button monthly">Monthly Sponsorship via Github <span class="dashicons dashicons-arrow-right-alt2"></span></a>
138 </div>
139 <div class="sponsorship-method sponsor-via-paypal">
140 <a href="https://bowo.io/asenha-sp-ppl" target="_blank" class="button button-hero sponsorship-button one-time">One-time Sponsorship via PayPal <span class="dashicons dashicons-arrow-right-alt2"></span></a>
141 </div>
142 </div>
143 </div>
144 <p>More about me and my work at <a href="https://bowo.io/asenha-bw-sp" target="_blank">bowo.io</a>.</p>
145 </div>
146 </div>
147 </div>
148 <?php
149
150 }
151
152 /**
153 * Suppress all notices, then add notice for successful settings update
154 *
155 * @since 1.1.0
156 */
157 function asenha_suppress_notices() {
158
159 global $plugin_page;
160
161 // Suppress all notices
162
163 if ( ASENHA_SLUG === $plugin_page ) {
164
165 remove_all_actions( 'admin_notices' );
166
167 }
168
169 // Add notice for successful settings update
170
171 if (
172 isset( $_GET[ 'page' ] )
173 && ASENHA_SLUG == $_GET[ 'page' ]
174 && isset( $_GET[ 'settings-updated' ] )
175 && true == $_GET[ 'settings-updated' ]
176 ) {
177 ?>
178 <script>
179 jQuery(document).ready( function() {
180 jQuery('.asenha-changes-saved').fadeIn(400).delay(2500).fadeOut(400);
181 });
182 </script>
183
184 <?php
185 }
186 }
187
188 /**
189 * Suppress all generic notices on the plugin settings page
190 *
191 * @since 2.7.0
192 */
193 function asenha_suppress_generic_notices() {
194
195 global $plugin_page;
196
197 // Suppress all notices
198
199 if ( ASENHA_SLUG === $plugin_page ) {
200
201 remove_all_actions( 'all_admin_notices' );
202
203 }
204
205 }
206
207 /**
208 * Enqueue admin scripts
209 *
210 * @since 1.0.0
211 */
212 function asenha_admin_scripts( $hook_suffix ) {
213
214 global $wp_version;
215
216 $current_screen = get_current_screen();
217
218 // Get all WP Enhancements options, default to empty array in case it's not been created yet
219 $options = get_option( 'admin_site_enhancements', array() );
220
221 // For main page of this plugin
222
223 if ( is_asenha() ) {
224 wp_enqueue_style( 'asenha-jbox', ASENHA_URL . 'assets/css/jBox.all.min.css', array(), ASENHA_VERSION );
225 wp_enqueue_script( 'asenha-jbox', ASENHA_URL . 'assets/js/jBox.all.min.js', array(), ASENHA_VERSION, false );
226 wp_enqueue_script( 'asenha-jsticky', ASENHA_URL . 'assets/js/jquery.jsticky.mod.min.js', array( 'jquery' ), ASENHA_VERSION, false );
227 wp_enqueue_script( 'asenha-js-cookie', ASENHA_URL . 'assets/js/js.cookie.min.js', array(), ASENHA_VERSION, false );
228
229 // jQuery UI Sortables. In use, e.g. for Admin Interface >> Admin Menu Organizer
230 // Re-register and re-enqueue jQuery UI Core and plugins required for sortable, draggable and droppable when ordering menu items
231 wp_deregister_script( 'jquery-ui-core' );
232 wp_register_script( 'jquery-ui-core', get_site_url() . '/wp-includes/js/jquery/ui/core.min.js', array( 'jquery' ), ASENHA_VERSION, false );
233 wp_enqueue_script( 'jquery-ui-core' );
234
235 if ( version_compare( $wp_version, '5.6.0', '>=' ) ) {
236
237 wp_deregister_script( 'jquery-ui-mouse' );
238 wp_register_script( 'jquery-ui-mouse', get_site_url() . '/wp-includes/js/jquery/ui/mouse.min.js', array( 'jquery-ui-core' ), ASENHA_VERSION, false );
239 wp_enqueue_script( 'jquery-ui-mouse' );
240
241 } else {
242
243 wp_deregister_script( 'jquery-ui-widget' );
244 wp_register_script( 'jquery-ui-widget', get_site_url() . '/wp-includes/js/jquery/ui/widget.min.js', array( 'jquery' ), ASENHA_VERSION, false );
245 wp_enqueue_script( 'jquery-ui-widget' );
246
247 wp_deregister_script( 'jquery-ui-mouse' );
248 wp_register_script( 'jquery-ui-mouse', get_site_url() . '/wp-includes/js/jquery/ui/mouse.min.js', array( 'jquery-ui-core', 'jquery-ui-widget' ), ASENHA_VERSION, false );
249 wp_enqueue_script( 'jquery-ui-mouse' );
250
251 }
252
253 wp_deregister_script( 'jquery-ui-sortable' );
254 wp_register_script( 'jquery-ui-sortable', get_site_url() . '/wp-includes/js/jquery/ui/sortable.min.js', array( 'jquery-ui-mouse' ), ASENHA_VERSION, false );
255 wp_enqueue_script( 'jquery-ui-sortable' );
256
257 wp_deregister_script( 'jquery-ui-draggable' );
258 wp_register_script( 'jquery-ui-draggable', get_site_url() . '/wp-includes/js/jquery/ui/draggable.min.js', array( 'jquery-ui-mouse' ), ASENHA_VERSION, false );
259 wp_enqueue_script( 'jquery-ui-draggable' );
260
261 wp_deregister_script( 'jquery-ui-droppable' );
262 wp_register_script( 'jquery-ui-droppable', get_site_url() . '/wp-includes/js/jquery/ui/droppable.min.js', array( 'jquery-ui-draggable' ), ASENHA_VERSION, false );
263 wp_enqueue_script( 'jquery-ui-droppable' );
264
265 // Script to set behaviour and actions of the sortable menu
266 wp_enqueue_script( 'asenha-custom-admin-menu', ASENHA_URL . 'assets/js/custom-admin-menu.js', array( 'jquery-ui-draggable' ), ASENHA_VERSION, false );
267
268 // CodeMirror. In use, e.g. for Utilities >> Enable Custom Admin / Frontend CSS / ads.txt / app-ads.txt
269 wp_enqueue_style( 'asenha-codemirror', ASENHA_URL . 'assets/css/codemirror/codemirror.min.css', array(), ASENHA_VERSION );
270 wp_enqueue_script( 'asenha-codemirror', ASENHA_URL . 'assets/js/codemirror/codemirror.min.js', array(), ASENHA_VERSION, true );
271 wp_enqueue_script( 'asenha-codemirror-htmlmixed-mode', ASENHA_URL . 'assets/js/codemirror/htmlmixed.js', array( 'asenha-codemirror' ), ASENHA_VERSION, true );
272 wp_enqueue_script( 'asenha-codemirror-xml-mode', ASENHA_URL . 'assets/js/codemirror/xml.js', array( 'asenha-codemirror' ), ASENHA_VERSION, true );
273 wp_enqueue_script( 'asenha-codemirror-javascript-mode', ASENHA_URL . 'assets/js/codemirror/javascript.js', array( 'asenha-codemirror' ), ASENHA_VERSION, true );
274 wp_enqueue_script( 'asenha-codemirror-css-mode', ASENHA_URL . 'assets/js/codemirror/css.js', array( 'asenha-codemirror' ), ASENHA_VERSION, true );
275 wp_enqueue_script( 'asenha-codemirror-markdown-mode', ASENHA_URL . 'assets/js/codemirror/markdown.js', array( 'asenha-codemirror' ), ASENHA_VERSION, true );
276
277 // DataTables. In use, e.g. for Security >> Limit Login Attempts
278 wp_enqueue_style( 'asenha-datatables', ASENHA_URL . 'assets/css/datatables/datatables.min.css', array(), ASENHA_VERSION );
279 wp_enqueue_script( 'asenha-datatables', ASENHA_URL . 'assets/js/datatables/datatables.min.js', array( 'jquery' ), ASENHA_VERSION, false );
280
281 // Main style and script for the admin page
282 wp_enqueue_style( 'asenha-admin-page', ASENHA_URL . 'assets/css/admin-page.css', array( 'asenha-jbox', 'asenha-codemirror', 'asenha-datatables' ), ASENHA_VERSION );
283 wp_enqueue_script( 'asenha-admin-page', ASENHA_URL . 'assets/js/admin-page.js', array( 'asenha-jsticky', 'asenha-jbox', 'asenha-js-cookie', 'asenha-codemirror-htmlmixed-mode', 'asenha-codemirror-xml-mode', 'asenha-codemirror-javascript-mode', 'asenha-codemirror-css-mode', 'asenha-codemirror-markdown-mode', 'asenha-datatables', 'asenha-custom-admin-menu' ), ASENHA_VERSION, false );
284 }
285
286 // Enqueue on all wp-admin
287
288 wp_enqueue_style( 'asenha-wp-admin', ASENHA_URL . 'assets/css/wp-admin.css', array(), ASENHA_VERSION );
289
290 // Content Management >> Show IDs, for list tables in wp-admin, e.g. All Posts page
291
292 if ( ( false !== strpos( $current_screen->base, 'edit' ) ) // List tables for pages, posts, taxonomies
293 || ( false !== strpos( $current_screen->base, 'users' ) ) // Users list table
294 || ( false !== strpos( $current_screen->base, 'upload' ) ) // Media list table
295 ) {
296 wp_enqueue_style( 'asenha-list-table', ASENHA_URL . 'assets/css/list-table.css', array(), ASENHA_VERSION );
297 }
298
299 // Content Management >> Enable Media Replacement
300
301 if ( ( $current_screen->base == 'upload' ) // Media list table
302 || ( $current_screen->id == 'attachment' ) // Media edit page
303 ) {
304 // wp_enqueue_style( 'asenha-jbox', ASENHA_URL . 'assets/css/jBox.all.min.css', array(), ASENHA_VERSION );
305 // wp_enqueue_script( 'asenha-jbox', ASENHA_URL . 'assets/js/jBox.all.min.js', array(), ASENHA_VERSION, false );
306 wp_enqueue_style( 'asenha-media-replace', ASENHA_URL . 'assets/css/media-replace.css', array(), ASENHA_VERSION );
307 wp_enqueue_script( 'asenha-media-replace', ASENHA_URL . 'assets/js/media-replace.js', array(), ASENHA_VERSION, false );
308 }
309
310 // Content Management >> Hide Admin Notices
311 if ( array_key_exists( 'hide_admin_notices', $options ) && $options['hide_admin_notices'] ) {
312 wp_enqueue_style( 'asenha-jbox', ASENHA_URL . 'assets/css/jBox.all.min.css', array(), ASENHA_VERSION );
313 wp_enqueue_script( 'asenha-jbox', ASENHA_URL . 'assets/js/jBox.all.min.js', array(), ASENHA_VERSION, false );
314 wp_enqueue_style( 'asenha-hide-admin-notices', ASENHA_URL . 'assets/css/hide-admin-notices.css', array(), ASENHA_VERSION );
315 wp_enqueue_script( 'asenha-hide-admin-notices', ASENHA_URL . 'assets/js/hide-admin-notices.js', array( 'asenha-jbox' ), ASENHA_VERSION, false );
316 }
317
318 // Utilities >> Multiple User Roles
319 if ( array_key_exists( 'multiple_user_roles', $options ) && $options['multiple_user_roles'] ) {
320 if ( 'user-edit.php' == $hook_suffix || 'user-new.php' == $hook_suffix ) {
321 // Only replace roles dropdown with checkboxes for users that can assign roles to other users, e.g. administrators
322 if ( current_user_can( 'promote_users', get_current_user_id() ) ) {
323 wp_enqueue_script( 'asenha-multiple-user-roles', ASENHA_URL . 'assets/js/multiple-user-roles.js', array( 'jquery' ), ASENHA_VERSION, false );
324 }
325 }
326 }
327
328 }
329
330 /**
331 * Enqueue public scripts
332 *
333 * @since 3.9.0
334 */
335 function asenha_public_scripts( $hook_suffix ) {
336
337 // Get all WP Enhancements options, default to empty array in case it's not been created yet
338 $options = get_option( 'admin_site_enhancements', array() );
339 if ( array_key_exists( 'enable_external_permalinks', $options ) ) {
340 $enable_external_permalinks = $options['enable_external_permalinks'];
341 } else {
342 $enable_external_permalinks = false;
343 }
344
345 wp_enqueue_script( 'asenha-public', ASENHA_URL . 'assets/js/public.js', array( 'jquery' ), ASENHA_VERSION, false );
346 wp_localize_script(
347 'asenha-public',
348 'phpVars',
349 array(
350 'externalPermalinksEnabled' => $enable_external_permalinks,
351 )
352 );
353
354 }
355
356 /**
357 * Add 'Access now' plugin action link.
358 *
359 * @since 1.0.0
360 */
361
362 function asenha_plugin_action_links( $links ) {
363
364 $settings_link = '<a href="tools.php?page=' . ASENHA_SLUG . '">Configure now</a>';
365
366 array_unshift($links, $settings_link);
367
368 return $links;
369
370 }
371
372 /**
373 * Modify footer text
374 *
375 * @since 1.0.0
376 */
377 function asenha_footer_text() {
378
379 if ( is_asenha() ) {
380 ?>
381 <a href="https://bowo.io/asenha-dotorg" target="_blank">Admin Site Enhancements</a> is on <a href="https://bowo.io/asenha-gthb" target="_blank">github</a>.
382 <?php
383 }
384
385 }
386
387 /**
388 * Change WP version number text in footer
389 *
390 * @since 4.8.3
391 */
392 function asenha_footer_version_text()
393 {
394 if ( is_asenha() ) {
395 ?>
396 Also by Bowo &#8594; <a href="https://bowo.io/asenha-wpn" target="_blank">WordPress Newsboard</a>: The latest from 100+ sources
397 <?php
398 } else {
399 echo core_update_footer();
400 }
401 }
402
403 /**
404 * Check if current screen is this plugin's main page
405 *
406 * @since 1.0.0
407 */
408 function is_asenha() {
409
410 $request_uri = sanitize_text_field( $_SERVER['REQUEST_URI'] ); // e.g. /wp-admin/index.php?page=page-slug
411
412 if ( strpos( $request_uri, 'page=' . ASENHA_SLUG ) !== false ) {
413 return true; // Yes, this is the plugin's main page
414 } else {
415 return false; // Nope, this is NOT the plugin's page
416 }
417
418 }