managingwp / cache-purge-helper Goto Github PK
View Code? Open in Web Editor NEWAdditional instances where nginx-helper and lscache plugin should be purged.
License: GNU General Public License v3.0
Additional instances where nginx-helper and lscache plugin should be purged.
License: GNU General Public License v3.0
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.
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 );
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.