Consolidated findings from four real-world integration attempts.
| # | Project | Type | sanctify-php Result | php-aegis Result |
|---|---|---|---|---|
| 1 | wp-sinople-theme | Semantic WP theme | ||
| 2 | Zotpress | Mature WP plugin | ❌ Could not run | ❌ No value added |
| 3 | (Metrics capture) | - | Improvements measured | Issues documented |
| 4 | sinople-theme | Semantic WP theme | ✅ CI integration | ✅ Unique value (Turtle!) |
| 5 | Sinople (full) | Semantic WP theme | ✅ Real vuln found | ✅ TurtleEscaper fix |
The sinople-theme integration demonstrates the correct approach:
┌─────────────────────────────────────────────────────────────┐
│ sinople-theme Integration: BOTH TOOLS PROVIDED VALUE │
│ │
│ php-aegis: │
│ ✅ TurtleEscaper for RDF output (/feed/turtle/) │
│ ✅ WordPress-style function wrappers │
│ ✅ Graceful fallback if php-aegis unavailable │
│ │
│ sanctify-php: │
│ ✅ Added to GitHub Actions CI workflow │
│ ✅ AST-based security analysis │
│ ✅ WordPress-specific issue detection │
└─────────────────────────────────────────────────────────────┘
Key success factor: Focus on unique value (Turtle escaping) not WordPress duplicates.
The complete Sinople integration found a real security vulnerability:
┌─────────────────────────────────────────────────────────────┐
│ CRITICAL: addslashes() used for Turtle escaping │
│ │
│ Original code: addslashes($value) for RDF Turtle output │
│ Problem: addslashes() is SQL escaping, NOT Turtle escaping │
│ Risk: RDF injection attacks possible │
│ │
│ Fix: TurtleEscaper::literal() + TurtleEscaper::iri() │
│ Result: W3C-compliant Turtle escaping │
└─────────────────────────────────────────────────────────────┘
Security Fixes Applied:
| Severity | Issue | Fix |
|---|---|---|
| CRITICAL | addslashes() for Turtle | TurtleEscaper::literal() |
| CRITICAL | IRI without validation | Validator::url() + error handling |
| HIGH | URL validation via strpos() | parse_url() host comparison |
| HIGH | Unsanitized Micropub input | sanitize_text_field() + wp_kses_post() |
| MEDIUM | No security headers | CSP, HSTS, X-Frame-Options |
| MEDIUM | No rate limiting | 1-min rate limit for Webmentions |
| LOW | Missing strict_types | Added to all PHP files |
This proves: When focused on unique value (Turtle escaping), php-aegis finds and fixes real vulnerabilities that WordPress cannot address.
┌─────────────────────────────────────────────────────────────┐
│ The Haskell toolchain requirement is a TOTAL BLOCKER │
│ │
│ • Zotpress integration: Could not run sanctify-php at all │
│ • Manual analysis was performed instead │
│ • PHP developers will NOT install GHC │
│ • Pre-built binaries are MANDATORY for any adoption │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ php-aegis provides no value for WordPress projects │
│ │
│ WordPress already has: │
│ • esc_html(), esc_attr(), esc_url(), esc_js() │
│ • sanitize_text_field(), wp_strip_all_tags() │
│ • is_email(), wp_http_validate_url() │
│ │
│ php-aegis should focus on what WordPress LACKS: │
│ • RDF/Turtle escaping │
│ • IndieWeb protocol security │
│ • ActivityPub content policies │
└─────────────────────────────────────────────────────────────┘
| Metric | Before | After | Change |
|---|---|---|---|
Files with strict_types |
0 | 24 | +100% |
| PHP version support | 7.4+ | 8.2+ | Upgraded |
| WordPress version | 5.8+ | 6.4+ | Upgraded |
| CI security checks | 0 | 4 | +4 new |
| Priority | Item | Status | Rationale |
|---|---|---|---|
| BLOCKER | Pre-built binaries | 🔲 Not Started | Tool cannot run without this |
| Critical | Composer plugin | 🔲 Not Started | PHP devs expect composer require |
| High | Docker container | 🔲 Not Started | Fallback for binary issues |
| High | GitHub Action | 🔲 Not Started | CI/CD adoption |
| Medium | Incremental analysis | 🔲 Not Started | Performance |
| Medium | Semantic support | 🔲 Not Started | Turtle/JSON-LD contexts |
| Priority | Item | Status | Rationale |
|---|---|---|---|
| Critical | Define target audience | 🔲 Not Started | Don't compete with WP core |
| Critical | php-aegis-compat (7.4+) | 🔲 Not Started | WordPress adoption |
| High | Turtle escaping | 🔲 Not Started | Unique value |
| High | WordPress adapter | 🔲 Not Started | snake_case functions |
| Medium | Extended validators | 🔲 Not Started | int(), ip(), domain() |
| Medium | IndieWeb support | 🔲 Not Started | Unique value |
Question: Who is this library for?
| Option | Description | Recommendation |
|---|---|---|
| A | Non-WordPress PHP library | Don't compete with WP |
| B | WordPress superset library | Provide unique value WP lacks |
Recommendation: Option B — Focus on semantic web, IndieWeb, ActivityPub.
Question: How do we achieve adoption?
| Priority | Action |
|---|---|
| 1 | Release pre-built binaries (BLOCKER resolution) |
| 2 | Create Composer plugin wrapper |
| 3 | Create GitHub Action |
| 4 | Add Docker container as fallback |
- ✅ WordPress-aware security constraints
- ✅ OWASP vulnerability coverage
- ✅ Taint tracking analysis
- ✅ SARIF output for GitHub Security
- ✅ Auto-fix transformations
- ✅ Simple, focused API
- ✅ Zero dependencies
- ✅ PSR-12 compliance
- ✅ Type safety
| Document | Purpose |
|---|---|
PHP-AEGIS-HANDOVER.md |
Recommendations for php-aegis team |
ROADMAP.md |
sanctify-php improvement plan |
STANDALONE.md |
Minimum viable standalone requirements |
TARGET-AUDIENCE.md |
When to use each tool |
IMPLEMENTATION-TRACKER.md |
Cross-team coordination |
INTEGRATION-SUMMARY.md |
This consolidated summary |
- sanctify-php: Set up GitHub Actions for binary releases
- php-aegis: Create php-aegis-compat package scaffold
- sanctify-php: Publish Composer plugin wrapper
- php-aegis: Implement Turtle escaping functions
- sanctify-php: Create GitHub Action for CI/CD
- php-aegis: Add IndieWeb protocol support
*SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2024-2025 hyperpolymath