[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-admin/includes/ -> secrets-site-health.php (summary)

Secrets API: Site Health integration

File Size: 367 lines (11 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 8 functions

  wp_secrets_site_health_tests()
  wp_secrets_site_health_result()
  wp_secrets_site_health_test_key_source()
  wp_secrets_site_health_test_undecryptable()
  wp_secrets_site_health_find_undecryptable()
  wp_secrets_site_health_test_needs_rotation()
  wp_secrets_site_health_count_needing_rotation()
  wp_secrets_site_health_debug_info()

Functions
Functions that are not part of a class:

wp_secrets_site_health_tests( $tests )   X-Ref
Registers the Secrets API's Site Health tests.

No settings screen – the proposal defers that to 7.3 – but the health signal an
operator needs to notice a broken key, a weak key source, or a pending rotation is
in scope now.

return: array<string, array<string, array<string, mixed>>>
param: array<string, array<string, array<string, mixed>>> $tests Existing Site Health tests.

wp_secrets_site_health_result( string $test, string $label, string $status, string $description )   X-Ref
Builds the standard shape a Site Health test callback returns.

return: array
param: string $test        The test's own identifier, matching the key registered
param: string $label       Short label for the test result.
param: string $status      One of 'good', 'recommended', 'critical'.
param: string $description HTML description, normally one or more <p> elements.

wp_secrets_site_health_test_key_source()   X-Ref
Site Health test: is the site key a dedicated constant, or a weaker fallback?

return: array

wp_secrets_site_health_test_undecryptable()   X-Ref
Site Health test: does every stored secret still decrypt?

Network secrets are included only for a super admin on a multisite install –
never shown to a site administrator who is not one.

return: array

wp_secrets_site_health_find_undecryptable( bool $network )   X-Ref
Finds secrets that fail to decrypt, for one scope.

return: array List of array( 'name' => ..., 'fingerprint' => ... ).
param: bool $network Whether to check network-scope secrets.

wp_secrets_site_health_test_needs_rotation()   X-Ref
Site Health test: are any secrets flagged as needing rotation?

return: array

wp_secrets_site_health_count_needing_rotation( bool $network )   X-Ref
Counts secrets flagged needs_rotation, for one scope.

return: int
param: bool $network Whether to check network-scope secrets.

wp_secrets_site_health_debug_info( $info )   X-Ref
Adds a Secrets API section to Site Health's debug information.

Counts and class names only – no secret values, and no fingerprints. Network
scope figures are included only for a super admin on a multisite install.

return: array<string, array<string, mixed>>
param: array<string, array<string, mixed>> $info Existing debug information sections.



Generated : Wed Oct 14 08:20:33 2026 Cross-referenced by PHPXref