WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 12 months ago

#14060 new defect (bug)

Misleading "You do not have sufficient permissions to access this page."

Reported by: hakre Owned by:
Priority: normal Milestone: Future Release
Component: Plugins Version: 3.0
Severity: normal Keywords: has-patch
Cc:

Description

When accessing a page of a plugin in the admin that does not exists any longer, you're told by an error message, that:

You do not have sufficient permissions to access this page.

This message is a little misleading, because there is no such page.

A message that better reflects the decision to display it would be less misleading, e.g.:

The requested page is not accessible.

Attachments (3)

14060.patch (469 bytes) - added by hakre 3 years ago.
Simple Patch
14060-More-Information.diff (479 bytes) - added by envygeeks 3 years ago.
Better description
14060.2.patch (2.0 KB) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (15)

hakre3 years ago

Simple Patch

comment:1 hakre3 years ago

FYI: at the end of Plugin.php there are a lot of functions undocumented and in addition to that important global variables for the admin like $parent_file or $plugin_page are not documented as well.

comment:2 nacin3 years ago

Related, #14039

envygeeks3 years ago

Better description

comment:3 dd323 years ago

  • Keywords needs-patch added; has-patch removed

Both of those proposed wordings are not appropriate IMO.

The major case of that block is to prevent users accessing pages which they do not have access to, The current wording seems appropriate for that (A straight up, Permission denied message).

"The requested page is not accessible." - Doesn't convey the reason for the page being inaccessible.

An alternate solution could be such as follows to give non-existant pages a specific error:

if ( !admin_page_exists() ) {
 do_action...
 wp_die "non-existant page!"
} elseif ( !user_can_access_admin_page() ) {
 do_action...
 wp_die "You dont have access!...";
}

comment:4 Ornani3 years ago

I'm with dd32.

comment:5 hakre3 years ago

For my scenario to check whether or not a page exists, would haven been helpful already.

comment:6 nacin3 years ago

  • Milestone changed from Awaiting Review to Future Release

comment:7 hakre2 years ago

Related: #15394

comment:8 ramiy2 years ago

Related: #18218

SergeyBiryukov2 years ago

comment:9 SergeyBiryukov2 years ago

  • Keywords has-patch added; needs-patch removed

14060.2.patch implements dd32's suggestion.

comment:10 SergeyBiryukov21 months ago

Closed #18662 as a duplicate.

comment:11 jane19 months ago

"The requested page no longer exists."

comment:12 SergeyBiryukov12 months ago

  • Component changed from Accessibility to Plugins
Note: See TracTickets for help on using tickets.