We’re super excited to bring you a new release of WP Offload Media.
Version 3.4.0 delivers full support for WordPress 7.1, performance improvements and bug fixes, along with foundational changes that unlock future features and further performance improvements.
WordPress 7.1 Compatible
WordPress 7.1’s client side media handling brings along three new fields to the _wp_attachment_metadata records in the postmeta table related to Media Library items.
Namely:
source_image: The uploaded image file that needed to be converted to another format, e.g. an HEIC file.animated_video: The MP4 file created from an uploaded animated GIF.animated_video_poster: A JPG extracted from an uploaded animated GIF to act as a placeholder for the MP4 version.
WP Offload Media now knows about these extra files, and will offload and remove them from the server as appropriate.
To accomplish this, we had to tap in to some in-progress changes to the plugin.
Preparing for the Future
We’ve been working on some changes to the internals of WP Offload Media to prepare for some features our customers have been asking for, while also improving performance, especially for sites with very large Media Libraries.
Custom Table Changes
When you upgrade to WP Offload Media 3.4.0, depending on how many offloaded items you have, you may see an upgrade notice in the settings page.
This upgrade routine will quietly background upgrade WP Offload Media’s metadata related to offloaded items to create a new as3cf_files table that lives alongside the existing as3cf_items table.
Although you won’t be able to make any changes to WP Offload Media’s settings or run any of its bulk management tools while this upgrade is in progress, all existing and new offloads will continue to work as usual.
This new as3cf_files table holds a wealth of information:
- 1-to-1 mappings of local media files to their path in the cloud storage bucket.
- Information related to whether the files are private in the bucket or not.
- A reference to the
as3cf_itemsrecord which ties multiple files to a Media Library item or BuddyBoss avatar or cover item.
Performance Improvements
The as3cf_files table gives WP Offload Media much improved flexibility in how it keeps track of offloaded media, crucial for supporting the new Media Library metadata fields mentioned above.
However, the new table’s data structure also makes it far simpler and therefore faster for finding matching records when performing unique name checks, or rewriting URLs between their local and remote versions.
WP Offload Media no longer needs to reduce file names down to their base non-sized suffixed name and do potentially expensive LIKE table scans, it can do much simpler equality checks that use indexes for speed.
Because of these changes, it has been possible for us to reduce the processing required when doing URL rewrites. We’ve removed a whole pass through post content and its associated processing, and removed other loops that are no longer required.
We’ve also been able to vastly improve the way we cache the relationship between the URLs in a post’s content with their associated Media Library items. As such, you may see a second upgrade routine notice related to the removal of ye olde amazonS3_cache records from the postmeta table, which will be replaced by much better behaved as3cf_url_cache_local and as3cf_url_cache_remote records.
And for our most advanced customers that have their whole site behind a CDN such as CloudFront, and only use WP Offload Media to manage media in the bucket, we have a big performance boost for you. WP Offload Media no longer implements many of the usual frontend content filters if “Deliver Offloaded Media” is turned off, cutting out a lot of unnecessary checks and processing.
Small Steps
Along with the custom table changes that unlock future features and performance improvements, WP Offload Media will need to change how some of its internal code is organized.
We’re very lucky to have a number of plugins that integrate with WP Offload Media, and are aware of many customers that have custom code that relies on the existing internal API.
As such, we’ve been very careful to make these changes in a backwards compatible way, keeping the existing as3cf_items table data in sync with the data managed in the new as3cf_files table, and ensuring the classes and methods that work with the old data still work.
However, we have marked some functions as deprecated, and do intend to eventually remove them.
Our work in this area is not complete. WP Offload Media still uses some of the deprecated methods itself, and we have plans for further improvements to the data handling that unlock some exciting features, and continue to improve performance.
And More
As always, there’s a number of other bug fixes and improvements in this release.
For a full list of new features, improvements, and bug fixes, see the 3.4 Changelog.
Next Up
We hope you enjoy this foundational release of WP Offload Media.
We’re already working hard on the next release, and are excited to bring you the features and improvements you’ve been asking for.