• Resolved AWOL

    (@awol)


    Hi,
    I have been having problems with the cache on my site not working, and I have discovered that your plugin is one of two causing the issues. Having looked at the plugin files I have found this file – wp-popups-lite/src/includes/functions.php – and in it a section (pasted below);

    /**
     * Clear all Cache
     * @return mixed
     * @since  2.0
     */
    function wppopups_clear_caches() {
    
    	// WP Rocket
    	if ( function_exists( 'rocket_clean_domain' ) ) {
    		rocket_clean_domain();
    	}
    	// W3 Total Cache : w3tc
    	if ( function_exists( 'w3tc_pgcache_flush' ) ) {
    		w3tc_pgcache_flush();
    	}
    	// WP Super Cache : wp-super-cache
    	if ( function_exists( 'wp_cache_clear_cache' ) ) {
    		wp_cache_clear_cache();
    	}
    	// WP Fastest Cache
    	if ( function_exists( 'wpfc_clear_all_cache' ) ) {
    		wpfc_clear_all_cache( true );
    	}
    	// WPEngine
    	if ( class_exists( 'WpeCommon' ) && method_exists( 'WpeCommon', 'purge_memcached' ) ) {
    		WpeCommon::purge_memcached();
    		WpeCommon::purge_varnish_cache();
    	}
    	// SG Optimizer by Siteground
    	if ( function_exists( 'sg_cachepress_purge_cache' ) ) {
    		sg_cachepress_purge_cache();
    	}
    	// LiteSpeed
    	if ( class_exists( 'LiteSpeed_Cache_API' ) && method_exists( 'LiteSpeed_Cache_API', 'purge_all' ) ) {
    		LiteSpeed_Cache_API::purge_all();
    	}
    	// Cache Enabler
    	if ( class_exists( 'Cache_Enabler' ) && method_exists( 'Cache_Enabler', 'clear_total_cache' ) ) {
    		Cache_Enabler::clear_total_cache();
    	}
    	// Pagely
    	if ( class_exists( 'PagelyCachePurge' ) && method_exists( 'PagelyCachePurge', 'purgeAll' ) ) {
    		PagelyCachePurge::purgeAll();
    	}
    	// Autoptimize
    	if ( class_exists( 'autoptimizeCache' ) && method_exists( 'autoptimizeCache', 'clearall' ) ) {
    		autoptimizeCache::clearall();
    	}
    	//comet cache (formerly zencache)
    	if ( class_exists( 'comet_cache' ) && method_exists( 'comet_cache', 'clear' ) ) {
    		comet_cache::clear();
    	}
    	// Hummingbird Cache
    	if ( class_exists( '\Hummingbird\WP_Hummingbird' ) &&
    	     method_exists( '\Hummingbird\WP_Hummingbird', 'flush_cache' )
    	) {
    		WP_Hummingbird::flush_cache();
    	}
    
    	return true;
    }
    

    Can you tell me why this is necessary? I use your plugin extensively to present forms to users, and having the cache purged constantly is causing both the site to be slow and resource usage spikes on the server. If it is necessary I am going to have to find an alternative way of presenting forms to users, otherwise can I delete this section, or is there some code I can put in my theme functions to prevent it running? I don’t understand why it is needed, and if it isn’t why there is no option to turn this off. Please help me understand.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter AWOL

    (@awol)

    As a further update to this, while my query above regarding the code still stands, I have discovered that there is an option on the forms of the plugin I use to prevent caching on the pages where they are located, which I have now turned off on every form. This hasn’t fixed the issues I am having but hopefully it gets me closer. An explanation of your plugin’s behaviour would be very helpful as well.

    Thread Starter AWOL

    (@awol)

    This now seems to have been resolved, so closing this, but I would still like to know about the ‘Clear All Cache’ bit, in case the problem reappears. I think the setting in the forms was the problem though.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with cache’ is closed to new replies.