Wordpress Pro Sites - newly created users wrong password

Hello,
We are using the Wordpress Pro Sites plugin. Users can register to selected plans and can be manually activated. So far it's ok, but after the site is activated the user receives a password associated to their account which does not work (i.e. signing in throws a wrong password error). The same password is displayed to the network administrator upon site activation.

  • Predrag Dubajic
    • Support

    Hey morfjord,

    Hope you're doing well today :slight_smile:

    I've just tested Pro Sites on my end and I had no issues with login when using generated password.

    Can you tell me when did this started happening to you and did you try performing basic troubleshooting by disabling your other plugins and switching to default WP theme to see if any of those are causing this for you?

    Best regards,
    Predrag

  • morfjord
    • Code Wrangler

    Hey Predrag,

    So this is what we did:
    1. Disabled all plugins except Pro Sites and used the last account details to login - the issue is not resolved
    2. Disabled all plugins except Pro Sites and created a new account - the issue is still there
    3. Disabled all plugins except Pro Sites, switched to the TwentySeventeen theme and created a new account - still not resolved

    Do you have any other suggestions?

    Thank you

  • morfjord
    • Code Wrangler

    I found something that might help you find the error. I edited the wp-includes/ms-functions.php file as follows:

    function wpmu_create_user( $user_name, $password, $email ) {
    $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
    wp_mail( 'my_mail', 'test pass', $password ); // This is just for testing. Somehow the password sent here is later changed and the user receives the wrong password.
    $user_id = wp_create_user( $user_name, $password, $email );
    if ( is_wp_error( $user_id ) )
    return false;

    // Newly created users have no roles or caps until they are added to a blog.
    delete_user_option( $user_id, 'capabilities' );
    delete_user_option( $user_id, 'user_level' );

    /**
    * Fires immediately after a new user is created.
    *
    * @since MU
    *
    * param int $user_id User ID.
    */
    do_action( 'wpmu_new_user', $user_id );

    return $user_id;
    }

    The password sent to the user after the site activation actually differs from the one sent from the wpmu_create_user function. The latter is the one that works.

  • Predrag Dubajic
    • Support

    Hi morfjord,

    Huh, that's strange, this works fine on my installation where clean WP and Pro Sites are installed...

    I was unable to check your site due to authentication popup so could you provide us with login to that and WP admin so we can have a closer look at this?

    You can send us your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question and the template below:

    Subject: "Attn: Predrag Dubajic"
    - Site login url
    - WordPress admin username
    - WordPress admin password
    - Authorization popup username
    - Authorization popup password
    - Link back to this thread for reference
    - Any other relevant urls

    Best regards,
    Predrag

  • Predrag Dubajic
    • Support

    Hi morfjord,

    I'm afraid that there's currently no workaround for this but the devs will be addressing this issue together with other fixes that are currently being worked on for next release.

    I guess that only solution for now would be editing your notification email and add something like this:

    "If you have any issues with using your generated password please reset the password here: LINK_TO_PASSWORD_RESET_PAGE"

    Best regards,
    Predrag

  • Predrag Dubajic
    • Support

    Hi morfjord,

    I have some good news, I've chatted with one of the devs in the meantime and below fix should take care of the password issue.

    Can you please download the attached file, unzip it and place it inside your wp-content/pro-sites/ folder, just make sure to backup original file first, just to stay on safe side.

    Let us know if the fix works for you.

    Best regards,
    Predrag

  • Predrag Dubajic
    • Support

    Hi morfjord,

    I've tested this on my installation with Pro Sites and CoursePress active but I was unable to replicate this issue.

    Since the issue is not related to original question can you please start a new thread for this and we will investigate it further.
    Please perform conflict test by disabling your plugins and see how the login works after that and post the results in your new thread.

    You can start a new thread here:
    http://premium.wpmudev.org/forums/#question

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.