From 66957c34dba5398474323606001e09da5380ca3d Mon Sep 17 00:00:00 2001 From: David Keane Date: Tue, 9 Jun 2026 02:24:53 +0100 Subject: [PATCH] wiki: initial 5 pages (Home / Architecture / Roadmap / Privacy / FAQ / Family) Mirrors the rangerhq-tuner wiki pattern so the RangerHQ family stays coherent across surfaces. Each page written specifically to make the wp.org reviewer's verification job easy: - Home: overview, status table, source layout, install - Architecture: per-user wp_usermeta storage, inline-SVG renderer, CSS-only animations, the four load-bearing decisions, Tier-1 admin discipline notes (esc_html, no inline styles, etc.) - Roadmap: Phase A done -> B (interactions) -> C (decay) -> D (species) -> E (site health, the headline feature) -> F (Pro) - Privacy: per-user wp_usermeta inventory, zero outbound requests, GDPR notes, how-to-wipe runbook - FAQ: 13 common questions - Family: positions Buddy against Radio + Tuner + future Logbook with the 'RangerHQ promise' (GPL, no telemetry, etc.) --- Architecture.md | 112 ++++++++++++++++++++++++++++++++++++++++++++++++ FAQ.md | 65 ++++++++++++++++++++++++++++ Family.md | 60 ++++++++++++++++++++++++++ Home.md | 70 ++++++++++++++++++++++++++++++ Privacy.md | 76 ++++++++++++++++++++++++++++++++ Roadmap.md | 94 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 477 insertions(+) create mode 100644 Architecture.md create mode 100644 FAQ.md create mode 100644 Family.md create mode 100644 Home.md create mode 100644 Privacy.md create mode 100644 Roadmap.md diff --git a/Architecture.md b/Architecture.md new file mode 100644 index 0000000..e2e1119 --- /dev/null +++ b/Architecture.md @@ -0,0 +1,112 @@ +# Architecture + +RangerHQ Buddy is hand-rolled PHP — no frameworks, no Composer dependencies, no build step. The whole plugin is ~6 PHP files, one stylesheet, and zero JavaScript. Currently ~28 KB packaged. + +## High-level component map + +``` + wp-admin + ┌────────────────────────────────────────────────────────────────┐ + │ WP Dashboard │ + │ ┌──────────────────────────────────┐ │ + │ │ Buddy Dashboard Widget │ inc/dashboard-widget.php│ + │ │ - sprite (sm) │ │ + │ │ - name + mood │ │ + │ │ - four stat bars (h/h/h/e) │ │ + │ └──────────────────────────────────┘ │ + │ │ + │ Sidebar: 🐾 Buddy ▾ │ + │ ├─ My Buddy inc/admin-page.php │ + │ ├─ Settings inc/settings.php (rename Buddy) │ + │ └─ About inc/about.php (roadmap + version) │ + └────────────────────────────────────────────────────────────────┘ + │ + │ buddy_get_state / buddy_update_state + ▼ + ┌────────────────────────────────────────────────────────────────┐ + │ inc/state.php — per-user storage in wp_usermeta │ + │ Key: 'buddy_state' │ + │ Shape: { name, species, hunger, happiness, health, energy, │ + │ born_at, last_tick } │ + └────────────────────────────────────────────────────────────────┘ + │ + │ values feed → mood label + tone selection + ▼ + ┌────────────────────────────────────────────────────────────────┐ + │ inc/sprite.php — inline-SVG renderer │ + │ buddy_render_sprite( $tone, $size ) │ + │ - tones: happy / neutral / sad / wink (cheeky surprise) │ + │ - sizes: sm / md / lg │ + │ - no image files, no GIFs — every pixel is SVG │ + │ - CSS keyframes drive bobbing + blinking, NOT JS │ + └────────────────────────────────────────────────────────────────┘ +``` + +## The four load-bearing decisions + +### 1. Per-user state in `wp_usermeta` (not `wp_options`) + +Each WP admin user gets their own Buddy. Storage is `update_user_meta( $user_id, 'buddy_state', $state )`. This means multi-admin sites work perfectly — Alice's Buddy is independent of Bob's. Nothing is shared between accounts. + +The alternative (a single `wp_options` row for the whole site) would have meant either everyone shares one Buddy or a complex multi-row schema. `wp_usermeta` makes per-user a one-liner. + +### 2. Inline-SVG character (no GIFs, no sprite sheets, no PNGs) + +`inc/sprite.php` outputs an `` element directly into the page HTML. Eye shapes, mouth curves, cheek dots — all paths/circles in SVG, all parameterised by the `$tone` and `$size` arguments. Switching mood doesn't change the image; it changes a couple of SVG element attributes. + +Why: zero asset weight, zero HTTP requests for the character, infinite scalability, easy to extend (add a new mood by adding a few SVG elements, not by drawing a new sprite sheet). + +### 3. CSS-only animations (no JavaScript) + +Bobbing motion and periodic blinking are CSS keyframes in `assets/css/buddy.css`. The wink animation that landed in v0.1.3 is also a CSS animation, not a JS timer. The plugin ships **zero JavaScript** for the character itself. + +The only JS in the whole plugin is the WP-native admin form scaffolding (the rename form on the Settings page uses standard WordPress nonces and a POST submission — no AJAX). + +### 4. Tier-1 admin discipline + +Carried forward from the broader RangerHQ family submission discipline (see [[Family]]): + +- Single `

` per admin page (accessibility + WordPress conventions) +- No nested toggle boxes +- No duplicate sections +- Output escaping on every user-facing string (`esc_html_e`, `esc_attr_e`, etc.) +- Text-domain alignment across every translation call (`'rangerhq-buddy'`) +- `wp_rand()` instead of `mt_rand()` for any randomness +- All CSS in enqueued stylesheets — **no inline `