Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Image Storage transfer can remain at 0% when scheduled work does not execute

未关闭
#1,108 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清

调研方向

从 inc/media_offload.php 中的 Optml_Media_Offload::move_images()、schedule_action()、is_scheduled() 和 maybe_reschedule() 开始,然后检查 assets/src/dashboard/utils/api.js 中的 callSync()。运行 tests/test-media.php 中与 rollback 相关的测试,并复现 scheduler 插入失败或过时的 pending action。完成的实现应包含回归覆盖,表明不会持续推进的传输不会无限期保持 active,而是会恢复或达到一个可见的终止状态。

由索引模型根据 Issue 内容生成。

描述

bug-report bug-report-triage customer report

Summary

An Image Storage transfer-back operation can remain active without processing images. The operation is expected to either begin restoring files or enter a visible failure state. Instead, the inspected workflow can continue reporting an active transfer with an unchanged count, leaving the user unable to recover locally stored originals through the plugin.

Customer context

  • Product / area: Optimole Pro, Image Storage transfer back
  • Version: Customer version not provided; inspected source is 4.2.10
  • Environment: WordPress; Windows 10 and Firefox reported by ticket metadata
  • Integration / third party: The customer reports no caching plugin or server cache and reports cron as active
  • Reported error / symptom: Transfer remains stuck before visible progress after password protection was removed
  • Impact: Cloud-stored images cannot be restored to the site's local media storage through the plugin

Reproduction notes

Reported workflow:

  1. Start an Image Storage sync/transfer-back operation.
  2. Remove the site's password gate and retry while images are publicly accessible.
  3. Observe that the transfer remains active before visible progress.

Support later confirmed public image access. The customer reports no cache and active cron. No controlled runtime reproduction was performed; the scheduler-failure condition is confirmed from source, while its occurrence on this site remains inferred.

Diagnosis

Conclusion

The transfer state is persisted as active before background work is scheduled, while the scheduler result is discarded. Polling derives activity from that persisted setting and remaining image count rather than from worker execution or a progress heartbeat. This directly permits a non-progressing operation to remain active indefinitely when the scheduled action is absent, stale, or not executing. The ticket's exact environmental trigger is unknown because no logs or usable screenshot were available.

Where this likely occurs
  • inc/media_offload.php — Optml_Media_Offload::move_images() lines 1854–1934: stores transfer metadata and active status, invokes schedule_action() without evaluating its result, then returns the persisted activity state.
  • inc/media_offload.php — Optml_Media_Offload::schedule_action() and is_scheduled() lines 1946–1970: delegates to Action Scheduler or WP-Cron and treats the presence of a scheduled record as sufficient evidence of recoverable work.
  • inc/media_offload.php — Optml_Media_Offload::maybe_reschedule() lines 197–219: skips recovery whenever a scheduled record exists, without checking whether image counts are advancing.
  • assets/src/dashboard/utils/api.js — callSync() lines 479–590: polls every ten seconds while status is true and count is nonzero, with no no-progress boundary.
  • Git history: commit 52ebcd90 refactored the current scheduling/REST path; the inspected behavior is present in tags from v4.0.0 through v4.2.10.
Engineering notes

The same bulk-processing path handles offloading and rollback, although this report concerns transfer back. Action Scheduler is preferred when available, with WP-Cron as fallback. A pending Action Scheduler record can suppress maybe_reschedule() even when no batch advances. Persistent batch exceptions also retry the same step without a terminal attempt limit in Optml_Media_Offload::start_processing_images() at lines 2035–2101. The customer reports cron as active, but Action Scheduler state, request logs, worker execution, and server resource limits were not captured.

Test coverage status

tests/test-media.php includes test_image_sync() at lines 326–346 and test_image_rollback() at lines 348–358, but these call media operations directly. No relevant coverage was found during inspection for scheduler insertion failure, stale pending actions, non-advancing jobs, REST polling, or terminal handling of persistent batch failures.

What to verify or explore next
  • May be worth reproducing a rollback with scheduler insertion returning failure and confirming the REST count/status sequence.
  • May be worth reproducing a pending Action Scheduler record whose worker does not run, while WP-Cron requests continue normally.
  • If reproducible, checking Action Scheduler records and Optimole rollback logs for the affected operation could distinguish missing dispatch from a repeatedly failing first batch.
  • The direct rollback suites in tests/test-media.php and a status-poll integration path are relevant verification surfaces.
Unknowns / follow-up

The customer's Optimole version, image count, PHP/WordPress versions, Action Scheduler backend, first rollback log error, and exact scheduler state are unavailable. The original screenshot was not retrievable through the sanctioned ticket-image tool.

Confidence

Confidence: 90/100

Two independently verifiable defects in the Optimole WordPress plugin match the reported stalled rollback and disabled Image Storage UI. The screenshot and site-specific logs are unavailable, so confidence is based on direct source-path evidence rather than a customer-site reproduction.


Source: HelpScout #3411333716
Generated by bug-report-triage (ID: bug-report-triage_6a7f1f81ead033.88694331)

主要语言
PHP
星标
74
派生
14
平均合并
2 天 6 小时
30 天内合并 PR
18

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Codeinwp/optimole-wp 的其他 Issue

查看 Codeinwp/optimole-wp 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。