litespeedtech / litespeedtech/lscache_wp
Gather Images Outside Metadata
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 257
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
We use a plugin that generates additional crops sizes for images that are stored outside of the metadata and added via the `wp_get_attachment_metadata` hook. I see that the Img_Optm `_gather_images` function makes a direct database query and skips over using internal WP function calls, so the callbacks are never applied.
Are there any hooks or methods for optimizing image crops that are not explicitly stored in the attachment's metadata? Ideally I'd like a way to pass these extra image sizes for webp generation, as well as the source string replacement on the front end. Otherwise we're unable to benefit from the webp functionality without reworking all client sites.
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 by tracing Img_Optm::_gather_images and compare its direct metadata query with WordPress's wp_get_attachment_metadata hook. Review how image sizes feed WebP generation and frontend source-string replacement. Done means extra crop sizes can be supplied to both optimization paths without requiring client sites to rework their image metadata.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100