Consolidates the `peptide` CPT under PR Core ownership, dropping the `pr_peptide` slug-collision that was 404ing all 89 peptide detail pages. - POST_TYPE: pr_peptide -> peptide - TAX_CATEGORY: pr_peptide_category -> peptide_category - TAX_FAMILY + pr_peptide_family taxonomy removed - Defensive post_type_exists/taxonomy_exists guards on both registrations - Args harmonized as superset of PSA + prior PR Core (adds thumbnail support) - Activation hook + init:999 version-change flush handler - Uninstall scoped to _pr_core_authored flag (PSA-authored posts survive) - Plugin version 0.1.1 -> 0.2.0, CHANGELOG in same commit - ARCHITECTURE.md + CONVENTIONS.md updated with CPT ownership rule QA gate verdict: PASS (qa-reviews/peptide-repo-core/2026-04-22-874f93b.md) Sibling release: peptiderepo/peptide-search-ai#15 (PSA v4.5.0) Known follow-up: manage_peptide_content capability is not granted to any role as of v0.2.0. No current UI/theme reads or writes PR Core-defined meta keys, so no regression. Follow-up thread to decide role assignment.
5.8 KiB
5.8 KiB
Changelog
All notable changes to Peptide Repo Core are documented here. Format: Semantic Versioning.
[0.2.0] — 2026-04-22
Changed (BREAKING)
- CPT renamed from
pr_peptidetopeptide. Consolidates with PSA's existingpeptideCPT which owns the 89 canonical peptide posts on production. - Taxonomy renamed from
pr_peptide_categorytopeptide_category. Same reason. - CPT args harmonized as superset of PSA + prior PR Core registration (supports now includes thumbnail + revisions + custom-fields).
- Defensive registration: guards with
post_type_exists()/taxonomy_exists()so PSA's parallel registration no-ops cleanly during the PSA v4.5.0 transition.
Added
PR_Core_Activator::maybe_flush_on_version_change()— one-shot rewrite flush on in-place version bumps (hooked atinitpriority 999). Eliminates the need for a manualwp rewrite flushafter updates that change CPT/taxonomy slugs._pr_core_authoredpost-meta flag contract — peptide posts created via PR Core UI carry this flag;uninstall.phpuses it to scope teardown to plugin-owned posts only.- Lightweight unit-test harness (
tests/bootstrap.php+tests/unit/test-peptide-cpt.php) that exercises CPT/taxonomy guards and args payload shape without a PHPUnit + wp-env dependency. Wired into the existing PHP-lint CI job.
Removed
pr_peptide_familytaxonomy — never populated, never surfaced in UI.- All
pr_peptide*CPT-slug-derived references (constants, docblock mentions, uninstall string literals). - Blanket
DELETE FROM posts WHERE post_type = 'pr_peptide'on uninstall. Replaced with a join-on-_pr_core_authoredselective delete so PSA-authored peptide posts are never destroyed by PR Core teardown. - Taxonomy-term cleanup on uninstall.
peptide_categoryis shared ownership post-v0.2.0; term data the site still needs is preserved.
Fixed
- Production peptide detail pages (all 89) were 404'ing due to a rewrite slug collision between PSA's
peptideCPT and PR Core'spr_peptideCPT both claiming/peptides/%postname%/. PR Core v0.1.1's emptypr_peptideCPT was winning the rewrite resolution. This release consolidates both to a singlepeptideCPT owned by PR Core.
Notes
- Scope of the
pr_peptide*scrub is intentionally narrow: CPT-slug-derived identifiers only. Class names (PR_Core_Peptide_CPT), file names (class-pr-core-peptide-cpt.php), plugin constants (PR_CORE_VERSION), option keys (pr_core_*), and the REST namespace (pr-core/v1) are the plugin's own namespace, not the CPT slug, and are preserved verbatim. - PR Core-defined meta keys (
display_name,aliases,evidence_strength,editorial_review_status, …) are gated bymanage_peptide_content. The activator grants this capability toadministratorandeditorroles on activation. Prod sites where the activation hook never fired (v0.1.1 was deployed manually) will receive the grant on nextwp plugin activate peptide-repo-core. Follow-up thread to decide whether a dedicatedpeptide_editorrole is more appropriate than extending coreeditor.
[0.1.1] — 2026-04-19
Fixed
- Fatal error on activation:
NAMESPACEis a PHP reserved keyword. Renamed toREST_NAMESPACEin the REST controller. - Fatal error: autoloader cannot resolve
PR_Coreclass. Class name equals the autoloader prefix exactly, producing wrong filename. Added explicit require_once in bootstrap (same pattern as PRAutoBlogger).
[0.1.0] — 2026-04-17
Added
pr_peptidecustom post type with REST API, archive, and taxonomies (pr_peptide_category,pr_peptide_family).- Post-meta fields: display_name, aliases, molecular_formula, molecular_weight, cas_number, drugbank_id, chembl_id, evidence_strength, editorial_review_status, last_editorial_review_at, medical_editor_id.
- Custom table
pr_dosing_rowswith schema migration 0001 — high-cardinality dosing data with citation tracking, evidence strength, and supersede (soft-delete) pattern. - Custom table
pr_legal_cellswith schema migration 0002 — per-country legal status with unique constraint on peptide x country (active). - Custom table
pr_ai_candidate_queuewith schema migration 0003 — AI-extracted dosing candidates awaiting human review. - Migration runner with sequential versioning (
pr_core_schema_versionoption,PR_CORE_TARGET_SCHEMA_VERSIONconstant). - Typed DTOs:
PR_Core_Peptide_DTO,PR_Core_Dosing_Row_DTO,PR_Core_Legal_Cell_DTO,PR_Core_Candidate_DTO. - Repository classes:
PR_Core_Peptide_Repository,PR_Core_Dosing_Repository,PR_Core_Legal_Repository,PR_Core_Candidate_Queue_Repository. - REST API (
pr-core/v1): list/get peptides, list/create dosing rows, list/create legal cells. - Admin UI: Scientific Identifiers meta box, Dosing Data meta box (read-only), Legal Status meta box (read-only), custom list-table columns (Evidence, Editorial, Dosing Rows).
- AI Candidate Queue admin page with approve/reject workflow (copies approved rows to dosing table).
- Shared disclaimer component:
[pr_disclaimer surface="dosing"]shortcode,PR_Core_Disclaimer::render()static method,pr_core_disclaimer_for_surfacefilter. - JSON-LD emission: schema.org
Drugtype on single peptide pages withpr_core_jsonld_peptidefilter. - Public API filters:
pr_core_get_indexable_corpus,pr_core_disclaimer_for_surface,pr_core_evidence_strength_label. - Public API actions:
pr_core_before/after_peptide_publish,pr_core_before/after_dosing_row_publish,pr_core_before/after_legal_cell_publish,pr_core_candidate_approved/rejected. manage_peptide_contentcapability granted to administrators and editors on activation.- Full teardown in
uninstall.php(tables, posts, terms, options, capabilities). - Seed data fixture: 3 peptides (BPC-157, Semaglutide, TB-500), 10 dosing rows, 5 legal cells.
- CI workflow: PHP lint (8.0/8.1/8.2), PHPCS (WordPress standard), 300-line file check.