| 1 |
<?php |
| 2 |
/** |
| 3 |
* Compatability related functionalities with 3rd party |
| 4 |
* |
| 5 |
* @package PoweredCache |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace PoweredCache\Compat; |
| 9 |
|
| 10 |
defined( 'ABSPATH' ) || exit; |
| 11 |
|
| 12 |
add_action( 'plugins_loaded', __NAMESPACE__ . '\\load_compat_files' ); |
| 13 |
|
| 14 |
/** |
| 15 |
* Load compatibility files |
| 16 |
* since 2.0 |
| 17 |
*/ |
| 18 |
function load_compat_files() { |
| 19 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/a3-lazy-load.php'; |
| 20 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/advanced-custom-fields.php'; |
| 21 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/autoptimize.php'; |
| 22 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/bj-lazy-load.php'; |
| 23 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/lazy-load.php'; |
| 24 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/rocket-lazy-load.php'; |
| 25 |
|
| 26 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/cookie-law-info.php'; |
| 27 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/cookie-notice.php'; |
| 28 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/eu-cookie-law.php'; |
| 29 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/gdpr.php'; |
| 30 |
require_once POWERED_CACHE_COMPAT_DIR . 'plugins/jetpack-boost.php'; |
| 31 |
|
| 32 |
if ( is_multisite() && defined( 'SUNRISE' ) && SUNRISE ) { |
| 33 |
require POWERED_CACHE_COMPAT_DIR . 'domain-mapping.php'; |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Adds conflict message for 3rd party plugins |
| 39 |
* |
| 40 |
* @param string $plugin_name The plugin name that causes feature conflict |
| 41 |
* @param string $feature The feature name (eg: lazy load) |
| 42 |
*/ |
| 43 |
function add_conflict_message( $plugin_name, $feature ) { |
| 44 |
?> |
| 45 |
<div class="sui-notice sui-notice-warning sui-padding"> |
| 46 |
|
| 47 |
<div class="sui-notice-content"> |
| 48 |
|
| 49 |
<div class="sui-notice-message"> |
| 50 |
<span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span> |
| 51 |
<p> |
| 52 |
<?php |
| 53 |
/* translators: %1$s plugin name, %2$s conflicted feature name (Eg lazyload) */ |
| 54 |
printf( esc_html__( 'It seems %1$s is activated on your site. Powered Cache works perfectly fine with %1$s but you cannot use %2$s functionalities that conflic with %1$s plugin unless you deactivate it.', 'powered-cache' ), esc_html( $plugin_name ), esc_html( $feature ) ); |
| 55 |
?> |
| 56 |
<br> |
| 57 |
</p> |
| 58 |
</div> |
| 59 |
|
| 60 |
</div> |
| 61 |
|
| 62 |
</div> |
| 63 |
<?php |
| 64 |
} |
| 65 |
|