# give/4.18.0/src/Campaigns/Migrations/FlushCampaignsDataCache.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.18.0. 51 lines.

- Page: https://pluginprobe.com/plugins/give/4.18.0/code/src/Campaigns/Migrations/FlushCampaignsDataCache.php
- Raw: https://pluginprobe.com/plugins/give/4.18.0/raw/src/Campaigns/Migrations/FlushCampaignsDataCache.php
- Modified: 2026-10-01T20:29:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.18.0/code/src/Campaigns/Migrations/FlushCampaignsDataCache.php#L10-L20`.

```php
<?php

namespace Give\Campaigns\Migrations;

use Give\Framework\Migrations\Contracts\Migration;

/**
 * Drops the campaign stats cache so it is rebuilt from scratch. Before this migration the
 * subscriptions cache was written under one option name and read under another, and the
 * rebuild migration merged donation rows into it, so what is stored cannot be trusted.
 * The repository repopulates the cache on demand.
 *
 * @since 4.18.0
 */
class FlushCampaignsDataCache extends Migration
{
    /**
     * @since 4.18.0
     */
    public static function id(): string
    {
        return 'flush_campaigns_data_cache';
    }

    /**
     * @since 4.18.0
     */
    public static function title(): string
    {
        return 'Flush campaign stats cache';
    }

    /**
     * @since 4.18.0
     */
    public static function timestamp(): string
    {
        return strtotime('2026-09-21 00:00:00');
    }

    /**
     * @since 4.18.0
     */
    public function run()
    {
        delete_option('give_campaigns_data');
        delete_option('give_campaigns_subscriptions_data');
        delete_option('give_campaigns_subscription_data');
    }
}

```
