*/ public static function terms() { return array( 'server_time' => array( 'term' => __( 'Server time', '360-orbit-speed-optimizer' ), 'match' => '/server time/i', 'text' => __( 'How long your server needs to build a page before it starts sending it.', '360-orbit-speed-optimizer' ), ), 'first_byte' => array( 'term' => __( 'First byte (TTFB)', '360-orbit-speed-optimizer' ), 'match' => '/first byte|ttfb/i', 'text' => __( 'The time from the request until the first piece of the answer arrives. It includes the connection, the web server and the server time.', '360-orbit-speed-optimizer' ), ), 'query' => array( 'term' => __( 'Database query', '360-orbit-speed-optimizer' ), 'match' => '/quer(y|ies)|database question/i', 'text' => __( 'A question your site asks its database, for example "give me the latest posts". Every page needs several.', '360-orbit-speed-optimizer' ), ), 'autoload' => array( 'term' => __( 'Autoload', '360-orbit-speed-optimizer' ), 'match' => '/autoload/i', 'text' => __( 'Settings that WordPress loads into memory on every single page view, whether they are needed or not.', '360-orbit-speed-optimizer' ), ), 'page_cache' => array( 'term' => __( 'Page cache', '360-orbit-speed-optimizer' ), 'match' => '/page cache/i', 'text' => __( 'A stored, finished copy of a page that is handed out instantly instead of building the page again.', '360-orbit-speed-optimizer' ), ), 'object_cache' => array( 'term' => __( 'Persistent object cache', '360-orbit-speed-optimizer' ), 'match' => '/object cache/i', 'text' => __( 'A fast memory (Redis or Memcached) where your site keeps answers to repeated database questions, so it does not have to ask again.', '360-orbit-speed-optimizer' ), ), 'compression' => array( 'term' => __( 'Compression (gzip, Brotli)', '360-orbit-speed-optimizer' ), 'match' => '/compress|gzip|brotli/i', 'text' => __( 'Packs pages and files into a smaller package before they are sent, and the browser unpacks them.', '360-orbit-speed-optimizer' ), ), 'browser_cache' => array( 'term' => __( 'Browser caching', '360-orbit-speed-optimizer' ), 'match' => '/browser cach/i', 'text' => __( 'Tells the visitor\'s browser to keep files like images and styles for a while, so they are not downloaded again on the next page.', '360-orbit-speed-optimizer' ), ), 'heartbeat' => array( 'term' => __( 'Heartbeat', '360-orbit-speed-optimizer' ), 'match' => '/heartbeat/i', 'text' => __( 'A regular background call from the admin area to the server, used for autosave and to keep your login alive.', '360-orbit-speed-optimizer' ), ), 'htaccess' => array( 'term' => __( '.htaccess', '360-orbit-speed-optimizer' ), 'match' => '/\.htaccess/i', 'text' => __( 'A small file on Apache servers that controls how the web server treats your site, for example compression and caching rules.', '360-orbit-speed-optimizer' ), ), 'php_memory' => array( 'term' => __( 'PHP memory limit', '360-orbit-speed-optimizer' ), 'match' => '/memory limit/i', 'text' => __( 'The most memory a single page request may use. If it needs more, PHP stops with an error.', '360-orbit-speed-optimizer' ), ), 'php_version' => array( 'term' => __( 'PHP version', '360-orbit-speed-optimizer' ), 'match' => '/\bPHP \d/i', 'text' => __( 'The version of the programming language WordPress runs on. Newer versions are faster and get security updates.', '360-orbit-speed-optimizer' ), ), 'emoji_script' => array( 'term' => __( 'Emoji script', '360-orbit-speed-optimizer' ), 'match' => '/emoji/i', 'text' => __( 'A small script WordPress adds so that emoji also look right in very old browsers.', '360-orbit-speed-optimizer' ), ), 'version_number' => array( 'term' => __( 'Version number in addresses (?ver=)', '360-orbit-speed-optimizer' ), 'match' => '/\?ver=|version number/i', 'text' => __( 'WordPress appends the version to file addresses so browsers fetch a new file after an update. Some caches ignore such files.', '360-orbit-speed-optimizer' ), ), ); } /** * Begriffe, die in einem Text vorkommen. * * @param string $text * @return list Schluessel der Begriffe. */ public static function terms_in( $text ) { $found = array(); foreach ( self::terms() as $key => $term ) { if ( preg_match( $term['match'], (string) $text ) ) { $found[] = $key; } } return $found; } }