| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Class Optml_Jetpack_Lazyload |
| 5 |
* |
| 6 |
* An example of a conflict. |
| 7 |
*/ |
| 8 |
class Optml_Jetpack_Lazyload extends Optml_abstract_conflict { |
| 9 |
|
| 10 |
/** |
| 11 |
* Optml_Jetpack_Lazyload 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( __( 'It seems your are using %1$sJetpack%2$s with Lazy loading option ON. %3$s Optimole already provides a lazy loading mechanism by it\'s own which might conflict with this. If you would like to further use Optimole lazy loading feature, you can turn that off from %4$sJetpack -> Perfomance%5$s page. ', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=jetpack#/performance' ) . '">', '</a>' ); |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Determine if conflict is applicable. |
| 30 |
* |
| 31 |
* @return bool |
| 32 |
* @since 2.0.6 |
| 33 |
* @access public |
| 34 |
*/ |
| 35 |
public function is_conflict_valid() { |
| 36 |
|
| 37 |
if ( ! is_plugin_active( 'jetpack/jetpack.php' ) && ! is_plugin_active( 'jetpack/jetpack.php' ) ) { |
| 38 |
return false; |
| 39 |
} |
| 40 |
if ( ! class_exists( 'Jetpack', false ) ) { |
| 41 |
return false; |
| 42 |
} |
| 43 |
if ( ! class_exists( 'Jetpack', false ) ) { |
| 44 |
return false; |
| 45 |
} |
| 46 |
|
| 47 |
if ( ! Optml_Main::instance()->admin->settings->use_lazyload() ) { |
| 48 |
return false; |
| 49 |
} |
| 50 |
|
| 51 |
return Jetpack::is_module_active( 'lazy-images' ); |
| 52 |
} |
| 53 |
} |
| 54 |
|