Getting started#
Requirements#
- WordPress 6.0 or later, PHP 7.4 or later.
- Optimization needs the Imagick PHP extension; AVIF copies need an ImageMagick built with AVIF. Everything else works without it.
- Two tables are created:
{prefix}bb_media_filesand{prefix}bb_media_usage.
Install#
- Upload and activate BB Media.
- The library is indexed by itself in background batches (WP-Cron), and where files are used is scanned after it.
With a shell,
wp bb-media index && wp bb-media scan && wp bb-media usagedoes it at once; without one, Media → Media index has buttons that run it from the browser. - On a site that is mostly served from BB Cache's page cache, WP-Cron only runs when someone loads an uncached page (an admin page will do). Use WP-CLI or the buttons if the index does not fill.
Reactivating the plugin does not start the index again; a finished index is kept and only kept current.
Media → Media index#
- Attachments and files: how much is indexed, unattached files, files with WebP/AVIF copies.
- Where files are used: unused attachments and files, the CSV download, a rescan button.
- Transfers: files hashed (for BB Migrate's content comparison), image sizes waiting to be made.
- Optimization: compression and WebP/AVIF copies, with the server checks.
Each attachment also gets Used in (on its edit screen and in the media modal), and the media list a Used column.
Uninstall#
Uninstalling drops both tables and BB Media's options. WebP/AVIF copies stay, because pages BB Cache cached may point at
them; run wp bb-media optimize --remove first to delete them.