=== Copy Paste Ubermenu Settings ===
Contributors: abda53
Tags: ubermenu, menu, navigation, copy paste, admin
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds copy and paste controls for UberMenu menu item settings on the Appearance → Menus screen.

== Description ==

Copy Paste Ubermenu Settings helps you reuse UberMenu configuration across menu items without re-entering every field by hand.

On **Appearance → Menus**, each menu item gets compact Copy and Paste controls next to the UberMenu settings toggle. Copy stores that item’s UberMenu settings; Paste applies them to another item after confirmation.

**Requirements**

* WordPress 5.8 or later
* PHP 7.4 or later
* [UberMenu](https://sevenspark.com/docs/ubermenu-3) (third-party plugin) must be installed and active
* Access to the WordPress admin **Appearance → Menus** screen. This plugin adds admin-only copy/paste controls inside UberMenu on that screen. It does **not** work with directly in Full Site Editing (FSE) / block themes that manage navigation in the Site Editor instead of Appearance → Menus.

This plugin is an independent companion tool. It is not affiliated with or endorsed by UberMenu / SevenSpark. It does not change your theme, license, front-end menus, or block-based navigation—only the UberMenu settings UI in wp-admin. This plugin only adds Copy/Paste capabilities within the Ubermenu menu settings.

**Features**

* Copy UberMenu settings from a menu item
* Paste those settings onto another menu item (with confirmation)
* Same-site mode uses browser local storage (default)
* Optional cross-site mode uses the system clipboard so you can move settings between two WordPress sites
* Settings page under **Appearance → UM Copy/Paste**

**Cross-site mode**

Enable **Cross-site copy/paste** under Appearance → UM Copy/Paste on both sites. Copy writes JSON to the clipboard; Paste reads from the clipboard. Cross-site paste requires a secure context (HTTPS) and a browser that supports the Clipboard API.

== Installation ==

This plugin runs entirely in the WordPress admin. It extends UberMenu on the classic **Appearance → Menus** screen and is **not compatible with Full Site Editing (FSE) block themes**, which do not use that screen for navigation.

1. Upload the `ubermenu-copypaste-settings` folder to the `/wp-content/plugins/` directory, or install the zip via **Plugins → Add New → Upload Plugin**.
2. Activate the plugin through the **Plugins** screen.
3. Confirm UberMenu is installed and active, and that your site uses a classic theme with **Appearance → Menus** (not an FSE block theme using the Site Editor for menus).
4. Go to **Appearance → Menus** and use the copy/paste icons on menu items that have UberMenu settings.
5. Optionally enable cross-site mode under **Appearance → UM Copy/Paste**.

== Frequently Asked Questions ==

= Does this work without UberMenu? =

No. UberMenu must be active. Without it, the copy/paste controls are not loaded.

= Does this work with Full Site Editing (FSE) / block themes? =

No. This plugin only adds controls on the classic **Appearance → Menus** admin screen, inside UberMenu’s menu-item settings. FSE block themes use the Site Editor for navigation instead of that screen, so this plugin does not apply and will not help there. Use a classic theme (or a setup where UberMenu and Appearance → Menus are available in wp-admin).

= Where are copied settings stored? =

By default, in the browser’s local storage for the current site. With cross-site mode enabled, settings are copied to and pasted from the system clipboard only (not stored on the server).

= Is the settings form secure? =

Yes. The Appearance → UM Copy/Paste option uses the WordPress Settings API with capability checks (`manage_options`), nonces, and boolean sanitization. Menu copy/paste runs in the admin UI only for users who can edit menus; pasted data is validated before it is applied to fields.

= Can I paste malicious clipboard data? =

Pasted JSON is treated as untrusted. The plugin sanitizes keys/values, rejects unsafe media/edit URLs, and never injects clipboard strings as raw HTML.

== Screenshots ==

1. Copy and paste icons on a menu item in Appearance → Menus.
2. Cross-site option on Appearance → UM Copy/Paste.

== Changelog ==

= 1.0 =
* Initial public release for the WordPress plugin directory.
* Settings API option for cross-site clipboard mode.
* Hardened paste handling for untrusted clipboard / localStorage data.
* Internationalized admin UI strings (PHP and JS).

== Upgrade Notice ==

= 1.0 =
Initial release.
