PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 All 257 releases
give / src / Campaigns / Migrations / FlushCampaignsDataCache.php

FlushCampaignsDataCache.php in GiveWP – Donation Plugin and Fundraising Platform 4.18.0, at src/Campaigns/Migrations/FlushCampaignsDataCache.php

51 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\Campaigns\Migrations;
4
5 use Give\Framework\Migrations\Contracts\Migration;
6
7 /**
8 * Drops the campaign stats cache so it is rebuilt from scratch. Before this migration the
9 * subscriptions cache was written under one option name and read under another, and the
10 * rebuild migration merged donation rows into it, so what is stored cannot be trusted.
11 * The repository repopulates the cache on demand.
12 *
13 * @since 4.18.0
14 */
15 class FlushCampaignsDataCache extends Migration
16 {
17 /**
18 * @since 4.18.0
19 */
20 public static function id(): string
21 {
22 return 'flush_campaigns_data_cache';
23 }
24
25 /**
26 * @since 4.18.0
27 */
28 public static function title(): string
29 {
30 return 'Flush campaign stats cache';
31 }
32
33 /**
34 * @since 4.18.0
35 */
36 public static function timestamp(): string
37 {
38 return strtotime('2026-09-21 00:00:00');
39 }
40
41 /**
42 * @since 4.18.0
43 */
44 public function run()
45 {
46 delete_option('give_campaigns_data');
47 delete_option('give_campaigns_subscriptions_data');
48 delete_option('give_campaigns_subscription_data');
49 }
50 }
51