v0.6.0
Until v0.5.0 the audio cut every time you navigated between WP admin
pages — every navigation is a full page reload, which destroys the
<audio> element. v0.6.0 fixes the background-music use case by letting
you pop the player out into a separate browser window that persists
across the parent tab's navigation.
Pop-out window
- Small "↗ Pop out" button beside the Play button on both the main
Radio page and the Dashboard widget.
- Opens a 380×560 standalone window via window.open() with a window
name of `radio_popout` so a second click re-focuses the existing
popup rather than spawning a new one.
- Popup renders at admin-post.php?action=radio_popout&play=1 — a new
admin_post_radio_popout hook outputs a full standalone HTML page
(custom DOCTYPE / head / body, no WP admin chrome).
- Theme follows radio_state['theme'] via body class radio-theme-{...}.
- Includes the full player (now-playing block with dancing bars +
Web Audio visualizer, play, mute, volume, station dropdown, error
slot). Close button calls window.close().
Auto-resume + single-stream invariant
- cfg.autoPlay is true when the popup URL carries &play=1. radio.js
auto-calls audio.play() 200 ms after init. Same-origin user-gesture
popups are exempt from autoplay-blocking on every modern browser.
- On pop-out click, every other audio surface in the parent tab is
paused so there is only ever one stream playing.
State stays in sync
- Popup uses the SAME radio_save_state AJAX + track-logging endpoint.
Station / volume changes persist to user_meta; track history keeps
accumulating from whichever surface is playing.
Edge cases
- Inside the popup, cfg.popoutUrl is '' so bindPopOut hides any
Pop-out button it finds (would be infinite otherwise).
- Popup blocked by browser → clear alert tells the user to allow
popups for this site.
Files
- radio.php (version, popoutUrl in localized config, admin_post
handler + full standalone HTML renderer)
- inc/admin-page.php + inc/dashboard-widget.php (Pop-out button
beside Play)
- assets/css/radio.css (.radio-player__popout styling)
- assets/js/radio.js (bindPopOut function; autoPlay branch in
bindPlayer)
- inc/about.php + CHANGELOG.md (history entries)
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%