Google Recaptcha integration

  • Thanks for the shoutout Clive!


    Any questions, let me know.

    Hey Ryan,


    Does this app work with the Perch Members / Shop Customers registration forms too? I don't think those have a spam section, so I was wondering if this was only for custom Forms such as contact submissions.

  • Hey,


    It doesn't currently, only Perch Forms unfortunately.

    Shoot. Any ideas for potential solutions? I've tried form validations, character limitations, Akismet, and even honeypot fields, but it seems like any sort of spam filter needs a place to dump spam members like the form system has (but it doesn't). At this point, even something that blocks the spammers and doesn't put them into another "bucket" would suffice - I'm drowning in hundreds of spam accounts on my SQL server.

  • Shoot. Any ideas for potential solutions? I've tried form validations, character limitations, Akismet, and even honeypot fields, but it seems like any sort of spam filter needs a place to dump spam members like the form system has (but it doesn't). At this point, even something that blocks the spammers and doesn't put them into another "bucket" would suffice - I'm drowning in hundreds of spam accounts on my SQL server.

    Were you able to find a solution for this?


    One of my clients is receiving dozens of spam registrations and there doesn't appear to be a quick way to resolve it.

  • I've installed the MBK Forms app to a client site, but I can't seem to see a Recaptcha checkbox appearing. The form(s) still work fine, and aren't all getting marked as spam or stopping anything getting through unduly, but I'm assuming the standard 'i'm not a robot' checkbox should be there nonetheless?

    I have Akismet running on the forms too.


    Weirdly some webserver permissions seem to mean I get access denied to the MBK admin pages in Perch, so is there likely to be some kind of read/write permission causing this?

  • Hi Ryan,


    Thanks for developing this addon.


    I have followed the readme instructions to install v2 recaptcha. However, once I click to submit my contact form, I land on an empty broken page saying 'This page isn't working (chrome). There are no submissions being sent even in spam.


    I carefully followed instructions, I made sure there are no typos. I updated my secret key and honeypot ID in the Perch settings.

    The recaptcha script is in the <head> of where the contact form is, and also on the thank you page.

    The data-sitekey is displaying my recaptcha site key that was generated by recaptcha.

    I have replaced app="perch_forms" with app="mbk_forms".


    Could the issue be that I am running Perch v2.8.13 ?


    Please let me know your thoughts.


    Thanks


    EDIT: I looked at the error logs, and found this:

    Code
    1. PHP Fatal error: Call to undefined method PerchAPI_SubmittedForm::redispatch() in /cms/addons/apps/mbk_forms/runtime.php on line 23

    EDIT: Okay I figured it out.. it was because of the old Perch version being used. Once I updated the core files, forms came through. Thanks!

  • Were you able to find a solution for this?


    One of my clients is receiving dozens of spam registrations and there doesn't appear to be a quick way to resolve it.

    Unfortunately no, I've just been manually deleting them from my database every so often. The good thing is, you can typically search for an extra bit of code that the spam bots are injecting into the member properties field ("submit":"Register") and that will pull them up for deletion. I also have set maximums on the input name and email fields where the bots are usually forcing a lot of text. You can alternatively search for names and emails with sketchy URLs in them like .ru or other foreign addresses - those are usually spam.

  • Thanks for this.


    Just a tip for everyone... if you have a 'dark' themed site, you can switch to 'dark' captcha by adding


    Code
    1. data-theme="dark"

    to the form code, eg:


    Code
    1. <div class="g-recaptcha" data-sitekey="YOUR_SITE_KEY" data-theme="dark"></div>

    You can also add this too


    Code
    1. data-size="compact"

    if you're tight for space.




    My question is:


    If users forget to click the captcha V2 box, they silently fail and see the success message, yet get added to spam.


    How could we disable the submit button until CAPTCHA is validated, or show an error message if they've forgotten to tick the box?

  • Hi Simon


    If I understand your question correctly then you can disable the submit button by using the data-callback  data-expired-callback attributes in the API.


    https://developers.google.com/recaptcha/docs/display


    If I recall I got the answer from a post like this one on Stackoverflow -->


    https://stackoverflow.com/ques…av2-enable-disable-submit


    Code
    1. <div data-sitekey="YOUR_SITE_KEY" data-callback="enableBtn" data-expired-callback="disableBtn"></div>
    2. <script>
    3. document.getElementById("ID_OF_YOUR_SUBMIT_BTN").disabled = true;
    4. function disableBtn(){
    5. document.getElementById("ID_OF_YOUR_SUBMIT_BTN").disabled = true;
    6. }
    7. function enableBtn(){
    8. document.getElementById("ID_OF_YOUR_SUBMIT_BTN").disabled = false;
    9. }
    10. </script>
  • That should really be part of the docs!
    Thank you very much for this code !!


    Without this addition the user can easily forget to do the captcha and unwillingly create a spam entry.


    In my case the page would say: “thanks for your entry we will get back to you and enroll you in the course” - and it would never happen.


    So thanks!

    To hopefully help others, I have added my code example. I made the button pushable only after doing the reCaptcha.


    René



  • I'm not sure if this is my implementation, reCaptcha or mbk_forms.


    Basically I have followed ryan git instal process for v2 reCaptcha, (v3 resulted in too many genuine messages being spammed unfortunately) and everything works. However, my client would prefer the invisible version of reCaptcha, the codes were generated using invisible settings, however the reCaptcha checkbox appears?


    Is there an step i've missed or is this not supported?