Skip to content

Asset version and wp_kses for HTML-in-printf - #36

Merged
thisismyurl merged 1 commit into
mainfrom
fix/asset-version-and-printf-kses
Jun 7, 2026
Merged

Asset version and wp_kses for HTML-in-printf#36
thisismyurl merged 1 commit into
mainfrom
fix/asset-version-and-printf-kses

Conversation

@thisismyurl

Copy link
Copy Markdown
Owner

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

  • Install on a WordPress test site and confirm plugin activates without errors
  • Verify Plugin Check passes with no new warnings on the modified files
  • Confirm existing functionality unchanged

AI-assisted: fixes researched and applied with Claude Sonnet 4.6; reviewed by Christopher Ross.

- 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>
Copilot AI review requested due to automatic review settings June 7, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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__() with sprintf() + 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'
);
@thisismyurl
thisismyurl merged commit d8bcf62 into main Jun 7, 2026
7 checks passed
@thisismyurl
thisismyurl deleted the fix/asset-version-and-printf-kses branch June 7, 2026 18:38
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.

2 participants