SiteOrigin Image Slider widget generates images with
loading="1"as
<img>attribute. The only valid values for loading attribute according to HTML standards are “eager” and “lazy”. The value “1” is invalid.
In order to fix the invalid HTML, one needs to modify wp-content/plugins/so-widgets-bundle/widgets/slider/slider.php and change
'loading' => trueto
'loading' => 'eager'on lines 171 and 201 (in version 1.17.8 of SiteOrigin Widgets Bundle)
Hi Disassembler,
Thank you for reporting this. This was done to avoid a WordPress bug when disabling lazy loading. You can read more about this change here. Let me know if you have any further questions.
Kind regards,
Alex
Hi Alex,
Value “true” is not allowed in the loading parameter, see https://developer.wordpress.org/reference/functions/wp_get_attachment_image/ – only boolean false or a string is allowed. Setting ‘loading’ => true as it is now results in invalid HTML generated as , as per my original report (sorry about the formatting), hence I’m suggesting setting to a string value ‘eager’, which is allowed, results in valid HTML and still keeps the lazy loading disabled.
*invalid HTML generated as
Hi Disassembler,
I’ve forwarded your feedback to the rest of the team, and I’ll investigate this further shortly. If WordPress has resolved the issue related to using values other than false we’ll look towards changing this value to more valid options.
https://github.com/siteorigin/so-widgets-bundle/issues/new
Kind regards,
Alex
I see that the proposed change has been merged into the develop branch on GitHub a few days ago. Eagerly (pun intended) looking forward to the next release. :) Thank you.
Hahaha :) Thanks for checking in.