48e97862a6
Buddy is born. First commit of a new standalone WordPress plugin — the spiritual successor to the tamagotchi that once lived inside A-WP-Notes v1.1.5 (gracefully retired). Rebuilt from scratch with all the v3-discipline lessons baked in from day one. PHASE A — pet exists - Dashboard widget at WP Admin → Dashboard showing SVG character + name + mood label + four stats bars. - Dedicated admin page at WP Admin → Buddy → My Buddy (bigger view). - About page with side-by-side intro + plain-prose cards (Logbook About-page pattern carried forward). - Settings page with name-rename form + Updates panel. - Per-user state in user_meta key buddy_state (each WP admin gets their own pet, no shared state). - Inline SVG sprite renderer with three mood tones (happy/neutral/ sad) and three sizes (sm/md/lg). CSS keyframe animations: bobbing + periodic blinking. Zero image files. - Self-hosted update checker wired up from commit 1, ported from Logbook v3.3.5: /releases/latest with /tags?limit=1 fallback, 12h success cache / 1h negative cache. UI on Settings page. - dashicons-pets admin-menu icon — literal paw-print, brand match. ARCHITECTURE LOCKED FROM COMMIT 1 - Single-word brand name "Buddy" — no WP prefix, no future rebrand. - Public GPL v2+ Gitea repo (ranger/a-buddy). - Constants prefix BUDDY_*, function prefix buddy_*, text domain buddy. Clean naming throughout — none of Logbook's wp-notes-* historical-artifact baggage. - Single H1 per admin page, no nested toggle boxes, no duplicate sections — Tier-1 discipline carried forward from Logbook. - All assets local (inline SVG, plain CSS), no third-party CDN, no Gravatar-style external pings. NOT IN THIS RELEASE (planned) - Phase B — Feed/Play/Clean/Sleep interactions + cooldown timers. - Phase C — WP-cron decay + "Buddy is hungry" dismissible notices (port the persistent-dismissal pattern from Logbook). - Phase D — Multiple species (dog, dragon, sprite), per-species personality phrases. - Phase E — Site-health hook: pet stats react to wp_get_site_health() results. The killer feature. - Phase F — Pro tier (€2.99 lifetime) with custom skins + multi-pet. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
114 lines
5.9 KiB
PHP
114 lines
5.9 KiB
PHP
<?php
|
|
/**
|
|
* Buddy About page — explains what the plugin is, who it's for, and
|
|
* keeps a compact version history with a link out to the canonical
|
|
* CHANGELOG.md on Gitea.
|
|
*
|
|
* Layout: a clean side-by-side intro row at the top (sprite + intro
|
|
* + CTA), then plain prose cards. Discipline carried from Logbook —
|
|
* no nested toggle boxes, no duplicate sections, single H1.
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) { exit; }
|
|
|
|
function buddy_render_about_page() {
|
|
if ( ! current_user_can( 'read' ) ) {
|
|
wp_die( esc_html__( 'You do not have permission to view this page.', 'buddy' ) );
|
|
}
|
|
?>
|
|
<style>
|
|
.buddy-about-intro {
|
|
display: flex;
|
|
gap: 24px;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
margin: 16px 0 28px;
|
|
padding: 18px;
|
|
background: #fff;
|
|
border: 1px solid #ccd0d4;
|
|
border-radius: 4px;
|
|
}
|
|
.buddy-about-intro__sprite {
|
|
flex: 0 0 160px;
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
.buddy-about-intro__body {
|
|
flex: 1 1 320px;
|
|
min-width: 0;
|
|
}
|
|
.buddy-about-intro__body h2 { margin-top: 0; }
|
|
|
|
.buddy-about-card {
|
|
background: #fff;
|
|
border: 1px solid #ccd0d4;
|
|
border-radius: 4px;
|
|
padding: 20px 24px;
|
|
margin: 0 0 22px;
|
|
max-width: 720px;
|
|
}
|
|
.buddy-about-card h2 { margin: 0 0 10px; font-size: 16px; }
|
|
.buddy-about-card p:last-child { margin-bottom: 0; }
|
|
.buddy-about-card ul { margin: 8px 0 0 18px; list-style: disc; }
|
|
.buddy-about-card ul li { margin-bottom: 4px; }
|
|
.buddy-about-card--versions ul { list-style: none; margin-left: 0; }
|
|
.buddy-about-card--versions li { margin-bottom: 12px; }
|
|
.buddy-about-card--versions .ver { font-weight: 600; color: #2271b1; }
|
|
.buddy-about-card--versions .latest { display:inline-block; margin-left:6px; padding:1px 7px; background:#00a32a; color:#fff; border-radius:9px; font-size:11px; font-weight:600; }
|
|
.buddy-about-changelog-link { display: inline-block; margin-top: 6px; font-size: 13px; color: #646970; }
|
|
</style>
|
|
|
|
<div class="wrap">
|
|
<h1 class="wp-heading-inline"><?php esc_html_e( 'About', 'buddy' ); ?></h1>
|
|
<span class="page-title-action">v<?php echo esc_html( BUDDY_VERSION ); ?></span>
|
|
<hr class="wp-header-end">
|
|
</div>
|
|
|
|
<div class="wrap">
|
|
<div class="buddy-about-intro">
|
|
<div class="buddy-about-intro__sprite">
|
|
<?php buddy_render_sprite( 'default', 'happy', 'lg' ); ?>
|
|
</div>
|
|
<div class="buddy-about-intro__body">
|
|
<h2>Buddy <span style="color:#646970; font-weight:400;">v<?php echo esc_html( BUDDY_VERSION ); ?></span></h2>
|
|
<p>A friendly little companion that lives in your WordPress dashboard. The idea: keep Buddy's stats up, eventually Buddy's mood will reflect how well you're taking care of your site itself. Gamifies WordPress maintenance with a bit of charm.</p>
|
|
<p style="margin-bottom:0;">
|
|
<a href="<?php echo esc_url( admin_url( 'admin.php?page=buddy' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Go to My Buddy →', 'buddy' ); ?></a>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="buddy-about-card">
|
|
<h2><?php esc_html_e( 'What Buddy does', 'buddy' ); ?></h2>
|
|
<p><?php esc_html_e( 'Buddy is a small virtual pet stored per-user in your WordPress site. Each WP admin gets their own Buddy with its own name, species, and stats. Everything lives in your site\'s own database — nothing leaves the server.', 'buddy' ); ?></p>
|
|
<p><?php esc_html_e( 'Right now (v0.1.0): Buddy exists. You can see them on the WordPress Dashboard widget and on the dedicated Buddy admin page. Coming next: feed / play / clean / sleep interactions, time-based stat decay, multiple species, and the killer feature — stats that react to your actual WordPress site health.', 'buddy' ); ?></p>
|
|
</div>
|
|
|
|
<div class="buddy-about-card">
|
|
<h2><?php esc_html_e( 'Who Buddy is for', 'buddy' ); ?></h2>
|
|
<ul>
|
|
<li><strong><?php esc_html_e( 'WordPress admins', 'buddy' ); ?></strong> <?php esc_html_e( 'who want a small daily reason to keep their site tidy.', 'buddy' ); ?></li>
|
|
<li><strong><?php esc_html_e( 'Freelancers', 'buddy' ); ?></strong> <?php esc_html_e( 'managing multiple client sites and wanting a visual gauge of each one\'s health.', 'buddy' ); ?></li>
|
|
<li><strong><?php esc_html_e( '90s kids', 'buddy' ); ?></strong> <?php esc_html_e( 'who remember when computers had pets in them.', 'buddy' ); ?></li>
|
|
<li><strong><?php esc_html_e( 'Anyone', 'buddy' ); ?></strong> <?php esc_html_e( 'who wants their WordPress admin to feel slightly less corporate.', 'buddy' ); ?></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="buddy-about-card buddy-about-card--versions">
|
|
<h2><?php esc_html_e( 'Version history', 'buddy' ); ?></h2>
|
|
<ul>
|
|
<li>
|
|
<span class="ver">v0.1.0</span> — 25 May 2026 <span class="latest">latest</span><br>
|
|
<?php esc_html_e( 'First release. Phase A complete: Buddy exists. Dashboard widget + dedicated admin page show the SVG character, name, mood label, four stats bars. Self-hosted update checker wired up to Gitea from commit 1. No interactions yet — that\'s next.', 'buddy' ); ?>
|
|
</li>
|
|
</ul>
|
|
<a class="buddy-about-changelog-link"
|
|
href="https://git.davidtkeane.com/ranger/a-buddy/src/branch/main/CHANGELOG.md"
|
|
target="_blank" rel="noopener">
|
|
<?php esc_html_e( 'View the full CHANGELOG.md →', 'buddy' ); ?>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|