Files
ranger 117eaddaa0 chore: v0.1.5 — wp.org reviewer-feedback fix
Reviewer flagged inc/about.php line 19 — an inline <style> block —
asking us to use wp_enqueue_style instead. Per their hint that the
team may not list every instance of an issue, fixed the entire CSS
inline-styling pattern across the plugin:

- inc/about.php: <style> block (lines 19-59) → moved to buddy.css
- inc/about.php: <span style="color:#646970; font-weight:400;">
  → .buddy-about-intro__version class
- inc/about.php: <p style="margin-bottom:0;"> → .buddy-about-intro__cta
- inc/settings.php: <form style="..."> → .buddy-settings-form class
- inc/settings.php: <h2 style="margin-top:0;"> → scoped under form class
- inc/admin-page.php: <p style="max-width:720px;">
  → .buddy-admin-description utility class

The only remaining inline style is in inc/dashboard-widget.php at the
stat-bar width — that is a runtime-computed %d value, legitimately
inline.

The buddy.css file was already enqueued on the About / Settings /
Admin / Dashboard pages via the existing buddy_enqueue_admin_assets
function, so no new enqueue logic was needed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 14:55:04 +01:00

80 lines
5.2 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.', 'rangerhq-buddy' ) );
}
?>
<div class="wrap">
<h1 class="wp-heading-inline"><?php esc_html_e( 'About', 'rangerhq-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 class="buddy-about-intro__version">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 class="buddy-about-intro__cta">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=buddy' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Go to My Buddy →', 'rangerhq-buddy' ); ?></a>
</p>
</div>
</div>
<div class="buddy-about-card">
<h2><?php esc_html_e( 'What Buddy does', 'rangerhq-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.', 'rangerhq-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.', 'rangerhq-buddy' ); ?></p>
</div>
<div class="buddy-about-card">
<h2><?php esc_html_e( 'Who Buddy is for', 'rangerhq-buddy' ); ?></h2>
<ul>
<li><strong><?php esc_html_e( 'WordPress admins', 'rangerhq-buddy' ); ?></strong> <?php esc_html_e( 'who want a small daily reason to keep their site tidy.', 'rangerhq-buddy' ); ?></li>
<li><strong><?php esc_html_e( 'Freelancers', 'rangerhq-buddy' ); ?></strong> <?php esc_html_e( 'managing multiple client sites and wanting a visual gauge of each one\'s health.', 'rangerhq-buddy' ); ?></li>
<li><strong><?php esc_html_e( '90s kids', 'rangerhq-buddy' ); ?></strong> <?php esc_html_e( 'who remember when computers had pets in them.', 'rangerhq-buddy' ); ?></li>
<li><strong><?php esc_html_e( 'Anyone', 'rangerhq-buddy' ); ?></strong> <?php esc_html_e( 'who wants their WordPress admin to feel slightly less corporate.', 'rangerhq-buddy' ); ?></li>
</ul>
</div>
<div class="buddy-about-card buddy-about-card--versions">
<h2><?php esc_html_e( 'Version history', 'rangerhq-buddy' ); ?></h2>
<ul>
<li>
<span class="ver">v0.1.2</span> &mdash; 26 May 2026 <span class="latest">latest</span><br>
<?php esc_html_e( 'Wink, tuned. The Easter-egg wink from v0.1.1 was firing at 30% per render — felt closer to "stuck" than "playful". Dropped to 5%: same cheeky face when it lands, just rare enough to feel like a treat.', 'rangerhq-buddy' ); ?>
</li>
<li>
<span class="ver">v0.1.1</span> &mdash; 25 May 2026<br>
<?php esc_html_e( 'Cheeky face! New wink expression that occasionally appears when Buddy is in a good mood — one eye closed, asymmetric smirk, rosier cheeks. Pure SVG, no image files. Proof that the expression engine is properly extensible.', 'rangerhq-buddy' ); ?>
</li>
<li>
<span class="ver">v0.1.0</span> &mdash; 25 May 2026<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.', 'rangerhq-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 →', 'rangerhq-buddy' ); ?>
</a>
</div>
</div>
<?php
}