=' ) ) { return; } self::migrate( $stored ); update_option( self::OPTION, ACID_AEO_VERSION, false ); } /** * Re-creates the daily event when it is missing. * * @return void */ public static function ensure_daily_cron(): void { if ( false === wp_next_scheduled( self::DAILY_HOOK ) ) { wp_schedule_event( time() + self::CRON_DELAY, 'daily', self::DAILY_HOOK ); } } /** * The steps every upgrade takes, then the version-specific ones. * * The cache version is bumped too: an update can change how any generated * file renders, and the version stamp is the right moment to discard them. * * @param string $from The version the site ran before, or '' when unknown. * @return void */ private static function migrate( string $from ): void { self::ensure_daily_cron(); // Rewrite rules may have changed between versions; the flush itself // is deferred to the next `init` by `Plugin::maybe_flush_rewrites()`. update_option( 'acid_aeo_flush_needed', 1 ); // An update can change any generated body, so drop the cached ones. Cache::invalidate_all(); unset( $from ); // No version-specific step yet; 1.0.5 needs none. } }