From ad4b8143df02d57e82fed4cec408958f040c59a8 Mon Sep 17 00:00:00 2001 From: Eric Mann Date: Wed, 11 Nov 2026 11:21:29 -0800 Subject: [PATCH 1/3] Release 0.5.1 src/ follows core trunk through r65395: the Site Health checks are methods of WP_Site_Health and WP_Debug_Data (r65394), and the internal helpers are marked private (r65395). wp secret health no longer fatals on a core that ships the API. No breaking changes. --- SECURITY.md | 2 +- docs/changelog/0-5-1.md | 44 +++++++++++++++++++++++++++++++++++++++++ docs/spec/scope.md | 2 +- secrets-api.php | 4 ++-- 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 docs/changelog/0-5-1.md diff --git a/SECURITY.md b/SECURITY.md index 60d0616..cc3c771 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -25,7 +25,7 @@ explanation rather than silence. ## Scope -This is a pre-release feature plugin (`0.5.0`). The API is in WordPress core trunk for 7.2, and +This is a pre-release feature plugin (`0.5.1`). The API is in WordPress core trunk for 7.2, and `src/` follows it. There is no supported-version matrix yet: `main` is the only supported branch, and fixes land there. diff --git a/docs/changelog/0-5-1.md b/docs/changelog/0-5-1.md new file mode 100644 index 0000000..20c75dd --- /dev/null +++ b/docs/changelog/0-5-1.md @@ -0,0 +1,44 @@ +--- +title: "0.5.1" +description: "The Site Health checks follow core into WP_Site_Health and WP_Debug_Data, and src/ follows core trunk through r65395. Nothing to change before updating." +date: 2026-11-11 +--- + +# 0.5.1 + +Released 2026-11-11. In this release `src/` and the shared test helpers match WordPress core trunk +as of [r65395](https://core.trac.wordpress.org/changeset/65395), byte for byte. There are no +breaking changes, and nothing to do before updating. + +## Ported from core + +| Changeset | Change | Props | +|---|---|---| +| [r65394](https://core.trac.wordpress.org/changeset/65394) | The Site Health checks are methods of `WP_Site_Health` and `WP_Debug_Data`, not functions in `wp-admin/includes/secrets-site-health.php`. The statuses, labels and descriptions are unchanged. The Info section's key is now `wp-secrets-api`, and the results use the blue Security badge. | ericmann, peterwilsoncc, mindctrl | +| [r65395](https://core.trac.wordpress.org/changeset/65395) | The `_wp_secrets_*()` helpers are marked `@access private`. | wildworks | + +whyisjake committed both. + +A plugin can't add methods to core's classes, so before 7.2 the plugin registers copies of core's +methods through the `site_status_tests` and `debug_information` filters, under the same test IDs, +labels and Info key. A test in CI fails when core changes one of the originals. + +## Fixed + +- **`wp secret health` on 7.2.** It loaded the Site Health file that r65394 removed, which is a + fatal error on a core that ships the API. It now runs core's checks on 7.2 and the plugin's + copies before 7.2. + +## In review in core + +Each of these will be ported once committed. + +| Ticket | Change | PR | +|---|---|---| +| [#66424](https://core.trac.wordpress.org/ticket/66424) | A failed read of a secret's record, or of the list of secrets, no longer reads as a missing secret or an empty list. | [NNNNN](https://github.com/WordPress/wordpress-develop/pull/NNNNN) | +| [#66187](https://core.trac.wordpress.org/ticket/66187) | Two more parameters that receive a secret value or key are marked `#[\SensitiveParameter]`. | [15904](https://github.com/WordPress/wordpress-develop/pull/15904) | + +WP-CLI's `wp config create` will generate the key as well +([wp-cli/config-command#235](https://github.com/wp-cli/config-command/pull/235)). Moving the +`wp secret` commands into WP-CLI is proposed in +[wp-cli/entity-command#677](https://github.com/wp-cli/entity-command/issues/677). diff --git a/docs/spec/scope.md b/docs/spec/scope.md index 4882ef4..25c30fe 100644 --- a/docs/spec/scope.md +++ b/docs/spec/scope.md @@ -15,7 +15,7 @@ scope", and "Timeline" in the [proposal][proposal]. ## As built -**The plugin.** `secrets-api.php` declares version `0.5.0`, `Requires at least: 6.8`, and +**The plugin.** `secrets-api.php` declares version `0.5.1`, `Requires at least: 6.8`, and `Requires PHP: 7.4`. **Core-bound versus plugin-only.** Everything under `src/` is written to be copied into diff --git a/secrets-api.php b/secrets-api.php index ebb2288..a90c2c1 100644 --- a/secrets-api.php +++ b/secrets-api.php @@ -3,7 +3,7 @@ * Plugin Name: Secrets API * Plugin URI: https://github.com/ericmann/secrets-api * Description: Feature plugin for the WordPress Secrets API proposed for 7.2. Encrypted, versioned credential storage with pluggable storage and keyring back ends. - * Version: 0.5.0 + * Version: 0.5.1 * Requires at least: 6.8 * Requires PHP: 7.4 * License: GPL-2.0-or-later @@ -25,7 +25,7 @@ /** * Plugin version. */ -define( 'WP_SECRETS_API_PLUGIN_VERSION', '0.5.0' ); +define( 'WP_SECRETS_API_PLUGIN_VERSION', '0.5.1' ); /** * The WordPress version expected to ship the Secrets API in core. From a1a213668e204956412a8fc479a68d1e4261a2de Mon Sep 17 00:00:00 2001 From: Eric Mann Date: Fri, 13 Nov 2026 06:16:58 -0800 Subject: [PATCH 2/3] Mark two more parameters as sensitive Ports r65466: WP_Secret::__construct()'s $value and WP_Secrets_Cipher::validate_common()'s $master_key. --- docs/reference/classes.md | 2 +- src/wp-includes/secrets/class-wp-secret.php | 7 ++++++- src/wp-includes/secrets/class-wp-secrets-cipher.php | 9 ++++++++- tests/phpunit/test-wp-set-secret-and-wp-get-secret.php | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/reference/classes.md b/docs/reference/classes.md index 1c9d2e1..0e98a30 100644 --- a/docs/reference/classes.md +++ b/docs/reference/classes.md @@ -440,7 +440,7 @@ Nothing outside this API constructs a WP_Secret in normal use; the values passed here come from _wp_secrets_get() having just decrypted them. ```php -public function __construct( string $name, $value, string $fingerprint ) +public function __construct( string $name, #[\SensitiveParameter] $value, string $fingerprint ) ``` | Parameter | Type | Description | diff --git a/src/wp-includes/secrets/class-wp-secret.php b/src/wp-includes/secrets/class-wp-secret.php index d8db880..7c236cd 100644 --- a/src/wp-includes/secrets/class-wp-secret.php +++ b/src/wp-includes/secrets/class-wp-secret.php @@ -97,7 +97,12 @@ final class WP_Secret implements JsonSerializable { * @throws InvalidArgumentException If $name or $fingerprint is empty, or if $value * is not a string. $value may be empty. */ - public function __construct( string $name, $value, string $fingerprint ) { + public function __construct( + string $name, + #[\SensitiveParameter] + $value, + string $fingerprint + ) { if ( '' === $name ) { throw new InvalidArgumentException( 'WP_Secret requires a non-empty name.' ); } diff --git a/src/wp-includes/secrets/class-wp-secrets-cipher.php b/src/wp-includes/secrets/class-wp-secrets-cipher.php index 4880d02..ccc88b7 100644 --- a/src/wp-includes/secrets/class-wp-secrets-cipher.php +++ b/src/wp-includes/secrets/class-wp-secrets-cipher.php @@ -314,7 +314,14 @@ private function build_aad( string $purpose, string $scope, int $site_id, string * @phpstan-param 'site'|'network' $scope * @phpstan-param WP_Secret_Version::CURRENT|WP_Secret_Version::PREVIOUS $slot */ - private function validate_common( string $master_key, string $scope, int $site_id, string $name, string $slot ) { + private function validate_common( + #[\SensitiveParameter] + string $master_key, + string $scope, + int $site_id, + string $name, + string $slot + ) { if ( ! in_array( $scope, array( 'site', 'network' ), true ) ) { return $this->invalid_argument( __( 'The scope must be "site" or "network".' ) ); } diff --git a/tests/phpunit/test-wp-set-secret-and-wp-get-secret.php b/tests/phpunit/test-wp-set-secret-and-wp-get-secret.php index 2c441da..b63013f 100644 --- a/tests/phpunit/test-wp-set-secret-and-wp-get-secret.php +++ b/tests/phpunit/test-wp-set-secret-and-wp-get-secret.php @@ -416,6 +416,8 @@ public static function data_parameters_that_receive_a_secret_value(): array { 'WP_Secrets_Cipher::encrypt_value() key' => array( array( WP_Secrets_Cipher::class, 'encrypt_value' ), 'master_key' ), 'WP_Secrets_Cipher::decrypt_value() key' => array( array( WP_Secrets_Cipher::class, 'decrypt_value' ), 'master_key' ), 'WP_Secrets_Cipher::fingerprint() key' => array( array( WP_Secrets_Cipher::class, 'fingerprint' ), 'master_key' ), + 'WP_Secrets_Cipher::validate_common() key' => array( array( WP_Secrets_Cipher::class, 'validate_common' ), 'master_key' ), + 'WP_Secret::__construct()' => array( array( WP_Secret::class, '__construct' ), 'value' ), 'WP_Secrets_Keyring::wrap()' => array( array( WP_Secrets_Keyring::class, 'wrap' ), 'key_material' ), 'WP_Secrets_Config_Key_Provider::wrap()' => array( array( WP_Secrets_Config_Key_Provider::class, 'wrap' ), 'key_material' ), 'WP_Secrets_Broken_Keyring::wrap()' => array( array( WP_Secrets_Broken_Keyring::class, 'wrap' ), 'key_material' ), From 863a4ab205bbae6a4c31024c1f14abe0196ecb89 Mon Sep 17 00:00:00 2001 From: Eric Mann Date: Fri, 13 Nov 2026 06:17:21 -0800 Subject: [PATCH 3/3] Update the 0.5.1 changelog for r65466 --- docs/changelog/0-5-1.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/changelog/0-5-1.md b/docs/changelog/0-5-1.md index 20c75dd..1735616 100644 --- a/docs/changelog/0-5-1.md +++ b/docs/changelog/0-5-1.md @@ -1,13 +1,13 @@ --- title: "0.5.1" -description: "The Site Health checks follow core into WP_Site_Health and WP_Debug_Data, and src/ follows core trunk through r65395. Nothing to change before updating." -date: 2026-11-11 +description: "The Site Health checks follow core into WP_Site_Health and WP_Debug_Data, and src/ follows core trunk through r65466. Nothing to change before updating." +date: 2026-11-13 --- # 0.5.1 -Released 2026-11-11. In this release `src/` and the shared test helpers match WordPress core trunk -as of [r65395](https://core.trac.wordpress.org/changeset/65395), byte for byte. There are no +Released 2026-11-13. In this release `src/` and the shared test helpers match WordPress core trunk +as of [r65466](https://core.trac.wordpress.org/changeset/65466), byte for byte. There are no breaking changes, and nothing to do before updating. ## Ported from core @@ -16,8 +16,9 @@ breaking changes, and nothing to do before updating. |---|---|---| | [r65394](https://core.trac.wordpress.org/changeset/65394) | The Site Health checks are methods of `WP_Site_Health` and `WP_Debug_Data`, not functions in `wp-admin/includes/secrets-site-health.php`. The statuses, labels and descriptions are unchanged. The Info section's key is now `wp-secrets-api`, and the results use the blue Security badge. | ericmann, peterwilsoncc, mindctrl | | [r65395](https://core.trac.wordpress.org/changeset/65395) | The `_wp_secrets_*()` helpers are marked `@access private`. | wildworks | +| [r65466](https://core.trac.wordpress.org/changeset/65466) | `WP_Secret::__construct()`'s `$value` and `WP_Secrets_Cipher::validate_common()`'s `$master_key` are marked `#[\SensitiveParameter]`, so they are redacted from stack traces. | johnbillion | -whyisjake committed both. +whyisjake committed r65394 and r65395, and johnbillion committed r65466. A plugin can't add methods to core's classes, so before 7.2 the plugin registers copies of core's methods through the `site_status_tests` and `debug_information` filters, under the same test IDs, @@ -35,8 +36,13 @@ Each of these will be ported once committed. | Ticket | Change | PR | |---|---|---| -| [#66424](https://core.trac.wordpress.org/ticket/66424) | A failed read of a secret's record, or of the list of secrets, no longer reads as a missing secret or an empty list. | [NNNNN](https://github.com/WordPress/wordpress-develop/pull/NNNNN) | -| [#66187](https://core.trac.wordpress.org/ticket/66187) | Two more parameters that receive a secret value or key are marked `#[\SensitiveParameter]`. | [15904](https://github.com/WordPress/wordpress-develop/pull/15904) | +| [#66424](https://core.trac.wordpress.org/ticket/66424) | A failed read of a secret's record, or of the list of secrets, no longer reads as a missing secret or an empty list. | [15974](https://github.com/WordPress/wordpress-develop/pull/15974) | + +Seven multisite defects were reported against 7.2 after this release was prepared, from +[#66686](https://core.trac.wordpress.org/ticket/66686) to +[#66692](https://core.trac.wordpress.org/ticket/66692). They affect this release too: network +secrets stored before a single site is converted to multisite, and secrets on installs with more +than one network. WP-CLI's `wp config create` will generate the key as well ([wp-cli/config-command#235](https://github.com/wp-cli/config-command/pull/235)). Moving the