BJ Lazy Load is a WordPress plugin that improves site loading times by lazy loading images and iframes. The plugin is available through the plugin repository on wordpress.org.
Lazy loading makes your site load faster and saves bandwidth.
This plugin replaces all your post images, post thumbnails, gravatar images and content iframes with a placeholder and loads the content as it gets close to enter the browser window when the visitor scrolls the page. Also works with text widgets.
Since it works with iframes, it also covers embedded videoes from YouTube, Vimeo etc.
You can also lazy load other images and iframes in your theme, by using a simple filter.
Non-javascript visitors gets the original element in noscript.
You will need npm to build the plugin.
git clone --recurse-submodules git+ssh://[email protected]/Angrycreative/bj-lazy-load.git
cd bj-lazy-load
npm i
gulp
PHP linting requires PHP Codesniffer to be installed.
# lint everything
npm run lint
# lint only PHP or only JavaScript
npm run lint:php
npm run lint:js