-
Notifications
You must be signed in to change notification settings - Fork 2
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
Press7 93 burst safety mode #41
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AleTorrisi pointed out a few minor things. Let’s also run the lint on all the files. Everything else looks good to me, thanks 😃
@@ -12,3 +12,5 @@ function ( $features ) { | |||
} | |||
|
|||
new PerformanceFeatureHooks(); | |||
|
|||
require_once __DIR__ . '/includes/BurstSafetyMode/init.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we planning to include this in the plugin's alternate experience instead of here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we'll have a code there too but it's needed have that in the module too because when the burst safety mode is disabled the alternate experience folder is not loaded but we need anyway include the init file of burst safety folder to restore cache settings
@@ -83,7 +83,7 @@ const SingleOption = ( { params, isChild, methods, constants } ) => { | |||
! NewfoldRuntime.sdk.performance | |||
.jetpack_boost_premium_is_active && ( | |||
<FeatureUpsell | |||
cardText="Upgrade to Unlock" | |||
cardText={constants.text.upgradeModule} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we run a WordPress scripts lint on this file?
if ( $newfold_burst_safety_mode === false ) { | ||
|
||
}else{ | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we remove the empty if-else
statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I forgot remove block
Proposed changes
At the moment, when the constant BURST_SAFETY_MODE is defined, all Newfold Labs modules stop working, thanks this code in main file inside brand plugin.
`if ( defined( 'BURST_SAFETY_MODE' ) && BURST_SAFETY_MODE ) {
}`
On admin side a static page is loaded if you try visit Bluehost Plugin dashboard.
The purpose of this branch is keep this behavior on the admin side, and force a strong cache on frontend side.
Once the module detects that BURST SAFETY MODE has been disabled, the htaccess file is restored according rules set on admin side, so cache level and Skip 404 option.
Type of Change
Production
Development
Video
REC-20241220131314.mp4
Checklist
Further comments
This branch, in order to work properly, requires a small change in the Brand plugin too, but the relative branch on that is not available at the moment.
You just need add this code at the end of the file at following path:
wp-content/plugins/bluehost-wordpress-plugin/inc/alt-experience/init.php
$bust_mode_path = dirname( __DIR__, 2 ) . '/vendor/newfold-labs/wp-module-performance/includes/BurstSafetyMode/init.php'; if ( file_exists( $bust_mode_path ) ) { require_once dirname( __DIR__, 2 ) . '/vendor/newfold-labs/wp-module-performance/includes/BurstSafetyMode/init.php'; }