Repository navigation
Conversation
`wp_load_secrets_dropin()` requires the drop-in inside a function, so a drop-in that assigned `$wp_secrets_keyring = new My_Keyring();` set a local variable. The override was ignored, and secrets were protected by the default keyring instead, with nothing to say so. The three globals are now declared before the require, as `require_wp_db()` does for db.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. |
wp_load_secrets_dropin()requireswp-content/secrets.phpinside a function. A drop-in that sets its override as a plain variable, such as$wp_secrets_keyring = new My_Keyring();, sets a local variable. The override is ignored, and the default keyring protects the secrets instead, with nothing to say so. Raised by jorbin on #66187 comment:45.The three globals are now declared before the require, as
require_wp_db()does fordb.php. Drop-ins that write to$GLOBALS[...]work as before.The declaration only runs when a drop-in exists, so sites without one get no new globals.
Testing
The drop-in loads once, during bootstrap, so this has no unit test. I checked it with a
src/wp-content/secrets.phpthat assigns$wp_secrets_keyringto an anonymous keyring class, and a test asserting that the key manager uses that keyring:derived from LOGGED_IN_KEY and LOGGED_IN_SALT)--group secrets: 381 tests, no failures.load.php.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, running the check above and the tests, and drafting this description. 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.