JayBizzle / Laravel-Crawler-Detect

A Laravel wrapper for CrawlerDetect - the web crawler detection library
MIT License
311 stars 30 forks source link

Can this library return false positives? #9

Closed GTCrais closed 7 years ago

GTCrais commented 7 years ago

So this isn't an issue, but rather a question - is there any possibility at all this library can return a false positive, i.e. return true even if the 'user' isn't a crawler?

JayBizzle commented 7 years ago

Yes, for sure it can. The user agent can easily be spoofed or not provided at all. There is no real way to guarantee 100% a visit is from a crawler or not, but we have a lot of test data to ensure we can be as accurate as we can be.

Do you have any specific concerns?

GTCrais commented 7 years ago

Yes, I do. I'm implementing a Cart solution on a website. In the database a Cart entry will be automatically generated for each visitor as soon as they visit the page, and I don't want to do that for crawlers. However I want to make absolutely sure that each 'real' user has a Cart generated for him/her. What I'm trying to say is that I need to be sure the Crawler::isCrawler() always returns false for real users. If it sometimes also returns false for some crawlers that's not a problem, but real users must always have ability to add things to their generated Cart.

I hope I made sense with that :)

JayBizzle commented 7 years ago

Ah, well in that scenario, you should be okay. You may end up with some carts generated by bots, but all real users should have a cart created for them without issue.

A user could fake their agent to look like a crawler, but then, they are unlikely to be a genuine shopper.

Hope that helps 👍🏻

GTCrais commented 7 years ago

Ah, that's great, thanks for the very quick replies!