Skip to content

fix: disable img sizes=auto to mitigate Gutenberg bug (1.2.2) - #65

Merged
nickpagz merged 1 commit into
trunkfrom
fix/disable-img-auto-sizes
Jul 17, 2026
Merged

nickpagz merged 1 commit into
trunkfrom
fix/disable-img-auto-sizes

Conversation

@nickpagz

Copy link
Copy Markdown
Contributor

Summary

Emergency mitigation. WordPress 6.7+ automatically adds a sizes="auto" attribute to lazy-loaded images via the wp_img_tag_add_auto_sizes filter. A Gutenberg bug in this behavior is affecting potentially hundreds of partner sites, and the upstream fix — WordPress/gutenberg#80386 — has no confirmed release date.

This PR disables the auto-sizes behavior fleet-wide so we don't have to wait on a Gutenberg release:

add_filter( 'wp_img_tag_add_auto_sizes', '__return_false' );

Where it lives / why

Registered in Plugin::initialize() (a new register_core_compat_filters() helper) rather than behind a module, so it runs on every active install regardless of module settings — enabling the fastest possible blanket rollout. The helper is clearly marked temporary and links the Gutenberg PR so it's easy to find and remove once the upstream fix ships.

Safety

  • add_filter() + __return_false are both WordPress core — no version/dependency risk.
  • The filter only fires during image-tag rendering; harmless where the attribute wasn't being added.
  • No error/notice if the hook is absent — registration is inert until the filter runs.

Version

Patch bump 1.2.1 → 1.2.2 (a8csp-atlantis.php header + @version, package.json), per the release checklist in README.md.

Follow-up

Revert register_core_compat_filters() (or just the single line) once the Gutenberg fix is released and has propagated to sites.

🤖 Generated with Claude Code

WordPress 6.7+ adds a `sizes="auto"` attribute to lazy-loaded images via
the `wp_img_tag_add_auto_sizes` filter. A Gutenberg bug in this behavior is
affecting potentially hundreds of partner sites, and the upstream fix
(WordPress/gutenberg#80386) has no confirmed release date.

Register `add_filter( 'wp_img_tag_add_auto_sizes', '__return_false' )` in
Plugin::initialize() so it applies to every active install regardless of
module settings, allowing a quick fleet-wide rollout. Remove once the
Gutenberg fix ships.

Bumps version to 1.2.2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@t51eng-poseidon

Copy link
Copy Markdown

🔱 Poseidon started reviewing this PR — central run.

@t51eng-poseidon t51eng-poseidon Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔱 Poseidon Review

Summary — Emergency fleet-wide mitigation that disables the WordPress 6.7+ sizes="auto" image attribute via a new register_core_compat_filters() helper; low risk, correct filter name, no issues found on this pass.

  • 🐛 Fix — Registers add_filter( 'wp_img_tag_add_auto_sizes', '__return_false' ) in Plugin::initialize() to work around the upstream Gutenberg bug.
  • 🔧 Chore — Patch version bump 1.2.1 → 1.2.2 across a8csp-atlantis.php and package.json.

ℹ️ Review info
  • Commit: 831cdb4
  • Files reviewed: a8csp-atlantis.php, package.json, src/Plugin.php
  • Files skipped: none
  • Model: claude-opus-4-8

@nickpagz
nickpagz merged commit cef8ecf into trunk Jul 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant