While running FarCry 7.0.6, I’ve received several error emails caused by a googlebot visit but having “(not a bot)” in the subject. In fact the only error email received with “(bot)” in the subject was when the user agent was empty. Is there a configuration option I need to set or is this a bona fide bug?
Cheers!
P.S. Sorry for the inactivity recently. Been very busy
I’m not sure why bot detection would be failing but I can point you in the right direction if you want to debug it.
The bot detection will be checked on each request, here:
If “googlebot” is present in the user agent string then it should be detected as a bot, as it’s in the default list of bot user agents (just above on line 44).
It’s possible to turn off bot detection by placing this.botDetection = false in your farcryConstructor.cfm, but I’m assuming that’s not the case in your app.
It seems that the user agent match is case sensitive, although the user agent string is passed to lcase() when reFindAny() is called so that shouldn’t be it:
Oh and specifically related to the data present in an error, this is where the bot detection is checked and turned into the string “bot” or “not a bot” (also worth noting, we shouldn’t be using IIF() and DE() in core):
Thanks for the pointers. I’ll do some digging, see if I can find anything and share anything worth sharing.
I couldn’t find this.botDetection in the farcryConstructor.cfm, but I did find <cfparam name="this.botAgents" default="*:+bingbot" /> in Application.cfm. If I understand __plusMinusStateMachine correctly, this should add bingbot to the default list.
Here’s the googlebot user agent in question: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Initial investigation indicates that the bot agents array is empty for some reason …
Yes I also read "*:+bingbot" as adding bingbot to the array. Interesting to note that bingbot is missing from core though, we should definitely add it
Is that an Application.cfm in your project folder? I’d be surprised if that was still having any effect, FarCry Core has used Application.cfc for quite a few major versions now. If it’s specified in your projects Application.cfc then perhaps that is the problem, the line of code might need to be moved into the farcryConstructor.cfm instead?