WordPress / performance

Performance plugin from the WordPress Performance Group, which is a collection of standalone performance modules.
https://wordpress.org/plugins/performance-lab/
GNU General Public License v2.0
365 stars 99 forks source link

Background images does not uses the `*.webp` version in the content if present #288

Closed masteradhoc closed 2 years ago

masteradhoc commented 2 years ago

Bug Description

Some time ago i developed a small simple website with gutenberg & generatepress. i tried to use as many default blocks as possible. Now i tried the performance plugin to support the great initiative to move to webp as also other platforms are doing the same as shopify and wix...

webps are generated correctly which i checked based on this request: https://wordpress.slack.com/archives/C02KGN5K076/p1649596392220539?thread_ts=1648893985.315499&cid=C02KGN5K076

It though seems that still the regular jpg images get used instead of the webp version of the images. see here: image

Steps to reproduce

  1. Upload jpeg images - implement them as background images or regular images in gutenberg blocks
  2. install performance plugin, activate webp
  3. use Regenerate Thumbnails plugin to generate the webp
  4. See on frontend if they got used

Additional Context

mitogh commented 2 years ago

Thanks for creating your report @masteradhoc I was able to reproduce this problem locally, using the Cover block and using an image as background.

Currently the replacement of images to WebP only happens in inserted images in the content. But I do agree this behavior should be consistent even with background images.

adamsilverstein commented 2 years ago

Nice work @mitogh! I'll make sure this is covered in the core patch as well.