wp-media / wp-media/imagify-plugin
Sometimes Optimization Can Hang For a Long Time and Then Fail
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 82
- Forks
- 31
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 9
Description
Describe the bug
Sometimes, when optimization is attempted on an image, it can just hang on "Optimizing..." for a long time:

And then optimization fails, but instead of offering an error message to give the user an indication of what is wrong, it just fails and the Optimize button returns:

We can see here that the process is set to run up to 10 minutes:
https://github.com/wp-media/imagify-plugin/blob/5971929e9842066e1351704ce14f25c5f31a7180/classes/Optimization/Process/AbstractProcess.php#L1710
To Reproduce
Unfortunately, not sure how to reproduce this.
Expected behavior
We should see if there is a way to prevent optimization from hanging if possible. At the least, an error message should be returned to let the user know what is happening and possible solutions.
Could also help if the functionality suggested in the following issue is implemented so optimization can be stopped manually by the user: https://github.com/wp-media/imagify-plugin/issues/642
Backlog Grooming (for WP Media dev team use only)
- Reproduce the problem
- Identify the root cause
- Scope a solution
- Estimate the effort
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at classes/Optimization/Process/AbstractProcess.php around line 1710, where the optimization process can run for up to 10 minutes. First try to reproduce the hang during image optimization, then identify the failure path and its root cause. Done means preventing the hang where possible or returning a useful error message and possible solutions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100