5 Commits

Author SHA1 Message Date
Engineer (geomonitor)
f5cfa39f60 ci: switch PHPCS job to global composer require (fixes Packagist SSL timeout)
No project-level composer.lock → full Packagist fetch was timing out with
SSL error 28 on every run. Switch to setup-php built-in phpcs tool +
composer global require for WPCS, matching the pattern used in prautoblogger
which does not need a lock file for the global install path.

Refs #4
2026-06-14 13:08:44 +00:00
Engineer (geomonitor)
da25f0d9cb Fix CI (round 3): stub esc_attr__() in bootstrap
PRV_Dashboard_Renderer::render_trendline() uses esc_attr__() (the
WP function combining esc_attr + translation) for the canvas
aria-label. The stub was missing; PHP fatal on line 112 when
test-dashboard-panel.php called render_trendline() directly.
2026-06-14 13:02:41 +00:00
Engineer (geomonitor)
b3a96cf627 Fix CI (round 2): renderer docblock alignment + ARRAY_A + delta_html ignore
- Simplify render_bento and render_score_tile @param types in
  PRV_Dashboard_Renderer from complex aligned generics to plain
  'float', 'float|null', 'int', 'array', 'bool', 'string' with
  uniform per-group alignment — eliminates SpacingAfterParamType
  errors on lines 31-41 and 192-196.
- Add phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
  above the echo $delta_html line (output built by build_delta_html
  which applies esc_html() to all user-controlled values).
- Add ARRAY_A / OBJECT / ARRAY_N WP DB constants to tests/bootstrap.php
  — PRV_Ai_Visibility_Collector::collect() passes ARRAY_A to
  $wpdb->get_results(); the constant was never defined in bootstrap
  because existing tests only call run() not collect() directly. The
  new test-dashboard-panel.php test calls collect() and hit the
  undefined constant fatal.
2026-06-14 13:00:58 +00:00
Engineer (geomonitor)
7b9f53ec60 Fix CI: PHPCS param alignment + stub _n() in bootstrap
- Simplify @param type-hints in render_bento_band docblock from
  complex array<K,V{...}> generics to plain 'array' — eliminates
  SpacingAfterParamType alignment errors (PHPCS rule requires exact
  column alignment across multi-param functions; long generics are
  impossible to auto-align). Alignment is now uniform (longest type
  'string' = 6 chars; all others padded to col 7).
- Add phpcs:ignore comment on line above the /
  echo (dot is a fixed HTML entity; label is escaped by esc_html__()).
- Add _n() stub to tests/bootstrap.php — WP plural-form helper used
  by derive_health_pill_state(); not a PHP built-in; was missing.
2026-06-14 12:57:57 +00:00
Engineer (geomonitor)
2a2424ce8c v0.2.1 — dashboard visuals + deploy pipeline
Piece 1 — Visuals
- Add KPI bento bar (score tile with run-health pill, cost tile, last-run tile).
  Run-health pill shows 'All models healthy' / 'N model(s) degraded' / 'No run
  yet' sourced from PRV_Model_Registry health fields via collector.
- Add config-change trendline marker: inline configMarker Chart.js plugin draws
  a vertical dashed orange line + pin at every config_version boundary.
  Legend swatch + annotation note appear when breaks exist.
- Chart sits in fixed .prv-chartbox (300px); typeof-Chart guard + .prv-noscript
  fallback — cannot grow layout, degrades gracefully offline.
- PRV_Dashboard_Renderer: new class owns bento tile + trendline rendering.
  PRV_Ai_Visibility_Panel is now a thin orchestrator (237 lines).
- PRV_Ai_Visibility_Collector: trendline query now includes MIN(config_version)
  per run; collect() adds last_run_counts and config_versions to payload.
- PRV_Admin_Page: get_dashboard_css() returns Assay dark palette CSS.

Piece 2 — Deploy pipeline
- .github/workflows/deploy.yml: on push to main, runs CI, rsyncs plugin to
  Hostinger PROD (excl. .git .github tests phpunit composer vendor phpcs *.md),
  purges LiteSpeed, health-checks (200/403). Standalone — not smoke-gated.

DoD
- Version 0.2.1 in header + constant; CHANGELOG, ARCHITECTURE, CONVENTIONS,
  CONTEXT all updated same commit.
- tests/unit/test-dashboard-panel.php: 27 assertions.
- Pre-push checks: no PHP built-in name shadows in bootstrap.php; all
  includes/*.php files <= 300 lines (max: 298).
2026-06-14 12:52:07 +00:00
3 changed files with 5 additions and 33 deletions

View File

@@ -7,20 +7,6 @@ Versioning: [Semantic Versioning](https://semver.org/)
---
## [0.2.2] — 2026-06-14
Kill white WP admin gutters around the dark "Assay" UI — CSS only, no logic change.
### Fixed
- **Admin chrome (dashboard + settings):** `#wpcontent`, `#wpbody`, and `#wpbody-content` now receive the dark page background (`#14181C`) on both PR Vision screens. WP's default `20px` left padding on `#wpcontent` is removed so no light gutter appears between the left menu and the dark content area.
- **WP admin bar / first-element gap:** `#wpbody` dark fill removes the white strip between the admin bar and the first card.
- **Page `<h1>` header:** `.wrap > h1` colour set to the light text token (`#EEF2F5`) so the dashboard heading renders on dark, not white.
- **Proxy-note banner (dashboard):** `.notice.prv-proxy-note` overridden to dark surface (`#1C2228`) with teal left border — banner now sits on dark bg matching the surrounding cards.
- **Scope:** entire CSS block delivered via `wp_add_inline_style('wp-admin', …)` inside `PRV_Admin_Page::enqueue_assets()`, which is already guarded by `strpos($hook, 'pr-vision')`. Styles are absent on every other WP admin page. WP admin bar and left menu are not touched.
---
## [0.1.1] — 2026-06-13
Rename to PR Vision; fix www-strip in competitor display; PHPCS gating; remove dead cache.

View File

@@ -203,28 +203,14 @@ class PRV_Admin_Page {
/**
* Return the dashboard CSS for the PR Vision admin page.
*
* Covers two concerns:
* 1. WP admin wrapper chrome (injected here; fires on BOTH PR Vision screens
* because the enqueue_assets guard matches 'pr-vision' in the hook suffix):
* #wpcontent / #wpbody-content are set to the dark page bg so no white
* gutter/strip shows around or above the dark UI.
* 2. Component tokens (.prv-*) — unchanged from prior versions.
*
* This inline style block is attached to wp-admin (always loaded on admin
* pages) via wp_add_inline_style() and therefore only present on the two
* PR Vision screens. It must NOT be registered globally.
* Uses CSS custom properties matching the "Assay" dark design palette from
* design/pr-vision/design-proposal.md. Scoped to .prv-* selectors so it
* cannot leak into WP admin chrome.
*
* @return string CSS string.
*/
private function get_dashboard_css(): string {
return '
/* === PR Vision — WP admin chrome: kill white wrappers (scoped via conditional enqueue) === */
#wpcontent{background:#14181C;padding-left:0;}
#wpbody-content{background:#14181C;min-height:calc(100vh - 32px);padding-bottom:40px;}
#wpbody{background:#14181C;}
.wrap>h1,.prv-settings-wrap~*>h1,.wp-heading-inline{color:#EEF2F5;}
.notice.prv-proxy-note{background:#1C2228;border-left-color:#34C0CA;color:#EEF2F5;}
.notice.prv-proxy-note p{color:#C2CCD6;}
/* === PR Vision dashboard — "Assay" palette (dark-adapted) === */
.prv-bento{display:grid;grid-template-columns:1.25fr 1fr 1fr;gap:16px;margin:18px 0 22px;}
@media(max-width:820px){.prv-bento{grid-template-columns:1fr;}}

View File

@@ -3,7 +3,7 @@
* Plugin Name: PR Vision
* Plugin URI: https://peptiderepo.com
* Description: Weekly server-side LLM probes for AI-visibility (GEO) tracking. Records whether peptiderepo.com is cited by LLMs across core peptides, stores time-series, and renders an admin dashboard + settings UI.
* Version: 0.2.2
* Version: 0.2.1
* Author: peptiderepo
* Author URI: https://peptiderepo.com
* License: GPL-2.0-or-later
@@ -24,7 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) {
/* ── Constants ────────────────────────────────────────────────────────── */
define( 'PRV_VERSION', '0.2.2' );
define( 'PRV_VERSION', '0.2.1' );
define( 'PRV_PLUGIN_FILE', __FILE__ );
define( 'PRV_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'PRV_PLUGIN_URL', plugin_dir_url( __FILE__ ) );