2bd501d6103c51a1a2f443ebdbb74884c79360e7
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>
Radio — SomaFM player for your WordPress dashboard
A small, focused, free WordPress plugin that drops a SomaFM radio player into your admin dashboard. 44 hand-curated stations across 10 genres — ambient, electronic, lounge, rock, metal, jazz, world, reggae, holiday, and specials.
What it does
- Mini-player on WP Admin → Dashboard (opt-out via Settings)
- Dedicated page at WP Admin → Radio → My Radio
- Plays via HTML5
<audio>— no proxy server, no third-party tracking - Per-user state: each admin remembers their own station + volume
- Self-hosted update checker against the Gitea repo
Installation
- Download the latest release
.zipfrom git.davidtkeane.com/ranger/a-radio/releases - WP Admin → Plugins → Add New → Upload Plugin
- Activate
- Look at WP Admin → Dashboard for the mini-player, or WP Admin → Radio
Requirements
- WordPress 5.0+
- PHP 7.4+
- A modern browser (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)
Credits
All stations and streams are provided by SomaFM, an independent, listener-supported, commercial-free internet radio network broadcasting from San Francisco since 2000. If you enjoy this plugin, please consider donating to SomaFM directly.
License
GPL v2 or later. See LICENSE (the same GPL v2+ terms as WordPress itself).
Author
David Keane — part of the RangerHQ plugin family. rangersmyth.xyz
Languages
PHP
59.3%
JavaScript
21.6%
CSS
19.1%