Title: Cache Deletion and Code Fix
Last modified: July 11, 2017

---

# Cache Deletion and Code Fix

 *  Resolved [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/cache-deletion-and-code-fix/)
 * Thank you for adding automatic cache purge with plugin upgrades in version 1.9.12.
   This is a much-needed and appreciated feature.
 * However, I have unfortunately discovered that your code is incomplete for the
   wp_fastest_cache plugin, because that software stores cached html files separately
   from minified css & javascript separately. The main cache is in an “all” subfolder,
   whereas the minified script is in a “wpfc-minified” folder. Right now, when wp-
   spamshield is upgraded, the “all” folder is cleared, but not “wpfc-minified”,
   resulting in error messages when users later try to post comments from cached
   pages.
 * Fortunately, there is an easy fix for this. All you have to do is change the 
   function for wp_fastest_cache from “deleteCache()” to “deleteCache(true)”
 * **Here is the code issue in detail: **
 * 1) Relevant, currently existing code in wp_spamshield.php
 *     ```
       /* WP Fastest Cache */
       			if( ( WPSS_Compatibility::is_plugin_active( 'wp-fastest-cache/wpFastestCache.php' ) || WPSS_Compatibility::is_plugin_active( 'wp-fastest-cache-premium/wpFastestCachePremium.php' ) ) && !empty( $wp_fastest_cache ) && method_exists( $wp_fastest_cache, 'deleteCache' ) ) {
       				$wp_fastest_cache->deleteCache();
       			}
       ```
   
 * 2) Function hook to fully clear WP Fastest Cache:
 *     ```
       if(isset($GLOBALS['wp_fastest_cache']) && method_exists($GLOBALS['wp_fastest_cache'], 'deleteCache')){
              $GLOBALS['wp_fastest_cache']->deleteCache(true);
       }
       ```
   
 * See [http://www.wpfastestcache.com/tutorial/delete-the-cache-by-calling-the-function/](http://www.wpfastestcache.com/tutorial/delete-the-cache-by-calling-the-function/)
 * > “You can delete the cache and minified css&js sources. You need to add “true”
   > argument into deleteCache(true)”
 * (Note: this is not a support request, as I already know the answer to my question,
   which was kindly provided to me by the cache developer. I have tested this by
   modifying the plugin file on one of my sites, and it works. The relevant code
   change is at line 9188)
    -  This topic was modified 8 years, 11 months ago by [Abigailm](https://wordpress.org/support/users/abigailm/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [rsm-support](https://wordpress.org/support/users/rsm-support/)
 * (@rsm-support)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/cache-deletion-and-code-fix/#post-9310578)
 * Hi Abigail,
 * Since our last update we became aware of this, and included a similar modification
   in today’s plugin update, version 1.9.16.
 * – Steven
 *  Thread Starter [Abigailm](https://wordpress.org/support/users/abigailm/)
 * (@abigailm)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/cache-deletion-and-code-fix/#post-9310690)
 * Thank you!
 *  Plugin Contributor [rsm-support](https://wordpress.org/support/users/rsm-support/)
 * (@rsm-support)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/cache-deletion-and-code-fix/#post-9313319)
 * You’re welcome! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cache Deletion and Code Fix’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-spamshield_08293a.svg)
 * [WP-SpamShield](https://wordpress.org/plugins/wp-spamshield/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-spamshield/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-spamshield/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-spamshield/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-spamshield/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-spamshield/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [rsm-support](https://wordpress.org/support/users/rsm-support/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/cache-deletion-and-code-fix/#post-9313319)
 * Status: resolved