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

Fixes #5952 Prevent adding not public CPT posts to cache table #6722

Merged
merged 7 commits into from
Jun 20, 2024

Conversation

Khadreal
Copy link
Contributor

Description

Fixes #5952

Documentation

Added a check for post type before adding it to wpr_cache_table

User documentation

Explain how this code impacts users.

Technical documentation

Explain how this code works. Diagram & drawings are welcomed.

Type of change

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

New dependencies

List any new dependencies that are required for this change.

Risks

List possible performance & security issues or risks, and explain how they have been mitigated.

Checklists

Code style

  • I wrote self-explanatory code about what it does.
  • I named variables and functions explicitely.
  • I did not introduce unecessary complexity.

Copy link

codacy-production bot commented Jun 13, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for d0d3ce01 100.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d0d3ce0) Report Missing Report Missing Report Missing
Head commit (a302839) 37290 14481 38.83%

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 (#6722) 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


🚀 Don’t miss a bit, follow what’s new on Codacy.

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

@MathieuLamiot MathieuLamiot left a comment

Choose a reason for hiding this comment

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

We would need tests on the new bail-out.
Also, I asked on the issue if excluding private post types is expected or not. -> OK on this.

inc/common/purge.php Show resolved Hide resolved
@MathieuLamiot MathieuLamiot dismissed their stale review June 19, 2024 16:40

Ok for me now. I'll let the team review.

@MathieuLamiot MathieuLamiot requested review from a team and removed request for a team and MathieuLamiot June 19, 2024 17:36
@Tabrisrp Tabrisrp changed the title :closes Fixed wpcode entry into cache table Fixes #5952 Prevent adding not public CPT posts to cache table Jun 19, 2024
@Tabrisrp Tabrisrp added this to the 3.16.2 milestone Jun 19, 2024
@Tabrisrp Tabrisrp added 3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting module: preload type: bug Indicates an unexpected problem or unintended behavior labels Jun 19, 2024
@Khadreal Khadreal requested a review from Tabrisrp June 20, 2024 14:22
@MathieuLamiot
Copy link
Contributor

I reproduced the issue on my E2E website with develop, and not with this PR.
I get the same number of preload entries on this PR than on develop without code snippets, no errors and all are preloaded.

@MathieuLamiot MathieuLamiot added this pull request to the merge queue Jun 20, 2024
Merged via the queue into develop with commit 5b286ce Jun 20, 2024
13 checks passed
@MathieuLamiot MathieuLamiot deleted the fix/wpcode-url#5952 branch June 20, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting module: preload type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WPCode URLs added to cache table when we disable active snippet
3 participants