WP Offload Media 2.5 Released: Improved WooCommerce Integration and New Tool for Already Offloaded Files

#

It’s been a busy few months since our last release. In that time we’ve been hiring, settling into a regular release cycle format, planning out the future roadmap for the plugin, and working hard on new features and improvements.

Today we’re pleased to announce the latest release of WP Offload Media, version 2.5 🎉

This release has two main features, let’s get into it.

Improved WooCommerce Integration

WP Offload Media has had WooCommerce integration since the beginning, and that comes in the form of using the official WooCommerce Amazon S3 Storage addon’s amazon_s3 shortcode. This was a little confusing, as despite the shortcode having S3 in its name, it works for all storage providers.

WP Offload Media would make sure any file you add to a product is offloaded to your chosen storage provider, set it as private, and then delivered it to customers with the storage provider or CDN URL.

Our existing implementation meant it was hard for users who had an established WooCommerce store with lots of products, to start using WP Offload Media and get going quickly. They would have to go through all their products and re-save them so that WP Offload Media could replace the product file paths with the S3 shortcode. Not ideal.

I’m pleased to say that with this release, WooCommerce integration has become much more seamless 🎉

There’s three parts to our improvements.

Rewriting Local URLs

WP Offload Media will detect if a product’s file has been offloaded to S3 and when a customer downloads the file it will automagically rewrite the file URL to the storage provider or CDN URL.

This means if you install WP Offload Media on an existing site, perform the bulk offload of existing media, you then don’t need to do anything further to get it to deliver your WooCommerce files.

magic

Remove Shortcode Dependency

As I mentioned before, our use of the amazon_s3 shortcode has been something we’ve done for years but doesn’t quite fit with our approach of using local URLs that get rewritten when they are needed.

With this release, we have removed the use of the shortcode. If you are adding a file to a WooCommerce downloadable product and select a media library item that has been offloaded to a storage provider, you will now see the storage provider or CDN URL instead of the shortcode in the product files metabox.

Gif of adding offloaded file to WooCommerce product

We will actually store the file’s local URL in the database, which will be rewritten dynamically when the file is downloaded. Of course, existing shortcodes will still work just fine.

New Cleanup Tool

We’ve added a new tool to the WP Offload Media settings screen sidebar that helps clean up a site with an existing WooCommerce store and offloaded media items. This tool will:

  1. Remove all traces of our use of the amazon_s3 shortcode, and replace with the local URL
  2. Ensure all product files that have been offloaded are set to private on the storage provider

The tool is helpful for making sure offloaded media is made private in the bucket without having to update products or toggle the access on the media library item manually. It’s also helpful if you have existing products where you are unsure about the private/public status of the offloaded file, this tool checks and updates all of them to private at once.

WP Offload Media can still act as a drop-in replacement for the WooCommerce Amazon S3 Storage addon, and still supports its amazon_s3 shortcode format that includes bucket and object attributes. However, if WP Offload Media recognizes that the referenced object belongs to an offloaded Media Library item it will upgrade that shortcode to a standard URL too.

Learn more in the WooCommerce integration doc and the WooCommerce Cleanup Tool doc.

New Add Metadata Tool: For When Your Media is Already in a Bucket

Although the usual process of WP Offload Media is to offload existing media library items to the chosen storage provider, and then offload all new items added to the media library, we have gotten many requests over the years to handle the opposite flow.

What I mean by that, is that many users already have all their media library files in S3 or another storage provider and they want to install WP Offload Media, point the plugin at their storage provider and existing files, and get WP Offload Media to start serving them from there.

We see this a lot with users who have used WP Engine to host their site, and have used the LargeFS system to store their files in an Amazon S3 bucket. Now they are migrating their site away from WP Engine, but want to keep using their media in their S3 bucket.

We also often have new customers migrating from a competitor’s plugin that wish they could just point WP Offload Media at the already offloaded Media Library files.

And some customers have manually offloaded their Media Library files from the server to the bucket using a command line tool or similar, they too wish they could just point WP Offload Media at those offloaded files.

However, up until this release, the only way to get WP Offload Media to work for these users is to download, and re-offload the items to the storage provider.

For a large media library, this is time consuming and costly! 😬

The new Add Metadata tool solves this issue without the need for re-offloading. After installing WP Offload Media and the storage provider has been configured to reflect where the existing media library lives, you can run the tool to tell WP Offload Media to add the special metadata for all media library items that haven’t been offloaded.

The tool then connects WP Offload Media with the already existing media items on the storage provider, and will start to serve them from there.

As the tool is used for a very specific reason, it isn’t visible in the plugin sidebar all the time. It needs to be turned on by defining the AS3CF_SHOW_ADD_METADATA_TOOL constant:

Add Metadata tool shown in sidebar

Once WP Offload Media has added the special metadata for some media library items, it can then verify their files do actually exist on the storage provider. If the tool finds items that don’t exist on the storage provider, for example if the wrong storage provider bucket was configured in the plugin settings before the tool was run, the tool will let you know if there are minor issues with any items, and removes new metadata that is unusable.

Check or remove items created with the Add Metadata tool error notice showing details

It’s then possible to address problems in the bucket or change WP Offload Media’s settings and re-run the Add Metadata tool to create records for Media Library items that are still missing offload metadata.

If the Add Metadata tool was run by mistake, or for some other reason the new metadata needs to be removed, the tool has the ability to remove all metadata records it created without touching offload metadata created though normal offloads.

Learn more in the Add Metadata Tool doc.

And More

In addition to these major improvements, we’ve squashed a number of bugs, including fixing an issue where regenerating thumbnails of offloaded images could be disabled if the pre-scaled original image had been offloaded and removed from the server.

Check out the changelog for all the details.

Welcome Erik 🎉

I’m really excited to announce that Erik Torsner, an experienced software developer from Stockholm, Sweden has joined our team. He’s really hit the ground running, working with Jonesy to get this release out the door. In fact, you can thank him for the improved WooCommerce integration. If he replies to your support request, please join us in welcoming him to the team.

Next Up

The WP Offload Media plugin screen hasn’t had much of a refresh since we launched it back in 2015. Our designer Lewis has been working his magic on the UI, just as he’s done with the soon to be released WP Migrate DB Pro 2.0 UI. Keep an eye out for that in the next release.

Despite the rise of Gutenberg, we still see a large number of our customer base using page builder plugins and themes like Elementor, Divi, WPBakery and Beaver Builder. These page builders typically handle saving of media item URLs in their own way, which doesn’t always play nice with our plugin.

Although we added some fixes for compatibility issues with Divi in WP Offload Media 2.4, released in July, we are planning on adding fixes for more of the other popular page builders in the next version.

As Brad mentioned last time, a big item on our roadmap is an improved plugin setup process, similar to the wizard we developed for WP Offload SES. This is something we are working on and should appear some time after the UI update.

If you’re not already on our email list, be sure to subscribe to stay tuned.

Are you excited about the features we just launched or the ones we plan to launch next? What else would you like to see in WP Offload Media? Let us know on Twitter or in the comments below.

About the Author

Iain Poulson

Iain is a WordPress and PHP developer from England. He builds free and premium plugins, as well as occasionally blogging about WordPress. Moonlights as a PhpStorm evangelist.