Fatal error since 3.0
-
Since version 3.0, the plugin causes a fatal error.
Starting from this version, the plugin uses “Simple HTML DOM”.
If another plugin (e.g., EmbedPress) also uses Simple HTML DOM, a fatal error occurs because the Taboola plugin does not check whether the library has already been included.The error message is typically: Fatal error: Cannot redeclare function …
Solution:In the file
taboola_widget.php, replace this line:
require_once plugin_dir_path( FILE ) . ‘simple_html_dom.php’; // ← NEW
with this:
if ( ! class_exists( ‘simple_html_dom’ ) ) {
require_once plugin_dir_path( FILE ) . ‘simple_html_dom.php’; // ← NEW
}This change ensures that Simple HTML DOM is only loaded if it has not already been included by another plugin or theme.
It prevents function redeclaration errors and improves compatibility with other plugins that use the same library.
The topic ‘Fatal error since 3.0’ is closed to new replies.