Skip to content

Commit 6f31d24

Browse files
authored
Release 2.8.6 (#1060)
* Bump version to 2.8.6 * Update deps * Update translations POT file * Update `@since` * Delete cached notices after flagging a new notice * Purge Object Cache files if disabled or the engine changed
1 parent 2fbbd80 commit 6f31d24

12 files changed

+369
-289
lines changed

Generic_AdminActions_Default.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,18 @@ private function _w3tc_save_options_process() {
332332
$data['response_errors'][] = 'fancy_permalinks_disabled_pgcache';
333333
}
334334

335+
/**
336+
* Check for Object Cache using Disk being disabled or changed to another engine.
337+
*
338+
* @since 2.8.6
339+
*/
340+
if (
341+
$this->_config->get_boolean( 'objectcache.enabled' ) && 'file' === $this->_config->get_string( 'objectcache.engine' ) &&
342+
( ! $config->get_boolean( 'objectcache.enabled' ) || 'file' !== $config->get_string( 'objectcache.engine' ) )
343+
) {
344+
Util_File::rmdir( Util_Environment::cache_blog_dir( 'object' ) );
345+
}
346+
335347
/**
336348
* Check for Image Service extension status changes.
337349
*/

Generic_Plugin.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,18 +835,24 @@ public function post_update_tasks(): void {
835835

836836
// Check if W3TC was updated to 2.8.6 or higher.
837837
if ( \version_compare( W3TC_VERSION, '2.8.6', '>=' ) && ! in_array( '2.8.6', $ran_versions, true ) ) {
838-
// Disable Object Cache if using Disk and show a notice in wp-admin.
838+
// Disable Object Cache if using Disk, purge the cache files, and show a notice in wp-admin.
839839
if ( $this->_config->get_boolean( 'objectcache.enabled' ) && 'file' === $this->_config->get_string( 'objectcache.engine' ) ) {
840840
$this->_config->set( 'objectcache.enabled', false );
841841
$this->_config->save();
842-
}
843842

844-
// Set the flag to show the notice.
845-
$state->set( 'tasks.notices.disabled_objdisk', true );
843+
// Purge the Object Cache files.
844+
Util_File::rmdir( Util_Environment::cache_blog_dir( 'object' ) );
845+
846+
// Set the flag to show the notice.
847+
$state->set( 'tasks.notices.disabled_objdisk', true );
848+
}
846849

847850
// Mark the task as ran.
848851
$ran_versions[] = '2.8.6';
849852
update_option( 'w3tc_post_update_tasks_ran_versions', $ran_versions, false );
853+
854+
// Delete cached notices.
855+
delete_option( 'w3tc_cached_notices' );
850856
}
851857

852858
// Mark the task runner as ran for the current version.

ObjectCache_DiskPopup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/**
22
* File: ObjectCache_DiskPopup.js
33
*
4-
* @since X.X.X
4+
* @since 2.8.6
55
*
66
* @package W3TC
77
*/
88

99
/**
1010
* Modal for object cache disk usage risk acceptance.
1111
*
12-
* @since X.X.X
12+
* @since 2.8.6
1313
*
1414
* @return void
1515
*/

ObjectCache_DiskPopup_View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* File: ObjectCache_DiskPopup_View.php
44
*
5-
* @since X.X.X
5+
* @since 2.8.6
66
*
77
* @package W3TC
88
*/

ObjectCache_Plugin_Admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function w3tc_usage_statistics_summary_from_history( $summary, $history )
131131
/**
132132
* Enqueue disk usage risk acceptance script.
133133
*
134-
* @since X.X.X
134+
* @since 2.8.6
135135
*
136136
* @return void
137137
*/
@@ -151,7 +151,7 @@ public function admin_enqueue_scripts() {
151151
/**
152152
* Popup modal for Object Cache disk usage risk acceptance.
153153
*
154-
* @since X.X.X
154+
* @since 2.8.6
155155
*
156156
* @return void
157157
*/

composer.lock

Lines changed: 40 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)