Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ruden

Google reCAPTCHA v3

Recommended Posts

By logging the $response from Google, I have discovered that the majority of time I receive “timeout-or-duplicate” error. I’ve learned that the token is only valid for 2 minutes after you execute is called as stated in the docs:

“Note: reCAPTCHA tokens expire after two minutes. If you're protecting an action with reCAPTCHA, make sure to call execute when the user takes the action.”

Thus, if you spend more then 2 minutes on the contact-form, you get the timeout error. That's why its recommended in the docs to only call execute if the user actually submits your form / takes action.

Source: https://stackoverflow.com/a/60076476/2157236

Any solution to this?

Share this post


Link to post
Share on other sites
On 10/31/2020 at 1:40 PM, ruden said:

hi

i installed this  hook system and the google capture was working for a while

now suddenly its giving me error in error log and makes my order screen go blank

 

this line here

$OSCOM_Hooks->register(basename($PHP_SELF, '.php'));

 

is making the error below it seems, as when i take it out, my admin order page comes back.

PHP Fatal error:  Cannot declare class hook_admin_orders_paypal, because the name is already in use in /home/website/public_html/includes/hooks/admin/orders/paypal.php on line 13

 

Share this post


Link to post
Share on other sites

Tried this on the new phoenix 1.0.8.0.

Got this error message after trying to use the contact us page.

 

Deprecated: The tep_session_unregister function has been deprecated. in includes/functions/sessions.php on line 113

Warning: Cannot modify header information - headers already sent by (output started at includes/functions/sessions.php:113) in includes/functions/general.php on line 36

 

Share this post


Link to post
Share on other sites
On 1/3/2020 at 11:36 PM, ruden said:

Google reCAPTCHA v3

For all version osCommerce stops bots from spamming account creation and contact us.

Install
---------

Unzip the archive and upload the files on server.
In the admin side menu Modules -> Boxes -> button Install Module -> select modules Google reCAPTCHA v3 -> button Install Module

Setting
----------

Go to reCAPTCHA v3 page https://www.google.com/recaptcha/intro/v3.html and register your store.
Add Site key and Secret key to module settings.

Thank you, Ruden. Only come across this thread now. It's a much needed addon for any osCommerce shop.

Share this post


Link to post
Share on other sites
Hello.
recaptcha give 2 minutes time to complete the form.
After 2 minutes the form becomes invalid and redirects you to the index, without the account being made or the contact form being sent.
Did anyone manage to solve the problem? Thanks

Share this post


Link to post
Share on other sites
On 3/29/2021 at 12:09 PM, matei68 said:

Hello.
recaptcha give 2 minutes time to complete the form.
After 2 minutes the form becomes invalid and redirects you to the index, without the account being made or the contact form being sent.
Did anyone manage to solve the problem? Thanks

This 2 minute window is a problem, its too short. 3 mins ought to be sufficient, but if the account is not created there should be a message stack informing the user.

Share this post


Link to post
Share on other sites
On 2/9/2022 at 1:55 AM, Hotclutch said:

This 2 minute window is a problem, its too short. 3 mins ought to be sufficient, but if the account is not created there should be a message stack informing the user.

The 2 minute window is the only reason I haven't implemented this.

I think there is a way to do it only when the user clicks "submit" for example, but I haven't looked into how that would change this add on.  Is anyone using this currently? How are you getting around the 2 minute issue?

I think a lot of people take longer than 2 minutes for the contact us or for the create account forms.

Share this post


Link to post
Share on other sites

tolens.png.0fa8fd536f24daad5f08cc8f115722c5.png

https://developers.google.com/recaptcha/docs/v3

https://stackoverflow.com/questions/54437745/recaptcha-v3-how-to-deal-with-expired-token-after-idle

I have supertracker installed, so observe customers sometime struggle with this. The token expires and when they click submit it just redirects to index, confusing the user. The contact form does not seem to be a problem, at least for my site. I put an informational alert on the registration page informing users of this 2 minute interval they have to complete the form.

Share this post


Link to post
Share on other sites

@Hotclutch nice information there.  I think it would be good to modify this addon to tie the captcha to the form submission (rather than on pageload).  That will get rid of the 2 minute problem entirely.

It probably isn't a good thing to display that informational alert... most customers probably have no idea what a captcha even is :)

Share this post


Link to post
Share on other sites
4 hours ago, phi148 said:

@Hotclutch nice information there.  I think it would be good to modify this addon to tie the captcha to the form submission (rather than on pageload).  That will get rid of the 2 minute problem entirely.

It probably isn't a good thing to display that informational alert... most customers probably have no idea what a captcha even is :)

I find the alert helps, otherwise the customer does not have a clue whats going on. The best option is for the code to be modified, but that's beyond me for the moment. I don't want to be making changes there at the risk of losing the effectiveness of the Captcha.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×