| 1 |
<?php // phpcs:ignore |
| 2 |
|
| 3 |
namespace OPTN\Includes\Compatibility; |
| 4 |
|
| 5 |
defined( 'ABSPATH' ) || exit; |
| 6 |
|
| 7 |
/** |
| 8 |
* Class CachingPlugins |
| 9 |
*/ |
| 10 |
class CachingPlugins { |
| 11 |
|
| 12 |
/** |
| 13 |
* Init hooks |
| 14 |
* |
| 15 |
* @return void |
| 16 |
*/ |
| 17 |
public static function init() { |
| 18 |
add_action( |
| 19 |
'optn_compat_purge_cache', |
| 20 |
function () { |
| 21 |
|
| 22 |
// Litespeed. |
| 23 |
// ISSUE:OPT-106 Disabling for now. |
| 24 |
// do_action( 'litespeed_purge_all' ); |
| 25 |
|
| 26 |
// WP Rocket. |
| 27 |
if ( function_exists( 'rocket_clean_domain' ) ) { |
| 28 |
rocket_clean_domain(); |
| 29 |
} |
| 30 |
|
| 31 |
// W3 Total Cache. |
| 32 |
if ( function_exists( 'w3tc_flush_all' ) ) { |
| 33 |
w3tc_flush_all(); |
| 34 |
} |
| 35 |
} |
| 36 |
); |
| 37 |
} |
| 38 |
} |
| 39 |
|