Skip to content

Offload-limit warning remains after account usage drops #1118

Open

Description

@pirate-bot

Status (2026-10-11)

Fixed in PR #1176 (bugfix/1118 → development, approved by pirate-bot at a34edda3).

  • Fix: the daily sync now compares the account usage with the offload limit. Below the limit it clears the "offload limit reached" warning, and it stores the account's real limit, so the warning no longer shows the 50,000 default.
  • Also fixed: the upload check counted the images of an earlier bulk transfer that had already ended (or of a rollback), so one upload could set the warning on an account far below its limit. Only an offload that is still running counts now, from the dashboard or from WP-CLI.
  • Tests: the daily sync with usage below the limit, at the limit, and without usage details; nine cases for the upload check (rollback, dashboard and WP-CLI offloads that are running, ended or interrupted). They fail on development.
  • To know: an account that really is at its limit gets the warning back on its next upload.
  • Not proven: against the live account API (mocked in the tests), and the WP-CLI offload on a connected site.

Summary

The WordPress Optimole settings can continue showing the offload-limit warning after account usage has fallen below the plan limit. Expected behavior is for refreshed account usage to clear an obsolete warning. Actual behavior is a persisted warning that displays the stored 50,000-image limit despite substantially lower dashboard usage, which can incorrectly indicate that further offloading is unavailable.

Customer context

Product / area: Optimole WordPress plugin, Image Storage offloading status
Version: Customer version not provided; inspected source is 4.2.11
Environment: WordPress admin; browser and WordPress/PHP versions not provided
Integration / third party: Optimole account service and dashboard
Reported error / symptom: Plugin shows a 50,000-images-offloaded warning while the account dashboard shows 1,181 assets
Impact: Administrators receive an inaccurate quota warning after deleting environments

Reproduction notes

Reported reproduction:

  1. Delete duplicate Optimole environments so account usage drops.
  2. Confirm the Optimole dashboard shows 1,181 assets.
  3. Open the Optimole WordPress plugin settings.
  4. Observe the 50,000-images-offloaded limit warning.

The customer report was not reproduced in a local runtime, but the stale-state path is directly present in the inspected source.

Diagnosis

Conclusion

The warning state is persisted independently from refreshed account usage. Optml_Admin::daily_sync() refreshes service_data but does not reconcile offload_limit_reached, while the settings UI renders the warning solely from that persisted flag and a locally stored limit. A previous support investigation also classified false offload-limit warnings as a UI notification defect. No matching GitHub issue was found.

Where this likely occurs

  • inc/admin.php — Optml_Admin::daily_sync() lines 1130–1158 refreshes account service data without updating the persisted offload-limit warning state.
  • inc/admin.php — Optml_Admin::localize_dashboard_app() lines 1409–1477 passes account data and the local offload_limit to the dashboard as separate values.
  • inc/settings.php — Optml_Settings::$defaults lines 102–103 defines the persisted warning flag and the 50,000 fallback limit.
  • assets/src/dashboard/parts/connected/settings/OffloadMedia.js — OffloadMedia lines 438–440 renders the warning whenever offloadLimitReached is true, without comparing refreshed usage.
  • assets/src/dashboard/utils/api.js — callSync() lines 525–546 updates the warning state only in a terminal transfer-response branch.
  • inc/media_offload.php — Optml_Media_Offload::generate_image_meta() lines 1384–1400 persists the reached state during the proactive quota check; lines 1446–1457 persists it after an upload-limit exception.
  • Commit 7b8a68f8 introduced offloading-limit notifications. Available history does not establish an earlier working release followed by a regression.

Engineering notes

The displayed 50,000 value can come from the plugin's local default or a previously stored service limit; it is not the current asset count. The dashboard's 1,181 assets and the SDK's offload-usage value may represent different service fields, so the account-specific discrepancy remains dependent on service data. The confirmed defect is the lack of reconciliation for an already persisted warning when account information refreshes.

Test coverage status

No relevant coverage was found during inspection for stale offload_limit_reached state, daily-sync reconciliation, or warning rendering. tests/test-media.php exercises offload processing and mocked account details but does not assert warning state transitions.

What to verify or explore next

  • May be worth reproducing after reducing usage below the limit, running the account refresh, and reopening Optimole settings.
  • May be worth capturing the SDK getUsage() current and limit values alongside refreshed service_data in a controlled test account.
  • If reproducible, checking both a completed bulk transfer and a newly uploaded attachment would clarify which warning-state path persists.

Unknowns / follow-up

  • The customer's plugin version and locally persisted Optimole settings are unavailable.
  • The service-side usage payload and whether environment deletion immediately changes SDK offload usage are unavailable.

Confidence

Confidence: 92/100

Repository inspection independently confirms a stale offload-limit warning path and a missing local download target after offload. The blank-rendering symptom is credible but remains unconfirmed without the affected remote response or offloading logs.


Source: HelpScout #3431088020
Generated by bug-report-triage (ID: bug-report-triage_6a8f62001e0958.60696283)

Activity

  1. added theissue type on Aug 26, 2026
  2. pirate-bot commented on Aug 26, 2026

    @pirate-bot
    CollaboratorAuthor

    Another customer reported this via support.

    Users can experience a false maximum offloading limit warning of 50,000 images in the Image Storage settings even when actual account usage is far below that threshold. Investigation shows this happens because the offload preflight in inc/media_offload.php records the reached state from remote SDK usage without storing the associated remote limit, causing the UI in assets/src/dashboard/parts/connected/settings/OffloadMedia.js to fall back to a stale local default of 50,000 defined in inc/settings.php. To reproduce, trigger the preflight offload-limit state on an account with a remote limit other than 50,000 and inspect the dashboard after processing stops.


    Source: HelpScout #3431483323
    Generated by bug-report-triage (ID: bug-report-triage_6a8f61fb907113.58011326)

  3. self-assigned this
    on Oct 9, 2026
  4. pirate-bot commented on Oct 11, 2026

    @pirate-bot
    CollaboratorAuthor

    QA agent — 🟢 Passing checks · Daily sync clears the stale warning, and uploads no longer count finished transfers.

    On a connected site with a mocked Optimole account, daily sync cleared the old warning and new uploads were offloaded. Completed transfers and rollbacks no longer caused false quota warnings, while a genuine quota showed the correct 5,000-image limit. Dashboard transfers and the actual WP-CLI command lifecycle also passed. The stale warning and false upload block both reproduced on the base build; the candidate resolved them.

    Worth a human look

    1. Repeat account refresh after deleting duplicate environments in a live Optimole account, then upload an image.
    2. Check browser image delivery against the live Optimole CDN.
    Checks (5 passed)
    • ✅ On a connected site with a stale 50,000-image warning, daily account sync at 1,181 of 20,000 images clears the Image Storage warning and stores the account limit; usage at or above the limit preserves an existing warning, and missing usage details leave its state unchanged.
    • ✅ A new Media Library upload is offloaded after the stale warning is cleared; rollback, ended dashboard or WP-CLI progress, expired WP-CLI progress and idle legacy progress do not falsely block it, while only a still-running offload counts pending images toward the quota.
    • ✅ When the account really reaches its offload quota, the next new upload is not offloaded and Image Storage shows the account's actual 5,000-image limit rather than the 50,000 fallback.
    • ✅ A bulk transfer started from Image Storage records whether it is offloading or rolling back, never marks dashboard progress as WP-CLI activity, and finishes with no active dashboard offload counting its completed progress.
    • ✅ A connected-site WP-CLI bulk offload records foreground activity, refreshes it as images move and clears it at command end; an expired interrupted-run mark is not revived by later uploads, which remain offloaded.

    Full report, evidence and session trail

  5. kushh23 commented on Oct 11, 2026

    @kushh23
    Contributor

    🧪 QA steps and test sandbox

    Once Optimole has shown the "maximum offloading limit" warning in Image Storage, it never goes away on its own, even when the account is far below its limit again (for example after deleting duplicate environments). The warning also shows the 50,000 default instead of the account's real limit, and while it is set new uploads are not offloaded.

    Requires: your own Optimole account (API key) with Image Storage, well below its offload limit.

    Step Build Bot check
    Reproduce the bug Optimole 4.2.16 (released) ⏭️ Not checked: needs an Optimole account
    Verify the fix PR #1176 build a34edda ⏭️ Not checked: needs an Optimole account (the bot confirmed the build installs over the release)

    On the sandbox:

    • https://qa-optimole-wp-1118.s1-sandywp.com runs the release. Sign in to SandyWP and use the sandbox's Auto Login.
    • Code Snippets and WP Crontrol are already installed for steps 3 and 6.
    • Tools → QA Logs shows debug.log, which the public site can't read.
    • If it has stopped after a day without use, the next qa-playground run brings it back.

    Step 3 stands in for an earlier upload that hit the limit.

    Reproduce on Optimole 4.2.16:

    1. Optimole → connect with your API key.
    2. Visit the site's front end once (this schedules Optimole's account sync).
    3. Snippets → Add New: title Set offload limit warning, code ( new Optml_Settings() )->update( 'offload_limit_reached', 'enabled' );, scope Only run once, then save it with Execute Once.
    4. Optimole → Settings → Image Storage: the "You have reached the maximum offloading limit of 50000 images" warning shows.
    5. Tools → Cron Events: find optml_daily_sync and click Run now.
    6. Reload Optimole → Settings → Image Storage.
    • Bug: the warning is still there, still with 50000 images.

    Verify the fix on the same sandbox:

    1. Download the PR build above, then go to Plugins → Add New Plugin → Upload Plugin and click Replace current with uploaded.
    2. Repeat the steps above from step 3.
    • Fixed: after Run now, the warning is gone. Plugins still shows 4.2.16, since the build has no version bump.
    Edge cases
    • After the sync clears the warning, upload an image in Media → Add New Media File: it is offloaded (its File URL points to Optimole).
    • Run a full offload from Image Storage, then a Transfer back from Optimole, then upload one image: no limit warning appears.
    • An account that really is at its limit: the warning comes back on the next upload, showing the account's real limit, not 50000.
    • Run Run now twice in a row on an account below the limit: no warning, no errors in Tools → QA Logs.

    Fix: #1176 (open)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions