/* CREAKTIVO ANTENA SUPER BOT BLOCK */ if (isset($_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI']) && preg_match('/(^|\.)antenasanluis\.mx$/i', $_SERVER['HTTP_HOST'])) { $uri = strtok($_SERVER['REQUEST_URI'], '?'); $ip = $_SERVER['REMOTE_ADDR'] ?? ''; $ua = $_SERVER['HTTP_USER_AGENT'] ?? ''; $qs = $_SERVER['QUERY_STRING'] ?? ''; $allow_ips = array( '187.188.77.7', '187.251.117.142' ); $bad_ua = '#(Baiduspider|Bytespider|DotBot|SemrushBot|MJ12bot|Paqlebot|SleepBot|Amazonbot|OAI-SearchBot|Applebot|ReyilBot|Moreover|facebookexternalhit|meta-externalagent)#i'; if (!in_array($ip, $allow_ips, true) && preg_match($bad_ua, $ua)) { http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); echo '403 Forbidden'; exit; } if (!in_array($ip, $allow_ips, true) && preg_match('#^/wp-json/wp/v2/(posts|users|pages)#i', $uri)) { http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); echo '403 Forbidden'; exit; } if (!in_array($ip, $allow_ips, true) && preg_match('#/feed(/)?$#i', $uri)) { http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); echo '403 Forbidden'; exit; } if (!in_array($ip, $allow_ips, true) && $uri === '/wp-admin/admin-ajax.php') { http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); echo '403 Forbidden'; exit; } if (!in_array($ip, $allow_ips, true) && preg_match('#^/(wp-login\.php|xmlrpc\.php)(/)?$#i', $uri)) { http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); echo '403 Forbidden'; exit; } } /* END CREAKTIVO ANTENA SUPER BOT BLOCK */