• Resolved THP Studio

    (@thpstock)


    Hey,

    Since above 3.6.4, there is a bug to do with the Media Excludes tab > Lazy Load Image Parent Class Name Excludes field.

    In this field, if you enter a value that is actually found anywhere on a page (which for example in the link above you’ll see the class name ‘heroimage’ in use in the html for the very first image on the page), it prevents EVERY image on the page from lazy loading. In other words, it’s not only looking at parent classes, it’s looking at the whole page.

    My developer viewed the Git blame on line 553 in media.cls.php on 27th March by hi-hai and we can see the regular expression changed from:

    $content = preg_replace( ‘#<(\w+) [^>]*class=(\’|”)[^\'”]*’ . preg_quote( $v, ‘#’ ) . ‘[^\'”]*\2[^>]*>.*</\1>#sU’, ”, $content );

    to

    $content = preg_replace( ‘#<(\w+) [^>]*class=(\’|”)[^\2]*’ . preg_quote( $v, ‘#’ ) . ‘[^\2]*\2[^>]*>.*</\1>#sU’, ”, $content );

    If we change roll back this one line of code, we can once again use classes in the Lazy Load Image Parent Class Name Excludes field without problems.

    We have tested this on multiple sites, on multiple hosts, on multiple recent versions of the plugin and it fails every time. But if we swap out the code as mentioned above, or remove entirely anything from that Lazy Load Image Parent Class Name Excludes field, then it works.

    The site linked to is running 4.4.1, but with this one change of code applied to it. (so that it works).

    • This topic was modified 2 years, 7 months ago by THP Studio.
    • This topic was modified 2 years, 7 months ago by THP Studio.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Lazy Load Image Parent Class Name Excludes Bug?’ is closed to new replies.