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

Disable Divi caching #5597

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Disable Divi caching #5597

wants to merge 5 commits into from

Conversation

kat3samsin
Copy link

@kat3samsin kat3samsin commented May 20, 2024

Description

Added disabling of Divi Caching by default. VIP already supports page and object caching Divi Caching can cause bloated media directory.
Docs

Changelog Description

Disables Divi plugin caching

Added disabling of Divi Caching by default.

Pre-review checklist

Please make sure the items below have been covered before requesting a review:

  • This change works and has been tested locally or in Codespaces (or has an appropriate fallback).
  • This change works and has been tested on a sandbox.
  • This change has relevant unit tests (if applicable).
  • This change uses a rollout method to ease with deployment (if applicable - especially for large scale actions that require writes).
  • This change has relevant documentation additions / updates (if applicable).
  • I've created a changelog description that aligns with the provided examples.

Pre-deploy checklist

  • VIP staff: Ensure any alerts added/updated conform to internal standards (see internal documentation).

Steps to Test

Copy link

codecov bot commented May 20, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 29.58%. Comparing base (99a7221) to head (41c9bd7).

Files Patch % Lines
plugin-fixes.php 82.35% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #5597      +/-   ##
=============================================
+ Coverage      29.52%   29.58%   +0.06%     
  Complexity      4780     4780              
=============================================
  Files            282      282              
  Lines          20577    20582       +5     
=============================================
+ Hits            6076     6090      +14     
+ Misses         14501    14492       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@WPprodigy WPprodigy left a comment

Choose a reason for hiding this comment

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

  1. We should prevent a slew of php warnings for customer's currently defining these. So like:
if ( ! defined( 'ET_DISABLE_FILE_BASED_CACHE' ) ) {
	define( 'ET_DISABLE_FILE_BASED_CACHE', true );
}
  1. Should we also be including the rest of the logic mentioned here (with additional safeguards to not register and constant that is already set): https://docs.wpvip.com/plugins/incompatibilities/#divi ?

  2. Lastly, let's try to limit the scope of the code to only running when we're sure it is needed - i.e. Divi is present on the site. So wrapping all of the logic inside of something like if defined( 'ET_CORE_VERSION' ) { ... }. Load order will be important though, might have to hook it all onto after_setup_theme for example.

@kat3samsin kat3samsin marked this pull request as ready for review May 22, 2024 12:57
@kat3samsin kat3samsin requested a review from a team as a code owner May 22, 2024 12:57
@kat3samsin
Copy link
Author

Thanks for the detailed feedback @WPprodigy! I've applied changes in e7d167b

@kat3samsin kat3samsin requested a review from WPprodigy May 22, 2024 12:59
Copy link

sonarcloud bot commented May 22, 2024

Quality Gate Passed Quality Gate passed

Issues
6 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@rinatkhaziev
Copy link
Contributor

@kat3samsin thanks!

I'm not entirely sure how Divi caching works, is it appropriate for it to use VIP filesystem at all?

@kat3samsin
Copy link
Author

kat3samsin commented Jun 15, 2024

@rinatkhaziev thanks for looking.

I'm not entirely sure how Divi caching works, is it appropriate for it to use VIP filesystem at all?

From what I understand, the dynamic loading (dynamic css) feature of Divi is trying to write in wp_content which is not allow on VIP FS. This PR disables the dynamic loading feature if the plugin is installed so that customers would not need to manually apply the instructions from the docs.

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.

None yet

3 participants