Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Google reCAPTCHA v3


ruden

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?

Link to comment
Share on other sites

  • 3 weeks later...
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

 

Link to comment
Share on other sites

  • 3 months later...

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

 

Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

  • 8 months later...
  • 2 months later...
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.

Link to comment
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.

Link to comment
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.

Link to comment
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 :)

Link to comment
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.

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...
  • 3 months later...

@leopard333I just tried dowloading from there and it worked for me. But instead of recaptcha I recommend Honey Pot since it is does more than recaptcha.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

12 hours ago, Jack_mcs said:

@leopard333I just tried dowloading from there and it worked for me. But instead of recaptcha I recommend Honey Pot since it is does more than recaptcha.

https://old.oscommerce.com/M93NH&google-recaptcha-v3

 

click on Download, than ask for sign redirect to:  https://www.oscommerce.com/forums/login/

I login and come on: https://www.oscommerce.com/forums/?&_fromLogin=1

And not on OLD site.

When i go manuele back to https://old.oscommerce.com/M93NH&google-recaptcha-v3

than ask again for login..... again on   https://www.oscommerce.com/forums/login/

Ist circle...

 

Honey Pot i not like.

Link to comment
Share on other sites

9 hours ago, leopard333 said:

Honey Pot i not like.

Honey Pot is easier to install and does a better job at stopping hackers and spammers than Recaptcha so, if you don't mind saying, I would like to know what you don't like about it so that I can improve it, if necessary.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 5 months later...

I am new to osCommerce 4.12

This seems massively over powered. What is wrong with the 100 year old "kaptcha" code rather than this seize of power by Google ?
Cat it just be truned off anywhere easy ???

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...