follow-up:
I activated the statistics with the widget for the 5 most favorited – and was amazed how quickly some very old articles got favorited many times.
Looking at the access log, it turns out that these where mostly just bots, not real users ‘clicking’ the ‘add to favorites’ link.
So here goes one more suggestion for a small improvement:
42c42
< if (isset($_REQUEST['wpfpaction'])):
---
> if (isset($_REQUEST['wpfpaction']) && !(isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/bot|crawl|slurp|spider/i', $_SERVER['HTTP_USER_AGENT']))):
More on the caching situation I mentioned in the above post:
I’m now using a simple ajax call to change the fixed ‘add to favorites’ link for non-logged-in users to a ‘remove from favorites’ if the corresponding cookie is found after page load. This allows me to still cache all my articles with w3tc – only exception being the favorites page.
No pb to share the code – but a warning: it only works, it’s pretty badly hacked together… hardcoded text strings etc.
You can see the result here (blog in French): https://www.lejournaldemaman.com