true ) ); } ); add_action( 'admin_notices', static function () { if ( ! current_user_can( 'activate_plugins' ) ) { return; } $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null; if ( ! $screen || ! in_array( (string) $screen->id, array( 'plugins', 'plugins-network' ), true ) ) { return; } echo '

' . esc_html__( 'MarginBeacon Free is inactive because MarginBeacon Direct is active. Deactivate Direct before changing distribution channels.', 'marginbeacon' ) . '

'; } ); return; } define( 'AKSMB_VERSION', '1.0.0' ); define( 'AKSMB_PLUGIN_FILE', __FILE__ ); define( 'AKSMB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'AKSMB_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'AKSMB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); define( 'AKSMB_MIN_PHP', '7.4' ); define( 'AKSMB_MIN_WP', '6.4' ); define( 'AKSMB_MIN_WC', '8.0' ); define( 'AKSMB_SCHEMA_VERSION', '1.4.0' ); define( 'AKSMB_FORMULA_VERSION', '1.0.0' ); if ( ! defined( 'AKSMB_DISTRIBUTION_CHANNEL' ) ) { define( 'AKSMB_DISTRIBUTION_CHANNEL', 'legacy' ); } /** * Woo Marketplace product URL for MarginBeacon Pro (upgrade CTA). * Leave empty until listed; then set to the full https://woocommerce.com/products/... URL. */ if ( ! defined( 'AKSMB_PRO_MARKETPLACE_URL' ) ) { define( 'AKSMB_PRO_MARKETPLACE_URL', '' ); } $aksmb_autoload = AKSMB_PLUGIN_DIR . 'vendor/autoload.php'; if ( is_readable( $aksmb_autoload ) ) { require_once $aksmb_autoload; } else { require_once AKSMB_PLUGIN_DIR . 'src/Autoloader.php'; \Kayvandra\MarginBeacon\Autoloader::register(); } register_activation_hook( __FILE__, array( \Kayvandra\MarginBeacon\Bootstrap\Activator::class, 'activate' ) ); register_deactivation_hook( __FILE__, array( \Kayvandra\MarginBeacon\Bootstrap\Deactivator::class, 'deactivate' ) ); add_action( 'plugins_loaded', static function () { \Kayvandra\MarginBeacon\Plugin::instance()->boot(); }, 20 );