From cd3747492dc9013897fa12ea1a3ee1e8dcf24380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Tue, 29 Sep 2020 11:10:47 -0700 Subject: [PATCH] flush cache after upgrading --- includes/class-plugin.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/includes/class-plugin.php b/includes/class-plugin.php index 27b21042..ddfba7d2 100644 --- a/includes/class-plugin.php +++ b/includes/class-plugin.php @@ -80,6 +80,7 @@ private function __construct() { $this->screen = 'settings_page_redis-cache'; } + $this->run_migrations(); $this->add_actions_and_filters(); if ( is_admin() && ! wp_next_scheduled( 'rediscache_discard_metrics' ) ) { @@ -87,6 +88,18 @@ private function __construct() { } } + /** + * Run migrations + * + * @return void + */ + public function run_migrations() { + if ( ! get_option( 'roc_migrated_2_0_16' ) ) { + wp_flush_cache(); + update_option( 'roc_migrated_2_0_16', true, true ); + } + } + /** * Adds all necessary hooks *