Description
Simple Radio Forty Two is a small radio player for WordPress, inspired by Radio 42. It is written in vanilla JavaScript (no jQuery). You configure stations once, then drop the player on any page with [sr42_radio] or the Simple Radio Forty Two block.
What it does
- Plays Icecast / MPC, SomaFM, and Radio Paradise streams from a dropdown.
- Shows now-playing metadata (artist, title, next track when the source provides it) via the REST route
/wp-json/sr42/v1/meta. - On supporting mobile browsers, uses the Media Session API: lock-screen title, artwork, play/pause, and previous/next station.
- Remembers the last station and volume in
localStorage. If you navigate to another page that also contains the player, it tries to resume playback. See the FAQ: browsers often block that autoplay. - Optional custom title and button/background images under Simple Radio Styling.
This plugin does not keep audio playing across a full page load by itself (no background Service Worker). Media Session controls work while the tab that started playback stays open, including with the phone locked.
Configuration
- Simple Radio — copy the shortcode.
- Settings — station name, stream URL, and server type (Icecast / SomaFM / Radio Paradise).
- Styling — title and image URLs, with a live preview. Save to apply on the public player.
Usage
- Shortcode:
[sr42_radio] - Block: Simple Radio Forty Two (Media category). Dynamic render: the same HTML as the shortcode. Stations always come from Settings (no per-block station list).
There is no separate classic widget. On a classic widget screen you can put the shortcode in a Shortcode or Custom HTML widget.
License
Simple Radio Forty Two is licensed under the GPLv2 or later. See LICENSE.txt for details.
Acknowledgments
Thanks to the WordPress community and the Radio 42 developers for the inspiration.
Blocks
This plugin provides 1 block.
- Simple Radio Forty Two Embed the radio player. Stations are configured under Simple Radio → Settings.
Installation
- Install from Plugins Add New, or upload the plugin folder to
/wp-content/plugins/. - Activate Simple Radio Forty Two.
- Open Simple Radio Settings and add or edit stations.
- Insert
[sr42_radio]in a page, or add the Simple Radio Forty Two block in the editor.
FAQ
-
Why is there a “Please wait” message at startup?
-
On the default Radio 42 Icecast stream, the player briefly buffers (about five seconds) so the first play is less likely to stutter. Other stations skip that wait.
-
Does it remember my station after a refresh?
-
Yes. The last stream URL is stored in
localStorage. Volume is stored the same way. -
Will music keep playing when I open another page?
-
Only if that other page also embeds the player and the browser allows autoplay. After a full navigation, Chrome and Safari usually require a tap on Play. That is a browser rule, not a missing feature.
-
What about the lock screen?
-
While the player page stays in memory and audio is playing, supporting phones show title, artwork, and play/pause (and station skip) via Media Session. Closing the tab or killing the browser stops the stream.
-
Does it support mobile devices?
-
Yes. Play/pause are real buttons (keyboard and screen-reader accessible). Volume and station selects have labels.
-
Can I add the player in the block editor?
-
Yes. The block is registered with
block.jsonand rendered in PHP. It does not replace the shortcode.
Reviews
Contributors & Developers
“Simple Radio Forty Two” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Simple Radio Forty Two” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
2.1.0
- Compat: Tested up to WordPress 7.1.
- Added: Media Session API — now-playing title/artist, artwork, play/pause, previous/next station on supporting lock screens.
- Added: After in-site navigation, the player tries to resume if
sessionStoragesays it was playing. Autoplay is often blocked; the FAQ explains why. - Added: Gutenberg block
sr42/radiois registered fromblocks/radio/block.jsonwith a dynamic PHP render (same output as the shortcode). The 2.0.0 JS-only registration is replaced, not duplicated. - Design: Player and admin screens drop gold “laser” glow. Native admin layout (
.wrap,.form-table,.button). Play/pause are<button>s witharia-labeland visible focus. - Docs:
readme.txtplusdocs/USER-GUIDE.md(English) anddocs/MODE-DEMPLOI.md(French).
2.0.0
- New: Native Gutenberg block
sr42/radio— drop the player anywhere in the block editor with zero shortcode knowledge required. - New: Metadata now fetched via a proper REST API endpoint (
/wp-json/sr42/v1/meta) instead ofadmin-ajax.php— faster, cacheable, and standards-compliant. - Fix: Replaced deprecated
document.execCommand('copy')with the modern Clipboard API in the admin shortcode tool. - Fix: All hardcoded French error strings in the front-end JS are now fully translated via
wp_localize_script. - Fix: Aligned CSS asset version with plugin version (was 1.4.1, now 2.0.0).
- Compat: Tested and confirmed compatible with WordPress 7.0.
- Compat: Raised minimum PHP requirement to 7.4 (null coalescing assignment, named args).
1.3.1
- Fix: Corrected the Shortcode copy tool to support modern Clipboard API and added UI feedback.
- Fix: Implemented station persistence (F5) via localStorage.
- Fix: Added default “fallback” stations if the database is empty (Radio 42, SomaFM, Radio Paradise).
- Fix: Resolved a regression where the selected station was reset on initial load.
1.3.0
- Way cleaner UI and overall performance optimization.
- Final stable release for WordPress 6.9.
- Integrated Icecast/SomaFM metadata (Artist/Title) via AJAX.
- Added “Laser Glow” visual effect on the volume slider.
- Synchronized initial buffer with page load cycle.
1.2.3
- Switched to pure Vanilla JS (jQuery-free).
- Added 4 predefined radio stations.
- Added Click Lock mechanism to prevent UI spamming.
1.2.2
- Fixed shortcode detection bug.
- Updated compatibility for WordPress 6.7.
1.0
- First stable version.
- Added basic radio player and customization options.



