=== PromioSync ===
Contributors: wjddesigns
Tags: promo, sync, franchise, coupon, marketing
Requires at least: 5.9
Tested up to: 7.1
Stable tag: 1.1.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sync promotional banners and coupons across your franchise network or multi-site setup with a visual drag-and-drop builder.

== Description ==

**Promio Sync** is a powerful WordPress plugin that connects parent and child sites for synchronized promo and coupon management. Perfect for franchise networks, multi-location businesses, and marketing agencies.

= Key Features =

* **Visual Drag & Drop Builder** – Create stunning promos with headings, text, buttons, icons, images, columns, and more
* **Real-Time Sync** – Push updates instantly to all connected child sites
* **Scheduling** – Start/end dates and recurring schedules with the Promio Sync Pro add-on
* **Child Site Overrides** – Let franchisees customize without losing parent updates
* **Responsive Layouts** – Works beautifully on desktop, tablet, and mobile
* **Override Reports** – See exactly what child sites have customized

= Perfect For =

* Franchise networks
* Multi-location businesses
* Marketing agencies managing multiple client sites
* Any WordPress network needing centralized promo control

= How It Works =

1. Install Promio Sync on your **parent site** (headquarters)
2. Create promos using the visual builder
3. Connect your **child sites** (franchise locations)
4. Promos sync automatically – updates push instantly!

= Free vs Pro =

**This plugin (free) includes:**

* Full visual promo builder
* All modules (headings, text, buttons, images, columns, etc.)
* 1 child site connection
* Manual promo activation

This plugin is complete on its own and never contacts a license server.

**Promio Sync Pro**, a separate add-on available from WJD Designs, adds:

* More child sites (5, 15, or unlimited)
* Advanced scheduling with start/end dates
* Recurring schedules (daily, weekly, monthly, seasonal)
* Priority support

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/promiosync` directory, or install the plugin through the WordPress plugins screen.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Navigate to Promio Sync in the admin menu.
4. Choose whether this is a Parent Site or Child Site.
5. For parent sites, create promos and generate API keys for child sites.
6. For child sites, enter the parent site URL and API key to connect.

== Frequently Asked Questions ==

= What is a parent site vs child site? =

The **parent site** is where you create and manage promos (usually your headquarters or main site). **Child sites** are the locations that receive and display the synced promos (franchise locations, regional sites, etc.).

= Can child sites customize promos? =

Yes! Child sites can override specific modules (like changing a phone number or address) while still receiving updates from the parent site for non-overridden content.

= How many child sites can I connect? =

The free plugin allows 1 child site. With the Promio Sync Pro add-on you can connect 5, 15, or unlimited child sites depending on your plan.

= Does it work with page builders? =

Promio Sync uses shortcodes to display promos, which work with any theme or page builder. You can place `[promio id="123"]` anywhere on your site.

= What happens if I disconnect a child site? =

The promos will remain on the child site but will no longer receive updates from the parent. You can reconnect at any time.

== Screenshots ==

1. Visual drag-and-drop promo builder
2. Parent site dashboard with connected child sites
3. Child site with synced promos and override options
4. Scheduling options with recurring dates
5. Override report showing child site customizations

== Changelog ==

= 1.1.0 =
* Change: Pro features (more child sites, scheduling, recurring schedules) now come from the separate Promio Sync Pro add-on. This plugin no longer contains a license screen, license checks or an updater of its own, and makes no calls to wjddesigns.com.
* Change: without the add-on, parent sites see a short note about scheduling in the promo editor. Existing schedules, and schedules child sites receive from their parent, keep working.
* Dev: new filters and actions for add-ons: promiosync_pro_active, promiosync_tier, promiosync_tier_name, promiosync_child_site_limit, promiosync_has_feature, promiosync_plan_info, promiosync_upgrade_url, promiosync_loaded, promiosync_admin_menu, promiosync_register_schedule_meta_box, promiosync_save_promo.

= 1.0.1 =
* Security: promo content received over the sync channel is now fully sanitized before it is stored
* Security: raw HTML in the Tracking Code field and HTML module is now restricted to users with the `unfiltered_html` capability
* Security: parent and child site URLs are validated against private and link-local address ranges before any server-side request
* Security: API keys and secrets are no longer returned by the connections REST endpoints
* Security: synced webhooks now enforce a timestamp window and reject replayed requests
* Security: disconnected connections can no longer authenticate
* Security: rate limiting now counts failed authentication attempts and adds a per-address limit
* Security: escaped all dynamic values in the promo builder and override report admin screens
* Fix: promo reordering is now scoped to promo posts the current user can edit
* Fix: heading module no longer emits a PHP warning when no tag is set
* Fix: malformed sync payloads return a clear error instead of a fatal
* Fix: child-site polling and failed-push retries now actually run on schedule
* Fix: schedules entered in the promo editor are saved, and synced schedules keep the correct time on child sites
* Fix: child-site module overrides are no longer lost when a promo is saved
* Fix: "Regenerate API key" now rotates the stored key
* Fix: [promio_promos] sliders, grids and stacks render builder layouts
* Fix: PHP 8 fatal error when a columns module has an empty gap value

= 1.0.0 =
* Initial release
* Visual drag-and-drop promo builder
* Parent/child site sync
* Module override system
* Scheduling with recurrence
* Multiple display layouts (single, slider, grid, stack)
* Override reports

== Upgrade Notice ==

= 1.1.0 =
Pro licenses now live in the separate Promio Sync Pro add-on. If you have a Pro license, install the add-on (1.1.0) after updating; your key and schedules are kept.

= 1.0.1 =
Recommended security update. Hardens the parent-to-child sync path and the promo builder. All sites should update.

= 1.0.0 =
Initial release of Promio Sync.

