Forums

[Plugin: WP-reCAPTCHA] Undefined variable errors (2 posts)

  1. wongo888
    Member
    Posted 2 years ago #

    I just installed the recaptcha plugin and I'm getting some warnings ahead of the captcha widget which is showing up:

    Notice: Undefined variable: needed_capability in /...../public/blog/wp-content/plugins/wp-recaptcha/wp-recaptcha.php on line 438

    Notice: Undefined index: rerror in /....../public/blog/wp-content/plugins/wp-recaptcha/wp-recaptcha.php on line 443

    Notice: Undefined index: rerror in /...../public/blog/wp-content/plugins/wp-recaptcha/wp-recaptcha.php on line 494

    I looked at the code and on line 430 of the 'wp-recaptch.php' file is the following:

    function recaptcha_comment_form() {
       global $user_ID, $recaptcha_opt;
    
       // set the minimum capability needed to skip the captcha if there is one
       if ($recaptcha_opt['re_bypass'] && $recaptcha_opt['re_bypasslevel'])
          $needed_capability = $recaptcha_opt['re_bypasslevel'];
    
    	// skip the reCAPTCHA display if the minimum capability is met
    	if (($needed_capability && current_user_can($needed_capability)) || !$recaptcha_opt['re_comments'])
    		return;

    It appears that the variable $needed_capability is not being set up because $recaptcha_opt['re_bypass'] is not TRUE. It is actually NULL. $recaptcha_opt['re_bypasslevel'] is set to 'read'. It appears to me that if $recaptcha_opt['re_bypass'] is NULL then $needed_capability is never set although it is tested in the following line (438).

    Is there a default $needed_capability set somewhere that is not being picked up? Thanks for any help!

    http://wordpress.org/extend/plugins/wp-recaptcha/

  2. chestersstore28
    Member
    Posted 2 years ago #

    I am getting this error - any ideas on how I resolve this?

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
    Timestamp: Fri, 4 Dec 2009 20:26:27 UTC

    Message: 'wp' is undefined
    Line: 78
    Char: 1
    Code: 0
    URI: https://wendygould.magellanshop.com/blog/wp-content/themes/swift/includes/js-functions.js

Topic Closed

This topic has been closed to new replies.

About this Topic