Skip to content

Conversation

@sejas
Copy link
Member

@sejas sejas commented Jan 27, 2026

When pushing a site from Studio to WordPress.com, PHP warnings were generated because wp-config.php contained constant definitions that were already defined by WordPress.com's infrastructure.

This fix:

  • Creates a sanitizeWpConfig() function that wraps define() calls with defined() checks to prevent constant redefinition warnings
  • Modifies DefaultExporter.addWpConfig() to sanitize wp-config.php before including it in the export archive
  • Adds comprehensive tests for the sanitization function

Fixes: STU-1257

Related issues

  • Fixes #

Proposed Changes

Testing Instructions

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

When pushing a site from Studio to WordPress.com, PHP warnings were
generated because wp-config.php contained constant definitions that
were already defined by WordPress.com's infrastructure.

This fix:
- Creates a sanitizeWpConfig() function that wraps define() calls with
  defined() checks to prevent constant redefinition warnings
- Modifies DefaultExporter.addWpConfig() to sanitize wp-config.php
  before including it in the export archive
- Adds comprehensive tests for the sanitization function

Fixes: STU-1257

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@sejas sejas self-assigned this Jan 27, 2026
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.

2 participants