| @@ -3,10 +3,10 @@ | ||
| 3 | 3 | /** |
| 4 | 4 | * Plugin Name: Booktics - Booking Calendar for Appointments and Service Businesses |
| 5 | 5 | * Plugin URI: https://arraytics.com/booktics/ |
| 6 | 6 | * Description: Schedule, Appointment and Seat Booking plugin. |
| 7 | - * Version: 1.0.18 | |
| 8 | - * Requires at least: 5.2 | |
| 7 | + * Version: 1.0.27 | |
| 8 | + * Requires at least: 6.2 | |
| 9 | 9 | * Requires PHP: 7.4 |
| 10 | 10 | * Author: Arraytics |
| 11 | 11 | * Author URI: https://arraytics.com/ |
| 12 | 12 | * License: GPL v2 or later |
| @@ -29,9 +29,9 @@ | ||
| 29 | 29 | * |
| 30 | 30 | * @package Booktics |
| 31 | 31 | * @category Core |
| 32 | 32 | * @author Arraytics |
| 33 | - * @version 1.0.18 | |
| 33 | + * @version 1.0.27 | |
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | 36 | use Booktics\Booktics; |
| 37 | 37 | use Booktics\Providers\Global_Service_Provider; |
| @@ -43,11 +43,12 @@ | ||
| 43 | 43 | require_once __DIR__ . '/vendor/autoload.php'; |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | // Define constant for the Plugin file. |
| 47 | +define( 'BOOKTICS_PLUGIN_NAME', "Booktics"); | |
| 47 | 48 | defined( 'BOOKTICS_FILE' ) || define( 'BOOKTICS_FILE', __FILE__ ); |
| 48 | 49 | defined( 'BOOKTICS_DIR' ) || define( 'BOOKTICS_DIR', __DIR__ ); |
| 49 | -defined( 'BOOKTICS_VERSION' ) || define( 'BOOKTICS_VERSION', '1.0.18' ); | |
| 50 | +defined( 'BOOKTICS_VERSION' ) || define( 'BOOKTICS_VERSION', '1.0.27' ); | |
| 50 | 51 | |
| 51 | 52 | global $booktics_container; |
| 52 | 53 | |
| 53 | 54 | $booktics_container = new \Booktics\Container\Container(); |
| @@ -66,9 +67,9 @@ | ||
| 66 | 67 | } |
| 67 | 68 | |
| 68 | 69 | /** |
| 69 | 70 | * Registers the uninstaller form backend. |
| 70 | - * | |
| 71 | + * | |
| 71 | 72 | * @return void |
| 72 | 73 | */ |
| 73 | 74 | function booktics_register_uninstaller_form() { |
| 74 | 75 | try { |
| @@ -93,9 +94,9 @@ | ||
| 93 | 94 | 'Booktics', // Plugin name |
| 94 | 95 | 'booktics', // Plugin Slug |
| 95 | 96 | __FILE__, |
| 96 | 97 | 'booktics', // Text Domain Name |
| 97 | - 'booktics-feedback-modal' | |
| 98 | + 'booktics-feedback-modal' | |
| 98 | 99 | ); |
| 99 | 100 | } |
| 100 | 101 | } |
| 101 | 102 | } catch ( \Throwable $e ) { |
| @@ -111,8 +112,57 @@ | ||
| 111 | 112 | ); |
| 112 | 113 | } |
| 113 | 114 | } |
| 114 | 115 | } |
| 116 | + | |
| 117 | +/** | |
| 118 | + * Add a "Go Pro" action link on the Plugins page. | |
| 119 | + * Hidden when the pro plugin is active. | |
| 120 | + */ | |
| 121 | +if ( ! function_exists( 'booktics_add_go_pro_action_link' ) ) { | |
| 122 | + function booktics_add_go_pro_action_link( $links ) { | |
| 123 | + if ( function_exists( 'booktics_pro' ) ) { | |
| 124 | + return $links; | |
| 125 | + } | |
| 126 | + | |
| 127 | + $go_pro = sprintf( | |
| 128 | + '<a href="%1$s" target="_blank" rel="noopener noreferrer" style="color:#e8364c;font-weight:600;">%2$s</a>', | |
| 129 | + esc_url( 'https://arraytics.com/booktics/pricing/' ), | |
| 130 | + esc_html__( 'Go Pro', 'booktics' ) | |
| 131 | + ); | |
| 132 | + | |
| 133 | + $links[] = $go_pro; | |
| 134 | + return $links; | |
| 135 | + } | |
| 136 | +} | |
| 137 | +add_filter( 'plugin_action_links_' . plugin_basename( BOOKTICS_FILE ), 'booktics_add_go_pro_action_link' ); | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | +/** | |
| 142 | + * Declare WooCommerce feature compatibility. | |
| 143 | + * | |
| 144 | + * Must run on before_woocommerce_init, which fires while WooCommerce boots — | |
| 145 | + * earlier than the `init` hook the service providers are wired to, so this | |
| 146 | + * cannot live inside the WooCommerce module. | |
| 147 | + * | |
| 148 | + * @return void | |
| 149 | + */ | |
| 150 | +add_action( | |
| 151 | + 'before_woocommerce_init', function () { | |
| 152 | + if ( ! class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { | |
| 153 | + return; | |
| 154 | + } | |
| 155 | + | |
| 156 | + // High-Performance Order Storage: the module only ever touches orders | |
| 157 | + // through the CRUD API, never through post meta. | |
| 158 | + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', BOOKTICS_FILE, true ); | |
| 159 | + | |
| 160 | + // Cart & Checkout blocks: booking checkout runs on whatever checkout the | |
| 161 | + // store already uses, block or classic. | |
| 162 | + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', BOOKTICS_FILE, true ); | |
| 163 | + } | |
| 164 | +); | |
| 115 | 165 | |
| 116 | 166 | /** |
| 117 | 167 | * Load Booktics Plugin when all plugins loaded. |
| 118 | 168 | * |