Address the Theme Check recommendations that are real - #352
Merged
Conversation
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>
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.
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.class-wp-bootstrap-navwalker.php:113site_url() . $item->url/wp/#sectionclass-shapely-builder.php:105site_url()api.settings.url.preview, a front-end URL — could never matchThe 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 ininc/extras.phpposts towp-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,#745cf9links) so the editor resembles the resultshapely-filled,shapely-outline,shapely-shortThe styles reuse the theme's existing
.btnrules and brand colour rather than inventing a second palette, and ship asinline_styleso they cost nothing on sites that never insert those blocks.Verified on a live WordPress, not by grep:
Also
Removed
assets/css/font-awesome.cssandfont-awesome.min.css— two more Font Awesome 5 leftovers nothing enqueued.Left alone, with reasons
role="search"—shapely_search_form()is theget_search_formfilter callback (add_filterat line 529). That is the mechanism the warning asks for; Theme Check only greps for the attribute.include/requireininc/libraries/— allrequire_once( ABSPATH . 'wp-admin/…' )core includes, not template parts.WP_Filesystem— inside the vendored Epsilon framework, which Theme Check itself says not to modify.