Skip to content

ITC Media Workspace 0.3.43Changelog

Cloud storage

Cloud storage is optional. When it is on, Media Workspace copies uploads to a bucket in your own Amazon S3, Cloudflare R2 or other S3-compatible account and can serve them from there. itouchcode never receives your files or bucket credentials, and the provider bills you directly for storage and transfer.

Try every step on a staging copy of the site first, with a backup you have restored at least once.

  • Local copies are kept. Moving media to the cloud does not delete the files in wp-content/uploads. Removing them is a separate, explicit action (see below).
  • Each upload is downloaded once to check that the bucket holds exactly the same bytes. This uses temporary disk space and can add provider transfer charges.
  • Old objects are retained. When a site moves to another bucket, or an image is edited, the superseded objects and provider profiles are kept for review. They can keep costing storage and keep credentials in the database. The storage page lists them. An administrator can preview and delete one eligible retained object at a time.
  • Credentials entered in the plugin live in your database. They are plaintext by default, including in backups. Since version 0.3.34, optional encryption is available for stored credentials; see Protect stored credentials. Protect backups, use a key limited to this bucket, and rotate it when no longer needed.

Open Media → Storage, choose the provider, enter the endpoint, bucket, access key and secret, save, and use the connection test. The test confirms that the bucket answers; it does not prove that the key can write or that public delivery works. Upload a test image and open it on the front end before relying on it.

Endpoints and delivery URLs must use valid HTTPS URLs without a username or password. If either URL is invalid, the submitted settings are not saved.

To keep the credentials out of the database, set them in wp-config.php:

define( 'ITC_MW_STORAGE_ACCESS_KEY', '…' );
define( 'ITC_MW_STORAGE_SECRET_KEY', '…' );

Moving from one bucket to another still requires credentials saved in the plugin settings.

Since version 0.3.34, the plugin can optionally encrypt credentials saved in the database, including saved provider-migration profiles. It needs PHP sodium and a stable key ring configured outside the database, for example in wp-config.php:

define( 'ITC_MW_CREDENTIAL_KEYS', array( 'key1' => getenv( 'ITC_MW_CREDENTIAL_KEY1' ) ) );
define( 'ITC_MW_CREDENTIAL_ACTIVE_KEY', 'key1' );

Supply a base64-encoded, cryptographically random 32-byte key through your environment or secret manager. Back up the key separately from the database. Do not commit it to source control or generate a new one on every request. If the key is lost, the plugin cannot decrypt the credentials; restore the original key rather than deleting the encrypted data.

New or changed settings and migration profiles are encrypted when the key ring is configured. Existing plaintext is not automatically changed. After testing the configuration and taking a recoverable backup, use WP-CLI to protect the existing settings and profiles:

Terminal window
wp itc-media credentials protect

For rotation, add the new key under a new ID while retaining all old keys, select the new ID as active, and run the command again. Active settings and saved profiles are processed separately: if interrupted, retain the full key ring and rerun the command. Keep old keys and backups until recovery has been verified. Previous database backups may still contain plaintext.

Before downgrading to an older version without credential encryption, back up the database and key ring, then run wp itc-media credentials unprotect and verify that it succeeds. This explicitly restores plaintext credentials for the older version. A staging rehearsal is recommended.

Create an R2 bucket and an API token with Object Read & Write permission for that bucket only. Enter the account’s S3 API endpoint (use the EU, US or FedRAMP jurisdiction endpoint if the bucket uses one), the bucket name and the token’s access key ID and secret.

For public pages, connect a custom domain to the bucket and enter it as the public media delivery address. A custom domain makes the bucket’s objects publicly readable, so do not use it for media that must stay private. Without a delivery domain, the plugin creates signed links that expire after 15 minutes. Since version 0.3.34, the plugin requests that pages containing private URLs are not cached, but this only helps when the page cache, CDN and proxy respect those instructions. Clear existing cached pages and verify delivery on your site; a cache that ignores the instructions can still serve expired links. A stable delivery domain avoids this for media intended to be public. See Cloudflare’s guides to public buckets and presigned URLs.

From the storage page you can copy the existing library to the bucket, restore media to local uploads, and move to another bucket. Each file is copied one at a time and checked before an attachment switches over. During a move between buckets, media can be served from either bucket: keep the source bucket until the move and any queued clean-up have finished.

Background work runs in batches. While the storage page is open, batches run immediately; when it is closed, WordPress cron continues them. If cron does not run reliably on your host, jobs pause; the storage page warns about missing or overdue batches. Keep the page open for large jobs, or fix the site’s cron first.

When you edit an image that is already in the cloud with the WordPress image editor, the change is synced straight away. If the sync fails, the edited local files stay in place and the workspace shows that the image needs attention.

After verifying delivery from the bucket, an administrator can remove local copies for one attachment, or in confirmed batches under Media → Storage → Remove existing local copies (up to 100 attachments per preview; repeat it for the rest). Each cloud file is downloaded again and compared before the local copy is removed. Batches can be paused, resumed, retried and cancelled.

Limits to keep in mind:

  • Removal is blocked for files linked directly in stored post content. Links in custom fields, page builders and other sites are not detected; check them yourself.
  • Other software does not respect the plugin’s lock and can change a file during removal. A failed deletion can leave an attachment partly removed; the job reports it so you can retry or restore.
  • Keep a separate backup. After local copies are removed, the plugin is needed to deliver those files. Restore them to local uploads before you deactivate or remove the plugin.

The itc_mw_media_delivery_url filter lets a CDN or image service rewrite the address of a cloud file. It receives the verified provider URL, the attachment ID, the object key and the variant (original, a registered size, or srcset-{width}). Without a filter, delivery is unchanged. An integration that uses it is responsible for access control, responsive sizes, caching and valid HTTPS addresses.