*/ public static function all() { static $all = null; if ( null !== $all ) { return $all; } $all = array( // Gesamtanzeige (Serverzeit und Zeit bis zum ersten Byte, ms). 'overall_server_fast_ms' => 300, 'overall_server_slow_ms' => 800, 'overall_ttfb_fast_ms' => 500, 'overall_ttfb_slow_ms' => 1500, // Anzahl der "wichtigsten Schritte". 'top_steps' => 3, // 1, 2: Plugin und Theme. 'slow_plugin_share' => 0.30, 'slow_plugin_min_ms' => 100, 'slow_theme_share' => 0.30, 'slow_theme_min_ms' => 50, // 3, 4, 5: Datenbankabfragen. 'many_queries' => 150, 'duplicate_query_count' => 5, 'slow_query_ms' => 50, // 6: Autoload in Byte (Schwelle der Website-Zustandspruefung). 'autoload_bytes' => 800000, // 7, 8: Cache und Hosting (ms). 'no_page_cache_server_ms' => 300, 'slow_hosting_ms' => 300, // 9, 10: PHP. 'min_php_version' => '8.1', 'memory_usage_share' => 0.80, 'memory_min_bytes' => 134217728, // 11 bis 15 (Pro). 'external_call_ms' => 300, 'too_many_plugins' => 30, // 18, 19 (Pro). 'transients_expired' => 5000, 'revisions' => 10000, 'dashboard_ms' => 1000, // 20: Heartbeat-Aufrufe im Messzeitraum. 'heartbeat_calls' => 6, 'heartbeat_per_minute' => 1.5, // 16, 17: Komprimierung (ab dieser Antwortgroesse sinnvoll) und // Browser-Cache (kuerzeste Lebensdauer in Sekunden, die als Cache zaehlt). 'compression_min_bytes' => 1400, 'browser_cache_min_seconds' => 3600, // 22, 23, 24: Signale aus dem HTML. 'version_urls' => 5, 'blocking_scripts' => 3, 'preconnect_host_repeats' => 2, ); return $all; } /** * @param string $key Name des Schwellenwerts. * @return int|float|string * @throws InvalidArgumentException Bei unbekanntem Namen (Tippfehler soll auffallen). */ public static function get( $key ) { $all = self::all(); if ( ! array_key_exists( $key, $all ) ) { throw new InvalidArgumentException( 'Unknown threshold: ' . $key ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped } return $all[ $key ]; } }