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

Closes #7187: Add filter to disable Homepage cache clearing in rocket_clean_post #7297

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

Miraeld
Copy link
Contributor

@Miraeld Miraeld commented Feb 10, 2025

Description

Fixes #7187
Adds a filter to disable clearing cache homepage following user suggestion

Type of change

  • Enhancement (non-breaking change which improves an existing functionality).

Detailed scenario

Refer to initial issue.

Technical description

Documentation

This pull request includes a small change to the inc/common/purge.php file. The change adds a conditional check before purging the homepage and its pagination.

  • inc/common/purge.php: Added a conditional check using wpm_apply_filters_typed to determine if the homepage and its pagination should be purged after cleaning a post.

New dependencies

None

Risks

None

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.

@Miraeld Miraeld added the type: enhancement Improvements that slightly enhance existing functionality and are fast to implement label Feb 10, 2025
@Miraeld Miraeld requested a review from a team February 10, 2025 01:45
@Miraeld Miraeld self-assigned this Feb 10, 2025
Copy link

codacy-production bot commented Feb 10, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 11744a11 100.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (11744a1) Report Missing Report Missing Report Missing
Head commit (494ccbe) 38792 17161 44.24%

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 (#7297) 2 2 100.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.

Copy link
Contributor

@wordpressfan wordpressfan left a comment

Choose a reason for hiding this comment

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

That's working perfectly just one very minor change, u can send it to QA directly after adjusting it, thanks @Miraeld

@MathieuLamiot
Copy link
Contributor

@Miraeld @wordpressfan Shouldn't we have a unit test for the case where the filter is set to false?
That would even allow to go NoQA I think

@Miraeld
Copy link
Contributor Author

Miraeld commented Feb 10, 2025

@MathieuLamiot Integrations tests have been added

@Miraeld Miraeld added the noQA label Feb 11, 2025
@Miraeld Miraeld added this pull request to the merge queue Feb 14, 2025
Merged via the queue into develop with commit a0ceecd Feb 14, 2025
14 checks passed
@Miraeld Miraeld deleted the enhancement/7187-add-filter-to-cache-homepage branch February 14, 2025 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noQA type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a filter to disable Homepage cache clearing
3 participants