=== ThemePackager ===
Contributors: ansar317
Tags: theme, export, zip, backup, developer tools
Requires at least: 7.1
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

Export any installed WordPress theme (active or inactive) as a ZIP file directly from Appearance → Themes.

== Description ==

ThemePackager adds a simple, native-feeling "Export Themes" button to the Appearance → Themes screen, letting administrators download any installed theme as a ready-to-use ZIP archive without touching FTP, SSH, or a hosting file manager.

**Key Features**

* Export any single installed theme (active or inactive) as a ZIP file.
* Export the currently active theme with one click.
* Export all installed themes into a single `all-themes.zip` archive, with each theme in its own folder.
* Native WordPress admin modal listing every installed theme with screenshot, name, version, author, status, folder name, directory size, and last modified date.
* Instant search/filter across the theme list.
* Uses PHP's built-in `ZipArchive` class only — no external libraries, no Composer dependencies, no `shell_exec()`/`exec()`/`system()` calls.
* Streams the ZIP to the browser and automatically removes the temporary file afterward — nothing is left behind on your server.
* Administrator-only access, protected with WordPress nonces and strict path validation to prevent path traversal.
* Compatible with shared hosting, WordPress Multisite, and PHP 7.4 through 8.4.

This plugin does not modify, move, or delete your theme files. It only reads them in order to build a ZIP archive for download.

== Installation ==

**Automatic Installation**

1. In your WordPress admin, go to Plugins → Add New.
2. Search for "ThemePackager".
3. Click Install Now, then Activate.

**Manual Installation**

1. Download the plugin ZIP file.
2. In your WordPress admin, go to Plugins → Add New → Upload Plugin.
3. Choose the downloaded ZIP file and click Install Now.
4. Activate the plugin through the Plugins menu.

**FTP Installation**

1. Unzip the plugin package.
2. Upload the `themepackager` folder to the `/wp-content/plugins/` directory on your server.
3. Activate the plugin through the Plugins menu in WordPress.

After activation, go to **Appearance → Themes** and click the **Export Themes** button next to **Add New Theme**.

== Frequently Asked Questions ==

= Does this plugin modify or delete my theme files? =

No. ThemePackager only reads your theme files to build a ZIP archive. It never modifies, moves, or deletes any theme file.

= Can I export a theme that is not currently active? =

Yes. Every installed theme, active or inactive, appears in the Export Themes modal and can be exported individually.

= Does exporting "All Themes" include the active theme too? =

Yes. The "Export All Themes" option creates a single `all-themes.zip` archive containing every installed theme, each in its own top-level folder inside the ZIP.

= Where are the temporary ZIP files stored? =

ZIP files are generated temporarily inside `wp-content/uploads/themepackager-temp/`, streamed directly to your browser, and then automatically deleted from the server. No ZIP files are stored permanently.

= What happens if the ZipArchive PHP extension is not available? =

The plugin will display an admin notice explaining that the `ZipArchive` PHP extension is required and will not attempt to run without it. Most hosts, including shared hosting, have this extension enabled by default; contact your host if you see this notice.

= Who can use this plugin? =

Only users with the `manage_options` capability (typically Administrators) can see the Export Themes button or use any of its export functions.

= Does this plugin work on Multisite? =

Yes. ThemePackager is compatible with WordPress Multisite installations.

= Will this work on my shared hosting account? =

Yes. The plugin relies exclusively on PHP's native `ZipArchive` class and does not use `shell_exec()`, `exec()`, `system()`, or any external libraries, making it safe for shared hosting environments.

== Screenshots ==

1. The "Export Themes" button next to "Add New Theme" on the Appearance → Themes screen.
2. The Export Themes modal listing all installed themes with details and individual export buttons.
3. Search/filter in action within the Export Themes modal.

== Changelog ==

= 1.0.0 =
* Initial release.
* Export any single installed theme as a ZIP file.
* Export the active theme with one click.
* Export all installed themes into a single `all-themes.zip` archive.
* Native admin modal with search, screenshots, and theme metadata.
* Secure, nonce-protected, administrator-only AJAX export workflow.
* Temporary ZIP files are streamed and automatically deleted after download.

== Upgrade Notice ==

= 1.0.0 =
Initial release of ThemePackager.
