Skip to main content

WordPress 7.2 is due on Tuesday, 8 December. If you read the previews written during beta, you will expect it to ship a Secrets API: encrypted storage for the API keys, OAuth client secrets and SMTP passwords that plugins currently leave in the database. It won’t. Core reverted the whole thing on 17 November, three weeks before release, and most of the coverage never caught up. We checked what that means in practice by searching the source of every plugin in the WordPress.org directory.

TL;DR

  • WordPress 7.2 (8 December 2026) ships without the Secrets API. Commit 53ea8006 removed it on 17 November, deleting 12,529 lines.
  • Core gave two reasons: the design was still disputed, and the manage_secrets capabilities were not checked when secrets were written.
  • Nothing breaks on Tuesday. Of 80,316 indexed plugins, only two call the API, and both check that it exists first.
  • The problem the API was meant to fix is still there. 6,020 plugins read credential-named options with get_option(), and only 15 of the 65 biggest contain any encryption call outside bundled libraries.
  • Assume every database copy (backups, staging clones, dumps sent to contractors) carries live credentials, and move the important ones into wp-config.php or host environment variables.

What was promised, and what ships

The Secrets API was proposed in August and documented in a developer note on 11 November. Plugins would call wp_set_secret( 'my-plugin/api-key', $key ) and get back a WP_Secret object that prints as a placeholder when logged or dumped and only gives up its value through reveal(). Values were encrypted with libsodium and kept one previous version for key rotation. Hosts could also plug in their own key storage.

Six days later, commit 53ea8006 took it all out: 17 earlier changesets reverted, secrets.php and its 13 class files deleted. We checked the 7.2 branch tree directly, and no Secrets API files remain. The developer note now opens with a one-line update saying the API “will no longer be shipping with WordPress 7.2”. The 7.2 Field Guide, published three days after the revert, does not mention it. The RC5 announcement confirms 8 December as the release date.

Why it was pulled

The commit message is unusually candid. Feedback on the announcement raised design questions, including “whether writing secrets belongs in the same API as reading host-provided secrets.” Then the clincher: “Further review also found that the manage_secrets and manage_network_secrets capabilities are not checked when secrets are set.” Rather than rework a security API late in the cycle, core removed it.

That is the right call. A credential store whose write path skips its own permission check is worse than no store, because people would trust it. We would rather see core ship this in 7.3 or later and get it right than ship it now and patch it in 7.2.1.

It is also worth being clear about what the API would and would not have done. The developer note says it plainly: the naming prefix “isn’t access control, since any code running on the site can read any secret.” A malicious plugin or a PHP-level compromise would still have read every key. What the API protected against was the database leaking on its own, and that happens far more often than people think.

Who breaks on Tuesday: nobody

A late revert usually means fatal errors from plugins that adopted a beta function early. So we searched all 80,316 plugins indexed by Veloria (the successor to WPDirectory) for calls to wp_set_secret(), wp_get_secret() and their list, delete and network variants.

The search returned eight matches across four plugins. Two are false positives: one plugin defines its own gpt2wp_get_secret(), another only mentions the API in comments and a changelog. The two real callers, a performance profiler with 50 active installs and an accounting connector with fewer than ten, both wrap every call in function_exists() and fall back to their old storage. Neither will fatal.

Nothing breaks, but only because hardly anybody adopted it.

The plaintext problem is the real story

The Secrets API existed because WordPress has no standard place to put a credential. Plugins store them where they store everything else: in wp_options, usually as plain text.

To size that, we ran a second search for get_option() calls that read an option whose name contains api_key, apikey, api_secret, secret_key, access_token, client_secret, api_token or app_password.

Active installs Plugins reading credential-named options Also contain any sodium or OpenSSL encryption call (outside vendor folders)
Any 6,020 598 (9.9%)
1,000+ 623 94 (15.1%)
10,000+ 243 52 (21.4%)
100,000+ 65 15 (23.1%)
1,000,000+ 11 4 (36.4%)

Two caveats, both pointing the same way. First, this undercounts. Many plugins keep credentials inside one serialised settings array with an innocent name, and a name-based search cannot see those. Second, the encryption column is generous. A plugin that calls openssl_encrypt() somewhere has not necessarily encrypted its API keys; it is an upper bound, not a pass mark.

Even the plugins that do encrypt show why core needed to step in. We read WP Mail SMTP (4.10.5), installed on over four million sites. It encrypts the SMTP password with libsodium, but the key lives in wp_options as wp_mail_smtp_mail_key unless you define a WPMS_CRYPTO_KEY constant. Its API keys and OAuth client secrets, for SendGrid, Mailgun, Brevo, Postmark, Gmail, Outlook and the rest, are saved as ordinary sanitised text. WPForms Lite (2.0.5.3) keeps its own libsodium key in wp_options too. None of this is negligence; it is what every plugin author is left to improvise. A database dump that holds the ciphertext and the key in the same table is not much better than plain text. A shared, host-aware keyring was exactly what the Secrets API would have provided.

Where your database actually goes

The common route is not a hacker on the server. It is a copy of the database ending up somewhere less protected than production:

  • Nightly backups synced to cloud storage, often kept for months.
  • Staging and local clones made with a migration plugin, then forgotten.
  • SQL dumps emailed or shared with a freelancer or a new agency during a handover.
  • SQL injection bugs in plugins that let an attacker read tables without running code.

Each of those copies holds working Stripe keys, mail provider tokens and CRM secrets. We showed the same pattern for password reset tokens last month in A Database Dump Gives Working Reset Links in 5 of 12 Auth Libraries, and the Pipedream breach this week is a reminder of what a pile of static keys costs when it leaks.

What to do with your keys now

1. Find them. Run this against your database (adjust the wp_ prefix). The first query catches named options; the second catches well-known key formats hidden inside settings arrays.

SELECT option_name, autoload, LENGTH(option_value) AS bytes
FROM wp_options
WHERE option_name REGEXP 'api_?key|secret|access_token|api_token|client_secret|pass'
ORDER BY option_name;

SELECT option_name FROM wp_options
WHERE option_value REGEXP 'sk_live_|rk_live_|xkeysib-|SG\\.';

2. Move the important ones out of the database. Many established plugins accept credentials as constants in wp-config.php, which never touch wp_options. WP Mail SMTP, for example, reads every mailer’s settings from WPMS_* constants once WPMS_ON is true. Better still, have your host or container inject the value as an environment variable and read it in wp-config.php:

define( 'WPMS_ON', true );
define( 'WPMS_SMTP_PASS', getenv( 'SMTP_PASS' ) );

If a plugin you rely on supports neither, ask the vendor; it is the closest thing to the Secrets API you will get this year.

3. Scope and rotate. Use restricted keys where the provider offers them (Stripe does), lock browser-facing keys such as Maps keys to your domains, and rotate anything that has been in a database copy you no longer control.

4. Treat database copies as secrets. Encrypt backups, expire staging clones, and scrub credentials from any dump before it leaves your team.

5. If you build plugins, prepare for the API’s return. Read credentials through one function in your code, support a constant and an environment variable, and wrap any future core call in function_exists() as the two early adopters did. When a Secrets API does ship, you can switch with a single change.

The bigger picture

WordPress has always kept its secrets in the database. This release was meant to change that, and it was pulled for good reasons. Until the API comes back, managing credentials is still your job, not core’s. With PHP version churn already making upgrades harder (see Half of WordPress Ran Unsupported PHP Last January), Tuesday’s release is a good moment to audit both.

REPTILEHAUS maintains and upgrades WordPress sites for businesses that cannot afford a broken release day, and our DevOps team sets up environment-based secret handling for WordPress, Node and container platforms. If you want your keys out of wp_options before the next database copy leaves the building, get in touch.

📷 Photo by Alex Waltz on Unsplash