HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/cwd/wp-content/plugins/wp-smushit/core/integrations/class-wp-optimize-integration.php
<?php

namespace Smush\Core\Integrations;

use Smush\Core\Controller;
use WPO_Page_Cache;

class WP_Optimize_Integration extends Controller {
	public function __construct() {
		$this->register_action( 'wp_smush_post_cache_flush_required', array( $this, 'clear_post_cache' ) );
		$this->register_action( 'wp_smush_home_cache_flush_required', array( $this, 'clear_url_cache' ) );
	}

	public function should_run() {
		return parent::should_run() && class_exists( 'WPO_Page_Cache' );
	}

	public function clear_post_cache( $post_id ) {
		if ( method_exists( 'WPO_Page_Cache', 'delete_single_post_cache' ) ) {
			WPO_Page_Cache::delete_single_post_cache( $post_id );
		}
	}

	public function clear_url_cache( $url ) {
		if ( method_exists( 'WPO_Page_Cache', 'delete_cache_by_url' ) ) {
			WPO_Page_Cache::delete_cache_by_url( $url );
		}
	}
}