plugin_path = end( $plugin_path ); // Set plugin file $this->plugin_file = $plugin_file; // Set plugin name $this->plugin_name = str_replace( 'AffiliateWP - ', '', $plugins[$this->plugin_path . '/' . $this->plugin_file]['Name'] ); // Is EDD installed? foreach( $plugins as $plugin_path => $plugin ) { if( $plugin['Name'] == 'AffiliateWP' ) { $this->has_affwp = true; } } } /** * Process plugin deactivation * * @access public * @since 1.0.0 * @return void */ public function run() { // Display notice add_action( 'admin_notices', array( $this, 'missing_affwp_notice' ) ); } /** * Display notice if EDD isn't installed * * @access public * @since 1.0.0 * @return string The notice to display */ public function missing_affwp_notice() { if( $this->has_affwp ) { echo '

' . $this->plugin_name . __( ' requires AffiliateWP! Please activate it to continue!', 's214-affwp-activation' ) . '

'; } else { echo '

' . $this->plugin_name . __( ' requires AffiliateWP! Please install it to continue!', 's214-affwp-activation' ) . '

'; } } }