# DB Sync for Microsoft Excel

DB Sync for Microsoft Excel is a WordPress admin tool for synchronising database tables with Excel spreadsheets. The plugin lets you import, export, back up and even live edit tables without leaving the dashboard. Every action is logged and a backup is created before data is changed.

## Features
- **Excel import** – Upload .xlsx files to update existing tables. A preview step lets you verify rows before committing.
- **Excel export** – Download one or more tables as Excel files bundled in a single ZIP archive.
- **Live editing** – Browse a table, edit cells directly in the browser and save or revert the changes.
- **Backups & restore** – Automatically back up tables before import and manually create, restore or delete backups at any time.
- **Action logging** – All operations are recorded for traceability.

## Requirements
- WordPress with PHP 7.4 or higher.
- Write permissions for the `wp-content/uploads/db-sync-for-excel` directory which holds temporary files and backups.

## Installation
1. Download the plugin as a ZIP file.
2. In the WordPress admin go to **Plugins → Add New → Upload Plugin** and select the ZIP file.
3. Install and activate the plugin.

Alternatively copy the unzipped folder into `wp-content/plugins/`.

## Usage

After activation a **DB Sync for Microsoft Excel** entry is available in the WordPress admin menu.

### Import from Excel
1. Open the **Import** tab.
2. Choose the target table and upload an `.xlsx` file.
3. Review the preview and confirm to apply the changes. A backup is created automatically.

### Export tables
1. Open the **Export** tab.
2. Select the tables you wish to download.
3. The plugin exports each table as Excel and bundles them into a ZIP archive.

### Live editing
1. Open the **Live Edit** tab.
2. Select a table to load its contents.
3. Edit cells inline and use the save dialog to persist or discard the changes.

### Backups & restore
- **Create backup:** In the **Backups** section choose a table to save its current state.
- **Restore:** Pick any existing backup and restore it.
- **Delete:** Remove backups you no longer need.

## License
This plugin is licensed under the [GPL-2.0-or-later](LICENSE).
