Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove file-based caching #718

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
Loading