Hi @opicron,
I actually started to replace the
file_exists
checks by a custom function that will call a filter (and then let you handle the check), but there is another issue…
The plugin does a lot of checks like: does the file exist? Yes? Then it checks its size and compares it. If different, it deletes the file and creates a new one. But in this case, that will not work at all.
Thing is if you are using S3 or remote storage, WordPress doesn’t really work with those files anymore. All the existing plugins which handle this are half-cooked, only handle the uploads well (and hopefully, the deletes), but it’s more complex than this, and all the file operations should be handled. Some plugins work with EXIFs, some other regenerate thumbnails, rename or move files around, and in the case of WP/LR Sync… keep then synchronized.
Ideally, WordPress will add its own functions for dealing with files one day. Then, those plugins would hook on those. Right now, they just hack through WordPress and they leave it full of holes, and for me, that sounds like… quite a mess.
It’s better to keep those files safe next to the WordPress install, and CDN solutions are extremely good at making all this fast.
I can push the new plugin with the change, and you can try to play with it, but I doubt the updates of files will go smoothly.
You could try to modify WP/LR Sync to make it works in your case, by, as I did, replacing the system calls by functions in WP/LR Sync (which are using apply_filters), and try to make a little plugin for WP/LR Sync + the remote upload plugin you are using. I am pretty sure you could do it but you would need quite a lot of patience ??
I will definitely include the changes in the plugin if it’s clean, and you could upload that plugin on the repository too. That could be interesting too.