hCaptcha plugin to replace the Google captcha plugin

davidspring

New Member
I am a very old semi-retired teacher and I have been teaching website design classes for more than 25 years. I built a website called Our Community Network dot org to help my students learn how to use some basic Fabrik functions. We have a Fabrik registration form at the menu item Member Signup. At the bottom of this form is a Fabrik Captcha plugin (element) using Google public and private keys. The problem is that Google policies are getting more invasive all of the time and my students are looking for some other option that does not require registering their websites with Google and subjecting their website visitors to Google data mining.

There is a less invasive replacement for Google called hCaptcha. They claim that if you already are using a Google Captcha plugin, it can be adapted to hCaptcha in a matter of minutes because many of the functions have the same names and it is just a matter of adding a couple lines of Javascript to the exising captcha plugin.

However, I was not able to get their “easy JS code” to work or their “easy PHP code” to work. I am therefore hoping that someone in this forum could get it to work so that Fabrik can have a non-Google captcha plugin. If Fabrik were to offer a non-Google captcha plugin, it would be a huge help to lots of people.

Regards,

David Spring

Here is a summary of the route I used to try to modify the Fabrik Captcha plugin:

I went to this page which summarizes how to change a reCaptcha plugin to an hCaptcha plugin in 3 simple steps:

Unfortunately I am not able to post the rest of this thread because it has links and I am not yet qualified to post a thread with links. If someone would be willing to link this post, I will add a second post with links to all of the steps I have taken so far to create an hCaptcha plugin.
 
Without Google you can use the "Standard" captcha (ok, not the newest method).

Posting: I think after two or three posts you can add links.
 
Thank you for suggesting the Standard captcha. I have switched my Fabrik Demonstration Registration form to the standard captcha and I will let my students know about this option. However, the standard captcha seems very primitive even for someone as old as me. I will therefore in my next post attempt to list the steps I have taken thus far to create an hCaptcha plugin with the hope that someone with better JavaScript and or PHP skills than me will be able to make quick work out of what is supposed to be "easy" code.
 
Here is a summary of the route I used to try to modify the Fabrik Captcha plugin:

I went to this page which summarizes how to change a reCaptcha plugin to an hCaptcha plugin:

https://docs.hcaptcha.com/switch

Replace the script tag:

<script src="https://www.google.com/recaptcha/api.js" async defer></script>

becomes

<script src="https://js.hcaptcha.com/1/api.js" async defer></script>




Replace the parameter name:

g-recaptcha becomes h-captcha

Replace field used from the form:

g-recaptcha-response becomes h-captcha-response

Update siteverify URL

https://www.google.com/recaptcha/api/siteverify (or https://www.recaptcha.net/recaptcha/api/siteverify) becomes https://hcaptcha.com/siteverify

But there is also a PHP apps link which I was not able to follow:

https://medium.com/@hCaptcha/using-hcaptcha-with-php-fc31884aa9ea


https://hcaptcha.com/siteverify");
curl_setopt($verify, CURLOPT_POST, true);
curl_setopt($verify, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($verify, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($verify);// var_dump($response);$responseData = json_decode($response);
if($responseData->success) {
// your success code goes here
}
else {
// return error to user; they did not pass
}?>

They provide a complete Contact Form PHP code at the bottom of the page. But I likely did it wrong. I also went to this page to see all of the Integration options:

https://github.com/hCaptcha/hcaptcha-integrations-list

There were six front end options. The most promising was the Plain JavaScript option which is at this link:

https://docs.hcaptcha.com/

In the first couple of paragraphs, it explains that you just need to add two pieces of JavaScript to your form.

<script src="https://js.hcaptcha.com/1/api.js" async defer></script>

and

<div class="h-captcha" data-sitekey="your_site_key"></div>

Here is their suggested HTML code:

<html>

<head>

<title>hCaptcha Demo</title>

<script src="https://js.hcaptcha.com/1/api.js" async defer></script>

</head>

<body>

<form action="" method="POST">

<input type="text" name="email" placeholder="Email" />

<input type="password" name="password" placeholder="Password" />

<div class="h-captcha" data-sitekey="your_site_key"></div>

<br />

<input type="submit" value="Submit" />

</form>

</body>

</html>


The confirmation test looks like this:

curl https://hcaptcha.com/siteverify \

-X POST \

-d "response=CLIENT-RESPONSE&secret=YOUR-SECRET"

There is more information on this page and on this page:

https://docs.hcaptcha.com/configuration

There are also two Joomla plugins that have been developed for hCaptcha. There is a general plugin that works with the standard Joomla Registration form. Here is a link to this plugin:

https://extensions.joomla.org/extension/hcaptcha/

and there is an RS forms hCaptcha plugin at this link:

https://www.rsjoomla.com/support/do...modules/plugin-hcaptcha-spam-protection-.html

Thanks for your assistance in solving this important issue!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top