Skip to content

Press7 93 burst safety mode#41

Merged
arunshenoy99 merged 7 commits intorelease/v2.3.0from
PRESS7-93-Burst-Safety-Mode
Jan 8, 2025
Merged

Press7 93 burst safety mode#41
arunshenoy99 merged 7 commits intorelease/v2.3.0from
PRESS7-93-Burst-Safety-Mode

Conversation

@AleTorrisi
Copy link
Copy Markdown
Contributor

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 ) {

// Load alternate experience
require __DIR__ . '/inc/alt-experience/init.php';

// Short-circuit all plugin functionality
return;

}`

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

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Video

REC-20241220131314.mp4

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

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'; }

Copy link
Copy Markdown
Member

@arunshenoy99 arunshenoy99 left a 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 😃

Copy link
Copy Markdown
Member

@arunshenoy99 arunshenoy99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, @AleTorrisi. Thanks! Let’s check why the linting is failing so that we can move this to QA? It says get_option is undefined in the burst safety mode init file.

Copy link
Copy Markdown
Member

@arunshenoy99 arunshenoy99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @AleTorrisi 😄

@arunshenoy99 arunshenoy99 changed the base branch from main to release/v2.3.0 January 8, 2025 07:36
Copy link
Copy Markdown
Member

@arunshenoy99 arunshenoy99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be tested along with: bluehost/bluehost-wordpress-plugin#1499

@arunshenoy99 arunshenoy99 merged commit adf2b78 into release/v2.3.0 Jan 8, 2025
@arunshenoy99 arunshenoy99 deleted the PRESS7-93-Burst-Safety-Mode branch January 8, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants