App for Cloudflare® Pro

App for Cloudflare® Pro 1.8.9

Issue with plugin that uses /wp-content/uploads

moonlike1871

New member
One more question.

The Smash Balloon Instagram plugin downloads and creates thumbnails of an Instagram feed so that you can embed small Instagram image feeds in your site.

It uses the /wp-content/uploads/sb-instagram-feed-images directory to create downsized thumbnails to serve. The images don't get added to your Wordpress media library, they're temporary files.

When enabling the R2 image uploads, it breaks the feed; you can see that the feed image URLs are getting converted to the new media.siteurl.com/sb-instagram-feed-images/tempImageName.webp but they don't exist there, presumably because they're not normal Wordpress media. They still exist in the siteurl.com/wp-content/uploads/sb-instagram-feed-images/tempImageName.webp directory.

Any suggestions on how to resolve this? The only way I can do it now is to disable the image resizing which results in a series of full-resolution Instagram images being served at tiny thumbnail sizes, which cause a huge amount of data to be downloaded.
 
I don’t know anything about the plugin, but my guess is they are partially (but not fully) using WordPress built-in filters and hooks for the WordPress media system.

Specifically, it seems like they are using the filter that transform media URLs, but the weird thing is the R2 hostname only becomes part of it if the attachment meta record is flagging it as being in R2 (that’s how you can have some media in R2 if you wanted and some not). And the plugin is only going to flag it as being in R2 if it was actually transferred to R2. Maybe it was transferred to R2 as part of the normal media hooks/filters but then after that the plugin deletes it since it was temporary?

Hard to say exactly what it’s doing. Do you have a link to the plugin?
 
Sorry it took awhile (some real life stuff came up that needed to be attended to)... been poking on it to figure out what's going on. For me it so far seems to be working as expected. However, I just had a thought... do you by chance have a Redirect Rule in your Cloudflare dashboard that would be redirecting the underlying image request to your R2 bucket? So far, that's the only thing I can think of that would cause what you are seeing.
 
Back
Top