Opened 3 years ago
Last modified 3 months ago
#58935 new enhancement
White page on admin.php in WordPress Dashboard
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | has-patch dev-feedback |
| 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 (7)
This ticket was mentioned in PR #4932 on WordPress/wordpress-develop by @rajinsharwar.
3 years 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
#4
follow-up:
↓ 5
@
3 years 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
@
3 years 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.phpWordPress 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.phpwithout a query string component.
As a proof of concept, I've created a mini-plugin to demonstrate the use of
admin.phpwithout a query string parameter.
@masoudin You are correct that the user experience could be nicer for people visiting
admin.phpwithout 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
@
3 years ago
Thanks for the suggestion @masoudin @peterwilsoncc. Just updated the PR code, can you please take a look now?
#7
@
3 months ago
- Keywords dev-feedback added; needs-testing removed
Patch Testing Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/4932
Environment
- WordPress: 7.0-alpha-61215-src
- PHP: 8.2.29
- Server: nginx/1.29.4
- Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
- Browser: Chrome 144.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.1
Steps taken
- Login to WordPress dashboard
- Navigate to
/wp-admin/admin.php - Confirm that white page being displayed
- Apply patch
- Navigate to
/wp-admin/admin.phpagain - ✅ Patch is solving the problem. It redirects to
/wp-admin/
Expected result
- We are expecting to redirect to dashboard home if no valid query params are added to
/admin.php
Screenshots/Screencast with results
Before: https://i.imgur.com/IPt2DOz.mp4
+ 1
I am more leaning towards redirecting to the admin dashboard when accessed without any query parameters.