Repository navigation
Conversation
`WP_Secrets_Provider`, `WP_Secrets_Store` and `WP_Secrets_Keyring` were interfaces. Once 7.2 ships, adding a method to an interface is a fatal error in every drop-in that implements it, so they could never change. As abstract classes, a later release can add a method with a default implementation, and existing drop-ins keep working. Drop-ins now extend these classes. The method signatures are unchanged. The files are renamed from `interface-wp-secrets-*.php` to `class-wp-secrets-*.php`. See #66187.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
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. |
# Conflicts: # src/wp-includes/secrets/class-wp-secrets-keyring.php # src/wp-includes/secrets/class-wp-secrets-provider.php
|
@whyisjake Done: trunk is merged in at 511b568. The two conflicts were the |
WP_Secrets_Provider,WP_Secrets_StoreandWP_Secrets_Keyringare now abstract classes instead of interfaces, as jorbin suggested on #66187 comment:45.Once 7.2 ships, adding a method to an interface is a fatal error in every drop-in that implements it, so the interfaces could never change. With abstract classes, a later release can add a method with a default implementation, and existing drop-ins keep working. Two such methods are already likely: a way for a provider or keyring to say whether it is usable (see
wp_is_secrets_api_available()in #15258), and a key re-wrapping path for 7.3.What changes
abstract classwithabstract publicmethods. The method signatures are unchanged.extendsinstead ofimplements.interface-wp-secrets-*.phptoclass-wp-secrets-*.php, andwp-settings.phploads them under the new names.wp_load_secrets_dropin().For drop-in authors, the change is
implements→extends. A drop-in can no longer extend some other base class, but it can still wrap one.Testing
--group secrets: 384 tests on single site and 392 on multisite, no failures (PHP 8.5, MySQL 8.4).This conflicts with #15200, which adds
#[\SensitiveParameter]towrap()andset()in the files renamed here. Whichever lands second needs a small rebase.Trac ticket: https://core.trac.wordpress.org/ticket/66187
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Making the change, the test and this description, and running the tests. I reviewed the change and the results.
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.