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

Boost: Fix removing WP_CACHE when advanced cache wasn't deleted #38033

Conversation

dilirity
Copy link
Member

Boost should only clean up after itself it it's the last thing that
enabled caching. If it cleans up, it might accidentally break caching
for other plugins.

Fixes #38032

Proposed changes:

  • Prevent Boost from breaking caching for other plugins;
  • Add comment cleanup for WP_CACHE constant in wp-config.php (didn't break anything, it just seems odd having a boost related comment when boost might not even be present on a site).

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

n/a

Does this pull request change what data or activity we track or use?

no

Testing instructions:

Test that deactivating Boost doesn't remove WP_CACHE from wp-config.php when it wasn't the last time that had cache enabled

  1. Setup WP Super Cache and enable easy caching;
  2. Setup Boost plugin and enable caching;
  3. Check wp-config.php to make sure the WP_CACHE declaration got moved to the top of the file and there's a comment behind it (// Boost Cache Plugin);
  4. Activate WP Super Cache (as it got deactivated in step 2);
  5. Keep Boost plugin active, but disable caching;
  6. Enable WP Super Cache caching;
  7. Deactivate Boost plugin but don't visit WP Super Cache's settings (it will muddy the test, as it automatically adds constants to wp-config.php);
  8. Check wp-config.php to make sure that WP_CACHE did not get removed (the comment from step 3 should be removed).

Boost should only clean up after itself it it's the last thing that
enabled caching. If it cleans up, it might accidentally break caching
for other plugins.
@dilirity dilirity added [Plugin] Boost A feature to speed up the site and improve performance. [Boost Feature] Page Cache labels Jun 25, 2024
@dilirity dilirity requested a review from a team June 25, 2024 13:53
@dilirity dilirity self-assigned this Jun 25, 2024
Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Boost plugin:

  • Next scheduled release: July 2, 2024.
  • Scheduled code freeze: June 24, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@donnchawp donnchawp enabled auto-merge (squash) June 25, 2024 14:46
Copy link
Contributor

@donnchawp donnchawp left a comment

Choose a reason for hiding this comment

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

Works as expected! Thanks!

@donnchawp donnchawp merged commit 404b7c0 into trunk Jun 25, 2024
61 of 62 checks passed
@donnchawp donnchawp deleted the fix/boost/prevent-wp-cache-removal-if-advanced-cache-not-removed branch June 25, 2024 14:46
@dilirity
Copy link
Member Author

No cherry pick necessary. We ended up cutting a new release from trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Boost Feature] Page Cache [Plugin] Boost A feature to speed up the site and improve performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Boost: Deactivating Boost sometimes breaks WP Super Cache's caching
2 participants