WordPress.org

Forums

Contact Form 7 reCAPTCHA Extension
Only allows 1 reCAPTCHA per web page (14 posts)

  1. huyz
    Member
    Posted 3 years ago #

    If I have a Contact form with reCAPTCHA in a Page, then all of a sudden, the reCAPTCHA that usually shows up for the comments disappears.

    The same thing if I have a widget in a sidebar that includes a Contact form with reCAPTCHA. The reCAPTCHA will not show up in the widget until there is no other reCAPTCHA on the page.

    So it looks like there can be only one reCAPTCHA at any time, and the priority seems to be Page/Post containing form > comment > widget containing form.

    This is particularly bad because it creates a loophole for spam to get in on pages/posts with a contact form.

    This is on WordPress 3.0.5 with a multisite setup.

  2. huyz
    Member
    Posted 3 years ago #

    In any case, I can't get the contact form to work with reCAPTCHA. When I hit send, the arrows circle around and nothing else happens.

  3. Andre Pietsch
    Member
    Plugin Author

    Posted 3 years ago #

    Hi,

    I had no possibility to check that until now. Do you have a test installation of that multisite setup I can get access to? A link to the page would be enough. Would like to step through some javascript code via firebug. No account access or something like that at the moment.

    Or could you provide some screenshots?

    At the moment I have only a 3.1.3 singlesite instance to test. Will have a look if I can setup some older and also multisite versions to test...

    Kind regards

    Andre

  4. huyz
    Member
    Posted 3 years ago #

    Sure, Andre.
    You can check this http://test.ofb.net/2011/06/15/contact-form-7-test

    Looking at the source, I can see that there are 3 reCAPTCHA script sections in the page. I just don't know why only the first one shows up.

    Also, when I click on send in the contact form, I get this in the HTTP POST response:
    "For security reasons, you must pass the remote ip to reCAPTCHA"
    I don't know what that means.

    Sorry, about all the plugins on the page. I'm testing tons of plugins and how well they work together.

  5. huyz
    Member
    Posted 3 years ago #

    It might also be relevant to know that in my setup, my Apache/WordPress are running behind an Apache proxy using ProxyPass.

    But I do have this in my wp-config.php:

    /* As per http://core.trac.wordpress.org/ticket/9235 */
    if ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $_SERVER['HTTP_X_FORWARDED_FOR'] ) )
       $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];

    This is an Ajax call however, so I'm not sure if this info matters.

  6. Andre Pietsch
    Member
    Plugin Author

    Posted 3 years ago #

    ah... thx for the hints... i will have a look. but i won't be able to fix it until next week. i am on another problem at the moment.

    hope that is ok...

  7. huyz
    Member
    Posted 3 years ago #

    Yeah that's fine. Thanks in advance.

  8. huyz
    Member
    Posted 3 years ago #

    Regarding the problem with having multiple reCAPTCHA per page:

    Looking into this further, it looks like a common problem that has to do with the reCAPTCHA API:
    http://groups.google.com/group/recaptcha/browse_thread/thread/1b19592222f8d87b/3cfd98ba4d7f71aa?lnk=gst&q=multiple#3cfd98ba4d7f71aa

    Another test page with Formidable shows the same problem: only one reCAPTCHA shows up:
    http://test.ofb.net/2011/06/16/formidable-test

    Some people were able to fix it:
    http://god-at-the-center.blogspot.com/2009/09/more-than-one-recaptcha-on-page-mixing.html
    http://rubyforge.org/projects/ondemandcaptcha/

    As for the hanging problem when submitting, it does not apply with the Formidable test, though: hitting send works.

  9. Andre Pietsch
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for the hints. I also found some possible ways. Have to test them. Will let you know about the progress...

    Have a nice weekend

    Andre

  10. Andre Pietsch
    Member
    Plugin Author

    Posted 3 years ago #

    Hey...

    released version 0.0.7 that gives some possibilities around options.

    I will address the "one recaptcha issue" now.

    Will keep you informed... ;)

    Andre

  11. Andre Pietsch
    Member
    Plugin Author

    Posted 3 years ago #

    Hey...

    the "one recaptcha" issue is heavier than I thought.

    The solution in the link uses the ajax api whereas the wp-recaptcha thing uses the php api.

    The problem is, that they aren't really compatible to one another. Both use the same javascript Recaptcha class. At the moment I have no idea how to handle that. They are not designed to work both on the same site.

    There is a chance to "overdeclarate" the Recaptcha class of the javascript. But I have no idea how and if this will work. I can't guarantee to be the last script to declerate that class. So if there is someone who imports the original after me he will be the on in charge.

    At the moment I have no idea how to solve that. If you have please give me a hint. :(

    Kind regards

    Andre

  12. huyz
    Member
    Posted 3 years ago #

    Yeah it didn't look like an easy problem to fix when I glanced over it.

    I think it's really up to Google at this point, if someone makes a feature/bug request.

  13. Andre Pietsch
    Member
    Plugin Author

    Posted 3 years ago #

    It has been reported but I think they won't do it because they fear some overusage of their service... :(

    I will try some stuff and see if I can fix it...

  14. huyz
    Member
    Posted 3 years ago #

    Hmm, this is Google -- they should be able to handle it :)

    Maybe one possibility is to only invoke the recaptcha JS once a contact form field has keyboard focus. So the recaptcha would automatically appear. And maybe there's a way to find any existing on the page and destroy it before creating a new one.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7 reCAPTCHA Extension
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic