Make WordPress Core

Opened 12 months ago

Last modified 12 months ago

#58935 new enhancement

White page on admin.php in WordPress Dashboard

Reported by: masoudin's profile masoudin Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch needs-testing
Focuses: administration Cc:

Description

Hello there,

As we all know, plugins (e.g. WooCommerce, etc.) are using wp-admin/admin.php to handle their option pages.

e.g. http://localhost/wp-admin/admin.php?page=wc-admin

The problem is, when we navigate to admin.php without any query string, it shows a white screen. I believe we can improve it by showing a message or redirecting to the main page of the dashboard.

e.g. http://localhost/wp-admin/admin.php

Change History (6)

#1 @rajinsharwar
12 months ago

+ 1
I am more leaning towards redirecting to the admin dashboard when accessed without any query parameters.

This ticket was mentioned in PR #4932 on WordPress/wordpress-develop by @rajinsharwar.


12 months ago
#2

  • Keywords has-patch added; needs-patch removed

Update admin.php for redirecting to the admin dashboard when access without any query parameters.

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

#3 @rajinsharwar
12 months ago

  • Keywords needs-testing added

Patch added

#4 follow-up: @peterwilsoncc
12 months ago

  • Version 6.2.2 deleted

At the end of admin.php WordPress fires a custom action for requests that include either $_GET['action'] or $_POST['action'] (code reference).

The firing of this action does not require a query string parameter to be set, as such making this change would need to consider backward compatibility for plugins POSTing an action to /wp-admin/admin.php without a query string component.

As a proof of concept, I've created a mini-plugin to demonstrate the use of admin.php without a query string parameter.

@masoudin You are correct that the user experience could be nicer for people visiting admin.php without any form data (either via POST or GET) but the existing pull request will require a little refactoring to ensure that backward compatibility is retained.

I've removed the version from this ticket as enhancements don't require a version be specified.

#5 in reply to: ↑ 4 @masoudin
12 months ago

Replying to peterwilsoncc:

Thank you, @peterwilsoncc.

@rajinsharwar

I believe you should refactor your pull request and handle what @peterwilsoncc mentioned.

At the end of admin.php WordPress fires a custom action for requests that include either $_GET['action'] or $_POST['action'] (code reference).

The firing of this action does not require a query string parameter to be set, as such making this change would need to consider backward compatibility for plugins POSTing an action to /wp-admin/admin.php without a query string component.

As a proof of concept, I've created a mini-plugin to demonstrate the use of admin.php without a query string parameter.

@masoudin You are correct that the user experience could be nicer for people visiting admin.php without any form data (either via POST or GET) but the existing pull request will require a little refactoring to ensure that backward compatibility is retained.

I've removed the version from this ticket as enhancements don't require a version be specified.

#6 @rajinsharwar
12 months ago

Thanks for the suggestion @masoudin @peterwilsoncc. Just updated the PR code, can you please take a look now?

Note: See TracTickets for help on using tickets.