Skip to content

3.4.2 — fix collapsed lightbox, rewrite docs, refresh screenshots - #112

Open
puikinsh wants to merge 1 commit into
masterfrom
release/3.4.2
Open

3.4.2 — fix collapsed lightbox, rewrite docs, refresh screenshots#112
puikinsh wants to merge 1 commit into
masterfrom
release/3.4.2

Conversation

@puikinsh

@puikinsh puikinsh commented Aug 7, 2026

Copy link
Copy Markdown
Member

Already published to WordPress.org as 3.4.2. This brings master in line.

The bug

I found this while setting up screenshots — the lightbox rendered a 20px sliver instead of the image.

assets/css/fancybox.css carried a rule that is not in upstream fancyBox:

.fancybox-content { height: auto !important; }

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:

slide type before after
image 20px — the border alone, image invisible renders correctly
iframe 0px renders correctly

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.

variant image iframe
as shipped collapsed collapsed
scoped to non-image renders collapsed
removed renders renders

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 via mfbfw_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.yml now sets ASSETS_DIR so future releases sync them automatically.

Verified

  • plugin-check on the built package: 0 errors
  • phpcs: clean · PHP 8.5 harness: clean across all settings states
  • front-end and admin browser suites: pass
  • SVN trunk and tag 3.4.2 identical; the height:auto!important rule confirmed absent from the shipped minified CSS

One 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 fancyboxforwp rename protects — and I presented it as a clean pass. It was not true of the CSS. This bug lives exactly there.

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>
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

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