Probably something that could be sent to the error logging system once I get that sorted out. Did I mention how dumb I think it is that WordPress has no internal error logging system? š
Yeah I can't believe how bad Wordpress is and even being open source nobody has taken time to improve it.. Did I mention how dumb I think it is that WordPress has no internal error logging system?
yes it isIs the file in your local filesystem still?
yes but it doesn't display all the records, only the recent onesYou can access it via the plugin on the R2 page in WordPress (clicking on class A and class B numbers for example).
Is the media flagged as being in R2 (orange cloud when browsing it in WordPress media system)?yes it is
Ya, itās not particularly greatā¦ their logging system is designed more for building specific queries and running those queries (itās why Cloudflare itself doesnāt even let you see it in their normal dashboard).yes but it doesn't display all the records, only the recent ones
the file was never transferred to r2 but it is on the file system. I ended up uploading it manually to R2 but it sucks because I'm finding there are other files which weren't transferred.Is the media flagged as being in R2 (orange cloud when browsing it in WordPress media system)?
Yes, none of the folders of the following plugins were uploaded to R2. In fact, I checked the filesystem and noticed the plugins created new folders in the upload folder (which shouldn't happen, they should be created in R2 instead):Do you have an example of one of the plugins so I can go digging on it? It would be nice if they at least used a different prefix so someone could differentiate them.
Ya, WordPress doesnāt have an abstracted filesystem like XenForo does, so we canāt just say everything going to the uploads folder goes to R2, instead we do need to hook into things upstream (which frankly is a pain in the ass), so the R2 stuff does work by hooking into the media system. Iāll look at those when I get back to a computer and see if maybe itās viable to hook into the individual plugins as well.Yes, none of the folders of the following plugins were uploaded to R2. In fact, I checked the filesystem and noticed the plugins created new folders in the upload folder (which shouldn't happen, they should be created in R2 instead):
View attachment 36
it's fine if the plugin files are being served from the file system but if the media files are being served from R2 their URLs across the database need to definitely be overwritten and pointed to r2Ya, WordPress doesnāt have an abstracted filesystem like XenForo does, so we canāt just say everything going to the uploads folder goes to R2, instead we do need to hook into things upstream (which frankly is a pain in the ass), so the R2 stuff does work by hooking into the media system. Iāll look at those when I get back to a computer and see if maybe itās viable to hook into the individual plugins as well.
Not sure there's a realistic way to do it just for media if there's nothing differentiating media vs. other things based on the URL itself. I suppose one could go into the database and do a find/replace with a SQl query, but that's going to get sketchy and isn't necessarily going to handle everything (for example how would you handle a 3rd party site that references the old URL without having access to their database/HTML source?) But for posts within your own site, you could do that via SQL find/replace.it's fine if the plugin files are being served from the file system but if the media files are being served from R2 their URLs across the database need to definitely be overwritten and pointed to r2
Ya, you should be able to since the expressions for Redirect Rules are fairly flexible. You would just need to know what to key on. If a "subdirectory" means it has more than certain number of slashes in the URI, you could key on that. Or maybe it simply doesn't start with "20" (media URIs normally start with the year... so anything that doesn't start with "20" would potentially cover any non-media that was uploaded since 2000). Really just depends on your site, how it's configured and what is unique about the URIs between media and third party plugin things that are uploaded into the uploads folder.Question: is there any way to set a dynamic rule in CloudFlare that redirects the media to R2 only if the file requested is not inside a folder?
We have all the uploaded images inside the /uploads/ older and if I can exclude the requests made to subfolders (which are the plugins) then I guess I can keep the redirect in place and keep serving the uploads from R2
Well, Wordpress uploads the media in folders with the date (if it is set up in that way) or just in the /uploads folder. Anything else (not matching the date folders but matching other folder name) could be not modifiedNot sure there's a realistic way to do it just for media if there's nothing differentiating media vs. other things based on the URL itself.
Well, right now I can't use R2 because any of my plugins don't create the files in R2 so I'm just in the middle and can't use R2 unless I have a Wordpress site with no plugins.Not sure there's a realistic way to do it just for media
If the referred url refers to a file inside /uploads folder or inside /uploads/year/month/ folder then redirect it to R2.(for example how would you handle a 3rd party site that references the old URL without having access to their database/HTML source?)
You should be able to minus the redirect part for old media, right? For example if you were to use it just going forward and not messing with old media (whereād you need redirects), it should work (the way the system works, itās not an either/orā¦ some media can be local and some can be in R2).Well, right now I can't use R2 because any of my plugins don't create the files in R2 so I'm just in the middle and can't use R2 unless I have a Wordpress site with no plugins.
Remember the problem is all plugins save their data on /upload/XXX (plugin name folder)so you could key on the URI starting with /uploads