Skip to content

Preserve index.php in wp-content during import - #1052

Merged
wojtekn merged 1 commit into
trunkfrom
update/import-to-preserve-index-php
Mar 12, 2025
Merged

Preserve index.php in wp-content during import#1052
wojtekn merged 1 commit into
trunkfrom
update/import-to-preserve-index-php

Conversation

@wojtekn

@wojtekn wojtekn commented Mar 11, 2025

Copy link
Copy Markdown
Contributor

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

@ivan-ottinger ivan-ottinger left a comment

Copy link
Copy Markdown
Contributor

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
@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

2 participants