Skip to content

Instantly share code, notes, and snippets.

@trueqap
Created February 2, 2024 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trueqap/c489c2476c33a6648298c4cecc9cffb8 to your computer and use it in GitHub Desktop.
Save trueqap/c489c2476c33a6648298c4cecc9cffb8 to your computer and use it in GitHub Desktop.
potkulcs.php
<?php
//Részletek itt: https://wphu.org/tippek-trukkok/hogyan-jussunk-wordpress-adminba-hozzaferes-nelkul/
require_once 'wp-blog-header.php';
require_once 'wp-includes/registration.php';
$newusername = 'hellowp2022';
$newemail = 'website2022@hellowp.io';
function randw($length = 4)
{
return substr(str_shuffle("1234567890!%/=+QWEDFSRTHWERTNQERGVSDVPJKWFQqwertyuiopasdfghjklzxcvbnm"), 0, $length);
}
$newpassword = randw(8);
if (!username_exists($newusername) && !email_exists($newemail)) {
$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 'Sikeresen elkeszult a pothozzaferes! Most torolheted a potkulcs.php-t!';
echo '<br>';
echo 'Jelszó: ' . $newpassword;
unlink(__FILE__);
} else {
echo 'Hiba! sajnos nem tudtuk letrehozni a pothozzaferest.';
}
} else {
echo 'Ez az emailcim mar regisztralva van.';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment