- Replace hand-rolled ci.yml jobs with thin caller to reusable estate workflow
(peptiderepo/peptide-e2e/.github/workflows/ci.yml@main); tests: stubs; has_js: false.
workflow_call + permissions: contents: write added per estate standard so deploy.yml
can gate on it and phpcbf auto-commit step has required token scope.
- Convert 7 hand-rolled test-*.php scripts to PHPUnit TestCase classes:
PeptideCptTest <- test-peptide-cpt.php
VerificationScannerTest <- test-verification-scanner.php
VerificationSettingsTest <- test-verification-settings.php
Migration0004Test <- test-migration-0004.php
JsonldTest <- test-jsonld.php
JsonldWebpageTest <- test-jsonld-webpage.php
JsonldPeptidePieceTest <- test-jsonld-peptide-piece.php
All assertions preserved; old scripts remain in tests/unit/ but CI no longer
runs them (PHPUnit discovery matches *Test.php only).
- Rewrite tests/bootstrap.php: full WP stub library for PHPUnit (WP_Post, WP_Error,
all option/cron/CPT/taxonomy/permalink stubs); registers PR_Core_Autoloader.
- Add phpunit.xml.dist (bootstrap, unit suite, includes/ coverage).
- Add phpunit/phpunit ^9.6 + yoast/phpunit-polyfills ^2.0 to require-dev.
- Add composer test script (vendor/bin/phpunit --configuration phpunit.xml.dist).
- deploy.yml: add permissions: contents: write.
- Version bump 0.6.2 -> 0.7.0.
Agent-Session: claude-adopt-ci-20260616
52 lines
2.3 KiB
PHP
52 lines
2.3 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Peptide Repo Core
|
|
* Plugin URI: https://peptiderepo.com
|
|
* Description: Canonical peptide schema — shared data layer for the peptiderepo.com ecosystem. Provides the peptide CPT, dosing rows, legal status cells, AI candidate queue, disclaimer component, and JSON-LD output.
|
|
* Version: 0.7.0
|
|
* Author: peptiderepo
|
|
* Author URI: https://peptiderepo.com
|
|
* License: GPL-2.0-or-later
|
|
* Text Domain: peptide-repo-core
|
|
* Requires PHP: 8.1
|
|
*
|
|
* @see ARCHITECTURE.md — Full data flow and file tree.
|
|
* @see CONVENTIONS.md — Naming patterns and extension guides.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
/* ── Constants ────────────────────────────────────────────────────────── */
|
|
|
|
define( 'PR_CORE_VERSION', '0.7.0' );
|
|
define( 'PR_CORE_PLUGIN_FILE', __FILE__ );
|
|
define( 'PR_CORE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
|
define( 'PR_CORE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
|
define( 'PR_CORE_TARGET_SCHEMA_VERSION', 4 );
|
|
|
|
/* ── Autoloader ───────────────────────────────────────────────────────── */
|
|
|
|
require_once PR_CORE_PLUGIN_DIR . 'includes/class-pr-core-autoloader.php';
|
|
PR_Core_Autoloader::register();
|
|
|
|
// The main orchestrator class is loaded explicitly because its name (PR_Core)
|
|
// equals the autoloader prefix exactly — stripping "PR_Core_" yields an empty
|
|
// suffix, producing "class-pr-core-.php" instead of "class-pr-core.php".
|
|
require_once PR_CORE_PLUGIN_DIR . 'includes/class-pr-core.php';
|
|
|
|
/* ── Activation / Deactivation ────────────────────────────────────────── */
|
|
|
|
register_activation_hook( __FILE__, [ 'PR_Core_Activator', 'activate' ] );
|
|
register_deactivation_hook( __FILE__, [ 'PR_Core_Deactivator', 'deactivate' ] );
|
|
|
|
/* ── Boot ──────────────────────────────────────────────────────────────── */
|
|
|
|
add_action( 'plugins_loaded', static function (): void {
|
|
$plugin = new PR_Core();
|
|
$plugin->init();
|
|
} );
|