Skip to content

Conversation

@lusimeon
Copy link
Contributor

Hi @studiometa/wordpress

Presently, all assets version are removed on load (to prevent plugin version to be public) so we lost the pros of browser cache invalidation.

Theme assets versions are tracked depends on file content hash, so it is not a security breach to keep theirs versions public.

This PR, check if asset is loaded from theme and keep version instead of removing it.

@lusimeon lusimeon requested a review from a team March 15, 2021 16:24
Copy link
Contributor

@titouanmathis titouanmathis left a comment

Choose a reason for hiding this comment

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

👍

@lusimeon lusimeon force-pushed the bugfix/keep-theme-assets-version branch from f400e58 to 18cca46 Compare March 18, 2021 17:54
@codecov
Copy link

codecov bot commented Mar 18, 2021

Codecov Report

Merging #12 (30a922c) into develop (48dc6c9) will increase coverage by 4.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop      #12      +/-   ##
=============================================
+ Coverage      39.24%   43.31%   +4.06%     
- Complexity       131      132       +1     
=============================================
  Files              6        6              
  Lines            344      344              
=============================================
+ Hits             135      149      +14     
+ Misses           209      195      -14     
Flag Coverage Δ Complexity Δ
unittests 43.31% <100.00%> (+4.06%) 0.00 <0.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
src/Cleanup.php 29.78% <100.00%> (+29.78%) 11.00 <0.00> (+1.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48dc6c9...30a922c. Read the comment docs.

@lusimeon lusimeon force-pushed the bugfix/keep-theme-assets-version branch 2 times, most recently from d88f29f to ecaf73a Compare April 7, 2021 18:33
Theme assets are versionned depends on file content hash, so it is not a security breach to keep version public
@lusimeon lusimeon force-pushed the bugfix/keep-theme-assets-version branch from ecaf73a to 30a922c Compare April 7, 2021 18:42
@lusimeon lusimeon merged commit 6ee493a into develop Apr 7, 2021
@titouanmathis titouanmathis deleted the bugfix/keep-theme-assets-version branch July 14, 2021 20:54
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 participants