PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.17
Yatra – Travel Booking & Tour Operator Software v3.0.17
3.0.17 3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 All 85 releases
yatra / app / Upgrades / Versions / Upgrade_3_0_17.php

Upgrade_3_0_17.php in Yatra – Travel Booking & Tour Operator Software 3.0.17, at app/Upgrades/Versions/Upgrade_3_0_17.php

48 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Yatra\Upgrades\Versions;
6
7 use Yatra\Services\ReviewReminderService;
8 use Yatra\Upgrades\AbstractUpgradeStep;
9
10 /**
11 * Free 3.0.17: drain review reminders queued against the old anchor.
12 *
13 * Until this release the review request was scheduled for "now + N days",
14 * measured from the moment a booking was marked completed. The daily
15 * auto-completion sweep can complete a long backlog of finished tours in a
16 * single run, so sites ended up with a queue of reminders for trips that had
17 * ended weeks or months earlier — all due to fire together.
18 *
19 * {@see ReviewReminderService} now anchors on the tour's end date and refuses
20 * anything older than its staleness cap, but those are decisions taken when the
21 * reminder is scheduled. Events already sitting in wp_cron carry no such rule,
22 * so upgrading alone would not spare the installs that are carrying one. This
23 * clears them once.
24 *
25 * The service also re-checks the window when an event actually fires, so a
26 * reminder queued between this step running and the upgrade completing is still
27 * declined rather than sent.
28 */
29 final class Upgrade_3_0_17 extends AbstractUpgradeStep
30 {
31 public static function targetVersion(): string
32 {
33 return '3.0.17';
34 }
35
36 public static function runOnHooks(): array
37 {
38 return ['admin_init'];
39 }
40
41 public static function run(string $fromVersion, string $toVersion): void
42 {
43 unset($fromVersion, $toVersion);
44
45 ReviewReminderService::purgeStaleScheduledReminders();
46 }
47 }
48