Zen Cart Logo
Forums / All Other Contributions/Addons / Support Thread for Google reCAPTCHA plugin

Support Thread for Google reCAPTCHA plugin

Views: 176,318

Results 481 to 500 of 694
13 Aug 2020, 5:03 PM
#481
reviresco avatar

reviresco

New Zenner

Join Date:
Jul 2017
Location:
United States
Posts:
10
Plugin Contributions:
0

Support Thread for Google reCAPTCHA plugin

DrByte:

These are typical when using a template (including any custom override files) built for an older version of Zen Cart, which didn't have the features that the newer versions of the plugin depends on.

I can confirm that this worked for me in v. 1.5.4. The Create Account form was going through without checking the reCaptcha box, until I added:

$zco_notifier->notify('NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK');

before

if ($error == true) {

in /includes/modules/YOUR_TEMPLATE/create_account.php

(couldn't figure out how to multi-quote, but this is what I was referring to:)

Reading a couple pages pack in this thread I saw someone mentioning their edits to /includes/modules/pages/contact_us/header_php.php on an older version of zen cart. I read to the very bottom of the instructions and saw this change is needed specifically on 1.5.1, even though I'm on 1.5.6 I tried it out as there was nothing left to do and sure enough the captcha became required to use the contact us form. Any ideas why 1.5.1 specific changes needed to be made on my 1.5.6 install?

I've also just had to do the same on the /includes/modules/TEMPLATE_NAME/create_account.php

Copying the zco notifier line across from the 1.3 files into this file made it work for me, else you could create an account without ticking the box!

J

13 Aug 2020, 5:30 PM
#482
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Support Thread for Google reCAPTCHA plugin

Reviresco:

Any ideas why 1.5.1 specific changes needed to be made on my 1.5.6 install?
Sounds like that particular file was still from an older version. Maybe you didn't upgrade that file? Maybe you installed a plugin that overwrote that file with something outdated?

6 Oct 2020, 10:34 AM
#483
phil99 avatar

phil99

Zen Follower

Join Date:
Aug 2007
Posts:
113
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Hi guys,

I installed this Recaptcha module a few months ago after getting spam sign ups.. but it has killed my sales and conversions...

So.. I tried to remove it from the create account page, just removing the recaptcha call from that page... this means it no longer displays, but when people try to create a new account now, they get the error message:

Please verify that you are not a robot

  • Required information

There is no code on this page though that refers to recaptcha... do i need to modify other files? I would like to keep it on the contact us page.. just do not want to lose anymore sales..

Thanks

6 Oct 2020, 12:19 PM
#484
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

EDIT: See Lat9's post below regarding 'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK'

6 Oct 2020, 12:28 PM
#485
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Support Thread for Google reCAPTCHA plugin

jeking:

NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK
In /includes/classes/observers/class.google_recaptcha.php , in the __construct() method, you can comment-out the $pages_to_check for those pages that shouldn't have the recaptcha applied.

6 Oct 2020, 12:42 PM
#486
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Thanks lat9.

15 Oct 2020, 2:43 PM
#487
chrispardy avatar

chrispardy

New Zenner

Join Date:
Jan 2020
Location:
Boston MA
Posts:
14
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Is the newest plugin ok to be used with v1.5.7

I've got to stopped these spammers somehow

15 Oct 2020, 3:00 PM
#488
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

ChrisPardy:

Is the newest plugin ok to be used with v1.5.7

I've got to stopped these spammers somehow

1.5.7 has built-in spam protection so this should not be needed.

"Email - SPAM prevention built in to forms (Credits @davewest for zenNonCAPTCHA)."

17 Nov 2020, 2:11 PM
#489
bdougherty avatar

bdougherty

New Zenner

Join Date:
Jul 2013
Location:
Fort Myers. Florida
Posts:
3
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

I just updated this plugin to the latest version and now the recaptcha checkbox just spins for 10 seconds when clicked then re-displays not checked.
My zen cart version is v1.5.5a.

I am seeing javascript errors in the console. I've been able to remove all but one error:

Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
https://www.gstatic.com/recaptcha/releases/UFwvoDBMjc8LiYc1DKXiAomK/recaptcha__en.js:291

Has anyone else experienced this issue and is there a fix or work-around?

Thanks,
Brian

16 Dec 2020, 3:54 PM
#490
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Support Thread for Google reCAPTCHA plugin

Is the plugin compatible with 1.5.7b?

IT IS COMPATIBLE WITH v1.5.7b, but not with 1.5.7a or 1.5.7-without-a-letter-suffix.

The base install files does not affect ZC and can be copy as is to ZC1.5.7b... The template files are NOT the same as ZC1.5.7b and should NOT be dragged and dropped! Instead, copy the recaptcha line over and placed just below the last input field in the form and above the closing form tag.

Keep in mind, that the code is only good for version 2 of recaptcha... you can try version 3... The Free versions, 2 & 3 are only good for up to 1 million Assessments / Month!

This has no affect on the existing CAPTCHA in ZC1.5.7 and is just another test.. The existing well still work even when reCAPTCHA passes testing...

Tested live with heavy modified ZC1.5.7b and php7.4x on my contact page and map request page which is Get-a-Quote addon. I'll leave it up if you like to look...

16 Dec 2020, 5:35 PM
#491
raindrop99 avatar

raindrop99

New Zenner

Join Date:
Dec 2020
Location:
UK
Posts:
6
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Has anyone managed to get the recaptcha working on the create account page with FEC installed?

I've just taken over a zencart site and I'm "feeling" my way around!

I had a problem with recaptcha on the contact page but I've fixed that :)

But on the create account page (weirdly called /log-in on the frontend) I can get the Recaptcha box to show up but either ticking the box or not just refreshes the page with no errors? (nothing in the log files or server logs)

After digging I see that the FEC mod has it's own template & module files for creating accounts etc...

So I have /includes/modules/fec_create_account.php as well as the normal zencart create_account.php file

Template wise I have includes/templates/<my-template>/templates/tpl_login_default.php which seems to control the layout of the login / register page and has FEC code in it?

Zencart Version: 1.5.4

16 Dec 2020, 6:50 PM
#492
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Support Thread for Google reCAPTCHA plugin

Probably some stupid quirk with FEC's use of CSS/JS Loader junk.

raindrop99:

Has anyone managed to get the recaptcha working on the create account page with FEC installed?
I realize the following comment is not helpful in immediately doing what the rest of your post talks about ... but it's worth mentioning:

The first thing I delete when I find it is FEC, and all the things it adds or depends on, especially "CSS/JS Loader" stuff. All of these cause nightmares for interoperability with other plugins, and for upgrades, and for troubleshooting things that "should" work but don't work when these things are present.

When you get around to upgrading the site to a newer version, look into OPC One Page Checkout as a better replacement.

17 Dec 2020, 3:29 PM
#493
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Support Thread for Google reCAPTCHA plugin

NOTE: if you're running the unsuffixed version of zc157 without having installed the known patches (https://www.zen-cart.com/showthread.php?226872-Known-bugs-%28and-fixes%29-for-v1-5-7-series%29 could be part of the problem.

That initial version had a bug that prevented multiple 'observers' from watching the same event, which might have play in the issue reported.

17 Dec 2020, 7:16 PM
#494
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Support Thread for Google reCAPTCHA plugin

lat9:

NOTE: if you're running the unsuffixed version of zc157 without having installed the known patches (https://www.zen-cart.com/showthread.php?226872-Known-bugs-%28and-fixes%29-for-v1-5-7-series%29 could be part of the problem.

That initial version had a bug that prevented multiple 'observers' from watching the same event, which might have play in the issue reported.
Yes, important point!

17 Dec 2020, 11:23 PM
#495
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Support Thread for Google reCAPTCHA plugin

lat9:

NOTE: if you're running the unsuffixed version of zc157 without having installed the known patches (https://www.zen-cart.com/showthread.php?226872-Known-bugs-%28and-fixes%29-for-v1-5-7-series%29 could be part of the problem.

That initial version had a bug that prevented multiple 'observers' from watching the same event, which might have play in the issue reported.

I was looking for that post when I did by tests... maybe that helped in my testing, but also found it was easy to add another page to the notifier group to add Get-a-Quote to reCAPTCHA.. Could be the answer for the FEC question..

Just to post this again, Both ZC1.5.7b and ReCAPTCHA performed as expected. When testing URL in the comment, reCAPTCHA passed it to ZC1.5.7b and ZC stopped it dead. Which is what I would expect for reCAPTCHA is only testing for a click and not what's in the message...

18 Dec 2020, 1:48 PM
#496
raindrop99 avatar

raindrop99

New Zenner

Join Date:
Dec 2020
Location:
UK
Posts:
6
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Thanks to the last few posts (cheers Dave) I've had a lighbulb moment and fixed recaptcha with FEC

Because FEC doesn't use the default zencart register page - it uses the login page as a split register / login page the observer wasn't looking for the recaptcha on that page

In includes/classes/observers/class.google_recaptcha.php

Add $pages_to_check[] = 'NOTIFY_LOG_IN_CAPTCHA_CHECK'; to the array of pages to check so it becomes:

	function __construct() {

		//comment out any pages you do NOT want to check
		$pages_to_check[] =  'NOTIFY_CONTACT_US_CAPTCHA_CHECK';
		$pages_to_check[] =  'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK';
		$pages_to_check[] =  'NOTIFY_REVIEWS_WRITE_CAPTCHA_CHECK';
		[B]$pages_to_check[] =  'NOTIFY_LOG_IN_CAPTCHA_CHECK';[/B]
		$this->attach($this,$pages_to_check);
	}

Then in the same file update the following

if (!$resp->isSuccess()) {
			$event_array = array('NOTIFY_CONTACT_US_CAPTCHA_CHECK' => 'contact', 'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK' => 'create_account', 'NOTIFY_REVIEWS_WRITE_CAPTCHA_CHECK' => 'review_text',[B] 'NOTIFY_LOG_IN_CAPTCHA_CHECK' => 'create_account'[/B]);
			$messageStack->add($event_array[$eventID], $resp->getErrors());
			$error = true;
		}

This now seems to be working fine - although there is no error is you don't tick the recaptcha? (must have missed something)

18 Dec 2020, 3:06 PM
#497
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Support Thread for Google reCAPTCHA plugin

raindrop99:

Because FEC doesn't use the default zencart register page - it uses the login page as a split register / login page the observer wasn't looking for the recaptcha on that page

Taking a quick look at FEC, to does have the NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK built in, it also seems to be doing it's own looking for a captcha.php class, so more then likely some other things going on here.

To get the message change 'create_account' to 'login'...

18 Dec 2020, 9:50 PM
#498
jwlamb avatar

jwlamb

Zen Follower

Join Date:
Jan 2014
Location:
Arizona
Posts:
110
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

lat9:

NOTE: if you're running the unsuffixed version of zc157 without having installed the known patches (https://www.zen-cart.com/showthread.php?226872-Known-bugs-%28and-fixes%29-for-v1-5-7-series%29 could be part of the problem.

That initial version had a bug that prevented multiple 'observers' from watching the same event, which might have play in the issue reported.

Now that 1.5.7b is out, mind you only a few weeks ago, that did solve the issue with the observers. Thank you for pointing out that 1.5.7 had this bug in it. For the last several months I've been banging my head trying to get this to work as I have been flooded with spam emails from the contact us page. I'm not one to jump right on to each update as I have a modified ZC that I winmerge all the files to check for changes before uploading blindly, which is why I didn't upgrade to 157b as soon as it came out. But now that 157b address the observers, the commenting out that I posted earlier is no longer needed. Thank you all for putting up with my rants as I was not the politest in my posts.

18 Dec 2020, 10:02 PM
#499
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Support Thread for Google reCAPTCHA plugin

Whether you jump on the new right away or not, it's a good idea to use the thread tools and subscribe to the thread at https://www.zen-cart.com/showthread.php?198357-Support-Thread-for-Google-reCAPTCHA-plugin&goto=newpost

Do the same for all the new versions and the forum will keep you up to date with changes.

21 Dec 2020, 12:10 PM
#500
raindrop99 avatar

raindrop99

New Zenner

Join Date:
Dec 2020
Location:
UK
Posts:
6
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

davewest:

Taking a quick look at FEC, to does have the NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK built in, it also seems to be doing it's own looking for a captcha.php class, so more then likely some other things going on here.

To get the message change 'create_account' to 'login'...

Thanks Dave,

I've changed the create_account to login and I still don't get an error message when recaptcha fails? Any ideas please?

This is what I changed

'NOTIFY_LOG_IN_CAPTCHA_CHECK' => 'login'

Zen Cart 1.5.4, FEC installed