Support

Home Forums Event Espresso Premium reCaptcha error – still not resolved

reCaptcha error – still not resolved

Posted: March 6, 2022 at 4:30 pm

Viewing 7 reply threads


hvacrcomfortpro

March 6, 2022 at 4:30 pm

This topic was IGNORED for over a month until it “expired” in the system and was closed. The original post content appears below and can also be found at https://eventespresso.com/topic/recaptcha-error-3/#post-330454

I am having a problem getting reCaptcha to work on the site at hvacrcomfortpro.com. I have reviewed the info here and here, as well as multiple other forum posts, all to no avail. When I test the registration form and attempt to advance to the payment step, I receive the error: “We’re sorry but an attempt to verify the form’s reCAPTCHA has failed. Missing “g-recaptcha-response”. Please try again.” Any ideas what I can try to get this working?


Tony

  • Support Staff

March 8, 2022 at 9:49 am

Hi there,

Firstly, my apologies for your previous thread, I wasn’t ignoring your thread but I marked it pending whilst waiting on some feedback from our developers and it slipped through our support queue.

Still, my fault and I apologise for the mishap.

With regards to your issue with ReCaptcha, it looks like one of the ReCaptcha Scripts isn’t loading on the page when reCaptcha is enabled and I’d like to take a deeper look as to why.

To do so I’ll need FTP credentials as I’ll need to add some debug code to the section which loads the script and see what is happening on the request at that point.

If that’s ok you can send temp credentials using this form:

https://eventespresso.com/send-login-details/


hvacrcomfortpro

March 8, 2022 at 9:25 pm

Temporary credentials for both wp-admin and FTP have been sent using the form you linked to above. Thank you.


Tony

  • Support Staff

March 9, 2022 at 8:27 am

Thank you for the credentials.

It turns out the issue here is within your theme.

Some of the EE Recaptcha scripts are loaded on the loop_end hook which is fired by the standard WordPress loop:

<?php while ( have_posts() ) : the_post(); ?>
    //Do stuff.
<?php endwhile; ?>

(Loops over the current posts, even if that’s just one, outputs the post details and then loops again but stops because there are no more posts then fires the above hook)

Within the page template of your theme it has this:

<?php while ( have_posts() ) : the_post(); ?>
    //Do stuff.
<?php break; ?>
<?php endwhile; ?>

That break; call basically means that the loop no longer runs twice (once for the post and then another where it detects no more posts etc) but rather just the once, the first iteration of the loop and then break; exits the loop at that point but doesn’t fire any of the hooks that would normally, like loop_end.

To fix this I copied your page.php template file into your child theme, renamed the copy to page-registration-checkout.php so that it only loads for the EE registration checkout page (based on the slug) and then removed that <?php break; ?> from the template file.

ReCaptcha now works on the checkout page, however, if the theme has that in various other places it may cause issues on those too.


hvacrcomfortpro

March 9, 2022 at 6:21 pm

Ummmm…Ok, that all made my head hurt LOL

It doesn’t appear the /registration-checkout page is any different, though. Shouldn’t the little “protected by” symbol pop up in the corner or something?


Tony

  • Support Staff

March 10, 2022 at 4:48 am

Yes, but reCaptcha is only used when you register whilst not logged in.

So if you open up a private/incognito window within your browser and test another registration with that, you should see the reCaptcha symbol:

https://monosnap.com/file/XCv9W2SMsR6lLKGv8sHEsNxlIs78Dv

(I’ve blurred a lot of the content because you haven’t publicly shared a link to your site but I’m sure you can see from the layout it’s your site in the screenshot 🙂 )

If not please let me know.


hvacrcomfortpro

March 12, 2022 at 5:13 pm

AHA! You are right LOL I thought I was logged out when I was testing but clearly I was wrong because I just went back to re-test and *made certain* I was not logged in and it is working. Thank you so much for your help! It’s perfect!!


Tony

  • Support Staff

March 14, 2022 at 5:25 am

You’re most welcome, I’m glad its working for you 🙂

I’ve removed your credentials from our system so you can delete the temp user account now, any further issues just let us know.

Viewing 7 reply threads

The support post ‘reCaptcha error – still not resolved’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso