• Resolved nunosaraiva91

    (@nunosaraiva91)


    Hi!

    I’m struggling to make the plugin “Offload Media Lite” work with web-stories when I need to set a “Poster Image” on a given story

    Steps to reproduce my error:
    – I upload a new image to the Poster Image
    – The image is successfully uploaded with the right CDN url:
    https://cdn.<my-domain>/uploads/2022/10/<image-name>.jpg
    – The plugin now requires me to click on “Set as Poster Image”
    – It opens the Edit image dialog in order for me to cut the image to the right size
    – It generates a new cropped image with a wrong CDN url, by prefixing my local url with the CDN url:
    https://<my-domain>/app/uploads/s3euwest1://cdn.<my-domain>/uploads/2022/10/<image-name>.jpeg

    I already checked my CORS configurations and its working all just fine. I’ve been using “Offload Media Lite” for the last 5 years now.

    This also happens to the “Publisher Logo” image uploads

    Here’s some of my “Offload Media Lite” settings:
    – Offload Media: yes
    – Remove Local Media: yes
    – Add Prefix to Bucket path: “uploads/”
    – Add year & Month to Bucket Path: Yes
    – Add Object version to Bucket Path: No
    – Deliver Offloaded media: Yes
    – Use Custom Domain Name (CNAME): cdn.<my-domain>
    – Force HTTPS: yes

    Versions:
    “WordPress”: 6.0
    “Offload Media Lite”: v3.0.2
    “Web-Stories”: 1.27.0

    Is there something that I’m missing?
    Is this something that already happened to someone?

    Thank you for your support!

Viewing 15 replies - 1 through 15 (of 16 total)
  • @nunosaraiva91 Thank you for reaching out with your topic. While we try to reproduce this on our end, could you please share a few additional details?

    Could you provide your Site Health information so we can check on your site and story URL? You can share privately if you prefer.

    Thread Starter nunosaraiva91

    (@nunosaraiva91)

    Hi @luckynasan !

    I’ve just filled out the form with the requested information.

    Thank you for your support!

    @nunosaraiva91 Could you please share the affected story URL in the form or here?

    Hi there! I’m also having the same issue with the same plugin. Commenting here to receive replies on this topic. Thank you!

    @pablodias If you are having troubles with your Stories plugin then please open your own topic as per the forum guidelines and we will be happy to help you there.

    I don’t think flooding the forum with the exact same issue is the best way. As I said before, I’m having the same problem as reported by Nuno. As long as you guys don’t solve the issue in private messages with him, considering we are in a public forum I think eveyone can benefit from this thread.

    Thanks!

    @pablodias I appreciate the idea behind posting on this topic as you are facing the same issue but users facing the same or similar issues aren’t always due to the same cause although they can be.

    It’s easier for us to track these if you open your own individual topic where we can assist you separately. If a solution is found on this topic or any similar then we will of course communicate that on your own topic also to test.

    Thanks.

    Ok!

    Thread Starter nunosaraiva91

    (@nunosaraiva91)

    Hi @luckynasan

    I don’t have any public URL with this problem at the moment as having this problem in production is not ideal. Is it strictly necessary? If yes I’ll try to have one isolated page with that.

    Either way, I’m fixing this problem by using the hook “wp_get_attachment_url” and fixing each URL with this pattern:

    if (str_contains($url, 's3euwest1://cdn')) {
        $url = preg_replace('/^.*s3euwest1:\/\//', 'https://', $url);
    }
    
    return $url;

    which is not ideal at all, but it works while I figure a proper solution to this.

    And just to explain what output I get on the frontend when using the “stories” block on the Gutenberg editor is basically that widget with broken poster images with the following URLs:

    https://<my-domain>/app/uploads/s3euwest1://cdn.<my-domain>/uploads/2022/10/<image-name>.jpeg

    Clicking on each story from the widget, works as expected (opens the story), but the poster image is broken

    Let me know if you still need a public URL with the Gutenberg “stories” widget.

    Thanks!

    @nunosaraiva91 Thanks for sharing the workaround that’s very useful to know. In the meantime I am running some tests to try and replicate this but so far have been unable to. Could I check with you what hosting provider you are currently with?

    Thread Starter nunosaraiva91

    (@nunosaraiva91)

    Hi @adamdunnage my hosting provider is DigitalOcean and I’m using 2 web-servers (droplets) with 1 loadbalancer and 1 Managed Database.

    That’s why I need to offload everything to a CDN and not keeping files on the filesystem, so my web-servers are pure atomic and stateless. That enables me to replace them with new servers everytime I need to publish a new version

    @nunosaraiva91 Thanks for sharing the information. We will continue to test this on our end. So far we have been unable to replicate the issue. If we have any updates then we will drop them in here.

    @nunosaraiva91 Are you still facing issues with this?

    Thread Starter nunosaraiva91

    (@nunosaraiva91)

    Hi @adamdunnage I was expecting some feedback from your side about you being able to reproduce this problem.

    As it seems there are more cases like this, considering @pablodias replies to this thread.

    In the mean time, I was able to “fix” this problem by str_replacing the “bad” URLs with the wp_get_attachment_url hook as I mentioned in the reply above.

    @nunosaraiva91 Unfortunately I have been unable to replicate this on my side which makes troubleshooting this tricky. It’s good to hear you have a workaround in the meantime but any further information you could share on this would be greatly appreciated.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Offload Media Lite don’t work for Poster images’ is closed to new replies.