Please give us a description of what happened.
Currently, src/pageScanner/checks/img-alt-empty-check.js skips some hard-coded image URLs (like known smileys and specific tracking pixels), but does not automatically skip images that are exactly 1x1 in size. True tracking pixels with width="1" and height="1" (from any src or base64) should also be ignored by the rule if they have an empty alt attribute, to avoid false positives for WCAG 1.1.1.
Please describe what you expected to happen and why.
The accessibility check should automatically skip (ignore) all img elements with empty alt attributes if their width and height are both exactly 1 (matching tracking pixel conventions), regardless of the src path. This aligns with standard practice—1x1 tracking pixels are not meaningful visual content.
How can we reproduce this behavior?
-
Create or test a post with the following image markup:
<img src="tracking.gif" alt="" width="1" height="1">
-
Run Accessibility Checker: it reports this as a failure, but it should be SKIPPED.
-
Try with a non-tracker 1x1 image (other src):
<img src="https://example.com/whatever.png" alt="" width="1" height="1">
It also fails (should be skipped).
-
Try with a slightly larger image:
<img src="tiny.png" alt="" width="2" height="1">
This should continue to fail (not be skipped) as it’s not a 1x1 tracking pixel.
Technical info
- WordPress version: (any)
- Accessibility Checker version: (any)
- Editor(s): any
- Browser(s): any
Please reference these required tests in tests/jest/rules/imgAltEmpty.test.js
<img src="track.gif" alt="" width="1" height="1"> → shouldPass: true
<img src="https://example.com/whatever.png" alt="" width="1" height="1"> → shouldPass: true
<img src="tiny.png" alt="" width="2" height="1"> → shouldPass: false
- (optional)
<img src="maybe-tracker.gif" alt=""> → shouldPass: false
Strongly recommend adding/expanding tests in tests/jest/rules/imgAltEmpty.test.js to verify this edge case and prevent regression!
Labels: bug, a11y
Please give us a description of what happened.
Currently,
src/pageScanner/checks/img-alt-empty-check.jsskips some hard-coded image URLs (like known smileys and specific tracking pixels), but does not automatically skip images that are exactly 1x1 in size. True tracking pixels withwidth="1"andheight="1"(from any src or base64) should also be ignored by the rule if they have an empty alt attribute, to avoid false positives for WCAG 1.1.1.Please describe what you expected to happen and why.
The accessibility check should automatically skip (ignore) all
imgelements with emptyaltattributes if their width and height are both exactly 1 (matching tracking pixel conventions), regardless of the src path. This aligns with standard practice—1x1 tracking pixels are not meaningful visual content.How can we reproduce this behavior?
Create or test a post with the following image markup:
Run Accessibility Checker: it reports this as a failure, but it should be SKIPPED.
Try with a non-tracker 1x1 image (other src):
It also fails (should be skipped).
Try with a slightly larger image:
This should continue to fail (not be skipped) as it’s not a 1x1 tracking pixel.
Technical info
Please reference these required tests in
tests/jest/rules/imgAltEmpty.test.js<img src="track.gif" alt="" width="1" height="1">→ shouldPass: true<img src="https://example.com/whatever.png" alt="" width="1" height="1">→ shouldPass: true<img src="tiny.png" alt="" width="2" height="1">→ shouldPass: false<img src="maybe-tracker.gif" alt="">→ shouldPass: falseStrongly recommend adding/expanding tests in
tests/jest/rules/imgAltEmpty.test.jsto verify this edge case and prevent regression!Labels: bug, a11y