Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
MichaelRafael

Wordpress Auto Add Admin

Recommended Posts

<?php
// Admin User Auto Add 
// Don't Forget to remove this script after user add ! 
// Put this file in your Wordpress /Public_html Directory and run it from your browser \!/


require_once('wp-blog-header.php');
require_once('wp-includes/registration.php');

// Change this , you are free to put the logins you want ^_^
$newusername = 'admin';
$newpassword = 'admin';
$newemail = 'youremailhere';

// Set The Configs vars
if ( $newpassword != 'YOURPASSWORD' && $newemail != 'YOUREMAIL@TEST.com' && $newusername !='YOURUSERNAME'  ) 
{
	// Check that the user doesn't exist already
	if ( !username_exists($newusername) && !email_exists($newemail) ) 
	{
		// Create the admin user and set the role to Administrator
		$user_id = wp_create_user( $newusername, $newpassword, $newemail);
		if ( is_int($user_id) )
		{
			$wp_user_object = new WP_User($user_id);
			$wp_user_object->set_role('administrator');
			echo 'Successfully created new admin user. Now delete this script ^_^ and dont be lazy !  Username:admin Password:admin';
		} 
		else {
			echo 'Error with wp_insert_user. No users were created , you are drunk man xD go watch cartoon !';
		}
	} 
	else {
		echo 'This user or email already exists , you are drunk man xD put glasses °_° !';
	}
} 
else {
	echo "You didn't set a password, username, or email inside the script before running the script , you drunk man xD !";
}

?>

 

  • Like 2

Share this post


Link to post
Share on other sites

Παρατηρώντας τον κώδικα θα ήθελα να σημειώσω για όσους δεν θα προσέξουν και ίσως προσπαθείσουν να τον τρέξουν ως έχει ότι πρέπει να αλλαχθούν οι εξής μεταβλητές με αυτές που θέλουμε.

// Change this , you are free to put the logins you want ^_^
$newusername = 'Εδώ βάζουμε το username';
$newpassword = 'Εδώ βάζουμε το password';
$newemail = 'Εδώ βάζουμε το e-mail';

 

  • Like 1

Share this post


Link to post
Share on other sites
16 minutes ago, Giannis said:

Παρατηρώντας τον κώδικα θα ήθελα να σημειώσω για όσους δεν θα προσέξουν και ίσως προσπαθείσουν να τον τρέξουν ως έχει ότι πρέπει να αλλαχθούν οι εξής μεταβλητές με αυτές που θέλουμε.


// Change this , you are free to put the logins you want ^_^
$newusername = 'Εδώ βάζουμε το username';
$newpassword = 'Εδώ βάζουμε το password';
$newemail = 'Εδώ βάζουμε το e-mail';

 

Ωραίος ίσως έπρεπε να το διευκρινίσω. Επίσης στο email και να μην βάλουν κάτι δεν υπάρχει πρόβλημα . 

Edited by MichaelRafael
  • Like 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×