Skip to content

Conversation

@Blueibear
Copy link
Owner

CRITICAL FIXES:

  1. FIXED HEADER TEMPLATE STRUCTURE

    • Replace LLM-generated header with fixed boilerplate
    • LLM only generates inner header content (logo, nav, etc.)
    • Fixed structure enforces DOCTYPE, html, head, body tags
    • Prevents malformed HTML generation
    • Remove all tags from header
  2. FIXED FOOTER TEMPLATE STRUCTURE

    • Replace LLM-generated footer with fixed boilerplate
    • LLM only generates inner footer content (widgets, copyright)
    • Fixed structure enforces footer, wp_footer(), body, html closing tags
    • Remove all tags from footer
    • Prevent double-escaped quotes: date('Y') not date('Y')
    • Remove duplicate footer blocks
  3. SANITIZATION AND VALIDATION

    • Add sanitize_php_code() function to remove escaping artifacts
    • Remove ' and " when outside actual PHP strings
    • Remove invisible unicode characters
    • Validate and strip accidentally generated structural tags
  4. TEMPLATE ENFORCEMENT

    • Add is_stub_template() to detect placeholder/stub templates
    • Add ensure_full_template_structure() to enforce get_header(), , get_footer()
    • Add remove_duplicate_footers() to clean duplicate footer blocks
    • Always create content.php and content-none.php as safe defaults
  5. PACKAGING FIXES

    • Exclude .git, .github, node_modules from ZIP archives
    • Exclude hidden files and directories
    • Exclude IDE files (.vscode, .idea) and cache files

This update prevents blank screens, malformed HTML, and PHP syntax errors by using fixed boilerplate structures that LLMs cannot break.

CRITICAL FIXES:

1. FIXED HEADER TEMPLATE STRUCTURE
   - Replace LLM-generated header with fixed boilerplate
   - LLM only generates inner header content (logo, nav, etc.)
   - Fixed structure enforces DOCTYPE, html, head, body tags
   - Prevents malformed HTML generation
   - Remove all <main> tags from header

2. FIXED FOOTER TEMPLATE STRUCTURE
   - Replace LLM-generated footer with fixed boilerplate
   - LLM only generates inner footer content (widgets, copyright)
   - Fixed structure enforces footer, wp_footer(), body, html closing tags
   - Remove all <main> tags from footer
   - Prevent double-escaped quotes: date('Y') not date(\'Y\')
   - Remove duplicate footer blocks

3. SANITIZATION AND VALIDATION
   - Add sanitize_php_code() function to remove escaping artifacts
   - Remove \' and \" when outside actual PHP strings
   - Remove invisible unicode characters
   - Validate and strip accidentally generated structural tags

4. TEMPLATE ENFORCEMENT
   - Add is_stub_template() to detect placeholder/stub templates
   - Add ensure_full_template_structure() to enforce get_header(), <main>, get_footer()
   - Add remove_duplicate_footers() to clean duplicate footer blocks
   - Always create content.php and content-none.php as safe defaults

5. PACKAGING FIXES
   - Exclude .git, .github, node_modules from ZIP archives
   - Exclude hidden files and directories
   - Exclude IDE files (.vscode, .idea) and cache files

This update prevents blank screens, malformed HTML, and PHP syntax errors
by using fixed boilerplate structures that LLMs cannot break.
@Blueibear Blueibear merged commit 02882b9 into main Dec 12, 2025
5 of 11 checks passed
@Blueibear Blueibear deleted the claude/update-wpgen-generator-MegNE branch December 12, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants