=== RollCraft – Layout Snapshots & Rollback for Elementor ===
Contributors: glistersoft, freemius
Donate link: https://glistersoft.com
Tags: elementor, rollback, versioning, backup, revisions
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Git-style layout versioning for Elementor. Roll back page builder changes without restoring the entire database.

== Description ==

**RollCraft** is a lightweight, surgical versioning and safety tool for WordPress sites using Elementor. Unlike full database backups, RollCraft only tracks layout data — leaving your WooCommerce orders, customer data, and plugin settings completely untouched.

= How It Works =

1. **Automatic Capture** — Every time you save a page in Elementor (or via Ctrl+S / auto-save), RollCraft silently captures a compressed snapshot of the layout.
2. **Instant Rollback** — Open the "🔄 RollCraft" section in Elementor's Page Settings panel or the central Dashboard, select any previous version, and click Rollback.
3. **WooCommerce Safe** — Only layout data (`post_content` and Elementor meta) is affected. Your orders, products, and customers are never touched.

= Free Features =

* 🔄 **Automatic Snapshots** — Captured before every Elementor save with configurable or unlimited retention
* ⚡ **One-Click Rollback** — Restore any previous layout from Elementor Page Settings or the Dashboard
* 📦 **Max Compression** — Snapshots are gzcompressed (70-85% database space savings)
* 🔒 **Pin Snapshots** — Protect critical milestone snapshots permanently from auto-pruning with no limits
* 🎨 **Native Elementor UI** — Integrated directly into Elementor Page Settings panel with live sync
* 📊 **Admin Dashboard** — Centralized snapshot management with stats, table view, and bulk actions
* 👥 **Role & Capability Controls** — Configure rollback and deletion permissions for Administrators and Editors
* 🛡️ **WooCommerce Isolation** — Only affects Elementor layout keys (`post_content` & `_elementor_*`)
* 📖 **Built-in Access Tutorial** — Step-by-step visual tutorial guide available in WP Admin

= Pro Features =

* 🎚️ **Visual Diff & Before/After Slider** — Compare historical snapshots with live layout using an interactive slider
* ↔️ **Side-by-Side Comparison** — Synchronized dual-pane view of live page vs snapshot version
* 🛡️ **Pre-Update Safety Shield** — Automatically takes pinned safety snapshots before Elementor or WordPress core updates
* ⏰ **Scheduled Background Snapshots** — Recurring automated captures via WP-Cron (Daily, Twice Daily, Weekly)
* 📦 **Snapshot Export & Import** — Export snapshots to portable JSON files and migrate layouts across different sites or staging
* 💻 **WP-CLI Command Suite** — Command-line management (`wp rollcraft list/rollback/protect/delete/prune/export`)
* 🔌 **REST API v1 Endpoints** — Headless API endpoints under `/wp-json/rollcraft/v1/`
* 📧 **Priority Support** — Direct email assistance from core developers

== Installation ==

1. Upload the `RollCraft` folder to `/wp-content/plugins/` directory, or install directly through WordPress: **Plugins → Add New → Search "rollcraft"**.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Edit any Elementor page — snapshots will be captured automatically on save.
4. Click the gear icon (⚙️ Page Settings) in Elementor and open the **🔄 RollCraft** section to view and manage versions.

== Frequently Asked Questions ==

= Will this affect my WooCommerce data? =

No. RollCraft only touches Elementor layout data (`post_content` and `_elementor_*` meta keys). WooCommerce orders, products, customers, and settings are completely isolated.

= How much database space do snapshots use? =

Very little. All snapshot data is compressed with `gzcompress()` at maximum compression (level 9). A typical Elementor page layout compresses by 70-85%, so each snapshot is only a few kilobytes.

= Can I use this with other page builders? =

Currently RollCraft supports Elementor only. Support for Beaver Builder, Bricks, and the WordPress Block Editor is planned for future releases.

= What happens when I delete the plugin? =

By default, all plugin data (custom tables and options) is removed when you delete the plugin. You can toggle "Keep data on uninstall" in the Settings page to preserve your snapshots.

= Is it compatible with WordPress Multisite? =

Yes. RollCraft creates separate tables per site using `$wpdb->prefix` and handles network activation correctly.

== Third-Party Services ==

This plugin optionally connects to Freemius to provide secure license key activation, automatic updates for Pro features, and optional anonymous diagnostic data collection (opt-in only).

* Service Provider: Freemius, Inc.
* Service Website: https://freemius.com
* Terms of Service: https://freemius.com/terms/
* Privacy Policy: https://freemius.com/privacy/

No sensitive personal data is sent without explicit user opt-in during plugin activation.

== Screenshots ==

1. Admin Dashboard — Overview of all snapshots across your site
2. Elementor Integration — RollCraft accordion inside Page Settings
3. Rollback in Action — One-click restore with confirmation
4. Pro Upgrade — Visual preview and unlimited history

== Changelog ==

= 1.0.0 =
* Initial release.
* Automatic layout snapshot capture on Elementor save (or Ctrl+S / auto-save).
* One-click rollback with Elementor CSS cache regeneration.
* Central Admin Dashboard with snapshot statistics, search, and bulk management.
* Pin/protect critical snapshots from auto-pruning.
* Visual Diff Slider & Side-by-Side comparison mode (Pro).
* Built-in visual tutorial guide in WP Admin.
* Export and Import layout snapshots with SHA-1 checksum integrity verification.
* Comprehensive Settings page for snapshot limits, allowed post types, and compression.
* REST API v1 endpoints (`/wp-json/rollcraft/v1/`) and WP-CLI command suite (Pro).
* Multisite network activation support.
* Clean uninstall with database table removal and data retention toggle.

== Upgrade Notice ==

= 1.0.0 =
Initial release of RollCraft. Install to start capturing layout snapshots automatically.
