=== Naqla Migrator & Sync for EasyOrders ===
Contributors: elalmy111
Donate link: https://ahmed-abdelhamed.com/naqla-for-easyorders
Tags: woocommerce, easyorders, migration, sync, arabic
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Migrate and live-sync your EasyOrders store to WooCommerce via API: Variable Products, Categories, HPOS Orders, WebP Images & SEO 301 Redirects — Arabic RTL ready.

== Description ==

**Move from EasyOrders to WooCommerce in minutes — without CSV headaches, broken Arabic encoding, missing variations, or lost Google rankings.**

**Naqla Migrator & Sync for EasyOrders** (**نقلة لإيزي أوردر**) connects directly to the official EasyOrders External Apps REST API using your merchant API Key to migrate your entire store into WooCommerce — and optionally keep stock, prices, and landing-page orders synchronized in real time.

Built specifically for Arab e-commerce merchants and WordPress agencies in **Egypt, Saudi Arabia, and MENA**, featuring a native **Arabic (RTL)** interface by default plus one-click switching to **English (LTR)**.

= المميزات الرئيسية (بالعربية) =

* **نقل مباشر عبر الـ API الرسمي لإيزي أوردر:** بدون تعديل ملفات Excel أو مشاكل ترميز الحروف العربية (`؟؟؟`) — فقط أدخل الـ API Key وابدأ النقل بضغطة زر.
* **نقل المنتجات البسيطة والمتغيرة (ألوان ومقاسات):** تحويل تلقائي للـ Variants والخصائص والأسعار والمخزون والـ SKU إلى منتجات متغيرة سليمة 100% في ووكومرس.
* **سحب الصور محلياً وتحويلها إلى WebP تلقائياً:** تحميل صور المنتجات والتصنيفات داخل مكتبة وسائط ووردبريس وتحويلها لـ WebP عشان متجرك يفضل سريع وصورك متختفيش لو قفلت إيزي أوردر.
* **نقل الطلبات السابقة وبيانات العملاء (متوافق مع HPOS):** نقل الطلبات بالتاريخ الأصلي وبيانات الشحن مع ربط ذكي للمحافظات المصرية وحالات الطلبات.
* **مزامنة حية ثنائية الاتجاه + استقبال Webhook فوري:** استمر في استخدام صفحات هبوط EasyOrders السريعة مع مزامنة المخزون والأسعار ووصول الطلبات الجديدة لووكومرس خلال ثوانٍ.
* **حماية السيو بتحويلات 301 تلقائية:** توليد تحويلات 301 من روابط إيزي أوردر القديمة (`/products/...`) إلى روابط ووكومرس الجديدة مع إمكانية التصدير لـ Rank Math.
* **النقل التجريبي (Dry Run) + التراجع الآمن بضغطة زر (One-Click Rollback):** جرّب نقل أول 10 منتجات الأول، ولو حبيت تتراجع، زر واحد يمسح كل ما تم نقله وينظف قاعدة البيانات بالكامل.

= Key Features (English) =

* **Direct Official EasyOrders REST API Connector:** Paste your EasyOrders `Api-Key`, test live connectivity, and pull Categories, Products, Variations, and Orders automatically.
* **Timeout-Safe Chunked Batch Engine:** Processes large catalogs in small batches with live progress tracking and zero duplicate imports (re-runs safely update mapped entities).
* **Full Simple & Variable Product Mapping:** Preserves regular & sale prices, SKUs, stock quantities, attributes, variation images, Arabic slugs, and category hierarchies.
* **Local Media Sideloader + Automatic WebP Optimization:** Downloads and deduplicates remote images locally and converts them to lightweight WebP using WordPress `WP_Image_Editor`.
* **HPOS-Compatible Historical Orders & Egyptian Governorate Mapping:** Creates real WooCommerce orders preserving original dates, shipping fees, customer phone/address, and configurable EasyOrders -> WooCommerce status mapping.
* **Live Two-Way Sync & Real-Time Webhook Listener:** Scheduled WP-Cron sync (15 min / 30 min / hourly / daily), optional outbound stock push to EasyOrders when WooCommerce sells, and a secret-protected REST endpoint (`/wp-json/naqla-eo/v1/webhook`) for instant order intake.
* **Built-in SEO 301 Redirect Manager:** Auto-registers 301 redirects for every migrated product/category with hit tracking and CSV export for **Rank Math**, **Yoast**, and **Redirection**.
* **Dry Run & One-Click Safe Batch Rollback:** Test with 10 products first and roll back any batch (products, variations, categories, orders, downloaded images, and redirects) cleanly.
* **WP-CLI Automation:** Run `wp naqla-eo test`, `wp naqla-eo migrate --type=products`, `wp naqla-eo sync`, and `wp naqla-eo rollback <id>`.

= Documentation, Support & Author =

Developed and maintained by **[Ahmed Abdelhamed](https://ahmed-abdelhamed.com/)** (**أحمد عبدالحميد**), specializing in WordPress engineering, WooCommerce automation, and Arabic e-commerce solutions.

* Official Plugin Page & Arabic Video Guide: [Naqla for EasyOrders Documentation](https://ahmed-abdelhamed.com/naqla-for-easyorders)
* Developer Website: [ahmed-abdelhamed.com](https://ahmed-abdelhamed.com/)

== External Services ==

This plugin connects directly to the **EasyOrders External Apps REST API** (`https://api.easy-orders.net/api/v1/external-apps/`) **only** when you explicitly enter your EasyOrders API Key and trigger a connection test, migration, or live sync:

* **What data is sent/fetched:** Your `Api-Key` header is sent to authenticate read requests for your store's categories, products, variations, and orders (and optional stock quantity updates if Two-Way Stock Push is enabled). Remote product image URLs returned by EasyOrders are downloaded directly to your WordPress Media Library.
* **No intermediary servers:** Naqla never sends your API Key, store data, or customer data to any third-party cloud server.
* **Service Provider:** EasyOrders ([easy-orders.net](https://www.easy-orders.net/) | [Terms & Privacy](https://www.easy-orders.net/terms)).

== Installation ==

1. Ensure **WooCommerce 8.0+** is installed and activated.
2. Upload the `naqla-for-easyorders` folder to `/wp-content/plugins/` or install via **Plugins -> Add New -> Upload Plugin**.
3. Activate **Naqla Migrator & Sync for EasyOrders** through the **Plugins** menu.
4. Open **نقلة لإيزي أوردر (Naqla EasyOrders)** from your WordPress Admin sidebar.
5. Paste your EasyOrders API Key and click **Save & Test Connection**.
6. Go to **معالج النقل (Migration Wizard)**, test with **Dry Run (10 items)**, then run the full migration.

== Frequently Asked Questions ==

= هل الإضافة مجانية بالكامل؟ =

نعم، الإضافة مجانية 100% ومفتوحة المصدر (GPLv2) وتعمل مباشرة داخل موقعك بدون أي سيرفرات وسيطة أو قيود على عدد المنتجات.

= هل تنقل الإضافة المنتجات المتغيرة (الألوان والمقاسات)؟ =

نعم، تقوم الإضافة بقراءة كافة خيارات الـ Variants من EasyOrders وبناء خصائص ومتغيرات ووكومرس (WC_Product_Variable) تلقائياً بأسعارها ومخزونها وصورها.

= ماذا يحدث للصور لو أغلقت حسابي على إيزي أوردر بعد النقل؟ =

تقوم الإضافة بسحب كافة الصور وحفظها محلياً داخل مكتبة وسائط ووردبريس مع تحويلها لصيغة WebP، وبالتالي لن تتأثر صور متجرك أبداً حتى بعد إغلاق حساب إيزي أوردر.

= هل تدعم الإضافة نظام WooCommerce HPOS؟ =

نعم، الإضافة متوافقة رسمياً مع **High-Performance Order Storage (HPOS)** و **Cart & Checkout Blocks**.

= هل يمكنني استمرار استخدام صفحات هبوط إيزي أوردر مع ووكومرس؟ =

نعم! من تبويب **المزامنة الحية والـ Webhook** يمكنك تفعيل المزامنة الدورية أو إضافة رابط الـ Webhook في إيزي أوردر لتصل كل الطلبات الجديدة تلقائياً إلى ووكومرس وتُحدّث كميات المخزون في الاتجاهين.

== Screenshots ==

1. لوحة التحكم وحالة الاتصال — ملخص المنتجات والمتغيرات والطلبات وروابط 301 وربط EasyOrders API بضغطة زر.
2. معالج النقل الذكي — اختيار نقل التصنيفات أو المنتجات المتغيرة أو الطلبات مع وضع التجربة (Dry Run) وشريط التقدم اللحظي.
3. المزامنة الحية والـ Webhook — مزامنة تلقائية للمخزون والأسعار والطلبات الجديدة + استقبال الطلبات الفوري عبر Webhook آمن.
4. تحويلات السيو 301 — جدول التحويلات التلقائية لحماية روابط جوجل والإعلانات مع إمكانية التصدير لـ Rank Math.
5. السجلات والتراجع الآمن — متابعة كافة دفعات النقل مع زر التراجع الآمن بضغطة زر (One-Click Rollback) وسجل العمليات.
6. الإعدادات والأدوات — تبديل اللغة (عربي RTL / إنجليزي LTR)، الوضع الداكن، ربط حالات الطلبات، وأوامر WP-CLI.

== Changelog ==

= 1.0.0 =
* الإصدار الأول الرسمي على WordPress.org.
* ربط مباشر مع EasyOrders External Apps REST API لنقل التصنيفات والمنتجات المتغيرة والطلبات (HPOS).
* سحب الصور محلياً مع تحويل تلقائي لصيغة WebP ومنع تكرار التحميل.
* محرك مزامنة حية ثنائية الاتجاه + مستقبل Webhook فوري (`/wp-json/naqla-eo/v1/webhook`).
* محرك تحويلات 301 مدمج لحماية السيو مع تصدير CSV لـ Rank Math.
* وضع النقل التجريبي (Dry Run) وميزة التراجع الآمن بضغطة زر (One-Click Rollback) وأوامر WP-CLI.

== Upgrade Notice ==

= 1.0.0 =
Initial stable release of Naqla Migrator & Sync for EasyOrders.
