Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a check to see if plugin is already active with Sensei Pro #237

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions includes/class-scd-ext-dependency-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
7 changes: 5 additions & 2 deletions sensei-content-drip.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down