=== OCI Media Offload (PRO) === Contributors: OCI media offload Tags: oracle cloud, oci, object storage, s3, offload, media, cdn, par, performance Requires at least: 6.0 Tested up to: 6.8 Stable tag: Pro 1.3.2 / Lite 1.3.3 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Offload your WordPress Media Library to **Oracle Cloud (OCI) Object Storage** via the S3-compatible **path-style** endpoint. One-page setup, URL & `srcset` rewrite, Health Check (PUT+GET). PRO adds CDN CNAME, PAR base (private buckets), and batch backfill. == External services == This plugin connects to external services to store and serve your media. 1. **Oracle Cloud (OCI) Object Storage** — used to **upload** and **serve** media files. - Data sent: object bytes, object key/path, and standard S3 headers for signing (Host, Date, Content-SHA256, Authorization). - When: on upload (new attachments and, in PRO, backfill batches) and during the Health Check. - Service: Oracle Cloud Infrastructure (OCI). Terms/Privacy: refer to your OCI tenancy policies. 2. **Your CDN (optional, PRO)** — if you specify a **custom CDN CNAME**, media URLs are rewritten to that host. - Data sent: regular HTTP GETs from your visitors to your CDN (no API calls from the plugin). - When: at view time; after URLs are rewritten in WordPress. 3. **OCI Media Offload License Verification (PRO only)** — validates your PRO license key. - Endpoint: `https://oci-media-offload.net/verify.php?site=&license=` - Data sent: license key, your WordPress site URL, and plugin version. - When: when you submit/verify your license and during periodic checks. == Plans == **Lite**: direct OCI delivery (no CDN/PAR), single-page wizard, Health Check, offload on upload, best-effort support. **PRO** (license verified): **CDN CNAME**, **PAR base** (private buckets), **Batch Backfill** for existing media, priority support. == Compatibility == * WordPress: 6.0 – 6.8 (tested) * PHP: 7.0+ (checked on activation) * Editor: Classic and Block Editor (media for any post type) == Installation == 1. Upload the ZIP in **Plugins ▸ Add New ▸ Upload Plugin**, then **Activate**. Or unzip and place `oci-media-offload/` into `/wp-content/plugins/`. 2. Go to **OCI Offload** and complete the wizard (Region, Namespace, Access Key ID, Secret Key, Bucket). 3. Click **Finish** then **Run Health Check** (signed PUT + public GET). In PRO you may also set **CDN CNAME** or **PAR base**. == Quick Start == 1. In **OCI Offload ▸ Setup**, enter your **OCI Namespace**, **Region** (e.g., `me-riyadh-1`), **Customer Secret Keys** (Access/Secret), and **Bucket**. 2. (PRO) Optionally set a **CDN CNAME** or enable **PAR base** for private buckets. 3. Click **Save All Settings** and run **Health Check**. Upload a new image and confirm its URL points to your bucket/CDN. == Keys & Regions == * **Customer Secret Keys** — create in OCI Console (User settings ▸ Customer secret keys). **Do not** use API key fingerprints. * **Region** — examples: `me-riyadh-1`, `eu-frankfurt-1`, `us-ashburn-1`. The plugin needs the exact region code. * **Bucket** — for quick testing, you can set object-read public. For private buckets use **PAR base** (PRO) or a private **CDN**. == License (PRO) == * Enter your license in **OCI Offload ▸ License Key** (PRO UI) and click **Check License**. * Server validation: `https://oci-media-offload.net/verify.php?site=&license=` (briefly cached). * If verification fails/missing, PRO features are disabled (Lite behavior applies). == Field Reference (Settings) == * **Region** — OCI region code (e.g., `me-riyadh-1`). * **Namespace** — your OCI Object Storage namespace. * **Access Key ID / Secret Key** — OCI Customer Secret Keys for S3-compatible signing. * **Bucket** — destination bucket name. * **Custom CDN URL (PRO)** — CNAME such as `https://media.example.com`. Rewrites attachment URLs and `srcset`. * **Use PAR (PRO)** / **PAR base** — base URL of a bucket-level **AnyObjectRead** PAR; plugin appends `/o/`. * **Offload new uploads** — offload originals + generated sizes on upload. * **Keep local copy** — retain local file(s) after successful offload (recommended while testing). * **Folder style** — mirrors WordPress year/month or flat. == Backfill (PRO) == Use **OCI Offload ▸ Backfill** to migrate existing attachments in batches. Progress and errors are shown in **Status & Logs**. You can pause/resume safely. For large libraries, keep **Keep local copy** enabled until you verify delivery. == URL Rewriting & `srcset` == When an attachment is marked as offloaded, `wp_get_attachment_url()` and `srcset` candidates are rewritten to the **computed delivery base** (Direct OCI in Lite, or CDN/PAR in PRO). Thumbnails generated by WordPress are included. == Tips & Best Practices == * Start with **Keep local copy** ON; disable only after confirming delivery and caching. * For **private buckets**, use **PAR base** (PRO) or a private **CDN** and keep the bucket non-public. * A mismatched **Region** or **Namespace** causes signature/host errors; always double-check spelling. * Health Check first: it performs a signed PUT + public GET and logs both steps. == Troubleshooting == * **403 SignatureDoesNotMatch** — wrong Region/Namespace/keys or path-style mismatch; re-enter settings and retry Health Check. * **411 MissingContentLength** — some endpoints reject chunked uploads; this plugin sends explicit `Content-Length`. Update if you run a very old version. * **403 AccessDenied / 404 NotFound** — bucket policy/object visibility; for direct reads the object must be publicly readable or served via CDN/PAR. * **Host resolve error (cURL 6)** — Region or Namespace is blank/typo; verify host looks like `.compat.objectstorage..oraclecloud.com`. * **Backfill stops early (PRO)** — check **Status & Logs**; fix the failing object then resume. == Privacy & Security == * No telemetry. The plugin only makes requests you configure (OCI endpoint, optional CDN, and license verify in PRO). * Keys are stored in WordPress options and never exposed to visitors. Admin capability checks and nonces are enforced in the UI. == Changelog (PRO/Lite highlights) == * **Pro 1.3.2 / Lite 1.3.3** — Health Check logging for incomplete config & PUT/GET failures; region handling fixes (Lite dropdown + custom). * Earlier: single-page wizard, explicit `Content-Length` signing, Status & Logs, CDN/PAR/Backfill (PRO).