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>
This commit is contained in:
2026-06-08 14:55:04 +01:00
parent 8af3d7eb04
commit 117eaddaa0
6 changed files with 96 additions and 50 deletions
+2 -44
View File
@@ -16,48 +16,6 @@ function buddy_render_about_page() {
wp_die( esc_html__( 'You do not have permission to view this page.', 'rangerhq-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', 'rangerhq-buddy' ); ?></h1>
<span class="page-title-action">v<?php echo esc_html( BUDDY_VERSION ); ?></span>
@@ -70,9 +28,9 @@ function buddy_render_about_page() {
<?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>
<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 style="margin-bottom:0;">
<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>
+1 -1
View File
@@ -29,7 +29,7 @@ function buddy_render_main_page() {
<span class="page-title-action">v<?php echo esc_html( BUDDY_VERSION ); ?></span>
<hr class="wp-header-end">
<p class="description" style="max-width: 720px;">
<p class="description buddy-admin-description">
<?php esc_html_e( 'Your dashboard pet. Keep its stats up — eventually they will reflect how well you take care of your WordPress site.', 'rangerhq-buddy' ); ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=buddy-about' ) ); ?>"><?php esc_html_e( 'Read more on the About page →', 'rangerhq-buddy' ); ?></a>
</p>
+2 -2
View File
@@ -47,9 +47,9 @@ function buddy_render_settings_page() {
<div class="wrap">
<h1><?php esc_html_e( 'Buddy Settings', 'rangerhq-buddy' ); ?></h1>
<form method="post" style="max-width: 720px; background:#fff; padding:18px 22px; border:1px solid #ccd0d4; border-radius:4px; margin-top: 16px;">
<form method="post" class="buddy-settings-form">
<?php wp_nonce_field( 'buddy_rename', 'buddy_rename_nonce' ); ?>
<h2 style="margin-top:0;"><?php esc_html_e( 'Name', 'rangerhq-buddy' ); ?></h2>
<h2><?php esc_html_e( 'Name', 'rangerhq-buddy' ); ?></h2>
<p>
<label for="buddy_name"><?php esc_html_e( 'What is your Buddy called?', 'rangerhq-buddy' ); ?></label><br>
<input type="text"