Make WordPress Core

Opened 9 years ago

Last modified 3 months ago

#14060 reviewing defect (bug)

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

Reported by: hakre Owned by: SergeyBiryukov
Milestone: Future Release Priority: normal
Severity: normal Version: 3.0
Component: Plugins Keywords: has-patch needs-testing has-screenshots early
Focuses: Cc:


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 (6)

14060.patch (469 bytes) - added by hakre 9 years ago.
Simple Patch
14060-More-Information.diff (479 bytes) - added by envygeeks 9 years ago.
Better description
14060.2.patch (2.0 KB) - added by SergeyBiryukov 8 years ago.
14060.3.diff (2.3 KB) - added by Nikschavan 3 years ago.
Refreshed the patch
14060.4.diff (2.4 KB) - added by Nikschavan 21 months ago.
Refreshed the patch with current trunk
page-does-not-exist.png (150.1 KB) - added by Nikschavan 21 months ago.

Download all attachments as: .zip

Change History (29)

9 years ago

Simple Patch

#1 @hakre
9 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.

#2 @nacin
9 years ago

Related, #14039

9 years ago

Better description

#3 @dd32
9 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() ) {
 wp_die "non-existant page!"
} elseif ( !user_can_access_admin_page() ) {
 wp_die "You dont have access!...";

#4 @Ornani
9 years ago

I'm with dd32.

#5 @hakre
9 years ago

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

#6 @nacin
9 years ago

  • Milestone changed from Awaiting Review to Future Release

#7 @hakre
8 years ago

Related: #15394

#8 @ramiy
8 years ago

Related: #18218

#9 @SergeyBiryukov
8 years ago

  • Keywords has-patch added; needs-patch removed

14060.2.patch implements dd32's suggestion.

#10 @SergeyBiryukov
8 years ago

Closed #18662 as a duplicate.

#11 @jane
8 years ago

"The requested page no longer exists."

#12 @SergeyBiryukov
7 years ago

  • Component changed from Accessibility to Plugins

#15 @chriscct7
4 years ago

  • Keywords needs-refresh added

3 years ago

Refreshed the patch

#16 @Nikschavan
3 years ago

  • Keywords needs-testing added; needs-refresh removed

Refreshed the patch by @SergeyBiryukov

21 months ago

Refreshed the patch with current trunk

#18 @Nikschavan
21 months ago

  • Keywords has-screenshots added

Updated the patch with the latest trunk attached a screenshot of the error message.

Can this be targeted for 4.9?

#19 @SergeyBiryukov
21 months ago

  • Milestone changed from Future Release to 4.9
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#20 @SergeyBiryukov
20 months ago

  • Keywords early added
  • Milestone changed from 4.9 to 5.0

#21 @SergeyBiryukov
9 months ago

  • Milestone changed from 5.0 to 5.1

#22 @pento
5 months ago

  • Milestone changed from 5.1 to 5.2

Patch needs testing and review.

#23 @jorbin
3 months ago

  • Milestone changed from 5.2 to Future Release

As 5.2 is now in beta and this was something that needed early attention, I'm removing it from the milestone.

Note: See TracTickets for help on using tickets.