Skip to content

Commit 881f63d

Browse files
committed
Add sinople-theme integration: success story + upstream issues
Fourth integration report - sinople-theme SUCCESS: - php-aegis provided unique value via TurtleEscaper - sanctify-php integrated into GitHub Actions CI - Graceful fallback pattern when php-aegis unavailable New: UPSTREAM-ISSUES.md Documents bugs/issues to report: - php-aegis: missing compat package, not on Packagist, mu-plugin not implemented, missing Permissions-Policy - sanctify-php: UnsafeRedirect false positive, MissingTextDomain false positive, PHP 8.1+ syntax needs verification Key insight: When focused on UNIQUE value (Turtle escaping), both tools provide real value to WordPress projects.
1 parent 4d492bd commit 881f63d

3 files changed

Lines changed: 278 additions & 5 deletions

File tree

docs/IMPLEMENTATION-TRACKER.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
| sanctify-php Roadmap | ✅ Complete | Begin Phase 1 |
99
| Standalone Requirements | ✅ Complete | See STANDALONE.md |
1010
| Target Audience | ✅ Complete | See TARGET-AUDIENCE.md |
11+
| Upstream Issues | ✅ Complete | See UPSTREAM-ISSUES.md |
1112
| Binary Releases | 🔲 Not Started | **BLOCKER** - Tool cannot run without this |
1213
| Composer Plugin | 🔲 Not Started | **CRITICAL** - Enable `composer require` |
1314
| Docker Container | 🔲 Not Started | **HIGH** - Fallback for binary issues |
@@ -21,10 +22,11 @@
2122

2223
### Integration Evidence
2324

24-
| Project | Could run sanctify-php? | Result |
25-
|---------|------------------------|--------|
26-
| wp-sinople-theme | ⚠️ With difficulty | Needed Haskell setup |
27-
| Zotpress |**NO** | GHC not available, couldn't run at all |
25+
| Project | Could run sanctify-php? | php-aegis Value? | Result |
26+
|---------|------------------------|------------------|--------|
27+
| wp-sinople-theme | ⚠️ With difficulty | ⚠️ Limited | Needed Haskell setup |
28+
| Zotpress |**NO** | ❌ None | GHC not available |
29+
| sinople-theme |**CI Integration** |**Turtle!** | Success with unique value focus |
2830

2931
> **Zotpress integration failed completely** — sanctify-php could not be executed.
3032
> Manual analysis was performed instead using documented patterns.

docs/INTEGRATION-SUMMARY.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Integration Feedback Summary
22

3-
Consolidated findings from three real-world integration attempts.
3+
Consolidated findings from four real-world integration attempts.
44

55
---
66

@@ -11,6 +11,29 @@ Consolidated findings from three real-world integration attempts.
1111
| 1 | wp-sinople-theme | Semantic WP theme | ⚠️ Ran with difficulty | ⚠️ Limited value |
1212
| 2 | Zotpress | Mature WP plugin |**Could not run** | ❌ No value added |
1313
| 3 | (Metrics capture) | - | Improvements measured | Issues documented |
14+
| 4 | sinople-theme | Semantic WP theme |**CI integration** |**Unique value (Turtle!)** |
15+
16+
### Success Story: sinople-theme
17+
18+
The sinople-theme integration demonstrates the **correct approach**:
19+
20+
```
21+
┌─────────────────────────────────────────────────────────────┐
22+
│ sinople-theme Integration: BOTH TOOLS PROVIDED VALUE │
23+
│ │
24+
│ php-aegis: │
25+
│ ✅ TurtleEscaper for RDF output (/feed/turtle/) │
26+
│ ✅ WordPress-style function wrappers │
27+
│ ✅ Graceful fallback if php-aegis unavailable │
28+
│ │
29+
│ sanctify-php: │
30+
│ ✅ Added to GitHub Actions CI workflow │
31+
│ ✅ AST-based security analysis │
32+
│ ✅ WordPress-specific issue detection │
33+
└─────────────────────────────────────────────────────────────┘
34+
```
35+
36+
**Key success factor**: Focus on **unique value** (Turtle escaping) not WordPress duplicates.
1437

1538
---
1639

docs/UPSTREAM-ISSUES.md

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
# Upstream Issues
2+
3+
Issues discovered during integration testing that need to be reported to respective repositories.
4+
5+
---
6+
7+
## php-aegis Issues
8+
9+
### Issue 1: Missing php-aegis-compat Package
10+
11+
**Severity**: High
12+
**Found in**: sinople-theme integration
13+
14+
**Description**:
15+
The `COMPATIBILITY.md` documentation references a `php-aegis-compat` package for PHP 7.4+ compatibility, but this package does not exist.
16+
17+
**Impact**:
18+
WordPress projects targeting PHP 7.4 (the WordPress minimum) cannot use php-aegis.
19+
20+
**Recommended Fix**:
21+
```bash
22+
# Create the package
23+
mkdir php-aegis-compat
24+
# Implement PHP 7.4 compatible API without enums/union types
25+
```
26+
27+
---
28+
29+
### Issue 2: Not Published on Packagist
30+
31+
**Severity**: Medium
32+
**Found in**: sinople-theme integration
33+
34+
**Description**:
35+
php-aegis is not available on Packagist, requiring VCS repository configuration in composer.json.
36+
37+
**Current workaround**:
38+
```json
39+
{
40+
"repositories": [
41+
{
42+
"type": "vcs",
43+
"url": "https://github.com/hyperpolymath/php-aegis"
44+
}
45+
]
46+
}
47+
```
48+
49+
**Recommended Fix**:
50+
Publish to Packagist for standard `composer require` experience.
51+
52+
---
53+
54+
### Issue 3: WordPress mu-plugin Adapter Not Implemented
55+
56+
**Severity**: Medium
57+
**Found in**: sinople-theme integration
58+
59+
**Description**:
60+
Documentation describes a WordPress mu-plugin adapter for automatic loading, but the adapter code does not exist.
61+
62+
**Expected location**: `src/WordPress/MuPlugin.php`
63+
64+
**Recommended Fix**:
65+
Implement the mu-plugin adapter or remove from documentation.
66+
67+
---
68+
69+
### Issue 4: Headers::secure() Missing permissionsPolicy()
70+
71+
**Severity**: Low
72+
**Found in**: sinople-theme integration
73+
74+
**Description**:
75+
The `Headers::secure()` method sets security headers but is missing `Permissions-Policy` header.
76+
77+
**Current output**:
78+
```
79+
X-Content-Type-Options: nosniff
80+
X-Frame-Options: DENY
81+
X-XSS-Protection: 1; mode=block
82+
Content-Security-Policy: ...
83+
```
84+
85+
**Missing**:
86+
```
87+
Permissions-Policy: camera=(), microphone=(), geolocation=()
88+
```
89+
90+
---
91+
92+
## sanctify-php Issues
93+
94+
### Issue 1: UnsafeRedirect False Positive
95+
96+
**Severity**: Medium
97+
**Found in**: sinople-theme integration
98+
99+
**Description**:
100+
The `UnsafeRedirect` check flags code as unsafe even when `exit` is on the next line.
101+
102+
**False positive**:
103+
```php
104+
wp_redirect($url);
105+
exit; // This IS safe, but sanctify reports it as unsafe
106+
```
107+
108+
**Expected behavior**:
109+
Should recognize `exit`/`die` on the immediately following line as safe.
110+
111+
**Recommended Fix**:
112+
```haskell
113+
-- In UnsafeRedirect check, look for exit/die within next 2 statements
114+
isFollowedByExit :: Statement -> [Statement] -> Bool
115+
isFollowedByExit redirect following =
116+
case take 2 following of
117+
(ExitStatement:_) -> True
118+
(DieStatement:_) -> True
119+
_ -> False
120+
```
121+
122+
---
123+
124+
### Issue 2: MissingTextDomain False Positive on WP Core
125+
126+
**Severity**: Low
127+
**Found in**: sinople-theme integration
128+
129+
**Description**:
130+
The `MissingTextDomain` check flags WordPress core functions that don't need a text domain.
131+
132+
**False positive**:
133+
```php
134+
// These are WordPress core, not theme strings
135+
__('Dashboard'); // Flagged, but this is WP core
136+
```
137+
138+
**Recommended Fix**:
139+
Maintain allowlist of WordPress core strings, or only check strings in theme/plugin files.
140+
141+
---
142+
143+
### Issue 3: PHP 8.1+ Syntax Verification Needed
144+
145+
**Severity**: Medium
146+
**Found in**: sinople-theme integration
147+
148+
**Description**:
149+
Need to verify parser handles modern PHP syntax:
150+
- Nullsafe operator (`?->`)
151+
- Match expressions
152+
- Named arguments
153+
- Enums
154+
- Constructor property promotion
155+
156+
**Recommended Fix**:
157+
Add test suite with PHP 8.1+ syntax examples.
158+
159+
---
160+
161+
### Issue 4: Incomplete Guix Export Documentation
162+
163+
**Severity**: Low
164+
**Found in**: sinople-theme integration
165+
166+
**Description**:
167+
The `sanctify export --guix` command is documented but the output format and usage instructions are incomplete.
168+
169+
**Missing**:
170+
- Example output
171+
- How to integrate with existing guix.scm
172+
- Container vs package mode
173+
174+
---
175+
176+
## Issue Template for GitHub
177+
178+
### php-aegis Issue Template
179+
180+
```markdown
181+
## Issue: [Title]
182+
183+
**Found during**: sinople-theme integration
184+
**Severity**: [High/Medium/Low]
185+
186+
### Description
187+
[Description of the issue]
188+
189+
### Steps to Reproduce
190+
1. [Step 1]
191+
2. [Step 2]
192+
193+
### Expected Behavior
194+
[What should happen]
195+
196+
### Actual Behavior
197+
[What actually happens]
198+
199+
### Suggested Fix
200+
[Code or approach to fix]
201+
```
202+
203+
### sanctify-php Issue Template
204+
205+
```markdown
206+
## Issue: [Title]
207+
208+
**Found during**: sinople-theme integration
209+
**Severity**: [High/Medium/Low]
210+
**Component**: [Parser/Analysis/Transform/CLI]
211+
212+
### Description
213+
[Description of the issue]
214+
215+
### Example Code Triggering Issue
216+
```php
217+
// PHP code that triggers the issue
218+
```
219+
220+
### Expected Behavior
221+
[What sanctify-php should report/do]
222+
223+
### Actual Behavior
224+
[What sanctify-php actually reports/does]
225+
226+
### Suggested Fix
227+
[Haskell code or approach to fix]
228+
```
229+
230+
---
231+
232+
## Tracking
233+
234+
| Issue | Repository | Reported | Status |
235+
|-------|------------|----------|--------|
236+
| php-aegis-compat missing | php-aegis | 🔲 Pending | - |
237+
| Not on Packagist | php-aegis | 🔲 Pending | - |
238+
| mu-plugin not implemented | php-aegis | 🔲 Pending | - |
239+
| Missing Permissions-Policy | php-aegis | 🔲 Pending | - |
240+
| UnsafeRedirect false positive | sanctify-php | 🔲 Pending | - |
241+
| MissingTextDomain false positive | sanctify-php | 🔲 Pending | - |
242+
| PHP 8.1+ syntax verification | sanctify-php | 🔲 Pending | - |
243+
| Guix export docs incomplete | sanctify-php | 🔲 Pending | - |
244+
245+
---
246+
247+
*SPDX-License-Identifier: MIT OR AGPL-3.0-or-later*
248+
*SPDX-FileCopyrightText: 2024-2025 hyperpolymath*

0 commit comments

Comments
 (0)