=== Enterra Quick Clone ===
Tags: woocommerce, clone, duplicate, products, quick edit
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Author: Enterrahost
Author URI: https://enterrahost.com

Easily clone or clone & edit WooCommerce products or WordPress posts with one click.

== Description ==

Enterra Quick Clone adds two handy actions to your WooCommerce product and WordPress post lists:
- **Clone**: Instantly duplicates an item (sets status to Draft).
- **Clone & Edit**: Duplicates the item and takes you straight to the editor screen.

Perfect for quickly building out similar product listings or blog posts, speeding up your workflow, or setting up reusable templates.

**Features:**
- Duplicates title, content, excerpt, taxonomies, and all meta fields
- Duplicates featured image and gallery images
- Clears SKU (for products) to prevent conflicts
- Copies product variations for variable products
- Supports WordPress posts, pages, and public custom post types
- Lightweight, fast, and unobtrusive
- Localisation-ready

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/enterra-quick-clone` directory, or install it via the WordPress plugin screen.
2. Activate the plugin through the 'Plugins' menu.
3. Navigate to **Products > All Products**, **Posts > All Posts** or **Pages > All Pages** and hover over an item to see the **Clone** and **Clone & Edit** links.

== Frequently Asked Questions ==

= Does this copy images and custom fields? =
Yes. It duplicates the featured image, gallery images, and all post meta — including custom fields added by other plugins.

Some meta is deliberately not copied, because it belongs to the original item rather than to its content:
- WordPress's own bookkeeping (`_edit_lock`, `_edit_last`, `_wp_old_slug`, `_wp_old_date`)
- attachment file metadata that would make the copy claim the original's uploaded file
- sales and rating tallies (`total_sales`, `_wc_average_rating`, `_wc_review_count`), which would otherwise make a brand-new draft look like a bestseller
- flags other plugins set to mark a post as already imported or processed

A copy that carried those would look finished before anyone had looked at it. The list is filterable:

`apply_filters( 'enterra_quick_clone_skip_meta', $keys )`

= Does it copy the SKU? =
No. The SKU is **cleared** on every product copy, including each variation. A copied SKU would collide with the original, and WooCommerce refuses to save a product whose SKU is already taken — so the copy would be un-editable. Give the copy its own SKU when you are ready to publish it.

= Will this work with variable or grouped products? =
Variable products are supported: the copy keeps its `variable` product type, its attribute definitions, and all of its variations, each with its own cleared SKU.

Grouped products copy as a set of products but do not re-link their grouped children — link them from the Grouped product's settings.

= Can I bulk clone products or posts? =
Not yet.

= Does cloning use the block editor? =
Cloning works whether the item is edited in the block editor or the classic editor. Content is copied exactly, including block markup and any backslashes inside it.

= Can a clone fail? =
If copying an item fails partway, the plugin removes the partial copy rather than leaving a half-built draft behind, and tells you it failed.

== Screenshots ==

1. Clone and Clone & Edit links in the WooCommerce products.
2. Clone and Clone & Edit links in the WordPress Pages.
3. Clone and Clone & Edit links in the WordPress Posts.

== Support ==

For help or feature requests, please email [pluginsupport@enterrahost.com](mailto:pluginsupport@enterrahost.com).

You can also view the full usage guide here:
[Using Enterra Quick Clone for WordPress – Knowledgebase](https://portal.enterrahost.com/knowledgebase/17/Using-Enterra-Quick-Clone-for-Wordpress.html)

== Changelog ==

= 1.3.1 =
* Removed two custom field names belonging to an unrelated plugin from the list of fields a copy skips. Those two names should never have been in this plugin; no site needs them, and any site that does can add its own with the `enterra_quick_clone_skip_meta` filter.
* Corrected a code comment that gave the wrong reason for the order in which a copy's taxonomies and custom fields are written. The variable product fix in 1.3.0 is unchanged and unaffected.

= 1.3.0 =
* Fixed: backslashes were stripped from copied content. A copy of a page containing code, JSON or a Windows path was silently corrupted while the original stayed correct.
* Fixed: the SKU is now cleared on the copy, as this readme has always said. 1.2.0 appended "-Copy" instead, so a copy of a copy became "-Copy-Copy" and two copies of the same product collided on the same SKU.
* Fixed: variable products and their variations are now copied correctly, with the product type preserved. Before this release a variable product copied as a simple product with no variations.
* Fixed: serialised custom field data (including WooCommerce product attributes) is copied in the shape WooCommerce expects.
* Fixed: sales totals, rating tallies and other plugins' "already processed" flags are no longer copied, so a fresh copy no longer looks finished.
* Fixed: a copy that fails partway is now removed instead of leaving a half-built draft.
* Fixed: two copies of the same item no longer end up with the same slug.
* Improved: cloning now also requires permission to create posts of that type, not only permission to edit the original.
* Tested up to WordPress 7.1.

= 1.2.0 =
* General improvements and internal code enhancements.
* Improved support for cloning post types with custom meta and taxonomy structures.

= 1.1.0 =
* Added support for WordPress Posts — includes title, content, tags, meta, and featured image.

= 1.0.1 =
* Minor code cleanup and improved robustness.

= 1.0.0 =
* Initial release with clone and clone & edit functionality for WooCommerce products.

== Upgrade Notice ==

= 1.3.1 =
Optional. Removes two unrelated custom field names from the skip list and corrects a code comment.

= 1.3.0 =
Recommended update. Fixes corrupted content on copy, colliding SKUs, and variable products copying as simple products.

= 1.2.0 =
Recommended update with improved stability and expanded support for post types.

= 1.1.0 =
Recommended update — adds support for cloning WordPress Posts.

= 1.0.1 =
Maintenance release — no new features, but improved code stability.

= 1.0.0 =
Initial release — no upgrade needed.

== Credits ==
Developed by Enterrahost
