I would approach as follows:
- Identify all the action/filter hooks in the plugin
- Identify all scripts/styles being enqueued.
- Create a function that removes the actions/filters based on the page using
remove_action
,remove_filter
,wp_deregister_style
,wp_deregister_script
You could use something like the following:
function foo_disable_plugin(){
if(is_page('PAGE_TITLE OR ID')){
remove_filter('the_content', 'PLUGIN_FILTER_NAME');
remove_action('wp_head', 'PLUGIN_ACTION_NAME');
wp_deregister_script('PLUGIN_SCRIPT_NAME');
}
}
add_action('template_redirect', 'foo_disable_plugin', 999999999);
If this doesn’t work, you’re probably going to have to make one of the plugin’s classes pluggable.
if(!class_exists('CLASS_NAME')){
//Class goes here
}