[Smush Pro] Resizing of existing images

Hi, we're testing SMUSH Pro & one of the features we were particularly keen on was image resizing however as far as we can tell existing images do not automatically get resized.

Can I confirm that is correct? Is it not possible to resizing existing images when their dimensions are too big? Does image resizing only happen when adding new images?

thanks in advance

  • Adam Czajczyk
    • Support Gorilla

    Hello Katy

    I hope you're well today and thank you for your question!

    There are two "resizing" options in Smush so since I'm not quite sure which one are you asking about, let me briefly describe both.

    1. There's a "Resize my full size images" option in the "Smush Pro -> Bulk smush" section.

    This is an automatic resizing that's meant mostly to help you save some storage space as it only resizes images bigger than a certain size (that you set there in options) and is not related in any way to the size of image displayed on site.

    This option - if enabled - will be applied when a new image is uploaded to the site but also if you run "Bulk smush" option. With "bulk smush" option all the images in Media Library are processed (unless they already are optimized).

    Note: it doesn't apply to "Directory smushing" - so to optimization of images that are not within Media Library but are in other folders.

    2) There's an "Autmatic Resizing" option in a Smush CDN settings. If you got Smush CDN and that option enabled what happens is:
    - and image that's about to be displayed on the page is send to our CDN (the original image)
    - it's optimized (compressed) in our CDN
    - plugin attempts to read the "display size" of an image (so image container size) and resizes image to these dimensions
    - image is served from the CDN

    In this case also already existing images should be affected. However, no images are actually changed on your server. This means that original images, as uploaded and stored on your site/server, remain unchanged - all the optimization/resizing happens on our end and is applied only to those copies stored in CDN.

    To sum it up - unless I'm missing the point, I can tell that all the images (already existing and newly uploaded) should be resized but it'd be great if you could explain this specific case with more details; especially - what makes you suspect that only new images are affected.

    It would help me get the better picture of the case and I'd be able to give you better response and, if necessary, start troubleshooting the issue in order to solve it.

    Best regards,
    Adam

  • Katy
    • WPMU DEV Initiate

    Hi Adm,

    Okay so if I understand correctly image dimensions will not be changed using this plugin, is that correct?

    Here's an example URL:
    https://www.thempagroup.co.uk/case-studies/cell-imaging-breakthrough-vu/

    When viewed on desktop the main image wp-content/uploads/2018/07/popbio.png is 2048x8833 but it is displayed at 430x185.

    There are a number of instances across the site where images have been uploaded which are not appropriately sized.

    I was hoping that the plugin would provide a quick way to address this but that doesn't appear to be the case. Let me know if I've misunderstood here?

    thanks,
    Dom

  • Predrag Dubajic
    • Support

    Hi Katy,

    Thanks for providing additional info, from what I see on that page the image is loaded via IMG HTML tag and that is something Smush can deal with and serve the properly sized image.
    What you will need to do for this is enable Smush CDN and Auto-Resizing option from there, as Adam mentioned in his #2 section above.
    This will use our CDN services to serve an image that is sized as the HTML holder.

    Let us know if you have any follow up questions about this.

    Best regards,
    Predrag

  • Katy
    • WPMU DEV Initiate

    We are currently using the free trail - Trial - Monthly (silver level)

    Checking the CDN settings the message reads:

    CDN is not yet active. Configure your settings below and click Activate. With a link to "Upgrade Plan"

    We need to test the CDN feature as part of the free trail - please can you explain how we do this?

    thanks

  • Katy
    • WPMU DEV Initiate

    We've gone ahead & upgraded as we needed to test.

    We've found that background images are not served by the CDN, so are not resized.

    For example, on this URL:
    https://www.thempagroup.co.uk/our-work/

    The following image is used as a background image:

    <div class="listing__item-image" style="background-image:url('https://www.thempagroup.co.uk/wp-content/uploads/2017/08/shutterstock_395205550_PURCHASED_DIGITAL-ONLY_RF.jpg');">
    </div>

    It is not served via the CDN & is not resized.

    Is it possible to configure SMUSH so that background images are served via CDN?

    thanks

  • Adam Czajczyk
    • Support Gorilla

    Hello Katy

    Is it possible to configure SMUSH so that background images are served via CDN?

    Yes, as long as it's set by an "inline CSS" (like in your example above) and not via the separate CSS file. It's also important that it's not "fixed" (hard-coded) but rather displayed there using using WP's default "wp_attachment()" functions. It also has to be coming from Media Library.

    If these requirements are met, make sure that you have at least following options enabled on "Smush Pro -> Smush CDN" page

    - "server background images from CDN"
    - "Enable automatic resizing of my images"

    You might also need to clear cache on site/server after making any changes to make sure they are applied. If that still doesn't help, let me know please. In such case I'd also want to take a closer look at the site so please enable support access to it by going to the "WPMU DEV -> Support -> Support Access" page in site's back-end and clicking on "Grant support access" button there (just let me know once it's done as I won't be notified automatically).

    Best regards,
    Adam

  • Katy
    • WPMU DEV Initiate

    Hi Adam

    "server background images from CDN" - I don't see that option on "Smush Pro -> Smush CDN" page

    We are running version 3.2.1 - do we need to install latest version or is the setting somewhere else?

    Support access has been granted & cache cleared, please advise next steps asap.

    thanks,
    Dom

  • Adam Czajczyk
    • Support Gorilla

    Hello Katy

    Yes, in this case you'll need to update Smush Pro as background images optimization was introduced in 3.2.2 release, along with a lot of additional enhancements and important fixes. The current version is 3.2.2.1 and I'd strongly recommend using this one.

    To update plugin please go to the "WPMU DEV -> Plugins page" and click "Update" button next to the "Smush Pro". It will update the plugin to the most recent release, giving you access to the background images processing feature (please note: you still might need to clear caches on site after update).

    Best regards,
    Adam

  • Katy
    • WPMU DEV Initiate

    Hello,

    We've upgraded to 3.2.2.1, enabled - "server background images from CDN" and enabled "automatic resizing of my images" via the SMUSH settings but some background images are still not being served via CDN and are not being automatically resized.

    For example, https://www.thempagroup.co.uk/news/

    <div class="listing__item-image" style="background-image:url('https://www.thempagroup.co.uk/wp-content/uploads/2019/07/shutterstock_526745899-1024x535.png');">
    </div>

    This image is not being served via eth CDN & is not resized.

    Please can you review & advise?

    Many thanks

  • Adam Czajczyk
    • Support Gorilla

    Hello Katy

    Thank you for response!

    it seem then that there's something involved that "breaks" that feature but by checking "from outside" only I'm afraid I can't really tell yet what would that be.

    I'd like to take a closer look at this so would you mind enabling support access to the site for me? To do so, please go to the "WPMU DEV -> Support -> Support Access" page in your site's wp-admin area and click on "Grant support access" button there.

    Once that's done, let me know here, please, as I won't be notified automatically.

    I'll then access the site and investigate the issue to see how to fix it.

    Best regards,
    Adam

  • Predrag Dubajic
    • Support

    Hi Katy,

    I had a look at your page and it seems that the issue might be somewhere in the theme code and how the images are being included in there.
    From what I see this is a custom theme for your site so I was unable to find anywhere to download it and check it further on my end.

    Could you zip your theme, upload it to any file sharing service like Dropbox or GDrive and share the download link so we could check it out more in-depth?
    Also, if the theme has some plugins that it requires to be active for it to run please include those as well.

    Best regards,
    Predrag

  • Adam Czajczyk
    • Support Gorilla

    Hello Katy

    I've downloaded the theme and tried to install it on my test site but the installation fails with "missing stylesheet" message.

    I looked into the .zip file that you provided and there's indeed no "style.css" file - which is one of the core files of any theme and is required. Could you please double-check if the theme package that you shared is complete and share a complete one with me again?

    Or is there any specific, additional step required to install that theme, different than with regular installation?

    Best regards,
    Adam

  • Katy
    • WPMU DEV Initiate

    Hi Pedrag,

    I've spoken to our developers, they can't see anywhere Autoloader.php is actually doing anything on the site, and no notes have been left in the code by whoever it was that originally built it.

    They suggest that you comment out line 253 in Functions.php and that should bypass the error.

    Let me know if there is a still an issue though.

    thanks,
    Dom

  • Predrag Dubajic
    • Support

    Hi Dom,

    I'm afraid that still didn't help :slight_frown:
    While it did remove the first error the new one popped up right away:
    PHP Fatal error: Interface 'MpaSoapInterface' not found in /wp-content/themes/mpa/inc/classes/MpaSoap.php on line 3

    So I then excluded call to MpaSoap.php as well, but then next error emerged:
    PHP Fatal error: Uncaught Error: Call to undefined function get_field() in /wp-content/themes/mpa/inc/module-functions.php:32

    I'm afraid that commenting stuff further will not help as we can stop some of the theme functionalities and then testing it with Smush might not have any sense.

    If your devs could double-check the theme, install it on clean WP installation and get it running there, then zip that working version and send it over we will gladly investigate it further.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.