=== ideo Field Porter ===
Contributors:      jellob77
Tags:              acf, import, export, excel, custom post type
Requires at least: 6.2
Tested up to:      7.0
Requires PHP:      7.2
Stable tag:        1.1.8
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Import and export any custom post type to/from Excel (.xlsx), CSV or XML — with full ACF field and taxonomy support. No extra libraries required.

== Description ==

https://youtu.be/9ZbRMFy7Kwo

**ideo Field Porter** lets you import and export WordPress posts (standard or custom post types) to and from spreadsheet files, with complete support for Advanced Custom Fields (ACF) and taxonomies.

**Export features:**

* Export any public post type to `.xlsx`, `.csv` or `.xml`
* Live, directly editable export preview — drag-and-drop column reordering, inline header renaming, per-column value separator, and zoom
* Supports all ACF field types: text, number, select, checkbox, radio, button group, relationship, post object, repeater, group, image, file, gallery, taxonomy, user, date, true/false, link, flexible content…
* Taxonomies and featured images are included
* Native XLSX generation — no external library required

**Import features:**

* Import `.xlsx`, `.csv` or `.xml` files
* Drag-and-drop file upload with live preview
* Step-by-step column mapping UI with auto-match
* Save and reuse mapping profiles
* Undo last import in one click
* Duplicate detection by post title, with optional overwrite of existing posts
* Supports all ACF field types listed above
* Taxonomies and featured images resolved from the existing media library

**Technical highlights:**

* No spreadsheet libraries required — uses only PHP's built-in `ZipArchive` and `SimpleXML`
* No Composer, no npm
* One submenu per post type, automatically registered
* Full nonce and capability checks on every action — Administrators can grant Export/Import access to other roles (Editor, Author, or any custom role) from Settings → Access
* Bilingual: English and French

= Need more? =

For nested ACF structures (Repeaters inside Groups, Flexible Content, etc.), multi-sheet export by taxonomy or ACF choice field, an import test run, log export to CSV, custom Excel header colours, and a dark mode, check out **[ideo Field Porter PRO](https://checkout.freemius.com/plugin/34453/plan/56696/)**.

== Installation ==

1. Upload the `ideo-field-porter` folder to `/wp-content/plugins/`.
2. Activate the plugin from **Plugins → Installed Plugins**.
3. A **ideo Field Porter** submenu will appear under each active post type in the WordPress admin (see **Settings → ideo Field Porter** to choose which post types are enabled).
4. ACF is not required for basic title/taxonomy/featured image export-import, but is needed for custom field support.

== Frequently Asked Questions ==

= Does this plugin require Advanced Custom Fields? =

No. The plugin works without ACF for standard fields (title, taxonomies, featured image). ACF fields are detected automatically when ACF is active.

= Does it require ACF Pro or does ACF Free work? =

Both ACF Free and ACF Pro are supported.

= Does it use any external service or send data anywhere? =

All spreadsheet processing (export/import) is done locally on your server — no post content or field data is ever sent anywhere.

The plugin uses the Freemius SDK for license management, plugin updates, and optional usage analytics. On first activation, you're shown a clear opt-in screen — declining has no effect on the plugin's functionality. If you opt in, basic environment data (WordPress/PHP versions, active plugins, site URL) is shared with Freemius to help improve compatibility. See [Freemius's privacy policy](https://freemius.com/privacy/) for details.

= What PHP extensions are required? =

`ZipArchive` (for `.xlsx` files) and `SimpleXML` (for `.xml` files). Both are included by default in all standard PHP installations. The plugin checks for these on activation and displays an admin notice if they are missing.

= Can I import images? =

Yes, for featured images and ACF image/file/gallery fields. The image must already exist in your WordPress media library. The import resolves URLs or relative paths to the correct attachment ID.

= What happens if a post with the same title already exists? =

Before the import runs, a dialog lists any spreadsheet rows that match an existing post by title. You choose right there — replace all of them, replace only the ones you check, or ignore them and skip those rows. It's a per-import choice, not a Settings toggle.

= Can I undo an import? =

Yes. Immediately after an import, an **Undo import** button lets you permanently delete all posts created during that import session.

= Does this handle nested ACF structures (Repeater inside Group, etc.)? =

The free version exports and imports using a flat, one-row-per-post structure: Group fields are serialised into a single cell (one line per sub-field), while Repeater fields use one column per row/iteration. Full Hierarchical mode (structured multi-level spreadsheets) is available in ideo Field Porter PRO.

= What happens if I later install ideo Field Porter PRO? =

PRO automatically switches this free version off and keeps all your existing settings (active post types, import behaviour, media URL format, mapping profiles) — no need to deactivate anything yourself first.

= Can other user roles access the plugin? =

By default, only Administrators can use ideo Field Porter. From **Settings → Access**, an Administrator can grant Export/Import access to other roles too — built-in ones like Editor or Author, or any custom role registered by another plugin or theme on your site. The Access section itself (and the "Restore default settings" button) stays visible only to Administrators, so granting access to a role never lets that role decide who else gets it.

= Does this work with large sites? =

Yes. Export has been tested successfully with 30,000 posts under a 256MB PHP memory limit (about 24 seconds) — posts are fetched and processed in bounded batches instead of loading the whole post type into memory at once. Import of the same 30,000 rows also completed successfully (about 6 minutes, using only 142MB of that 256MB limit) — each row creates a real WordPress post, so time rather than memory is the limiting factor there.

== Screenshots ==

1. Export — the live preview table: drag columns to reorder, click a header to rename, and see every field (including multi-value ones) exactly as it will export.
2. Export result — the generated Excel file, opened: columns, colours and multi-entry fields intact.
3. Import — map each spreadsheet column to its WordPress/ACF destination field.

== Changelog ==

= 1.1.8 =
* Improved: dragging a column to reorder it in the Export preview now moves the whole column — header and rows together — instead of just the header.
* Fixed: a Repeater field's Export preview cell only showed its first entry — every entry now shows (numbered #1, #2… when there's more than one, matching the "Field #1", "Field #2"… columns the exported file itself has always had). Only the on-screen preview was affected.
* Hardened: an ACF True/False field explicitly set to "No" is now guaranteed to export as "0" rather than risk an empty cell.
* Improved: Settings → Access now shows each role's name on its own, with the technical slug and the "Administrator always has access" note moved to a hover tooltip instead of cluttering the list.

= 1.1.0 =
* Improved: the Export preview is now a live, directly editable table — drag-and-drop column reordering, inline header renaming, per-column separator, and zoom, replacing the old static preview modal.
* Improved: much faster imports on large files — duplicate-title detection now uses a single batched lookup instead of one database query per row.
* Fixed: exporting large post types no longer risks running out of memory — posts are now fetched and processed in bounded batches instead of all at once.
* Fixed: duplicate titles within the same import file no longer inflate the duplicate count.

= 1.0.16 =
* Added: quick "Account" link on the Settings page to manage your license.
* Improved: Settings page header layout — better alignment and spacing at every screen width, including correct behaviour alongside the WordPress admin sidebar (collapsed, expanded, or on mobile).
* Fixed: some notices could get visually trapped under the Settings page header, hiding their close button.
* Improved: Preview window now shows 5 rows instead of 3.
* Added: a demo video link to the plugin description.

= 1.0.0 =
* Initial release.
