Skip to content

v1.0.4

Choose a tag to compare

@Jehu Jehu released this 20 Nov 16:33
· 79 commits to main since this release

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:

  1. Exact match with full relative path (highest priority)
  2. Match without WordPress size suffixes, preserving user-defined names
  3. Directory-scoped LIKE searches
  4. 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.