=== Offloft – Media Offloader for Cloudflare R2, Amazon S3 & More ===
Contributors: eritsonzach
Tags: offload media, cloudflare r2, amazon s3, cloud storage, cdn
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Offload your WordPress media to Cloudflare R2, Amazon S3 or any S3-compatible storage. Every file is verified before your site uses it.

== Description ==

Offloft offloads your WordPress media library to cloud storage and serves your images and files from there. It works with Cloudflare R2, Amazon S3, Wasabi, Backblaze B2, DigitalOcean Spaces and any other S3-compatible bucket, so visitors get your media from your bucket or CDN instead of your web server.

Plenty of offload plugins count a file as done once the upload call returns. Offloft checks that **every file, and every size of every image, is really in your bucket** before your site points at it, and it keeps checking afterwards. When something goes wrong, it tells you in plain language, so you don't find out from a visitor's broken image.

The free plugin is the full offloader. There's no file limit, no trial period and no locked screens.

= Your site never shows a broken image because of Offloft =

* **Verified before it's used.** A cloud copy is used only after Offloft has checked it in your bucket: right size, right content. Until then, your site keeps serving the local file.
* **Waits for WordPress to finish.** New uploads are sent only once WordPress has made every thumbnail size, so no size is left behind.
* **Every file tracked.** The original, the scaled copy, every thumbnail and every extra format each has its own status, so nothing gets missed.
* **No silent failures.** Every problem shows up as a plain-language issue with a "Fix" button where one is possible. Nothing is only written to a server log.
* **Recovers by itself.** Timeouts, provider outages, a server clock that's off, a worker killed halfway through a big file: uploads retry, resume where they stopped and never upload twice.
* **Reversible at any time.** Your database isn't rewritten: URLs are changed as pages are shown. "Bring everything back to my server" downloads every file again, and deactivating keeps your media working from its local copies.

= Features =

* Automatic offload of new uploads, with large files sent in resumable parts.
* Bulk offload of your existing library, "Verify everything", and "Bring everything back to my server".
* A pre-flight scan that shows what will be offloaded and what needs attention first.
* A health summary and issues list, with fix buttons.
* Media Library status column, item actions and a per-file panel.
* Step-by-step setup guides for each provider, with copy-and-paste values, a real connection test and a public delivery check.
* Changed files are uploaded under a new name, so no browser or CDN cache serves the old version.
* Deleting an item in WordPress removes its files from your bucket. You can turn this off.
* Site Health tests and a dashboard widget.
* A REST API (`offloft/v1`) and WP-CLI commands (`wp offloft`) for developers and agencies.

= Works with =

* Cloudflare R2
* Amazon S3
* Wasabi, Backblaze B2, DigitalOcean Spaces, Akamai (Linode) Object Storage, Scaleway, Vultr
* MinIO, and any other S3-compatible storage

You bring your own bucket. Offloft doesn't store your files anywhere else, and there's no limit on the number of files.

= Offloft Pro =

Offloft Pro is an optional paid add-on for sites that want this handled for them. It runs scheduled audits, repairs what it safely can, alerts you by email, Slack or webhook, and frees your server's disk by removing local copies once every file is proven in the cloud. The free plugin is complete on its own: nothing in it is locked or time-limited.

== Installation ==

1. Install Offloft from **Plugins → Add New**, or upload the zip, then activate it.
2. Open **Offloft** in the admin menu.
3. Choose your storage provider and follow its guide to create a bucket and an access key.
4. Run the connection test and the delivery check. Offloft starts serving media from the cloud only once both pass.
5. New uploads are offloaded automatically. To move your existing library, run the pre-flight scan, then **Offload everything**.

Requirements: PHP 8.1 or later with the cURL extension, and WordPress 6.5 or later.

== Frequently Asked Questions ==

= How do I offload WordPress media to Cloudflare R2? =

Install Offloft, choose Cloudflare R2 and follow the guide to create a bucket and an access key. Offloft tests the connection and checks public delivery before it serves anything from the cloud. Amazon S3 and the other providers work the same way, each with its own guide.

= Does Offloft free up space on my server? =

Not on its own: the free plugin keeps your local copies as a safety net. The Pro add-on can remove them once every file of an item is verified in the cloud and a safety delay has passed.

= What happens if an upload fails? =

The file stays on your server and your site keeps using it. Offloft retries with increasing waits. If it still can't upload, it raises an issue explaining what went wrong and how to fix it. Your visitors never see a broken image.

= What happens when my storage provider is down? =

Offloft notices, pauses uploads without using up their retries, and shows an issue. It checks again on its own and continues where it stopped once the provider is back.

= Does Offloft change my database? =

No. Media URLs are changed as pages are shown, so turning Offloft off returns your site to its local files at once. Your posts and settings aren't search-and-replaced.

= Are my local files deleted? =

Not by the free plugin. Your local copies stay where they are. The Pro add-on can remove them, but only once every file of the item is verified in the cloud and a safety delay has passed.

= What if I deactivate or delete the plugin? =

Deactivating stops background work and keeps all your data. Your site serves media from your server again. If some files exist only in the cloud, Offloft warns you first and offers to bring them back.

Deleting the plugin keeps its data, unless you chose in its settings to remove its data when it's deleted. Files in your bucket are never deleted on uninstall.

= Can I use it on a big library? =

Yes. Work runs in the background in small batches, large files are uploaded in parts that resume after interruptions, and pages don't run an extra database query for each image.

= Does it work with WP-CLI? =

Yes. Run `wp offloft` to see the commands: status, scan, offload, verify, restore, issues, fix, job and more.

== Privacy ==

Offloft sends your media files only to the storage bucket you connect, using the access keys you enter. The keys are stored encrypted in your database. Offloft also fetches one small test image from your public delivery address to check that delivery works.

Offloft doesn't send any data to its makers or to any other service: no tracking, no analytics, no "phone home". It doesn't add cookies or collect visitors' personal data.

== External services ==

Offloft connects to two kinds of outside service. It contacts nothing until you set it up, and only the services you choose.

**Your cloud storage provider.** Offloft's job is to store your media in a bucket you own. When you connect a bucket, Offloft sends your media files (the original and every image size), their file names and folder paths, and requests signed with the access keys you entered, to that provider's storage address. It does this when you test the connection, when files are offloaded, checked, brought back or deleted, and when Offloft checks a file is still there. It also loads one small test image from your public delivery address to check that delivery works. It talks only to the provider and address you entered:

* Cloudflare R2: [terms](https://www.cloudflare.com/terms/), [privacy policy](https://www.cloudflare.com/privacypolicy/)
* Amazon S3: [terms](https://aws.amazon.com/service-terms/), [privacy policy](https://aws.amazon.com/privacy/)
* Wasabi: [terms](https://wasabi.com/legal/customer-agreement), [privacy policy](https://wasabi.com/legal/privacy-policy)
* Backblaze B2: [terms](https://www.backblaze.com/company/policy/terms-of-service), [privacy policy](https://www.backblaze.com/company/policy/privacy)
* DigitalOcean Spaces: [terms](https://www.digitalocean.com/legal/terms-of-service-agreement), [privacy policy](https://www.digitalocean.com/legal/privacy-policy)
* Any other S3-compatible storage you enter: that provider's own terms and privacy policy apply.

**Freemius checkout, only if you click.** The plan buttons on Offloft's Account page are plain links to Freemius, the shop that sells the optional Offloft Pro add-on. Nothing is sent to Freemius unless you click one, and then your browser simply opens its checkout page. Offloft adds no site details to the link. Freemius: [terms](https://freemius.com/terms/), [privacy policy](https://freemius.com/privacy/).

== Screenshots ==

1. The dashboard: how many files are verified in the cloud, what needs attention, and the last full check.
2. The setup wizard connects your storage and tests every permission before anything moves.
3. Files: every media item with its cloud state, and a drawer that shows each size and where it lives.
4. Issues: each problem explained in plain words, with a fix you can run or a reason to ignore it.
5. Jobs: offload, verify or bring everything back, in the background, with pause and cancel.
6. Tools: the pre-flight scan, connection test, URL replacement with a backup and undo, and settings export.
7. The Media Library shows each file's cloud state, and the attachment panel offers the fix when one is needed.

== Changelog ==

= 0.1.0 =
* First release.

== Upgrade Notice ==

= 0.1.0 =
First release.
