• Resolved Sai Siddula

    (@uorwst)


    Hi,

    We recently upgraded our wordpress multisite to 4.0.1 and since then we are unable to create new users. Whenever we try to create new user, irrespective of which site, we get “Incorrect verification code” error. I was searching on internet for this error but no luck. Could some please advise ?

    Thanks
    Sai

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    “Incorrect verification code” is from a plugin I would think.

    What registration plugins are you running?

    Thread Starter Sai Siddula

    (@uorwst)

    I disabled all the plugins but still I get the error. Not sure I understand by registration plugins. Below is the list of plugins we have currently installed.

    akismet, all in one seo pack, google analytics, hello dolly, jetpack by wordpress.com, jw player 6, more privacy options, multisite administrator tools, nextgen gallery, peter collaboration emails, resend welcome email, sharedaddy, site template, social, subscribe2, themes visibility manager, wordpress importer, wordpress mu domain mapping, wp ui-tabs, accordions and more.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Where are you creating the user? From the wp-admin/network pages?

    @sai Siddula, do you have a two step authentication plugin installed?

    Thread Starter Sai Siddula

    (@uorwst)

    Thank you all for your replies.

    After much digging I found that there was one more plugin installed in the back-end which is not visible in the UI list of plugins. That plugin is adding captcha code to the user registration page. That is working fine if any new person tries to register through blogs website. But the same plugin is causing error even when administrator tries to add through dashboard->add users page.

    When I looked in to the code, its adding action and filters. like this –

    add_action('init', 'signup_init');
    add_action('signup_extra_fields', 'signup_user_captcha_field');
    add_filter('wpmu_validate_user_signup', 'signup_user_captcha_filter');
    function signup_user_captcha_filter($content)
    {
    	if (!empty($_POST['captcha']))
    		$_SESSION['entered_captcha'] = $_POST['captcha'] . $content['user_name'];
    
    	if(empty($_SESSION['entered_captcha']) || $_SESSION['captcha'] . $content['user_name']!= $_SESSION['entered_captcha'])
    		$content['errors']->add('captcha', __('Incorrect verification code.'));
    
    	return $content;
    }

    Is it possible to check if the logged in user is Admin and skip this error?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    You’ll really want to ONLY call that on the front end registration. So wrap it with this:

    if ( !is_admin() ) {
        add_action('init', 'signup_init');
        add_action('signup_extra_fields', 'signup_user_captcha_field');
        add_filter('wpmu_validate_user_signup', 'signup_user_captcha_filter');
    }

    See http://codex.wordpress.org/Function_Reference/is_admin

    Thread Starter Sai Siddula

    (@uorwst)

    Thanks Ipstenu, it worked like a charm!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Incorrect Verification code’ is closed to new replies.