Code Monkey home page Code Monkey logo

Comments (5)

Tabrisrp avatar Tabrisrp commented on June 22, 2024

What is the related DB data entry for this case looks like?

from wp-rocket.

jeawhanlee avatar jeawhanlee commented on June 22, 2024

Reproduce the problem ✅

I was able to reproduce the problem with the steps below:

  1. install/activate 3.16 + activate lazyload feature
  2. page template with image in the root directory without a forward slash(<img src="image.jpg" alt="image" />)
  3. visit the page template
  4. clear cache and revisit the page
  5. Check the markup, you'll still find lazyload applied: <img src="image.jpg" data-lazy-src="image.jpg" data-ll-status="loaded" class="entered lazyloaded">
    When you log the entries of excluded patterns with the filter - rocket_lazyload_excluded_src You'll get:
Array
(
    [0] => /wpcf7_captcha/
    [1] => timthumb.php?src
    [2] => woocommerce/assets/images/placeholder.png
    [3] => /id/10/2500/1667.jpg
    [4] => /image.jpg
)

Identify the root cause ✅

The reason for this behaviour is because wp_parse_url returns a path with a forward slash like so - /image.jpg here:

$exclusion = wp_parse_url( $exclusion );

With that there would be a mismatch when matching /image.jpg with image.jpg to exclude.

Scope a solution ✅

We can ltrim the forward slash off the returned paths here:

$exclusion = wp_parse_url( $exclusion );

Estimate the effort ✅

[XS]

from wp-rocket.

MathieuLamiot avatar MathieuLamiot commented on June 22, 2024

@jeawhanlee Have you performed basic checks to ensure the code does not break on happy path and that the reported failing cases are fixed? In which case, we can merge so that we only have to work on the feature branch. OK? Thanks 🙏

from wp-rocket.

Related Issues (20)

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.