Title: bug report
Last modified: August 21, 2016

---

# bug report

 *  [macspert](https://wordpress.org/support/users/macspert/)
 * (@macspert)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/bug-report-35/)
 * Hi,
    great plugin, thanks. I don’t know if this forum is the right place – but
   just in case…: There is a small bug in wpfp-page-template.php (v1.6.2)
 *     ```
       44c54
       <         echo $wpfp_options['favorites_empty'];
       ---
       >         echo htmlspecialchars_decode( stripslashes($wpfp_options['favorites_empty']));
       ```
   
 * If you’ve got apostrophes or similar characters in your ‘favorites_empty’ string,
   they will be rendered with a backslash if stripslashes is missing.
 * Plus an idea: since I don’t allow registration on my site and I use w3tc for 
   caching, I had to disable the bit of code which tests whether the post is already
   favorited (it might get cached stuck with a remove link).
    You might add a tick
   box in the options, asking whether the site uses caching – and if so only ever
   show the add to favorites link.
 * Regards,
 * [https://wordpress.org/plugins/wp-favorite-posts/](https://wordpress.org/plugins/wp-favorite-posts/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [macspert](https://wordpress.org/support/users/macspert/)
 * (@macspert)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/bug-report-35/#post-5024145)
 * 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): [http://www.lejournaldemaman.com](http://www.lejournaldemaman.com/)

Viewing 1 replies (of 1 total)

The topic ‘bug report’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-favorite-posts.svg)
 * [WP Favorite Posts](https://wordpress.org/plugins/wp-favorite-posts/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-favorite-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-favorite-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-favorite-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-favorite-posts/reviews/)

## Tags

 * [backslash](https://wordpress.org/support/topic-tag/backslash/)
 * [caching](https://wordpress.org/support/topic-tag/caching/)
 * [W3TC](https://wordpress.org/support/topic-tag/w3tc/)
 * [wpfp](https://wordpress.org/support/topic-tag/wpfp/)

 * 1 reply
 * 1 participant
 * Last reply from: [macspert](https://wordpress.org/support/users/macspert/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/bug-report-35/#post-5024145)
 * Status: not resolved