Page 1 of 1

Invisible ReCaptcha issues with Captcha module and CGBetterforms

Posted: Sun Aug 23, 2020 1:15 pm
by slick
Dear CMSMS experts,

I have a form built in CGBetterForms (1.10.4) that works fine with the HN Captcha method from the Captcha module (v1.0). We still got some spam with that so I wanted to try the Invisible ReCaptcha that I previously successfully used on other sites.

After making the switch to Invisible ReCaptcha I now always get the "Sorry, incorrect captcha value" error (the page is in German, hence a different text shows). I have the same issue on more than one form.

Here is my form:
https://arbatherm.ch/test

The template is very simple:

Code: Select all


{cgbf_form_errors assign='errors'}
{if !empty($errors)}
  {foreach $errors as $err}
    <div class="uk-alert-danger uk-margin-medium" uk-alert><span uk-icon="warning" class="uk-margin-right"></span> {$err}</div>
  {/foreach}
{/if}

<form id="kontakt">

  <div class="row">
     <label for="name" hidden>Name</label>
     <input id="name" class="form-control" type="text" name="name" placeholder="Vorname Nachname" required>
  </div>

  <div class="row">
     <label for="email" hidden>Email</label>
     <input id="email" class="form-control" type="email" name="email" placeholder="Email-Adresse" required>
  </div>
  
  <div class="row">
     <label for="telefon" hidden>Telefon</label>
     <input id="telefon" class="form-control" type="tel" name="telefon" placeholder="Telefon (optional)">
  </div>
  
  <div class="row">
     <label for="betreff" hidden>Betreff</label>
     <input id="betreff" class="form-control" type="text" name="betreff" placeholder="Betreff" required>
  </div>

  <div class="row">
     <label for="anliegen" hidden>Anliegen</label>
     <textarea id="anliegen" class="form-control" name="anliegen" rows="5" placeholder="Beschreiben Sie Ihr Anliegen" required></textarea>
  </div>
  
  <div data-cgbf-captcha>{* captcha will be appended here *}</div>
  <div data-cgbf-captcha-input>{* captcha input field, if necessary will be appended here *}</div>

  <div class="row">
    <button type="submit" class="fbsubmit">Absenden</button>
  </div>
</form>

Of course, any help would be much appreciated. I would also be willing to donate/pay for development work on the Captcha module, maybe with an integration of ReCaptcha 3 or other effective spam prevention.

Best,
slick

Re: Invisible ReCaptcha issues with Captcha module and CGBetterforms

Posted: Mon Aug 24, 2020 10:05 pm
by slick
My issue is most likely related to bad PHP settings. This thread viewtopic.php?f=4&t=81753 mentioned checking for "allow_url_fopen" in php.ini -> I will check this on various installations and report back.

cyon.ch (good host with great default settings): works
hostfactory.ch (ok host with options): works after config
hostpoint.ch (bad host): have to go through support
vtx.ch (awful host): have to go through support

Re: Invisible ReCaptcha issues with Captcha module and CGBetterforms

Posted: Tue Aug 25, 2020 1:14 pm
by markS
Hello,

I tried multiple solutions but never got invisible Recaptcha & CGBetterForms to work properly. Although I quite liked the way the templates are handled in CGBF, I went back and setup the form in FormBuilder and it works as intended. I didn't find my php.ini settings affected it.

I'd be interested in hearing if anyone has ever got it to work.

Re: Invisible ReCaptcha issues with Captcha module and CGBetterforms

Posted: Tue Aug 25, 2020 5:04 pm
by DIGI3
I've been using invisible reCaptcha with CGBF and haven't run into any issues (other than the allow_url_open one already mentioned). I did have to make some adjustments to the javascript validation (Abide) I was using, but that wasn't related to out of the box CGBF.

I just did a quick test out of the box with the sample contact form in CGBF with an invisible captcha v2 and it worked fine.

Re: Invisible ReCaptcha issues with Captcha module and CGBetterforms

Posted: Tue Aug 25, 2020 7:52 pm
by slick
Thanks for your input. Do you have any guess if the following PHP functions make a difference?

passthru, exec, system, popen, shell_exec, proc_open, proc_close, proc_get_status, proc_nice, proc_terminate, symlink

I suspect symlink to interfere, because I have it working on an install with these functions disabled:

eval, exec, shell_exec, system, dl, passthru, proc_open, proc_close, popen, opcache_get_status

Re: Invisible ReCaptcha issues with Captcha module and CGBetterforms

Posted: Tue Aug 25, 2020 8:56 pm
by DIGI3
No idea. If it was something like that your error log should give you some details.

Re: Invisible ReCaptcha issues with Captcha module and CGBetterforms

Posted: Sun Sep 20, 2020 11:53 am
by slick
After a lot of experimentation I decided to remove the ReCaptcha account and create a new one and with the new key it suddenly worked.

Still not really happy with any of the Captcha solutions I have tried. I might have a look at https://www.hcaptcha.com in the future as it seems more privacy focused.

I'm of course open to any suggestions as to effective and non-invasive form protection.