Repository navigation
Conversation
LameuleFR
force-pushed
the
perf/skip-guest-for-bots
branch
from
October 21, 2026 14:08
eb5e895 to
bcd2367
Compare
jf-viguier
approved these changes
Oct 22, 2026
Touxten
approved these changes
Oct 22, 2026
nicohery
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
displayBeforeBodyClosingTagfor bots (Connection::isBot(), the same check core uses to skipps_connections). Bots send no cookie, so each hit created aps_guestrow nobody references, incremented the page view counter, and with "Save page views for each customer" on wrote aps_connections_pagerow withid_connections = 0. Bots also no longer get the module's scripts (plugin detection, page time). Themethod_existsguard keeps the module working on PrestaShop versions withoutConnection::isBot()(before 8.0), where the behaviour is unchanged; the PHPStan 1.7.x configs ignore the call accordingly.curl -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" <shop>/), with default settings then with the three options enabled: no new row inps_guestorps_connections_page, and theps_page_viewedcounter is not incremented. With a browser user agent, first visit and revisit behave as before (rows inps_guest,ps_connections,ps_connections_source,ps_connections_pageif enabled). Related core PR: PrestaShop/PrestaShop#43285.Measured on PrestaShop develop (9.x), home page, 20 hits per bot (Googlebot, bingbot, AhrefsBot), no cookie, before → after:
ps_guest+20 → 0 (−100%)ps_guest+20,ps_connections_page+4, page view counter → 0 (−100%)ps_guestrows per day, linked to no connection, cart or customer (about 20 MB per day, 7 GB per year with indexes).Connection::isBot()list (bingbot and AhrefsBot are recognised since 9.2.0; before 8.0 nothing changes). Its false positives now also lose the guest row and the page view, in addition to the connection they already lost (e.g. Motorola in-app and WeChat browsers on 8.0 to 9.2, fixed in develop). Behaviour change to be aware of: with "Save global page views" on, bot hits are no longer counted, which matches core not recording bot connections.