{"id":20019340,"url":"https://github.com/wp-media/rocket-lazy-load","last_synced_at":"2025-04-14T22:41:47.797Z","repository":{"id":16160677,"uuid":"79261620","full_name":"wp-media/rocket-lazy-load","owner":"wp-media","description":"Standalone LazyLoad plugin for WordPress (based on WP Rocket)","archived":false,"fork":false,"pushed_at":"2024-07-11T14:19:10.000Z","size":2099,"stargazers_count":24,"open_issues_count":30,"forks_count":14,"subscribers_count":21,"default_branch":"develop","last_synced_at":"2025-04-08T14:05:13.659Z","etag":null,"topics":["lazy-load","lazy-loading","lazyload","lazyload-images","lazyloading"],"latest_commit_sha":null,"homepage":"https://wordpress.org/plugins/rocket-lazy-load/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wp-media.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-17T19:08:04.000Z","updated_at":"2024-08-08T17:15:59.000Z","dependencies_parsed_at":"2024-11-13T09:34:44.356Z","dependency_job_id":null,"html_url":"https://github.com/wp-media/rocket-lazy-load","commit_stats":{"total_commits":299,"total_committers":8,"mean_commits":37.375,"dds":"0.17391304347826086","last_synced_commit":"46c5e782a5e5ebb934f91e82f00a097a0b6919e4"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-media%2Frocket-lazy-load","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-media%2Frocket-lazy-load/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-media%2Frocket-lazy-load/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-media%2Frocket-lazy-load/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-media","download_url":"https://codeload.github.com/wp-media/rocket-lazy-load/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975329,"owners_count":21192197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lazy-load","lazy-loading","lazyload","lazyload-images","lazyloading"],"created_at":"2024-11-13T08:27:10.692Z","updated_at":"2025-04-14T22:41:47.780Z","avatar_url":"https://github.com/wp-media.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LazyLoad Plugin – Lazy Load Images, Videos, and Iframes\n\nThe best free lazy load plugin for WordPress. Lazy load images, videos, and iframes to improve performance and Core Web Vitals scores.\n[Download the plugin on wordpress.org](https://wordpress.org/plugins/rocket-lazy-load/).\n\n## Description\n\nLazyLoad is the best free lazy load plugin for WordPress to lazy load images, videos, and iframes on WordPress. In a nutshell, LazyLoad displays images, videos, and iframes on a page only when they are visible to the user – that’s one crucial way to [speed up your WordPress site](https://wp-rocket.me/blog/guide-to-page-speed-optimization-for-wordpress/) and [optimize images for Google PageSpeed](https://imagify.io/blog/optimize-images-page-speed-google/#lazy-loading).\n\nYou can lazy load images in post content or widget text, plus thumbnails, avatars, and smilies. LazyLoad takes care of iframe lazy load, too: you’ll easily replace Youtube iframes with a preview thumbnail to further speed up the loading time of your website.\n\nNo JavaScript library such as jQuery is used, and the script weight is less than 10KB.\n\n## Why is lazy loading crucial for performance?\n\nLazy loading is a key performance technique to make your site faster. You’ll reduce loading time, [improve your Lighthouse performance score](https://wp-rocket.me/lighthouse-performance-score-wordpress/) and [optimize your Core Web Vitals grades](https://wp-rocket.me/google-core-web-vitals-wordpress/).\n\n[Lazy loading your images on WordPress](https://wp-rocket.me/blog/lazy-loading-wordpress-5-5/) will help you achieve a better PageSpeed Insights score for three main reasons:\n\n* You’ll address a specific PageSpeed Insights recommendation: [Defer offscreen images](https://wp-rocket.me/google-core-web-vitals-wordpress/defer-offscreen-images/, which means image lazy loading.\n* You’ll improve the performance of two key metrics: [First Input Delay](https://wp-rocket.me/google-core-web-vitals-wordpress/improve-first-input-delay/) (Core Web Vital) and [Total Blocking Time](https://wp-rocket.me/lighthouse-performance-score-wordpress/reduce-total-blocking-time/) (Lighthouse metric).\n* You’ll [make fewer HTTP requests](https://wp-rocket.me/blog/reduce-http-requests-speed-wordpress-site/) – that is another way to boost your site speed and [improve the Largest Contentful Paint score](https://wp-rocket.me/google-core-web-vitals-wordpress/improve-largest-contentful-paint/) (another Core Web Vital).\n\nTake a look at our complete list of reasons [why you should use lazy loading](https://wp-rocket.me/blog/lazyloading/#section-2). Then, turn on LazyLoad and make your WordPress website faster!\n\n\n## How to build the plugin\n\nIn order to build the plugin you need have composer installed.\n\nOnce it is the case you can follow these steps:\n- Download the zip from the plugin and unzip in a folder.\n- Move inside that folder and run the command `composer i` to install the full plugin and let the script installing protected dependencies run.\n- Run the command `composer i --no-dev --no-scripts -o` to install a production version from dependencies.\n- Zip back the folder and you have a working version from the plugin.\n\n## Dependencies\n\nLazyLoad script: [https://github.com/verlok/lazyload](https://github.com/verlok/lazyload)\n\n== Installation ==\n\n1. Upload the complete `rocket-lazy-load` folder to the `/wp-content/plugins/` directory\n2. Activate the plugin through the 'Plugins' menu in WordPress\n\n## Frequently Asked Questions\n\n### How can I use native lazyload?\nTo use native lazyload on browsers supporting this feature, you need to use the following line:\n\n`add_filter( 'rocket_use_native_lazyload', '__return_true' );`\n\nBrowsers that do not support native lazyload will use the JS-based solution as before.\n\n### How can I deactivate Lazy Load on some pages?\n\nYou can use the `do_rocket_lazyload` filter.\n\nHere is an example to put in functions.php files that disable lazyload on posts:\n\n`\nadd_action( 'wp', 'deactivate_rocket_lazyload_on_single' );\nfunction deactivate_rocket_lazyload_on_single() {\nif ( is_single() ) {\nadd_filter( 'do_rocket_lazyload', '__return_false' );\n}\n}\n`\n\n###  How can I deactivate Lazy Load on some images?\n\nSimply add a `data-no-lazy=\"1\"` property in you `img` or `iframe` tag.\n\nYou can also use the filters `rocket_lazyload_excluded_attributes` or `rocket_lazyload_excluded_src` to exclude specific patterns.\n\nFor iframes, the filter is `rocket_lazyload_iframe_excluded_patterns`.\n\n### How can I change the threshold to trigger the load?\n\nYou can use the `rocket_lazyload_threshold` filter.\n\nCode sample:\n\n`\nfunction rocket_lazyload_custom_threshold( $threshold ) {\nreturn 100;\n}\nadd_filter( 'rocket_lazyload_threshold', 'rocket_lazyload_custom_threshold' );\n`\n\n### I use plugin X and my images don't show anymore\n\nSome plugins are not compatible without lazy loading. Please open a support thread, and we will see how we can solve the issue by excluding lazy loading for this plugin.\n\n### How can I lazy load a background-image?\n\nThe plugin will automatically lazy load background-images set with a `style` attribute to a `div` element:\n\n`\u003cdiv style=\"background-image: url(image.jpg);\"\u003e`\n\nYou can also apply it manually. The element you want to apply lazy load on must have this specific markup:\n\n`\u003cdiv class=\"rocket-lazyload\" data-bg=\"url(../img/image.jpg)\"\u003e\u003c/div\u003e`\n\nThe element must have the class `rocket-lazyload`, and a `data-bg` attribute, which value is the CSS url for the image.\n\n### Where do I report security bugs found in this plugin?\n\nYou can report any security bugs found in the source code of the site-reviews plugin through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/rocket-lazy-load). The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin.\n\n### Related Plugins\n\n* [Imagify: The Best image optimizer](https://imagify.io/?utm_source=wordpress.org\u0026utm_medium=referral\u0026utm_campaign=LazyLoadPlugin) to speed up your website with lighter images.\n* [WP Rocket: Best performance plugin](https://wp-rocket.me/?utm_source=wordpress.org\u0026utm_medium=referral\u0026utm_campaign=LazyLoadPlugin) to speed up your WordPress website.\n* [Heartbeat Control by WP Rocket](https://wordpress.org/plugins/heartbeat-control/): Heartbeat Control by WP Rocket: The best plugin to control the WordPress Heartbeat API and reduce CPU usage.\n* [RocketCDN: The best CDN plugin for WordPress](https://rocketcdn.me/wordpress/) to propel your content at the speed of light – no matter where your users are located in the world.\n* [Increase Max upload file size](https://wordpress.org/plugins/upload-max-file-size/) is the best plugin to increase the upload file size limit to any value with one click.\n\n## Changelog\n= 2.3.9 =\nUpdated version to fix a mismatch between the tag of the release on Github and the release version which leads to a deployment issue that.\n\n= 2.3.8 =\nEnhancement: Launchpad compatibility (see https://github.com/wp-launchpad)\nEnhancement: Raised compatibility with PHP \u003e 7.3\nBug: Removed `wp-media/rocket-lazyload-common` from vendors\nEnhancement: Raised `wp-media/rocket-lazyload-common` to 3.0\n\n= 2.3.7 =\nBugfix: Removed `rocket_lazyload_polyfill` filter due to a vulnerability on polyfill\n\n= 2.3.5 =\nEnhancement: Test the plugin with latest version of WordPress v5.9.3\nEnhancement: Change WP readme content.\n\n= 2.3.4 =\nEnhancement: Allow `\u003ca\u003e` tags to lazyload background images\nEnhancement: Add \u003cnoscript\u003e tag to lazyloaded picture elements\nBugfix: Prevent a Fatal error related to the League Container package conflict with WooCommerce 4.4\nBugfix: Update lazyload for background images support for new version of lazyload script\nBugfix: Correctly apply the rocket-lazyload class on elements with a background-image and an empty class value\nBugfix: Correctly apply the rocket-lazyloadclass on elements with malformed HTML\nBugfix: Prevent a display issue with background-images when using different types of quotes around the URL\nBugfix: Prevent Layout from breaking when \u003cimg\u003e alt attribute has any html encoded characters\n\n= 2.3.3 =\nEnhancement: Add data-skip-lazy and skip-lazy class to exclusions list as part of the interoperability initiative between lazyload plugins\nEnhancement: Use native lazyload only if filter `rocket_use_native_lazyload` is true\nEnhancement: Apply lazyload on background images set on `figure` elements\nBugfix: Correctly add the rocket-lazyload class when class attribute is empty on an element with a background image\nBugfix: Correctly replace YouTube iframe with preview image when using relative protocol\nBugfix: Preserve youtube-nocookie.com during LazyLoad\n\n= 2.3.2 =\nBugfix: Incorrect characters used in Youtube thumbnail HTML code\n\n= 2.3.1 =\nBugfix: Prevent a conflict with WP Rocket\nBugfix: apply loading=\"lazy\" on Youtube thumbnail\nBugfix: Add autoplay attribute on iframe loaded with Youtube thumbnail\n\n= 2.3 =\nEnhancement: Add support for browser native lazyload\nBugfix: Prevent broken image in some cases for picture element\nBugfix: Prevent wrong lazy attributes for srcset and sizes on an image inside a picture element\n\n= 2.2.3 =\n* Enhancement: Improve compatibility for the picture element\n* Enhancement: Apply lazyload on background images set on section, span and li elements\n* Enhancement: also pass $width and $height values to the rocket_lazyload_placeholder filter\n* Bugfix: Use 0 instead of 1 for the default placeholder dimensions to improve compatibility\n* Bugfix: Improve infinite scroll support\n* Bugfix: Exclude Enfold avia-background-fixed background images and data-large_image from lazyload\n\n= 2.2.2 =\n* Bugfix: Auto-exclude data-height-percentage attribute to prevent display issues\n* Bugfix: Correctly handle responsive videos using fitVids again\n\n= 2.2.1 =\n* Enhancement: add a way to customize the lazyload script options\n* Bugfix: Prevent error on Internet Explorer 11\n* Bugfix: Prevent conflict with WooCommerce variation swatches\n* Bugfix: Prevent empty `src` when the image is an inline base64\n* Bugfix: Prevent issue when the original `src` attribute uses single quotes\n\n= 2.2 =\n* Enhancement: Update lazyload script to the latest version\n* Enhancement: Use the dimensions of the original image for the placeholder size when possible, to reduce content reflow\n* Enhancement: Ignore images using the new loading attribute introduce by Chrome for browser-native lazyload\n\n= 2.1.5 =\n* Bugfix: Prevent matching with the wrong data when a data-style attribute is on a div for background images\n* Remove data-cfasync=\"false\" by default\n* Enhancement: Add filter rocket_lazyload_script_tag to modify the lazyload script HTML if needed\n* Enhancement: Add data-no-minify attribute to the lazyload script tag to prevent it from being combined by JS combiners\n* Enhancement: Improve MutationObserver code to only call the lazyload update method if an image/iframe or element with .rocket-lazyload is contained in the new node(s) added to the DOM\n\n= 2.1.4 =\n* Regression fix: Correctly exclude scripts from lazyload again\n\n= 2.1.3 =\n* Bugfix: Ignore content inside noscript tags to prevent modifying them and causing some display issues\n\n= 2.1.2 =\n* Enhancement: Update lazyload script to the latest version\n* Enhancement: Add a way to lazyload the Youtube thumbnail image\n* Enhancement: Add width and height attributes to the Youtube thumbnail image depending on the resolution\n* Enhancement: Disable polyfill for intersectionObserver by default, added a way to activate it instead\n* Enhancement: Add data-cfasync=\"false\" to the lazyload script tag\n* Enhancement: Prevent lazyload on the Oxygen Builder page editor\n* Bugfix: Wrap no JS CSS in noscript tag and remove the no-js identifier\n\n\n= 2.1.1 =\n* Bugfix: Correctly apply lazyload on `picture` elements\n* Bugfix: Prevent double loading of an image when an `img` element inside a `picture` element only has a `srcset` attribute and no `src` attribute\n\n= 2.1 =\n* Enhancement: Update lazyload script to the latest version\n* Enhancement: Apply lazyload on picture elements found on the page\n* Enhancement: Apply lazyload on div elements with a background image found on the page. See FAQ for more info.\n\n= 2.0.4 =\n* Enhancement: Add filter for iframe lazyload pattern exclusion\n* Enhancement: Auto-exclude soliloquy-image pattern from lazyload\n* Bugfix: Prevent issue when an image/iframe is duplicated on the same page\n* Bugfix: Prevent W3C validation error for the SVG placeholder\n\n= 2.0.3.2 =\n* Bugfix: Correctly ignore inline scripts with line breaks inside\n\n= 2.0.3.1 =\n* Bugfix: Correct an issue preventing lazyload from working\n\n= 2.0.3 =\n* Bugfix: Prevent incorrect display if JavaScript is disabled\n* Bugfix: Don't apply lazyload on Divi/Extra/Beaver Builder Editor pages\n* Bugfix: Use the correct URL for each iframe when multiple iframes are on the same page\n* Bugfix: Ignore content inside inline script tags to prevent applying lazyload in it\n\n= 2.0.2 =\n* Bugfix: Fix an error in the compatibility for the AMP plugin\n\n= 2.0.1 =\n* Bugfix: Prevent a fatal error on case sensitive operating systems\n\n= 2.0 =\n* Enhancement: Lazyload is now applied on the template_redirect hook, which should allow the plugin to apply the optimization on more images and encountering less conflicts at the same time\n* Enhancement: Specifically target with the lazyload script images/iframes elements with a data-lazy-src attribute\n* Enhancement: Update lazyload script to the latest version\n* Enhancement: Possibility to apply lazyload on background-images with a specific markup, see FAQ\n* Enhancement: Use a svg image as placeholder instead of a base64 gif\n* Bugfix: Only use MutationObserver if available in the browser\n* Bugfix: When using the Youtube thumbnail option, correctly format the Youtube query if the video URL is encoded\n* Bugfix: Improve iframe matching to prevent unexpected results\n* Bugfix: Update CSS for the Youtube thumbnail option to prevent issue with the Gutenberg embeds block\n\n= 1.4.9 =\n* Enhancement: Update lazyload script to the latest available version\n* Enhancement: Use lazy-sizes to prevent W3C validation error when sizes is defined but srcset is not\n* Enhancement: Parse images or iframes only if the element is selected to be lazyloaded in the options\n* Fix: Prevent warning for lazyload+v in Google Search Console\n* Fix: Prevent PHP Notice with WooCommerce for product images\n\n= 1.4.8 =\n* Notice: Minimum WordPress version required is now 4.7\n* Enhancement: Update lazyload script version\n* Enhancement: Remove placeholder image to improve perceived loading time\n* Enhancement: Compatibility with Youtube privacy URL\n* Enhancement: Update play image to match Youtube logo\n* Enhancement: Support Youtube URL parameters\n* Enhancement: Lazyload images displayed with wp_get_attachment_image(). /!\\ no fallback if JavaScript is disabled\n* Fix: Use the correct size set in srcset for the lazyloaded image\n* Fix: Prevent Youtube thumbnail replacement on playlists\n* Fix: Prevent iframe lazyload on AMP pages\n* Fix: Correct text domain for translations (thanks @ Chantal Coolsma)\n\n= 1.4.7 =\n* Fix compatibility with infinite scroll\n* Prevent lazyload on masterSlider images\n\n= 1.4.6 =\n* Correctly include version 8.5.2 of lazyload script\n* Prevent 404 error on lazyload script if URL contains \"-v\"\n\n= 1.4.5 =\n* Rename Setting Page Name in WP Menu\n* New Product Banner in Settings Page\n* Conditionally load a different version of the script depending on browser support of IntersectionObserver\n* Fix a bug where images initially hidden are not correctly displayed when coming into view (slider, tabs, accordion)\n\n= 1.4.4 =\n* Admin Redesign\n\n= 1.4.3 =\n* Plugin is compatible again with PHP \u003c 5.4\n\n= 1.4.2 =\n* Update lazyload script to bring back compatibility with IE9/10\n\n= 1.4.1 =\n* Fix bug caused by a too aggressive cleanup\n\n= 1.4 =\n* New option: replace Youtube videos by thumbnail. This option can improve your loading time a lot, especially if you have multiple videos on the same page\n\n= 1.3.3 =\n* 2017-09-16\n* Prevent scripts and styles being removed during html parsing\n\n= 1.3.2 =\n* 2017-09-12\n* Fix images not displaying in certain conditions because image attributes exclusion was not working correctly\n\n= 1.3.1 =\n* 2017-09-07\n* Don't apply lazyload on Divi slider\n\n= 1.3 =\n* 2017-09-01\n* Improve HTML parsing of images and iframes to be faster and more efficient\n* Make the lazyload compatible with fitVids for iframes\n* Don't apply lazyload on AMP pages (compatible with AMP plugin from Automattic)\n* Use about:blank as default iframe placeholder to prevent warning in browser console\n* Don't apply lazyload on upPrev thumbnail\n\n= 1.2.1 =\n* 2017-08-22\n* Fix missing lazyload script\n* Don't lazyload for images in REST API requests\n\n= 1.2 =\n* 2017-08-22\n* Update lazyload script to latest version\n* Change the way the script is loaded\n\n= 1.1.1 =\n* 2017-02-13\n* Bug fix: Remove use of short tag to prevent 500 error on some installations\n\n= 1.1 =\n* 2017-02-12\n* *New*\n* JS library updated\n* Support for iFrame\n* Support for srcset and sizes\n* New options page\n\n= 1.0.4 =\n* 2015-04-28\n* Bug Fix: Resolved a conflict between LazyLoad \u0026 Emoji since WordPress 4.2\n\n= 1.0.3 =\n* 2015-01-08\n* Bug Fix: Don't apply LazyLoad on captcha from Really Simple CAPTCHA to prevent conflicts.\n\n= 1.0.2 =\n* 2014-12-28\n* Improvement: Add « rocket_lazyload_html » filter to manage the output that will be printed.\n\n= 1.0.1.1 =\n* 2014-07-25\n* Fix stupid error with new regex in 1.0.1\n\n= 1.0.1 =\n* 2014-07-16\n* Bug Fix: when a IMG tag or content (widget or post) contains the string \"data-no-lazy\", all IMG tags were ignored instead of one.\n* Security fix: The preg_replace() could lead to a XSS vuln, thanks to Alexander Concha\n* Code compliance\n\n= 1.0 =\n* 2014-01-01\n* Initial release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-media%2Frocket-lazy-load","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-media%2Frocket-lazy-load","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-media%2Frocket-lazy-load/lists"}