=== Norvis Backup ===
Contributors: norvisgabriel
Tags: backup, database backup, restore, migration, scheduled backup
Requires at least: 5.5
Tested up to: 7.0
Requires PHP: 7.2
Stable tag: 1.1.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Complete WordPress backup solution with database export, file compression, scheduled backups, and one-click restore.

== Description ==

Norvis Backup is a professional, self-hosted WordPress backup plugin that gives you full control over your backups without relying on third-party services.

**Key Features:**

* **Full backup** — database + files compressed into a single ZIP with manifest
* **Database backup** — complete SQL dump using WordPress-native $wpdb
* **File backup** — wp-content, uploads, plugins, themes, or full WordPress root
* **Real-time progress** — live progress bar via AJAX polling during backup/restore
* **Chunked restore** — database is restored in small chunks to avoid server timeouts, even on shared hosting
* **Scheduled backups** — hourly, every 6h, every 12h, daily, weekly, or monthly
* **Import & restore** — upload an external .zip or .sql backup file and restore it
* **Activity log** — step-by-step log of every operation stored in a file and accessible from the dashboard
* **Email notifications** — get notified on backup success or failure
* **Auto-cleanup** — delete old backups by age or maximum count
* **Exclude paths** — exclude specific directories from file backups

**Why Norvis Backup?**

Unlike other backup plugins, Norvis Backup writes the database dump row-by-row using `fopen()` + `fwrite()`, which means it never loads the entire database into PHP memory. This makes it work reliably even on shared hosting with low memory limits (64–128 MB).

The restore process uses a chunked approach — each AJAX call processes about 18 seconds of work, saves its position, and the browser automatically calls the next chunk. This prevents timeouts on shared hosting that limits PHP execution to 30-60 seconds per request.

**Support:** For questions, bug reports, or feature requests, please use the plugin support forum on WordPress.org.

== Installation ==

1. Download the plugin ZIP file
2. In your WordPress admin, go to **Plugins → Add New → Upload Plugin**
3. Upload the ZIP and click **Install Now**
4. Click **Activate Plugin**
5. Navigate to **Norvis Backup** in the admin menu

== Frequently Asked Questions ==

= Does it work on shared hosting? =

Yes. Norvis Backup was designed specifically for shared hosting environments. The chunked database restore avoids the timeouts that affect most other backup plugins.

= Where are backups stored? =

Backups are saved in `wp-content/uploads/norvis-backup/`. The directory is protected with an `.htaccess` file that prevents directory listing.

= What PHP version is required? =

PHP 7.2 or higher. The plugin also works with PHP 8.x.

= Does it require ZipArchive? =

No. If ZipArchive is not available on your server (common on some shared hosts), the plugin automatically falls back to PclZip, which is bundled with every WordPress installation.

= Can I restore a backup from a different site? =

Yes. Upload the `.zip` or `.sql` file using the **Import** feature on the Restore page.

== Screenshots ==

1. Dashboard with site stats and quick actions
2. Backup creation with type and scope selector
3. Backups list with download and restore buttons
4. Chunked restore with live progress bar
5. Automatic scheduling configuration
6. Step-by-step activity log

== Changelog ==

= 1.0.0 =
* Initial release
* Full database export using $wpdb (row-by-row, memory-safe)
* File backup using ZipArchive with PclZip fallback
* Chunked database restore (18s per chunk, resumable)
* Real-time progress polling via AJAX
* Scheduled backups via WP-Cron
* Activity log written to file and displayed in admin panel
* Import via wp_handle_sideload (WordPress-native file handling)
* Email notifications on backup success or failure
* Auto-cleanup by age and count

== Upgrade Notice ==

= 1.0.0 =
Initial release.
