Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| de93aa50ca | |||
| a9d76decae |
@@ -9,6 +9,67 @@ Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/) — versi
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## [0.7.4] — 2026-05-30 — WordPress.org submission cleanup (updater out, LICENSE in)
|
||||||
|
|
||||||
|
Walks back the Update URI guard pattern from v0.7.3 and replaces it with the simpler, actually-correct answer: just remove the custom updater entirely. The WordPress.org Plugin Check tool (PCP) raised `plugin_updater_detected` on the v0.7.3 build with the message *"Including An Update Checker / Changing Updates functionality. Plugin Updater detected. Use of the Update URI header is not allowed in plugins hosted on WordPress.org."* PCP scans the source as-shipped, not as-distributed, so the build-time `sed` strip we relied on in v0.7.3 never had a chance to run before the scan — and the scanner flagged both the header and the `inc/updater.php` file itself. Two options remained: (a) keep dancing around PCP with branches and build scripts, or (b) accept that WordPress.org is the canonical update channel once a plugin is hosted there and drop the custom system. We went with (b).
|
||||||
|
|
||||||
|
This release also closes the per-file GPL declaration loop by adding a top-level LICENSE file with the full GPL v2 text and explicit GPL header blocks to the CSS and JS assets — every shipped file now declares its license unambiguously.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- **`inc/updater.php`** — the self-hosted Gitea updater. Deleted from the working tree (still recoverable from git history at tag `v0.7.3` if ever needed for a non-wp.org distribution). With the file gone, PCP's `plugin_updater_detected` check is silent.
|
||||||
|
- **`Update URI:` header** in `radio.php`. PCP forbids the header in wp.org-hosted plugins, even when its value would legitimately defer updates to wp.org. (The v0.7.3 NOTE block in the file header documenting the strip-on-package pattern was removed along with it.)
|
||||||
|
- **`require_once RADIO_PATH . 'inc/updater.php';`** line in `radio.php`. The file no longer exists, so no require is needed.
|
||||||
|
- **Updates panel render block + `function_exists()` guard** in `inc/settings.php`. The panel function no longer exists in any build, so the call site is gone. Settings page now ends cleanly at the *Save Changes* button.
|
||||||
|
- **"Self-hosted update checker against the Gitea repo"** bullet in the top-level `README.md`. Replaced with *"Updates via WordPress.org (the canonical channel once published)"*.
|
||||||
|
- **"Self-hosted updater" bullet** in the `readme.txt` Privacy section. Replaced with a positive statement that updates come from WordPress.org through the normal core update process.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- **`LICENSE` file** at the plugin root — verbatim canonical GPL v2 text from `https://www.gnu.org/licenses/gpl-2.0.txt`, 338 lines. The plugin header has always declared GPL v2+ but wp.org reviewers like to see the full text shipped alongside.
|
||||||
|
- **GPL header block in `assets/css/radio.css`** (Copyright, GPL v2+ grant, pointer to LICENSE) so the CSS file's licensing is explicit at the file level, not inferred from the plugin header.
|
||||||
|
- **GPL header block in `assets/js/radio.js`** — same treatment as the CSS. The original `/** Radio — vanilla JS audio controller. */` opening is preserved verbatim as the "module overview" section below the license header.
|
||||||
|
- **GPL header block in `radio.php`'s docblock** — Copyright line + GPL v2+ grant + LICENSE pointer added below the `@package` tag. Sits alongside the existing `License:` / `License URI:` header fields rather than replacing them.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- **`readme.txt` Stable tag** → `0.7.4`.
|
||||||
|
- **`inc/about.php` Version history** — v0.7.4 rotated into the "latest" slot; v0.7.3 demoted to a one-liner in the earlier-releases list with a note explaining the walkback.
|
||||||
|
- **`RADIO_GITEA_URL` constant** is kept in `radio.php`. It's no longer used by an updater, but `inc/about.php` still uses it to render the *"View the full CHANGELOG.md →"* outbound link on the About page. Linking to a self-hosted source repo as a documentation reference is not the same as running a custom updater — that's fine in wp.org-hosted plugins. ([WordPress.org allows links to external source repos](https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/) — the prohibition is on the update *mechanism*, not on referring to where the source lives.)
|
||||||
|
|
||||||
|
### Migration
|
||||||
|
- **Existing wp.org installs** (post-acceptance): WordPress core handles updates automatically. Nothing to do.
|
||||||
|
- **Existing Gitea-installed copies of v0.7.3 or earlier** (e.g. M5): the `inc/updater.php` file on disk will become orphaned after this update lands on them — it's no longer required from `radio.php`, so it just sits there as a dormant file until the next reinstall. **Recommended path for those installs:** once a-radio is accepted onto WordPress.org, uninstall the Gitea-sourced copy and reinstall from WordPress.org. Future updates then flow through wp.org. Until acceptance, those installs simply stop receiving updates (the v0.7.3 updater code is gone in v0.7.4, so there's nothing to advertise newer versions back to them).
|
||||||
|
- **No data loss** in any case: station + volume + theme + history + favourites all live in `user_meta` and survive uninstall/reinstall cycles.
|
||||||
|
|
||||||
|
### Why this is the right answer (and v0.7.3 was clever but wrong)
|
||||||
|
v0.7.3's Update URI guard pattern reasoned correctly about WordPress core's behaviour — the `Update URI` header genuinely does opt a plugin out of wp.org's update channel, and the runtime guard genuinely would short-circuit the updater on stripped builds. But the whole scheme assumed the reviewer would see the *stripped* build. The Plugin Check tool runs against the *source* artifact — the same source that's in the public repository, that future contributors clone, that automated audits scan. From PCP's point of view, the plugin was "shipping" an updater regardless of what the build script did with it later. The simpler answer (just delete the updater for the wp.org branch) sidesteps that entire class of "the static scanner doesn't know about your build pipeline" problem.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [0.7.3] — 2026-05-30 — WordPress.org guideline 8 compliance + Privacy section
|
||||||
|
|
||||||
|
WordPress.org's detailed plugin guidelines require that plugins distributed via the directory **must not** ship their own updater that pulls from a non-wp.org server (guideline 8). RangerHQ Radio's self-hosted Gitea updater predates the wp.org submission and serves real-world installs on the author's own infrastructure, so it cannot simply be removed. The fix is the **Update URI guard pattern**: the plugin ships pointing at Gitea by default, and the build script that produces the wp.org submission zip strips the `Update URI:` header line. At load time the updater inspects that header and short-circuits if it's empty or points at wordpress.org.
|
||||||
|
|
||||||
|
Net effect: one source tree, two build artifacts, both compliant.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- **`Update URI:` header in `radio.php`** pointing at `https://git.davidtkeane.com/ranger/a-radio`. WordPress core uses this header to decide whether wp.org should poll this plugin for updates — a non-wordpress.org URI opts the plugin out of wp.org's update channel, which is exactly what we want for the Gitea-distributed build. A NOTE block in the file header documents the strip-on-package convention so future-me doesn't get confused.
|
||||||
|
- **`radio_should_skip_custom_updater()` helper** at the top of `inc/updater.php`. Reads the live `Update URI:` header via `get_file_data()`, caches the result, and returns `true` when the header is empty (wp.org default) or contains `wordpress.org`. Followed by `if ( radio_should_skip_custom_updater() ) { return; }` — the rest of the updater file (constants, transient filter, AJAX handlers, panel renderer) is never even defined when the guard trips, so there is zero overhead and zero risk of the custom updater running on a wp.org install.
|
||||||
|
- **`function_exists()` guard around `radio_render_updates_panel()` in `inc/settings.php`** — necessary because the panel function only exists when the updater module was allowed to load. With the guard, the Settings page silently omits the panel on wp.org installs and renders it normally on Gitea installs.
|
||||||
|
- **Dedicated `== Privacy ==` section in `readme.txt`** — explicit, bullet-by-bullet inventory of every connection the plugin can make: no telemetry from the plugin itself, no data leaving the site, audio streamed directly from SomaFM, current-track polling against `somafm.com/songs/{station}.json` every 30 seconds **only while playing**, search-provider links outbound only, no third-party JS, and an explicit note that the self-hosted updater is dormant on wp.org installs. Written so a reader who doesn't want any third-party traffic at all knows the answer: don't press Play.
|
||||||
|
- **SomaFM Terms of Use link** (`https://somafm.com/legal/`) prominently in the readme's third-party-service note. Required because RangerHQ Radio is a thin wrapper around a third party's streams — listeners should know whose terms cover the audio they're hearing.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- **`readme.txt` Stable tag** → `0.7.3`.
|
||||||
|
- **`readme.txt` Description third-party block** restructured from a single combined bullet into a separate "Third-party service" callout (with the ToS link) and a pointer to the new Privacy section, so the privacy policy isn't buried in the dependencies paragraph.
|
||||||
|
- **`inc/about.php` Version history** — v0.7.3 rotated into the "latest" slot (full description); v0.7.2 demoted to a one-liner in the earlier-releases list.
|
||||||
|
|
||||||
|
### Why
|
||||||
|
WordPress.org's guidelines page (Aug 2024 revision) is explicit: "Plugins may not contact external services without the explicit informed consent of the user… Plugins may not update themselves from anywhere other than WordPress.org once they're hosted there." The Update URI guard is the documented escape hatch — the same pattern Yoast, Jetpack, and Sucuri use for their commercial editions. The Privacy section is not strictly mandatory, but the GDPR-era reviewer notes have started flagging missing privacy disclosures even for telemetry-free plugins. Easier to ship with one than to play the comments game after submission.
|
||||||
|
|
||||||
|
### Migration
|
||||||
|
None. Existing installs from Gitea continue to receive updates from Gitea exactly as before (because the `Update URI:` line is present, the guard does not trip, the updater runs unchanged). The wp.org submission zip — once built — will have the line stripped and the updater will be dormant. No user-visible behaviour change in either distribution.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## [0.7.2] — 2026-05-30 — Screenshots + correct wp.org contributor handle
|
## [0.7.2] — 2026-05-30 — Screenshots + correct wp.org contributor handle
|
||||||
|
|
||||||
Two small but real submission-prep moves:
|
Two small but real submission-prep moves:
|
||||||
|
|||||||
@@ -0,0 +1,338 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
|
<https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
License is intended to guarantee your freedom to share and change free
|
||||||
|
software--to make sure the software is free for all its users. This
|
||||||
|
General Public License applies to most of the Free Software
|
||||||
|
Foundation's software and to any other program whose authors commit to
|
||||||
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
|
the GNU Lesser General Public License instead.) You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
this service if you wish), that you receive source code or can get it
|
||||||
|
if you want it, that you can change the software or use pieces of it
|
||||||
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
|
These restrictions translate to certain responsibilities for you if you
|
||||||
|
distribute copies of the software, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must give the recipients all the rights that
|
||||||
|
you have. You must make sure that they, too, receive or can get the
|
||||||
|
source code. And you must show them these terms so they know their
|
||||||
|
rights.
|
||||||
|
|
||||||
|
We protect your rights with two steps: (1) copyright the software, and
|
||||||
|
(2) offer you this license which gives you legal permission to copy,
|
||||||
|
distribute and/or modify the software.
|
||||||
|
|
||||||
|
Also, for each author's protection and ours, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
software. If the software is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original, so
|
||||||
|
that any problems introduced by others will not reflect on the original
|
||||||
|
authors' reputations.
|
||||||
|
|
||||||
|
Finally, any free program is threatened constantly by software
|
||||||
|
patents. We wish to avoid the danger that redistributors of a free
|
||||||
|
program will individually obtain patent licenses, in effect making the
|
||||||
|
program proprietary. To prevent this, we have made it clear that any
|
||||||
|
patent must be licensed for everyone's free use or not licensed at all.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License applies to any program or other work which contains
|
||||||
|
a notice placed by the copyright holder saying it may be distributed
|
||||||
|
under the terms of this General Public License. The "Program", below,
|
||||||
|
refers to any such program or work, and a "work based on the Program"
|
||||||
|
means either the Program or any derivative work under copyright law:
|
||||||
|
that is to say, a work containing the Program or a portion of it,
|
||||||
|
either verbatim or with modifications and/or translated into another
|
||||||
|
language. (Hereinafter, translation is included without limitation in
|
||||||
|
the term "modification".) Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running the Program is not restricted, and the output from the Program
|
||||||
|
is covered only if its contents constitute a work based on the
|
||||||
|
Program (independent of having been made by running the Program).
|
||||||
|
Whether that is true depends on what the Program does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Program's
|
||||||
|
source code as you receive it, in any medium, provided that you
|
||||||
|
conspicuously and appropriately publish on each copy an appropriate
|
||||||
|
copyright notice and disclaimer of warranty; keep intact all the
|
||||||
|
notices that refer to this License and to the absence of any warranty;
|
||||||
|
and give any other recipients of the Program a copy of this License
|
||||||
|
along with the Program.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy, and
|
||||||
|
you may at your option offer warranty protection in exchange for a fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Program or any portion
|
||||||
|
of it, thus forming a work based on the Program, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) You must cause the modified files to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
b) You must cause any work that you distribute or publish, that in
|
||||||
|
whole or in part contains or is derived from the Program or any
|
||||||
|
part thereof, to be licensed as a whole at no charge to all third
|
||||||
|
parties under the terms of this License.
|
||||||
|
|
||||||
|
c) If the modified program normally reads commands interactively
|
||||||
|
when run, you must cause it, when started running for such
|
||||||
|
interactive use in the most ordinary way, to print or display an
|
||||||
|
announcement including an appropriate copyright notice and a
|
||||||
|
notice that there is no warranty (or else, saying that you provide
|
||||||
|
a warranty) and that users may redistribute the program under
|
||||||
|
these conditions, and telling the user how to view a copy of this
|
||||||
|
License. (Exception: if the Program itself is interactive but
|
||||||
|
does not normally print such an announcement, your work based on
|
||||||
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Program,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Program, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Program.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Program
|
||||||
|
with the Program (or with a work based on the Program) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may copy and distribute the Program (or a work based on it,
|
||||||
|
under Section 2) in object code or executable form under the terms of
|
||||||
|
Sections 1 and 2 above provided that you also do one of the following:
|
||||||
|
|
||||||
|
a) Accompany it with the complete corresponding machine-readable
|
||||||
|
source code, which must be distributed under the terms of Sections
|
||||||
|
1 and 2 above on a medium customarily used for software interchange; or,
|
||||||
|
|
||||||
|
b) Accompany it with a written offer, valid for at least three
|
||||||
|
years, to give any third party, for a charge no more than your
|
||||||
|
cost of physically performing source distribution, a complete
|
||||||
|
machine-readable copy of the corresponding source code, to be
|
||||||
|
distributed under the terms of Sections 1 and 2 above on a medium
|
||||||
|
customarily used for software interchange; or,
|
||||||
|
|
||||||
|
c) Accompany it with the information you received as to the offer
|
||||||
|
to distribute corresponding source code. (This alternative is
|
||||||
|
allowed only for noncommercial distribution and only if you
|
||||||
|
received the program in object code or executable form with such
|
||||||
|
an offer, in accord with Subsection b above.)
|
||||||
|
|
||||||
|
The source code for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For an executable work, complete source
|
||||||
|
code means all the source code for all modules it contains, plus any
|
||||||
|
associated interface definition files, plus the scripts used to
|
||||||
|
control compilation and installation of the executable. However, as a
|
||||||
|
special exception, the source code distributed need not include
|
||||||
|
anything that is normally distributed (in either source or binary
|
||||||
|
form) with the major components (compiler, kernel, and so on) of the
|
||||||
|
operating system on which the executable runs, unless that component
|
||||||
|
itself accompanies the executable.
|
||||||
|
|
||||||
|
If distribution of executable or object code is made by offering
|
||||||
|
access to copy from a designated place, then offering equivalent
|
||||||
|
access to copy the source code from the same place counts as
|
||||||
|
distribution of the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
|
except as expressly provided under this License. Any attempt
|
||||||
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
|
void, and will automatically terminate your rights under this License.
|
||||||
|
However, parties who have received copies, or rights, from you under
|
||||||
|
this License will not have their licenses terminated so long as such
|
||||||
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
5. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Program or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Program (or any work based on the
|
||||||
|
Program), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Program or works based on it.
|
||||||
|
|
||||||
|
6. Each time you redistribute the Program (or any work based on the
|
||||||
|
Program), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute or modify the Program subject to
|
||||||
|
these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties to
|
||||||
|
this License.
|
||||||
|
|
||||||
|
7. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Program at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Program by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Program.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under
|
||||||
|
any particular circumstance, the balance of the section is intended to
|
||||||
|
apply and the section as a whole is intended to apply in other
|
||||||
|
circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system, which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Program under this License
|
||||||
|
may add an explicit geographical distribution limitation excluding
|
||||||
|
those countries, so that distribution is permitted only in or among
|
||||||
|
countries not thus excluded. In such case, this License incorporates
|
||||||
|
the limitation as if written in the body of this License.
|
||||||
|
|
||||||
|
9. The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies a version number of this License which applies to it and "any
|
||||||
|
later version", you have the option of following the terms and conditions
|
||||||
|
either of that version or of any later version published by the Free
|
||||||
|
Software Foundation. If the Program does not specify a version number of
|
||||||
|
this License, you may choose any version ever published by the Free Software
|
||||||
|
Foundation.
|
||||||
|
|
||||||
|
10. If you wish to incorporate parts of the Program into other free
|
||||||
|
programs whose distribution conditions are different, write to the author
|
||||||
|
to ask for permission. For software which is copyrighted by the Free
|
||||||
|
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||||
|
make exceptions for this. Our decision will be guided by the two goals
|
||||||
|
of preserving the free status of all derivatives of our free software and
|
||||||
|
of promoting the sharing and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
|
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||||
|
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||||
|
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||||
|
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||||
|
REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||||
|
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||||
|
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||||
|
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||||
|
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program is interactive, make it output a short notice like this
|
||||||
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, the commands you use may
|
||||||
|
be called something other than `show w' and `show c'; they could even be
|
||||||
|
mouse-clicks or menu items--whatever suits your program.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
|
<signature of Moe Ghoul>, 1 April 1989
|
||||||
|
Moe Ghoul, President of Vice
|
||||||
|
|
||||||
|
This General Public License does not permit incorporating your program into
|
||||||
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
|
consider it more useful to permit linking proprietary applications with the
|
||||||
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License.
|
||||||
@@ -8,7 +8,7 @@ A small, focused, free WordPress plugin that drops a SomaFM radio player into yo
|
|||||||
- Dedicated page at **WP Admin → Radio → My Radio**
|
- Dedicated page at **WP Admin → Radio → My Radio**
|
||||||
- Plays via HTML5 `<audio>` — no proxy server, no third-party tracking
|
- Plays via HTML5 `<audio>` — no proxy server, no third-party tracking
|
||||||
- Per-user state: each admin remembers their own station + volume
|
- Per-user state: each admin remembers their own station + volume
|
||||||
- Self-hosted update checker against the Gitea repo
|
- Updates via WordPress.org (the canonical channel once published)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -1,4 +1,14 @@
|
|||||||
/* Radio — admin styles, WordPress-native */
|
/*!
|
||||||
|
* RangerHQ Radio — admin styles, WordPress-native.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2026 David Keane
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version. See LICENSE in the plugin root
|
||||||
|
* for the full text, or visit https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
/* ──────────────────────────────────────────────────────────────────
|
/* ──────────────────────────────────────────────────────────────────
|
||||||
* Player layout (works inside .postbox .inside on main page,
|
* Player layout (works inside .postbox .inside on main page,
|
||||||
|
|||||||
+12
-2
@@ -1,5 +1,15 @@
|
|||||||
/**
|
/*!
|
||||||
* Radio — vanilla JS audio controller.
|
* RangerHQ Radio — vanilla JS audio controller.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2026 David Keane
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version. See LICENSE in the plugin root
|
||||||
|
* for the full text, or visit https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*
|
||||||
|
* --- module overview ---
|
||||||
*
|
*
|
||||||
* Binds to every `.radio-player` element on the page (dashboard widget
|
* Binds to every `.radio-player` element on the page (dashboard widget
|
||||||
* + main page can co-exist; both share one logical audio session per
|
* + main page can co-exist; both share one logical audio session per
|
||||||
|
|||||||
+4
-2
@@ -79,14 +79,16 @@ function radio_render_about_page() {
|
|||||||
<h2><?php esc_html_e( 'Version history', 'a-radio' ); ?></h2>
|
<h2><?php esc_html_e( 'Version history', 'a-radio' ); ?></h2>
|
||||||
|
|
||||||
<div class="radio-about-versions__latest">
|
<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.4</span> — 30 May 2026 <span class="latest"><?php esc_html_e( 'latest', 'a-radio' ); ?></span>
|
||||||
<p>
|
<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 submission cleanup. Removed the self-hosted Gitea updater (`inc/updater.php`) and the `Update URI` header from `radio.php` — WordPress.org explicitly disallows both for hosted plugins (Plugin Check `plugin_updater_detected`). Updates now flow through WordPress.org as the canonical channel. Added a top-level LICENSE file with the full GPL v2 text and GPL header blocks to the CSS and JS assets so the licensing of every shipped file is explicit. No user-visible behaviour changes for the player — only the small `Updates` panel that used to sit at the bottom of Radio → Settings is gone.', 'a-radio' ); ?>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3><?php esc_html_e( 'Earlier releases', 'a-radio' ); ?></h3>
|
<h3><?php esc_html_e( 'Earlier releases', 'a-radio' ); ?></h3>
|
||||||
<ul class="radio-about-versions__earlier">
|
<ul class="radio-about-versions__earlier">
|
||||||
|
<li><span class="ver">v0.7.3</span> <span class="ver-date">30 May 2026</span> — <?php esc_html_e( 'Privacy section in readme + SomaFM terms-of-use link (Update URI guard pattern from this release was walked back in v0.7.4 — Plugin Check disallows it for wp.org-hosted plugins regardless of header value)', 'a-radio' ); ?></li>
|
||||||
|
<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.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.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>
|
<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>
|
||||||
|
|||||||
+1
-9
@@ -3,8 +3,7 @@
|
|||||||
* Radio — Settings page.
|
* Radio — Settings page.
|
||||||
*
|
*
|
||||||
* Lets the user pick default station + volume + theme + dashboard
|
* Lets the user pick default station + volume + theme + dashboard
|
||||||
* widget opt-out. Renders the Updates panel from `updater.php` at the
|
* widget opt-out.
|
||||||
* bottom.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) { exit; }
|
if ( ! defined( 'ABSPATH' ) ) { exit; }
|
||||||
@@ -121,13 +120,6 @@ function radio_render_settings_page() {
|
|||||||
|
|
||||||
<?php submit_button( __( 'Save Changes', 'a-radio' ), 'primary', 'radio_settings_submit' ); ?>
|
<?php submit_button( __( 'Save Changes', 'a-radio' ), 'primary', 'radio_settings_submit' ); ?>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php
|
|
||||||
// Updates panel — only manage_options users see it.
|
|
||||||
if ( current_user_can( 'manage_options' ) ) {
|
|
||||||
radio_render_updates_panel();
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
-248
@@ -1,248 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Radio — self-hosted update checker against the Gitea repo.
|
|
||||||
*
|
|
||||||
* Direct port of the Buddy / Logbook updater (proven in production).
|
|
||||||
* Polls Gitea's /releases/latest, falls back to /tags?limit=1 when no
|
|
||||||
* formal Release object exists, compares against RADIO_VERSION,
|
|
||||||
* renders an Updates panel on the Settings page. Cached 12h on
|
|
||||||
* success, 1h on negative responses.
|
|
||||||
*
|
|
||||||
* Repo coordinates are constants you can override via define() in
|
|
||||||
* wp-config.php if the repo ever moves.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) { exit; }
|
|
||||||
|
|
||||||
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' ); }
|
|
||||||
|
|
||||||
function radio_gitea_repo_url() {
|
|
||||||
return RADIO_GITEA_HOST . '/' . RADIO_GITEA_OWNER . '/' . RADIO_GITEA_REPO;
|
|
||||||
}
|
|
||||||
function radio_gitea_releases_url() {
|
|
||||||
return radio_gitea_repo_url() . '/releases';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch the latest release/tag, normalised. Returns null on hard
|
|
||||||
* error, or an array including `version`.
|
|
||||||
*/
|
|
||||||
function radio_fetch_latest_release( $force_refresh = false ) {
|
|
||||||
$cache_key = 'radio_gitea_latest';
|
|
||||||
|
|
||||||
if ( ! $force_refresh ) {
|
|
||||||
$cached = get_site_transient( $cache_key );
|
|
||||||
if ( is_array( $cached ) ) { return $cached; }
|
|
||||||
}
|
|
||||||
|
|
||||||
$base_api = RADIO_GITEA_HOST . '/api/v1/repos/' . RADIO_GITEA_OWNER . '/' . RADIO_GITEA_REPO;
|
|
||||||
|
|
||||||
// Try formal Release first.
|
|
||||||
$response = wp_remote_get( $base_api . '/releases/latest', array( 'timeout' => 8 ) );
|
|
||||||
if ( is_wp_error( $response ) ) { return null; }
|
|
||||||
|
|
||||||
$code = (int) wp_remote_retrieve_response_code( $response );
|
|
||||||
$body = ( $code === 200 ) ? json_decode( wp_remote_retrieve_body( $response ), true ) : null;
|
|
||||||
|
|
||||||
// Fallback to /tags if no Release object exists yet.
|
|
||||||
if ( $code !== 200 || ! is_array( $body ) || empty( $body['tag_name'] ) ) {
|
|
||||||
$tags_response = wp_remote_get( $base_api . '/tags?limit=1', array( 'timeout' => 8 ) );
|
|
||||||
if ( ! is_wp_error( $tags_response )
|
|
||||||
&& (int) wp_remote_retrieve_response_code( $tags_response ) === 200 ) {
|
|
||||||
$tags = json_decode( wp_remote_retrieve_body( $tags_response ), true );
|
|
||||||
if ( is_array( $tags ) && ! empty( $tags[0]['name'] ) ) {
|
|
||||||
$body = array(
|
|
||||||
'tag_name' => $tags[0]['name'],
|
|
||||||
'html_url' => radio_gitea_repo_url() . '/src/tag/' . rawurlencode( $tags[0]['name'] ),
|
|
||||||
'body' => isset( $tags[0]['message'] ) ? $tags[0]['message'] : '',
|
|
||||||
'published_at' => isset( $tags[0]['commit']['created'] ) ? $tags[0]['commit']['created'] : null,
|
|
||||||
'assets' => array(),
|
|
||||||
);
|
|
||||||
$code = 200;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $code !== 200 || ! is_array( $body ) || empty( $body['tag_name'] ) ) {
|
|
||||||
$info = array(
|
|
||||||
'version' => null,
|
|
||||||
'html_url' => radio_gitea_releases_url(),
|
|
||||||
'download_url' => null,
|
|
||||||
'body' => '',
|
|
||||||
'published_at' => null,
|
|
||||||
'error_code' => $code,
|
|
||||||
);
|
|
||||||
set_site_transient( $cache_key, $info, HOUR_IN_SECONDS );
|
|
||||||
return $info;
|
|
||||||
}
|
|
||||||
|
|
||||||
$version = ltrim( (string) $body['tag_name'], 'vV' );
|
|
||||||
|
|
||||||
// Prefer a .zip asset; fall back to Gitea source-archive URL.
|
|
||||||
$download_url = null;
|
|
||||||
if ( ! empty( $body['assets'] ) && is_array( $body['assets'] ) ) {
|
|
||||||
foreach ( $body['assets'] as $asset ) {
|
|
||||||
if ( isset( $asset['name'], $asset['browser_download_url'] )
|
|
||||||
&& substr( strtolower( $asset['name'] ), -4 ) === '.zip' ) {
|
|
||||||
$download_url = $asset['browser_download_url'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( ! $download_url ) {
|
|
||||||
$download_url = radio_gitea_repo_url() . '/archive/' . rawurlencode( $body['tag_name'] ) . '.zip';
|
|
||||||
}
|
|
||||||
|
|
||||||
$info = array(
|
|
||||||
'version' => $version,
|
|
||||||
'html_url' => isset( $body['html_url'] ) ? esc_url_raw( $body['html_url'] ) : '',
|
|
||||||
'download_url' => esc_url_raw( $download_url ),
|
|
||||||
'body' => isset( $body['body'] ) ? wp_strip_all_tags( $body['body'] ) : '',
|
|
||||||
'published_at' => isset( $body['published_at'] ) ? $body['published_at'] : null,
|
|
||||||
);
|
|
||||||
|
|
||||||
set_site_transient( $cache_key, $info, 12 * HOUR_IN_SECONDS );
|
|
||||||
return $info;
|
|
||||||
}
|
|
||||||
|
|
||||||
function radio_update_status( $force_refresh = false ) {
|
|
||||||
$current = defined( 'RADIO_VERSION' ) ? RADIO_VERSION : '0.0.0';
|
|
||||||
$latest = radio_fetch_latest_release( $force_refresh );
|
|
||||||
|
|
||||||
if ( ! $latest || empty( $latest['version'] ) ) {
|
|
||||||
$msg = __( 'No releases tagged on the Gitea repo yet.', 'a-radio' );
|
|
||||||
if ( $latest && ! empty( $latest['error_code'] ) && (int) $latest['error_code'] !== 404 ) {
|
|
||||||
/* translators: %d = HTTP status code returned by the Gitea API */
|
|
||||||
$msg = sprintf( __( 'Could not reach Gitea (HTTP %d). Try again in a few minutes.', 'a-radio' ), (int) $latest['error_code'] );
|
|
||||||
}
|
|
||||||
return array(
|
|
||||||
'status' => 'unknown',
|
|
||||||
'current' => $current,
|
|
||||||
'message' => $msg,
|
|
||||||
'repo_url' => radio_gitea_repo_url(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( version_compare( $latest['version'], $current, '>' ) ) {
|
|
||||||
return array(
|
|
||||||
'status' => 'available',
|
|
||||||
'current' => $current,
|
|
||||||
'latest' => $latest['version'],
|
|
||||||
'html_url' => $latest['html_url'],
|
|
||||||
'download_url' => $latest['download_url'],
|
|
||||||
'published_at' => $latest['published_at'],
|
|
||||||
'body' => $latest['body'],
|
|
||||||
/* translators: 1: latest version available; 2: version currently installed */
|
|
||||||
'message' => sprintf( __( 'A new version (v%1$s) is available — you are on v%2$s.', 'a-radio' ), $latest['version'], $current ),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return array(
|
|
||||||
'status' => 'up-to-date',
|
|
||||||
'current' => $current,
|
|
||||||
'latest' => $latest['version'],
|
|
||||||
/* translators: %s = current installed version */
|
|
||||||
'message' => sprintf( __( 'You are up to date (v%s).', 'a-radio' ), $current ),
|
|
||||||
'repo_url' => radio_gitea_repo_url(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
add_action( 'wp_ajax_radio_check_updates', 'radio_ajax_check_updates' );
|
|
||||||
function radio_ajax_check_updates() {
|
|
||||||
if ( ! current_user_can( 'manage_options' ) ) {
|
|
||||||
wp_send_json_error( 'Insufficient permissions.', 403 );
|
|
||||||
}
|
|
||||||
check_ajax_referer( 'radio_check_updates', 'nonce' );
|
|
||||||
delete_site_transient( 'radio_gitea_latest' );
|
|
||||||
wp_send_json_success( radio_update_status( true ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
function radio_render_updates_panel() {
|
|
||||||
$status = radio_update_status( false );
|
|
||||||
$nonce = wp_create_nonce( 'radio_check_updates' );
|
|
||||||
$repo_url = radio_gitea_repo_url();
|
|
||||||
$rel_url = radio_gitea_releases_url();
|
|
||||||
?>
|
|
||||||
<div class="radio-updates" style="max-width:720px; margin-top:24px; padding:18px 20px; background:#fff; border:1px solid #ccd0d4; border-radius:4px;">
|
|
||||||
<h2 style="margin-top:0;"><?php esc_html_e( 'Updates', 'a-radio' ); ?></h2>
|
|
||||||
<p style="margin:0 0 12px;">
|
|
||||||
<?php esc_html_e( 'Radio is self-hosted on Gitea. Click Check now to ask the repo whether there is a newer release than the one you are running.', 'a-radio' ); ?>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p id="radio-update-status" style="margin:0 0 12px;">
|
|
||||||
<strong><?php esc_html_e( 'Status:', 'a-radio' ); ?></strong>
|
|
||||||
<span id="radio-update-status-text"><?php echo esc_html( $status['message'] ); ?></span>
|
|
||||||
<?php if ( $status['status'] === 'available' && ! empty( $status['download_url'] ) ) : ?>
|
|
||||||
<br>
|
|
||||||
<a href="<?php echo esc_url( $status['download_url'] ); ?>" class="button button-primary" style="margin-top:8px;">
|
|
||||||
<?php
|
|
||||||
/* translators: %s is the latest version number, e.g. "0.2.0" */
|
|
||||||
/* translators: %s = latest available version number, e.g. "0.7.0" */
|
|
||||||
echo esc_html( sprintf( __( 'Download v%s (.zip)', 'a-radio' ), $status['latest'] ) );
|
|
||||||
?>
|
|
||||||
</a>
|
|
||||||
<?php if ( ! empty( $status['html_url'] ) ) : ?>
|
|
||||||
<a href="<?php echo esc_url( $status['html_url'] ); ?>" target="_blank" rel="noopener" style="margin-left:8px;"><?php esc_html_e( 'View release notes →', 'a-radio' ); ?></a>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p style="margin:0 0 4px;">
|
|
||||||
<button type="button" id="radio-check-updates-btn" class="button" data-nonce="<?php echo esc_attr( $nonce ); ?>">
|
|
||||||
↻ <?php esc_html_e( 'Check now', 'a-radio' ); ?>
|
|
||||||
</button>
|
|
||||||
<a href="<?php echo esc_url( $repo_url ); ?>" target="_blank" rel="noopener" class="button" style="margin-left:6px;"><?php esc_html_e( 'View on Gitea', 'a-radio' ); ?></a>
|
|
||||||
<a href="<?php echo esc_url( $rel_url ); ?>" target="_blank" rel="noopener" class="button" style="margin-left:6px;"><?php esc_html_e( 'View all releases', 'a-radio' ); ?></a>
|
|
||||||
</p>
|
|
||||||
<p style="margin:10px 0 0; color:#646970; font-size:12px;">
|
|
||||||
<?php esc_html_e( 'Manual update path: download the .zip, deactivate the plugin in WordPress, upload via Plugins → Add New → Upload, reactivate. Your settings survive the upgrade (state is stored in user_meta).', 'a-radio' ); ?>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<?php if ( defined( 'RADIO_SUPPORT_URL' ) && RADIO_SUPPORT_URL ) : ?>
|
|
||||||
<a class="radio-support-link" href="<?php echo esc_url( RADIO_SUPPORT_URL ); ?>" target="_blank" rel="noopener">
|
|
||||||
<?php esc_html_e( 'Like Radio? If You fancy to buy me a coffee →', 'a-radio' ); ?>
|
|
||||||
</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
(function () {
|
|
||||||
var btn = document.getElementById('radio-check-updates-btn');
|
|
||||||
var statusText = document.getElementById('radio-update-status-text');
|
|
||||||
if (!btn || !statusText) { return; }
|
|
||||||
|
|
||||||
btn.addEventListener('click', function () {
|
|
||||||
var nonce = btn.getAttribute('data-nonce');
|
|
||||||
btn.disabled = true;
|
|
||||||
var orig = btn.textContent;
|
|
||||||
btn.textContent = '↻ Checking…';
|
|
||||||
statusText.textContent = 'Asking Gitea…';
|
|
||||||
|
|
||||||
var fd = new FormData();
|
|
||||||
fd.append('action', 'radio_check_updates');
|
|
||||||
fd.append('nonce', nonce);
|
|
||||||
|
|
||||||
fetch(ajaxurl, { method: 'POST', credentials: 'same-origin', body: fd })
|
|
||||||
.then(function (r) { return r.json(); })
|
|
||||||
.then(function (res) {
|
|
||||||
if (!res || !res.success) {
|
|
||||||
statusText.textContent = (res && res.data) ? String(res.data) : 'Check failed.';
|
|
||||||
} else {
|
|
||||||
statusText.textContent = res.data.message || 'Check complete.';
|
|
||||||
if (res.data.status === 'available' && res.data.download_url) {
|
|
||||||
setTimeout(function () { window.location.reload(); }, 400);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(function () { statusText.textContent = 'Network error — try again in a moment.'; })
|
|
||||||
.finally(function () {
|
|
||||||
btn.disabled = false;
|
|
||||||
btn.textContent = orig;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
* Plugin Name: RangerHQ Radio
|
* Plugin Name: RangerHQ Radio
|
||||||
* Plugin URI: https://icanhelp.ie/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.
|
* 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.2
|
* Version: 0.7.4
|
||||||
* Requires at least: 5.3
|
* Requires at least: 5.3
|
||||||
* Requires PHP: 7.4
|
* Requires PHP: 7.4
|
||||||
* Author: David Keane
|
* Author: David Keane
|
||||||
@@ -15,12 +15,19 @@
|
|||||||
* Text Domain: a-radio
|
* Text Domain: a-radio
|
||||||
*
|
*
|
||||||
* @package RangerHQ_Radio
|
* @package RangerHQ_Radio
|
||||||
|
*
|
||||||
|
* Copyright (C) 2026 David Keane
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version. See LICENSE for the full text.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) { exit; }
|
if ( ! defined( 'ABSPATH' ) ) { exit; }
|
||||||
|
|
||||||
// Plugin coordinates.
|
// Plugin coordinates.
|
||||||
if ( ! defined( 'RADIO_VERSION' ) ) { define( 'RADIO_VERSION', '0.7.2' ); }
|
if ( ! defined( 'RADIO_VERSION' ) ) { define( 'RADIO_VERSION', '0.7.4' ); }
|
||||||
if ( ! defined( 'RADIO_FILE' ) ) { define( 'RADIO_FILE', __FILE__ ); }
|
if ( ! defined( 'RADIO_FILE' ) ) { define( 'RADIO_FILE', __FILE__ ); }
|
||||||
if ( ! defined( 'RADIO_PATH' ) ) { define( 'RADIO_PATH', plugin_dir_path( __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_URL' ) ) { define( 'RADIO_URL', plugin_dir_url( __FILE__ ) ); }
|
||||||
@@ -36,7 +43,6 @@ require_once RADIO_PATH . 'inc/admin-page.php'; // dedicated Radio admin p
|
|||||||
require_once RADIO_PATH . 'inc/about.php'; // About page
|
require_once RADIO_PATH . 'inc/about.php'; // About page
|
||||||
require_once RADIO_PATH . 'inc/settings.php'; // Settings page
|
require_once RADIO_PATH . 'inc/settings.php'; // Settings page
|
||||||
require_once RADIO_PATH . 'inc/history.php'; // Track history + favourites (v0.5.0)
|
require_once RADIO_PATH . 'inc/history.php'; // Track history + favourites (v0.5.0)
|
||||||
require_once RADIO_PATH . 'inc/updater.php'; // self-hosted update checker against Gitea
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin menu registration. Radio gets its own top-level menu — having
|
* Admin menu registration. Radio gets its own top-level menu — having
|
||||||
|
|||||||
+31
-5
@@ -4,7 +4,7 @@ Donate link: https://buymeacoffee.com/davidtkeane
|
|||||||
Tags: radio, music, audio, internet radio, background music
|
Tags: radio, music, audio, internet radio, background music
|
||||||
Requires at least: 5.3
|
Requires at least: 5.3
|
||||||
Tested up to: 7.0
|
Tested up to: 7.0
|
||||||
Stable tag: 0.7.2
|
Stable tag: 0.7.4
|
||||||
Requires PHP: 7.4
|
Requires PHP: 7.4
|
||||||
License: GPLv2 or later
|
License: GPLv2 or later
|
||||||
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
@@ -26,11 +26,25 @@ A small, focused internet radio player for your WordPress admin — 44 hand-cura
|
|||||||
* **Dark theme** — explicit dark option for the player surface (`Settings → Theme`).
|
* **Dark theme** — explicit dark option for the player surface (`Settings → Theme`).
|
||||||
* **Per-user state** — your chosen station, volume, theme, history, and favourites all live in `user_meta`, so each WordPress user has their own setup.
|
* **Per-user state** — your chosen station, volume, theme, history, and favourites all live in `user_meta`, so each WordPress user has their own setup.
|
||||||
|
|
||||||
= Privacy + dependencies =
|
= Third-party service =
|
||||||
|
|
||||||
* **No tracking, no telemetry, no third-party scripts on your admin pages.** Audio plays directly in your browser via HTML5 — just an `<audio>` element pointed at SomaFM's public streams.
|
This plugin streams audio from **[SomaFM](https://somafm.com)** — an independent, listener-supported, commercial-free internet radio network broadcasting from San Francisco since 2000. RangerHQ Radio is a small WordPress wrapper around their public streams; the service itself provides all the music. SomaFM's terms of use are at [somafm.com/legal/](https://somafm.com/legal/). If you enjoy the music, please consider [supporting SomaFM directly](https://somafm.com/support/).
|
||||||
* **No data leaves your site.** History and favourites are stored in your own `wp_usermeta`. The four search links use deep-link search URLs on each provider's public site — no API keys, no third-party JS embedded.
|
|
||||||
* **Stations courtesy of [SomaFM](https://somafm.com)** — an independent, listener-supported, commercial-free internet radio network broadcasting from San Francisco since 2000. RangerHQ Radio is a small wrapper around their public streams. If you enjoy the music, please consider [supporting SomaFM directly](https://somafm.com/support/).
|
See the dedicated Privacy section below for everything that does and does not leave your site.
|
||||||
|
|
||||||
|
== Privacy ==
|
||||||
|
|
||||||
|
RangerHQ Radio is privacy-respecting by design:
|
||||||
|
|
||||||
|
* **No telemetry from the plugin.** RangerHQ Radio does not phone home, report usage statistics, or contact the plugin author's servers in any way.
|
||||||
|
* **No data leaves your site.** All per-user state — station choice, volume, theme, listening history, favourites — is stored in your own WordPress database (`wp_usermeta`) and never transmitted anywhere.
|
||||||
|
* **Audio streams come from SomaFM directly.** When you press Play, your browser opens an HTTP stream to `https://somafm.com` — the plugin does not proxy, log, or analyse this connection. SomaFM's own privacy practices apply to the stream; see [SomaFM legal](https://somafm.com/legal/).
|
||||||
|
* **Current-track display** polls SomaFM's public songs endpoint (`https://somafm.com/songs/{station}.json`) every 30 seconds **while audio is playing**. The plugin sends no identifying information with this request. Polling stops the moment you pause.
|
||||||
|
* **Search-provider links** (Spotify / YouTube / Apple Music / Bandcamp) are outbound only. Clicking one opens a new tab with a search URL on that service — the plugin sends no data and stores no information about which links you click.
|
||||||
|
* **No third-party JavaScript** is loaded from outside your own server. All scripts ship inside the plugin.
|
||||||
|
* **Updates** come from WordPress.org through the normal WordPress core update process. The plugin does not contact any other update server.
|
||||||
|
|
||||||
|
If you do not want any third-party traffic at all, simply do not press Play.
|
||||||
|
|
||||||
== Installation ==
|
== Installation ==
|
||||||
|
|
||||||
@@ -72,6 +86,12 @@ SomaFM's track-info endpoint (`somafm.com/songs/{station}.json`) is fetched best
|
|||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
|
= 0.7.4 =
|
||||||
|
* WordPress.org submission cleanup. Removed the self-hosted Gitea updater (`inc/updater.php`) and the `Update URI` header from `radio.php`. WordPress.org explicitly disallows both for hosted plugins (Plugin Check `plugin_updater_detected`), so updates now flow through WordPress.org as the canonical channel. Added a top-level `LICENSE` file with the full GPL v2 text and explicit GPL header blocks to `assets/css/radio.css` and `assets/js/radio.js` so the licensing of every shipped file is unambiguous. The small `Updates` panel that used to sit at the bottom of Radio → Settings is gone; player behaviour is unchanged.
|
||||||
|
|
||||||
|
= 0.7.3 =
|
||||||
|
* WordPress.org guideline 8 compliance + Privacy documentation. Added `Update URI: https://git.davidtkeane.com/ranger/a-radio` header so installs from the author's Gitea continue to receive updates from there, while wp.org-distributed copies (where the build script strips this 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 the readme covering every outbound connection (none from the plugin itself; SomaFM audio + 30-second songs.json poll while playing). Added explicit link to SomaFM's terms of use at https://somafm.com/legal/. No user-visible behaviour changes.
|
||||||
|
|
||||||
= 0.7.2 =
|
= 0.7.2 =
|
||||||
* Screenshots + correct wp.org contributor handle. Five `screenshot-N.png` files added at plugin root (Dashboard widget, Settings page, History page, Pop-out window, About page). `Contributors` header updated from placeholder to actual wp.org username `ir240474`.
|
* Screenshots + correct wp.org contributor handle. Five `screenshot-N.png` files added at plugin root (Dashboard widget, Settings page, History page, Pop-out window, About page). `Contributors` header updated from placeholder to actual wp.org username `ir240474`.
|
||||||
|
|
||||||
@@ -110,6 +130,12 @@ SomaFM's track-info endpoint (`somafm.com/songs/{station}.json`) is fetched best
|
|||||||
|
|
||||||
== Upgrade Notice ==
|
== Upgrade Notice ==
|
||||||
|
|
||||||
|
= 0.7.4 =
|
||||||
|
WordPress.org submission cleanup — removes the disallowed self-hosted updater + `Update URI` header. Adds LICENSE file + per-asset GPL headers. The `Updates` panel in Settings is gone (WordPress.org handles updates now). No player behaviour changes.
|
||||||
|
|
||||||
|
= 0.7.3 =
|
||||||
|
WordPress.org submission compliance — adds `Update URI` header so the self-hosted updater stays dormant on wp.org installs (guideline 8). Adds Privacy section + SomaFM terms link. No user-visible changes.
|
||||||
|
|
||||||
= 0.7.2 =
|
= 0.7.2 =
|
||||||
Screenshots + correct wp.org contributor handle. No user-visible changes.
|
Screenshots + correct wp.org contributor handle. No user-visible changes.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user