OpenYacht Storage: Cloudflare R2
Cloudflare R2 media storage for the OpenYacht WordPress plugin — SDK-free S3 driver with two-way migration
by OpenYacht · github.com/openyacht/openyacht-storage-r2 · website
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/openyacht/openyacht-storage-r2/releases/download/v0.1.0/openyacht-storage-r2-0.1.0.zipReadme
OpenYacht Storage: Cloudflare R2
Stores OpenYacht's cached partner media in a Cloudflare R2 bucket instead of the site's uploads folder. Activate it alongside the OpenYacht plugin and "Cloudflare R2" appears as a choice under OpenYacht → Settings → Media storage; the connection is configured under OpenYacht → R2 Storage, which includes a write/read/delete connection test.
No SDK, no Composer dependencies at runtime: R2's S3-compatible API is driven with SigV4-signed wp_remote_request calls. The signer is unit-tested against AWS's published signing example.
Setup
- Create an R2 bucket and an API token scoped to Object Read & Write on that one bucket. The token's access key ID and secret access key go into the settings, along with your Cloudflare account ID.
- Give the bucket a public face — either enable its public development URL (
https://pub-….r2.dev) or connect a custom domain — and enter that as the public base URL. R2 does not serve public traffic from the API endpoint, so this is required. - Save, run the connection test, then switch Media storage to Cloudflare R2 in OpenYacht's settings.
To move media that is already cached, the Move existing images buttons on the R2 Storage screen copy everything into (or back out of) the bucket and optionally flip the serving setting on a clean run. The same operation is available as wp openyacht media migrate --to=r2 --switch (--dry-run first to preview, --delete-source to clean up the uploads folder afterwards) — prefer the CLI for very large libraries. It works in either direction — --from=r2 --to=local moves everything back out again, and the same command covers any future provider's driver. Without a migration, previously cached media keeps serving from the uploads folder and only new syncs write to R2. Uninstalling removes the connection settings but never touches the bucket.
Development
composer install, then composer check (PHPUnit + PHPStan). The unit lane runs without WordPress or a network — core's Storage interface is mirrored in tests/Support/openyacht-stubs.php, which must be kept in sync with core.
Read the full README on GitHub →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| v0.1.0 | Aug 24, 2026 | openyacht-storage-r2-0.1.0.zip | 1 |