| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | * Class Optml_Divi |
| 5 | 5 | * |
| 6 | 6 | * An example of a conflict. |
| 7 | 7 | */ |
| 8 | -class Optml_Divi extends Optml_abstract_conflict { | |
| 8 | +class Optml_Divi extends Optml_Abstract_Conflict { | |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Optml_Divi constructor. |
| 12 | 12 | */ |
| @@ -22,9 +22,9 @@ | ||
| 22 | 22 | * @since 2.2.6 |
| 23 | 23 | * @access public |
| 24 | 24 | */ |
| 25 | 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>' ); | |
| 26 | + $this->message = sprintf( /* translators: 1 is the start of the bold tag, 2 is ending bold tag, 3 is new line tag, 4 is anchor tag start, 5 is ending anchor tag */ __( '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 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | /** |
| @@ -34,20 +34,26 @@ | ||
| 34 | 34 | * @since 2.2.6 |
| 35 | 35 | * @access public |
| 36 | 36 | */ |
| 37 | 37 | public function is_conflict_valid() { |
| 38 | - $show_message = false; | |
| 38 | + $show_message = true; | |
| 39 | 39 | if ( is_plugin_active( 'divi-builder/divi-builder.php' ) ) { |
| 40 | - $show_message = true; | |
| 40 | + if ( ! function_exists( 'get_plugin_data' ) ) { | |
| 41 | + require_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
| 42 | + } | |
| 43 | + $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/divi-builder/divi-builder.php' ); | |
| 44 | + if ( version_compare( $plugin_data['Version'], '4.10.8', '<' ) ) { | |
| 45 | + $show_message = true; | |
| 46 | + } | |
| 41 | 47 | } |
| 42 | 48 | |
| 43 | 49 | $theme = wp_get_theme(); |
| 44 | 50 | // Divi, no child theme. |
| 45 | - if ( strcmp( $theme->get( 'Name' ), 'Divi' ) === 0 && $theme->parent() === false ) { | |
| 51 | + if ( strcmp( $theme->get( 'Name' ), 'Divi' ) === 0 && $theme->parent() === false && version_compare( $theme->get( 'Version' ), '4.10.8', '<' ) ) { | |
| 46 | 52 | $show_message = true; |
| 47 | 53 | } |
| 48 | 54 | // Child theme, parent divi. |
| 49 | - if ( $theme->parent() !== false && strcmp( $theme->parent()->get( 'Name' ), 'Divi' ) === 0 ) { | |
| 55 | + if ( $theme->parent() !== false && strcmp( $theme->parent()->get( 'Name' ), 'Divi' ) === 0 && version_compare( $theme->parent()->get( 'Version' ), '4.10.8', '<' ) ) { | |
| 50 | 56 | $show_message = true; |
| 51 | 57 | } |
| 52 | 58 | if ( ! function_exists( 'et_get_option' ) ) { |
| 53 | 59 | return false; |