[Smush Pro] Images disappear with CDN enabled in smush pro

I am on MPMUDEV hosting and images disappear from blog posts when I enable CDN in Smush Pro. I will leave it enabled for now so you can see the problem in action at https://charliesmama.multipress.net

  • dubya
    • The Incredible Code Injector

    This may be related…

    [23-Aug-2019 19:15:23 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/web/site/public_html/wp-content/plugins/wp-smush-pro/core/modules/class-wp-smushit.php on line 400

  • Adam Czajczyk
    • Support Gorilla

    Hi dubya

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

    I checked the site and I can see the issue there. The warning that you shared doesn’t seem to be “directly responsible” for the issue but might actually indicate some related “under the hood” issue. The main problem here is that these images – if fetched from Smush CDN – return 404 (not found) errors, just like they were not uploaded to the CDN or CDN was rejecting connections.

    This is a bit surprising but there must, of course, be a reason for this. For now, I left CDN disabled so you site wouldn’t be affected but we’ll investigate it further. I would, however, want to ask you something about the setup:

    I noticed that it’s kind of “mixed” multisite where some sub-sites are “sub-folder” sites and some are “sub-domains”. Is this a sub-folder setup with just some sub-domains mapped to sub-sites?

    Also, is this issue with images happening from the beginning (when you started using CDN) or e.g. after some changes were made to the site (or updates or sth similar) or after it was e.g. moved to WPMU DEV Hosting?

    Let me know please!

    Best regards,

    Adam

    PS. Please make sure that support access for the site is kept open. It’s time-valid and might expire on its own otherwise, if not manually extended.

    • dubya
      • The Incredible Code Injector

      Hello. Sorry for the delay, I have been offline while dealing with a family emergency.

      As for the mixed state, the subdir sites were created before converting to a subdomain setup and are merely test sites that I hadn’t gotten around to deleting yet. I’ll do that and see if it makes a difference, but both the subdirectory and subdomain sites were working fine until I enabled CDN.

      I think Tony G is on the money about the urls changing as I recently added wildcard ssl and moved charliesmama.multipress.net from multipress.net/cm-dev-2/ with snapshot pro.

  • Tony G
    • Mr. LetsFixTheWorld

    I’ve seen this too and it’s not related to WPMUDEV hosting. It seems like the CDN has been configured to be very “sticky”. In other words, once content is placed in the CDN, it doesn’t get refreshed and/or links don’t change. I say “and/or” because it looks like when images are changed in the media library that they are not changed in the CDN, or sometimes the CDN link changes but the site doesn’t point to the right image, perhaps because the site is still generating the old CDN link.

    In general, I don’t see this as a single “one line fix” kind of issue. I fear that developers at Dev will poke at this for a long time, trying unsuccessfuly to find one small issue to fix, and I don’t think this one will be that simple. I really hope Dev does a complete review of exactly how changes in the media library relate to the CDN, and how content then refers to the correct CDN links.

    THEN, explain it to us! Tell us what we should expect when we crop an image, or smush it, or change the alt-text. Tell us how to completely reset the CDN. Tell us if that actually removes images from the CDN or if we’re just uploading more content and getting new links. How does this relate to cache?

    To me, this aspect of Smush isn’t documented well, and sometimes that tells me the developers haven’t really thought through the whole thing well themselves … that if they had to document exactly how it works they might find holes in their own processes. This is one of the benefits of documentation. You write it. You read it. You test to see if what it says is correct. You find out what is NOT there, which may point to deficiencies in the product. (Take that from someone who often has to write more code after reading my own documentation.)

    HTH

    • Adam Czajczyk
      • Support Gorilla

      Hi Tony G

      As for the issue itself: you might be right about those images/images URLs being changed and not fully/properly updated but I’d still like to hear from dubya first and do some more testing related to this as before jumping into conclusions I’d like to actually be sure what exactly happens in this case – the either I or our developers would look into it more to find out why and how to fix that (possibly for good, if you’re right about this behavior).

      As for your feedback: sounds like some really good points to me :slight_smile: Though as I’m nor a developer, neither QA tester and/or docs writer, I admit I don’t have much more to say than that I agree with you :slight_smile: So I have passed your entire message directly to the lead developer of the plugin so he could discuss this with his team.

      Thank you for your insight and feedback!

      Best regards,

      Adam

  • Adam Czajczyk
    • Support Gorilla

    Hello dubya

    Thanks for response. There’s been slight misunderstanding and I’m sorry for causing it. I actually didn’t ask you to remove anything, I only wanted to know more about how this was configured. I apologize for not being clear.

    As for the issue. I checked the setup again and did some more tests but I’ll need helping hand from our developers on this so I’ve already passed the case to them and asked them to help with investigation.

    Please make sure that the support access to the site is kept open and also keep an eye on this ticket for further information. We’ll be updating you here as soon as we get to know more from them.

    Best regards,

    Adam

  • dubya
    • The Incredible Code Injector

    Thank you. I’ve extended support access for another week. The Charlie’s Mama site is all but ready to have her domain pointed to it but I’ll hold off for now. Let me know if you need anything from me, I’ll be around :slight_smile:

  • Adam Czajczyk
    • Support Gorilla

    Hello dubya

    Thank you. I’m awaiting information on this from our developers. They’re looking into it but I must admit that their response time might be slightly longer than ours here on forum as they are dealing with a lot of complex tasks on daily basis.

    We’ll be updating you here as soon as we get to know more.

    Best regards,

    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.