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

Cache pagination pages properly #7089

Merged
merged 7 commits into from
Nov 6, 2024
Merged

Conversation

wordpressfan
Copy link
Contributor

@wordpressfan wordpressfan commented Nov 5, 2024

Description

Fixes #7088

Here we are fixing a regression from that PR: #6984

We now can cache pagination pages for terms (categories, tags, custom taxonomies like product_cat for woocommerce, ...etc.)

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Detailed scenario

To reproduce this issue, you need to visit a category page starting from the second page in pagination, before this PR, you will find it not cached.

http://example.org/category/uncategorized/page/2/

Technical description

Documentation

We check if we are in a paged page so compare the urls with page query variable to match properly.

New dependencies

No

Risks

Do u know if we have any query variable like paged one or not?

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

Copy link

codacy-production bot commented Nov 5, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for a9d955a1 75.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (a9d955a) Report Missing Report Missing Report Missing
Head commit (b926f70) 38116 16693 43.80%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7089) 4 3 75.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@wordpressfan wordpressfan marked this pull request as ready for review November 5, 2024 09:39
@wordpressfan wordpressfan requested a review from a team November 5, 2024 09:39
@MathieuLamiot
Copy link
Contributor

@wp-media/engineering-plugin-team QA feedback to tackle: https://wp-media.slack.com/archives/CUT7FLHF1/p1730802316824809?thread_ts=1730733341.053669&cid=CUT7FLHF1

@wordpressfan wordpressfan merged commit 4c31774 into trunk Nov 6, 2024
11 of 13 checks passed
@wordpressfan wordpressfan deleted the fix/7088-cache-pagination-pages branch November 6, 2024 07:12
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.

3.17.2 Blank page in paginated WooCommerce product category pages when WebP add-on is enabled
3 participants