diff --git a/includes/class-scd-ext-dependency-checker.php b/includes/class-scd-ext-dependency-checker.php index 54ba12d..dc96a96 100644 --- a/includes/class-scd-ext-dependency-checker.php +++ b/includes/class-scd-ext-dependency-checker.php @@ -38,6 +38,18 @@ public static function are_system_dependencies_met() { return $are_met; } + /** + * Checks if plugin already active through Sensei Pro. + * + * @return bool + */ + public static function is_sensei_pro_active() { + if ( defined( 'SENSEI_PRO_VERSION' ) ) { + return true; + } + return false; + } + /** * Checks if all plugin dependencies are met. * diff --git a/sensei-content-drip.php b/sensei-content-drip.php index 1a6f493..43a011e 100644 --- a/sensei-content-drip.php +++ b/sensei-content-drip.php @@ -20,13 +20,16 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } +require_once dirname( __FILE__ ) . '/includes/class-scd-ext-dependency-checker.php'; + +if ( Scd_Ext_Dependency_Checker::is_sensei_pro_active() ) { + return; +} define( 'SENSEI_CONTENT_DRIP_VERSION', '2.1.1' ); define( 'SENSEI_CONTENT_DRIP_PLUGIN_FILE', __FILE__ ); define( 'SENSEI_CONTENT_DRIP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); -require_once dirname( __FILE__ ) . '/includes/class-scd-ext-dependency-checker.php'; - if ( ! Scd_Ext_Dependency_Checker::are_system_dependencies_met() ) { return; }