3.4.2 — fix collapsed lightbox, rewrite docs, refresh screenshots - #112
Open
puikinsh wants to merge 1 commit into
Open
3.4.2 — fix collapsed lightbox, rewrite docs, refresh screenshots#112puikinsh wants to merge 1 commit into
puikinsh wants to merge 1 commit into
Conversation
Already published to WordPress.org as 3.4.2.
THE BUG
assets/css/fancybox.css carried a rule that is not in upstream fancyBox:
.fancybox-content { height: auto !important; }
It was added in 3.2.5 for "extra height on lightbox image wrapper". Because it is
!important it overrode the inline height fancyBox calculates for every slide. On
its own that happened to work; with a second copy of fancyBox's CSS on the page
it did not, and fancyBox's class names are deliberately not namespaced, so any
theme or plugin bundling its own copy collides.
Measured on WordPress 7.0.2 with a theme that bundles fancyBox 3.3.5:
image slides 20px tall - the border alone, image invisible
iframe slides 0px
which is also why videos played sound with no picture. Reproduced identically on
3.3.7, so this was long-standing rather than a regression.
WHY REMOVAL RATHER THAN SCOPING
A scoped variant that kept the override for non-image slides was tried first and
rejected: it fixed images but still collapsed iframes. Removing it outright is the
only variant that works for both, and the "extra height" it was written for does
not return - the content box now matches the image exactly in both caption
positions, with and without a competing stylesheet.
Note this does not make the plugin immune to a duplicate fancyBox stylesheet. It
turns a total collapse into a working lightbox that a competing sheet can still
mis-size. Properly isolating it would mean namespacing the CSS class names, which
fancyBox itself generates, and is not a patch-release change. The new FAQ explains
how to spot and resolve the conflict.
DOCS
The FAQ answered exactly two questions, both about a security release from 2015.
It now covers captions, excluding individual images, gallery grouping, loading the
lightbox only on chosen pages, PDFs on iOS, page builders, translations and
diagnosing a conflict with another lightbox. The description was mostly outbound
links; it now describes what the plugin does.
SCREENSHOTS
Four new ones taken on WordPress 7.0, replacing two from 2016 that showed an
interface which no longer exists. They live in .wordpress-org/ and are synced to
the plugin directory's assets rather than bundled, so the download drops from
644 KB to 222 KB. deploy.yml now sets ASSETS_DIR so future releases sync them.
Verified: 0 plugin-check errors, phpcs clean, PHP 8.5 harness clean across all
settings states, front-end and admin browser suites pass.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Already published to WordPress.org as 3.4.2. This brings
masterin line.The bug
I found this while setting up screenshots — the lightbox rendered a 20px sliver instead of the image.
assets/css/fancybox.csscarried a rule that is not in upstream fancyBox:Added in 3.2.5 for "extra height on lightbox image wrapper". Being
!important, it overrode the inline height fancyBox calculates for every slide. Alone that happened to work — but fancyBox's CSS class names are deliberately not namespaced (only the JS is), so any theme or plugin bundling its own copy collides.Measured on WordPress 7.0.2 against a theme that bundles fancyBox 3.3.5:
A zero-height content box is also why a video would play sound with no picture.
Reproduced identically on 3.3.7, so this is long-standing, not a regression.
Why removal rather than scoping
I tried a scoped variant first — keep the override for non-image slides, since that seemed to be its purpose — and rejected it after testing: it fixed images but still collapsed iframes.
And the "extra height" it was written for does not return: the content box now matches the image exactly in both caption positions, with and without a competing stylesheet.
This does not make the plugin immune to a duplicate fancyBox stylesheet. It turns a total collapse into a working lightbox that a competing sheet can still mis-size (1160px vs 804px in my test). Properly isolating it means namespacing class names that fancyBox itself generates — not a patch-release change. The new FAQ explains how to spot and resolve the conflict.
Docs
The FAQ answered two questions, both about a security release from 2015. It now covers captions (including
data-caption), excluding individual images, gallery grouping, loading the lightbox only on chosen pages viamfbfw_is_enabled, PDFs on iOS, page builders, translations, and diagnosing a conflict with another lightbox.The description was largely outbound links; it now describes what the plugin actually does.
Screenshots
Four new ones taken on WordPress 7.0, replacing two from 2016 that showed an interface which no longer exists. They live in
.wordpress-org/and sync to the plugin directory's assets rather than being bundled:Download: 644 KB → 222 KB.
deploy.ymlnow setsASSETS_DIRso future releases sync them automatically.Verified
phpcs: clean · PHP 8.5 harness: clean across all settings states3.4.2identical; theheight:auto!importantrule confirmed absent from the shipped minified CSSOne correction to my earlier claim
When I reported that this plugin and a theme's bundled fancyBox "coexist independently", that was true of the JavaScript namespaces — which the
fancyboxforwprename protects — and I presented it as a clean pass. It was not true of the CSS. This bug lives exactly there.