App for Cloudflare® Pro

App for Cloudflare® Pro 1.8.6

Issues with thumbnail imagen

Carlos

New member
Hello,

I notice that some images of thumnails are broken, but if you go to the actual images, they are working fine. This is doing it on some images only where there is a thumbnail image. All images are uploaded to CloudFlare, and the site still fetches thumbnails from the main site upload path. I check the web console and see the path to the actual site upload folder and not CloudFlare.

I check the medial. mywebsite link and the image shows fine If I check the actual url to the main site, it just redirect to the home page the imagen that are working show the correct path to media.mywebsite but some still show to the actual upload folder not matter how many times I deleted them and reuploaded.

1725445489544.png


I try deleting the image and uploading it again; I also try renaming it and uploading it again, and it still does the same issue.

Here are some thumbnails working on some products with the path to media.mydomain

1725445797115.png

Here some thumnail not working still showing the upload path to the main site.

1725445862005.png

Any way to resolve this issue?

Thanks,
 
Sure, here the code when I right-click on terminal on that broken image

Code:
<img width="150" height="150" src="https://media.allywebsite.com/2024/07/plugin-and-theme-bundle-150x150.png" class="attachment-thumbnail size-thumbnail" alt="WordPress Themes &amp; Plugins Bundle 4000+" decoding="async" loading="lazy" srcset="https://allywebsite.com/wp-content/uploads/2024/07/plugin-and-theme-bundle-150x150.png 150w, https://allywebsite.com/wp-content/uploads/2024/07/plugin-and-theme-bundle-100x100.png 100w" sizes="(max-width: 150px) 100vw, 150px">
 
All 3 images in there are working (well the first one works directly, the other 2 redirect to the working URL). As far as making them work without a redirect, are you using a custom theme or anything? Because whatever is doing the srcset generation doesn't seem to be utilizing the WordPress filter for srcset URL generation (it looks like it's just making it's own srcset URL based on default locations of WordPress).
 
All 3 images in there are working (well the first one works directly, the other 2 redirect to the working URL). As far as making them work without a redirect, are you using a custom theme or anything? Because whatever is doing the srcset generation doesn't seem to be utilizing the WordPress filter for srcset URL generation (it looks like it's just making it's own srcset URL based on default locations of WordPress).
No its not a custom theme; its Flatsome theme and they are working now after I added the Cloudflare redirect code you provided. Thank you so much ❤️
 
Well by custom, I just mean not made by WordPress/Automattic. Third party themes don't always adhere to what they are "supposed" to be doing. Basically WordPress has a built-in function (since WordPress 4.4), wp_calculate_image_srcset() that themes are supposed to call when they are generating srcset URLs. My guess is that the theme is using srcset URLs, but not actually passing them through that function so they can be altered to what they *should* be.

The redirect rule certainly works around that by redirecting the underlying request to where it should be, however it would be nice if theme authors would do it "right" and no redirect would be needed. :)
 
Back
Top