VELOX_VERSION, 'api' => VELOX_API_VERSION, 'cache_enabled' => (bool) $s['cache_enabled'], 'static_serve' => (bool) $s['static_serve'], 'pages' => (int) $stats['pages'], 'size_bytes' => (int) $stats['size'], 'last_purge' => (int) get_option( 'velox_last_purge', 0 ), 'preload_remaining' => (int) Velox_Preload::remaining(), 'optimizations' => $on, ); } } if ( ! function_exists( 'velox_get_server_stats' ) ) { /** * Current server values plus the hourly history of the last 7 days. * * @return array{now:array,history:array} */ function velox_get_server_stats() { return array( 'now' => Velox_Server::now(), 'history' => Velox_Server::history(), ); } } if ( ! function_exists( 'velox_get_vitals' ) ) { /** * Core Web Vitals from real visitors (75th percentile per device), empty when measuring is off. * * @return array */ function velox_get_vitals() { return Velox_Settings::get( 'rum' ) ? Velox_Vitals::summary() : array(); } } if ( ! function_exists( 'velox_purge_url' ) ) { /** * Clears the cached copies of one page of this site. * * @param string $url Full URL on this site. * @return bool False when the URL belongs to another host. */ function velox_purge_url( $url ) { $url = esc_url_raw( (string) $url ); if ( '' === $url || strtolower( (string) wp_parse_url( $url, PHP_URL_HOST ) ) !== strtolower( (string) wp_parse_url( home_url(), PHP_URL_HOST ) ) ) { return false; } Velox_Cache::purge_url( $url ); return true; } } if ( ! function_exists( 'velox_purge_all' ) ) { /** Clears the whole page cache (and Cloudflare, when connected). */ function velox_purge_all() { Velox_Cache::purge_all(); } } if ( ! function_exists( 'velox_preload' ) ) { /** Starts rebuilding the cache in the background (when preload is on). */ function velox_preload() { Velox_Preload::schedule(); } }