activate(); delete_option( 'wpconsent_install' ); } // If not first install, that means before 1.0.3. if ( ! isset( $activated['version'] ) ) { $activated['version'] = '1.0.0'; } if ( isset( $activated['version'] ) && version_compare( $activated['version'], '1.0.5', '<' ) ) { $this->update_1_0_5(); } do_action( 'wpconsent_before_version_update', $activated ); // Re-fetch the option to preserve any changes made by upgrade hooks. $activated = get_option( 'wpconsent_activated', array() ); $activated['version'] = WPCONSENT_VERSION; update_option( 'wpconsent_activated', $activated ); } /** * Upgrade routine for version 1.0.5. * * @return void */ private function update_1_0_5() { // Clear the cache for script blocking. wpconsent()->file_cache->delete( 'script-blocking-data' ); } } new WPConsent_Install();