PHPackages                             innocode-digital/wp-hybrid-lazy-loading - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. innocode-digital/wp-hybrid-lazy-loading

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

innocode-digital/wp-hybrid-lazy-loading
=======================================

A Progressive Migration To Native Lazy Loading.

1.3.2(5y ago)01.8k[5 PRs](https://github.com/wp-digital/wp-hybrid-lazy-loading/pulls)GPL-2.0-or-laterPHPPHP &gt;=7.0

Since Nov 6Pushed 3y ago12 watchersCompare

[ Source](https://github.com/wp-digital/wp-hybrid-lazy-loading)[ Packagist](https://packagist.org/packages/innocode-digital/wp-hybrid-lazy-loading)[ Docs](https://github.com/innocode-digital/wp-hybrid-lazy-loading#readme)[ RSS](/packages/innocode-digital-wp-hybrid-lazy-loading/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (12)Used By (0)

Hybrid Lazy Loading
===================

[](#hybrid-lazy-loading)

### Description

[](#description)

A Progressive Migration To Native Lazy Loading.

The idea of plugin is to use [Native Lazy Loading](https://web.dev/native-lazy-loading) when browser [supports](https://caniuse.com/#search=lazy%20loading) it and for all others implements lazy loading through [lazysizes](https://github.com/aFarkas/lazysizes) library that loads only when needed.

Plugin adds **loading** attribute for all attachments, oEmbed iframes, images and iframes that are inserted to content through editor, also CSS class **lazyload** adds to those elements as well as **data-src**, **data-srcset** and **data-sizes** are created from corresponding attributes.

Installation
------------

[](#installation)

Clone this repo to `wp-content/plugins/`:

```
cd wp-content/plugins/
git clone git@github.com:innocode-digital/wp-hybrid-lazy-loading.git

```

or use [Composer](https://getcomposer.org/) for that.

Activate **Hybrid Lazy Loading** from Plugins page or [WP-CLI](https://make.wordpress.org/cli/handbook/): `wp plugin activate wp-hybrid-lazy-loading`.

Documentation
-------------

[](#documentation)

By default plugin loads [lazysizes](https://github.com/aFarkas/lazysizes) lazily, which means only for ones that are w/o [Native Lazy Loading](https://web.dev/native-lazy-loading) support but it's possible to change this behaviour with filter:

```
add_filter( 'innocode_wp_hybrid_lazy_loading_lazy_enqueue_lazysizes', '__return_false' ); // Default is "true"

```

It makes sense when e.g. [lazysizes](https://github.com/aFarkas/lazysizes) is using also for other functionality.

---

By default CSS class "lazyload" removes from elements in browsers with [Native Lazy Loading](https://web.dev/native-lazy-loading) support but it's possible to change this behaviour with filter:

```
add_filter( 'innocode_wp_hybrid_lazy_loading_force_use_lazysizes', '__return_true' ); // Default is "false"

```

It makes sense when e.g. it's needed to use [lazysizes CSS classes](https://github.com/aFarkas/lazysizes#css-api) that are adding to element during loading process in all browsers.

---

By default all attachments are loading lazily but it's possible to change this behaviour with filter:

```
add_filter( 'innocode_wp_hybrid_lazy_loading_attachment_loading', function ( $type, $attachment_id ) {
    $type = 'eager'; // Default is "lazy"

    return $type;
}, 10, 2 );

```

It makes sense when e.g. featured image should be loaded immediately.

---

If there are images and iframes that are rendered in PHP code of theme or plugin and they should be loaded lazily, it's possible to use next methods:

```
/**
 * Adds "loading" attribute and "lazyload" CSS class to images in HTML code
 *
 * @param string $html
 * @return string
 */
\Innocode\WPHybridLazyLoading\DOM::images( $html );

/**
 * Adds "loading" attribute and "lazyload" CSS class to iframes in HTML code
 *
 * @param string $html
 * @return string
 */
\Innocode\WPHybridLazyLoading\DOM::iframes( $html );

/**
 * Adds "loading" attribute and "lazyload" CSS class to elements in HTML code by tag
 *
 * @param string $tag
 * @param string $html
 * @return string
 */
\Innocode\WPHybridLazyLoading\DOM::elements( $tag, $html );

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~115 days

Total

5

Last Release

1918d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b52f801a1cdb5f6622a9e49f4359717b1808ca23e948a243eae225f55e2c7eb?d=identicon)[smfb-dinamo](/maintainers/smfb-dinamo)

---

Top Contributors

[![kuliebiakin](https://avatars.githubusercontent.com/u/6066592?v=4)](https://github.com/kuliebiakin "kuliebiakin (19 commits)")[![zhyian](https://avatars.githubusercontent.com/u/8911089?v=4)](https://github.com/zhyian "zhyian (1 commits)")

### Embed Badge

![Health badge](/badges/innocode-digital-wp-hybrid-lazy-loading/health.svg)

```
[![Health](https://phpackages.com/badges/innocode-digital-wp-hybrid-lazy-loading/health.svg)](https://phpackages.com/packages/innocode-digital-wp-hybrid-lazy-loading)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
