Skip to content

Stop loading stylesheets out of the theme's directory - #43

Merged
puikinsh merged 1 commit into
masterfrom
fix/stop-reaching-into-the-theme
Aug 12, 2026
Merged

Stop loading stylesheets out of the theme's directory#43
puikinsh merged 1 commit into
masterfrom
fix/stop-reaching-into-the-theme

Conversation

@puikinsh

Copy link
Copy Markdown
Member

Found while testing Shapely 1.3.0 on a real install.

The plugin loaded two stylesheets from wherever the theme happened to be installed:

enqueued from the theme removed by the theme in
assets/css/font-awesome.min.css 1.2.21 — already released
inc/libraries/epsilon-framework/assets/css/style.css 1.3.0

Both 404 on widgets.php and customize.php.

Severity: admin-only and cosmetic. One is behind is_admin(), the other only fires on the widgets and customizer screens. No fatal, nothing visitor-facing. But a plugin reaching into a theme's internal file layout is exactly the coupling that caused the break, so the fix is to stop doing it rather than to chase the paths.

Changes

  • Font Awesome now points at the theme's current FA6 copy, under shapely-companion-font-awesome rather than the generic font-awesome handle — which can suppress another copy already registered on the page — and only when the file is actually present. The widget forms work without it; icon previews just render blank.
  • The Epsilon stylesheet enqueue is removed, along with the now-empty enqueue() methods and the admin_init / customize_controls_enqueue_scripts / customize_preview_init hooks that called them.

Verified

WordPress 7.0.3 / PHP 8.5.3. The admin screens that previously logged two 404s now load with none, and the full admin sweep passes with 0 fatals and 0 console errors.

The plugin pulled two stylesheets from wherever Shapely happened to be
installed, using get_template_directory_uri():

    assets/css/font-awesome.min.css
    inc/libraries/epsilon-framework/assets/css/style.css

Shapely removed the first in 1.2.21 when it moved to Font Awesome 6, and the
second in 1.3.0 when the vendored Epsilon framework was retired. Both therefore
404 on the widgets and customizer screens. The font-awesome one is already
failing against the released 1.2.21.

Neither is fatal and neither affects visitors -- both are admin-only, one behind
is_admin() and the other only on widgets.php and customize.php -- but a plugin
reaching into a theme's internal file layout is the coupling that made this
break in the first place.

Font Awesome now points at the theme's current copy, under our own handle
rather than the generic 'font-awesome' (which can suppress another copy already
registered on the page), and only when the file is actually present. The widget
forms work without it; the icon previews simply render blank.

The Epsilon stylesheet enqueue is removed outright, along with the now-empty
enqueue() methods and the admin_init / customize_controls_enqueue_scripts /
customize_preview_init hooks that pointed at them.

Verified on WordPress 7.0.3 / PHP 8.5.3: the admin screens that previously
logged two 404s now load with none.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@puikinsh
puikinsh merged commit 13c277f into master Aug 12, 2026
10 checks passed
@puikinsh
puikinsh deleted the fix/stop-reaching-into-the-theme branch August 12, 2026 12:36
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