Skip to content

BB Media#

The media layer under BB Cache and BB Migrate. BB Media keeps an index of every file in uploads (which attachment and size it is, its dimensions, bytes and content hash, its WebP/AVIF copies) and of where the site uses each one. The other Brightbase plugins read it instead of guessing from file names, and it does the image work Smush Pro did, on the site's own server.

This documentation describes version 0.4.1.

What it does#

Part What it is for
The file index Every uploads file with its attachment, size, dimensions, bytes, hash and copies. BB Cache's srcset, width/height and WebP serving read it.
Where files are used References in posts, ACF fields, options, terms and theme files; read-only reports of unused media and a CSV for review.
Transfers BB Migrate compares file content instead of dates, reuses the same image under another name, and makes image sizes in the background.
Optimization JPEG compression matched to Smush Pro, and WebP/AVIF copies served by BB Cache. Off until switched on.

BB Media never changes WordPress's own attachment data and never deletes media. Everything it reports is for a person to act on.

Measured on coalesce.io (local mirror)#

  • 42,879 files of 3,895 attachments indexed in 15 seconds; 8,860 files in uploads that no attachment owns.
  • 7,462 references found in 1 second. Unused: 1,154 attachments (about 1 GB with their sizes) and 8,846 unattached files (963 MB). None of the 5,017 files the 323 public pages render is reported unused.
  • BB Cache: 61 pages gained a srcset on 13 images whose URL is root-relative, with no change to their rendered size.
  • A BB Migrate push of 852 identical files with older dates: 0 files sent instead of 852 (93 MB).
  • Compression: 4.6% smaller than Smush at the same SSIM; WebP copies 29.9% smaller at a higher SSIM.