Skip to content

Commit

Permalink
fix: compatibility with cache_enabler #136
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoreMihai committed Sep 17, 2019
1 parent aaf2815 commit 483262f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions inc/compatibilities/cache_enabler.php
@@ -0,0 +1,29 @@
<?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 );
}

}
1 change: 1 addition & 0 deletions inc/manager.php
Expand Up @@ -64,6 +64,7 @@ final class Optml_Manager {
'metaslider',
'essential_grid',
'yith_quick_view',
'cache_enabler',
);

/**
Expand Down

2 comments on commit 483262f

@GrigoreMihai
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@preda-bogdan it works now

@preda-bogdan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GrigoreMihai please run the phpcs and phpunit tests since I see there are some formatting issues.

Thank you!

Please sign in to comment.