[WP Smush Pro] New Smush Pro CDN generating error

I have network activated SmushPro site wide and it is reporting an error upon trying to access an image on delonginsurance.com which is a part of the network.

Error:
{"success":false,"data":"Site not registered in the Hub."}

URL to CDN:
https://2974.smushcdn.com/0/wp-content/uploads/sites/202/2018/08/DeLong-Insurance.png?lossy=1&strip=1&webp=1

  • Ash
    • WordPress Hacker

    Hello johnol

    I am sorry to know that you had some issues with smush. I want to take a look at your setup. Would you please enable support access so that I can check? Please follow this article to enable support access: https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-5

    Also, would you please explain a bit more about this:

    It is breaking sites throughout the multisite environment. Super frustrated.

    I mean, please include the details how I can replicate it and how it breaks etc.

    Have a nice day!

    Cheers,
    Ash

  • johnol
    • Site Builder, Child of Zeus

    Ash, we disabled the CDN after getting this error.

    I told you how the error was being generated... if you visited a link to any image generated by the CDN you would get an error like to this:

    {"success":false,"data":"Site not registered in the Hub."}

    It's a pretty straightforward bug report. I'm not sure what else to tell you.

    We had to disable the CDN feature because of this error, not much you can replicate. I will not allow this to be re-deployed on our Multisite environment for "testing" because it impacts hundreds of live sites.

    My guess is that you folks somehow have this tied together with your "HUB" management and your plugin is checking to see if the site is actively managed with the hub and if not is causing the error. The problem is that I'm not using your "HUB", particularly since I'm using multisite mode.

    You folks got your start creating multisite specific plugins and I'm doubly frustrated that you appear to be pushing folks to have to use the HUB rather than relying on the normal multisite process.

    As an aside (and a caution against others considering your CDN) I have separately logged a different ticket about the fact that your "CDN mode" removed all the images from our media libraries in the backend across all of our sites in the multisite network...

  • johnol
    • Site Builder, Child of Zeus

    I was chatting with support about this ticket and they suggested I remind you that:

    * This is a network-activated installation of Smush Pro within Multisite
    * We have subsites all mapped to other domains
    * The issue is happening with images that reference the mapped domain

  • Nithin
    • Support Wizard

    Hi johnol,

    Sorry to hear about the issue you are noticing, this seems more like a bug, rather than any specific action within the plugin side related to Hub.

    Could you please try the following patch attached below, and check whether it works fine in your system? You can replace the file in the following path:
    /wp-content/plugins/wp-smush-pro/core/api/class-wp-smush-api-request.php

    This patch will be made available in the upcoming plugin version, so that you don't have to worry about the changes getting overridden after plugin update.

    Please let us know how that goes, so that we could give a closer look, if needed. Have a nice day ahead. :slight_smile:

    Regards,
    Nithin

  • Ash
    • WordPress Hacker

    Hello johnol

    Thank you for the update. https://delonginsurance.com/ is mapped domain right? But looking at your source, it seems it uses the original subsite URL to load images.

    To check if it related to smush CDN, would you please turn off smush CDN and then check if the image is loaded over
    https://delonginsurance.websitesrvr.com/wp-content/uploads/sites/202/2018/08/delong-pet-insurance.jpg
    or
    https://delonginsurance.com/wp-content/uploads/sites/202/2018/08/delong-pet-insurance.jpg ?

    If the image is loaded over the mapped domain, then the smush URL should replace it. Please let me know about this.

    Have a nice day!

    Cheers,
    Ash

  • johnol
    • Site Builder, Child of Zeus

    Hi Ash, you are assuming it will be either/or when in fact it will often be both.

    In multisite, it will often reference domain.multisite.com and then separately domain.com when referencing images. WordPress doesn't strictly do one or the other when domains are mapped.

    So the plugin needs to be aware of this and it needs to capture *both* which it is *not* doing. Make sense?

    With mapped domains enabled, presently it is *only* finding and serving images that are strictly mapped to the domain without properly understanding the above construct.

    So in the example above with Smush pro enabled, delonginsurance.com/path-to-images is being re-written but delonginsurance.websitesrvr.com (The multisite root) is being ignored. You must fix the plugin so it captures both the mapped domain and the original unmapped domain. That's the only way to make it work intelligently.

    -John

    PS - I would add that from an SEO perspective, having multiple domains helps to parallelize image downloads which gives a positive boost in ranking power...

  • Ash
    • WordPress Hacker

    Hello johnol

    In multisite, it will often reference domain.multisite.com and then separately domain.com when referencing images. WordPress doesn't strictly do one or the other when domains are mapped.

    When you use mapped domain in a subsite, that subsite should not have any instances of original URL - domain.multisite.com, all those links should be replaced by the mapped domain.

    It actually seems the builder issue. Not sure if they save the post content in meta, some builder does that. Do you have any test site where we can check the issue without the builder? Please let us know.

    Have a nice day!

    Cheers,
    Ash

  • johnol
    • Site Builder, Child of Zeus

    Ash, why is it difficult to make the plugin work for both scenarios?

    That way, regardless of builder behavior, Smush works.

    We have globally replaced URLs across the site. That stated I again encourage you to make the plugin as flexible as possible to deliver as much value to your users as possible.

    (There's no way for us to "monitor" how clients might upload images to their sites... thus disrupting the value of the Smush plugin because it is so narrowly constructed to follow an either/or scenario with domain mapping rather than a BOTH which makes infinitely more sense...)

    -John

  • Nithin
    • Support Wizard

    Hi johnol,

    I do get what you are trying to state, and I have brought this into our developers attention, so that they could give a closer look at the possibilities of improving this down the plugins road map.

    Really appericate your suggestion regarding this. Have a nice day ahead. :slight_smile:

    Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.