Giter Site home page Giter Site logo

shinsenter / defer-wordpress Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 2.0 209 KB

🔌A Wordpress plugin integrating my beloved "defer.js" library into your websites. Hope you guys like it.

Home Page: https://wordpress.org/plugins/shins-pageload-magic/

License: GNU General Public License v2.0

PHP 93.85% CSS 2.62% JavaScript 1.02% Shell 2.51%
wordpress lazy-loading lazyload pagespeed gtmetrix fast minification deferred-rendering

defer-wordpress's Issues

Defer Offscreen images

Seems like lazy load has stopped working, Pagespeed insights is now showing defer offscreen images even though Lazy Loading is on for images, iframes and videos?

It was working all good before the last update today.

Minify HTML conflicting with Yoast SEO schema markup

Hi, after enabling the Minify HTML option, the Google Webmaster Tool started notifying the error "Invalid top-level element: null".
looking at the source code I was able to locate the problem, which is in conflict with Yoast SEO:

the easiest solution for me was to disable the Minify HTML option in the plugin and the problem was solved, but I thought it prudent to warn you of the conflict.

Version demo

Mình nghĩ plugins này tác giả cũng phải có 1 bản demo riêng cho nó trên WordPress, để người dùng họ dễ xem trước và so sánh hơn. Ví dụ như trang chưa cài DeferJS thì như nào, và sau khi cài DeferJS thì trang sẽ như nào.

image tags have incorrect sources

With defer enabled, some images have a weird source:

src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1024'%20height='617'%3E%3C/svg%3E"

The images are fine with defer disabled.

Not working

Hi, I tested the defer-wordpress plugin on the Astra theme and it worked.
Helium theme did not work, could you help me solve it?
Thanks, Ricardo / Brazil

How Can I Trigger Lazyloading For Ajax Content?

Thank you very much for this awesome plugin.

I have a question: in combination with the BeRocket woocommerce-ajax-products-filter plugin, the WooCommerce product images are not loaded after a page switch (as they are served via Ajax, I believe Defer.js does not detect them to be images to be checked for whether they are in the viewport).
How can I tell the plugin to re-initialize/re-check for new images etc.?

Currently, my solution is to just query all images and replace the data-src attribute after new content is loaded, but this kind of destroys the idea of lazy loading...

Thanks for a hint!

const images = testElement.querySelectorAll( 'img' );
images.forEach( ( img ) => {
	if ( img.getAttribute( 'data-src' ) ) {
		img.setAttribute( 'src', img.getAttribute( 'data-src' ) );
	}
} );

Allow opting-out of video lazy-loading

Both <picture> and <video> use the same <source> element but there still should be a way of not lazy-loading videos separately than images since they natively support [preload="none"].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.