Repository navigation
Conversation
Expiration preset added, past date selection issue fixed Expiration edit option removed
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Description
This PR improves the Application Passwords expiration feature on top of PR #11685 by introducing sensible presets, a timezone-aware custom expiration calendar, backend validation, and security UX enhancements aligned with modern token management standards.
Summary of Changes:
7 days30 days(default)90 daysNo expiryCustom dateWP_Application_Passwords(EXPIRY_7_DAYS,EXPIRY_30_DAYS,EXPIRY_90_DAYS,EXPIRY_NO_EXPIRY,EXPIRY_CUSTOM) with a helper methodget_expiry_presets().23:59:59) in the site's configured local timezone (wp_timezone()), converted to UTC ISO format for consistent storage and comparison.minset to the site's current date (wp_date( 'Y-m-d' )), preventing users from picking past dates.WP_Application_Passwords::create_new_application_password()to validate$args['expires']and explicitly reject timestamps in the past with aWP_Error(application_password_past_expiration).WP_Application_Passwords_List_Tableandapplication-passwords.js.tests/phpunit/tests/auth.phpcovering authentication with expired passwords as well as passwords with valid future expiration.tests/phpunit/tests/rest-api/application-passwords.phpverifying that past expiration timestamps are rejected during creation and verifying preset definitions.Trac ticket: https://core.trac.wordpress.org/ticket/53995
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini 3.8 Flash
Used for: Generation of PHPUnit tests, JS code, tests, and translations; refined and verified in a local Docker environment.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.