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 #6657 Remove loading lazy attribute on images excluded from lazyload #6841

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

remyperona
Copy link
Contributor

Description

Closes #6657

Documentation

User documentation

Remove loading="lazy" attribute from images that are excluded from lazyload in WP Rocket (from UI, SaaS or filters).

Technical documentation

When an image is excluded, perform a preg_replace() to remove the attribute from the image element.

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 named variables and functions explicitely.
  • I protected entry points against unexpected inputs.
  • I did not introduce unecessary complexity.

@remyperona remyperona requested a review from a team August 5, 2024 13:40
@remyperona remyperona self-assigned this Aug 5, 2024
@remyperona remyperona added type: enhancement Improvements that slightly enhance existing functionality and are fast to implement module: lazyload images labels Aug 5, 2024
@remyperona remyperona added this to the 3.16.4 milestone Aug 5, 2024
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 961f7851 83.33% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (961f785) Report Missing Report Missing Report Missing
Head commit (20087d7) 37379 14579 39.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 (#6841) 6 5 83.33%

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.

@Khadreal
Copy link
Contributor

Khadreal commented Aug 6, 2024

Shouldn't we have a test for this ?

@remyperona
Copy link
Contributor Author

Test was added in the library with this PR: wp-media/rocket-lazyload-common#121

Copy link
Contributor

@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 is looking good.
Please find below Test Run Results. Thank you.
testrail-report-627.pdf

@remyperona remyperona added this pull request to the merge queue Aug 8, 2024
Merged via the queue into develop with commit 695a34c Aug 8, 2024
12 checks passed
@remyperona remyperona deleted the fix/6657-loading-attribute branch August 8, 2024 18:07
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.

Optimize Critical Images - loading="lazy" attribute should be removed for the critical images
3 participants