Jump to content
polosat

[Free Module] Contact form anti-spam: reCAPTCHA and blacklist (PS 1.5/1.6/1.7)

Recommended Posts

Hi everyone!

I want to share my contact form antispam module. It uses reCAPTCHA and a simple blacklist.
The module is fully compatible with PrestaShop 1.5, 1.6 and 1.7.
You just need to fill reCAPTCHA keys and it will work.

Get reCAPTCHA keys here: https://www.google.com/recaptcha/admin

Any feedback is highly appreciated.

 

Version 1.1.4

 - small fixes and improvements

 

1.thumb.jpg.1cb8d74c459c30ede3f2b49436d1c3b4.jpg2.thumb.jpg.b30016a4154170cc0af9ae41d1c34b81.jpg

 

 

 

 

 

 

notarobot.zip

Edited by polosat

Share this post


Link to post
Share on other sites
On 30/03/2018 at 2:29 PM, tdsoft said:

hi, it automatic detected form or we must modify template?

 

On 30/03/2018 at 2:29 PM, tdsoft said:

hi, it automatic detected form or we must modify template?

you are the best man in the world this helped so much thank you thank you thank you !!!!

Share this post


Link to post
Share on other sites

Very nice thank you. Appreciate your effort.

Can the * be used to blacklist all emails from a specific domain, for example *@mail.ru ?

 

 

Share this post


Link to post
Share on other sites

Hi,

I installed it, but it not work correctly .I filled the keys.

It seems ok, but you can send massage without check "I am not a robbot". Just i enter send button and the message is send.

My version of prestashop is 1.6.1.13.

Maybe i have to do something else?

 

Share this post


Link to post
Share on other sites

Hmm, that's strange. Did you get any warnings during installation? Or maybe you have overrides disabled? (in Back Office > Advanced Parameters > Performance)

Share this post


Link to post
Share on other sites

Hi,

I have another question. 

I tried to change the error message to mine language (Bulgarian). But if I use Cyrillic, the module stop working. If I use Latin letters, it's OK.

I changed the error massage in the notarobot.php.

It's not so important, but if it's possible, it will be better:).

Share this post


Link to post
Share on other sites

I had tried ten times, but I searched it in the wrong place. When I sow your answer, i understood that it's in the error massages  sector.

Thanks man. God bless you :).

Share this post


Link to post
Share on other sites
On 4/3/2018 at 5:44 PM, polosat said:

You can simply enter mail.ru, it'll blacklist all emails from that domain.

 

Thank you. Unfortunately it seems not to work. I have 4 different .ru spam emails I would like to blacklist but they keep getting through.  In fact today was more than double. Anything I am missing?

Edited by Dave L

Share this post


Link to post
Share on other sites

Well... you can try to use one of those email addresses in contact form and see if the module actually works. Maybe you have overrides disabled?
Could you show me your blacklist field content?

Share this post


Link to post
Share on other sites
12 hours ago, polosat said:

Well... you can try to use one of those email addresses in contact form and see if the module actually works. Maybe you have overrides disabled?
Could you show me your blacklist field content?

 

You were totally correct. My Disable Overrides was set to yes. Now it works perfectly. Thank you for a very useful module.

Share this post


Link to post
Share on other sites

Thank you so much for this module. I am having an issue though. Even though I have a domain on the blacklist the message still goes through. On the contact page it says that the e-mail is blocked but it still shows up in the back office.

 

I have disable all overrides set to no

 

I just put in mail.ru and @mail.ru in the black list box. I am running prestashop 1.7.3

 

Thank you again

Share this post


Link to post
Share on other sites

Thank you very much for this.  I've recently been spammed for the past few weeks by some russian bot at mail.ru.

 

I'm a complete newbie to this and have never installed a module before.  This was very simple and worked straight away.  Very grateful, thanks.

 

Chris

Share this post


Link to post
Share on other sites

Hi, thanks for your fabulous module, it works like a charm.

I removed my simple override for captcha and used your module.

But, it is possible to add a translation step to it?

The translation of the "I'm not a robot" message in the capthca.

I found this tutorial: https://stackoverflow.com/questions/28769893/setting-recaptcha-version-2-set-another-language-other-than-english

I planned to integrate some of the suggestion of those page before using your module

Actually with your module (don't know why) the message in the captcha frame is always in italian instead of english and don't change according with my site language.

Thanks in advance for any support.

Share this post


Link to post
Share on other sites

Hi,

Oh, you're right, there should be a language option. I've added it. Thanks for the idea :)

By default the message is displayed in a user's browser language, not site language. Most likely that's why you see Italian.

 

notarobot.zip

Share this post


Link to post
Share on other sites

I just want to say thank you for your free module. Now i do not get any messages from @mail.ru

Have a nice day.

Share this post


Link to post
Share on other sites
19 hours ago, Mustafa Ali Keskin said:

hi

how can i put it on the right side

Hi,

You can add these styles to the "Custom CSS" field:

#nar-gre {
    overflow: hidden;
}
#nar-gre > div {
    float: right;
}

Actually it seems I need to add an alignment option, but it'll be a bit later.

 

18 hours ago, HUHA said:

I just want to say thank you for your free module. Now i do not get any messages from @mail.ru

Have a nice day.

You're welcome, I'm glad it is useful:)

Share this post


Link to post
Share on other sites
On 30/03/2018 at 1:13 PM, polosat said:

Hi everyone!

I want to share my contact form antispam module. It uses reCAPTCHA and a simple blacklist.
The module is fully compatible with PrestaShop 1.5, 1.6 and 1.7.
You just need to fill reCAPTCHA keys and it will work.

Get reCAPTCHA keys here: https://www.google.com/recaptcha/admin

Any feedback is highly appreciated.

 

Version 1.1.0

 - added a choosing language option

 

1.thumb.jpg.1cb8d74c459c30ede3f2b49436d1c3b4.jpg2.thumb.jpg.b30016a4154170cc0af9ae41d1c34b81.jpg

 

 

notarobot.zip

Hello and thank you so so much, you really helped a lot of people out with this module !

 

Keep your genius and kindness up !

 

Thanks again !

Share this post


Link to post
Share on other sites

Hi

I have been trying to deploy this module on a shop, with no success...

With everything configured right, when I'm trying to submit a form, after completing the recaptcha I get the error "Please confirm that you are not a robot".

The "Overrides" option in admin panel is well set, I got the correct recaptcha keys inserted, and for some reason still can't submit without errors...

 

Thanks in advance

 

EDIT: I'm running PS 1.6.1.8

Edited by meloonPT

Share this post


Link to post
Share on other sites
1 minute ago, polosat said:

Hi,

That's strange, I don't know what else can be wrong.

Could you show me your shop?

 

Hi,

 

The store is at https://printhouse.pt/

Right now I am using a different module to use recapcha, but it isn't as good as yours.

 

Thanks

Share this post


Link to post
Share on other sites

Well... I can guess only two options:

1) Check your recaptcha keys, maybe there are extra spaces etc.

2) Maybe there is some conflict with that another recaptcha module. As I understand it should use ContactController override as well.

 

Share this post


Link to post
Share on other sites

It appeared after some time ^^'

I've just tested once, it work fine !

I've tried many things and couldn't make them work (I'm bad at these stuff...)

 

So, Thank You VERY VERY VERY MUCH !

 

Share this post


Link to post
Share on other sites
3 hours ago, polosat said:

Well... I can guess only two options:

1) Check your recaptcha keys, maybe there are extra spaces etc.

2) Maybe there is some conflict with that another recaptcha module. As I understand it should use ContactController override as well.

 

 

Hey,

So, updated prestashop to 1.6.1.18 and it is working fine, no problems!

 

Thanks for the assist!

Share this post


Link to post
Share on other sites
On 13/4/2018 at 2:20 PM, polosat said:

Hi,

You can add these styles to the "Custom CSS" field:


#nar-gre {
    overflow: hidden;
}
#nar-gre > div {
    float: right;
}

Actually it seems I need to add an alignment option, but it'll be a bit later.

 

You're welcome, I'm glad it is useful:)

Thank you for the addon, work for me, i added the custom style suggested but it still to the left

Share this post


Link to post
Share on other sites
On 28.04.2018 at 5:41 PM, Drazh said:

Thank you for the addon, work for me, i added the custom style suggested but it still to the left

Try to clear browser cache and PrestaShop cache, maybe it's the issue.

If it doesn't help, please show me an example live page, I'll check it.

Share this post


Link to post
Share on other sites

It seems the code has been corrupted a bit, maybe it happened during copying. Please copy that CSS code again and make sure that the ">" symbol is not converted to ">"

#nar-gre {
    overflow: hidden;
}
#nar-gre > div {
    float: right;
}

 

Share this post


Link to post
Share on other sites

Hello, i'm new to the PrestaShop thing i installed and configured this module, as it has everything i need and seems awesome. But i don't seem to find a way to use it, i can't find a way to add it with Visual Composer. It doesn't show up on the elements page.

Thank You

Share this post


Link to post
Share on other sites

Hello,

Do you mean Live Edit functionality?

This module automatically appears at the Contact Us page, it can't be added via Live Edit.

Share this post


Link to post
Share on other sites
On 3/30/2018 at 2:13 PM, polosat said:

Hi everyone!

I want to share my contact form antispam module. It uses reCAPTCHA and a simple blacklist.
The module is fully compatible with PrestaShop 1.5, 1.6 and 1.7.
You just need to fill reCAPTCHA keys and it will work.

Get reCAPTCHA keys here: https://www.google.com/recaptcha/admin

Any feedback is highly appreciated.

 

Version 1.1.0

 - added a choosing language option

 

1.thumb.jpg.1cb8d74c459c30ede3f2b49436d1c3b4.jpg2.thumb.jpg.b30016a4154170cc0af9ae41d1c34b81.jpg

 

 

notarobot.zip

Hi, when i want to install module - i got this error: 

The following module (s) could not be installed properly: notarobot:     Can not install override: PostProcess method in ContactController class is already overwritten.

Can help me with this?

Thanks a lot!

Share this post


Link to post
Share on other sites
11 hours ago, Daniela said:

Hi, when i want to install module - i got this error: 

The following module (s) could not be installed properly: notarobot:     Can not install override: PostProcess method in ContactController class is already overwritten.

Can help me with this?

Thanks a lot!

Hi,

Sure, please send me you current /override/controllers/ContactController.php file, I'll combine it with the module's file.

Share this post


Link to post
Share on other sites
11 hours ago, polosat said:

Hi,

Sure, please send me you current /override/controllers/ContactController.php file, I'll combine it with the module's file.

Hi, i attach my file /override/controllers/front/ContactController.php. Thanks a lot for your help!

ContactController.php

Share this post


Link to post
Share on other sites
On 11.05.2018 at 9:11 AM, Daniela said:

Hi, i attach my file /override/controllers/front/ContactController.php. Thanks a lot for your help!

ContactController.php

Hi,

Sorry for the delay...

Here is the updated override. You need to delete your current override file, install the module and then upload the attached override file to your server.

ContactController.php

Share this post


Link to post
Share on other sites
12 hours ago, polosat said:

Hi,

Sorry for the delay...

Here is the updated override. You need to delete your current override file, install the module and then upload the attached override file to your server.

ContactController.php

Hi, I delete the ContactContrller.php from override, but now when i try to install the module i get this : "The following module(s) could not be installed properly:

  • notarobot : 
        Nu se poate instala override-ul: Class ContactControllerOverrideOriginal5afbc024d18e0 does not exist

Thanks a lot for your help!

"

Share this post


Link to post
Share on other sites

Hmm, try to clear the PrestaShop cache. Did you delete the /override/controllers/front/ContactController.php file?

Share this post


Link to post
Share on other sites
On 5/10/2018 at 10:52 AM, Daniela said:

Hi, when i want to install module - i got this error: 

The following module (s) could not be installed properly: notarobot:     Can not install override: PostProcess method in ContactController class is already overwritten.

Can help me with this?

Thanks a lot!

Hi, now it work. Thanks a lot. Can I put this module in create new account formular?

Edited by Daniela

Share this post


Link to post
Share on other sites
9 hours ago, Daniela said:

Hi, now it work. Thanks a lot. Can I put this module in create new account formular?

Hi,

No, unfortunately it works only with contact form.

Share this post


Link to post
Share on other sites

Hmm, the module doesn't seem to be active. Are you sure it's activated? Make sure it's activated for that particular shop if you have multishop enabled.

Also you can check if it's hooked to the Header hook (Modules > Positions page in Back Office)

Share this post


Link to post
Share on other sites
Can you help solve the problem? capatcha does not work..
in the back office, messages still come.

 PS ver. 1.7.2.2

Screen Shot 05-24-18 at 03.18 PM.PNG

Edited by kaminski

Share this post


Link to post
Share on other sites

@polosat Yes, reCAPTCHA appears at contact page.  I sent you a link in a private message.

 

Messages do not reach box e-mail, but are displayed in the back office prestashop and database

Edited by kaminski

Share this post


Link to post
Share on other sites

Well... reCAPTCHA seems to work fine. Do you mean you don't want to receive messages from mail.ru? Did you add mail.ru domain to black list?

Share this post


Link to post
Share on other sites
Yes, I added mail.ru domain to the blacklist. I also get messages from other .ru domains... I read that the problem is somewhere in index.php, not in contactform


Edited by kaminski

Share this post


Link to post
Share on other sites

Hmm, that's strange. Blacklist should work since recaptcha works. Could you show me content of your blacklist?

Share this post


Link to post
Share on other sites

recaptcha works, messages do not come to my e-mail but come to back office in database
image.png.1717f55f68019ff030eb141c996cd3cf.png

 

the problem is also that an email with @ generatedomains.ru is coming.....  that is from @*.ru

 

examples: @yandex.ru , @front.ru , @mail.ru ..... How to stop it??
 

Edited by kaminski

Share this post


Link to post
Share on other sites

installed the module captcha appears but i can submit without verifying.  and does not filter blacklist

 

Share this post


Link to post
Share on other sites
On 25.05.2018 at 12:53 AM, kaminski said:

recaptcha works, messages do not come to my e-mail but come to back office in database

the problem is also that an email with @ generatedomains.ru is coming.....  that is from @*.ru

examples: @yandex.ru , @front.ru , @mail.ru ..... How to stop it??

No-no-no, blacklist entries should be entered one by line. Sorry for the confusing option description. Only one domain per line.

Share this post


Link to post
Share on other sites
On 25.05.2018 at 1:38 PM, skochobahn said:

installed the module captcha appears but i can submit without verifying.  and does not filter blacklist

Make sure that overrides are enabled. In Back Office > Advanced Parameters > Performance > option "Disable all overrides"

Share this post


Link to post
Share on other sites
On 31.05.2018 at 1:50 AM, mackooo said:

He does not verify if I am a robot or not. Please help

http://multikolor.pl/kontakt

Please check that overrides are enabled in Back Office > Advanced Parameters > Performance > "Debug mode" block.

If it's not the reason of the problem, please try to reinstall the module first.

 

Share this post


Link to post
Share on other sites

Hi Polosat,

I've downloaded your module from your first link in this thread, and installed in my 1.6.1.5 version.

But I get a list of errors every time I enter in "Configure" section.

In the contact form the Captcha box is present (on the left, but it's not a problem for me) but if I click on the checkbox it remains unchecked and if I click on the send button, the response is:

There's an error. Please confirm that you are not a robot

notarbot-setup-errors.txt

 

Override button is ok, deleted cache.

Can you help me?

Barbara

Share this post


Link to post
Share on other sites

Hello Polosat,

Thank you very much for your effort on this fantastic module.  I am wondering if we can also add this to the customer sign up form. I am a newbie to Prestashop.

Regards, 

Share this post


Link to post
Share on other sites
On 20.06.2018 at 10:27 PM, fonderiapassarelli said:

Hi Polosat,

I've downloaded your module from your first link in this thread, and installed in my 1.6.1.5 version.

But I get a list of errors every time I enter in "Configure" section.

In the contact form the Captcha box is present (on the left, but it's not a problem for me) but if I click on the checkbox it remains unchecked and if I click on the send button, the response is:

There's an error. Please confirm that you are not a robot

notarbot-setup-errors.txt

Override button is ok, deleted cache.

Can you help me?

Barbara

Hi Barbara,

That's strange, those errors don't seem to have any relation to the problem. Anyway I fixed them, you can try the latest module version.

Try to reinstall the module, maybe it'll help. Did it show any warnings during the installation?

Could you show me your website? Maybe there is some Javascript errors, I can check it.

notarobot.zip

Share this post


Link to post
Share on other sites
On 23.06.2018 at 6:52 AM, MannyF said:

Hello Polosat,

Thank you very much for your effort on this fantastic module.  I am wondering if we can also add this to the customer sign up form. I am a newbie to Prestashop.

Regards, 

Hi,

No, unfortunately the sign up form is very different from the contact form. This module can't do that.

Share this post


Link to post
Share on other sites

Thx for a great module!!!!!

Any progress on get it to move to the right, i try what you wrote:

#nar-gre {
    overflow: hidden;
}
#nar-gre > div {
    float: right;
}

 

But it dosent move....any other way to do it???

 

Regards

 

Maria

 

Share this post


Link to post
Share on other sites
20 hours ago, Maria said:

Thx for a great module!!!!!

Any progress on get it to move to the right, i try what you wrote:

#nar-gre {
    overflow: hidden;
}
#nar-gre > div {
    float: right;
}

But it dosent move....any other way to do it???

Regards

Maria

 

Hi Maria,

I've added an alignment option, you can try the new version of the module.

notarobot.zip

Share this post


Link to post
Share on other sites

Hello Polosat,

i got a problem. It doesn't show on my contact form. I am using toolsmarket version 2.0 theme.

http://www.makportugal.com/contact-us

 

i have verified contact-form.tpl and no changes have made it,,, it´s normal??

I have forced compilations and cache cleaning...

Can u help me?

Thks in advance

 

 

Share this post


Link to post
Share on other sites
21 hours ago, ravelino said:

Hello Polosat,

i got a problem. It doesn't show on my contact form. I am using toolsmarket version 2.0 theme.

http://www.makportugal.com/contact-us

i have verified contact-form.tpl and no changes have made it,,, it´s normal??

I have forced compilations and cache cleaning...

Can u help me?

Thks in advance

Hi,

Yes, it's ok, contact-form.tpl shouldn't be changed.

As I can see you have a few Javascript errors, maybe they are the problem. Try to temporarily disable module "totop", which seems to cause those errors, and see if it helps.

Share this post


Link to post
Share on other sites
19 minutes ago, polosat said:

Hi,

Yes, it's ok, contact-form.tpl shouldn't be changed.

As I can see you have a few Javascript errors, maybe they are the problem. Try to temporarily disable module "totop", which seems to cause those errors, and see if it helps.

 

thks for your reply, 

module "totop" is now disable,

I have forced compilations and cache cleaning... after it!

but as you can see it did not help...

:(

 

Share this post


Link to post
Share on other sites
On 25/6/2018 at 6:04 PM, polosat dice:

Hi Barbara,

That's strange, those errors don't seem to have any relation to the problem. Anyway I fixed them, you can try the latest module version.

Try to reinstall the module, maybe it'll help. Did it show any warnings during the installation?

Could you show me your website? Maybe there is some Javascript errors, I can check it.

notarobot.zip

Thank you Polosat, for the new zip, now setup procedure doesn't present errors, but when I compile my contact form and try to check the recaptcha box, it doesn't became checked.

My site is www.fonderiapassarelli.com

Thank you in advance.

Barbara

Share this post


Link to post
Share on other sites

Hello,

I have installed this on 1.7.3.3, a new store I am setting up.

The module installs and accepts my API keys, and appears on the contact us page. If I do not check the captcha box, a message says "confirm you are not a robot" but the message still logs in my Back Office. I have checked that "Disable all overrides" is set to NO, uninstalled, re-installed, cleared cache and its the same function. I aslo noticed when I re-installed, all my settings were pre-loaded which makes me wonder what good the un-install was? Do you have any suggestions of what else I should check?

 

Also, is there anyway to hide my email address on the contact US page? I'm not sure what good recaptcha is when my email is post on the page with a link to open the user's default mail agent with my email address.

 

Thank you

Edited by markcm
spelling

Share this post


Link to post
Share on other sites

Thanks so much for sharing this module!

I was able to install it without any problems & added my reCaptcha API keys.

However, when I actually try to send a message I get the error:

Quote

There is 1 error

  1. An error occurred while sending the message.

 But then there's no explanation of what the error is :/ Am I missing something?

The contact form is located here on my test site: https://getkawaii.com/shop/contact-us

Share this post


Link to post
Share on other sites

Thanks for the module - works fine here! :-)

Is there any way to slightly modify the width/length of the reCAPTCHA window?

On our theme it is just a little bit to wide to perfectly fit with the columns above..

 

 

reCAPTCHA.jpg

Share this post


Link to post
Share on other sites
On 12.07.2018 at 8:51 AM, markcm said:

Hello,

I have installed this on 1.7.3.3, a new store I am setting up.

The module installs and accepts my API keys, and appears on the contact us page. If I do not check the captcha box, a message says "confirm you are not a robot" but the message still logs in my Back Office. I have checked that "Disable all overrides" is set to NO, uninstalled, re-installed, cleared cache and its the same function. I aslo noticed when I re-installed, all my settings were pre-loaded which makes me wonder what good the un-install was? Do you have any suggestions of what else I should check?

Also, is there anyway to hide my email address on the contact US page? I'm not sure what good recaptcha is when my email is post on the page with a link to open the user's default mail agent with my email address.

Thank you

Hi,

Hmm, I'll recheck the compatibility with your PrestaShop version, maybe I missed something.
Contact email from the contact us page can be hidden only by removing it from the contact form template. For classic theme it's "/themes/classic/modules/ps_contactinfo/ps_contactinfo-rich.tpl" file.

Share this post


Link to post
Share on other sites
On 12.07.2018 at 11:06 AM, kurisuti said:

Thanks so much for sharing this module!

I was able to install it without any problems & added my reCaptcha API keys.

However, when I actually try to send a message I get the error:

 But then there's no explanation of what the error is :/ Am I missing something?

The contact form is located here on my test site: https://getkawaii.com/shop/contact-us

Do you have this error when the module is uninstalled?
Also you can try to temporarily enable debugging to see if there are any errors: https://www.prestashop.com/forums/topic/224525-how-to-turn-on-error-reporting-for-debug-information-blank-page-500-internal-server-error/

Share this post


Link to post
Share on other sites
On 13.07.2018 at 11:58 AM, kmorgen said:

Thanks for the module - works fine here! :-)

Is there any way to slightly modify the width/length of the reCAPTCHA window?

On our theme it is just a little bit to wide to perfectly fit with the columns above..

There is no standard way to slightly change its size, but you can add the following styles into the Custom CSS option field:

#nar-gre {
    transform: scale(0.9);
    transform-origin: 0 0;
}

You can change 0.9 to other value.

Share this post


Link to post
Share on other sites