How about using the WordPress is_plugin_active()
function? – https://codex.wordpress.org/Function_Reference/is_plugin_active
This is an admin only function though, so to use it in the frontend or within a template file you would need to manually require plugin.php like so:
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
is_plugin_active($plugin);
Where $plugin
is the name of the plugin sub directory/file eg:
is_plugin_active( 'plugin-directory/plugin-file.php' );