Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
50 changes: 50 additions & 0 deletions docs/changelog/0-5-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
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 r65466. Nothing to change before updating."
date: 2026-11-13
---

# 0.5.1

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

| 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 |
| [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 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,
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. | [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
`wp secret` commands into WP-CLI is proposed in
[wp-cli/entity-command#677](https://github.com/wp-cli/entity-command/issues/677).
2 changes: 1 addition & 1 deletion docs/reference/classes.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/spec/scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions secrets-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
7 changes: 6 additions & 1 deletion src/wp-includes/secrets/class-wp-secret.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.' );
}
Expand Down
9 changes: 8 additions & 1 deletion src/wp-includes/secrets/class-wp-secrets-cipher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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".' ) );
}
Expand Down
2 changes: 2 additions & 0 deletions tests/phpunit/test-wp-set-secret-and-wp-get-secret.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
Expand Down
Loading