Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2020-01-15 23:30:02

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Contact form recaptcha v2 not working in FireFox...

I've finally gotten round to adding recaptcha v2 support to my contact form for redvixen-studios.com because someone has unleashed a spambot against it.

I fired up FireFox (my preferred browser) and updated all of the Backlight 2 modules (thank you so much for making that about as painless as it can possibly be!) to the latest and greatest versions, went to Google to get the v2 site keys (public and private), added them to the contact form in Admin and turned recaptcha debugging on.

I went to the contact page and saw the "I am not a robot" recaptcha filled out a test EMAIL submission, clicked the recaptcha checkbox and was passed with the green check mark.  My first thought was "wow...Matt and Ben made this so freakin' easy that I really feel like a complete and utter doofus for not doing this earlier!"

I then clicked [Send] and no EMAIL was received with no error messages on screen or in the logs.

I cleared the cache and tried again...same thing...passed by recaptcha but no joy in the inbox.

I then thought that maybe the debug setting was just testing the communication with Google without actually sending the EMAIL (I'll admit...beta-testing was my first real job and I'm such a nerd to think of things that way!) so I turned it off and tried another submission...was passed through recaptcha but no EMAIL in the inbox afterward.

I popped back into the Backlight 2 admin and chose the "send test EMAIL" option and that EMAIL landed in the inbox so I was at least sure the underlying mail handling was working (as the spammers had also proved).

Finally, I fired up Chrome to see if it's potentially a browser problem (that would be a *HUGE SHOCK*, I know!)...filled out the fields, passed by recaptcha after checking the box...clicked [Send] and the EMAIL showed up almost immediately in the inbox.

I also tested it on Safari on my iPhone...got the images challenge from recaptcha (yay...nice to see that!), was passed through and also received the EMAIL almost instantly in the inbox.

I checked Backlight 2 Admin to see if the EMAILs at least made it to the contacts screen which shows all of the EMAIL requests that came through but none of the ones sent when using FireFox appear in the list.  The ones sent through Chrome and Safari do appear there which makes me think that FireFox is somehow failing to save the EMAIL in the database preventing it from being sent by the mailer.  I didn't see any error messages in the logs to that effect to aid in debugging, unfortunately.... sad

The site is hosted on an inMotion VPS using the stable version of php v 7.3.

Offline

#2 2020-01-16 01:20:31

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Contact form recaptcha v2 not working in FireFox...

I'm unable to duplicate the problem. I'm getting emails from the form using Firefox for pc and mobile.

Is Firefox up to date on your computer?

I noticed that on my iPhone, I get the picture match thingy. I don't get that on the pc browser though.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2020-01-16 03:11:57

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Contact form recaptcha v2 not working in FireFox...

Currently running version FireFox 72.0.1 (64-bit) on Windows 10 which Mozilla is reporting is the latest version.

I also temporarily disabled the enhanced tracking protection feature for the site thinking that might make a difference (I'm normally running FireFox in STRICT mode which usually doesn't tend to affect the Backlight sites but it was worth testing!).  Before I turned it off, FireFox was reporting that it didn't detect any trackers on the site which is a bit of good news.  smile

Unfortunately, still seeing the same behaviour where reCaptcha seems to pass and the submit reports success but the EMAIL isn't stored or sent.  That behaviour occurred both before and after clearing cache.

I fired up the FireFox debugger and loaded the page and hit an "Unknown base64 exception" in recaptcha__en.js at line 61 (unfortunately, it's minimised code which makes debugging much more painful).  That's probably what's breaking FireFox...

I've dropped a couple of screenshots onto Google Drive:

https://drive.google.com/drive/folders/ … sp=sharing

Offline

#4 2020-01-16 04:21:36

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Contact form recaptcha v2 not working in FireFox...

Post a link to your site and I’ll try sending a test message


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#5 2020-01-16 04:33:04

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Contact form recaptcha v2 not working in FireFox...

rod barbee wrote:

Post a link to your site and I’ll try sending a test message

https://www.redvixen-studios.com/

The contact form is under the “burger” menu.

I’m in the process of updating my laptop to the latest feature release of Windows 10 (taking forever!).  A web post on recaptcha suggested that Windows 10 and FireFox may be exploiting an OS bug...I’m looking to prove or disprove that.  My version of Windows 10 was fairly old (1809) because my OS drive was critically low on space until a month ago.

Offline

#6 2020-01-16 05:11:39

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Contact form recaptcha v2 not working in FireFox...

test message sent


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#7 2020-01-16 06:35:20

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Contact form recaptcha v2 not working in FireFox...

That is strange. The contact page will report success if the honey pot field is submitted. I’m not in front of a PC to see what the name of the field is.  ‘address’ perhaps. It is a field on the page that is hidden by CSS. Some bots may not be able to detect that it’s meant to be hidden and attempt to provide a value.
Can you inspect the contact submission from Firefox to see whether an extra field is being sent by Firefox?

Also, if you disable reCAPTCHA on the form, do submissions from Firefox get through?

Offline

#8 2020-01-16 06:38:12

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Contact form recaptcha v2 not working in FireFox...

rod barbee wrote:

test message sent

Nothing has arrived in the inbox...also now completely updated to latest version of Windows 10 and it's still persisting with failing on that one script with the unknown base64 encoding error.  I suspect the problem is on Google's side serving up that recaptcha code.

I appreciate your help with this...fortunately, it's more annoying than anything else as there is a workaround.  As long as it stops the spammers cold, I'll be thrilled!  smile

Offline

#9 2020-01-16 06:52:56

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Contact form recaptcha v2 not working in FireFox...

Hi Ben,

the name of the honey pot field is "address" in the  label-for=  input id= and name=  attributes


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#10 2020-01-16 07:03:16

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Contact form recaptcha v2 not working in FireFox...

Thanks, Rod.  Sunfox, please see my reply above.

Offline

#11 2020-01-16 07:12:41

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Contact form recaptcha v2 not working in FireFox...

Ben wrote:

That is strange. The contact page will report success if the honey pot field is submitted. I’m not in front of a PC to see what the name of the field is.  ‘address’ perhaps. It is a field on the page that is hidden by CSS. Some bots may not be able to detect that it’s meant to be hidden and attempt to provide a value.
Can you inspect the contact submission from Firefox to see whether an extra field is being sent by Firefox?

Also, if you disable reCAPTCHA on the form, do submissions from Firefox get through?

Disabled recaptcha on that form and FireFox is still appearing to successfully submit the form but no EMAIL is stored in the database (looking in Backlight admin or my inbox).  Doesn't throw the exception either but if recaptcha source code isn't included, that's not surprising given where the debugger said the error was.

That's rather weird.

I did check the form under debugger and it looks like everything that should be there is...the address field shows up in the HTML but it's hidden by CSS.  Looking at the form, it does appear to have a non-NULL value (probably populated by the saved form info feature in FireFox).  What was really interesting is that if you look at the form in the debugger, the hidden attribute on the field is set to false even though the CSS does hide it...wasn't expecting that mismatch between the CSS and the inspected DOM value.

I turned off the auto-complete functionality but it appears that FireFox is still caching the value and is populating the hidden field even if I don't explicitly choose to auto-complete the form.

Offline

#12 2020-01-16 07:17:57

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Contact form recaptcha v2 not working in FireFox...

Ben wrote:

Thanks, Rod.  Sunfox, please see my reply above.

I put a couple more screenshots into the Google Drive folder I sent above showing the hidden CSS/DOM mismatch.  Didn't really see any fields that shouldn't be there.  I'm going to see if I can find some PHP logs to see if they're helpful in figuring out why the form submission is failing.

Might be a bit as I have to drop off two of the three kids that I'm not keeping tonight... wink

In the meantime, I'm going to re-enable recaptcha on that form so the spammers are hopefully blocked.

Offline

#13 2020-01-16 07:43:55

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Contact form recaptcha v2 not working in FireFox...

That would be it then.  I'm more interested in the network traffic, and which fields and values are sent to the server when clicking Send.  That submission and the values sent should be available under the Network tab of the inspector.  Look for a sub-panel called Params.  You may need to check 'Persist Logs' so that the request info doesn't get removed on the page redirect to the success page.

On my site (and in my own Firefox 72 that doesn't seem to autofill anything for me), I see entries with values for 'name' and 'email', and an entry for 'address' with no value sent.

If this does prove to be the issue, then I can look at adding the autocomplete="off" attribute for either just the address honey pot, or for all fields.

Hopefully a quiet evening then? smile

Offline

#14 2020-01-16 08:38:54

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Contact form recaptcha v2 not working in FireFox...

Ben wrote:

That would be it then.  I'm more interested in the network traffic, and which fields and values are sent to the server when clicking Send.  That submission and the values sent should be available under the Network tab of the inspector.  Look for a sub-panel called Params.  You may need to check 'Persist Logs' so that the request info doesn't get removed on the page redirect to the success page.

On my site (and in my own Firefox 72 that doesn't seem to autofill anything for me), I see entries with values for 'name' and 'email', and an entry for 'address' with no value sent.

If this does prove to be the issue, then I can look at adding the autocomplete="off" attribute for either just the address honey pot, or for all fields.

Hopefully a quiet evening then? smile

One can dare to dream... wink

Two more screenshots and the log file containing the HTTP requests are now out in Google Drive for your perusal.  I did submits with and without the recaptcha enabled to see if there was any appreciable difference (and autocomplete was turned off).

Hopefully this exercise has at least proven to be interesting, if not useful!  Write once, debug everywhere with browsers is one reason I'm finding I enjoy photography and videography more and more every day.  At least if the camera settings are bolloxed, it's usually pretty to sort out who put the foot wrong!

If there's anything else I can do or test, please don't hesitate to ask (meanwhile, I'm going to put everything back the way it was with recaptcha enabled).  And of course, thanks to you and Rod for proving once again that awesome technical support still does exist in this world... smile

Offline

#15 2020-01-16 08:59:08

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Contact form recaptcha v2 not working in FireFox...

I've found a way to consistently make the form work now with FireFox...as long as you don't autofill the form, it works perfectly.

I also deleted the stored data for "address" and then did an autofill using that entry and that also worked correctly.

So I guess that "address" is the key field here that's breaking the form under FireFox which is where I think Ben was heading.

Weird.  But certainly a fun investigation!  smile

Offline

#16 2020-01-16 09:55:17

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Contact form recaptcha v2 not working in FireFox...

That's a shame -- the 'address' field doesn't look like it's the culprit.  I'm out of ideas.  Can you provide me with FTP access and a Backlight admin login so I can try to debug this?

Offline

#17 2020-01-16 10:34:23

SunFoxNC
Member
Registered: 2015-09-04
Posts: 80

Re: Contact form recaptcha v2 not working in FireFox...

Ben wrote:

That's a shame -- the 'address' field doesn't look like it's the culprit.  I'm out of ideas.  Can you provide me with FTP access and a Backlight admin login so I can try to debug this?

Sent via EMAIL.  Thanks and have a good afternoon/evening!  smile

Offline

Board footer

Powered by FluxBB