set_basename( false, __FILE__ ); return; } define( 'STRIKEWISE_VERSION', '1.0.4' ); define( 'STRIKEWISE_FILE', __FILE__ ); define( 'STRIKEWISE_DIR', plugin_dir_path( __FILE__ ) ); define( 'STRIKEWISE_URL', plugin_dir_url( __FILE__ ) ); /* * Freemius product ID and public key from the Freemius Developer Dashboard * (Product -> SDK Integration). Both values are public. Never put the secret key here. * With an empty ID, the plugin runs as the free version without licensing. */ define( 'STRIKEWISE_FS_ID', '41535' ); define( 'STRIKEWISE_FS_PUBLIC_KEY', 'pk_31b073feff3380ea9fe68e4f7aa79' ); require_once STRIKEWISE_DIR . 'src/Autoloader.php'; \Strikewise\Autoloader::register(); // Keep this "if": a function declared unconditionally exists from the moment the // file is compiled, which would break the function_exists() check at the top. if ( !function_exists( 'strikewise_fs' ) ) { /** * Freemius SDK instance, or a stand-in while no product ID is configured. * * @return \Freemius|\Strikewise\Licensing\NullFreemius */ function strikewise_fs() { global $strikewise_fs; if ( !isset( $strikewise_fs ) ) { if ( !\Strikewise\Licensing\Licensing::is_configured() ) { $strikewise_fs = new \Strikewise\Licensing\NullFreemius(); return $strikewise_fs; } require_once STRIKEWISE_DIR . 'vendor/freemius/start.php'; $strikewise_fs = fs_dynamic_init( array( 'id' => STRIKEWISE_FS_ID, 'slug' => 'strikewise', 'premium_slug' => 'strikewise-premium', 'type' => 'plugin', 'public_key' => STRIKEWISE_FS_PUBLIC_KEY, 'is_premium' => false, 'premium_suffix' => 'Premium', 'has_addons' => false, 'has_paid_plans' => true, 'is_org_compliant' => true, 'enable_anonymous' => true, 'trial' => array( 'days' => 14, 'is_require_payment' => false, ), 'menu' => array( 'slug' => 'strikewise', 'first-path' => 'admin.php?page=strikewise', 'contact' => false, 'support' => false, 'addons' => false, 'affiliation' => true, ), 'is_live' => true, ) ); } return $strikewise_fs; } } strikewise_fs(); // No trial offer outside the plugin's own pages; the trial stays available on the upgrade page. strikewise_fs()->add_filter( 'show_trial', '__return_false' ); do_action( 'strikewise_fs_loaded' ); if ( \Strikewise\Licensing\Licensing::is_configured() ) { // Freemius records the uninstall and then calls the cleanup. strikewise_fs()->add_action( 'after_uninstall', array(\Strikewise\Install\Uninstaller::class, 'run') ); } else { register_uninstall_hook( __FILE__, array(\Strikewise\Install\Uninstaller::class, 'run') ); } register_activation_hook( __FILE__, array(\Strikewise\Install\Installer::class, 'activate') ); register_deactivation_hook( __FILE__, array(\Strikewise\Install\Installer::class, 'deactivate') ); add_action( 'before_woocommerce_init', static function () { if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, true ); } } ); add_action( 'plugins_loaded', static function () { if ( !class_exists( 'WooCommerce' ) ) { add_action( 'admin_notices', static function () { echo '
' . esc_html__( 'Strikewise requires WooCommerce to be installed and active.', 'strikewise' ) . '