feat(0.7.0): WordPress.org submission prep — full Plugin Check clean

Ran the official Plugin Check (PCP) against v0.6.3 — surfaced 169
issues. This release closes all of them so the plugin is submission-
ready for the WordPress.org plugin directory.

Branding
  - Plugin Name renamed: "Radio" → "RangerHQ Radio". Removes the
    trademarked "SomaFM" from the plugin name surface (PCP
    trademarked_term). Lines up with the RangerHQ plugin family.
    SomaFM credited in Description + About as the data source.
    Folder/slug stays `a-radio` — no install path changes; existing
    user_meta keys (radio_state / radio_history / radio_favourites)
    untouched.
  - Text Domain header renamed: `radio` → `a-radio` (matches slug).
  - Requires at least bumped: 5.0 → 5.3 (matches wp_date() usage).
  - File docstring header dropped "SomaFM" from prominent line.

Code (mass-mechanical)
  - 134 i18n call sites rewritten from `'radio'` text domain to
    `'a-radio'` across 7 PHP files. Single sed pass on the unique
    pattern `, 'radio' )` — the 6 menu-slug `'radio'` references in
    add_*_page() were correctly left alone (those are URL slugs).

Security
  - 8 × MissingUnslash + 8 × InputNotSanitized in the v0.5.0 history
    endpoints (radio_ajax_log_track, radio_ajax_toggle_favourite).
    All four $_POST['artist|title|station|station_id'] access points
    are now wrapped sanitize_text_field( wp_unslash( $_POST['…'] ) )
    (or sanitize_key for station_id) at the access point.

Translator comments
  - 6 × printf / sprintf calls with placeholders now carry
    /* translators: ... */ comments.

Pop-out window refactor
  - Inline <link> stylesheets, <style> block, and <script> tag in
    radio_render_popout_page() replaced with wp_enqueue_style() +
    wp_enqueue_script() + wp_localize_script() registered before HTML
    output, then wp_print_styles() in <head> and wp_print_footer_
    scripts() at end of <body>.
  - Popup-specific CSS moved out of inline <style> and into radio.css
    under body.radio-popout scope so it only fires inside the popup.

Removed
  - .DS_Store files (root + assets/). PCP hidden_files.

Distribution
  - New readme.txt in proper WordPress.org format: Plugin headers,
    Contributors, Donate link, Tags, Requires-at-least, Tested-up-to,
    Stable Tag, Requires-PHP, License, Description, Installation,
    FAQ, Screenshots, Changelog, Upgrade Notice.

Compat
  - No behaviour change for users; user_meta preserved.
  - Displayed Plugin Name in Plugins → Installed changes from "Radio"
    to "RangerHQ Radio" — only visible difference on update.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-30 02:51:09 +01:00
parent 224fccd6c4
commit 09b61cc950
10 changed files with 352 additions and 171 deletions
+33
View File
@@ -557,6 +557,39 @@
border: 1px solid #3c434a;
}
/* ──────────────────────────────────────────────────────────────────
* Pop-out window (v0.6.0 → moved here from inline <style> in v0.7.0
* for PCP cleanliness). All scoped to body.radio-popout so these
* rules only fire inside the popup window, never bleed onto admin
* pages that load the same radio.css.
* ─────────────────────────────────────────────────────────────── */
body.radio-popout {
/* Popup has no WP admin chrome to provide --wp-admin-theme-color;
set a reasonable default so the player + links still tint. */
--wp-admin-theme-color: #2271b1;
margin: 0;
padding: 14px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background: #f0f0f1;
color: #1d2327;
font-size: 13px;
}
body.radio-popout .radio-popout-header { display: flex; justify-content: space-between; align-items: center; margin: 0 0 12px; }
body.radio-popout .radio-popout-header h1 { margin: 0; font-size: 14px; font-weight: 600; color: #1d2327; }
body.radio-popout .radio-popout-header h1::before { content: '📻 '; }
body.radio-popout .radio-popout-close { background: none; border: 0; font-size: 18px; cursor: pointer; color: #646970; padding: 4px 8px; line-height: 1; border-radius: 3px; }
body.radio-popout .radio-popout-close:hover { color: #b32d2e; background: rgba(179, 45, 46, 0.08); }
body.radio-popout .radio-popout-wrap { background: #fff; border: 1px solid #c3c4c7; padding: 14px; border-radius: 3px; }
body.radio-popout .radio-popout-wrap .radio-player__station-select select { max-width: 100%; }
body.radio-popout .radio-popout-wrap .radio-player__volume { width: 100%; }
body.radio-popout .radio-popout-wrap .radio-player__controls { flex-direction: column; align-items: stretch; gap: 10px; }
/* Popup dark theme — keeps the popup readable when theme=dark */
body.radio-popout.radio-theme-dark { background: #101213; color: #f0f0f1; }
body.radio-popout.radio-theme-dark .radio-popout-header h1 { color: #f0f0f1; }
body.radio-popout.radio-theme-dark .radio-popout-wrap { background: #1d2327; border-color: #3c434a; }
body.radio-popout.radio-theme-dark .radio-popout-close { color: #a7aaad; }
/* ──────────────────────────────────────────────────────────────────
* History + Favourites page (v0.5.0)
* ─────────────────────────────────────────────────────────────── */