wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_secrets_site_health_test_needs_rotation › WordPress Function

Seit7.2.0
Veraltetn/v
› wp_secrets_site_health_test_needs_rotation ( Keine Parameter )
Gibt zurück:
  • (array)
Definiert in:
Codex:

Site Health test: are any secrets flagged as needing rotation?



Quellcode

function wp_secrets_site_health_test_needs_rotation(): array {
	$count = wp_secrets_site_health_count_needing_rotation( false );

	if ( is_multisite() && is_super_admin() ) {
		$count += wp_secrets_site_health_count_needing_rotation( true );
	}

	if ( 0 === $count ) {
		return wp_secrets_site_health_result(
			'secrets_api_needs_rotation',
			__( 'No secrets are pending rotation' ),
			'good',
			sprintf( '<p>%s</p>', esc_html__( 'No secret is flagged as needing rotation.' ) )
		);
	}

	return wp_secrets_site_health_result(
		'secrets_api_needs_rotation',
		__( 'Some secrets are pending rotation' ),
		'recommended',
		sprintf(
			'<p>%s</p>',
			esc_html(
				sprintf(
					/* translators: %d: Number of secrets flagged for rotation. */
					_n(
						'%d secret was imported from an existing option and is flagged for rotation. A credential that sat in a plain option has already been through whatever backups and replication paths that option went through; re-entering it with a new value is recommended.',
						'%d secrets were imported from existing options and are flagged for rotation. A credential that sat in a plain option has already been through whatever backups and replication paths that option went through; re-entering each with a new value is recommended.',
						$count
					),
					$count
				)
			)
		)
	);
}