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>
Quietly log every track that scrolls past the player to a per-user
history (capped 500). A star button promotes the good ones to a
separate Favourites tab that doesn't age out. Each row has four
search-provider deep links so you can find the track on whichever
service you use.
Storage
Two new user_meta keys (separate from radio_state so frequent
inserts don't churn the player-state blob):
- radio_history — capped FIFO of last 500 played tracks
- radio_favourites — uncapped user-starred list
New page: Radio → History
- History tab: capped FIFO list, newest first.
- Favourites tab: starred tracks (uncapped).
- Each row: when (relative + full timestamp on hover) / station /
artist — title / four search links / favourite-star toggle.
- Filter by artist/title (live, client-side) + by station (dropdown).
- Clear history button (favourites preserved).
- Search providers: Spotify, YouTube, Apple Music, Bandcamp.
Deep-link URLs only — no API keys, no third-party JS.
Auto-logging during playback
fetchTrack (existing 30s SomaFM poll loop) now hands new tracks to
logTrackIfNew → POST to wp_ajax_radio_log_track. Dedup client-side
(lastLoggedSig) AND server-side (against last entry in user_meta).
Junk filtered server-side: (unknown) artist, missing artist/title.
New AJAX endpoints
- radio_log_track (nonce radio_save_state — player pages)
- radio_toggle_favourite (nonce radio_history — history page only)
- radio_clear_history (nonce radio_history — history page only)
Files
- radio.php (version, require new include, submenu page, asset
enqueue hook adds radio_page_radio-history, three AJAX endpoints,
three new localized strings)
- inc/history.php (NEW — storage helpers + admin page renderer)
- assets/css/radio.css (history table, toolbar, search-link pills,
favourite star, dark-theme overrides)
- assets/js/radio.js (logTrackIfNew wired into fetchTrack;
bindHistoryPage handles filter/favourite/clear)
- inc/about.php (history entry)
- CHANGELOG.md (full entry)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>