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



wp_secrets_site_health_find_undecryptable › WordPress Function

Seit7.2.0
Veraltetn/v
› wp_secrets_site_health_find_undecryptable ( $network )
Parameter:
  • (bool) $network Whether to check network-scope secrets.
    Erforderlich: Ja
Gibt zurück:
  • (array) List of array( 'name' => ..., 'fingerprint' => ... ).
Definiert in:
Codex:

Finds secrets that fail to decrypt, for one scope.



Quellcode

function wp_secrets_site_health_find_undecryptable( bool $network ): array {
	$entries = $network ? wp_list_network_secrets() : wp_list_secrets();

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

	$broken = array();

	foreach ( $entries as $entry ) {
		$secret = $network ? wp_get_network_secret( $entry['name'] ) : wp_get_secret( $entry['name'] );

		if ( is_wp_error( $secret ) ) {
			$broken[] = array(
				'name'        => $entry['name'],
				'fingerprint' => $entry['fingerprint'],
			);
		}
	}

	return $broken;
}