3 Commits

Author SHA1 Message Date
ranger 340cbb2487 v0.7.5 — WordPress.org slug rename: a-radio → rangerhq-radio
A third-party AI-driven naming check flagged `a-radio` as too
generic for the wp.org Plugin Directory (single common functional
word, no distinguishing prefix). The verdict was advisory but
defensible — short generic slugs are increasingly rejected as the
directory grows past 60K plugins. Fixing it preemptively is cheaper
than facing a rejection at submission time.

The new slug `rangerhq-radio` matches the public display name
"RangerHQ Radio" (unchanged) and lines up with the rest of the
RangerHQ plugin family: `rangerhq-spatial`, `rangerhq-glyph`,
now `rangerhq-radio`.

Changes (packaging only — no player behaviour change):
* Text Domain `a-radio` → `rangerhq-radio` across all 125 i18n
  call sites via in-place sed (esc_html__, _e, __, esc_attr_e
  and their friends). PHP lint clean post-rename.
* `Text Domain:` plugin header in radio.php line 15 → `rangerhq-radio`.
* `RADIO_GITEA_URL` constant value → new Gitea repo URL.
* README.md install link → new repo URL.
* readme.txt FAQ Gitea link → new repo URL.
* readme.txt Stable tag → 0.7.5.
* inc/about.php — v0.7.5 in "latest" slot; v0.7.4 demoted.

Unchanged deliberately (would have been pure churn):
* Plugin Name header "RangerHQ Radio" — already correct.
* Plugin URI.
* Internal constants `RADIO_*` — don't have to match slug.
* User-meta keys `radio_state` / `radio_history` /
  `radio_favourites` — renaming would orphan every existing
  user's settings on upgrade.
* HTML `data-radio-*` attributes — JS controller's element
  selectors in radio.js, not slug-related.
* CSS class names `radio-player`, `radio-about-*` — internal
  scoping.
* Main plugin file name `radio.php`.

Migration: existing Gitea-installed copies need their folder
renamed on disk (a-radio → rangerhq-radio) + reactivation in
WP admin. No data loss because all user-facing state lives in
user_meta under unchanged keys.

This commit is the file content for v0.7.5; the annotated tag
and push will follow the Gitea repo rename (ranger/a-radio →
ranger/rangerhq-radio) so the new tag lives in the new URL
space from the start.
2026-05-30 04:55:39 +01:00
ranger 09b61cc950 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>
2026-05-30 02:51:09 +01:00
ranger 2bd501d610 feat(0.5.0): track history + favourites with four search providers
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>
2026-05-29 23:55:18 +01:00