Skip to content

fix(linkable-blocks): correct enqueued stylesheet path - #19

Merged
brandonmarshal merged 2 commits into
developfrom
fix-linkable-blocks-stylesheet-path
Sep 7, 2026
Merged

fix(linkable-blocks): correct enqueued stylesheet path#19
brandonmarshal merged 2 commits into
developfrom
fix-linkable-blocks-stylesheet-path

Conversation

@brandonmarshal

Copy link
Copy Markdown
Collaborator

Description

The Linkable Blocks stylesheet was 404ing on every single page load sitewide. inc/linkable-blocks.php enqueued build/css/style-linkable-blocks.css, a filename that doesn't exist in the build output — the actual compiled file (present, correctly built by webpack, committed to the repo) is build/css/linkable-blocks.css, with no style- prefix.

Two other blocks in this plugin (back-to-top, button-icon) genuinely do get a style- prefix from their own webpack entry names, so this enqueue code was almost certainly copy-pasted from one of those and the prefix was never removed for linkable-blocks.

Because this style is registered on init and enqueued on wp_enqueue_scripts (sitewide, not gated to any template or block), every single frontend page load requested the broken URL, received a 404 HTML error page back instead of CSS, and got blocked by strict MIME-type checking (X-Content-Type-Options: nosniff) — surfacing as network errors and MIME-mismatch console warnings across the consuming site (ls-theme), including on search results and 404 pages.

Changes

  • inc/linkable-blocks.php — corrected the enqueued path from build/css/style-linkable-blocks.css to build/css/linkable-blocks.css
  • CHANGELOG.md — added entry under [Unreleased] / Fixed

Files Modified

  • inc/linkable-blocks.php — 1 line changed
  • CHANGELOG.md — +1 line

Testing

  • Confirmed via repo-wide search (all file types, excluding node_modules/vendor/.git) that the wrong filename appears in exactly this one place — no other reference needs the same fix
  • Confirmed the corrected target file (build/css/linkable-blocks.css) exists on disk and is already correctly built — no rebuild needed
  • composer run phplint — no syntax errors
  • vendor/bin/phpcs --standard=WordPress inc/linkable-blocks.php — the one finding reported (missing EOF newline, line 362) is pre-existing on develop and unrelated to this change, confirmed via git show develop:... | phpcs
  • Verify on the consuming site (ls-theme / ls-agency.lightspeedwp.dev) once merged and deployed, that the stylesheet loads with a 200 and Content-Type: text/css, and that the related BugHerd network-error/MIME-mismatch tickets clear

Deployment Notes

  • No breaking changes — corrects a broken reference to an already-existing, already-built file
  • No version bump included in this PR — flagging for reviewer to confirm whether one is expected
  • No build step required — PHP-only change, no JS/CSS source touched

Checklist

  • php -l / composer run phplint passed
  • PHPCS/WPCS pass (pre-existing unrelated finding noted above)
  • Verified the fix doesn't affect any other file referencing the old path (none found)

Related Issues

Related to LS-2935 (LightSpeed) and LS-2940 (console errors likely caused by this bug, in the ls-theme repo) — not part of this repo's issue tracker.

Bug fix
- Change build/css/style-linkable-blocks.css to build/css/linkable-blocks.css
- The "style-" prefix was copy-pasted from another block's enqueue
  code; this block's actual webpack output has no such prefix
- Caused the stylesheet to 404 on every single page load sitewide
@brandonmarshal brandonmarshal added area:plugins Plugin configuration/internals lang:php PHP code release:patch Backwards‑compatible bug fixes requiring a PATCH version bump (e.g., small fixes, docs updates). status:needs-review Awaiting code review labels Sep 3, 2026
@linear-code

linear-code Bot commented Sep 3, 2026

Copy link
Copy Markdown

LS-2935

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change corrects a verified incorrect asset path to an existing built file and is consistent with the associated .asset.php metadata already used by the style registration.

Pull request overview

This PR fixes a sitewide frontend asset issue in the LightSpeed Site Plugin by correcting the registered/enqueued Linkable Blocks stylesheet path so WordPress loads an existing built CSS file rather than hitting a 404.

Changes:

  • Updated the Linkable Blocks style registration to enqueue build/css/linkable-blocks.css (the file that exists in build/).
  • Added a [Unreleased] / Fixed changelog entry describing the 404/MIME-type impact and the corrected path.
File summaries
File Description
inc/linkable-blocks.php Fixes the registered stylesheet URL to match the actual compiled CSS asset (build/css/linkable-blocks.css).
CHANGELOG.md Documents the fix under [Unreleased] / Fixed.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@krugazul krugazul left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ive reviewed this commit, its nice and small only 2 changes thanks.

@brandonmarshal
brandonmarshal merged commit 0013ccd into develop Sep 7, 2026
1 check passed
@brandonmarshal
brandonmarshal deleted the fix-linkable-blocks-stylesheet-path branch September 7, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:plugins Plugin configuration/internals lang:php PHP code release:patch Backwards‑compatible bug fixes requiring a PATCH version bump (e.g., small fixes, docs updates). status:needs-review Awaiting code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants