Resolving conflicts with other plugins

Third-party plugin conflicts

To ensure that third-party plugins do not interfere with our plugin's functionality, we take proactive measures by unloading all non-MailPoet external JavaScript/CSS dependencies that are used on our plugin pages. To be fair, we also never load our own assets on other plugins' pages.

In some cases these measures may backfire, especially when third-party plugins output embedded code that depends on those external JavaScript/CSS assets.

Conflict resolution

While your first line of defense is to disable the offending plugin, you can also whitelist it from having its JavaScript/CSS dependencies unloaded using the following code:

add_action('admin_menu', 'mailpoet_whitelist_plugins', 1);

function mailpoet_whitelist_plugins() {
  add_filter('mailpoet_conflict_resolver_whitelist_script', function($whitelisted_scripts) {
    $whitelisted_scripts[] = 'slug_of_the_plugin_to_whitelist'; // make sure to change this
    return $whitelisted_scripts;
  });

  add_filter('mailpoet_conflict_resolver_whitelist_style', function($whitelisted_styles) {
    $whitelisted_styles[] = 'slug_of_the_plugin_to_whitelist'; // make sure to change this
    return $whitelisted_styles;
  });
}

This code can be added to your theme's functions.php or elsewhere.

Resolving Dependency Conflicts with other plugins

If you see a message like this one below in your Dashboard or Plugins page, that's a conflict with another plugin using the same dependency as MailPoet, but probably using an older version of the same library as we use:

In order to fix that issue, you'll need to install this plugin: Plugins Load Order and then go to your WordPress Settings menu and click on Plugins Load Order page.

First, try dragging the MailPoet plugin above the conflicting plugin. This will make sure MailPoet is loaded first. Then click on Save Settings and go to the Plugins page. If that error message above isn't gone away, repeat the steps below, but this time, make sure MailPoet is dragged below the offending plugin. That might do the trick.