a8cteam51 / safety-net

Scrub options, deactivate denylisted plugins, and delete user data on development sites.
17 stars 1 forks source link

Clear Order and Subscription Caches when deleting or anonymizing #41

Open NickGreen opened 2 years ago

NickGreen commented 2 years ago

There are a few caches that store order and subscription data, that we need to look into flushing after running the Anonymize or Delete functions.

If you go to WooCommerce > status > tools, there are a couple of relevant tools:

I'd probably also consider running:

NickGreen commented 3 months ago

This might work, need to fully test:

    if ( class_exists( 'WCS_Related_Order_Store_Cached_CPT' ) ) {
        WCS_Related_Order_Store_Cached_CPT::instance()->delete_all_caches();
    }

    if ( class_exists( 'WCS_Customer_Store_Cached_CPT' ) ) {
        WCS_Customer_Store_Cached_CPT::instance()->delete_all_caches();
    }