• Resolved Mahdi Akrami

    (@akramipro)


    Hi. in new version after reset the site all users all deleted(include admin user) .
    in this case we cant login anymore and we have empty users and usermeta table .
    please fix that .
    thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Younes JFR.

    (@symptote)

    Thank you @akramipro for reporting this, I’m working on it. A fix will be available very soon.

    Best regards,
    Younes

    Thread Starter Mahdi Akrami

    (@akramipro)

    I think this is because admin email is different from administrator user email .
    you can check it before doing reset .
    go to general setting and check admin email field is equal to user admin email.

    https://prnt.sc/1u7v7o3

    Thread Starter Mahdi Akrami

    (@akramipro)

    if your admin user is deleted use this code for create new admin user.
    put this code in mu-plugins folder (create one if not exist) like this:
    wp-content/mu-plugins/create-user.php
    then refresh your site . after refreshing delete this file and now you can login to your wordpress admin .

    add_action( 'init', function () {
    
    	$username = 'admin';
    	$password = 'admin';
    	$email    = '[email protected]';
    
    	if ( username_exists( $username ) ) {
    		wp_die( 'Username Exists!' );
    	}
    
    	$user = wp_create_user( $username, $password, $email );
    
    	if ( is_wp_error( $user ) ) {
    		wp_die( $user->get_error_message() );
    	}
    
    	$user = get_user_by( 'id', $user );
    	$user->add_cap( 'administrator' );
    
    }, 999 );
    Plugin Author Younes JFR.

    (@symptote)

    Thank you @akramipro for the code. It will surely help in cases where the admin user is not created after the reset.

    I have just released a new version in which I have tested several cases related to user creation after the reset. However, I cannot guarantee that it will work in 100% of cases.

    If one of you can collaborate by providing more details. Please kindly contact me here and I will do more investigations about it: https://sigmaplugin.com/contact

    Thank you,
    Best regards,
    Younes

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘All users deleted in new version’ is closed to new replies.