ACOOFM WP-CLI Sync
A powerful media sync for existing media files for advanced users.
by Alamin (dev-alamin) · github.com/dev-alamin/sync-for-offload-media-cloud-storage
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/dev-alamin/sync-for-offload-media-cloud-storage/archive/refs/heads/main.zipReadme
WP-CLI Sync for Offload Media Cloud Storage
A single must-use plugin that adds wp acoofm sync / wp acoofm status
WP-CLI commands for the Offload Media - Cloud Storage
plugin by Acowebs.
Why
The free version of Offload Media - Cloud Storage only offloads media on new upload. There's no built-in way to bulk-offload an existing media library from the free tier, and no WP-CLI command shipped at all.
This tool re-fires the exact same core WordPress hook
(wp_update_attachment_metadata) that the plugin already listens to, so
existing attachments get pushed through the plugin's real, unmodified
offload logic — same prefix handling, same per-size uploads, same
database bookkeeping. It's not a reimplementation or a fork; it just
triggers the plugin's own code path on demand instead of waiting for a
fresh upload.
Platform independence
This never calls any provider-specific code — no S3, DigitalOcean, R2,
MinIO, or Google Cloud classes are touched directly. It only fires a
WordPress core hook that the plugin already handles internally,
regardless of which of its five storage backends you have configured.
provider/bucket/region are read from the plugin's own wp_acoofm_items
table (or passed explicitly via flags) — never hardcoded to one service.
Requirements
- WP-CLI
- Offload Media - Cloud Storage active and connected to a storage provider
- PHP 7.4+
Install
Copy acoofm-cli-trigger.php into wp-content/mu-plugins/. Must-use
plugins load automatically — no activation step, and it won't show up in
your regular Plugins list.
curl -o wp-content/mu-plugins/acoofm-cli-trigger.php \
https://raw.githubusercontent.com/dev-alamin/acoofm-wp-cli-sync/main/acoofm-cli-trigger.php
Usage
# Check current progress
wp acoofm status
# Offload everything not yet offloaded
wp acoofm sync
# Test on a small batch first (recommended before a full run)
wp acoofm sync --limit=50
# See what would run without sending anything
wp acoofm sync --dry-run
Fresh install with zero offloads yet
The tool normally auto-detects provider/bucket/region from an existing row in the plugin's items table. If nothing has been offloaded yet (table is empty), either offload one file via the plugin's UI first, or specify explicitly:
wp acoofm sync --provider=ocean --bucket=my-bucket --region=lon1
wp acoofm status --provider=ocean --bucket=my-bucket --region=lon1
CI/CD integration
Works well as a post-deploy step in a pipeline — guard it with status
first so it's a no-op once the library is fully synced:
wp acoofm sync --limit=200
Caveats
- This is a companion utility, not affiliated with or endorsed by Acowebs. It relies on the plugin's internal table/hook structure, which could change in a future plugin update without notice — pin your plugin version or re-verify after major updates.
- Test with
--dry-runand a small--limitbefore running against a full production library. - Not tested against the Pro version's additional features.
License
GPL-2.0-or-later