You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1b7c9d1
Browse filesBrowse the repository at this point in the historyBrowse files
Secrets API: Report a keyring's own error when it cannot unlock the stored secrets.
Addresses review. Only the default keyring reads `wp-config.php`, so the critical key source result names `WP_SECRETS_KEY` only for it. A keyring from a `secrets.php` drop-in, such as a key service that is unreachable or was installed without re-wrapping the root key, has its own error shown instead. The label no longer says the key "does not match", which does not fit an outage.
With `WP_SECRETS_KEY` now required, the key source and undecryptable results no longer mention `LOGGED_IN_KEY` and `LOGGED_IN_SALT`. When a drop-in replaces the provider, Site Health Info marks the keyring class and key source as not used, instead of describing a keyring that the site does not use.
See #66380, #66187.
? __( 'This happens when WP_SECRETS_KEY was changed or removed after secrets were stored. Restoring the previous value fixes it.' )
155
+
: sprintf(
156
+
/* translators: %s: Error message from the keyring. */
157
+
__( 'The keyring of the secrets.php drop-in reported: %s' ),
158
+
$root_key->get_error_message()
159
+
);
160
+
137
161
returnwp_secrets_site_health_result(
138
162
'secrets_api_key_source',
139
-
__( 'Secrets API key does not match the stored secrets' ),
163
+
__( 'Secrets API cannot unlock the stored secrets' ),
140
164
'critical',
141
165
sprintf(
142
-
'<p>%s</p>',
143
-
esc_html__( 'The configured key cannot decrypt the root key that protects the stored secrets, so no secret can be read or saved. This happens when WP_SECRETS_KEY, LOGGED_IN_KEY, or LOGGED_IN_SALT changed after secrets were stored. Restoring the previous value fixes it.' )
166
+
'<p>%s</p><p>%s</p>',
167
+
esc_html__( 'The configured key cannot decrypt the root key that protects the stored secrets, so no secret can be read or saved.' ),
168
+
esc_html( $cause )
144
169
)
145
170
);
146
171
}
@@ -257,7 +282,7 @@ function wp_secrets_site_health_test_undecryptable(): array {
257
282
'<p>%s</p><ul>%s</ul><p>%s</p>',
258
283
esc_html__( 'The following secrets exist but could not be decrypted with the current key.' ),
259
284
$items,
260
-
esc_html__( 'This can happen after WP_SECRETS_KEY, LOGGED_IN_KEY, or LOGGED_IN_SALT changed, after restoring a database backup without its matching key, or after a failed key rotation. Restoring the previous key makes the secrets readable again. Otherwise, each credential must be entered again.' )
285
+
esc_html__( 'This can happen after WP_SECRETS_KEY was changed or removed, after restoring a database backup without its matching key, or after a failed key rotation. Restoring the previous key makes the secrets readable again. Otherwise, each credential must be entered again.' )
261
286
)
262
287
);
263
288
}
@@ -392,8 +417,9 @@ function wp_secrets_site_health_count_needing_rotation( bool $network ) {
0 commit comments