Support » Plugin: WP Offload Media Lite for Amazon S3, DigitalOcean Spaces, and Google Cloud Storage » [Question] Is there a way to trigger upload, not via media

  • Hi guys,

    Just want to start by saying – I’ve been using WP Offload since the early days of S3 Offload and I absolutely love it – thank you! 😊

    On to my question – so I have started using WebP Express, which generates a WebP variant of my images when they’re requested. Obviously, they’re not directly requested via my site as I’m using WP Offload and all my assets are being served via Cloudfront – however if I were to call my assets manually, a WebP would be generated on my server. So my question is… when that happens, is there a way for me to somehow get WP Offload to fire and upload those WebP’s?

    I could try to do it via W3TC with a custom rule thingymabob, (off-topic from here) but I’m a bit wary of doing that given that I set a (very small!!) folder to upload and I’m now lumped with a bill that costs more than my annual hosting and multiple million monthly PUT’s in my bucket – an issue I’ve NEVER had with WP Offload!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor ianmjones

    (@ianmjones)

    Thanks for the kind words @willstockstech!

    There’s a few ways this could be accomplished.

    Ideally the plugin you’re using to generate those WebP files would properly register the thumbnail sizes and then ensure that wp_update_attachment_metadata is called with the correct relative file paths in the data. WP Offload Media automatically handles re-offloading a Media Library item and its thumbnail sizes when they’re updated.

    Otherwise you could register those sizes and trigger the above yourself.

    Another option (and probably easiest) is to use WP Offload Media’s as3cf_attachment_file_paths filter to specify that there’s more files to be offloaded than those in the attachment’s metadata. Check out the Tweaks plugin…

    https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront-tweaks/blob/cb7c645d84969d58b43dd43b918c6c5c75218099/amazon-s3-and-cloudfront-tweaks.php#L396

    You could then trigger the re-offload via wp_update_attachment_metadata as necessary, but don’t need to adjust the data.

    Hope that helps.

    Will Stocks

    (@willstockstech)

    Thanks @ianmjones – that’s some great insight!

    I’ve linked this topic in a Github comment (https://github.com/rosell-dk/webp-express/issues/161) for the plugin in question ☺️

    My only thought is – if I wanted to rewrite images web variant for supported browsers… Any thoughts off of the top of your head how one could achieve this whilst still using WP Offload?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.