=== Codeandcore One-Click Migrator ===
Contributors: codeandcore
Tags: migration, post migration, ACF, REST API, content migration
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 3.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

All-in-one post migration solution — Send and receive any post type server-to-server via REST API.

== Description ==

Codeandcore One-Click Migrator is a unified WordPress plugin that acts as both **Sender** and **Receiver**.
Install on both sites to migrate content directly between servers — no FTP, no export/import.

= Features =

* **All Post Types** — Posts, Pages, and Custom Post Types (CPT)
* **All Statuses** — Draft, Published, Pending, Scheduled (Future), Private
* **Featured Image** — Auto-downloaded and re-attached on receiver
* **All Taxonomies** — Categories, Tags, custom taxonomies (parent hierarchy preserved)
* **Post Excerpt** — Full excerpt support preserved during migration
* **Full ACF Support** — All field types with up to 3-level deep repeater support
* **ACF Smart Update** — Only updates fields that exist on the receiver (skips missing fields)
* **Image Remapping** — ACF image/gallery fields downloaded and re-attached on receiver
* **Relationship Remapping** — Post Object and Relationship fields resolved by slug
* **Flexible Content** — ACF Flexible Content field support (up to 2 sub-levels)
* **Page Builders Support** — Full media and layout remapping for Elementor, Beaver Builder, and Gutenberg block editor
* **Premium UI** — Ultra Premium Light Admin UI with modal confirmations and sleek sidebar
* **REST API** — Secure server-to-server communication (no file transfers)
* **Authentication** — Shared auth-key, verified with timing-safe comparison
* **Bulk Migration** — Migrate multiple posts with real-time progress tracking
* **Disconnect** — Easily disconnect and reset sender credentials
* **Deactivation Feedback** — Understand why users leave with a sleek, non-intrusive feedback modal
* **Granular Migration Control** — Toggle exactly what to migrate (Author, Comments, Media Meta, ACF, Taxonomies, Excerpts)
* **Post Type Filtering** — Select exactly which post types are enabled for migration
* **Local Environment Support** — Built-in option to disable SSL verification for seamless migration between `.local` / `.test` sites
* **Smart Media Optimization** — Automatically deduplicates image processing during migration to prevent redundant database writes
* **Usage Tracking** — Opt-in analytics to help us improve features and identify platform compatibility needs

= How It Works =

1. Install this plugin on **both** the source and destination sites.
2. On the **destination** site → go to *Codeandcore One-Click Migrator → Receiver Settings* → generate an auth key → copy the endpoint URL.
3. On the **source** site → go to *Codeandcore One-Click Migrator → Sender Settings* → paste the endpoint URL and auth key.
4. On the **source** site → Navigate to any post list → click **⚡ Migrate** in the row actions, OR use the *Migrate Posts* panel for bulk migrations.

== Installation ==

1. Upload the `codeandcore-one-click-migrator` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Follow the *How It Works* steps above

== Frequently Asked Questions ==

= What ACF field types are supported? =
All standard ACF field types: text, textarea, number, email, url, image, file, gallery, select, checkbox, radio, relationship, post_object, user, taxonomy, date/time, color, repeater (up to 3 levels), and flexible_content.

= What happens if a field doesn't exist on the receiver? =
Top-level ACF fields are checked against available field groups on the receiver. If a field doesn't exist, it can be skipped or preserved as post meta depending on your configuration.

= Will duplicate posts be created? =
No. Posts are matched by slug + post type. If a match is found, the existing post is updated. Otherwise a new post is created.

= Are media files duplicated? =
No. The plugin checks if an image with the same filename/path exists in the media library and reuses it to save space. Otherwise, it is downloaded fresh.

== Screenshots ==

1. **Sender Settings** — Connect to your destination site using the endpoint URL and Auth Key.
2. **Receiver Settings** — Generate secure Auth Keys and view your REST API endpoint.
3. **Bulk Migration** — Select multiple posts and track migration progress in real-time.
4. **Post-Level Migration** — Quick-action "Migrate" link directly in the post list table.
5. **Real-time Progress** — Visual feedback during the migration process.

== Changelog ==

= 3.0.0 =
* Feature: Added Dashboard Disconnect and Unlock buttons for Sender and Receiver connections.
* Feature: Bi-Directional Migration Logs now active on both Sender and Receiver sites.
* Feature: Pre-flight Plugin Dependency Checks now seamlessly exchange active plugin data.
* Feature: Supported Plugin Checks for Advanced Custom Fields (ACF), Yoast SEO, Rank Math SEO, and AIOSEO.
* Enhancement: Added Sender/Receiver role tags to migration logs for better distinction.
* Enhancement: Dynamic Navigation automatically hides the Receiver Settings tab when connected as a Sender.
* Enhancement: Updated `content-events_section.php` logic to support separated start and end times for events.
* Enhancement: Detailed Migration Logs now feature a "View Details" dropdown with direct edit links.
* Enhancement: Advanced Notification System with a sleek Notification Bell in the sidebar and a global warning node in the WP Admin Bar.
* Enhancement: Dynamic Warning Banner now displays total count and exact names of missing plugins.
* Enhancement: Moved the missing plugin warning banner into the main content area for maximum visibility.
* Fix: Taxonomy Hierarchy Syncing — Fixed an issue where child terms were migrating without their parents. Implemented ancestor tracing and a two-pass taxonomy builder to guarantee perfect hierarchy for all custom taxonomies.
* Fix: Auto-Sync Race Condition — Deferred auto-sync execution to the `shutdown` hook to ensure newly created categories are fully saved before the payload is sent.
* Fix: Duplicate Auto-Sync Issue (Gutenberg) resolved by implementing a 5-second `set_transient()` lock to prevent race conditions.
* Fix: Sidebar Layout Bugs and broken connection status blocks removed.
* Fix: Activation redirect to the settings page now only happens on single plugin activation; bulk activation stays on the Plugins page.

= 2.0.0 =
* Feature: Added granular migration options panel (toggle Author, Comments, ACF, Taxonomies, Excerpts, Custom Meta, Media Meta)
* Feature: Added Post Type filtering to control which content types are allowed to migrate
* Feature: Built-in support for migrating to/from Local environments (Disable SSL Verification option)
* Enhancement: Switched to wp_remote_get/post to bypass restrictive local URL blocking
* Enhancement: Major performance optimizations for media handling (smart deduplication of image parsing to prevent slow DB writes)
* Fix: Featured image migrating without Alt Text and Captions due to payload ordering bug
* Fix: Mismatch in default migration settings between UI and backend logic causing silent failures

= 1.0.0 =
* Initial merged release combining sender and receiver into one plugin
* Added bulk migration with progress bar
* Added 3-level ACF repeater support
* Added flexible content support
* Added relationship field remapping
* Added smart ACF field availability check on receiver
* Added Ultra Premium Light Admin UI with modal confirmations
* Added test connection and "Disconnect" features
* Added auto key generator for receiver auth
* Support for scheduled (future) posts and private content
* Full compatibility and media remapping for Elementor, Beaver Builder, and Gutenberg
* Added Opt-in Usage Tracking and Analytics
* Added Deactivation Feedback Modal with secure API integration

== Upgrade Notice ==

= 3.0.0 =
Major UI and logging enhancements. Improved disconnected button locations, bi-directional logging, and better navigation handling for Sender connections. Includes critical fixes for taxonomy hierarchy syncing and auto-sync race conditions.

= 2.0.0 =
Major performance optimizations for media handling during migrations, and fixes for local environment connectivity.

= 1.0.0 =
Initial unified release. Combines Sender and Receiver functionality with full support for ACF repeaters, flexible content, and major page builders.
