Asset version and wp_kses for HTML-in-printf - #36
Merged
Conversation
- Bump asset version constant to 1.6149.0734 to match header - Replace esc_html__() + printf() pattern (which double-encodes the link HTML) with wp_kses( sprintf() ) allowing only the <a> tag with its expected attributes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses WordPress Plugin Check (PHPCS) warnings by aligning an enqueued asset version with the plugin version and sanitizing localized output that includes literal HTML.
Changes:
- Updated the admin stylesheet enqueue version string.
- Replaced
printf()+esc_html__()withsprintf()+wp_kses()to allow a literal<a>tag in a translated string.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
135
to
140
| wp_enqueue_style( | ||
| 'timu-elc-admin', | ||
| plugins_url( 'assets/css/admin.css', __FILE__ ), | ||
| array(), | ||
| '1.6148' | ||
| '1.6149.0734' | ||
| ); |
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.
Summary
Plugin Check: asset version mismatch; printf with literal HTML arg needs wp_kses instead of esc_html__.
Changes
Plugin Check (PHPCS) fixes — no behaviour changes to production functionality.
Test plan
AI-assisted: fixes researched and applied with Claude Sonnet 4.6; reviewed by Christopher Ross.