• Resolved deeveearr

    (@deeveearr)


    Hi guys,

    At present, I’m using Lightspeed Cache with Short Pixel, and have just tried optimizing a couple of new images, which seem to be fine.

    1) I’m using a ‘proper cron’ rather than a WordPress one and so I’ve also left the LSCache Auto Request Cron setting set to on.

    2) The media gallery notifications for ONE of these new images are:

    Reduced by 63.02% (Lossy)

    +2 thumbnails optimized

    +3 Webp images

    3) There is also a mention of bulk optimizing ALL images to make this system work properly, but won’t this make the process rather expensive (I tend to run out of my free allowance rather quickly as there are hunderds of images on my website)?

    For further info: I’ve added the two new lines of code into Code Snippets (one to leave in, and one to delete following optimisation) but have left the snippets disabled until further instructions are given.

    Advice needed, please.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hi deeveearr,

    Could you please tell us:

    1. What document or documents you tried to follow?
    2. What’s your goal exactly?
    3. What lines have you added to the Code Snippets plugin?
    4. Where is it mentioned that you need to bulk optimize all images?

    Thank you!

    Thread Starter deeveearr

    (@deeveearr)

    Hi, @sixaxis

    The full instructions from Shortpixel are inside the latest ‘nag’ at the top of the admin page:

    ShortPixel has detected that you are using the Litespeed cache with WebP Image Replacement enabled. You must?enable the double WebP extension constant?for WebP delivery to work correctly in this case.

    Following that nag (opens in a new window) will tell you all about the two lines of code and the bulk optimization process.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi deeveearr,

    The first line of code is this:

    add_filter('shortpixel/image/filecheck', function () { return true; });

    That line is only necessary if you followed the instructions on the article days or weeks ago and discovered that some or all of your WebP image files are missing. If this is the case, you just need to do these steps:

    1. Upgrade to the latest version of ShortPixel Image Optimizer (at least 5.3.0).
    2. Add the line to the functions.php file (or via the?Code Snippets?plugin).
    3. Run again the ShortPixel bulk optimization?to generate the missing WebP files.
    4. Remove the line from step #2.

    If you have not noticed any missing WebP files, please ignore the first line of code.

    Now, regarding the second line:

    define('SHORTPIXEL_USE_DOUBLE_WEBP_EXTENSION', true);

    It is necessary to use as long as you are using LiteSpeed to deliver the WebP files. If you do, and if your WebP files do not have a double extension (xxx.jpg.webp for example), you have two options:

    1. Either restore and re-optimize all the images,
    2. or rename your existing WebP files, which will not require a re-optimization: https://shortpixel.com/knowledge-base/article/277-how-to-rename-my-webp-images-from-single-to-double-extension

    I hope this helps you!

    Thread Starter deeveearr

    (@deeveearr)

    Hi @sixaxis

    So therefore I’m going to need to re-optimize as I do not have access to a shell with bash thingy.

    I already threw the second line into wp.config manually (not with Code Snippets), so seeing as I hadn’t ever followed any instructions regarding running Litespeed Cache with Shortpixel, I guess I’m going to have to add the first line into Code Snippets, bulk re-optimize, and delete the snippet?

    For info: Lots of images are not appearing as webp, either with a double or as a single extension.

    I’ve been doing some work on videos this morning, so I’ll leave it until tomorrow to do, as if something goes wrong I’ll need a daily backup to rollback to, so that I do not lose all of this morning’s work.

    Thread Starter deeveearr

    (@deeveearr)

    On second thoughts @sixaxis do I really need Shortpixel at all?

    The only reason that I started using Shortpixel again, is that Lightspeed Cache started taking days and (sometimes) weeks to optimize images.

    I’m guessing that they might have got it right with the last two or three releases?

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi deeveearr,

    To your first question, yes, you need to add the first line as well. Make sure you add it to the functions.php file, not the wp-config.php file.

    As for your second question, I highly recommend using ShortPixel’s image optimization instead of LiteSpeed Cache. It’s a much more complete and flexible solution and faster. Especially when it comes to the quality of the images, ShortPixel’s algorithms try to optimize each image in ~10 different ways to achieve the best ratio between quality and size, and you can choose between 3 different quality levels.

    I hope that helps!

    Thread Starter deeveearr

    (@deeveearr)

    Ok, @sixaxis

    So what changes need making to Litespeed Cache’s image optimization page, considering that most of the images are not recognised as webp?

    Plugin Support Gerard Blanco

    (@sixaxis)

    Assuming that you want LiteSpeed Cache to be the one in charge of delivering the WebP files, you need to do this:

    1. On LiteSpeed Cache, enable “Image WebP Replacement” and “WebP For Extra srcset”.
    2. Set the rest of LiteSpeed’s image optimization settings to OFF.
    3. Go to Settings > ShortPixel > Advanced > Next Generation Images, disable the option “Deliver the WebP versions of the images in the front-end”, and enable the “Create WebP versions of the images” option.
    4. Add the lines mentioned above to the functions.php and wp-config.php files.
    5. Re-optimize your images.
    6. Remove the first line (from the functions.php file).

    If, after dong all this, the WebP files are still not being delivered on the front-end, you’ll have to consult it with the LiteSpeed Cache team or try to use ShortPixel’s WebP delivery methods.

    Cheers,

    Thread Starter deeveearr

    (@deeveearr)

    Ok, @sixaxis

    So what needs to be changed if I wanted Shortpixel to be in charge of webp delivery, as Litespeed Cache dosen’t seem to be doing a very good job of it at present?

    Plugin Support Gerard Blanco

    (@sixaxis)

    For that you just need set everything to OFF in LiteSpeed Cache’s image optimization settings, and enable the “Deliver the WebP versions of the images in the front-end” option in ShortPixel. You will find this article useful too: https://shortpixel.com/knowledge-base/article/126-which-webp-files-delivery-method-is-the-best-for-me

    Cheers!

    Thread Starter deeveearr

    (@deeveearr)

    Ok then @sixaxis it looks like Shortpixel just runs ‘on a par’ with the Lightspeed Cache image optimization as nothing has really changed.

    Most noticeable is that any featured images in the Blog posts remain as .jpg.

    And prior to you suggesting trying Shortpixel Adaptive Images – I tried it last year, and was the main reason that I stopped using Shortpixel.

    Looks like I’m going to have to leave again, as this constant bulk optimizing (which is a close second behind SPAI) is going to break the bank.

    I’m now off to try Optimole on one of my smaller websites.

    Plugin Support Gerard Blanco

    (@sixaxis)

    No problem, deveear. If you’d like to try ShortPixel again, we’ll be around.

    Good luck.

    Thread Starter deeveearr

    (@deeveearr)

    Bump

    Thread Starter deeveearr

    (@deeveearr)

    Excuse the ‘Bump’ Above, but that would have made this reply the 13th (and I’m a little superstitious)

    I just thought that I’d pop in and say that I’ve been re-using ShortPixel for the last three months now, and I added a review into the appropriate section.

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.