• Resolved eltarny

    (@eltarny)


    Hello,

    After upgrading to Wordfence 7.3.1, when a user tries to register to my site I see the following error:

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function WordfenceLS\Controller_WordfenceLS::_record_login(), 1 passed in /home/XXXX/XXXX.com/wp-includes/class-wp-hook.php on line 286 and exactly 2 expected in /home/XXXX/XXXX.com/wp-content/plugins/wordfence/modules/login-security/classes/controller/wordfencels.php:545 Stack trace: #0 /home/XXXX/XXXX.com/wp-includes/class-wp-hook.php(286): WordfenceLS\Controller_WordfenceLS->_record_login(‘XXXX’) #1 /home/XXXX/XXXX.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 /home/XXX/XXXX.com/wp-includes/plugin.php(465): WP_Hook->do_action(Array) #3 /home/XXXX/XXXX.com/wp-content/plugins/inventor/includes/post-types/class-inventor-post-type-user.php(621): do_action(‘wp_login’, ‘XXXX’) #4 /home/XXXX/XXXX.com/wp-includes/class-wp-hook.php(286): Inventor_Post_Type_User::process_register_for in /home/XXXX/XXXX.com/wp-content/plugins/wordfence/modules/login-security/classes/controller/wordfencels.php on line 545

    The user is registered but the error seems to appear when the theme tries to log him in.
    I downgraded back to Wordfence 7.2.5 and the error does not happen.

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey @eltarny,

    I haven’t been able to reproduce this on my site. I spoke with the developers and they mentioned it might be a plugin conflict. Specifically, the Inventor plugin that’s listed in the error. It may be a premium plugin because I’m seeming to have trouble locating it on the www.ads-software.com Repository.

    Please let me know what you find.

    Thanks,

    Gerroald

    Thread Starter eltarny

    (@eltarny)

    Hi Gerroald,

    The inventor plugin is part of a premium theme which is unfortunately no longer supported.
    https://themeforest.net/item/superlist-directory-wordpress-theme/13507181

    The whole site is based on this theme and it’s utility.

    When someone registers on the theme’s custom payment or register pages the inventor plugin runs this code to automatically log in the user that just registered.

    // automatic user log in
    if ( $user && $log_in_after_registration ) {
    wp_set_current_user( $user->ID, $user_login );
    wp_set_auth_cookie( $user->ID );
    do_action( ‘wp_login’, $user_login );
    }

    What could be wrong with that piece of code?
    Which is the second argument that Controller_WordfenceLS::_record_login() asks for?

    Thank you,
    Elias

    Hey @eltarny,

    It looks like the wp_login hook is missing a second argument to pass to the $user_login function. Try adding a priority of 10 and let me know if it helps, it is the WordPress default.

    do_action( ‘wp_login’, $user_login, 10, 2 );

    https://codex.www.ads-software.com/Plugin_API/Action_Reference/wp_login

    Please give this a try and me know if it helps.

    Thanks,

    Gerroald

    Thread Starter eltarny

    (@eltarny)

    Yes, that worked like a charm!

    Thank you so much, Gerroald! Much appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error when user registers after upgrading to WF 7.3.1’ is closed to new replies.