wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_secrets_site_health_count_needing_rotation › WordPress Function

Since7.2.0
Deprecatedn/a
› wp_secrets_site_health_count_needing_rotation ( $network )
Parameters:
  • (bool) $network Whether to check network-scope secrets.
    Required: Yes
Returns:
  • (int)
Defined at:
Codex:

Counts secrets flagged needs_rotation, for one scope.



Source

function wp_secrets_site_health_count_needing_rotation( bool $network ): int {
	$entries = $network ? wp_list_network_secrets() : wp_list_secrets();

	if ( is_wp_error( $entries ) ) {
		return 0;
	}

	$count = 0;

	foreach ( $entries as $entry ) {
		if ( ! empty( $entry['needs_rotation'] ) ) {
			++$count;
		}
	}

	return $count;
}