v0.7.3 — WordPress.org guideline 8 compliance + Privacy section
Adds the Update URI guard pattern so one source tree produces two compliant build artifacts: * Gitea install (default): `Update URI:` header points at git.davidtkeane.com → wp.org skips this plugin → self-hosted updater runs normally. * WordPress.org submission zip (build script strips that line): header is empty → `radio_should_skip_custom_updater()` returns true → entire updater file short-circuits at load time → wp.org takes over update delivery as guideline 8 requires. Settings page now guards the Updates panel render with `function_exists()` because the panel function only exists when the updater was allowed to load. Also adds a dedicated `== Privacy ==` section to readme.txt covering every outbound connection (none from the plugin itself; SomaFM audio + 30s songs.json poll while playing) and adds an explicit link to SomaFM's terms of use (somafm.com/legal/). No user-visible behaviour change in either distribution.
This commit is contained in:
+3
-2
@@ -79,14 +79,15 @@ function radio_render_about_page() {
|
||||
<h2><?php esc_html_e( 'Version history', 'a-radio' ); ?></h2>
|
||||
|
||||
<div class="radio-about-versions__latest">
|
||||
<span class="ver">v0.7.2</span> — 30 May 2026 <span class="latest"><?php esc_html_e( 'latest', 'a-radio' ); ?></span>
|
||||
<span class="ver">v0.7.3</span> — 30 May 2026 <span class="latest"><?php esc_html_e( 'latest', 'a-radio' ); ?></span>
|
||||
<p>
|
||||
<?php esc_html_e( 'Screenshots + correct wp.org contributor handle. Five screenshot-N.png files at plugin root (Dashboard widget / Settings / History / Pop-out window / About) ready for wp.org. Contributors header updated from placeholder to actual wp.org username ir240474. No user-visible changes — distribution / submission-prep only.', 'a-radio' ); ?>
|
||||
<?php esc_html_e( 'WordPress.org guideline 8 compliance + Privacy documentation. Added Update URI header so installs from the author\'s Gitea keep receiving updates from there, while wp.org-distributed copies (where the build strips that header line) hand update delivery to WordPress.org — the self-hosted updater short-circuits at load time and the Updates panel hides automatically. Added a dedicated Privacy section to readme covering every outbound connection (none from the plugin itself; SomaFM audio + 30-second songs.json poll only while playing). Added explicit link to SomaFM terms of use. No user-visible behaviour changes.', 'a-radio' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h3><?php esc_html_e( 'Earlier releases', 'a-radio' ); ?></h3>
|
||||
<ul class="radio-about-versions__earlier">
|
||||
<li><span class="ver">v0.7.2</span> <span class="ver-date">30 May 2026</span> — <?php esc_html_e( 'Screenshots + correct wp.org contributor handle (ir240474)', 'a-radio' ); ?></li>
|
||||
<li><span class="ver">v0.7.1</span> <span class="ver-date">30 May 2026</span> — <?php esc_html_e( 'Plugin Check follow-up — Tested-up-to bumped to 7.0, .DS_Store re-cleanup', 'a-radio' ); ?></li>
|
||||
<li><span class="ver">v0.7.0</span> <span class="ver-date">30 May 2026</span> — <?php esc_html_e( 'WordPress.org submission prep — full Plugin Check clean (169 → 4 issues, branding, textdomain, security, popup refactor, readme.txt)', 'a-radio' ); ?></li>
|
||||
<li><span class="ver">v0.6.3</span> <span class="ver-date">30 May 2026</span> — <?php esc_html_e( 'Discreet buy-me-a-coffee support link (Updates panel + Credits card)', 'a-radio' ); ?></li>
|
||||
|
||||
+6
-2
@@ -123,8 +123,12 @@ function radio_render_settings_page() {
|
||||
</form>
|
||||
|
||||
<?php
|
||||
// Updates panel — only manage_options users see it.
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
// Updates panel — only manage_options users see it, and only when
|
||||
// the custom updater is active (i.e. self-hosted Gitea install,
|
||||
// NOT when distributed via wp.org where wp.org handles updates).
|
||||
// The function is undefined when updater.php short-circuited at
|
||||
// load time per wp.org guideline 8 — hence the function_exists() check.
|
||||
if ( current_user_can( 'manage_options' ) && function_exists( 'radio_render_updates_panel' ) ) {
|
||||
radio_render_updates_panel();
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -14,6 +14,39 @@
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) { exit; }
|
||||
|
||||
/**
|
||||
* v0.7.3 — wp.org guideline 8 guard.
|
||||
*
|
||||
* If the plugin's `Update URI:` header is empty or points to wordpress.org,
|
||||
* the plugin is being distributed via WordPress.org and core handles updates.
|
||||
* In that case the self-hosted updater MUST stay dormant — serving updates
|
||||
* from a non-wp.org server is explicitly prohibited by guideline 8.
|
||||
*
|
||||
* When `Update URI` points at our Gitea (the default for self-hosted /
|
||||
* pre-submission installs), wp.org skips this plugin and our updater runs
|
||||
* normally.
|
||||
*
|
||||
* The submission build script strips the `Update URI:` line from
|
||||
* `radio.php` so this check trips and the entire updater becomes a no-op.
|
||||
*/
|
||||
function radio_should_skip_custom_updater() {
|
||||
static $cached = null;
|
||||
if ( null !== $cached ) { return $cached; }
|
||||
if ( ! defined( 'RADIO_FILE' ) || ! function_exists( 'get_file_data' ) ) {
|
||||
$cached = false;
|
||||
return $cached;
|
||||
}
|
||||
$data = get_file_data( RADIO_FILE, array( 'UpdateURI' => 'Update URI' ) );
|
||||
$uri = isset( $data['UpdateURI'] ) ? trim( $data['UpdateURI'] ) : '';
|
||||
if ( '' === $uri ) { $cached = true; return $cached; } // empty → wp.org default
|
||||
if ( false !== stripos( $uri, 'wordpress.org' ) ) { $cached = true; return $cached; } // explicit wp.org
|
||||
$cached = false; // points at Gitea / other → custom updater runs
|
||||
return $cached;
|
||||
}
|
||||
|
||||
// Short-circuit: stop here entirely if wp.org is handling updates.
|
||||
if ( radio_should_skip_custom_updater() ) { return; }
|
||||
|
||||
if ( ! defined( 'RADIO_GITEA_HOST' ) ) { define( 'RADIO_GITEA_HOST', 'https://git.davidtkeane.com' ); }
|
||||
if ( ! defined( 'RADIO_GITEA_OWNER' ) ) { define( 'RADIO_GITEA_OWNER', 'ranger' ); }
|
||||
if ( ! defined( 'RADIO_GITEA_REPO' ) ) { define( 'RADIO_GITEA_REPO', 'a-radio' ); }
|
||||
|
||||
Reference in New Issue
Block a user