=== Database Backup Manager ===
Contributors: jigarkahar
Tags: database, backup, export, sql, zip, scheduled backup
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A secure, lightweight WordPress database backup manager with full or selective table backups, SQL/ZIP export, backup history, and scheduled backups.

== Description ==

**Database Backup Manager** is a professional WordPress plugin that gives administrators full control over database backups — all from the comfort of the WordPress admin panel.

= Core Features =

* **Dashboard** — at-a-glance database statistics: total tables, database size, last backup date and type.
* **Full Database Backup** — export your entire database as SQL or ZIP with a single click.
* **Selected Tables Backup** — check individual tables from a searchable, sortable list and export only what you need.
* **SQL & ZIP Export** — choose between a plain `.sql` file or a compressed `.zip` archive.
* **Backup History** — every backup is logged with filename, date, type, format and file size. Re-download or delete from the History screen.
* **Scheduled Backups** — use the built-in WordPress Cron integration to schedule automatic full backups: daily, weekly, or monthly.
* **Backup Retention** — automatically prune old backups to stay within a configurable limit.
* **Security first** — nonce verification, `manage_options` capability checks, input sanitisation, output escaping, and a protected backup directory on every request.

= Planned Features (v2.1+) =

* Cloud storage integration (Google Drive, Dropbox, OneDrive)
* One-click restore from SQL or ZIP backup
* Email notifications for successful / failed backups

== Installation ==

1. Upload the `database-backup-manager` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **DB Backup** in the admin sidebar.

== Frequently Asked Questions ==

= Where are backup files stored? =
Backups are stored in `wp-content/plugins/database-backup-manager/backups/`. The folder is protected by `.htaccess` and a blank `index.php` to prevent direct web access.

= Can I change the backup format? =
Yes — from **DB Backup → Settings** you can set the default format to SQL or ZIP. You can also override the format per backup from the Dashboard.

= How do scheduled backups work? =
The plugin uses the WordPress Cron API (`wp-cron`). Choose daily, weekly, or monthly from Settings; the next scheduled run time is displayed automatically.

= Will this work on large databases? =
The plugin processes tables one at a time, which works well for typical WordPress databases. For very large databases (hundreds of MB) consider increasing PHP `memory_limit` and `max_execution_time`.

== Changelog ==

= 2.0 =
* Complete rewrite with modular OOP architecture.
* Added dashboard with statistics cards.
* Added selected-tables backup with searchable/sortable table list.
* Added ZIP export format via ZipArchive.
* Added backup history with download & delete actions.
* Added scheduled backups (daily / weekly / monthly) via WP Cron.
* Added settings page: default format, retention limit, schedule.
* Enforced nonce verification, capability checks, and sanitisation throughout.
* Protected backup directory with .htaccess and index.php.

= 1.0 =
* Initial release — basic full SQL backup download.

== Upgrade Notice ==

= 2.0 =
Major update: completely rebuilt. Please deactivate and reactivate the plugin after upgrading to create the new history database table.
