# optimole-wp/3.0.1/inc/compatibilities/cache_enabler.php

Optimole – Optimize Images | Convert WebP &amp; AVIF | CDN &amp; Lazy Load | Image Optimization, version 3.0.1. 30 lines.

- Page: https://pluginprobe.com/plugins/optimole-wp/3.0.1/code/inc/compatibilities/cache_enabler.php
- Raw: https://pluginprobe.com/plugins/optimole-wp/3.0.1/raw/inc/compatibilities/cache_enabler.php
- Modified: 2019-09-25T17:15:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/optimole-wp/3.0.1/code/inc/compatibilities/cache_enabler.php#L10-L20`.

```php
<?php

/**
 * Class Optml_cache_enabler.
 *
 * @reason Cache_enabler stores the content of the page before Optimole starts replacing url's
 */
class Optml_cache_enabler extends Optml_compatibility {


	/**
	 * Should we load the integration logic.
	 *
	 * @return bool Should we load.
	 */
	function should_load() {
		include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

		return is_plugin_active( 'cache-enabler/cache-enabler.php' );
	}

	/**
	 * Register integration details.
	 */
	public function register() {
		add_filter( 'cache_enabler_before_store', [ Optml_Main::instance()->manager, 'replace_content' ], PHP_INT_MAX, 1 );
	}

}

```
