=== Export Import For WooCommerce ===
Contributors: fahadmahmood, invoicepress
Donate link: https://www.paypal.me/fahadmahmood
Tags: woocommerce, export, import, orders export, hpos
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.0
Requires Plugins: woocommerce
WC requires at least: 6.0
WC tested up to: 10.3
Stable tag: 1.3.0

Export and import WooCommerce products, orders, pages and posts as an encoded string, a downloadable file or an Excel sheet.

== Description ==

**Export Import For WooCommerce** helps you move or back up WooCommerce content quickly, without a bloated interface.

* Choose a post type (product, shop_order, page, post or any custom post type) and a post status (published, draft, private, pending and more).
* Export everything, or only specific IDs.
* Export as an **encoded string** (copy/paste) or as a **file**, and import it again on another site in either form.
* Posts, post meta and taxonomy terms travel together; items that already exist are skipped, so imports are safe to repeat.
* Export WooCommerce **orders to Excel (.xlsx)** with selectable columns, order meta keys, ACF fields and line items.
* Add custom meta-key filters to the WooCommerce orders list.
* Compatible with **HPOS** (High-Performance Order Storage) and the classic post-based order storage.
* Smart product import: matches existing products by **SKU**, re-links **variations** to their new parent product and remaps upsells, cross-sells and grouped children.

= Security first =
Since version 1.2.8 every action has capability checks and nonce verification to every action, stores export files in a protected, randomly named location and no longer unserializes arbitrary PHP objects during import.

= Links =
* Author: [Fahad Mahmood](https://www.androidbubbles.com/contact)
* Project: <http://androidbubble.com/blog/wordpress/plugins/export-import-for-wc>

== Screenshots ==

1. Export Options > select Post Types, Post Status and Export Type.
2. Export data as string.
3. Export data as file.
4. Import data as string or file.
5. Enable/Disable (Post Types)

== Frequently Asked Questions ==

= What kind of data can be exported using this plugin? =
This plugin can export post types with different statuses like product, page, post and shop_order.

= How to select post type to export with different statuses? =
From selection box select post type and then select post status. Select all posts or define specific IDs to export. In last choose export type string/file and click "Export".

= In which format data will be exported if I select "Export Type: File"? =
"Text File" creates an encoded .txt file that can be imported again. "CSV File" creates a spreadsheet-ready .csv for viewing and editing in Excel or Google Sheets; it cannot be imported back. Orders can additionally be exported as an .xlsx file.

= Who can use the export and import tools? =
Only users with the manage_woocommerce or manage_options capability, such as Administrators and Shop Managers.

= Where are export files stored? =
In wp-content/uploads/woie-temp/ with a random file name. Files older than one hour are removed automatically on the next export.

= Does it work with HPOS (High-Performance Order Storage)? =
Yes. Version 1.3.0 declares HPOS compatibility and exports orders through the WooCommerce order API, so it works with both HPOS and the legacy post storage.

= Are product images imported? =
No. Media files are not transferred. Featured and gallery image links are deliberately skipped, because the old attachment IDs would point to unrelated files on the new site. Re-attach images or use a media migration tool.

= How are duplicates handled? =
Posts with the same title, slug and type are skipped. Products with an SKU that already exists are skipped as well.


== Installation ==

From the WordPress plugin menu click on Add New and search for Export Import For WooCommerce

Instead of searching for a plugin you can directly upload the plugin zip file by clicking on Upload:

Use the browse button to select the plugin zip file that was downloaded, then click on Install Now. The plugin will be uploaded to your blog and installed. It can then be activated.

"Export Import WC" is available in left admin menu under WooCommerce. 




== Changelog ==
= 1.3.0 =
* New: "CSV File" export now works. It creates a spreadsheet-ready UTF-8 CSV with one column per taxonomy and per meta key, and protects against formula injection. (CSV is for viewing and editing; use String or Text File to re-import.)
* New: HPOS (custom order tables) compatibility declared; orders are now read with wc_get_orders() and the orders-list screen and meta filters work on both storage types. [25/10/2026]
* New: products are matched by SKU on import, variations are re-linked to their imported parent, and upsells, cross-sells and grouped children are remapped to the new IDs.
* New: imported products are refreshed through WooCommerce so prices, stock and lookup tables are correct straight away.
* New: translation template (languages/woo-ie.pot) and the text domain is loaded properly.
* Security: all SQL that used imported or stored values is now prepared (term, duplicate and meta-filter queries).
* Security: stale image and attachment IDs are no longer imported; guid and author are reset safely.
* Performance: export no longer loads every term and meta cache, queries post meta in chunks, and raises the memory and time limits for large stores.
* Fix: the orders export no longer sends file-download headers on an AJAX response and no longer pauses between rows.
* Fix: AJAX failures now show a clear message instead of failing silently in the admin screens.
* Tweak: scripts are cached by plugin version instead of a timestamp; dead debug code removed.
= 1.2.8 =
* Security: capability check (manage_woocommerce / manage_options) added to all AJAX export, import and settings actions. [25/10/2026]
* Security: nonces are now unslashed, sanitized and verified through one shared helper; failures return a proper JSON error with HTTP 403.
* Security: export files moved from the public plugin folder to a protected uploads/woie-temp folder with random names and automatic cleanup.
* Security: the orders Excel file now uses a non-guessable file name.
* Security: imported serialized meta no longer instantiates PHP objects; upload type and error checks added for file imports.
* Security: post IDs are cast to integers before being used in SQL; output escaping added for links and the tab parameter.
* Fix: imported content is slashed correctly, so quotes and backslashes in titles, content and meta survive intact.
* Fix: PHP notices on imports with missing meta or terms, and on exports with no matching posts.
* Fix: translatable plural strings now use sprintf() properly.
* New: uninstall now removes plugin options and temporary files.
* Tweak: plugin header now declares Requires Plugins: woocommerce, WooCommerce compatibility and a proper description.
* Tweak: readme tags, description, FAQ and requirements refreshed; tested up to WordPress 7.1.
= 1.2.7 =
* Maintenance release.
= 1.2.5 =
* Fix: WooCommerce orders list page, filters can be added from the settings page using the order meta keys checkboxes. [24/04/2024]
= 1.2.4 =
* Fix: WooCommerce orders list page filters. [18/04/2024]
= 1.2.3 =
* New: WooCommerce orders list page, filters can be added from the settings page using the order meta keys checkboxes. [26/01/2024]
= 1.2.2 =
* Shop order export feature with detailed csv selection of line_items. [22/01/2024]
= 1.2.1 =
* Shop order export feature with detailed csv selection of columns including ACF fields. [18/01/2024][Thanks to Nick Soti]
= 1.2.0 =
* Version updated for WordPress. [02/05/2023]
= 1.0 =
* Initial release of Export Import For WooCommerce.

== Upgrade Notice ==
= 1.3.0 =
Adds HPOS compatibility, SKU-aware product import with variation support, and more SQL hardening. Back up before importing into a live store. Media files are still not imported.
= 1.2.8 =
Important security update: adds permission checks to all export/import actions and moves export files out of the public plugin folder. Update recommended for all users. Old files in the plugin's /temp folder can be deleted.
= 1.2.5 =
Fix: WooCommerce orders list page filters.
