PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.5
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.5
2.4.5 2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 All 69 releases
← All changes | boot/app.php +12 -12 2.3.0 → 2.4.5 View file →
@@ -20,13 +20,9 @@
20 20
21 21 add_action('plugins_loaded', function () use ($file) {
22 22 $application = new Application($file);
23 23
24 - $currentDbVersion = get_option('fluent_support_db_version');
25 - if (!$currentDbVersion || version_compare($currentDbVersion, FLUENT_SUPPORT_DB_VERSION, '<')) {
26 - \FluentSupport\Database\DBMigrator::run();
27 - update_option('fluent_support_db_version', FLUENT_SUPPORT_DB_VERSION, 'no');
28 - }
24 + \FluentSupport\Database\DBMigrator::maybeMigrateDBChanges();
29 25
30 26 do_action('fluent_support_loaded', $application);
31 27 do_action('fluent_support_addons_loaded', $application);
32 28
@@ -59,16 +55,20 @@
59 55 $wpdb->query("UPDATE `{$table}` SET `serial_number` = `id` WHERE `serial_number` IS NULL");
60 56 }
61 57 }
62 58
63 - /*
64 - * The below schedule is powered by Action Scheduler by WooCommerce
65 - * It will run every 30 minutes.
66 - */
67 - if (false === as_next_scheduled_action('fluent_support_half_hourly')) {
68 - as_schedule_recurring_action(time(), 1800, 'fluent_support_half_hourly', [], 'fluent-support', true);
59 + // Half-hourly Action Scheduler job. Only schedule it while something
60 + // listens (currently only Pro), otherwise it fires with no callback.
61 + $hasListener = has_action('fluent_support_half_hourly');
62 + $nextRun = as_next_scheduled_action('fluent_support_half_hourly', [], 'fluent-support');
63 +
64 + if ($hasListener) {
65 + if (false === $nextRun) {
66 + as_schedule_recurring_action(time(), 1800, 'fluent_support_half_hourly', [], 'fluent-support', true);
67 + }
68 + } elseif (false !== $nextRun) {
69 + as_unschedule_all_actions('fluent_support_half_hourly', [], 'fluent-support');
69 70 }
70 -
71 71 });
72 72
73 73 });
74 74 };