Commit Graph

2 Commits

Author SHA1 Message Date
peptiderepo
edb4afe71e style: fix non-auto-fixable PHPCS violations — docblocks + wp_parse_url
All inline `/** @var ... */` single-line docblocks on class constants
and the $reader property are expanded to multi-line form with a proper
short description as the first tag (resolves
Generic.Commenting.DocComment.MissingShort on 8 locations across 2 files).

parse_url() → wp_parse_url() in sanitize_url() per WPCS
WordPress.WP.AlternativeFunctions.parse_url_parse_url (1 location).

No behaviour change: pure style/documentation fixes.

Agent-Session: prcore-jsonld-phpcs-20260623
2026-06-23 04:41:17 +00:00
peptiderepo
1ce471981b feat: PRAB article JSON-LD emitter + meta reader (v0.8.0)
- PR_Core_Jsonld_Article: meta-triggered emitter for PRAutoBlogger posts
  (trigger: _prab_schema_version=1 on post type). Yoast path retypes page
  node to MedicalWebPage (wpseo_schema_webpage_type priority 10) and enriches
  Article piece with citation[], about[]→Drug @id, lastReviewed, honest
  reviewedBy (wpseo_schema_graph priority 13). No-Yoast fallback emits
  standalone @graph. Posts without trigger meta are byte-unchanged.

- PR_Core_Prab_Meta_Reader: sanitises all _prab_* contract-v1 meta at read
  time. URLs validated (http/https), DOIs normalised to https://doi.org/ URI,
  JSON arrays per-element validated, WP user ID resolved. Malformed values
  degrade gracefully. Honest reviewedBy: Person ONLY when mode=human + valid
  user ID; else Organization. Never a fabricated person.

- Unit tests: JsonldArticleTest.php — 22 assertions covering is_triggered,
  review_mode, reviewed_by Person/Org decision tree, citation sanitization,
  DOI normalisation, about linkage, retype passthrough, enrich, no-new-nodes,
  editorial-system-never-person.

- bootstrap.php: WP_User stub + get_userdata reads pr_test_userdata global.
- ARCHITECTURE.md: updated JSON-LD class tree + PRAB emission section.
- CONVENTIONS.md: PRAB contract v2 extension guide added.
- CHANGELOG.md + version bump to v0.8.0.

Ratified contract: convo/prcore/decisions/2026-06-11-jsonld-contract-v1.md
File sizes: article.php=235L, meta-reader.php=265L (both < 300-line gate).
No duplicate Article/WebPage nodes. uninstall.php unaffected (_prab_* unowned).

Agent-Session: prcore-jsonld-article-20260622
2026-06-23 04:23:21 +00:00