Cloudflare Turnstile Frictionless (CAPTCHA)

Integrating Cloudflare Turnstile into Mautic would provide significant benefits for users, including enhanced security and improved lead capture capabilities. Turnstile’s customizable captcha system can prevent spam submissions and protect against brute-force attacks, while its multi-factor authentication adds an extra layer of security to user accounts.

Additionally, Turnstile’s flexible form builder can help streamline the lead capture process by allowing users to create custom forms with conditional logic and personalized messaging. Overall, integrating Turnstile would be a valuable addition to Mautic’s feature set, providing users with powerful tools to enhance their marketing efforts.

For an experience developer it would be around 10 minutes of time if you have Google reCaptcha already included in your code to add Turnstile integration.

Turnstile Documentation

Migration from reCaptcha

2 Likes

I think it’s a good one.
There already is a recaptcha plugin, you probably want to drop by @johnwick.

Who knows, maybe KonstantinCodes is interested in making a version of his plugin for Turnstile!?

Here’s a good video about it?

1 Like

Thanks Yosu!

I was able to use that plugin and make it work with Turnstile.
Screenshot 2023-05-01 at 9.15.46 PM

Line 45 recaptcha.html.php

<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?compat=recaptcha" async defer></script>

Line 20 RecaptchaClient.php

    const VERIFY_URL = 'https://challenges.cloudflare.com/turnstile/v0/siteverify';

It has to be on v2 to work.

Also, there’s missing variables to select: Day, Night, or Auto theme. I’ll work on adding that, plus stripping out the other v3 code, etc. in a bit and toss it up on Github once I’m happy with it.

2 Likes

Great, let us know if you need any help with the plugin or creating the repo and PR.
Or if you do not have the time, let me know too, I would probably want to continue your work.

1 Like

This is great. Is it also maybe GDPR compatible?

I think it is, so say the guys in the video…

Is this up on GitHub yet?

the video is good, the main thing is informative

Wow it’s good idea

I’m working on a version for Mautic 5 and will release it once it’s finally complete and the best integration possible.

2 Likes

Hello there. Has this been implemented in the version currently hosted in GitHub, specifically with Cloudflare Turnstile? for Mautic 4?

Any update? Nearly 2 years have passed.

Willing to get together with someone and buy a few beers/coffees.

We made a plugin with Cloudflare Turnstile support for Mautic forms.

Free on Github: https://github.com/FireMultimedia/mautic-multi-captcha-bundle/

Tried that but got several errors;

[hosting@alpha mautic]$ composer require firemultimedia/mautic-multi-captcha-bundle
Deprecation Notice: Composer\Installers\Installer::__construct(): Implicitly marking parameter $filesystem as nullable is deprecated, the explicit nullable type must be used instead in /home/hosting/subdomains/mautic/vendor/composer/installers/src/Composer/Installers/Installer.php:136
More deprecation notices were hidden, run again with -v to show them. ./composer.json has been updated
Running composer update firemultimedia/mautic-multi-captcha-bundle
Loading composer repositories with package information Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1

  • Root composer.json requires mautic/core-lib ^6.0 → satisfiable by mautic/core-lib[6.0.0-dev].
  • mautic/core-lib 6.0.0-dev requires ext-imap * → it is missing from your system. Install or enable PHP’s imap extension.
    Problem 2
  • Root composer.json requires firemultimedia/mautic-multi-captcha-bundle * → satisfiable by firemultimedia/mautic-multi-captcha-bundle[dev-main, dev-develop, 1.0.0, 1.0.1, 1.0.2, 9999999-dev].
  • firemultimedia/mautic-multi-captcha-bundle 1.0.0 requires mautic/core-lib ^6.0 → satisfiable by mautic/core-lib[6.0.0-dev].
  • firemultimedia/mautic-multi-captcha-bundle 1.0.1 requires mautic/core-lib ^5.0|^6.0 → satisfiable by mautic/core-lib[6.0.0-dev].
  • firemultimedia/mautic-multi-captcha-bundle[dev-main, dev-develop, 1.0.2] require mautic/core-lib ^5.0|^6.0|^7.0 → satisfiable by mautic/core-lib[6.0.0-dev].
  • mautic/core-lib 6.0.0-dev requires ext-imap * → it is missing from your system. Install or enable PHP’s imap extension.

To enable extensions, verify that they are enabled in your .ini files:

  • /opt/cpanel/ea-php84/root/etc/php.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/01-ioncube.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-bcmath.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-calendar.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-ctype.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-curl.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-dom.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-exif.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-fileinfo.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-ftp.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-gd.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-iconv.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-intl.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-mbstring.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-mysqlnd.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-pdo.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-phar.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-posix.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-simplexml.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-soap.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-sockets.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-sodium.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-sqlite3.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-tokenizer.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-xml.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-xmlwriter.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-xsl.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/20-zip.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/30-mysqli.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/30-pdo_mysql.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/30-pdo_sqlite.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/30-xmlreader.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/i360.ini
  • /opt/cpanel/ea-php84/root/etc/php.d/zzzzzzz-pecl.ini
    You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
    Alternatively, you can run Composer with --ignore-platform-req=ext-imap to temporarily ignore these required extensions.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. “composer require firemultimedia/mautic-multi-captcha-bundle:*” to figure out if any version is installable, or “composer require firemultimedia/mautic-multi-captcha-bundle:^2.1” if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
[hosting@alpha mautic]$ php --ini
/opt/cpanel/ea-php83/root/usr/bin/php: /opt/cpanel/ea-libxml2/lib64/libxml2.so.2: no version information available (required by /opt/cpanel/ea-php83/root/usr/bin/php)
/opt/cpanel/ea-php83/root/usr/bin/php: /opt/cpanel/ea-libxml2/lib64/libxml2.so.2: no version information available (required by /opt/cpanel/ea-php83/root/usr/bin/php)
/opt/cpanel/ea-php83/root/usr/bin/php: /opt/cpanel/ea-libxml2/lib64/libxml2.so.2: no version information available (required by /opt/cpanel/ea-php83/root/usr/bin/php)
Configuration File (php.ini) Path: /opt/cpanel/ea-php83/root/etc
Loaded Configuration File: /opt/cpanel/ea-php83/root/etc/php.ini
Scan for additional .ini files in: /opt/cpanel/ea-php83/root/etc/php.d
Additional .ini files parsed: /opt/cpanel/ea-php83/root/etc/php.d/01-ioncube.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-bcmath.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-calendar.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-ctype.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-curl.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-dom.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-exif.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-fileinfo.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-ftp.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-gd.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-iconv.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-imap.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-intl.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-mbstring.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-mysqlnd.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-pdo.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-phar.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-posix.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-simplexml.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-soap.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-sockets.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-sodium.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-sqlite3.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-tokenizer.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-xml.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-xmlwriter.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-xsl.ini,
/opt/cpanel/ea-php83/root/etc/php.d/20-zip.ini,
/opt/cpanel/ea-php83/root/etc/php.d/30-mysqli.ini,
/opt/cpanel/ea-php83/root/etc/php.d/30-pdo_mysql.ini,
/opt/cpanel/ea-php83/root/etc/php.d/30-pdo_sqlite.ini,
/opt/cpanel/ea-php83/root/etc/php.d/30-xmlreader.ini,
/opt/cpanel/ea-php83/root/etc/php.d/i360.ini,
/opt/cpanel/ea-php83/root/etc/php.d/zzzzzzz-pecl.ini

Don’t see the issues tab in GitHub so I can’t report it there…

This is probably not a problem with the plugin, but a specific issue with your installation. I think you need some help with the hosting and/or composer.