• Resolved lucamc

    (@lucamc)


    Hi,

    I believe there is an incompatibility between your ShortPixel Image Optimizer Plugin and the AdRotator Plugin which is used to manage advertisements on the website.

    AdRotator uses images from wordpress “media”, Shortpixel correctly optimizes these images and creates the webp copy.

    In ShortPixel settings I activated WebP Images> Using the <PICTURE> tag syntax> Only via WordPress hooks. This appears to work for all images on the site except those served by Adrotator.

    Looking at the code that is used:

    <picture class="sp-no-webp">
    <source srcset="https://www.mywebsite.com/wp-content/uploads/2020/05/Nemko-Italy-web-banner-300x250-v3.jpg.webp" type="image/webp">
    <source srcset="https://www.mywebsite.com/wp-content/uploads/2020/05/Nemko-Italy-web-banner-300x250-v3.jpg" type="image/jpeg">
    <img src="https://www.mywebsite.com/wp-content/uploads/2020/05/Nemko-Italy-web-banner-300x250-v3.jpg" class="sp-no-webp" srcset="https://www.mywebsite.com/wp-content/uploads/2020/05/Nemko-Italy-web-banner-300x250-v3.jpg">
    </picture>

    The issue seems to be that the link to the webp image has extension .jpg.webp, while the real image has only .webp (without .jpg).

    Is there any way to solve?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter lucamc

    (@lucamc)

    I have to apologize, I was wrong. The AdRotator plugin has nothing to do, the problem also occurs in other positions not only on ads.

    Thread Starter lucamc

    (@lucamc)

    While waiting for an answer, I found a temporary solution.

    I added the following line in the img-to-picture-webp.php file around line 300 just before “return ‘<picture’ …”

    $srcsetWebP = preg_replace('/\.(gif|png|jpg|jpeg)\.webp/', '.webp', $srcsetWebP);

    This solves the problem for now, the images on the site are all visible.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi, @lucamc,

    ShortPixel creates WebP files with the extension “.webp”, not “jpg.webp”.

    Can you please tell me:

    Thank you,

    Thread Starter lucamc

    (@lucamc)

    1) I have created all the Webp files in the last 3 days or so
    2) No, but … I have selected the option to transform images from png to jpg in the Short Pixel settings. However, the problem also happens with images that were jpg even at the origin.
    3) I didn’t even know that there was the possibility of adding constants, so no.

    Thread Starter lucamc

    (@lucamc)

    I looked in the system file on the server, I am attaching a screenshot.
    https://ibb.co/zPr4QHN

    Many images have a dual version .jpg.webp and .webp, while others have only the .webp version

    I also installed the WP Stateless plugin to have a backup (non-CDN backup only) of everything on google storage. On the cloud I find only the .jpg.webp image

    Should I revert all the optimizations and try to do it all over again?

    Thread Starter lucamc

    (@lucamc)

    ok, I understand where the problem lies:
    – I have bulk restored all backups
    – I checked that all webp images have been deleted (ok)
    – I have completely disabled WP Stateless
    – I restarted the optimization of all images and thumbnails (with the generation of the webp version)
    – the webp versions of the images have been correctly generated and at this point only the copy with the .webp extension existed
    – I reactivated WP Stateless setting it “backup only”
    – the backup copy on google storage has been generated, but the files on the cloud have the extension .jpg.webp ( https://ibb.co/y63qP9T )
    – after a few minutes the copy .jpg.webp also appeared on the site server ( https://ibb.co/pPHC426 )

    A WP Stateless bug? An incompatibility between the 2 plugins?

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi, @lucamc!

    That’s very interesting. It is possible that an incompatibility exists, since ShortPixel Image Optimizer (SPIO) does not officially support WP Stateless.

    What you can do is either install WP Offload Media (which is supported by SPIO) or ask the WP Stateless team for further assistance ??

    Let me know if you have any further questions.

    Best,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Webp and AdRotator’ is closed to new replies.