GoogleChromeLabs / wp-native-lazyload

WordPress plugin to lazy-load media using the native browser feature.
https://wordpress.org/plugins/native-lazyload/
Apache License 2.0
51 stars 13 forks source link

Cover images outside of `the_content()` #14

Closed jlavoie13 closed 4 years ago

jlavoie13 commented 4 years ago

Doesn't have noscript fallback when javascript is disabled.

jlavoie13 commented 4 years ago

Confirmed the noscript is implemented on images run through the_content() but nothing else.

swissspidy commented 4 years ago

@jlavoie13 Are you suggesting adding the noscript fallback for images outside the_content?

jlavoie13 commented 4 years ago

Yes. It seems like it's a bug if only enabled on the_content().

felixarntz commented 4 years ago

@jlavoie13 I completely agree with you that it's weird that the plugin only works on post content at this point.

However, given how WordPress generates content, it's not possible (at least not in a reasonable way) to make such updates to any part of the content from the server-side. The plugin would need to run the entire generated markup through an output buffer, which seems overkill for this type of enhancement, as it has all kinds of side effects.

In the future though, with WordPress moving to enabling full-site editing via Gutenberg, it will become possible to address this issue, which I'll totally do when that becomes feasible.