WP Offload Media 2.2 Released: Offload Existing Media Items in the Background & More

It is with immense pleasure that we’d like to announce the release of WP Offload Media 2.2! 🎉

This release brings the much-requested background offloading of existing Media Library items. We’ve also included some huge performance improvements (especially for larger sites), as well as other new features, enhancements, and bug fixes.

Introducing Background Offloads

Prior to today, you had to keep a browser tab open when using the offload, download or remove from bucket tools. Not ideal, especially for sites with larger media libraries.

We’ve been wanting to do this one for awhile. In fact, it was July 29, 2014 when Brad added issue #2 to the newly created GitHub repo.

Background the Upload, Download and Remove From Bucket tools issue

We’ve added a lot of other great features and improvements to WP Offload Media since then, but we were finally able to prioritize this feature in this development cycle.

Clicking the “Offload Remaining Now” button in the following screenshot will start offloading the 400 Media Library items that currently aren’t offloaded.

WP Offload Media background tools with counts on pie chart shown

You can now just let WP Offload Media go about offloading those files in the background, close the tab and just forget about it. Or you can keep the tab open and monitor progress from WP Offload Media’s settings page.

WP Offload Media background offload in progress

When the tool finishes its job, you’ll get a notice in the WordPress dashboard, just like the existing Copy to New Bucket and Remove from Server tools.

WP Offload Media finished offloading media library notice

The new implementation is not only way more convenient, but also gets started far more quickly, especially on larger Media Libraries. For example, the old offload tool could take many minutes, if not hours on very large Media Libraries to just analyze the work to be done before it started offloading. The background offloader should only take a few seconds.

Performance Improvements

Talking of making things faster, there’s been some massive improvements in performance across the WordPress dashboard. In particular, multisites with thousands of subsites should find WP Offload Media’s settings page is now usable!

While working on this release I used the scripting power of WP Migrate DB Pro to create a multisite install of WordPress with 1,234 subsites (I know, cute eh?), and over 155,000 offloaded Media Library items in 140,000 posts scattered across 160 of those subsites. I was aiming for 2,000 subsites and over 300,000 Media Library items, but it turns out a small $5 per month DigitalOcean Droplet isn’t quite cut out for serving 2,000 WordPress sites, shocker! 😜

With the old version of WP Offload Media 2.1.1 this is what I saw when I tried to access the settings page on this resource-restrained server. 😢

504 Gateway Timeout on large multisite settings page

But with the new and improved WP Offload Media 2.2 I had far greater success! 💪

WP Offload Media 2.2 on large multisite settings page

The 504 Gateway Timeout for the old version was actually down to memory exhaustion in the Query Monitor plugin when trying to parse the backtrace, likely due to the shear volume of SQL queries that the old WP Offload Media plugin used to perform on every settings page load.

At the top of the above screenshot for WP Offload Media 2.2 you can still see a pretty large number of SQL queries reported by Query Monitor, 1,242 in fact. However, that’s from an initial clean and uncached state. The next reloads of the settings page were much leaner.

WP Offload Media 2.2 on large multisite settings page lean

Yup, that’s right, instead of 1,242 queries taking 9.0795 seconds of database time, the second load performed just 8 queries in 0.0037 seconds! That my friends is the power of refactored code, transients, statics, and a properly configured object cache courtesy of SpinupWP! 🎉

Other Changes

As always, there are other new features, improvements and bug fixes to be had in a new release of WP Offload Media, you can see them all in the changelog.

Next Up

There are more big changes for WP Offload Media lined up for development as we continue to add new features and improvements as requested by our customers, but we’re always looking for more ideas. Let us know in the comments the one feature, big or small, that you’d like to see added to WP Offload Media.

About the Author

Ian Jones Senior Software Developer

Ian is always developing software, usually with PHP and JavaScript, loves wrangling SQL to squeeze out as much performance as possible, but also enjoys tinkering with and learning new concepts from new languages.