PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / 4.2.5
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization v4.2.5
4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 3.12.0 3.12.1 All 134 releases
optimole-wp / inc / conflicts / autoptimize.php

autoptimize.php in Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization 4.2.5, at inc/conflicts/autoptimize.php

60 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Class Optml_Autoptimize
5 *
6 * Handles conflicts with Autoptimize plugin.
7 */
8 class Optml_Autoptimize extends Optml_Abstract_Conflict {
9
10 /**
11 * Optml_Autoptimize 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 4.1.0
22 * @access public
23 * @return void
24 */
25 public function define_message() {
26 $this->message = sprintf(
27 /* translators: 1 is the settings path link */
28 __( 'Autoptimize has <strong>Lazy loading</strong> enabled. Optimole already provides its own lazy loading mechanism, which may conflict with Autoptimize\'s. To continue using Optimole\'s lazy loading feature, please disable lazy loading in %1$s.', 'optimole-wp' ),
29 '<a href="' . admin_url( 'admin.php?page=autoptimize_imgopt' ) . '">Autoptimize → Image Optimization</a>'
30 );
31 }
32
33 /**
34 * Determine if conflict is applicable.
35 *
36 * @return bool
37 * @since 2.0.6
38 * @access public
39 */
40 public function is_conflict_valid() {
41 if ( ! is_plugin_active( 'autoptimize/autoptimize.php' ) ) {
42 return false;
43 }
44
45 if ( ! Optml_Main::instance()->admin->settings->use_lazyload() ) {
46 return false;
47 }
48
49 $autoptimize_imgopt_settings = get_option( 'autoptimize_imgopt_settings', '' );
50 if ( ! empty( $autoptimize_imgopt_settings ) ) {
51 $settings = maybe_unserialize( $autoptimize_imgopt_settings );
52 if ( is_array( $settings ) && isset( $settings['autoptimize_imgopt_checkbox_field_3'] ) ) {
53 return (bool) $settings['autoptimize_imgopt_checkbox_field_3'];
54 }
55 }
56
57 return false;
58 }
59 }
60