#40762 closed enhancement (fixed)
Login: add canonical admin shorthand URL for login.php
Reported by: | lancewillett | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | minor | Version: | 4.8 |
Component: | Login and Registration | Keywords: | has-patch has-testing-info needs-testing |
Focuses: | Cc: |
Description
Users could type login.php
by accident when trying to access their admin dashboard because wp-login.php
is a known URL and shorthand, and either they don't remember or get it wrong.
Let's make that more friendly.
Right now WordPress treats it as a 404, and tries to redirect it to a valid permalink if it's available.
It'd be more user-friendly to automatically send to login page, or admin if logged in.
Attachments (2)
Change History (24)
#2
@
16 months ago
- Milestone changed from Awaiting Review to 6.4
This seems like a nice little enhancement, moving for 6.4 consideration.
#4
@
16 months ago
- Keywords needs-testing added
Some plugins are used to change wp-login.php to /login/
I assume that it needs to be tested that this enhancement has no side effects and will not break this logic.
This ticket was mentioned in Slack in #core by oglekler. View the logs.
15 months ago
#6
@
15 months ago
Test Report ✅
Env
- WordPress - 6.4-alpha-20230914.125438
- Chrome Version - Version 116
- OS - macOS Monterey V12.3.1
- Theme: Storefront Version: 4.2.0
- PHP - 7.4.0
- Web Server - Apache
- Database - MySQL 5.7.28
Test result
Tested the patch and the patch works fine.
After the patch:
'http://example.com/login.php' redirects to 'http://example.com/wp-login.php'
'http://example.com/login' redirects to 'http://example.com/wp-login.php'
Also checked on sub-domain sites like
'http://example.com/tester/login.php' redirects to 'http://example.com/tester/wp-login.php'
Video Demostration:
https://www.loom.com/share/876864d1d47f4022b86ef21631f94afb
#8
@
15 months ago
Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: REPLACE_WITH_PATCH_URL
Environment
- WordPress: 6.3.1
- PHP: 8.1.10
- Server: Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
- Database: mysqli (Server: 8.0.30 / Client: mysqlnd 8.1.10)
- Browser: Chrome 116.0.0.0 (Windows 10/11)
- Theme: Twenty Twenty-Three 1.2
- MU-Plugins: None activated
- Plugins:
- WordPress Beta Tester 3.5.4
Actual Results
- ✅ Issue resolved with patch.
Additional Notes
- I just tested the patch and it's working fine. Added the video and screenshots.
After Patch Tested
Screenshot:
Video : https://youtu.be/Deodp7VS7UE
#9
@
15 months ago
- Keywords commit added
This is simple enough patch, and it has been tested, so, I am marking this for review to commit.
#10
@
15 months ago
- Owner set to audrasjb
- Status changed from new to reviewing
Self assigning for final review and commit.
#11
follow-up:
↓ 16
@
15 months ago
- Keywords dev-feedback added; commit removed
The patch looks simple, straightforward, but I'm wondering whether we should also add
site_url( 'login.php', 'relative' )
for multisite support.
This ticket was mentioned in Slack in #core by oglekler. View the logs.
15 months ago
This ticket was mentioned in Slack in #core by oglekler. View the logs.
15 months ago
#15
@
15 months ago
- Keywords commit added
This ticket was discussed during bug scrub,
and it was decided that concern is addressed and mark the ticket for review to commit.
Thank to @hellofromtonya and @joemcgill
#16
in reply to:
↑ 11
@
15 months ago
- Keywords dev-feedback removed
Replying to audrasjb:
The patch looks simple, straightforward, but I'm wondering whether we should also add
site_url( 'login.php', 'relative' )
for multisite support.
As discussed during yesterday's scrub, it should be okay to commit the patch ahead of Beta 1 following @tejwanihemant reply (see comment:13).
I'll remove dev-feedback
keyword. However, if additional consideration is needed as noted by @audrasjb, the ticket can be reopened for a follow-up commit.
40762.2.diff is ready for commit consideration.
#17
@
15 months ago
- Keywords needs-testing added; commit removed
Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://core.trac.wordpress.org/attachment/ticket/40762/40762.2.diff
Environment
- WordPress: 6.4-alpha-56267-src
- Localhost: Docker wp-env
- Browser: Chrome and Firefox
- Theme: Twenty Twenty-Three
- MU-Plugins: None activated
- Plugins: None activated
Actual Results
I can reproduce the reported issue.
However, the patch does not resolve the 404 for me ❌ It still is a 404.
#18
follow-up:
↓ 21
@
15 months ago
- Milestone changed from 6.4 to 6.5
Beta 1 starts in ~40 minutes. As the patch did not work for me, I think this ticket needs more time for discussion and testing. Moving it to 6.5.
#20
@
15 months ago
- Milestone changed from 6.5 to 6.4
With commit [56718], moving this back into 6.4.
Hmm, wonder why the fix does not working for me.
#21
in reply to:
↑ 18
@
15 months ago
Replying to hellofromTonya:
As the patch did not work for me, I think this ticket needs more time for discussion and testing. Moving it to 6.5.
Ah, I missed the latest comments. However, it appears to work for me, and there are two successful test reports above.
It is worth noting that the wp_redirect_admin_locations()
function requires permalinks to be enabled, maybe that could be the reason? We can reopen the ticket to add some tests.
Good suggestion!
Your patch works fine as far as taking user to login page with
login.php
.However, the problem I found (not in your code, it works perfectly fine) is WordPress takes me to login page even if I am already logged in! I should rather be on some other page but of course not on login page.
Added a proposed patch at #40768 to prevent this.