| @@ -2,13 +2,13 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: Taboola |
| 4 | 4 | * Plugin URI: https://developers.taboola.com/web-integrations/docs/wordpress-plugin |
| 5 | 5 | * Description: Taboola |
| 6 | - * Version: 3.0.1 | |
| 6 | + * Version: 3.0.2 | |
| 7 | 7 | * Author: Taboola |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -define( 'TABOOLA_PLUGIN_VERSION', '3.0.1' ); // track every release | |
| 10 | +define( 'TABOOLA_PLUGIN_VERSION', '3.0.2' ); // track every release | |
| 11 | 11 | define( 'TABOOLA_MIN_VER', '3.0' ); // bump only when DB changes |
| 12 | 12 | define( 'TABOOLA_DEBUG_MODE', false ); |
| 13 | 13 | |
| 14 | 14 | define( 'TABOOLA_OPTION_NAME', 'taboola_plugin_version' ); |
| @@ -21,9 +21,11 @@ | ||
| 21 | 21 | define( 'TABOOLA_CONTENT_FORMAT_HTML', 'html' ); |
| 22 | 22 | |
| 23 | 23 | include_once 'widget.php'; |
| 24 | 24 | require_once 'JavaScriptWrapper.php'; |
| 25 | -require_once plugin_dir_path( __FILE__ ) . 'simple_html_dom.php'; // ← NEW | |
| 25 | +if ( ! class_exists( 'simple_html_dom' ) ) { | |
| 26 | + require_once plugin_dir_path( __FILE__ ) . 'simple_html_dom.php'; // ← NEW | |
| 27 | +} | |
| 26 | 28 | |
| 27 | 29 | if ( ! class_exists( 'TaboolaWP' ) ) { |
| 28 | 30 | class TaboolaWP { |
| 29 | 31 | |
| @@ -554,9 +556,11 @@ | ||
| 554 | 556 | |
| 555 | 557 | // server side selector provided (see simple_html_dom selectors http://simplehtmldom.sourceforge.net/manual.htm) |
| 556 | 558 | // basically it's CSS selectors like in jQuery |
| 557 | 559 | } else{ |
| 558 | - require_once('simple_html_dom.php'); | |
| 560 | + if ( ! class_exists( 'simple_html_dom' ) ) { | |
| 561 | + require_once('simple_html_dom.php'); | |
| 562 | + } | |
| 559 | 563 | |
| 560 | 564 | $html_doc = str_get_html($content); |
| 561 | 565 | $target_location = $html_doc->find($location, ($occurrence) - 1); |
| 562 | 566 | |
| @@ -615,10 +619,12 @@ | ||
| 615 | 619 | } |
| 616 | 620 | |
| 617 | 621 | // server side selector provided (see simple_html_dom selectors http://simplehtmldom.sourceforge.net/manual.htm) |
| 618 | 622 | // basically it's CSS selectors like in jQuery |
| 619 | - } else{ | |
| 623 | + } else{ | |
| 624 | + if ( ! class_exists( 'simple_html_dom' ) ) { | |
| 620 | 625 | require_once('simple_html_dom.php'); |
| 626 | + } | |
| 621 | 627 | |
| 622 | 628 | $html_doc = str_get_html($content); |
| 623 | 629 | $target_location = $html_doc->find($location,($this->settings->home_location_string_occurrence)-1); |
| 624 | 630 | |