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>
This commit is contained in:
+14
-14
@@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; }
|
||||
|
||||
function radio_render_settings_page() {
|
||||
if ( ! current_user_can( 'read' ) ) {
|
||||
wp_die( esc_html__( 'You do not have permission to view this page.', 'radio' ) );
|
||||
wp_die( esc_html__( 'You do not have permission to view this page.', 'a-radio' ) );
|
||||
}
|
||||
|
||||
// Handle form submission.
|
||||
@@ -39,7 +39,7 @@ function radio_render_settings_page() {
|
||||
$state['hide_dashboard_widget'] = $hide_widget ? 1 : 0;
|
||||
update_user_meta( $user_id, RADIO_META_KEY, $state );
|
||||
|
||||
echo '<div class="notice notice-success is-dismissible"><p>' . esc_html__( 'Settings saved.', 'radio' ) . '</p></div>';
|
||||
echo '<div class="notice notice-success is-dismissible"><p>' . esc_html__( 'Settings saved.', 'a-radio' ) . '</p></div>';
|
||||
}
|
||||
|
||||
$state = radio_get_state();
|
||||
@@ -48,7 +48,7 @@ function radio_render_settings_page() {
|
||||
?>
|
||||
<div class="wrap radio-settings-wrap">
|
||||
<h1>
|
||||
<?php esc_html_e( 'Radio — Settings', 'radio' ); ?>
|
||||
<?php esc_html_e( 'Radio — Settings', 'a-radio' ); ?>
|
||||
<span class="radio-version-badge">v<?php echo esc_html( RADIO_VERSION ); ?></span>
|
||||
</h1>
|
||||
|
||||
@@ -58,7 +58,7 @@ function radio_render_settings_page() {
|
||||
<table class="form-table" role="presentation">
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="default_station"><?php esc_html_e( 'Default station', 'radio' ); ?></label>
|
||||
<label for="default_station"><?php esc_html_e( 'Default station', 'a-radio' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select id="default_station" name="default_station">
|
||||
@@ -75,14 +75,14 @@ function radio_render_settings_page() {
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<p class="description">
|
||||
<?php esc_html_e( 'The station that loads when you open Radio in a fresh tab.', 'radio' ); ?>
|
||||
<?php esc_html_e( 'The station that loads when you open Radio in a fresh tab.', 'a-radio' ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="default_volume"><?php esc_html_e( 'Default volume', 'radio' ); ?></label>
|
||||
<label for="default_volume"><?php esc_html_e( 'Default volume', 'a-radio' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="range" id="default_volume" name="default_volume" min="0" max="100" value="<?php echo esc_attr( (int) round( $state['volume'] * 100 ) ); ?>" aria-describedby="default_volume_label">
|
||||
@@ -92,34 +92,34 @@ function radio_render_settings_page() {
|
||||
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="theme"><?php esc_html_e( 'Theme', 'radio' ); ?></label>
|
||||
<label for="theme"><?php esc_html_e( 'Theme', 'a-radio' ); ?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select id="theme" name="theme">
|
||||
<option value="auto" <?php selected( $state['theme'], 'auto' ); ?>><?php esc_html_e( 'Auto (match WP admin colour scheme)', 'radio' ); ?></option>
|
||||
<option value="light" <?php selected( $state['theme'], 'light' ); ?>><?php esc_html_e( 'Light', 'radio' ); ?></option>
|
||||
<option value="dark" <?php selected( $state['theme'], 'dark' ); ?>><?php esc_html_e( 'Dark', 'radio' ); ?></option>
|
||||
<option value="auto" <?php selected( $state['theme'], 'auto' ); ?>><?php esc_html_e( 'Auto (match WP admin colour scheme)', 'a-radio' ); ?></option>
|
||||
<option value="light" <?php selected( $state['theme'], 'light' ); ?>><?php esc_html_e( 'Light', 'a-radio' ); ?></option>
|
||||
<option value="dark" <?php selected( $state['theme'], 'dark' ); ?>><?php esc_html_e( 'Dark', 'a-radio' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<?php esc_html_e( 'Dashboard widget', 'radio' ); ?>
|
||||
<?php esc_html_e( 'Dashboard widget', 'a-radio' ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" name="hide_dashboard_widget" value="1" <?php checked( $hide_widget ); ?>>
|
||||
<?php esc_html_e( 'Hide the Radio widget from the WordPress Dashboard', 'radio' ); ?>
|
||||
<?php esc_html_e( 'Hide the Radio widget from the WordPress Dashboard', 'a-radio' ); ?>
|
||||
</label>
|
||||
<p class="description">
|
||||
<?php esc_html_e( 'When checked, Radio is only accessible from the dedicated admin page (WP Admin → Radio → My Radio).', 'radio' ); ?>
|
||||
<?php esc_html_e( 'When checked, Radio is only accessible from the dedicated admin page (WP Admin → Radio → My Radio).', 'a-radio' ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php submit_button( __( 'Save Changes', 'radio' ), 'primary', 'radio_settings_submit' ); ?>
|
||||
<?php submit_button( __( 'Save Changes', 'a-radio' ), 'primary', 'radio_settings_submit' ); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user