=== Futurecode XML Ürün Aktarım for WooCommerce ===
Contributors: futurecodetr
Tags: xml import, supplier, product import, stock sync, woocommerce
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Import and update WooCommerce products from your supplier's XML: field mapping, variations, stock and price sync, rules, schedule, safety brake.

== Description ==

**English**

Keep your shop in sync with your supplier's XML feed. Point the plugin at the supplier address (or upload the file), map the fields once, and it adds new products and keeps stock and prices up to date on a schedule, in small batches, with a log of every run and a safety brake that stops before touching your stock when the feed looks wrong.

* **Source:** the supplier XML from an address (optional HTTP Basic auth, password stored encrypted) or an uploaded file.
* **Automatic analysis:** the product node is detected, products are counted and every field is shown in a tree with sample values. A first mapping is proposed from the field names (Turkish and English names).
* **Streaming:** large files are read with XMLReader one product at a time; the file is never loaded into memory as a whole.
* **Field mapping** with drop-down lists or drag and drop: name, description, short description, SKU, barcode / GTIN, price, sale price, stock, category, brand and several images.
* **Variations:** nested variant nodes inside the product, or flat rows grouped by a main product code. Attributes such as colour and size, each variation with its own SKU, barcode, price, stock and image.
* **Update rules:** match products by SKU or barcode; full import or stock and price only; new products as drafts; products that left the XML: leave / stock 0 / draft (they come back automatically when they return).
* **Images** are downloaded once into the media library; an address that was downloaded before is never downloaded again.
* **Schedule:** WP-Cron starts the run (hourly, twice a day, daily or manual), Action Scheduler (bundled with WooCommerce) processes it in batches. "Run now" with a progress bar.
* **Run log:** added, updated, skipped and error counts of every run with a filterable list of products and messages.
* **Safety brake:** an empty or broken XML, a failed download or a product count that fell more than the percentage you set stops the run before anything changes. An admin warning is shown and an e-mail can be sent. "Run anyway" is one click when the drop is expected.
* **Dry run:** see what a run would add, update and set out of stock, without writing anything.
* **Price rules:** margin in percent or a fixed amount, rounding to ,90 / ,99 / whole numbers, a different margin per supplier category.
* **Category mapping:** supplier category → shop category, with automatic creation of missing ones (or a default category).
* **CSV** export, template and import for the field mapping and the category mapping; bulk actions; a toast with a spinner on every action.
* Declares HPOS (high-performance order storage) compatibility; the plugin works on products only.

The free plugin works with one supplier source. That is its scope, not a lock: nothing in it is limited by a licence.

**Coming soon (planned as a separate Pro plugin):** unlimited supplier sources, AI category matching and AI rewriting of product descriptions.

**Türkçe**

Mağazanızı tedarikçinizin XML'i ile güncel tutun. Tedarikçi adresini girin (ya da dosyayı yükleyin), alanları bir kez eşleyin; eklenti yeni ürünleri ekler, stok ve fiyatları zamanlanmış olarak, küçük parçalar halinde günceller. Her çalıştırma kayda geçer; XML'de bir sorun varsa güvenlik freni stoklara dokunmadan işlemi durdurur.

* **Kaynak:** tedarikçi XML'i adresten (isteğe bağlı Basic auth; parola şifreli saklanır) ya da dosya yükleyerek.
* **Otomatik çözümleme:** ürün düğümü bulunur, ürünler sayılır, tüm alanlar örnek değerleriyle bir ağaçta gösterilir. Alan adlarından (Türkçe ve İngilizce) ilk eşleme önerilir.
* **Akışla okuma:** büyük dosyalar XMLReader ile ürün ürün okunur; dosya hiçbir zaman belleğe bütün olarak yüklenmez.
* **Alan eşleme** açılır liste ya da sürükle-bırak ile: ad, açıklama, kısa açıklama, SKU, barkod / GTIN, fiyat, indirimli fiyat, stok, kategori, marka ve çoklu görsel.
* **Varyasyonlar:** ürünün içinde iç içe varyant düğümleri ya da ana ürün koduna göre gruplanan düz satırlar. Renk, beden gibi özellikler; her varyasyonun kendi SKU'su, barkodu, fiyatı, stoğu ve görseli.
* **Güncelleme kuralları:** SKU ya da barkodla eşleme; tam aktarım ya da yalnız stok + fiyat; yeni ürünleri taslak açma; XML'den çıkan ürünler için dokunma / stoğu 0 yap / taslağa al (geri geldiklerinde kendiliğinden düzelir).
* **Görseller** ortam kütüphanesine bir kez indirilir; daha önce indirilen adres tekrar indirilmez.
* **Zamanlama:** WP-Cron çalıştırmayı başlatır (saatlik, günde iki kez, günlük ya da elle), WooCommerce ile gelen Action Scheduler parça parça işler. İlerleme çubuklu "Şimdi çalıştır" düğmesi.
* **Çalıştırma kayıtları:** her çalıştırmanın eklenen, güncellenen, atlanan ve hata sayıları; ürün ürün süzülebilir ayrıntı listesi.
* **Güvenlik freni:** XML boşsa, bozuksa, indirilemiyorsa ya da ürün sayısı önceki çalıştırmaya göre belirlediğiniz yüzdeden fazla düştüyse işlem hiçbir şeyi değiştirmeden durur. Yöneticiye uyarı gösterilir, isterseniz e-posta gider. Düşüş beklenen bir durumsa "Yine de çalıştır" tek tıktır.
* **Kuru çalıştırma:** hiçbir şey yazmadan, bir çalıştırmanın neyi ekleyeceğini, güncelleyeceğini ve stoğunu sıfırlayacağını gösterir.
* **Fiyat kuralları:** yüzde ya da sabit tutar marj, ,90 / ,99 / tam sayıya yuvarlama, tedarikçi kategorisine göre ayrı marj.
* **Kategori eşleme:** tedarikçi kategorisi → mağaza kategorisi; olmayanları otomatik oluşturma (ya da varsayılan kategori).
* **CSV** ile alan eşlemesini ve kategori eşlemesini dışa aktarma, şablon ve içe aktarma; toplu işlemler; her eylemde dönen göstergeli bildirim.
* HPOS (yüksek performanslı sipariş tabloları) uyumluluğunu bildirir; eklenti yalnız ürünlerle çalışır.

Ücretsiz eklenti tek bir tedarikçi kaynağıyla çalışır. Bu bir kilit değil, eklentinin kapsamıdır; hiçbir özellik lisansla sınırlanmaz.

**Yakında (Pro sürüm, ayrı eklenti olarak planlanıyor):** sınırsız tedarikçi kaynağı, yapay zekâ ile kategori eşleme ve ürün açıklamalarını yapay zekâ ile yeniden yazma.

== External services ==

This plugin connects only to addresses you give it:

* **The supplier XML address** you enter on the *Source and mapping* screen. It is requested when you click *Test connection* or *Analyse*, and on every run (by you or by the schedule). If you enter a user name and password, they are sent to that address as an HTTP Basic auth header, and to no other address. The request carries a user agent with the plugin name and your site address; nothing else is sent.
* **The image addresses** found in that XML, when *Download images* is on. Each image address is requested once and the file is saved in your media library.

The plugin does not send your products, orders, customers or any other data anywhere, makes no other requests and has no tracking or statistics. The supplier and the hosts of the image addresses are chosen by you; their own terms and privacy policies apply.

**Türkçe:** Eklenti yalnız sizin girdiğiniz tedarikçi XML adresine (Test et, Çözümle ve her çalıştırmada; kullanıcı adı ve parola yalnız bu adrese Basic auth olarak gider) ve o XML'deki görsel adreslerine (görsel indirme açıksa, her adres bir kez) istek atar. Başka hiçbir yere veri göndermez, izleme ya da istatistik yoktur.

== Installation ==

1. Install and activate WooCommerce.
2. Upload and activate the plugin.
3. Open *XML import* in the admin menu. Enter the supplier XML address (and the user name and password if the supplier gave you one) or upload the file, then click *Analyse*.
4. Check the proposed mapping (drag fields from the tree or pick them from the lists), choose how variations come, and click *Save mapping*.
5. Set the update and price rules on *Rules* and the category mapping on *Categories*.
6. Make a *Dry run* on *Runs*, read the result, then click *Run now*. Choose an automatic update on *Rules* when you are happy.

**Türkçe:** WooCommerce'i kurun, eklentiyi etkinleştirin. Yönetim menüsündeki *XML aktarım* ekranında tedarikçi adresini girip *Çözümle*'ye tıklayın, önerilen eşlemeyi kontrol edip kaydedin. *Kurallar* ve *Kategoriler* sekmelerini ayarlayın, *Çalıştırmalar*'da önce *Kuru çalıştırma*, sonra *Şimdi çalıştır*.

== Frequently Asked Questions ==

= Tedarikçimin XML'i çok büyük, sunucu kaldırır mı? / My supplier's XML is huge. Will my server cope? =

Evet. XML akışla, ürün ürün okunur; ürünler varsayılan olarak 50'şer işlenir ve her parçadan sonra bellek boşaltılır. 10.000 ürünlük testte 6,5 MB'lık XML 0,6 saniyede okundu ve tüm aktarım boyunca PHP belleği 134 MB'ı geçmedi (WordPress ve WooCommerce dahil). Paylaşımlı sunucularda parça boyutunu düşürebilirsiniz. / Yes. The XML is streamed, products are processed in batches (50 by default) and memory is released after each batch. In a 10,000 product test the 6.5 MB XML was read in 0.6 s and PHP memory stayed under 134 MB for the whole import (WordPress and WooCommerce included).

= Güvenlik freni ne zaman devreye girer? / When does the safety brake stop a run? =

XML indirilemezse, boşsa, bozuksa ya da ürün sayısı son tamamlanan çalıştırmaya göre ayarladığınız yüzdeden (varsayılan %30) fazla düşerse. Bu durumda hiçbir ürün, stok ya da fiyat değişmez; yöneticiye uyarı gösterilir ve isterseniz e-posta gönderilir. / When the XML cannot be downloaded, is empty or broken, or the product count fell more than the set percentage (30 % by default). Nothing is changed.

= XML'den çıkan ürünlere ne olur? / What happens to products that leave the XML? =

*Kurallar* sekmesinde seçersiniz: dokunma, stoğu 0 yap ya da taslağa al. Yalnız bu eklentinin eklediği ya da eşlediği ürünler etkilenir; elle eklediğiniz diğer ürünlere dokunulmaz. Ürün XML'e geri dönerse stoğu güncellenir, taslaktaysa yeniden yayınlanır. / You choose on *Rules*. Only products added or matched by this plugin are affected.

= Görseller her seferinde yeniden mi indirilir? / Are images downloaded again on every run? =

Hayır. Her görsel adresi bir kez indirilir ve hatırlanır; aynı görseli kullanan başka ürünler de aynı dosyayı kullanır. Ürünün görsel listesi değişmediyse görsellere hiç bakılmaz. / No. Each image address is downloaded once.

= Varyasyonlu ürünler nasıl gelmeli? / How should variations look in the XML? =

İki yaygın yapı desteklenir: ürün düğümünün içinde varyant düğümleri (ör. `<Varyantlar><Varyant><Renk>…`) ya da her varyasyonun ayrı satır olduğu ve aynı ana ürün kodunu taşıdığı düz liste. Çözümleme ikisini de tanır ve öneri yapar. / Nested variant nodes, or flat rows sharing a main product code.

= Barkod nereye yazılır? / Where is the barcode stored? =

Geçerli bir GTIN ise WooCommerce'in kendi "GTIN, UPC, EAN veya ISBN" alanına; ayrıca eşleme için eklentinin kendi alanına. / In the WooCommerce GTIN field when it is a valid number, and in the plugin's own field for matching.

= Birden fazla tedarikçi bağlayabilir miyim? / Can I connect several suppliers? =

Ücretsiz eklenti tek bir tedarikçi kaynağıyla çalışacak şekilde tasarlandı. Sınırsız kaynak, yakında çıkacak Pro eklentide planlanıyor. / The free plugin is designed for one supplier source; unlimited sources are planned for the Pro plugin.

= Kaldırınca ne silinir? / What does uninstalling remove? =

Ayarlar, eşlemeler, çalıştırma kayıtları, zamanlanmış görevler, çalışma dosyaları ve eklentinin ürünlere eklediği iç alanlar. Aktarılan ürünler, kategoriler ve görseller mağazanızda kalır. / Settings, mappings, run logs, schedules, working files and the plugin's internal product fields. Imported products, categories and images stay.

== Screenshots ==

1. Source and field mapping: supplier address, field tree with sample values, mapping and variations. / Kaynak ve alan eşleme.
2. Runs: run now with progress, last run counts and the run log with details. / Çalıştırmalar ve kayıtlar.
3. Safety brake warning and dry run result. / Güvenlik freni ve kuru çalıştırma.
4. Update rules, price rules, schedule and safety brake settings. / Kurallar.
5. Supplier category → shop category mapping with margins and bulk actions. / Kategori eşleme.
6. Mobile view (390 px). / Mobil görünüm.

== Changelog ==

= 1.0.0 =
* First release: supplier XML from an address (Basic auth) or a file, streaming analysis with field tree, mapping by list or drag and drop, nested and grouped variations, SKU / barcode matching, full and stock + price modes, draft for new products, actions for products that left the XML, one-time image download, price and category rules, scheduled batch runs on WP-Cron + Action Scheduler, run log, dry run, safety brake with e-mail, CSV import / export / templates, HPOS compatibility.
