UXPA Lean Media Offloader
Stateless media offloading to Cloudinary without database tracking queues.
by Shrinkray Interactive · github.com/shrinkray/uxpa-lean-offloader
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/shrinkray/uxpa-lean-offloader/archive/refs/heads/main.zipWordPress plugin that offloads media uploads to Cloudinary on upload and rewrites attachment URLs on the frontend—without queues, sync tables, or the overhead of the official Cloudinary WordPress plugin.
Built for UXPA’s multisite production environment; developed and tested on a single-site LocalWP install.
What it does
- On upload — After WordPress saves a file locally, the plugin POSTs it to Cloudinary’s signed upload API (folder per site:
{folder}/wp_{blog_id}/). - On the frontend —
wp_get_attachment_urlis rewritten to Cloudinary delivery URLs so visitors load assets from the CDN. Admin screens keep local URLs so the Media Library continues to work.
This is intentionally lean: no background jobs, no attachment metadata sync with Cloudinary. It complements (rather than replaces) Cloudinary features the main plugin does not provide for your workflow.
Requirements
- WordPress 5.x+ (tested in LocalWP single site; designed for multisite)
- PHP with cURL enabled (
CURLFileused for uploads) - A Cloudinary account (cloud name, API key, API secret)
Installation
The plugin folder must live under WordPress plugins:
wp-content/plugins/uxpa-lean-offloader/
└── uxpa-lean-offloader.php ← required; contains the plugin header
No other PHP files, composer.json, or build step are required—one file is enough for WordPress to recognize and run the plugin.
- Place or clone this repo into
wp-content/plugins/uxpa-lean-offloader/. - In Plugins, activate UXPA Lean Media Offloader.
- Configure credentials (see below).
Optional: add an empty index.php in the folder if you want to block directory listing on hosts that allow it; WordPress does not require it.
Configuration
Option A — Admin settings (good for local dev)
| Install type | Where to configure |
|---|---|
| Single site | Settings → UXPA Lean Offloader |
| Multisite | Network Admin → Settings → UXPA Lean Offloader (network-wide) |
Fields: Cloud name, API key, API secret, Cloudinary folder (default uxpa_uploads).
Option B — wp-config.php constants (recommended for production)
Constants override saved options and keep secrets out of git:
define( 'UXPA_CLOUDINARY_CLOUD_NAME', 'your_cloud_name' );
define( 'UXPA_CLOUDINARY_API_KEY', 'your_api_key' );
define( 'UXPA_CLOUDINARY_API_SECRET', 'your_api_secret' );
define( 'UXPA_CLOUDINARY_FOLDER', 'uxpa_uploads' ); // optional
Do not commit API secrets to this repository.
Multisite behavior
- Uploads use
get_current_blog_id()so each site’s files go under…/wp_{blog_id}/in Cloudinary. - Network settings apply to all sites when constants are not defined.
Local vs production
| Environment | Typical setup |
|---|---|
| LocalWP (single site) | Settings page + test Cloudinary credentials |
| Production (multisite) | wp-config.php constants on the network |
Limitations (by design)
- Upload failures are logged via
error_log; the local file remains unless you enable the optionalunlink()in code. - URL rewriting assumes files were uploaded through this plugin’s folder/public_id convention.
- Does not handle every attachment filter (e.g.
wp_calculate_image_srcset)—onlywp_get_attachment_url.
License
Proprietary — Shrinkray Interactive / UXPA. Adjust as needed for your org.