ibro87
Forum Replies Created
-
Hi vupdraft,
Thanks for your effort and willingness to help. Unfortunately, this filter does not work either. Is there anything else we can try to make this work?Hi vupdraft?,
Sounds good. Thank you!Hey there vaakash,
Sorry I have taken so long to reply. WP-Optimize support helped me create custom function which automatically clears the cache after WooCommerce order is made. This makes it possible to show dynamic content in your plugin so no further assistance is needed from your side. Thanks again for your willingness to help! ??Hi vupdraft,
Thank you for your explanation. I totally get that every filter has its own functionality. So, I’ve added them all as suggested (see here please) but none of these filters seem to prevent automatic purging on the website.
For example, when new WooCommerce product is added or updated on the website, entire purge automatically occurs for all the content on the website right after clicking on “Publish” / “Update” button.
Am I missing something here?Hello @daniyalraza01,
Thanks for the quick reply. There is an example how to send emails when user gains / loses points, which is great. However, this is not what I need. Could you please help me create the code that would purge the cache instead when user gains / losses the points?
FYI, here’s what I am using when WooCommerce order is made and this works so I’d like to achieve the same when MyCred points are gained or lost. Thanks again for your help!
add_action(‘woocommerce_payment_complete’, ‘wpo_flush_wc_purchase’, 10, 1);
function wpo_flush_wc_purchase ( $order_id ) {
$order = new WC_Order( $order_id );
$items = $order->get_items();
foreach ( $items as $item ) {
wpo_cache_flush ( $item[‘product_id’] );
}
}Hi,
I tried adding one by one filter. Should I add them all at once?Hi,
I do NOT want anything to be purged automatically. I have thousands of products on the website. Updating one single product purge them all including all other content on the website which makes caching pointless. Is there a fix for this?
FYI, no minification is enabled in the plugin settings.Ok. So I’ve tried them all, but none of them worked. Every time the post / page or WooCommerce product is updated, the entire cache is purged which is unacceptable.
FYI, adding this filter add_filter(‘cache_config_updated’); caused critical error on the site.
Is there anything else we can do here to make caching functionality usable in this plugin?- This reply was modified 1 year, 1 month ago by ibro87.
Hi,
Thanks for sharing this filter. Unfortunately, this filter does not seem to work. When one WooCommerce product is updated the entire site cache is purged which does not make any sense.
Is there anything else we can try to stop automatic purging of entire cache?UPDATE: Thanks to the hooks provided, I managed to figure out this myself. For anyone who might need to clear the cache automatically after WooCommerce order is made, the code below will do it.
add_action(‘woocommerce_payment_complete’, ‘wpo_flush_wc_purchase’, 10, 1);
function wpo_flush_wc_purchase ( $order_id ) {
$order = new WC_Order( $order_id );
$items = $order->get_items();
foreach ( $items as $item ) {
wpo_cache_flush ( $item[‘product_id’] );
}
}Hi vupdraft,
Thanks again for the modified code and trying to complement the missing feature. Unfortunately, this code caused another critical error on the website and can’t be used. I do not really understand why it is so difficult to get this function to work with WP-Optimize plugin.
I guess there is nothing else we can do here so I will temporarily switch to “WP Fastest Cache” plugin until this functionality becomes available in WP-Optimize settings.
I will also make sure to mention your willingness to help in the review section. This thread can be closed now.Ok, that sounds good.
In the meantime, would you be able to provide me custom (working) code that would allow me to use missing functionality ? Perhaps, this can help?Forum: Plugins
In reply to: [WP Fastest Cache] User Specific CacheOk. Do you think you can implement this feature in the Pro version any time soon? Please let me know. Thank you.
Hey vupdraft,
Thank you so much for sending the modified code. Although there is no critical error this time, this code makes WooCommerce products not-purchasable so I can’t use it. ??
Could you please add this option in the plugin settings instead or provide me with the complete (working) code that I can just copy and paste in my function.php file or MU plugin?
I know some other plugins like WP Fastest Cache purge cache automatically when WooCommerce order status is changed, but I’d like to keep using WP-Optimize because of user specific cache feature which they do not have so thank you for your understanding and continual support!Hi there,
Great, your help is greatly appreciated! The website is still in development stage. I can give you temporary access to WP Dashboard if you tell me your email address. Thank you.