PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / 2.5.5
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization v2.5.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 / divi.php

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

62 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_Divi
5 *
6 * An example of a conflict.
7 */
8 class Optml_Divi extends Optml_abstract_conflict {
9
10 /**
11 * Optml_Divi constructor.
12 */
13 public function __construct() {
14 $this->priority = 2;
15 $this->severity = self::SEVERITY_HIGH;
16 parent::__construct();
17 }
18
19 /**
20 * Set the message property
21 *
22 * @since 2.2.6
23 * @access public
24 */
25 public function define_message() {
26 $this->message = sprintf( __( 'It seems your are using %1$sDivi%2$s right now. %3$s In order for Optimole to replace the images in your Divi pages, you will need to go to %4$sDivi -> Theme Options -> Builder -> Advanced -> Static CSS File Generations%5$s and click on Clear for the images to be processed. ', 'optimole-wp' ), '<b>', '</b>', '<br/>', '<a target="_blank" href="' . admin_url( 'admin.php?page=et_divi_options' ) . '">', '</a>' );
27 }
28
29
30 /**
31 * Determine if conflict is applicable.
32 *
33 * @return bool
34 * @since 2.2.6
35 * @access public
36 */
37 public function is_conflict_valid() {
38 $show_message = false;
39 if ( is_plugin_active( 'divi-builder/divi-builder.php' ) ) {
40 $show_message = true;
41 }
42
43 $theme = wp_get_theme();
44 // Divi, no child theme.
45 if ( strcmp( $theme->get( 'Name' ), 'Divi' ) === 0 && $theme->parent() === false ) {
46 $show_message = true;
47 }
48 // Child theme, parent divi.
49 if ( $theme->parent() !== false && strcmp( $theme->parent()->get( 'Name' ), 'Divi' ) === 0 ) {
50 $show_message = true;
51 }
52 if ( ! function_exists( 'et_get_option' ) ) {
53 return false;
54 }
55 if ( 'off' === et_get_option( 'et_pb_static_css_file', 'off' ) ) {
56 return false;
57 }
58
59 return $show_message;
60 }
61 }
62