\nRequire all denied\n\n\nDeny from all\n\n"); } $index = WP_RECACHE_CACHE_PATH . 'index.php'; if (!file_exists($index)) { file_put_contents($index, ' true, 'separate_mobile_cache' => false, 'exclude_urls' => ['/cart', '/checkout', '/my-account'], 'minify_css' => false, 'minify_js' => false, 'lazyload_images' => false, 'preload_enabled' => false, ]; foreach ($defaults as $key => $value) { if (get_option("wp_recache_{$key}") === false) { add_option("wp_recache_{$key}", $value); } } } /** * Write the standalone cache server required by the advanced-cache.php * drop-in. Must run without WordPress loaded. */ private static function create_cache_server() { $content = ' $value) { if (strpos($name, \'wordpress_logged_in\') === 0) { return; } } $uri = isset($_SERVER[\'REQUEST_URI\']) ? (string) parse_url($_SERVER[\'REQUEST_URI\'], PHP_URL_PATH) : \'/\'; $host = $_SERVER[\'HTTP_HOST\'] ?? \'\'; $file = WP_CONTENT_DIR . \'/cache/wp-recache/\' . md5($host . $uri) . \'.html\'; // With separate mobile cache enabled, files carry a -desktop/-mobile suffix, // so the plain file never exists and serving falls through to WordPress. if (file_exists($file)) { header(\'X-WP-Recache: HIT\'); header(\'X-WP-Recache-Dropin: 1\'); readfile($file); exit; } '; file_put_contents(WP_CONTENT_DIR . '/wp-recache-cache.php', $content); } /** * Create advanced-cache.php drop-in. */ private static function create_advanced_cache() { $advanced_cache = WP_CONTENT_DIR . '/advanced-cache.php'; if (file_exists($advanced_cache)) { return; } $content = '