Skip to content

Conversation

@wojtekn
Copy link
Contributor

@wojtekn wojtekn commented Mar 11, 2025

Related issues

Proposed Changes

I propose to add index.php to the protected files list during site import. Previously, the moveExistingWpContentToTrash method was removing index.php from the wp-content directory, which is a required WordPress file. The fix ensures this file is preserved alongside other critical files like db.php and the mu-plugins directory.

Testing Instructions

  1. Create a new WordPress site in Studio
  2. Verify that wp-content/index.php exists in the new site
  3. Export this site as a backup file
  4. Create another new WordPress site in Studio
  5. Import the backup file into the second site
  6. Verify that wp-content/index.php still exists after the import
  7. The site should work normally without any file-related errors

Pre-merge Checklist

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

@wojtekn wojtekn requested a review from a team March 11, 2025 12:36
@wojtekn wojtekn self-assigned this Mar 11, 2025
Copy link
Contributor

@ivan-ottinger ivan-ottinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed change looks good and works as expected. The wp-content/index.php stays in place after import. 👍🏼

@wojtekn wojtekn merged commit 54e900a into trunk Mar 12, 2025
7 checks passed
@wojtekn wojtekn deleted the update/import-to-preserve-index-php branch March 12, 2025 13:21
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.

index.php file is removed from wp-content during the import

3 participants