| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Class Optml_Wprocket |
| 5 |
* |
| 6 |
* An example of a conflict. |
| 7 |
*/ |
| 8 |
class Optml_Wprocket extends Optml_Abstract_Conflict { |
| 9 |
|
| 10 |
/** |
| 11 |
* Optml_Wprocket constructor. |
| 12 |
*/ |
| 13 |
public function __construct() { |
| 14 |
$this->severity = self::SEVERITY_MEDIUM; |
| 15 |
parent::__construct(); |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* Set the message property |
| 20 |
* |
| 21 |
* @since 2.0.6 |
| 22 |
* @access public |
| 23 |
*/ |
| 24 |
public function define_message() { |
| 25 |
$this->message = sprintf( |
| 26 |
/* translators: 1 is plugin name, 2 is the settings path link */ |
| 27 |
__( 'WP Rocket has <strong>Lazy loading for images</strong> enabled. Optimole already provides its own lazy loading mechanism, which may conflict with WP Rocket\'s. To continue using Optimole\'s lazy loading feature, please disable lazy loading in WP Rocket via %1$s.', 'optimole-wp' ), |
| 28 |
'<a href="' . admin_url( 'options-general.php?page=wprocket#media' ) . '">Settings → WP Rocket → Media</a>' |
| 29 |
); |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Determine if conflict is applicable. |
| 34 |
* |
| 35 |
* @return bool |
| 36 |
* @since 2.0.6 |
| 37 |
* @access public |
| 38 |
*/ |
| 39 |
public function is_conflict_valid() { |
| 40 |
|
| 41 |
if ( ! is_plugin_active( 'wp-rocket/wp-rocket.php' ) ) { |
| 42 |
return false; |
| 43 |
} |
| 44 |
if ( ! function_exists( 'get_rocket_option' ) ) { |
| 45 |
return false; |
| 46 |
} |
| 47 |
|
| 48 |
return get_rocket_option( 'lazyload', false ); |
| 49 |
} |
| 50 |
} |
| 51 |
|