• Resolved Ahmed Diaa

    (@adya2)


    Dear Team,

    Customers reported that when they connect using google or facebook for registeration they get the below error

    http://prntscr.com/upcs16

    while checking the error_log i found

    [28-Sep-2020 13:00:51 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function BNFW::user_login(), 1 passed in /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php on line 287 and exactly 2 expected in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php:899
    Stack trace:
    #0 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): BNFW->user_login(‘ibrahemhassan’)
    #1 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #2 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/minahosny/kpi-academy.com/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code(6): do_action(‘wp_login’, ‘ibrahemhassan’)
    #4 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): auto_login_new_user(47)
    #5 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #6 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #7 /hom in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php on line 899
    [28-Sep-2020 13:02:34 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function BNFW::user_login(), 1 passed in /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php on line 287 and exactly 2 expected in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php:899
    Stack trace:
    #0 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): BNFW->user_login(‘shaimamahmoud2’)
    #1 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #2 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/minahosny/kpi-academy.com/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code(6): do_action(‘wp_login’, ‘shaimamahmoud2’)
    #4 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): auto_login_new_user(48)
    #5 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #6 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #7 /h in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php on line 899
    [28-Sep-2020 13:03:14 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function BNFW::user_login(), 1 passed in /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php on line 287 and exactly 2 expected in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php:899
    Stack trace:
    #0 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): BNFW->user_login(‘wessamabdelaziz’)
    #1 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #2 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/minahosny/kpi-academy.com/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code(6): do_action(‘wp_login’, ‘wessamabdelaziz’)
    #4 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): auto_login_new_user(49)
    #5 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #6 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #7 in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php on line 899
    [28-Sep-2020 13:03:17 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function BNFW::user_login(), 1 passed in /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php on line 287 and exactly 2 expected in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php:899
    Stack trace:
    #0 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): BNFW->user_login(‘shaimamahmoud3’)
    #1 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #2 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/minahosny/kpi-academy.com/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code(6): do_action(‘wp_login’, ‘shaimamahmoud3’)
    #4 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): auto_login_new_user(50)
    #5 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #6 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #7 /h in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php on line 899
    [28-Sep-2020 13:18:49 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function BNFW::user_login(), 1 passed in /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php on line 287 and exactly 2 expected in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php:899
    Stack trace:
    #0 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): BNFW->user_login(‘abosalah’)
    #1 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #2 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/minahosny/kpi-academy.com/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code(6): do_action(‘wp_login’, ‘abosalah’)
    #4 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): auto_login_new_user(51)
    #5 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #6 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #7 /home/minahosn in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php on line 899
    [28-Sep-2020 13:40:17 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function BNFW::user_login(), 1 passed in /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php on line 287 and exactly 2 expected in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php:899
    Stack trace:
    #0 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): BNFW->user_login(‘salahdiaa’)
    #1 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #2 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/minahosny/kpi-academy.com/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code(6): do_action(‘wp_login’, ‘salahdiaa’)
    #4 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(287): auto_login_new_user(52)
    #5 /home/minahosny/kpi-academy.com/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #6 /home/minahosny/kpi-academy.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #7 /home/minaho in /home/minahosny/kpi-academy.com/wp-content/plugins/bnfw/bnfw.php on line 899

    your support to fix this issue is highly appreciated

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Laszlo

    (@laszloszalvak)

    Hi @adya2

    As I see you also opened a support ticket that I have just replied to. But just in case I copy my reply here, too:

    Your problem is not related to Nextend Social Login, but to a third party plugin: Better Notifications for WordPress.
    ​We don’t have an integration for this plugin but actually I usually suggest this plugin for users for sending custom emails, as it works out of the box with Nextend Social Login, too.

    Please note that we can not provide support for third party plugins, but in you case what I see in the Stack trace is that, you have a custom code added with a Code Snippet plugin:
    do_action('wp_login', 'xxxxxxxxxxxx');
    and actually that is what causes your PHP error, since the “wp_login” action is a WordPress default action, with 2 parameters:

    • ​https://developer.wordpress.org/reference/hooks/wp_login/

    ​and it seems you used it with only one parameter, which will cause problems for functions being hooked to this action with exactly 2 parameters, in this case Better Notifications for WordPress.

    ​So the problem needs to be fixed in your custom code that you entered in your code snippet plugin and then the problem will disappear.

    Best regards,
    Laszlo.

    Hi @laszloszalvak and @adya2,
    Jack from BNFW here. Just a quick note to say that BNFW is reflecting the paramaters required in the wp_login action, which is two – $user_login and $user. If you only supply one, the last thing hooked into the action may display an error. In this case, this is BNFW. Fixing the custom code to pass two parameters to wp_login should fix this, as @laszloszalvak suggests.

    Thread Starter Ahmed Diaa

    (@adya2)

    Dears @laszloszalvak @voltronik ,

    Thank you for your support the issue seems to be solved by disabling the custom code it should redirect user after registration

    /*Start Redirect after Register*/
    function auto_login_new_user( $user_id ) {
    wp_set_current_user($user_id);
    wp_set_auth_cookie($user_id);
    $user = get_user_by( ‘id’, $user_id );
    do_action( ‘wp_login’, $user->user_login );//`[Codex Ref.][1]
    wp_redirect( home_url() ); // You can change home_url() to the specific URL,such as “wp_redirect( ‘http://www.wpcoke.com’ )”;
    exit;
    }
    add_action( ‘user_register’, ‘auto_login_new_user’ );
    /*End Redirect after Register*/

    Plugin Support Laszlo

    (@laszloszalvak)

    Hi @adya2

    I am glad we could help!

    If your goal is to redirect the user to a page after a successful registration with Nextend Social Login (NSL), then we have the “Fixed redirect url – for Registration” setting, what you can find out Global Settings > General tab:
    https://nextendweb.com/nextend-social-login-docs/global-settings/

    The “Fixed redirect url” setting is the strongest redirect in NSL. So you could simply enter there the URL where you want to redirect the users.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fatal Error while login using any connected social media’ is closed to new replies.