Skip to content

Address the Theme Check recommendations that are real - #352

Merged
puikinsh merged 1 commit into
masterfrom
fix/theme-check-recommendations
Aug 11, 2026
Merged

Address the Theme Check recommendations that are real#352
puikinsh merged 1 commit into
masterfrom
fix/theme-check-recommendations

Conversation

@puikinsh

Copy link
Copy Markdown
Member

Folded into the unreleased 1.2.21.

Two are genuine bugs, not style points

site_url() is where the WordPress files live; home_url() is the site address. They differ whenever WordPress is installed in its own subdirectory.

file was effect
class-wp-bootstrap-navwalker.php:113 site_url() . $item->url one-page section links pointed at /wp/#section
class-shapely-builder.php:105 site_url() compared in JS against api.settings.url.preview, a front-end URL — could never match

The builder one also gains the trailing slash the preview URL carries; the unslashed site_url() could not have matched it even on a root install.

The third site_url() is deliberately left alone. The post-password form in inc/extras.php posts to wp-login.php, which genuinely does live at the WordPress files location. Changing it would break password-protected posts on exactly the installs the other two fixes help.

Block editor recommendations — implemented

  • add_theme_support( 'wp-block-styles' )
  • add_editor_style( 'assets/css/editor-style.css' ) — mirrors the front-end typography (Raleway 14/24, #8c979e, heading scale, #745cf9 links) so the editor resembles the result
  • 3 block styles: shapely-filled, shapely-outline, shapely-short
  • 2 patterns: a centred call to action and a two-column feature

The styles reuse the theme's existing .btn rules and brand colour rather than inventing a second palette, and ship as inline_style so they cost nothing on sites that never insert those blocks.

Verified on a live WordPress, not by grep:

block styles registered: 3
  core/button     ->  shapely-filled
  core/button     ->  shapely-outline
  core/separator  ->  shapely-short
block patterns registered: 2
wp-block-styles support: yes
editor styles: assets/css/editor-style.css

Also

Removed assets/css/font-awesome.css and font-awesome.min.css — two more Font Awesome 5 leftovers nothing enqueued.

Left alone, with reasons

  • role="search"shapely_search_form() is the get_search_form filter callback (add_filter at line 529). That is the mechanism the warning asks for; Theme Check only greps for the attribute.
  • include/require in inc/libraries/ — all require_once( ABSPATH . 'wp-admin/…' ) core includes, not template parts.
  • WP_Filesystem — inside the vendored Epsilon framework, which Theme Check itself says not to modify.
  • Footer credit link — intentional.

Two are genuine bugs rather than style points:

  inc/class-wp-bootstrap-navwalker.php built one-page section links as
  site_url() . $item->url, and inc/class-shapely-builder.php localised
  site_url() for comparison against api.settings.url.preview. Both are
  front-end addresses, but site_url() is where the WordPress *files* live --
  so on an install with WordPress in a subdirectory the section links pointed
  at /wp/#section, and the builder comparison could never match. Both now use
  home_url(). The builder also gains the trailing slash the preview URL
  carries, which the unslashed site_url() could never have matched.

  The one remaining site_url() -- the post-password form in inc/extras.php --
  is correct and deliberately left: it posts to wp-login.php, which really
  does live at the WordPress files location.

The block-editor recommendations are implemented rather than waved away:
wp-block-styles, an editor stylesheet mirroring the front-end typography, three
block styles and two patterns. The styles reuse the theme's existing button
rules and brand colour instead of introducing a second palette, and ship as
inline_style so they cost nothing on sites that never use them.

Also removes assets/css/font-awesome.css and font-awesome.min.css, two more
Font Awesome 5 leftovers that nothing enqueued.

Verified on a live WordPress rather than by grep: 3 block styles and 2 patterns
present in the registries, wp-block-styles supported, editor style registered.

Not changed, and not defects:

  - role="search" in inc/extras.php is the get_search_form filter callback
    (add_filter at line 529). That is exactly the mechanism the warning asks
    for; Theme Check only greps for the attribute and cannot tell.
  - The include/require hits in inc/libraries/ are require_once( ABSPATH .
    'wp-admin/...' ) core includes, not template parts.
  - The WP_Filesystem hits are inside the vendored Epsilon framework, which
    Theme Check itself says not to modify.
  - The footer credit link is intentional.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@puikinsh
puikinsh merged commit 45b9b26 into master Aug 11, 2026
10 checks passed
@puikinsh
puikinsh deleted the fix/theme-check-recommendations branch August 11, 2026 10:29
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