=== Clonify – Page & Post Duplicator ===
Contributors:      devshujon
Tags:              duplicate post, clone post, copy page, duplicate page, content cloner
Requires at least: 5.9
Tested up to:      6.9
Requires PHP:      7.4
Stable tag:        2.0.0
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

One-click duplication for posts, pages, and custom post types. Smart naming, modern Dashboard, Gutenberg and Classic Editor support.

== Description ==

Clonify gives you a fast, modern way to duplicate any WordPress content — posts, pages, or custom post types — with a single click.

= Features =

* One-click Duplicate link in post list row actions
* Classic Editor Publish metabox button
* Block Editor (Gutenberg) sidebar button
* Copies title, content, excerpt, featured image, all taxonomies, and post meta
* Prefix and suffix naming with live preview
* Default status — Draft, Published, Private, or Pending Review
* Redirect control — edit screen or post list after duplication
* Admin bar duplicate shortcut (optional)
* Per post-type enable/disable
* Dashboard with stats, quick actions, and settings summary
* Tabbed Settings page — General, Post Types, Display, Naming
* Tools page — system info and stat reset
* Toast success notifications and loading feedback
* Elementor CSS auto-regeneration for duplicated posts
* ACF field group auto-exclusion (prevents data corruption)
* Serialized PHP object injection protection
* 10+ developer action and filter hooks

= Developer Hooks =

**Actions:**
`do_action( 'clonify_after_duplicate', $new_post_id, $original_post_id );`
`do_action( 'clonify_after_copy_taxonomies', $new_post_id, $original_post_id );`
`do_action( 'clonify_after_copy_meta', $new_post_id, $original_post_id );`

**Filters:**
`clonify_before_duplicate` — Modify original post before duplication.
`clonify_duplicate_title` — Override the duplicated post title.
`clonify_insert_post_args` — Modify full wp_insert_post() args.
`clonify_excluded_meta_keys` — Add/remove meta keys excluded from copying.
`clonify_copy_meta_value` — Filter individual meta values during copy.
`clonify_redirect_url` — Override the URL after duplication.
`clonify_supported_post_types` — Extend the supported post type list.

= Programmatic Usage =

`$new_id = Clonify_Duplicate::duplicate( $post_id );`

== Installation ==

1. Go to Plugins > Add New, search Clonify, Install and Activate.
2. Or upload the ZIP via Plugins > Add New > Upload Plugin.
3. Configure at Clonify > Settings.
4. Hover any post in the list and click Duplicate.

== Frequently Asked Questions ==

= Does it copy the featured image? =
Yes, automatically.

= Does it copy ACF custom fields? =
Yes — post meta including ACF field values is copied. ACF field group definitions are excluded to prevent data corruption.

= Does it work with Elementor? =
Yes. Elementor CSS is auto-regenerated for each duplicated post.

= Can I set a prefix or suffix on duplicated titles? =
Yes. Go to Clonify > Settings > Naming tab. Includes a live preview.

= Is it safe on production? =
Yes. Nonce verification, capability checks, sanitization, and serialized object injection protection are applied throughout.

= Does it work with WooCommerce? =
The free version supports the product post type. All meta and taxonomies are copied.

== Screenshots ==

1. Dashboard with stats cards and quick actions
2. Settings page — General tab
3. Settings page — Naming tab with live preview
4. Settings page — Post Types with toggle switches
5. Row action Duplicate link in post list
6. Toast success notification

== Changelog ==

= 2.0.0 =
* NEW: Full Dashboard with stats cards and quick actions
* NEW: Tabbed Settings — General, Post Types, Display, Naming
* NEW: Tools page with system info and stat reset
* NEW: Prefix + suffix title naming with live preview
* NEW: Toast notifications and loading feedback
* NEW: Top-level admin menu (Dashboard, Settings, Tools)
* NEW: Duplication counter and last-duplicate tracking
* FIXED: PHP 7.4 compatibility (removed PHP 8.0 union types)
* FIXED: Deprecated current_time('timestamp') replaced with time()
* FIXED: Raw $_POST now properly wp_unslash'd before processing
* FIXED: intval() replaced with absint() per WP standards
* FIXED: wp_register_style false src replaced with wp_add_inline_style
* ADDED: uninstall.php for clean database removal
* All v1.x security and compatibility fixes included

= 1.1.0 =
* Gutenberg and Classic Editor buttons
* Pending Review status option
* Elementor CSS regeneration
* ACF field group exclusion
* Serialized object injection protection

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 2.0.0 =
Major update. Adds Dashboard, tabbed settings, Tools page, and naming preview. Includes PHP 7.4 compatibility fixes. Upgrade recommended.

== License ==

This plugin is free software released under the GNU General Public License v2 or later.
https://www.gnu.org/licenses/gpl-2.0.html
