'42834', 'slug' => 'shipclock-pre-orders', 'type' => 'plugin', 'public_key' => 'pk_c40bdda47a2d8cd3359aed8951933', 'is_premium' => false, 'premium_suffix' => 'Pro', 'has_premium_version' => true, 'has_addons' => false, 'has_paid_plans' => true, 'is_org_compliant' => true, 'menu' => array( 'slug' => 'pokit-preorders', 'first-path' => 'admin.php?page=pokit-preorders', 'parent' => array( 'slug' => 'woocommerce' ), 'contact' => false, 'support' => false, ), ) ); } return $pokit_fs; } pokit_fs(); do_action( 'pokit_fs_loaded' ); } if ( ! function_exists( 'pokit_uninstall_cleanup' ) ) { /** * Runs when the plugin is deleted (Freemius after_uninstall hook). * * Data is kept by default so pre-orders are never lost by accident. * Define POKIT_REMOVE_ALL_DATA as true in wp-config.php to delete everything. */ function pokit_uninstall_cleanup() { if ( ! defined( 'POKIT_REMOVE_ALL_DATA' ) || ! POKIT_REMOVE_ALL_DATA ) { return; } global $wpdb; $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}pokit_preorders" ); // phpcs:ignore WordPress.DB delete_option( 'pokit_settings' ); delete_option( 'pokit_db_version' ); delete_option( 'pokit_flush_rewrite' ); $wpdb->query( "DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '\\_pokit\\_%'" ); // phpcs:ignore WordPress.DB } } pokit_fs()->add_action( 'after_uninstall', 'pokit_uninstall_cleanup' ); require_once POKIT_PATH . 'includes/class-pokit-license.php'; // Declare compatibility with HPOS and Cart/Checkout Blocks. 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 ); } } ); register_activation_hook( __FILE__, array( 'POKIT_Install_Loader', 'activate' ) ); register_deactivation_hook( __FILE__, array( 'POKIT_Install_Loader', 'deactivate' ) ); /** * Tiny shim so activation works before WooCommerce has loaded. */ final class POKIT_Install_Loader { /** Activation. */ public static function activate() { require_once POKIT_PATH . 'includes/class-pokit-install.php'; POKIT_Install::install(); } /** Deactivation: stop our scheduled jobs. */ public static function deactivate() { if ( function_exists( 'as_unschedule_all_actions' ) ) { as_unschedule_all_actions( 'pokit_sweep' ); } flush_rewrite_rules(); } } add_action( 'plugins_loaded', static function () { if ( ! class_exists( 'WooCommerce' ) ) { add_action( 'admin_notices', static function () { echo '
' . esc_html__( 'Shipclock Pre-Orders requires WooCommerce to be installed and active.', 'shipclock-pre-orders' ) . '