Background image processing mode#1122
Conversation
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
|
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) |
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
npm i && npm run buildAutomatically on upload (background)processing modeTools > Scheduled Actionsand find theclassifai_schedule_image_process_jobscheduled actionScreenshots
background-image-processing.mov
Changelog Entry
Credits
Props @dkotter
Checklist: