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.
This commit is contained in:
2026-05-30 04:55:39 +01:00
parent de93aa50ca
commit 340cbb2487
9 changed files with 182 additions and 131 deletions
+46 -46
View File
@@ -5,14 +5,14 @@
* Plugin Name: RangerHQ Radio
* Plugin URI: https://icanhelp.ie/radio
* Description: A small, focused internet radio player for your WordPress admin. 44 hand-curated stations from SomaFM across 10 genres — ambient, electronic, lounge, rock, metal, jazz, world, reggae, holiday, specials. Plays via HTML5 audio; per-user station + volume + history + favourites; pop-out window for continuous background play.
* Version: 0.7.4
* Version: 0.7.5
* Requires at least: 5.3
* Requires PHP: 7.4
* Author: David Keane
* Author URI: https://rangersmyth.xyz/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: a-radio
* Text Domain: rangerhq-radio
*
* @package RangerHQ_Radio
*
@@ -27,12 +27,12 @@
if ( ! defined( 'ABSPATH' ) ) { exit; }
// Plugin coordinates.
if ( ! defined( 'RADIO_VERSION' ) ) { define( 'RADIO_VERSION', '0.7.4' ); }
if ( ! defined( 'RADIO_VERSION' ) ) { define( 'RADIO_VERSION', '0.7.5' ); }
if ( ! defined( 'RADIO_FILE' ) ) { define( 'RADIO_FILE', __FILE__ ); }
if ( ! defined( 'RADIO_PATH' ) ) { define( 'RADIO_PATH', plugin_dir_path( __FILE__ ) ); }
if ( ! defined( 'RADIO_URL' ) ) { define( 'RADIO_URL', plugin_dir_url( __FILE__ ) ); }
if ( ! defined( 'RADIO_BASENAME' ) ) { define( 'RADIO_BASENAME', plugin_basename( __FILE__ ) ); }
if ( ! defined( 'RADIO_GITEA_URL' ) ) { define( 'RADIO_GITEA_URL', 'https://git.davidtkeane.com/ranger/a-radio' ); }
if ( ! defined( 'RADIO_GITEA_URL' ) ) { define( 'RADIO_GITEA_URL', 'https://git.davidtkeane.com/ranger/rangerhq-radio' ); }
if ( ! defined( 'RADIO_SUPPORT_URL' ) ) { define( 'RADIO_SUPPORT_URL', 'https://buymeacoffee.com/davidtkeane' ); }
// Includes — each file owns one concern.
@@ -52,8 +52,8 @@ require_once RADIO_PATH . 'inc/history.php'; // Track history + favouri
add_action( 'admin_menu', 'radio_register_admin_menu' );
function radio_register_admin_menu() {
add_menu_page(
__( 'Radio', 'a-radio' ),
__( 'Radio', 'a-radio' ),
__( 'Radio', 'rangerhq-radio' ),
__( 'Radio', 'rangerhq-radio' ),
'read', // any logged-in user with read access has their own radio
'radio',
'radio_render_main_page',
@@ -67,8 +67,8 @@ function radio_register_admin_menu() {
// form gotcha).
add_submenu_page(
'radio',
__( 'My Radio', 'a-radio' ),
__( 'My Radio', 'a-radio' ),
__( 'My Radio', 'rangerhq-radio' ),
__( 'My Radio', 'rangerhq-radio' ),
'read',
'radio',
''
@@ -76,8 +76,8 @@ function radio_register_admin_menu() {
add_submenu_page(
'radio',
__( 'Settings', 'a-radio' ),
__( 'Settings', 'a-radio' ),
__( 'Settings', 'rangerhq-radio' ),
__( 'Settings', 'rangerhq-radio' ),
'manage_options',
'radio-settings',
'radio_render_settings_page'
@@ -85,8 +85,8 @@ function radio_register_admin_menu() {
add_submenu_page(
'radio',
__( 'Track history', 'a-radio' ),
__( 'History', 'a-radio' ),
__( 'Track history', 'rangerhq-radio' ),
__( 'History', 'rangerhq-radio' ),
'read',
'radio-history',
'radio_render_history_page'
@@ -94,8 +94,8 @@ function radio_register_admin_menu() {
add_submenu_page(
'radio',
__( 'About', 'a-radio' ),
__( 'About', 'a-radio' ),
__( 'About', 'rangerhq-radio' ),
__( 'About', 'rangerhq-radio' ),
'read',
'radio-about',
'radio_render_about_page'
@@ -140,19 +140,19 @@ function radio_enqueue_admin_assets( $hook ) {
'nonce' => wp_create_nonce( 'radio_save_state' ),
'popoutUrl' => admin_url( 'admin-post.php?action=radio_popout' ),
'strings' => array(
'play' => __( 'Play', 'a-radio' ),
'pause' => __( 'Pause', 'a-radio' ),
'loading' => __( 'Loading…', 'a-radio' ),
'error' => __( 'Stream error — try another station.', 'a-radio' ),
'saveError' => __( 'Preferences not saved — check your connection.', 'a-radio' ),
'mute' => __( 'Mute', 'a-radio' ),
'unmute' => __( 'Unmute', 'a-radio' ),
'nowPlaying' => __( 'Now Playing', 'a-radio' ),
'volume' => __( 'Volume', 'a-radio' ),
'station' => __( 'Station', 'a-radio' ),
'addFav' => __( 'Add to favourites', 'a-radio' ),
'removeFav' => __( 'Remove from favourites', 'a-radio' ),
'clearConfirm' => __( 'Clear all track history? (Favourites are kept.)', 'a-radio' ),
'play' => __( 'Play', 'rangerhq-radio' ),
'pause' => __( 'Pause', 'rangerhq-radio' ),
'loading' => __( 'Loading…', 'rangerhq-radio' ),
'error' => __( 'Stream error — try another station.', 'rangerhq-radio' ),
'saveError' => __( 'Preferences not saved — check your connection.', 'rangerhq-radio' ),
'mute' => __( 'Mute', 'rangerhq-radio' ),
'unmute' => __( 'Unmute', 'rangerhq-radio' ),
'nowPlaying' => __( 'Now Playing', 'rangerhq-radio' ),
'volume' => __( 'Volume', 'rangerhq-radio' ),
'station' => __( 'Station', 'rangerhq-radio' ),
'addFav' => __( 'Add to favourites', 'rangerhq-radio' ),
'removeFav' => __( 'Remove from favourites', 'rangerhq-radio' ),
'clearConfirm' => __( 'Clear all track history? (Favourites are kept.)', 'rangerhq-radio' ),
),
) );
}
@@ -241,7 +241,7 @@ function radio_ajax_clear_history() {
add_action( 'admin_post_radio_popout', 'radio_render_popout_page' );
function radio_render_popout_page() {
if ( ! current_user_can( 'read' ) ) {
wp_die( esc_html__( 'You do not have permission to view this page.', 'a-radio' ) );
wp_die( esc_html__( 'You do not have permission to view this page.', 'rangerhq-radio' ) );
}
$state = radio_get_state();
@@ -258,16 +258,16 @@ function radio_render_popout_page() {
'popoutUrl' => '', // already in popout — no further popouts
'autoPlay' => isset( $_GET['play'] ), // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- query flag only, no state change
'strings' => array(
'play' => __( 'Play', 'a-radio' ),
'pause' => __( 'Pause', 'a-radio' ),
'loading' => __( 'Loading…', 'a-radio' ),
'error' => __( 'Stream error — try another station.', 'a-radio' ),
'saveError' => __( 'Preferences not saved — check your connection.', 'a-radio' ),
'mute' => __( 'Mute', 'a-radio' ),
'unmute' => __( 'Unmute', 'a-radio' ),
'nowPlaying' => __( 'Now Playing', 'a-radio' ),
'volume' => __( 'Volume', 'a-radio' ),
'station' => __( 'Station', 'a-radio' ),
'play' => __( 'Play', 'rangerhq-radio' ),
'pause' => __( 'Pause', 'rangerhq-radio' ),
'loading' => __( 'Loading…', 'rangerhq-radio' ),
'error' => __( 'Stream error — try another station.', 'rangerhq-radio' ),
'saveError' => __( 'Preferences not saved — check your connection.', 'rangerhq-radio' ),
'mute' => __( 'Mute', 'rangerhq-radio' ),
'unmute' => __( 'Unmute', 'rangerhq-radio' ),
'nowPlaying' => __( 'Now Playing', 'rangerhq-radio' ),
'volume' => __( 'Volume', 'rangerhq-radio' ),
'station' => __( 'Station', 'rangerhq-radio' ),
),
);
@@ -289,15 +289,15 @@ function radio_render_popout_page() {
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php
/* translators: %s = currently playing station name */
printf( esc_html__( 'Radio — %s', 'a-radio' ), esc_html( $station['name'] ) );
printf( esc_html__( 'Radio — %s', 'rangerhq-radio' ), esc_html( $station['name'] ) );
?></title>
<?php wp_print_styles(); /* dashicons + radio.css; popup-specific overrides scoped under body.radio-popout in radio.css */ ?>
</head>
<body class="radio-popout radio-theme-<?php echo esc_attr( $theme ); ?>">
<div class="radio-popout-header">
<h1><?php esc_html_e( 'Radio', 'a-radio' ); ?></h1>
<button type="button" class="radio-popout-close" onclick="window.close()" title="<?php esc_attr_e( 'Close', 'a-radio' ); ?>">✕</button>
<h1><?php esc_html_e( 'Radio', 'rangerhq-radio' ); ?></h1>
<button type="button" class="radio-popout-close" onclick="window.close()" title="<?php esc_attr_e( 'Close', 'rangerhq-radio' ); ?>">✕</button>
</div>
<div class="radio-popout-wrap">
@@ -308,7 +308,7 @@ function radio_render_popout_page() {
<span class="radio-player__bars"><span></span><span></span><span></span><span></span></span>
<canvas class="radio-player__viz" data-radio-viz hidden></canvas>
</span>
<span class="radio-player__label"><?php esc_html_e( 'Now Playing', 'a-radio' ); ?></span>
<span class="radio-player__label"><?php esc_html_e( 'Now Playing', 'rangerhq-radio' ); ?></span>
<span class="radio-player__station-name" data-radio-name><?php echo esc_html( $station['name'] ); ?></span>
<span class="radio-player__station-genre" data-radio-genre><?php echo esc_html( $station['genre'] ); ?></span>
<p class="radio-player__station-desc" data-radio-desc><?php echo esc_html( $station['description'] ); ?></p>
@@ -318,19 +318,19 @@ function radio_render_popout_page() {
<div class="radio-player__controls">
<button type="button" class="button button-primary radio-player__play" data-radio-play>
<span class="radio-player__play-glyph" data-radio-play-glyph aria-hidden="true">&#9654;</span>
<span data-radio-play-label><?php esc_html_e( 'Play', 'a-radio' ); ?></span>
<span data-radio-play-label><?php esc_html_e( 'Play', 'rangerhq-radio' ); ?></span>
</button>
<div class="radio-player__volume">
<button type="button" class="radio-player__mute" data-radio-mute aria-label="<?php esc_attr_e( 'Mute', 'a-radio' ); ?>">
<button type="button" class="radio-player__mute" data-radio-mute aria-label="<?php esc_attr_e( 'Mute', 'rangerhq-radio' ); ?>">
<span class="dashicons dashicons-controls-volumeon" aria-hidden="true"></span>
</button>
<input type="range" min="0" max="100" value="<?php echo esc_attr( (int) round( $state['volume'] * 100 ) ); ?>" data-radio-volume aria-label="<?php esc_attr_e( 'Volume', 'a-radio' ); ?>">
<input type="range" min="0" max="100" value="<?php echo esc_attr( (int) round( $state['volume'] * 100 ) ); ?>" data-radio-volume aria-label="<?php esc_attr_e( 'Volume', 'rangerhq-radio' ); ?>">
<span class="radio-player__volume-pct" data-radio-volume-pct><?php echo esc_html( (int) round( $state['volume'] * 100 ) ); ?>%</span>
</div>
</div>
<div class="radio-player__station-select">
<label for="radio-station-popout"><?php esc_html_e( 'Station', 'a-radio' ); ?></label>
<label for="radio-station-popout"><?php esc_html_e( 'Station', 'rangerhq-radio' ); ?></label>
<select id="radio-station-popout" data-radio-station>
<?php foreach ( $stations as $genre => $entries ) :
if ( empty( $entries ) ) { continue; }