Opened 29 hours ago
Last modified 79 minutes ago
#65820 new enhancement
Default first check for is_login()
| Reported by: | josephscott | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Login and Registration | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests close |
| Cc: | Focuses: |
Description
The is_login() function is an easy way to tell if the request is for the login page, see https://core.trac.wordpress.org/ticket/19898. The trade off is that wp_login_url() triggers a series of other activities that are more work than is needed for the default case where the login page has not moved.
Before going through that work we could check quickly check for the default condition as a fast path alternative.
Change History (2)
This ticket was mentioned in PR #12864 on WordPress/wordpress-develop by @josephscott.
29 hours ago
#1
- Keywords has-patch has-unit-tests added
#2
in reply to: ↑ description
@
79 minutes ago
- Keywords close added
Replying to josephscott:
The trade off is that
wp_login_url()triggers a series of other activities that are more work than is needed
What activities are these? It seems to be just constructing the URL. Given that the end result is a login_url filter, it seems this function needs to always be called to determine whether it is the login page.
Maybe I replaced wp-login.php with something else entirely and I require login via my-super-secret-login.php. As it stands right now, your PR would cause is_login() check to return true when in actuality it isn't the login page.
So I think the existing is_login() logic is sound and it isn't doing unnecessary work.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
https://core.trac.wordpress.org/ticket/65820
AI assistance: Yes
Tool(s): Claude
Model(s): Opus 4.8
Used for: Claude wrote the tests in this change