Commit Graph

3 Commits

Author SHA1 Message Date
peptiderepo
0bbb75fd26 fix(schema): v0.6.2 — move Drug/FAQ injection to wpseo_schema_graph; fix peptide 500
Root cause: inject_graph_pieces() added plain PHP arrays to wpseo_schema_graph_pieces.
Yoast Schema_Generator::filter_graph_pieces_to_generate() calls get_class() +
is_needed() on every piece expecting Abstract_Schema_Piece objects — a plain array
produces: PHP Fatal: get_class(): Argument #1 ($object) must be of type object,
array given. All peptide monograph pages returned HTTP 500; non-peptide pages were
unaffected (is_singular guard).

Fix: remove wpseo_schema_graph_pieces hook entirely. New inject_graph_nodes() method
hooks wpseo_schema_graph at priority 12 (after enrich_webpage_piece at 11), which
receives the fully-assembled graph as array-of-arrays — safe for plain array appends.

Also adds regression test (test-jsonld-peptide-piece.php) that:
- Reproduces the v0.6.1 get_class(array) TypeError (fails-before)
- Confirms inject_graph_nodes Drug+FAQ emission is correct (passes-after)

Agent-Session: jsonld-peptide-piece-fix v0.6.2
2026-06-13 07:12:46 +00:00
peptiderepo
e9d97b51e2 peptide-repo-core v0.6.0: peptide schema backfill + Yoast-integrated Drug/MedicalWebPage/FAQ (#19)
Backfill psa_*->_pr_* meta (migration 0004 + PubChem fallback); enrich Drug node with {permalink}#drug @id + molecularFormula/Weight/alternateName; rewrite emitter into Yoast schema graph (MedicalWebPage retype + FAQPage, no duplicate nodes).

QA: APPROVE (independent) — qa-reviews/peptide-repo-core/2026-06-13-817690c1b6ec2118ddcf3b8cfe8bc5ea7f3933b3.md

Agent-Session: peptide-schema-backfill v0.6.0 merge
2026-06-13 13:09:56 +07:00
peptiderepo
808b2509d8 feat: initial peptide-repo-core plugin (v0.1.0) — canonical schema sprint
Implements ADR-0002: canonical peptide schema as shared data layer for
the peptiderepo.com ecosystem. All Tier 1 tools (Reconstitution Calculator,
Dosage Reference, Legal Status Tracker, PSA enhancements) build on this.

Includes:
- pr_peptide CPT with REST, taxonomies, 11 meta fields
- 3 custom tables: pr_dosing_rows, pr_legal_cells, pr_ai_candidate_queue
- Sequential migration runner with schema versioning
- 4 typed DTOs and 4 repository classes (full CRUD)
- REST API (pr-core/v1): 6 endpoints (read public, write auth-gated)
- Admin UI: 3 meta boxes, custom columns, AI candidate queue page
- Shared disclaimer component (shortcode + static API)
- JSON-LD Drug schema emission on single peptide pages
- Seed data fixture (3 peptides, 10 dosing rows, 5 legal cells)
- Full teardown in uninstall.php
- CI: PHP lint 8.0-8.2, PHPCS WordPress, 300-line check

All 22 PHP files under 300 lines. Highest: peptide-cpt at 265.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 07:36:12 +07:00