Code Monkey home page Code Monkey logo

cache-purge-helper's People

Contributors

jeffcleverley avatar jordantrizz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cache-purge-helper's Issues

Clear object cache as well?

If I enable Redis Caching it creates a problem whenever there is a minor core update.
These happen automatically, which is probably for the best because security patches need to be applied quickly.

However, on my multisite network I have had some issues where plugins like Beaver Builder temporarily malfunctioned until the network Page Cache was cleared after a core update. So thank you for creating this plugin to remedy that!

HOWEVER, I also have a problem with some plugins (Convert Pro) which temporarily malfunction until the Object Cache is cleared. So I would REALLY appreciate it if you can find a way to incorporate "clear object cache" into this Cache Purge Helper plugin.

I'm not sure if there needs to be some way of "opting out" of the object cache purge.
I always clear both caches at the same time but other people might have different needs.

Your time and skill much appreciated.

Incorporate Stock Clearing of Cache

See https://gist.github.com/mrcave/7cdf6707273252de04094d4ed8d0d43c

//clear entire cache when stock is reduced or replenished

function clear_cache_when_stock_changes( $order ) {
	if(class_exists('PhpRedis_Purger') || class_exists('Predis_Purger')){
		global $nginx_purger;
		$nginx_purger->purge_all();	
	}
}
         
add_action( 'woocommerce_reduce_order_stock', 'clear_cache_when_stock_changes', 10, 1 );
add_action( 'woocommerce_restore_order_stock', 'clear_cache_when_stock_changes', 10, 1 );
//only clear product page caches when stock changes

function clear_product_page_caches_when_stock_changes( $order ) {

	if(class_exists('PhpRedis_Purger') || class_exists('Predis_Purger')){
		if($order){
			global $nginx_purger;

			foreach ( $order->get_items() as $item_id => $item ) {
				$product_id = $item->get_product_id();
				$nginx_purger->purge_post( $product_id );
			}
		}
	}
}

add_action( 'woocommerce_reduce_order_stock', 'clear_product_page_caches_when_stock_changes', 10, 1 );
add_action( 'woocommerce_restore_order_stock', 'clear_product_page_caches_when_stock_changes', 10, 1 );

Cannot update Elementor if CPH is in use

Hey Guys,

When we try to update Elementor using ManageWP, we see this error:

Elementor 3.5.3 > 3.5.4

Elementor 3.5.3 -> 3.5.4: Call to a member function purge_all() on null occured in wp-content/plugins/cache-purge-helper/cache-purge-helper.php on line 44.

Thanks in advance,

Jordy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.