Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-sg-pacheco committed Aug 4, 2021
1 parent 4b20e12 commit e8a5852
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions popup-notices-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
exit;
} // Exit if accessed directly

// Handle is_plugin_active function.
if ( ! function_exists( 'is_plugin_active' ) ) {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}

// Check for active plugins.
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
return;
}

// Composer.
if ( ! class_exists( '\ThanksToIT\PNWC\Core' ) ) {
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
Expand All @@ -31,19 +41,7 @@
do_action( 'pnwc_autoloader', $autoloader );
$autoloader->init();

// Handle is_plugin_active function.
if ( ! function_exists( 'is_plugin_active' ) ) {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}

// Check for active plugins.
if (
! is_plugin_active( 'woocommerce/woocommerce.php' ) ||
( 'popup-notices-for-woocommerce.php' === basename( __FILE__ ) && is_plugin_active( 'popup-notices-for-woocommerce-pro/popup-notices-for-woocommerce-pro.php' ) )
) {
return;
}

// Starts plugin.
$plugin = \ThanksToIT\PNWC\Core::instance();
$plugin->setup( array(
'path' => __FILE__
Expand Down

0 comments on commit e8a5852

Please sign in to comment.