Skip to content

Commit

Permalink
Merge pull request #718 from bluehost/update/remove-file-caching
Browse files Browse the repository at this point in the history
Remove file-based caching
  • Loading branch information
circlecube authored Oct 10, 2023
2 parents 6715337 + 0006357 commit a70888e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
if ( 'local' === wp_get_environment_type() ) {
wp_die( esc_html( __( 'Please install the Bluehost Plugin dependencies.', 'wp-plugin-bluehost' ) ) );
}

return;
}

Expand Down Expand Up @@ -72,15 +73,15 @@ function bluehost_is_jarvis() {
*/
$bluehost_module_container = new Container(
array(
'cache_types' => array( 'browser', 'file', 'skip404' ),
'cache_types' => array( 'browser', 'skip404' ),
)
);

// Set plugin to container
$bluehost_module_container->set(
'plugin',
$bluehost_module_container->service(
function() {
function () {
return new Plugin(
array(
'id' => 'bluehost',
Expand Down Expand Up @@ -166,7 +167,7 @@ function () {
'2x' => 'https://cdn.hiive.space/marketplace/vendors-assets/bluehost-banner.svg',
'1x' => 'https://cdn.hiive.space/marketplace/vendors-assets/bluehost-banner.svg',
],
'icons' => [
'icons' => [
'2x' => 'https://cdn.hiive.space/marketplace/vendors-assets/bluehost-icon.svg',
'1x' => 'https://cdn.hiive.space/marketplace/vendors-assets/bluehost-icon.svg',
],
Expand All @@ -178,9 +179,9 @@ function () {

// Handle plugin upgrades
$upgrade_handler = new UpgradeHandler(
BLUEHOST_PLUGIN_DIR . '/inc/upgrades', // Directory where upgrade routines live
BLUEHOST_PLUGIN_DIR . '/inc/upgrades', // Directory where upgrade routines live
get_option( 'bluehost_plugin_version', '0.1.0' ), // Old plugin version (from database)
BLUEHOST_PLUGIN_VERSION // New plugin version (from code)
BLUEHOST_PLUGIN_VERSION // New plugin version (from code)
);

// Returns true if the old version doesn't match the new version
Expand Down
10 changes: 10 additions & 0 deletions inc/upgrades/3.3.3.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

use NewfoldLabs\WP\Module\Performance\CachePurgingService;
use NewfoldLabs\WP\Module\Performance\CacheTypes\File;

// Remove the file-based caching rules from the .htaccess file
File::removeRules();

// Purge the file-based cache
( new CachePurgingService( [ new File() ] ) )->purgeAll();

0 comments on commit a70888e

Please sign in to comment.