deleteCache(); } } public function maybe_flush_autoptimize_cache() { if ( ! rsssl_user_can_manage() ) { return; } if ( class_exists( 'autoptimizeCache' ) ) { autoptimizeCache::clearall(); } } public function maybe_flush_wp_rocket() { if ( ! rsssl_user_can_manage() ) { return; } if ( function_exists( 'rocket_clean_domain' ) ) { rocket_clean_domain(); } } public function maybe_flush_cache_enabler() { if ( ! rsssl_user_can_manage() ) { return; } if ( class_exists( 'Cache_Enabler' ) ) { Cache_Enabler::clear_complete_cache(); } } public function maybe_flush_wp_super_cache() { if ( ! rsssl_user_can_manage() ) { return; } if ( function_exists( 'wp_cache_clear_cache' ) ) { wp_cache_clear_cache(); } } /** * Flush Cloudflare cache if the Cloudflare plugin is active. * * @see https://github.com/cloudflare/Cloudflare-WordPress */ public function maybe_flush_cloudflare_cache() { if ( ! rsssl_user_can_manage() ) { return; } if ( defined( 'CLOUDFLARE_PLUGIN_DIR' ) && class_exists( '\Cloudflare\APO\WordPress\Hooks' ) ) { try { $cloudflare_hooks = new \Cloudflare\APO\WordPress\Hooks(); $cloudflare_hooks->purgeCacheEverything(); } catch ( \Throwable $e ) { // Silently fail if Cloudflare API is not configured. } } } }//class closure }