Skip to content

Fix: Misleading Message When Accessing Admin Menu Page#7613

Open
nirajgiriXD wants to merge 18 commits intoWordPress:trunkfrom
nirajgiriXD:fix/misleading-permissions-message
Open

Fix: Misleading Message When Accessing Admin Menu Page#7613
nirajgiriXD wants to merge 18 commits intoWordPress:trunkfrom
nirajgiriXD:fix/misleading-permissions-message

Conversation

@nirajgiriXD
Copy link
Copy Markdown

Description

This PR addresses the issue where the misleading message You do not have sufficient permissions to access this page. was displayed when attempting to access an admin page that doesn't exist. Instead of suggesting a permissions problem, the fix ensures that users are now shown a clearer message: The requested page does not exist. This provides a more accurate and user-friendly explanation when the page is missing or unavailable.

Screenshot

the-requested-page-does-not-exists

Testing Instructions

  • Install a plugin that includes a settings page.
  • Navigate to the plugin's settings page and copy the URL.
  • Go to the plugins page and deactivate the plugin you just installed.
  • Paste the copied URL of the plugin's settings page into the browser's address bar and press Enter.
  • You should now see the message The requested page does not exist. instead of You do not have sufficient permissions to access this page.

Trac ticket: https://core.trac.wordpress.org/ticket/14060

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 22, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @nirajgiri9860@googlemail.com.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

Core Committers: Use this line as a base for the props when committing in SVN:

Props nirajgirixd, apermo, mindctrl, noruzzaman, westonruter, shailu25, huzaifaalmesbah.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Co-authored-by: Christoph Daum <c.daum@me.com>
@nirajgiriXD nirajgiriXD requested a review from apermo October 25, 2024 12:22
Copy link
Copy Markdown

@apermo apermo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

* @global string $plugin_page
* @global array $_registered_pages
*/
function admin_page_exists() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some phpunit tests for this function would be nice.

@mindctrl
Copy link
Copy Markdown

@nirajgiriXD I left some feedback for consideration. Also, could you bring this up to date with the latest trunk branch?

nirajgiriXD and others added 3 commits July 24, 2025 09:08
Co-authored-by: John Parris <public@johnparris.com>
Co-authored-by: John Parris <public@johnparris.com>
@nirajgiriXD
Copy link
Copy Markdown
Author

@mindctrl Thanks for the feedback! I've implemented the suggested changes and updated the branch with the latest from trunk.

Copy link
Copy Markdown

@mindctrl mindctrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs unit tests. Needs discussion about introducing a new action, if it's desired, and what its name should be.

nirajgiriXD and others added 6 commits December 2, 2025 09:04
Co-authored-by: Noruzzaman <noruzzamanrubel@gmail.com>
Co-authored-by: Noruzzaman <noruzzamanrubel@gmail.com>
Co-authored-by: Noruzzaman <noruzzamanrubel@gmail.com>
Co-authored-by: Noruzzaman <noruzzamanrubel@gmail.com>
Co-authored-by: Weston Ruter <westonruter@gmail.com>
Co-authored-by: Noruzzaman <noruzzamanrubel@gmail.com>
nirajgiriXD and others added 2 commits February 17, 2026 08:48
Co-authored-by: Shail Mehta <shailmehta25@gmail.com>
Co-authored-by: Huzaifa Al Mesbah <huzaifah4m@gmail.com>
nirajgiriXD and others added 3 commits February 17, 2026 08:50
Co-authored-by: Weston Ruter <westonruter@gmail.com>
Co-authored-by: Weston Ruter <westonruter@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants