ndigitals/wp-local-media-proxy

Not Replacing Inline CSS Style Image References

Opened this issue · 0 comments

Describe the bug
When images are included in content like Blocks and used as CSS inline styles sometimes the images are not being replaced when they should be.

<figure class="wp-block-media-text__media" style="background-image:url(https://gateshosting-discocntr.ddev.site/wp-content/uploads/2024/01/GA17181207_MH657125-700x467.jpg);background-position:30% 44%"><img decoding="async" width="700" height="467" src="https://gateshosting-discocntr.ddev.site/wp-content/uploads/2024/01/GA17181207_MH657125-700x467.jpg" alt="A mother and two daughters peer into a toilet prototype on view in the Discovery Center." class="wp-image-13226 size-full" srcset="https://www.discovergates.org/wp-content/uploads/2024/01/GA17181207_MH657125-700x467.jpg 700w, https://www.discovergates.org/wp-content/uploads/2024/01/GA17181207_MH657125-250x167.jpg 250w, https://www.discovergates.org/wp-content/uploads/2024/01/GA17181207_MH657125-768x512.jpg 768w, https://www.discovergates.org/wp-content/uploads/2024/01/GA17181207_MH657125-1536x1025.jpg 1536w, https://www.discovergates.org/wp-content/uploads/2024/01/GA17181207_MH657125-120x80.jpg 120w, https://www.discovergates.org/wp-content/uploads/2024/01/GA17181207_MH657125.jpg 2000w" sizes="(max-width: 700px) 100vw, 700px"></figure>

Expected behavior
Validation of other dynamic/embedded content, including inline CSS should have images replaced.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only this plugin is active.
  • This bug happens with a default WordPress theme active.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

  • PHP Version: 8.1
  • WordPress Version: 6.4.2
  • Plugin Version: 1.1.1