| Server IP : 145.239.37.162 / Your IP : 216.73.216.55 Web Server : Apache System : Linux webm003.cluster130.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaa ( 38250) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaa/www/wp-content/plugins/cookie-notice/includes/modules/wp-optimize/ |
Upload File : |
<?php
// exit if accessed directly
if ( ! defined( 'ABSPATH' ) )
exit;
/**
* Cookie Notice Modules WP-Optimize class.
*
* Compatibility since: 3.0.12
*
* @class Cookie_Notice_Modules_WPOptimize
*/
class Cookie_Notice_Modules_WPOptimize {
/**
* Constructor.
*
* @return void
*/
public function __construct() {
// has to be executed on plugins_loaded with priority 0
$this->load_module();
}
/**
* Add compatibility to WP-Optimize plugin.
*
* @return void
*/
public function load_module() {
// get wp-optimize configuration
if ( class_exists( 'WPO_Cache_Config' ) ) {
$options = WPO_Cache_Config::instance()->get();
// is caching enabled?
if ( ! empty( $options['enable_page_caching'] ) )
add_filter( 'wpo_purge_cache_hooks', [ $this, 'add_purge_cache' ] );
}
}
/**
* Add action when cache is purged.
*
* @param array $actions
* @return array
*/
public function add_purge_cache( $actions ) {
$actions[] = 'cn_configuration_updated';
return $actions;
}
}
new Cookie_Notice_Modules_WPOptimize();