=== WXD Backup Lite ===
Contributors: wxdlabs
Tags: backup, restore, migration, database backup, scheduler
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Reliable WordPress backup, restore, and migration workflows for agencies, freelancers, and serious site owners.

== Description ==

Most WordPress backup tools either feel too fragile when you actually need them, or too bloated with upsells and clutter. **WXD Backup Lite** is built around a narrower goal: reliable backups, safer restores, and cleaner migrations for real-world WordPress sites.

The focus is on **recovery confidence** and predictable workflows — not features for their own sake.

**Full-site backups. Guided restores. Clean migrations.**

WXD Backup Lite can create full-site or selective backups, schedule recurring jobs, enforce retention rules, lock important backups from deletion, and guide restores through a structured flow — including an automatic restore point created before every recovery attempt.

**WooCommerce-friendly:** Because WooCommerce stores everything in the WordPress database and filesystem, full-site backups automatically capture orders, products, customers, and store configuration. No extra setup required.

**What's included:**

* Full-site backup — database, plugins, themes, uploads, MU-plugins, and core files
* Selective backup scope for targeted jobs
* Portable .zip backup archives
* Daily, weekly, or manual backup scheduling
* Configurable retention with automatic cleanup of the oldest backups
* Backup locking to protect important archives from auto-deletion
* Guided one-click restore with scope selection, confirmation, and real-time progress
* Automatic restore point created before every restore
* Real-time restore event log and progress tracking
* Post-restore validation flow
* Site migration workflow with URL rewriting
* wp-config.php normalization after migration
* Import from an uploaded backup archive
* Dashboard with backup stats, storage forecast, and server health check
* Activity log with export support
* Concurrent restore lock and restore-safety protections
* Nonce and capability protection on all AJAX actions

**Note:** This plugin does not support WordPress Multisite. It is designed for single-site installs only.

**Privacy:** No data leaves your server. WXD Backup Lite makes no external API calls, does not phone home, and requires no account or license key. Backup archives are stored locally in the `wsbl-backups` subfolder of your WordPress uploads directory.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install directly from the WordPress plugin directory.
2. Activate the plugin through the WordPress admin.
3. Go to **WXD Backup** in the WordPress admin sidebar.
4. Create your first backup, or configure a schedule and retention policy.

No account, no API key, no external service required.

== Frequently Asked Questions ==

= Where are backups stored? =

Locally on your server in a protected `wsbl-backups` subfolder inside your WordPress uploads directory. The exact path depends on your `wp-content/uploads` configuration. Remote storage destinations (S3, Backblaze) are planned for the Pro tier.

= What does each backup contain? =

Each archive contains a SQL database dump, a JSON manifest file, key root config files when present, and the main WordPress content directories (plugins, themes, uploads, and optionally core files).

= Does this plugin support restore? =

Yes. You can restore a full backup or selectively restore supported backup components from the admin area. Every restore creates an automatic restore point first, so you can roll back immediately if something goes wrong.

= Does this plugin support migration? =

Yes. You can upload an archive, import it into local storage, and restore it. The migration workflow handles URL rewriting and wp-config.php normalization so the site comes up cleanly on the new host.

= Does it work with WooCommerce? =

Yes. Full-site backups capture WooCommerce orders, products, customers, and store configuration automatically — no separate plugin or configuration needed.

= Does it work with WordPress Multisite? =

No. This version does not support Multisite. Activating on a Multisite network will show an admin notice and the plugin will remain inactive. Multisite support is on the roadmap for a future release.

= What happens if a restore fails halfway? =

Every restore creates an automatic restore point first, and concurrent restores are blocked. If something fails mid-restore, you can immediately roll back to the pre-restore state.

= Does it require any special PHP extension? =

Yes. The PHP `ZipArchive` extension must be enabled on your server. The plugin's health check will flag this if it is missing.

= Does this plugin send data to external services? =

No. WXD Backup Lite operates entirely on your server and does not connect to any external service.

== Changelog ==

= 1.0.2 =
* Fixed: the backup lock/unlock icon was blank on the initial Backups table render and only appeared after the button was clicked. The SVG icon now renders correctly on first paint.
* Fixed: corrected several admin-area links (Upgrade to Pro, Docs, Support, More Products) that pointed to non-existent URLs.

= 1.0.1 =
* Restore reliability: post-commit hardening (.htaccess + wp-config) now runs in the same request that commits files, so cPanel/LiteSpeed handler directives baked into a backup .htaccess can no longer 500 the site mid-restore.
* Restore reliability: stale source-site jobs purged from the imported activity log; the completed restore is recorded as its own activity entry.
* Restore reliability: iThemes Security `itsec-*` options purged on restore, preventing Force-SSL redirect loops on the destination.
* Stop restore: clicking Stop early no longer leaves the modal hanging; the rollback now drives incrementally via the JS poll loop so the event log streams transitions instead of going silent.
* Stop restore: progress bar no longer snaps from 100% back to 0% after a successful rollback.
* Stop restore: starting a new restore from a wizard that still shows a previous "Stopped" terminal state now resets cleanly.
* Stop restore: event log no longer leaks a stale "Importing general database tables" entry below the "Stop requested by user" line.
* Rollback throughput: DB import bumped to 5,000 statements per tick during rollback, turning multi-hour rollbacks into minutes.
* Migrate wizard: removed the URL-mapping step (auto-detected from archive) and the PRO upsell placeholder.
* Migrate wizard: Stop Restore button moved into the wizard footer and now hides on terminal completion.
* Migrate wizard: progress bar now fills determinately during the restore phase.
* Migrate wizard: event log now matches the standalone Restore wizard density.
* Activity log: drag-and-drop file selection now enables the wizard's Next button (parity with Browse).
* Activity log: per-tick byte/percent sub-progress shown during long DB import buckets.
* Activity log: stopped+rolled-back restores now render with an amber "Stopped — rolled back" badge.
* Activity log: event log populates from both the standalone restore wizard and the migrate wizard's poll loop.
* Activity log: Retry Job for restore-type jobs now opens the regular Restore wizard instead of running silently in the background.
* Critical: fixed a rollback-empties-plugin-dir bug where a failed copy() during file-rollback would call cleanup_path() on the destination without a preserved fallback, deleting wp-content/plugins entirely.
* Localhost compatibility: optional shim for the WpOrg\Requests\IdnaEncoder autoloader works around a known Elementor + localhost subdirectory crash.
* Code quality: WordPress.org Plugin Check passes with zero errors and zero warnings.

= 1.0.0 =
* Initial release of WXD Backup Lite.
* Full-site and component-level WordPress backups with SQL database export.
* Restore workflow with automatic safety restore point and rollback on failure.
* Import and migration workflow with URL mapping and environment-aware hardening.
* Scheduled backups, retention policy, background job tracking, and archive verification.

== Upgrade Notice ==

= 1.0.2 =
Minor fixes: the backup lock icon now renders correctly on first load, and several admin links now point to valid URLs.

= 1.0.1 =
Reliability and UX hardening. Restore is more resilient on shared hosts; activity log no longer surfaces stale jobs as failures; progress feedback during long imports is more granular. Recommended for all 1.0.0 users.

= 1.0.0 =
Initial public release. Please take a test backup on a staging copy before running a restore or migration on a production site.
