Plugin Page

WooCommerce – Retroactive Download Access

View Plugin

Sync Methods

The plugin offers two strategies for granting retroactive download permissions. You select one from WP-Admin > Retroactive Downloads > Sync Method; both methods use the same Scope and Behavior settings.


Comparison

Background ProcessOn-the-Fly
TriggerProduct save (automatic) or manual buttonCustomer visits My Account > Downloads
ProcessingAsynchronous, batched — Action Scheduler processes orders in configurable page sizes (default 20 per job)Synchronous, unbatched — all of a customer’s orders scanned in a single page request
Customer sees new filesAfter the AS job completesImmediately on their next Downloads page visit (after cache expires)
Browser tab requiredNo (automatic)No
Per-user throttleNot applicableYes — configurable cache window (default 60 min)
Typical useStores with infrequent file changes or a moderate number of historical orders per productStores with a large number of historical orders per product and frequent file changes

Background Process

Permissions are granted asynchronously. When you save a product with new files, the plugin detects the change and queues an Action Scheduler job. The job runs on the next WP-Cron tick and processes orders in configurable batches.

Manual triggers are also available:

  • Per product — a Regenerate Download Permissions button on the product edit page
  • Global — the Regenerate All Permissions button on the Tools tab

See Background Process for full details.


On-the-Fly

Permissions are granted in real time when a customer visits My Account > Downloads. A per-user cache prevents repeated database scans within the configured time window.

No background jobs are queued. The customer sees new files on the same page load that triggers the grant.

See On-the-Fly for full details.


Switching Methods

You can switch between methods at any time from the Sync Method tab. Switching does not affect permissions already granted. Any pending Action Scheduler jobs scheduled under the Background Process method will still complete even after switching to On-the-Fly, because the AS workers are always registered.

Background Process

The Background Process method grants permissions asynchronously. It uses WooCommerce’s built-in Action Scheduler library to process past orders in the background without blocking the admin or affecting storefront performance.


Automatic Detection

When you save a downloadable product in WP-Admin, the plugin compares the files before and after the save:

  1. Before save (priority 1): the current download file hashes are captured from the database.
  2. After save (priority 20): the new hashes from the submitted form are compared against the captured set.
  3. If new download IDs are found — or if Force Reset Permissions is enabled — the plugin schedules a regeneration job for that product.

A success notice is displayed on the product edit page confirming the job was queued.


Batch Processing

Each regeneration job processes a page of orders containing the updated product:

  1. The job fetches up to Batch Size order IDs from the database.
  2. Each order is checked against the configured eligible statuses and date range.
  3. For each eligible order, the plugin checks which of the product’s current download files the customer does not yet have permission for.
  4. Missing permissions are granted via WooCommerce’s wc_downloadable_file_permission() function.
  5. Expiry and download limit overrides are applied according to the Behavior settings.
  6. If any new permission was granted in the order, a customer notification email is sent (if enabled).
  7. If the batch was full, the next page is scheduled immediately.

The full order set is paginated automatically — no manual intervention is needed for products with many past orders.

Scale note: Each file change triggers a full scan of all past orders for the affected product. For products with a large number of historical orders, this produces a proportionally large number of AS jobs. If file changes are also frequent, jobs can accumulate faster than they are processed. In these cases, consider switching to On-the-Fly, which distributes the work across individual customer page visits instead of scanning all orders at once.


Manual Triggers

Per-Product Trigger

On the product edit page, in the Downloadable Files section, click Regenerate Download Permissions. This queues the same background job as automatic detection, processing all past orders for that product.

See Per-Product Controls for details.

Global Trigger

In WP-Admin > Retroactive Downloads > Tools, click Regenerate All Permissions to process all eligible orders across all downloadable products. This is browser-driven and requires the tab to stay open.

See Tools for details.


Monitoring Progress

Check job status at WooCommerce > Status > Scheduled Actions. Filter by the group wcrda to see all pending, running, and completed jobs. Each per-product job is named wcrda_process_product_batch.

With Debug Mode enabled, detailed per-order and per-file log entries are written to WooCommerce > Status > Logs.

On-the-Fly

The On-the-Fly method grants missing permissions in real time, triggered when a customer visits My Account > Downloads. No background jobs are scheduled — permissions are created during the page load and the customer sees new files immediately.


How It Works

When a customer visits their Downloads page, the plugin:

  1. Checks whether the per-user scan cache is still valid (see Cache below). If yes, the scan is skipped and the standard download list is returned.
  2. If the cache has expired (or is disabled), the plugin fetches all of the customer’s orders matching the configured eligible statuses and date range.
  3. For each eligible order, each downloadable product is checked for files the customer does not yet have permission to download.
  4. Any missing permissions are granted immediately.
  5. If any new permissions were granted in a given order, a customer notification email is sent (if enabled).
  6. The scan timestamp is updated in user meta (_wcrda_last_scan), starting the cache window.
  7. The download list is re-fetched from the database so the newly granted files appear on the same page load.

Cache

The per-user cache prevents a full order scan on every page visit.

Cache Duration (default: 60 minutes) — how long to wait before running a new scan for a given user. Configured at WP-Admin > Retroactive Downloads > Sync Method.

Disable Cache — forces a fresh scan on every visit. Useful during testing, but adds a database scan to every Downloads page load for every customer.

The cache window is per-user. One customer visiting their Downloads page does not affect the cache state of another customer.


Scaling Characteristics

Why On-the-Fly can be preferable for large stores: Background Process scans all past orders for a product every time a file change is detected, processing them in batches (default 20 orders per job) via Action Scheduler. For a product with tens of thousands of historical orders, a single file change can queue thousands of batched AS jobs. With frequent file changes this can saturate the AS queue and generate sustained database load.

On-the-Fly never scans all orders at once. Each scan covers only the visiting customer’s own orders. The total work is distributed over time as customers visit their Downloads page, and the per-user cache further limits how often each customer’s orders are re-scanned.

Page load impact per customer: On the first visit after the cache expires, the scan runs synchronously within the page request. The cost scales with the individual customer’s own order count — not the store’s total order volume. For customers with a very large number of their own orders ('limit' => -1 is used), this can add noticeable latency.

File changes are not detected proactively: Unlike Background Process, On-the-Fly does not watch for product saves. There is no admin notice confirming that a specific customer has received access — permissions are granted when each customer next visits their Downloads page after the cache expires.

Force Reset is not supported: The Force Reset Permissions option has no effect in On-the-Fly mode. Existing permissions are not deleted before new ones are granted.