Support » Plugin: Login No Captcha reCAPTCHA » Fatal error in v 1.6.1

  • Resolved Andrew Ledwith


    After updating to version 1.6.1 I receive a fatal error on some of the websites I manage (but not all of them). The error reads:

    Fatal error: Can’t use function return value in write context in /public_html/wp-content/plugins/login-recaptcha/login-nocaptcha.php on line 353

    The error occurs on websites hosted by Hostgator on a shared hosting plan, which is running an older version of PHP. The sites I manage that run on Siteground and A Small Orange did not experience this issue.

Viewing 10 replies - 1 through 10 (of 10 total)
  • I have also experienced this error on sites with older version of PHP.
    Is there any fix for this?

    Plugin Author Robert Peake


    Hi @jaledwith and @spale ,

    Sorry to hear this is happening and thanks for reporting it.

    It looks like you are running a pretty old version of PHP. I don’t have easy access to this version, so if you can test a patch for me this would help.

    Line 353 of login-nocaptcha.php looks like this:

    if(!empty(get_option('login_nocaptcha_error')) && (empty(get_option('login_nocaptcha_working')) || (time() - get_option('login_nocaptcha_notice') < 30))) {

    Please can you replace it with these lines instead?

            $login_nocaptcha_error = get_option('login_nocaptcha_error');
            $login_nocaptcha_working = get_option('login_nocaptcha_working');
            $login_nocaptcha_notice = get_option('login_nocaptcha_notice');
            $time = time();
            if(!empty($login_nocaptcha_error) && (empty($login_nocaptcha_working) || ($time - $login_nocaptcha_notice < 30))) {

    If that works, I will release it right away with 1.6.2.

    Note also with the release of WordPress 5.2 (coming very soon) the minimum PHP version will be 5.6.20.

    Thanks for your response. When I make the edit you suggest I now receive this error:

    Fatal error: Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of get_option(). in /public_html/wp-content/plugins/login-recaptcha/login-nocaptcha.php on line 354

    Plugin Author Robert Peake


    Hi @jaledwith — this error doesn’t make sense for the code I provided earlier. I suspect an ampersand character may have snuck in there instead of the single quote (').

    Just in case it was an issue with the code styling on the forum, here is the code again:

    $login_nocaptcha_error = get_option(‘login_nocaptcha_error’);
    $login_nocaptcha_working = get_option(‘login_nocaptcha_working’);
    $login_nocaptcha_notice = get_option(‘login_nocaptcha_notice’);
    $time = time();
    if(!empty($login_nocaptcha_error) && (empty($login_nocaptcha_working) || ($time – $login_nocaptcha_notice < 30))) {

    Let me know!

    Yeah, I guess it would help if I looked at the code after pasting it. 🤦‍♂️

    The code you provided works great. Thanks!

    Plugin Author Robert Peake


    Great, I’ll push it to the repo so everyone can benefit.

    May I ask what version of PHP was triggering this error? That way I can document it.

    The sites in question run on PHP 5.4.45.

    Plugin Author Robert Peake


    Great, thanks. Have just pushed 1.6.2 live; should take just a few minutes to show as an update in wp-admin.

    Hello Robert,

    I can confirm that version 1.6.2 works well with PHP v5.4.45.
    Thank you for quick response and for fixing this issue.

    Also, thanks @jaledwith for quick reporting the issue and testing.

    This is why WordPress community is the best.

    I wish you both a great day.

    Best regards

    Plugin Author Robert Peake


    @spale I agree! 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.