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

Support Thread for Google reCAPTCHA plugin

Views: 177,479

Results 21 to 40 of 696
13 Sep 2012, 6:44 AM
#21
dochsa avatar

dochsa

New Zenner

Join Date:
Apr 2008
Location:
United Kingdom
Posts:
62
Plugin Contributions:
0

Support Thread for Google reCAPTCHA plugin

Hi David

Thanks it works fine now. I thing it had to do with latency of my ISP. One other thing. How do I get it to work on my SSL pages? Currently a warning flashes up, when you go to the contact us or create an account page that not all items are secure? Is there something I should have done with Google?

Thanks in advance.

Dono

13 Sep 2012, 8:25 AM
#22
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

dochsa:

Hi David

Thanks it works fine now. I thing it had to do with latency of my ISP. One other thing. How do I get it to work on my SSL pages? Currently a warning flashes up, when you go to the contact us or create an account page that not all items are secure? Is there something I should have done with Google?

Thanks in advance.

Dono

See the reply I gave earlier about SSL.

David Allen:

The solution is simple - in the Contact-us template file change the line (step 4 in instalation, step 6 for create account)

<?php echo recaptcha_get_html($publickey, $resp->error); ?>
> 
> to this
> 
> ```
<?php echo recaptcha_get_html($publickey, $resp->error, true); ?>

The extra 'true' tells it to use SSL and should solve the problem.

In the next version I'll get it to pick up the HTTPS automatically
Regards
David

18 Sep 2012, 9:14 AM
#23
geryjuhasz avatar

geryjuhasz

New Zenner

Join Date:
Jun 2012
Posts:
14
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Hi!
I`d like to include this mod to an EZ-page on which customers can send me their suggestions.I get spam messages so I MUST include some captcha script to this page.Any ideas how could this be done?

18 Sep 2012, 10:25 AM
#24
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

It shouldn't be too hard :) - you just need to add the line ```

<?php echo recaptcha_get_html($publickey, $resp->error); ?>

into the suggestion form - this shows the CAPTCHA to your customers. Then in the code which sends the email, add in the check for a correct response
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);

if (!$resp->is_valid) {
    // set the error code so that we can display it
    $messageStack->add('your-EZ-page', $resp->error);
    $error = true;
}
Hope this helps
Regards
David
18 Sep 2012, 10:40 AM
#25
geryjuhasz avatar

geryjuhasz

New Zenner

Join Date:
Jun 2012
Posts:
14
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

It showes error); ?> on the suggestions page and then shows the form, but no captcha is loaded

18 Sep 2012, 11:45 AM
#26
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

looks like your php tags are out of synch.
You will also need the recaptchalib.php file in the extra functions folder.

18 Sep 2012, 11:50 AM
#27
geryjuhasz avatar

geryjuhasz

New Zenner

Join Date:
Jun 2012
Posts:
14
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

it is there

19 Sep 2012, 4:33 AM
#28
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Support Thread for Google reCAPTCHA plugin

David,
For v1.5.1 and newer (since some captcha-related notifier hooks were added to v1.5.1), you can drop the changes your v1.1 plugin makes to the /includes/modules/ files and simply add the attached notifier support files to accomplish the same results.
Makes integration a lot simpler that way because there's fewer files to edit (esp since some of those files are often edited by other plugins), and simpler to update in the future too.

I might also suggest that using zen_get_ip_address() instead of $_SERVER['REMOTE_ADDR'] might provide more accurate results especially if the visitor is behind some sort of proxy or forwarder, or the store's hosting company is using some sort of proxying or caching engine that incorrectly passes the store's IP instead of the visitor's IP.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Sep 2012, 8:40 AM
#29
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

DrByte:

David,
For v1.5.1 and newer (since some captcha-related notifier hooks were added to v1.5.1), you can drop the changes your v1.1 plugin makes to the /includes/modules/ files and simply add the attached notifier support files to accomplish the same results.
Makes integration a lot simpler that way because there's fewer files to edit (esp since some of those files are often edited by other plugins), and simpler to update in the future too.

Thanks for that. I've just d/loaded today's new 1.51 and see the added notifier hooks. Brilliant. It will, as you say, make things a lot simpler.
In order not to have to maintain 2 versions (pre-1.51 and 1.51+) going forward, I'm thinking that I should make the pre-1.51 version also use the observer class. A quick question if I may. Am I correct in that all I would need (apart from the check on $error) to add to those header_php.php files would be the line ```
$zco_notifier->notify('NOTIFY_CONTACT_US_CAPTCHA_CHECK');


I like the sugestion of using zen_get_ip_address(). I'll add that to the observer class.

Many thanks 
David
19 Sep 2012, 8:19 PM
#30
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Support Thread for Google reCAPTCHA plugin

The only requirements you'd need to backport would be the changes that added the notifier points to those modules files.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Sep 2012, 10:23 PM
#31
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

Thanks DrByte - new version being tested, docs still to do :)
Regards
David

21 Sep 2012, 11:55 PM
#32
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

New version released.
v2.0 uses the new notifier hooks added in ZenCart v1.5.1 and a new observer class. So no core files to alter if you're using v1.5.1 or newer :)
I expanded it to include the write a review page as well as adding the auto detection of SSL pages. It now uses zen_get_ip_address() to better cope with proxies etc.

2 Oct 2012, 10:40 AM
#33
kruzzerr avatar

kruzzerr

New Zenner

Join Date:
Aug 2012
Posts:
4
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

We are currently having our Zencart version being updated from 1.3.9 to 1.5 ,we have the Captcha succesfully integrated to our older version 1.3.9 of Zencart however our developer having a difficulty to install this to the new 1.5 version because of the GD and Imagemagick are not installed ,also she said we are having a PHP depraceted code issue and our hosting Godaddy not support this
Can you please suggest the way forward how this can be solved?

2 Oct 2012, 10:57 AM
#34
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

kruzzerr:

We are currently having our Zencart version being updated from 1.3.9 to 1.5 ,we have the Captcha succesfully integrated to our older version 1.3.9 of Zencart however our developer having a difficulty to install this to the new 1.5 version because of the GD and Imagemagick are not installed ,also she said we are having a PHP depraceted code issue and our hosting Godaddy not support this
Can you please suggest the way forward how this can be solved?
Are you sure you are using my Google reCAPTCHA plugin? Because it doesn't use GD or Imagemagick.

17 Oct 2012, 1:35 AM
#35
zilog357 avatar

zilog357

New Zenner

Join Date:
Jun 2008
Posts:
20
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Hello David. This is very kind of you for sharing this contribution of yours. I have a simple question, I am using zencart v1.3.8a and would like to know if there is any possibility to put the reCaptcha in the admin login page. I think that would help in protecting against robotic brute-force attempts. I can not move to ZC 1.5 for now, as I have done many core edits.

Thank you in advance.

17 Oct 2012, 8:24 AM
#36
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

[QUOTE=zilog357;1157983]I am using zencart v1.3.8a and would like to know if there is any possibility to put the reCaptcha in the admin login page.
</QUOTE]
Zilog - it should be possible to include it on the admin login page. You'd have to include the files in the corresponding admin folders and add the appropriate entries to login.php.
I'm interested as to why you are getting brute force attempts? You did rename your admin directory didn't you??

zilog357:

I think that would help in protecting against robotic brute-force attempts. I can not move to ZC 1.5 for now, as I have done many core edits.
I think that as you are using such an old version the possibility of robotic brute-force attempts is much less than the gaping security holes that are known to exist in those older versions on Zen.
I'd recommend upgrading asap

31 Oct 2012, 1:11 AM
#37
repete avatar

repete

New Zenner

Join Date:
Oct 2012
Posts:
1
Plugin Contributions:
0

Re: Support Thread for Google reCAPTCHA plugin

Hi JC,

I am using the same templates as you and am having issues getting this to work as well.
Did you have any luck getting the recaptcha to work?

Peter

David Allen:

JC - can't see anything wrong with that - as you say it's the downloaded one. Very odd.
I've quickly tried a few other things that I thought could possibly cause it (and some that I was sure wouldn't), but have come up blank. I can't get it to send without the reCAPATCHA filled in.
I'm stumped, sorry. All I can suggest is putting some debugging statements in the file to try and find out why $error isn't being set to true when the reCAPATCHA isn't filled in.

31 Oct 2012, 10:43 AM
#38
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

RePete:

Hi JC,

I am using the same templates as you and am having issues getting this to work as well.
Did you have any luck getting the recaptcha to work?

Peter

Peter - what issues are you having? Perhaps a link to the problem would help me discover what is wrong.
Regards
David

31 Oct 2012, 3:45 PM
#39
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

In response to a post in another thread I thought I'd highlight some of the customisations that cane be made to the appearance of the Google reCAPTCHA.
Firstly there are 4 different styles supplied by Google:
White

Red (Default colour)

Black

Clean

To use these just include the following script on the page

        <script type="text/javascript">
            var RecaptchaOptions = {
                theme: 'white'
            };
        </script>

Additionally it is possible to style the individual elements through CSS. The following changes the font of the 'Type the two words' text

.recaptcha_only_if_image {
color:red !important;
font-size:1.4em !important;
}

There are many more customisations available see this Google page for more information, or just post here and I'll be happy to help.
Regards
David

31 Oct 2012, 3:56 PM
#40
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Support Thread for Google reCAPTCHA plugin

Oops - I forgot to paste in the image of the css customised version:
Edit second attempt - pasting the image didn't work. I'll upload it this time :)

Attachment 11380