KANASTA_FS_ID, 'slug' => 'kanasta', 'premium_slug' => 'kanasta-pro', 'type' => 'plugin', 'public_key' => KANASTA_FS_PUBLIC_KEY, 'is_premium' => false, 'premium_suffix' => 'Pro', 'has_premium_version' => true, 'has_addons' => false, 'has_paid_plans' => true, 'is_org_compliant' => true, 'menu' => array( 'slug' => 'kanasta', 'first-path' => 'admin.php?page=kanasta', 'contact' => false, 'support' => false, 'parent' => array( 'slug' => 'woocommerce', ), ), ) ); } return $kanasta_fs; } /** * Keep Freemius messages (opt-in, trial offer, license notices) on the Plugins screen and on the * plugin's own pages instead of the whole dashboard. * * @param bool $show Whether Freemius wants to show the notice. * @return bool */ function kanasta_fs_show_admin_notice( $show ) { $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null; if ( ! $show || ! $screen ) { return $show; } return 'plugins' === $screen->id || false !== strpos( $screen->id, 'kanasta' ); } kanasta_fs(); kanasta_fs()->add_filter( 'show_admin_notice', 'kanasta_fs_show_admin_notice' ); kanasta_fs()->add_filter( 'show_affiliate_program_notice', '__return_false' ); do_action( 'kanasta_fs_loaded' ); } /** * Delete Kanasta options when the plugin is deleted. * * Runs from Freemius' uninstall hook (Freemius needs to own uninstall, so there is no uninstall.php). */ function kanasta_uninstall_cleanup() { delete_option( 'kanasta_settings' ); delete_option( 'woocommerce_kanasta_settings' ); delete_option( 'kanasta_rotation_index' ); } if ( function_exists( 'kanasta_fs' ) ) { kanasta_fs()->add_action( 'after_uninstall', 'kanasta_uninstall_cleanup' ); } else { register_uninstall_hook( KANASTA_FILE, 'kanasta_uninstall_cleanup' ); } require_once KANASTA_DIR . 'includes/class-kanasta-plugin.php'; // Pro features: Freemius removes this block, and the Pro folder, from the free build. if ( function_exists( 'kanasta_fs' ) ) { } add_action( 'before_woocommerce_init', static function () { if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', KANASTA_FILE, true ); \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', KANASTA_FILE, true ); } } ); add_action( 'plugins_loaded', array( 'Kanasta_Plugin', 'instance' ) );