PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.27
Booktics – Appointment Booking Calendar for Service Businesses v1.0.27
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 All 31 releases
← All changes | booktics.php +71 -11 1.0.10 → 1.0.27 View file →
@@ -1,12 +1,12 @@
1 1 <?php
2 2
3 3 /**
4 - * Plugin Name: Booktics
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.10
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.1
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.10' );
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,18 +67,18 @@
66 67 }
67 68
68 69 /**
69 70 * Registers the uninstaller form backend.
70 - *
71 + *
71 72 * @return void
72 73 */
73 -function register_uninstaller_form() {
74 +function booktics_register_uninstaller_form() {
74 75 try {
75 76 if ( class_exists( 'UninstallerForm\UninstallerForm' ) && is_callable( [ '\UninstallerForm\UninstallerForm', 'init' ] ) ) {
76 77 $reflection = new ReflectionMethod( '\UninstallerForm\UninstallerForm', 'init' );
77 78 $totalParams = $reflection->getNumberOfParameters(); // Maximum number of parameters allowed
78 79
79 - if( $totalParams === 6 ) {
80 + if( 6 === $totalParams ) {
80 81 $uninstaller_form = new \UninstallerForm\UninstallerForm();
81 82 $uninstaller_form->init(
82 83 'Booktics', // Plugin name
83 84 'booktics', // Plugin Slug
@@ -93,18 +94,77 @@
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 ) {
102 - error_log('Error in initiating uninstaller form');
103 + if ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
104 + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
105 + error_log(
106 + sprintf(
107 + 'Booktics: Error in initiating uninstaller form – %s (Line %d, File %s)',
108 + $e->getMessage(),
109 + $e->getLine(),
110 + $e->getFile()
111 + )
112 + );
113 + }
103 114 }
104 115 }
105 116
106 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 +);
165 +
166 +/**
107 167 * Load Booktics Plugin when all plugins loaded.
108 168 *
109 169 * @return Booktics The singleton instance of Booktics.
110 170 */
@@ -110,9 +170,9 @@
110 170 */
111 171 function booktics() {
112 172 add_action( 'admin_init', 'booktics_handle_conflicting_plugins' );
113 173 add_action( 'admin_notices', 'booktics_show_conflict_deactivation_notice' );
114 - register_uninstaller_form();
174 + booktics_register_uninstaller_form();
115 175 return Booktics::instance();
116 176 }
117 177
118 178 // Let's go.