PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.38
Timetics – Appointment Booking Calendar & Scheduling v1.0.38
1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 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.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 All 62 releases
← All changes | bootstrap.php +38 -7 1.0.231.0.38 View file →
@@ -22,8 +22,9 @@
22 22
23 23
24 24 private $file;
25 25 public $version;
26 + private $has_pro;
26 27
27 28 /**
28 29 * Throw Error While Trying To Clone Object
29 30 *
@@ -209,8 +210,12 @@
209 210 /**
210 211 * Core helpers.
211 212 */
212 213 require_once TIMETICS_PLUGIN_DIR . 'utils/global-helper.php';
214 + require_once TIMETICS_PLUGIN_DIR . 'core/staffs/calendars/CalendarSyncFacade.php';
215 + require_once TIMETICS_PLUGIN_DIR . 'core/staffs/calendars/CalendarSyncFactory.php';
216 + require_once TIMETICS_PLUGIN_DIR . 'core/staffs/calendars/CalendarSyncInterface.php';
217 + require_once TIMETICS_PLUGIN_DIR . 'core/staffs/calendars/GoogleCalendarSync.php';
213 218 }
214 219
215 220 /**
216 221 * Initialize All Components
@@ -235,8 +240,9 @@
235 240 Core\Services\Hooks::instance()->init();
236 241 Base\Custom_Endpoint::instance()->init();
237 242
238 243 global $current_screen;
244 + $this->has_pro = class_exists('TimeticsPro');
239 245
240 246 $this->handle_buy_pro_module();
241 247
242 248 if ( function_exists('WC') ) {
@@ -258,9 +264,25 @@
258 264 *
259 265 * @return void
260 266 */
261 267 public function admin_scripts( $handle ) {
262 - if ( 'toplevel_page_timetics' !== $handle ) {
268 +
269 + if('plugins.php' === $handle){
270 +
271 + wp_register_script( 'timetics-feedback-modal', TIMETICS_ASSETS_URL . 'js/feedback-modal.js', [ 'wp-plugins', 'wp-i18n', 'wp-element', 'wp-dom', 'wp-data' ], TIMETICS_VERSION, true );
272 + wp_enqueue_script( 'timetics-feedback-modal', TIMETICS_ASSETS_URL . 'js/feedback-modal.js', [], TIMETICS_VERSION, true );
273 + wp_register_style( 'timetics-feedback-modal', TIMETICS_ASSETS_URL . 'css/feedback-modal.css', [], TIMETICS_VERSION, 'all' );
274 + wp_enqueue_style( 'timetics-feedback-modal', TIMETICS_ASSETS_URL . 'css/feedback-modal.css', [], TIMETICS_VERSION, 'all' );
275 +
276 + $feedback_obj = array(
277 + 'site_url' => site_url()
278 + );
279 +
280 + wp_localize_script( 'timetics-feedback-modal', 'timetics_feedback', $feedback_obj );
281 +
282 + }
283 +
284 + if ( 'toplevel_page_timetics' !== $handle) {
263 285 return;
264 286 }
265 287 global $wp_locale;
266 288
@@ -309,8 +331,9 @@
309 331 *
310 332 * @return void
311 333 */
312 334 public function frontend_scripts() {
335 +
313 336 wp_register_style( 'timetics-vendor', TIMETICS_ASSETS_URL . 'css/vendor.css', [], TIMETICS_VERSION, 'all' );
314 337 wp_register_style( 'timetics-frontend', TIMETICS_ASSETS_URL . 'css/frontend.css', [], TIMETICS_VERSION, 'all' );
315 338
316 339 wp_register_script( 'timetics-flatpickr-scripts', TIMETICS_ASSETS_URL . 'js/vendors/flatpickr.js', [ 'wp-plugins', 'wp-i18n', 'wp-element', 'wp-dom', 'wp-data' ], TIMETICS_VERSION, true );
@@ -397,25 +420,33 @@
397 420 */
398 421 public function handle_buy_pro_module() {
399 422 $page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
400 423
424 +
401 425 if ( 'timetics' !== $page ) {
402 426 return;
403 427 }
404 428
429 +
405 430 /**
406 431 * Show banner (codename: jhanda)
407 432 */
408 433 $filter_string = 'timetics,timetics-free-only';
409 434
435 + if( $this->has_pro ) {
436 +
437 + $filter_string .= ',timetics-pro';
438 + $filter_string = str_replace(',timetics-free-only', '', $filter_string);
439 +
440 + }
441 +
442 +
410 443 \Wpmet\Libs\Banner::instance('timetics')
411 - // ->is_test(true)
444 + ->is_test(true)
412 445 ->set_filter(ltrim($filter_string, ','))
413 - ->set_api_url('https://demo.themewinter.com/public/jhanda')
414 - ->set_plugin_screens('edit-timetics')
415 - ->set_plugin_screens('timetics_page_timetics_sales_report')
416 - ->set_plugin_screens('edit-timetics-attendee')
417 - ->set_plugin_screens('timetics_page_timetics_get_help')
446 + ->set_api_url('https://product.themewinter.com/auth/public/jhanda')
447 + ->set_plugin_screens('timetics')
448 + ->set_plugin_screens('toplevel_page_timetics')
418 449 ->call();
419 450 // show get-help and upgrade-to-premium menu.
420 451 // $this->handle_get_help_and_upgrade_menu();
421 452 }