wp-media / imagify-plugin

Speed up your website with lighter images without losing quality.
https://imagify.io
69 stars 24 forks source link

First Product Image on Woocommerce Single Product Page Not Converting to Next-Gen with <picture> Tag #889

Open saranshj4 opened 4 weeks ago

saranshj4 commented 4 weeks ago

Before submitting an issue please check that you’ve completed the following steps:

Describe the bug The first product image on the Woocommerce single product page does not convert to next-gen formats (WebP/AVIF) using the <picture> tag method. While other images, including those in the product gallery, are converted successfully, the first product image remains in its original format. The <img> tag is replaced with the <picture> tag, but it does not pull the next-gen version.

To Reproduce Steps to reproduce the behavior:

  1. Update to the latest versions of Woocommerce and Imagify.
  2. Enable next-gen image display in Imagify settings and select the <picture> tag method.
  3. Ensure next-gen versions are generated for all images.
  4. Navigate to a Woocommerce single product page.
  5. Observe that the first product image is not converted to next-gen format, while other images are.

Expected behavior The first product image should convert to next-gen formats using the <picture> tag method, similar to the other images on the page.

The workaround is to use the rewrite rules method to display next-gen seamlessly.

Screenshots image image

Additional context In my testing, I noticed that the gallery thumbnails (100x100) were not loading in next-gen formats. However, this was not the case in other user websites. image

Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming

saranshj4 commented 4 weeks ago

https://secure.helpscout.net/conversation/2623328754/496843?folderId=8160051 https://secure.helpscout.net/conversation/2636795531/499493?folderId=676697

saranshj4 commented 4 weeks ago

This might be related - https://github.com/wp-media/imagify-plugin/issues/661#issuecomment-2014708210