Skip to content

Background image processing mode#1122

Open
dkotter wants to merge 5 commits into
developfrom
feature/async-image-processing
Open

Background image processing mode#1122
dkotter wants to merge 5 commits into
developfrom
feature/async-image-processing

Conversation

@dkotter

@dkotter dkotter commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Description of the Change

For our Image Processing Features, we currently have two processing modes: automatic or manual. Automatic fires when an image is uploaded and blocks the request until processing is done. We then added the manual mode which allows you to manually trigger the Feature on an image-by-image basis.

This PR adds in a new mode that will trigger automatically but runs as a background process so requests aren't blocked. This utilizes Action Scheduler to schedule and run an event after an image has been uploaded. While this event is running, we disable the scan buttons and show a processing message. Once that event completes, we automatically update the UI with the result (assuming a user has kept the UI open).

This allows users to run these Features automatically on each item but avoid having requests be blocked while processing is happening. They can upload an image, insert it into the content and do additional work while behind the scenes, alt text generation is happening or OCR is running.

How to test the Change

  1. Checkout this PR and run npm i && npm run build
  2. Turn on an Image Processing Feature like Descriptive Text Generation
  3. Enable the new Automatically on upload (background) processing mode
  4. Go to the Media Library and ensure you're on the grid view
  5. Upload an image and then open that image in the media modal
  6. Ensure the generate button for that Feature is disabled and shows a processing message
  7. For quicker testing, in a new window, go to Tools > Scheduled Actions and find the classifai_schedule_image_process_job scheduled action
  8. Run that action
  9. Back in the other window, ensure the button is no longer disabled and the alt text is populated (or whatever Feature you're testing)
  10. Test again within a post using the image block. Add an image block, open the Media Library and drag in an image to upload
  11. Run through the same tests again

Screenshots

background-image-processing.mov

Changelog Entry

Added - New processing mode for Image Processing Features that will run the Feature automatically but on a background process

Credits

Props @dkotter

Checklist:

Open WordPress Playground Preview

@dkotter dkotter added this to the 3.9.0 milestone Jun 18, 2026
@dkotter dkotter self-assigned this Jun 18, 2026
@dkotter dkotter requested review from a team and jeffpaul as code owners June 18, 2026 17:50
@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@github-actions github-actions Bot added the needs:code-review This requires code review. label Jun 18, 2026
@jeffpaul

Copy link
Copy Markdown
Member

Action Scheduler just hit v4, is there a specific version of that plugin we want/need to require here (or anything that's new in v4 that perhaps may not have been accounted for In the original design for this PR)?

@dkotter

dkotter commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

Action Scheduler just hit v4, is there a specific version of that plugin we want/need to require here (or anything that's new in v4 that perhaps may not have been accounted for In the original design for this PR)?

I saw that release went out and did look through the changelog and nothing caught my eye as being immediately useful.

We also just a week or so ago bumped Action Scheduler to what was then the latest version: #1087.

I think it would be good to bump to 4.0 but I'd rather wait to give that some time to be more fully tested before making the leap (I know the next version of Woo is shipping with it and wouldn't be surprised if that ends up finding a few things that need fixed)

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

Labels

needs:code-review This requires code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants