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 #5723 Add a filter to enable/disable the noscript tag of lazyloaded images #6824

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

Tabrisrp
Copy link
Contributor

@Tabrisrp Tabrisrp commented Jul 29, 2024

Description

Closes #5723

Also includes changes to pass PHPStan level 9.

Documentation

User documentation

Add a new filter rocket_lazyload_noscript with a boolean value, that can be used to enable/disable the noscript tag added to lazyloaded images.

Technical documentation

Add a new method noscriptEnabled(), and use it in the lazyloadImages and lazyloadPictures methods.

Type of change

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

Checklists

Feature validation

  • I validated all the Acceptance Criteria. If possible, provide sreenshots 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.

Documentation

  • I prepared the user documentation for the feature/enhancement and shared it in the PR or the GitHub issue.
  • The user documentation covers new/changed entry points (endpoints, WP hooks, configuration files, ...).
  • I prepared the technical documentation if needed, and shared it in the PR or the GitHub issue.

Code style

  • I wrote self-explanatory code about what it does.
  • I wrote comments to explain why it does it.
  • I named variables and functions explicitely.
  • I protected entry points against unexpected inputs.
  • I did not introduce unecessary complexity.

@Tabrisrp Tabrisrp added type: enhancement Improvements that slightly enhance existing functionality and are fast to implement module: lazyload images labels Jul 29, 2024
@Tabrisrp Tabrisrp added this to the 3.16.4 milestone Jul 29, 2024
@Tabrisrp Tabrisrp requested a review from a team July 29, 2024 13:49
@Tabrisrp Tabrisrp self-assigned this Jul 29, 2024
Copy link

codacy-production bot commented Jul 29, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -0.10%) 47.62% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (9fe189b) 37343 14541 38.94%
Head commit (86f3f96) 37369 (+26) 14552 (+11) 38.94% (+0.00%)

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 (#6824) 42 20 47.62%

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

Copy link

@hanna-meda hanna-meda left a comment

Choose a reason for hiding this comment

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

This looks good. Explored also with js disabled in browser and update/rolllback with/without LL enabled and/or filter active.
Relating TP results:
testrail-report-625.pdf

@Tabrisrp Tabrisrp added this pull request to the merge queue Aug 1, 2024
Merged via the queue into develop with commit 7b624f5 Aug 1, 2024
13 of 14 checks passed
@Tabrisrp Tabrisrp deleted the enhancement/5723-noscript-filter branch August 1, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: lazyload images 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.

remove <noscript> tag automatically generated for each image
2 participants