• When E_NOTICE is enabled this plugin causes Notice stack traces to appear in the error log every time a page is loaded – causing a lot of noise in the error log and making it difficult to notice actual issues.

    It looked like the problem was reported here but never resolved:

    https://wordpress.org/support/topic/undefined-index-captcha_wc_login-captcha_wc_lost_password/

    I’m having to manually edit the plugin files to avoid the issue. Can the plugin be updated to not access undefined indexes?

    [11-Sep-2018 19:38:47 UTC] PHP Notice: Undefined index: captcha_wc_lost_password in /var/www/html/wp-content/plugins/no-captcha-recaptcha-for-woocommerce/lost-password.php on line 11
    [11-Sep-2018 19:38:47 UTC] PHP Stack trace:
    [11-Sep-2018 19:38:47 UTC] PHP 1. {main}() /var/www/html/index.php:0
    [11-Sep-2018 19:38:47 UTC] PHP 2. require() /var/www/html/index.php:17
    [11-Sep-2018 19:38:47 UTC] PHP 3. require_once() /var/www/html/wp-blog-header.php:13
    [11-Sep-2018 19:38:47 UTC] PHP 4. require_once() /var/www/html/wp-load.php:37
    [11-Sep-2018 19:38:47 UTC] PHP 5. require_once() /var/www/html/wp-config.php:124
    [11-Sep-2018 19:38:47 UTC] PHP 6. include_once() /var/www/html/wp-settings.php:305
    [11-Sep-2018 19:38:47 UTC] PHP 7. WC_Ncr_Lost_Password_Captcha::initialize() /var/www/html/wp-content/plugins/no-captcha-recaptcha-for-woocommerce/woocommerce-no-captcha-recaptcha.php:27

Viewing 5 replies - 1 through 5 (of 5 total)
  • +1

    I’m experiencing the same notice on a local site (production sites shouldn’t display notices)

    • This reply was modified 5 years, 4 months ago by Sander.

    +1 for me also.

    Same here!

    Is there something we can do to resolve the issue?

    Thread Starter icanoop

    (@icanoop)

    The real resolution is to fix the code but as a workaround I’ve been running these commands every time I install the plugin.

    sed -i '8 a $old_error_reporting = error_reporting(E_ALL ^ E_NOTICE);' wp-content/plugins/no-captcha-recaptcha-for-woocommerce/lost-password.php
    sed -i '19 a error_reporting($old_error_reporting);' wp-content/plugins/no-captcha-recaptcha-for-woocommerce/lost-password.php

    • This reply was modified 5 years, 3 months ago by icanoop.

    Hello people, I had the same issue, and it was easy to solve.
    on file wp-content/plugins/no-captcha-recaptcha-for-woocommerce/lost-password.php at line 11, change:
    if ( isset( self::$plugin_options['captcha_wc_lost_password'] ) || self::$plugin_options['captcha_wc_lost_password'] == 'yes' ) {
    for
    if ( isset( self::$plugin_options['captcha_wc_lost_password'] ) && self::$plugin_options['captcha_wc_lost_password'] == 'yes' ) {"

    The problem is clear, the logic is asking if is set, and then OR is equeal to “yes”, and that is not correct, as if its not set, if shouldn`t check its value, so, just changing the OR(||) to an AND(&&), will fix it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Undefined index: captcha_wc_lost_password in lost-password.php on line 11’ is closed to new replies.