v1.0.4
Critical Bug Fix
This release fixes a critical bug where images with similar names could be incorrectly matched, resulting in wrong srcset and metadata attributes.
Bug Fixed
Image ID Detection Issue: The plugin was incorrectly associating images due to overly aggressive filename pattern matching. For example, Gerl-Neumeister-scaled.webp could be matched to Dr.-Christian-Gerl-scaled.webp.
Changes
- Improved attachment ID lookup in
Helper::find_attachment_by_filename()- Now uses exact path matching as first priority
- Directory-aware searches to prevent cross-folder collisions
- Only removes known WordPress suffixes (
-scaled,-rotated,-NNNxNNN) - Prevents false matches between similarly named images
Technical Details
The fix implements a multi-strategy approach:
- Exact match with full relative path (highest priority)
- Match without WordPress size suffixes, preserving user-defined names
- Directory-scoped LIKE searches
- GUID fallback (backwards compatibility only)
This ensures that each image is correctly identified and receives its own proper attributes, preventing incorrect srcset generation.
Upgrade Priority
High - This bug could cause wrong images to be displayed in responsive image scenarios. Upgrading is strongly recommended.
Installation
Download the mwe-etchwp-enhancements-1.0.4.zip file and install it via WordPress admin panel.