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
This commit is contained in:
peptiderepo
2026-06-13 13:09:56 +07:00
committed by GitHub
parent cc5d06b970
commit e9d97b51e2
18 changed files with 2004 additions and 119 deletions

View File

@@ -76,6 +76,31 @@ $wpdb->query(
"DELETE FROM {$wpdb->options} WHERE option_name LIKE 'pr\_core\_%'"
);
/* ── 4b. Delete v0.6.0 schema-input meta keys from all peptide posts ──── */
/*
* Migration 0004 writes _pr_molecular_formula, _pr_molecular_weight, _pr_aliases,
* and _pr_faq_items to the shared peptide posts. These are PR Core-authored values
* (derived from PubChem / PSA) and are safe to remove on uninstall.
*
* @see ARCHITECTURE.md — §2.9 Uninstall specification.
*/
$schema_meta_keys = [
'_pr_molecular_formula',
'_pr_molecular_weight',
'_pr_aliases',
'_pr_faq_items',
];
foreach ( $schema_meta_keys as $meta_key ) {
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->delete(
$wpdb->postmeta,
[ 'meta_key' => $meta_key ],
[ '%s' ]
);
}
/* ── 5. Remove manage_peptide_content capability from all roles ───────── */
$editable_roles = wp_roles()->roles;