﻿=== RR Media Offload for S3 / S3-compatible storage ===
Contributors: rrcomputing, rvalverde
Tags: amazon s3, media offload, cloudfront, cdn, wordpress media
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 1.0.1
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Offload your WordPress media library to S3 and speed up your site with CDN delivery, reduced server load and better performance.

== Description ==

**RR Media Offload for S3** (powered by WPtoCloud) automatically uploads every file from your WordPress media library to an S3 or S3-compatible bucket.

Images, videos and all generated thumbnails are stored in S3 and can be served directly from cloud storage or via a CDN such as CloudFront.

This reduces disk usage, improves performance and allows your site to scale more easily.

Setup is simple and takes just a few minutes with the built-in step-by-step wizard.

== Features ==

- Automatic upload of new media files to Amazon S3
- Upload of all thumbnails and srcset variants
- Support for images, videos and all WordPress media types
- URL rewriting to serve files from S3 or CDN
- Compatible with CloudFront and custom CDN domains
- Optional local file deletion after upload
- Step-by-step setup wizard (bucket, IAM, CDN)
- Status dashboard with upload metrics and S3 health
- Works with private S3 buckets (using CDN)
- Compatible with multisite installations
- Translation-ready (English, Spanish, French, Portuguese, Catalan)

== External services ==

**This plugin does NOT load remote files from third-party servers.**

All plugin assets (JavaScript, CSS, images) are included locally within the plugin directory. The plugin does not call external CDNs for its own functionality.

**This plugin provides a service to connect YOUR OWN Amazon S3 account**

When you configure the plugin with your AWS credentials, it connects to:

- **S3 / S3-compatible storage** - to upload and store your media files in your own bucket
- **CDN (optional)** - to serve content via a CDN such as Amazon CloudFront or another compatible CDN distribution

The plugin also works with other services that implement the S3 API (S3‑compatible object storage). If you prefer to use an alternative provider, configure the plugin with that provider's endpoint and credentials. Common compatible providers include:

- MinIO (self-hosted)
- DigitalOcean Spaces
- Wasabi
- Backblaze B2 (S3 API)
- Linode Object Storage
- Scaleway Objects
- Ceph (RADOS Gateway)
- IBM Cloud Object Storage (S3-compatible mode)
- Oracle Cloud (S3-compatible gateway; may need adjustments)
- Cloudian, DreamObjects, Exoscale

Notes for S3‑compatible providers:

- You may need to set a custom `endpoint` (for example `https://nyc3.digitaloceanspaces.com`).
- Some providers require `use_path_style_endpoint => true` or specific `signature_version` (usually `v4`).
- Verify CORS, ACL/public-read behavior and large multipart upload limits with your provider.
- If the plugin UI does not expose an endpoint field, you can add the endpoint in the plugin settings or I can patch the plugin to add an "Custom S3 endpoint" option.

== Provider-specific instructions ==

Below are short, provider-specific notes to help you configure the plugin when using S3‑compatible object storage.

=== DigitalOcean Spaces ===
- Example endpoint: https://nyc3.digitaloceanspaces.com (replace nyc3 with your region)
- Create a Space in the DigitalOcean control panel and generate Access Key / Secret Key under API -> Spaces keys.
- Use the above endpoint in the plugin `Endpoint` field and leave Region to any (the SDK will use endpoint).
- CORS: allow GET, HEAD, PUT, POST and set Origin to your site if needed.
- Public objects: set Space to public or use signed URLs via your CDN.

=== MinIO (self-hosted) ===
- Example endpoint: https://minio.example.com:9000
- MinIO commonly requires `use_path_style_endpoint => true` — enable "Forzar path-style" in plugin settings.
- Ensure TLS is configured for production and that bucket names follow DNS rules.
- Use MinIO client (`mc`) to create buckets and test uploads:
	- `mc alias set myminio https://minio.example.com ACCESSKEY SECRET` 
	- `mc mb myminio/my-bucket`

=== Wasabi ===
- Example endpoint: https://s3.us-west-1.wasabisys.com (region-specific)
- Use the provider endpoint in the plugin and do not enable path-style unless instructed by Wasabi.
- Check Wasabi docs for bucket policies and CORS configuration.

=== Backblaze B2 (S3 Compatible) ===
- Backblaze S3 endpoints are region-specific, e.g. `https://s3.us-west-002.backblazeb2.com`.
- Use the endpoint and your S3-style keys; test with the plugin's "Probar conexión" button.

=== Linode Object Storage ===
- Example endpoint: https://us-east-1.linodeobjects.com
- Use the endpoint in settings; Linode supports virtual-host style by default, no path-style needed usually.

=== Custom / Other S3-compatible providers ===
- If your provider exposes an S3-compatible API, you will usually need:
	- `endpoint` (required)
	- `access key` and `secret key`
	- optionally `use_path_style_endpoint => true` for older or self-hosted gateways
- Common issues: signature version mismatch (ensure `v4`), CORS restrictions, or provider-specific limits for multipart uploads.

If you hit issues, copy the provider endpoint and keys into the plugin settings and use "Probar conexión". If the test fails, enable path-style and retry, or share the error message for further help.


**What data is sent:**

- Media files uploaded by your WordPress site (images, videos, thumbnails)
- API requests using YOUR AWS credentials to manage YOUR bucket
- All connections are made to YOUR configured AWS resources only

**AWS Account Requirement:**

You must create your own AWS account and configure your own S3 bucket and optional CloudFront distribution. The plugin does not provide these services—it merely connects WordPress to the AWS services YOU configure.

**Credentials Security:**

- Your AWS credentials are stored encrypted in your WordPress database
- Credentials are used ONLY to communicate with your own AWS account
- No data is sent to third-party servers or the plugin developer

**URLs shown in the plugin admin are informational links only:**

The setup wizard displays clickable links to help you open the correct AWS Console pages:

- `https://s3.console.aws.amazon.com/s3/home` - Opens your AWS S3 console (for bucket creation)
- `https://console.aws.amazon.com/iam/home#/users` - Opens your IAM console (for creating access keys)
- `https://console.aws.amazon.com/cloudfront/home` - Opens your CloudFront console (optional CDN setup)

These are standard AWS console URLs provided as user guidance. They are NOT external dependencies loaded by the plugin runtime.

**Example placeholder shown in setup wizard:**

The wizard shows an example CloudFront URL format like `https://d1ab2cde.cloudfront.net` as a visual reference. This is a placeholder example only—it is not a real endpoint. The plugin only uses the CDN URL YOU configure with YOUR OWN CloudFront domain.

**More information:**

- AWS Service Terms: https://aws.amazon.com/service-terms/
- AWS Privacy Notice: https://aws.amazon.com/privacy/

== Installation ==

1. Upload the plugin to the /wp-content/plugins/ directory or install it from the WordPress repository.
2. Activate the plugin through the Plugins menu.
3. Go to **WPtoCloud -> Settings**
4. Configure your S3 bucket and IAM credentials
5. (Optional) set a CloudFront or CDN URL

== Frequently Asked Questions ==

= What does this plugin do? =
It automatically uploads WordPress media to Amazon S3 and serves files from cloud storage.

= Does it support CloudFront? =
Yes, you can configure a CDN URL for fast delivery.

= Are existing files migrated? =
No. The free version handles new uploads only.

= Can I delete local files? =
Yes, you can enable automatic deletion once the file is uploaded to S3.

= Does it work with private buckets? =
Yes, when used with CloudFront or a compatible CDN.

= Are AWS credentials secure? =
Yes. They are stored encrypted in your WordPress database.


= What is WPtoCloud? =
WPtoCloud is the platform behind RR Media Offload, providing advanced features and premium tools for cloud media management.


== Upgrade to WPtoCloud Pro ==

Unlock advanced features with **WPtoCloud Pro**:

- Bulk media migration to Amazon S3
- Advanced automation tools
- WooCommerce media cleanup
- Detailed reporting and monitoring
- Priority support

Get WPtoCloud Pro:
https://www.wptocloud.com


== Changelog ==
= 1.0.0 =
- Initial release

= 1.0.1 =
- Added support for S3-compatible providers: DigitalOcean Spaces, MinIO, Wasabi, Backblaze, Linode and a custom option.
- New settings: `S3 Provider`, `Endpoint` and `Force path-style`.
- `RRCM_Media_Offload_S3_Manager` now accepts a custom endpoint and `use_path_style_endpoint` when configured.
- Added a "Test connection" button on the settings screen to verify credentials and endpoint.
- Minimal, backward-compatible changes: existing AWS configuration is unaffected.
- Fixed translation errors in plugin code (WordPress i18n strings corrected).

== Upgrade Notice ==
= 1.0.1 =
- See the Changelog above for details.
