An efficient lazy loader (defer.js)

Description

WordPress remains one of the most popular CMS platform until now, and I’m excited to make a WordPress plugin that focuses on minimizing payload size of HTML document and optimizing processing on the browser when rendering the web page.

⚑️ A native, blazing fast lazy loader. βœ… Legacy browsers support (IE9+). πŸ’― SEO friendly. 🧩 Lazy load almost anything.

Rate 5 stars (⭐️⭐️⭐️⭐️⭐️) if you guys like it.

πŸ’‘ Tip for defer.js: To archive better result, please disable lazyload and HTML-CSS-JS optimizations by other plugins.

Powered by defer.js

defer.js is a super tiny, native performance library for lazy-loading JS, CSS, images, iframes…

  • ⚑️ Native API, blazing fast
  • πŸ‘ Legacy browsers support (IE9+)
  • πŸ₯‡ SEO friendly
  • βœ… Very easy to use
  • πŸ’― No dependencies, no jQuery
  • 🀝 Works well with your favorite frameworks
  • 🧩 Uses IntersectionObserver API for optimized CPU usage
  • 🏞 Supports for responsive images, both srcset and sizes attributes

Easily speed up your website!

Other lazy loading libraries hook up to the scroll event on elements that need to be lazy loaded. This approach forces the browser to re-layout the page and it is painfully slow.

Here we are, defer.js is written in plain JavaScript, making lazy-loading more efficient and fast. This library is using the recently added Intersection Observer with tremendous native performance benefits.

In various cases, using async or defer does not deliver faster page speed than defer.js does.

Browser support

Available in latest browsers. This library also works perfectly with Internet Explorer 9 and later.

  • πŸ–₯ IE9+
  • πŸ–₯ Firefox 4+
  • πŸ–₯ Safari 3+
  • πŸ–₯ Chrome *
  • πŸ–₯ Opera *
  • πŸ“± Android 4+
  • πŸ“± iOS 3.2+

Keep in touch

Released under the GNU General Public License v2 license.
https://github.com/shinsenter/defer-wordpress/blob/master/LICENSE

Copyright (c) 2019 Mai Nhut Tan <shin@shin.company>

Screenshots

  • Scoring 100/100 in Google PageSpeed Test!
  • Defer almost anything, easily speed up your website.

Installation

  1. Upload defer-wordpress to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

FAQ

What is defer.js?

πŸ₯‡ A super tiny, native performance library for lazy-loading JS, CSS, images, iframes… Defer almost anything, easily speed up your website.

Why should I lazy-load my content?

The loading of contents on web page may make your load speed more slow, no one likes staring at a blank white page; users are impatient and will leave quickly.

Lazy loading content on web page can help reduce resource contention and improve performance.

Reviews

September 26, 2020
Specifically the svg placeholder option is a gem, we have been using this technique for quiet some time and it's good at preventing layout shift if used properly. Remember to always provide a width & height for your images so this could work!
June 28, 2020
Awesome plugin, one of the best speed optimization Plugins out there, and geat for boosting your Page Speed Scores.
June 17, 2020
He probado todo tipo de herramientas, plugins y cΓ³digos, de momento el ΓΊnico que nos ha dado excelentes resultados es este.
May 12, 2020
All the settings may not be for you, and you may need to set rules in functions.. but once it's set up... it works flawlessly. (The only lazy loader plugin I could get to work well with dynamically set up webp picture/source tags)
Read all 36 reviews

Contributors & Developers

“An efficient lazy loader (defer.js)” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.1.11 Fixed security issue (Fixed CVE-2019-18888)

1.1.10+5 Removed external resources

1.1.10 Bug fixes and improvements

1.1.9 Fixed wrong encoding when using mb_detect_encoding() function

1.1.8 Updated defer.php library (v1.0.15)

1.1.7 Fixed issues of FireFox, code improvements

1.1.6 Updated library version, improved javascript execution order

1.1.5 Hotfix: Escape HTML node value

1.1.4 Many improvements

1.1.3 Unify lazy attributes of another plugins

1.1.2 Fixed some known issues with gtm.js, improve library’s caches

1.1.1 Small bug fixes (IE polyfill, missing meta tags, preloading ads)

1.1.0 Added settings page

1.0.9 Imrpoved preloading code

1.0.8 Fixed issues with open web fonts

1.0.7 Optimized scriptloader, polyfill, scrset

1.0.6 Small bug fixes (color placeholders, css)

1.0.5 Migrated with defer.js library

1.0.0 ~ 1.0.4 The first implement