Interactive reconstitution calculator with peptide-specific presets. Core features: - [prc_calculator] shortcode with instant client-side math - Concentration (mg/mL), mcg/unit, injection volume, syringe units, doses/vial - Live presets from PR Core dosing data (graceful fallback to 8 defaults) - REST API (prc/v1): presets list/detail + server-side calculate - Transient-cached presets with event-driven invalidation - Dark mode + responsive design (320px+) - Full teardown in uninstall.php 12 PHP files (max 241 lines), 1 JS file, 1 CSS file. CI: PHP lint 8.1-8.3, PHPCS WordPress, 300-line check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
# ── PHP Syntax Check ─────────────────────────────────────────────
|
|
lint-php:
|
|
name: PHP Lint (${{ matrix.php }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php: [ '8.1', '8.2', '8.3' ]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up PHP ${{ matrix.php }}
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
|
|
- name: Syntax check all PHP files
|
|
run: find . -name "*.php" -not -path "./vendor/*" | xargs -n 1 php -l
|
|
|
|
# ── WordPress Coding Standards (PHP CodeSniffer) ──────────────────
|
|
lint-phpcs:
|
|
name: WordPress Coding Standards
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.1'
|
|
|
|
- name: Install Composer dependencies
|
|
run: composer install --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: Run PHPCS
|
|
run: composer run lint
|
|
continue-on-error: true
|
|
|
|
# ── 300-line file check ──────────────────────────────────────────
|
|
file-size:
|
|
name: 300-line file check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Check no PHP file exceeds 300 lines
|
|
run: |
|
|
violations=0
|
|
while IFS= read -r file; do
|
|
lines=$(wc -l < "$file")
|
|
if [ "$lines" -gt 300 ]; then
|
|
echo "VIOLATION: $file ($lines lines)"
|
|
violations=$((violations + 1))
|
|
fi
|
|
done < <(find . -name "*.php" -not -path "./vendor/*" -not -path "./tests/*")
|
|
if [ "$violations" -gt 0 ]; then
|
|
echo "$violations file(s) exceed 300 lines"
|
|
exit 1
|
|
fi
|
|
echo "All PHP files are 300 lines or fewer."
|