Skip to content

Super Cache: Fix deprecation notices#32453

Merged
haqadn merged 4 commits into
trunkfrom
fix/supercache-notices
Aug 14, 2023
Merged

Super Cache: Fix deprecation notices#32453
haqadn merged 4 commits into
trunkfrom
fix/supercache-notices

Conversation

@haqadn
Copy link
Copy Markdown
Contributor

@haqadn haqadn commented Aug 14, 2023

Fixes #32336

Proposed changes:

  • Ensure $wp_cache_request_uri is always set to a string.

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

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

Testing instructions:

None

@haqadn haqadn requested a review from a team August 14, 2023 10:41
@haqadn haqadn self-assigned this Aug 14, 2023
@haqadn haqadn added the [Status] Needs Team Review Obsolete. Use Needs Review instead. label Aug 14, 2023
@github-actions github-actions Bot added the [Plugin] Super Cache A fast caching plugin for WordPress. label Aug 14, 2023
@github-actions
Copy link
Copy Markdown
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.
  • ✅ All commits were linted before commit.
  • ✅ 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 (other than "Required review") 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.


Super Cache plugin:

  • Next scheduled release: September 5, 2023.
  • Scheduled code freeze: August 28, 2023.

Copy link
Copy Markdown
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.

I confirmed that $_SERVER['REQUEST_URI'] is NULL in a script run from the command line, so that is likely where the null value is coming from.

I saw in get_wp_cache_key in wp-cache-phase2.php (around line 40) that we fixed the same problem by checking for null. I think we can probably remove that check now with this fix.

@haqadn haqadn requested a review from donnchawp August 14, 2023 11:53
Copy link
Copy Markdown
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.

Looks great. I checked where $wp_cache_request_uri is used and it's good.

@haqadn haqadn enabled auto-merge (squash) August 14, 2023 12:00
@haqadn haqadn merged commit f4cfefb into trunk Aug 14, 2023
@haqadn haqadn deleted the fix/supercache-notices branch August 14, 2023 12:00
@github-actions github-actions Bot added this to the super-cache/1.9.5 milestone Aug 14, 2023
@github-actions github-actions Bot removed the [Status] Needs Team Review Obsolete. Use Needs Review instead. label Aug 14, 2023
donnchawp pushed a commit that referenced this pull request Aug 16, 2023
* Fix deprication notices

* changelog

* Remove redundant code for PHP notice fix, as the previous commit addresses it
@donnchawp
Copy link
Copy Markdown
Contributor

deb8585

@A-Printer
Copy link
Copy Markdown

@donnchawp The removal of the if ( null === $url ) check causes a Deprecated notice to be thrown on the frontend when logged as an admin:

Capture d’écran 2023-08-18 à 13 26 52

Also, the Deprecated notice causes the REST API check to fail on the Site Health page:

Capture d’écran 2023-08-18 à 11 56 20

@donnchawp
Copy link
Copy Markdown
Contributor

Fixed in #32629

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Super Cache A fast caching plugin for WordPress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Super Cache] More PHP 8 warnings

3 participants