PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 2.1.2
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v2.1.2
2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 1.7.2 All 33 releases
fluent-booking / boot / app.php

app.php in Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution 2.1.2, at boot/app.php

45 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) || exit;
4
5 use FluentBooking\Framework\Foundation\Application;
6 use FluentBooking\App\Hooks\Handlers\ActivationHandler;
7 use FluentBooking\App\Hooks\Handlers\DeactivationHandler;
8 use FluentBooking\Database\DBMigrator;
9
10 return function ($file) {
11
12 $app = new Application($file);
13
14 register_activation_hook($file, function () use ($app) {
15 ($app->make(ActivationHandler::class))->handle();
16 });
17
18 register_deactivation_hook($file, function () use ($app) {
19 ($app->make(DeactivationHandler::class))->handle();
20 });
21
22 require_once(FLUENT_BOOKING_DIR . 'boot/action_scheduler_loader.php');
23
24 add_action('plugins_loaded', function () use ($app) {
25 do_action('fluent_booking/loaded', $app);
26
27 $currentDBVersion = get_option('fluent_booking_db_version');
28 if (!$currentDBVersion || version_compare($currentDBVersion, FLUENT_BOOKING_DB_VERSION, '<')) {
29 update_option('fluent_booking_db_version', FLUENT_BOOKING_DB_VERSION, 'no');
30 DBMigrator::run();
31 }
32
33 if (defined('FLUENT_BOOKING_PRO_VERSION') && version_compare(FLUENT_BOOKING_MIN_PRO_VERSION, FLUENT_BOOKING_PRO_VERSION, '>')) {
34 if (!current_user_can('manage_options')) {
35 return;
36 }
37 add_filter('fluent_booking/dashboard_notices', function ($notices) {
38 $updateUrl = admin_url('plugins.php?s=fluent-booking&plugin_status=all&fluent-booking-pro-check-update=' . time());
39 $notices[] = '<div class="error">' . esc_html__('FluentBookingPro plugin needs to be updated to the latest version.', 'fluent-booking') . ' <a href="' . esc_url($updateUrl) . '">' . esc_html__('Click here to update', 'fluent-booking') . '</a></div>';
40 return $notices;
41 });
42 }
43 });
44 };
45