=== WP Migrator ===
Contributors: broodweb
Tags: migration, backup, clone, import, export
Requires at least: 5.6
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Full-site WordPress migration tool by Broodweb. Export and import your entire site as a single ZIP package.

== Description ==

WP Migrator is a complete site migration solution developed by [Broodweb](https://broodweb.com). Export your entire WordPress site — database, media files, plugins, themes, users and settings — into a single ZIP file, then import it to any other WordPress installation.

**Key Features:**

* **Full Database Export** — exports all tables with URL and prefix replacement on import
* **Media Files** — migrates your entire uploads directory
* **Plugins & Themes** — copies all installed plugin and theme files
* **Users** — migrates all user accounts and roles
* **Settings & Options** — transfers all site settings
* **Chunked Upload** — uploads large ZIPs in small pieces, bypassing server upload limits
* **Chunked Download** — downloads large ZIPs in pieces, no server timeout issues
* **Auto Admin Fix** — automatically restores your admin access after database import
* **DB Prefix Fix** — automatically handles database prefix differences between sites
* **Clean Import** — wipes existing content before importing so nothing is duplicated
* **Emergency Recovery** — built-in recovery tool if you get locked out after migration

**How It Works:**

1. Install WP Migrator on your source site
2. Go to Tools → WP Migrator → Export
3. Select components and click Generate Export ZIP
4. Download the ZIP file
5. Install WP Migrator on your destination site
6. Go to Tools → WP Migrator → Import
7. Upload the ZIP and click Start Import
8. Log out and back in — your site is migrated!

**Requirements:**

* PHP 7.4 or higher
* ZipArchive PHP extension
* WordPress 5.6 or higher

**Support & Documentation:**

Visit [broodweb.com](https://broodweb.com) for support and documentation.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/wp-migrator/`
2. Activate the plugin through the Plugins menu in WordPress
3. Go to Tools → WP Migrator

== Frequently Asked Questions ==

= How large a site can I migrate? =

WP Migrator uses chunked upload and download to handle sites of any size. The plugin has been tested with sites over 1 GB.

= Will my admin access be preserved after migration? =

Yes. WP Migrator automatically saves your admin credentials before import and restores them after, so you can always log back in with your original password.

= What if I get locked out after migration? =

Use the built-in Emergency Recovery tool under Tools → WP Migrator → Recovery tab to regain access without needing database tools.

= Does it work with different database prefixes? =

Yes. WP Migrator automatically detects and fixes database prefix differences between the source and destination sites.

= Is it safe to use on a live site? =

Yes. The export process is read-only and does not modify your site. Always back up before importing to a live site.

= Where are export files stored? =

Export ZIP files are stored in `wp-content/wp-migrator-exports/` and are protected from direct web access by `.htaccess`.

= Who made this plugin? =

WP Migrator is developed and maintained by [Broodweb](https://broodweb.com).

== Screenshots ==

1. Export tab — select components and generate ZIP
2. Import tab — upload ZIP with chunked upload and progress bar
3. Import log — detailed progress with prefix fix and admin restore
4. Exports tab — manage saved export files with chunked download
5. Recovery tab — emergency admin access recovery

== Changelog ==

= 1.1.1 =
* Fix: Replaced JS blob-assembly chunked download with direct PHP stream download
* Fix: Resolved .crdownload / duplicate download issue on live servers
* Fix: Reduced server chunk size from 5 MB to 2 MB for better shared-host compatibility
* Fix: Added X-Accel-Buffering, Content-Encoding and output buffer headers to prevent Nginx/Apache stream interruption
* Fix: WP Reset confirmation check now case-insensitive (typing "reset" or "RESET" both work)

= 1.1.0 =
* New: WP Reset feature — reset WordPress to a clean default state
* New: Selective reset — choose exactly which components to wipe (posts, comments, users, media, settings, plugins, themes, custom DB tables, transients)
* New: Safety confirmation — must type RESET to unlock the reset button
* New: Auto-redirect to dashboard after successful reset
* Current admin account is always preserved during reset

= 1.0.0 =
* Initial release by Broodweb
* Full database export and import with URL/prefix replacement
* Chunked upload and download for large files
* Automatic admin role restoration after database import
* Database prefix mismatch auto-fix
* Emergency recovery tool
* Clean import (wipes existing content before import)

== Upgrade Notice ==

= 1.1.0 =
New WP Reset feature added. Update recommended.

= 1.0.0 =
Initial release.
