{"id":21700141,"url":"https://github.com/wp-digital/wp-hybrid-lazy-loading","last_synced_at":"2026-05-16T20:35:09.565Z","repository":{"id":35890660,"uuid":"205153810","full_name":"wp-digital/wp-hybrid-lazy-loading","owner":"wp-digital","description":"A Progressive Migration To Native Lazy Loading.","archived":false,"fork":false,"pushed_at":"2023-03-04T04:36:43.000Z","size":1108,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-09-04T11:28:06.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wp-digital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-29T12:00:00.000Z","updated_at":"2021-02-09T15:03:22.000Z","dependencies_parsed_at":"2025-03-20T15:42:38.814Z","dependency_job_id":"790fa44e-25dd-47f4-85a6-c8259710ced4","html_url":"https://github.com/wp-digital/wp-hybrid-lazy-loading","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/wp-digital/wp-hybrid-lazy-loading","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-digital%2Fwp-hybrid-lazy-loading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-digital%2Fwp-hybrid-lazy-loading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-digital%2Fwp-hybrid-lazy-loading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-digital%2Fwp-hybrid-lazy-loading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-digital","download_url":"https://codeload.github.com/wp-digital/wp-hybrid-lazy-loading/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-digital%2Fwp-hybrid-lazy-loading/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33117962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"ssl_error","status_checked_at":"2026-05-16T18:38:29.903Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-25T20:13:00.692Z","updated_at":"2026-05-16T20:35:09.549Z","avatar_url":"https://github.com/wp-digital.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hybrid Lazy Loading\n\n### Description\n\nA Progressive Migration To Native Lazy Loading.\n\nThe idea of plugin is to use [Native Lazy Loading](https://web.dev/native-lazy-loading) when\nbrowser [supports](https://caniuse.com/#search=lazy%20loading) it and for all others implements \nlazy loading through [lazysizes](https://github.com/aFarkas/lazysizes) library that loads only\nwhen needed.\n\nPlugin adds **loading** attribute for all attachments, oEmbed iframes, images and iframes that \nare inserted to content through editor, also CSS class **lazyload** adds to those elements as well\nas **data-src**, **data-srcset** and **data-sizes** are created from corresponding attributes.\n\n## Installation\n\nClone this repo to `wp-content/plugins/`:\n\n````\ncd wp-content/plugins/\ngit clone git@github.com:innocode-digital/wp-hybrid-lazy-loading.git\n````\n\nor use [Composer](https://getcomposer.org/) for that.\n\nActivate **Hybrid Lazy Loading** from Plugins page \nor [WP-CLI](https://make.wordpress.org/cli/handbook/): `wp plugin activate wp-hybrid-lazy-loading`.\n\n## Documentation\n\nBy default plugin loads [lazysizes](https://github.com/aFarkas/lazysizes) lazily, which means only \nfor ones that are w/o [Native Lazy Loading](https://web.dev/native-lazy-loading) support but it's \npossible to change this behaviour with filter: \n\n```\nadd_filter( 'innocode_wp_hybrid_lazy_loading_lazy_enqueue_lazysizes', '__return_false' ); // Default is \"true\"\n```\n\nIt makes sense when e.g. [lazysizes](https://github.com/aFarkas/lazysizes) is using also for other\nfunctionality.\n\n---\n\nBy default CSS class \"lazyload\" removes from elements in browsers with \n[Native Lazy Loading](https://web.dev/native-lazy-loading) support but it's possible to change \nthis behaviour with filter: \n\n```\nadd_filter( 'innocode_wp_hybrid_lazy_loading_force_use_lazysizes', '__return_true' ); // Default is \"false\"\n```\n\nIt makes sense when e.g. it's needed to use \n[lazysizes CSS classes](https://github.com/aFarkas/lazysizes#css-api) that are adding to element \nduring loading process in all browsers.\n\n---\n\nBy default all attachments are loading lazily but it's possible to change this behaviour with \nfilter:\n\n```\nadd_filter( 'innocode_wp_hybrid_lazy_loading_attachment_loading', function ( $type, $attachment_id ) {\n    $type = 'eager'; // Default is \"lazy\"\n    \n    return $type;\n}, 10, 2 );\n```\n\nIt makes sense when e.g. featured image should be loaded immediately.\n\n---\n\nIf there are images and iframes that are rendered in PHP code of theme or plugin and they should\nbe loaded lazily, it's possible to use next methods:\n\n```\n/**\n * Adds \"loading\" attribute and \"lazyload\" CSS class to images in HTML code\n *\n * @param string $html\n * @return string\n */\n\\Innocode\\WPHybridLazyLoading\\DOM::images( $html );\n\n/**\n * Adds \"loading\" attribute and \"lazyload\" CSS class to iframes in HTML code\n *\n * @param string $html\n * @return string\n */\n\\Innocode\\WPHybridLazyLoading\\DOM::iframes( $html );\n\n/**\n * Adds \"loading\" attribute and \"lazyload\" CSS class to elements in HTML code by tag\n *\n * @param string $tag\n * @param string $html\n * @return string\n */\n\\Innocode\\WPHybridLazyLoading\\DOM::elements( $tag, $html );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-digital%2Fwp-hybrid-lazy-loading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-digital%2Fwp-hybrid-lazy-loading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-digital%2Fwp-hybrid-lazy-loading/lists"}