HEX
Server: nginx/1.18.0
System: Linux vps-9dcdb12e 5.15.0-176-generic #186-Ubuntu SMP Fri Mar 13 11:01:42 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.24
Disabled: exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
Upload Files
File: /var/www/hafty.com.pl/wp-content/plugins/cookie-notice/includes/modules/wp-optimize/wp-optimize.php
<?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();