konstantincodes / mautic-recaptcha Goto Github PK
View Code? Open in Web Editor NEWThis Plugin brings reCAPTCHA integration to mautic.
License: GNU General Public License v3.0
This Plugin brings reCAPTCHA integration to mautic.
License: GNU General Public License v3.0
Hi,
plugin does not work on Focus items -form.
I have created a form where the recaptcha field is also.
If I want to display the form via Focus Items (Collect Date-Modal), it will display as follows without recaptcha:
If I subsequently submit, it will show an error:
If I put the form directly on the page via an iframe, the recaptcha will be displayed.
Where is the problem?
Regards
Hi,
I have noticed that the plugin stops working when a reCaptcha field is inserted multiple times on a page.
The problem is that the verifyCallback gets overridden.
One solution would be to use "verifyCallback_{$formName}" as the callback name.
Hi, I run a marketing agency and we love this plugin.
The only problem is that we can't use it on more than 250 sites at once (per Mautic instance).
This is because, according to Google: There is a limit of 250 domains per site key.
Since only 1 site key can be added to this plugin, we are limited to 250 domains.
Would love for the developer to add support for multiple site keys since Mautic is being used by many marketing agencies like mine although I understand if it's not something easily done 😄
Mautic V4
mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Form\Exception\TransformationFailedException: "Unable to transform value for property path "[minScore]": Expected a numeric." at /home/admin/web/test/public_html/vendor/symfony/form/Form.php line 1110 {"exception":"[object] (Symfony\Component\Form\Exception\TransformationFailedException(code: 0): Unable to transform value for property path "[minScore]": Expected a numeric. at /home/admin/web/test/public_html/vendor/symfony/form/Form.php:1110, Symfony\Component\Form\Exception\TransformationFailedException(code: 0): Expected a numeric. at /home/admin/web/test/public_html/vendor/symfony/form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php:115)"}
Hello,
Thanks for this great plugin!
However, I added it to a form that's in a Focus Item, and it doesn't seem to work when you do it that way.
The form that shows doesn't even show the reCAPTCHA (and I'm using the v2 Checkbox reCAPTCHA).
When you submit, it thinks a bit then responds that reCAPTCHA failed. So it's there, but something about doesn't work. I suspect it's b/c the focus item is in an iFrame.
Just giving you a heads up.
Thanks again for this great plugin!
For various reasons I need to manually copy form code onto my sites.
Previously re-captcha added 'callback' script into the body of the form. Now it adds it to the header script - which is a disaster because the script targets ONE form. It means you can have only one form across an entire website. Of course, I have many - quote, contact, subscribe etc. so have to strip out the script and manually add it back in per form. Could the plugin please revert to adding code per-form - or some other method that doesn't limit me to one form per site. Thanks.
Since I use this plugin on a multilingual page, it would be useful if the validation message were customizable, so I can translate it.
Would this be possible?
Thanks in advance
Hi,
I'm using Mautic v3.3.2 and posting new form data using Mautic Api-Library.
For creating reCAPTCHA form field, I'm passing type=plugin.recaptcha.
Form is creating up but reCAPTCHA form field is not created and showing "The template "MauticFormBundle:Field:plugin.recaptcha.html.php" does not exist" error message.
I have followed installation-via-zip steps, it works with mautic ui but not working when using API-Library.
When I try to install the new version (for mautic 3 and 4) in mautic 4.3.1, it does not show the plugin in the mautic and gives an error in the mautic console (settings->System-Info->log file).
mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Schema\SchemaException: "There is no table with name 'asdq3_mautic.leads' in the schema."
I am trying to install it through FTP but with no success.
I need your help. Thanks in advance.
Will this work with reCaptcha v2 AND v3? Or only v2?
According to the docs there is a 2 minute limit on a valid CAPTCHA, and it appears that this plugin executes the CAPTCHA on page load rather than when a form is actually submitted. If you load page, wait over 2 minutes, then try to submit, the CAPTCHA always fails.
It will not install for me. I have tried composer and a manual install. Any ideas of what I should look for?
I forgot to mention that I looked at clearing the cache, but it is empty
The instructions state
_
Clear the cache via console command php app/console cache:clear --env=prod (might take a while) OR manually delete the app/cache/prod directory.
_
This directory no longer is used for cache. Cache is found in /var/cache/
I have successfully installed the plugin, but when inserting a reCaptcha field to one of my forms the plugin just crashes with a 500 Internal Server Error. Looking in Mautic log these are the error messages I'm getting:
[2023-10-15 10:52:45] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Form\Exception\TransformationFailedException: "Unable to transform value for property path "[minScore]": Expected a numeric." at /var/www/html/vendor/symfony/form/Form.php line 1131 {"exception":"[object] (Symfony\\Component\\Form\\Exception\\TransformationFailedException(code: 0): Unable to transform value for property path \"[minScore]\": Expected a numeric. at /var/www/html/vendor/symfony/form/Form.php:1131, Symfony\\Component\\Form\\Exception\\TransformationFailedException(code: 0): Expected a numeric. at /var/www/html/vendor/symfony/form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php:107)"} {"hostname":"cec57cb3e8d8","pid":44}
Tried both reCaptcha v2 and v3, both give me same error message. Site key and site secret entered in configuration.
Hello!
Running Mautic v2.12.1 with a fairly standard installation on a linux server the plugin will not show up:
I unzipped the package and renamed the folder as mautic/plugins/MauticRecaptchaBundle - with the plugin data (e.g. MauticRecaptchaBundle.php) in that folder the plugin won't install, i.e. it will not show up in the plugin list after clicking install/upgrade.
I did delete the cache and I do not use APC cache.
Is there anything else I have to consider: Obviously I am missing something, but the installation instructions are quite simple and straight-forward, so there must be something else to consider...
Thanks in advance for any advice.
Albrecht
Hi @KonstantinCodes !
I'm in charge of Mautic Community Product Team. I'd like to discuss with you about few things. Is it possible that you reach me by email or on Mautic Slack please ?
Thanks !
I installed the plugin on Mautic5, the recaptcha working fine when choose the v2, but it's not working with v3.
recaptcha not loading, but there is error. Any suggestions to debug the issue?
Hi Konstantin. First of all thanks for this great work. It saved us from indefatigable spam bots.
I'm wondering if we can find a way to load reCaptcha on demand. I have a site where I have a sign in form in all fages, and now I'm loading reCaptcha.
It slowed down the page speed in all page metrics due to multiple requests and recaptcha css.
Do you know if/how we can implement one of these solutions here?
https://stackoverflow.com/questions/35245768/load-recaptcha-dynamically
Thanks in advance.
Hello
I tried to use the plugin but it won't even get to the part where I can go and install it. After unzipping it and changing the name and clearing the Cache - the application throws a 500 error. Removing the plugin and clearing the cache again gets rid of the error. Could you please help?
The error that I Found is below
[19-Apr-2020 07:58:38 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2636 [19-Apr-2020 07:58:38 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636 [19-Apr-2020 07:58:38 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2665 [19-Apr-2020 07:58:38 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665 [19-Apr-2020 07:58:39 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2636 [19-Apr-2020 07:58:39 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636 [19-Apr-2020 07:58:39 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2665 [19-Apr-2020 07:58:39 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665 [19-Apr-2020 07:58:50 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2636 [19-Apr-2020 07:58:50 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636 [19-Apr-2020 07:58:50 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2665 [19-Apr-2020 07:58:50 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665 [19-Apr-2020 07:58:52 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2636 [19-Apr-2020 07:58:52 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636 [19-Apr-2020 07:58:52 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2665 [19-Apr-2020 07:58:52 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665 [19-Apr-2020 07:59:00 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2636 [19-Apr-2020 07:59:00 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636 [19-Apr-2020 07:59:00 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2665 [19-Apr-2020 07:59:00 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665 [19-Apr-2020 07:59:48 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2636 [19-Apr-2020 07:59:48 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636 [19-Apr-2020 07:59:48 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2665 [19-Apr-2020 07:59:48 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665 [19-Apr-2020 08:01:11 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2636 [19-Apr-2020 08:01:11 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636 [19-Apr-2020 08:01:11 UTC] PHP Warning - "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? - in file /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php - at line 2665 [19-Apr-2020 08:01:11 UTC] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /location-of-mautic-root/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
this has to move to tag. right now its loading in body tag. Its not working properly
Adicionei o plugin na pasta plugins, limpei o cache, fiz a instalação e adicionei as minhas chaves do google recaptcha. Até aqui tudo certo.
Mas não consigo adicionar o campo do recaptcha no formulário. Sempre dá um erro 500 na hora de adicionar o campo.
I have installed it on Mautic 3.3.3 and it works, but it throws an error on the thank you page:
Uncaught (in promise) TypeError: Cannot set properties of null (setting 'value')
at verifyCallback_c4d7a85729b431945e7ec1ed9cab42b3 (multumesc-myf:150:88)
at multumesc-myf:154:13
I use reCAPTCHA v3 and the html code Mautic generated for me is:
<div id="mauticform_mapyourfuture2022_recaptcha1" style="text-align: center;" class="mauticform-row mauticform-div-wrapper mauticform-field-7"> <input id="mauticform_input_mapyourfuture2022_recaptcha1" name="mauticform[recaptcha1]" value="" class="mauticform-input" type="hidden"/> <span class="mauticform-errormsg" style="display: none;"></span>
any help would be appreciated.
How to have the reCaptcha's texts in a different language than mautic?
Error
[2023-02-22 17:28:56] mautic.CRITICAL: Uncaught PHP Exception TypeError: "MauticPlugin\MauticRecaptchaBundle\EventListener\FormSubscriber::__construct(): Argument #5 ($translator) must be of type Symfony\Component\Translation\TranslatorInterface, Mautic\CoreBundle\Translation\Translator given, called in /var/www/html/var/cache/dev/ContainerEfSedQs/getMautic_Recaptcha_EventListener_FormSubscriberService.php on line 9" at /var/www/html/plugins/MauticRecaptchaBundle/EventListener/FormSubscriber.php line 80 {"exception":"[object] (TypeError(code: 0): MauticPlugin\\MauticRecaptchaBundle\\EventListener\\FormSubscriber::__construct(): Argument #5 ($translator) must be of type Symfony\\Component\\Translation\\TranslatorInterface, Mautic\\CoreBundle\\Translation\\Translator given, called in /var/www/html/var/cache/dev/ContainerEfSedQs/getMautic_Recaptcha_EventListener_FormSubscriberService.php on line 9 at /var/www/html/plugins/MauticRecaptchaBundle/EventListener/FormSubscriber.php:80)
I tried on my 2 accounts. Every time, after adding plugin on my server and clear cache files, Mautic show bug, that web is offline. When I delete plugin and clear cache again, Mautic work.
here the console output :
root@d4e1c93169c1:/var/www/html# composer require koco/mautic-recaptcha-bundle:3.*
The "ocramius/package-versions" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "robloach/component-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
./composer.json has been created
The "ocramius/package-versions" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "robloach/component-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Running composer update koco/mautic-recaptcha-bundle
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- koco/mautic-recaptcha-bundle[3.0.0, ..., 3.0.1] require mautic/composer-plugin ^1.0 -> satisfiable by mautic/composer-plugin[1.0.0, 1.0.1].
- mautic/composer-plugin[1.0.0, ..., 1.0.1] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- Root composer.json requires koco/mautic-recaptcha-bundle 3.* -> satisfiable by koco/mautic-recaptcha-bundle[3.0.0, 3.0.1].
You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.
Installation failed, deleting ./composer.json.
Looks like a few tweaks need to be made to make it work for Mautic 5.
PHP Fatal error: Declaration of MauticPlugin\MauticRecaptchaBundle\Integration\RecaptchaIntegration::appendToForm(&$builder, $data, $formArea) must be compatible with Mautic\PluginBundle\Integration\AbstractIntegration::appendToForm(&$builder, $data, $formArea): void in /var/www/vhosts/domain.net/subdomains/hello5/docroot/plugins/MauticRecaptchaBundle/Integration/RecaptchaIntegration.php on line 51
In RecaptchaIntegration.php line 51:
Compile Error: Declaration of MauticPlugin\MauticRecaptchaBundle\Integration\RecaptchaIntegration::appe
ndToForm(&$builder, $data, $formArea) must be compatible with Mautic\PluginBundle\Integration\AbstractI
ntegration::appendToForm(&$builder, $data, $formArea): void
Good day.
I had installed this plugin and it worked fine for a while but suddenly disappeared. No updates were done. I had only installed a new SSL certificate recently. What could be causing this to not show up?
I moved the MauticRecaptchaBundle directory of this repository to the plugins/ directory and clicked the "Install/Upgrade Plugins" button.
Still the plugin is not getting listed in the menu.
I installed this plugin via zip and ftp, cleared cache, and the plugin does not show up in the Install/Upgrade plugins section. Am I doing something wrong?
Hi,
When I try to install this Mautic plugin I have this output from composer:
`# composer require koco/mautic-recaptcha-bundle
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^1.1 for koco/mautic-recaptcha-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Generating autoload files
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
// Clearing the cache for the prod environment with debug false
[OK] Cache for the "prod" environment (debug=false) was successfully cleared.
php -r "if(file_exists('./.git')&&file_exists('./build/hooks/pre-commit'.(PHP_OS=='WINNT'?'.win':''))){copy('./build/hooks/pre-commit'.(PHP_OS=='WINNT'?'.win':''),'./.git/hooks/pre-commit');}"
php -r "if(file_exists('./.git/hooks/pre-commit')&&(PHP_OS!='WINNT')){chmod('./.git/hooks/pre-commit',0755);}"`
Any clue why ?
Hi! We followed the steps of the guide and installed the plugin, but when we submit a form with the recaptcha not ticked, it still creates the contact in Mautic. Everything seems fine but we don't know what could we be missing.
I enclose the landing page code for you to see.
Any help would be appreciated.
Thank you very much!
jmoreno
Is this plugin functional under PHPv8?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.