wp-media / wp-media/imagify-plugin

Sometimes Optimization Can Hang For a Long Time and Then Fail

Open
#641 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

optimization priority: high severity: major type: bug
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:

image

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:

image

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.