From 76846bc0a65c2e645b67d536b2e7e940a96e414b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Wed, 3 Jun 2026 08:55:25 -0400 Subject: [PATCH 1/5] improve logic for blocked pages access --- inc-setup/helping_hands.php | 60 ++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/inc-setup/helping_hands.php b/inc-setup/helping_hands.php index 3295fe4..c501f5d 100755 --- a/inc-setup/helping_hands.php +++ b/inc-setup/helping_hands.php @@ -178,17 +178,55 @@ function _mw_adminimize_check_page_access( $slug ) { return false; } - // URI without query parameter, like WP core edit.php. - if ( ! isset( $uri['query'] ) && strpos( $uri['path'], $slug ) !== false ) { - add_action( 'load-' . $slug, '_mw_adminimize_block_page_access' ); - return true; - } + $slug_parts = wp_parse_url( $slug ); + $slug_path = isset( $slug_parts['path'] ) ? $slug_parts['path'] : $slug; + $slug_query = isset( $slug_parts['query'] ) ? $slug_parts['query'] : ''; + $request_query = isset( $uri['query'] ) ? $uri['query'] : ''; + + if ( strpos( $uri['path'], $slug_path ) !== false ) { + if ( empty( $slug_query ) && empty( $request_query ) ) { + add_action( 'load-' . $slug, '_mw_adminimize_block_page_access' ); + return true; + } + + // Slug has no query, but request does + if ( empty( $slug_query ) && ! empty( $request_query ) ) { + wp_parse_str( html_entity_decode( $request_query ), $request_params ); + + // If request has post_type, but slug doesn't, we're on the posts section + if ( isset( $request_params['post_type'] ) && 'post' !== $request_params['post_type'] ) { + return false; + } + + // Request is for default post type or doesn't specify post_type - block it + add_action( 'load-' . $slug, '_mw_adminimize_block_page_access' ); + return true; + } + + // Both have query params - verify slug params match in request + if ( $slug_query && $request_query ) { + wp_parse_str( html_entity_decode( $slug_query ), $slug_params ); + wp_parse_str( html_entity_decode( $request_query ), $request_params ); + + // Check if all slug params are present in request with matching values + $all_match = true; + foreach ( $slug_params as $key => $value ) { + if ( ! isset( $request_params[ $key ] ) || $request_params[ $key ] !== $value ) { + $all_match = false; + break; + } + } + + if ( $all_match ) { + add_action( 'load-' . basename( $uri['path'] ), '_mw_adminimize_block_page_access' ); + return true; + } + } + + return false; + } - // URL is equal the slug of WP menu. - if ( $slug === $url ) { - add_action( 'load-' . basename( $uri['path'] ), '_mw_adminimize_block_page_access' ); - return true; - } + return false; } /** @@ -222,4 +260,4 @@ function _mw_adminimize_is_checked( $option, $haystack ) { } return ''; -} \ No newline at end of file +} From 4adae4d9e90d69c1a6c5cb7da0c4d78ebcb6095c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Wed, 3 Jun 2026 08:55:51 -0400 Subject: [PATCH 2/5] update version to 1.11.14-rc1 --- adminimize.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminimize.php b/adminimize.php index 2caada2..85f2051 100755 --- a/adminimize.php +++ b/adminimize.php @@ -7,7 +7,7 @@ * Description: Visually compresses the administrative meta-boxes so that more admin page content can be initially seen. The plugin that lets you hide 'unnecessary' items from the WordPress administration menu, for all roles of your install. You can also hide post meta controls on the edit-area to simplify the interface. It is possible to simplify the admin in different for all roles. * Author: WP Media * Author URI: https://wp-media.me - * Version: 1.11.13 + * Version: 1.11.14-rc1 * License: GPLv2+ * * Php Version 5.6 From 727826e607ac52a578317724f8520341154c7a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Wed, 10 Jun 2026 11:40:49 -0400 Subject: [PATCH 3/5] update version to 1.11.14 --- adminimize.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminimize.php b/adminimize.php index 85f2051..23fcd19 100755 --- a/adminimize.php +++ b/adminimize.php @@ -7,7 +7,7 @@ * Description: Visually compresses the administrative meta-boxes so that more admin page content can be initially seen. The plugin that lets you hide 'unnecessary' items from the WordPress administration menu, for all roles of your install. You can also hide post meta controls on the edit-area to simplify the interface. It is possible to simplify the admin in different for all roles. * Author: WP Media * Author URI: https://wp-media.me - * Version: 1.11.14-rc1 + * Version: 1.11.14 * License: GPLv2+ * * Php Version 5.6 From da186c9c64dc78250dd1b806df0c9709211a7680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Wed, 10 Jun 2026 11:41:01 -0400 Subject: [PATCH 4/5] update stable tag and changelog --- readme.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index b7a68ea..679f2cb 100755 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: wp_media, Bueltge, inpsyde Tags: customization, administration Requires at least: 4.0 Tested up to: 7.0 -Stable tag: 1.11.13 +Stable tag: 1.11.14 Adminimize that lets you hide 'unnecessary' items from the WordPress backend @@ -37,6 +37,9 @@ Use the installer via back-end of your install or ... 4. Administrator can go to `Settings` > `Adminimize` menu and configure the plugin (Menu, Sub-menu, Meta boxes, ...) == Changelog == += 1.11.14 (2026-06-10) = +* Improve pages access blocking + = 1.11.13 (2026-06-02) = * Revert change blocking unexpected pages From 692c57e32773ccd147ae36706db18eaaf46929bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Wed, 10 Jun 2026 12:06:04 -0400 Subject: [PATCH 5/5] Add additional check for post type matching against specific slug Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- inc-setup/helping_hands.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/inc-setup/helping_hands.php b/inc-setup/helping_hands.php index c501f5d..03d7d85 100755 --- a/inc-setup/helping_hands.php +++ b/inc-setup/helping_hands.php @@ -193,10 +193,14 @@ function _mw_adminimize_check_page_access( $slug ) { if ( empty( $slug_query ) && ! empty( $request_query ) ) { wp_parse_str( html_entity_decode( $request_query ), $request_params ); - // If request has post_type, but slug doesn't, we're on the posts section - if ( isset( $request_params['post_type'] ) && 'post' !== $request_params['post_type'] ) { - return false; - } + // Only treat `post_type` as a differentiator on core post list / add-new screens. + if ( + in_array( $slug_path, array( 'edit.php', 'post-new.php' ), true ) + && isset( $request_params['post_type'] ) + && 'post' !== $request_params['post_type'] + ) { + return false; + } // Request is for default post type or doesn't specify post_type - block it add_action( 'load-' . $slug, '_mw_adminimize_block_page_access' );