=== Astra Template Exporter ===
Contributors: brainstormforce
Tags: astra, export, child-theme, customizer, backup
Requires at least: 6.0
Tested up to: 6.9.4
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Export your Astra-powered WordPress site as an installable child theme package with content and settings.

== Description ==

**Astra Template Exporter** is a powerful WordPress plugin that allows you to export your entire Astra-powered website as a ready-to-install child theme package. Perfect for developers, agencies, and site owners who want to create reusable site templates or backup their complete site configuration.

= What Gets Exported? =

The plugin creates a comprehensive child theme package containing:

* **WordPress Content** - All posts, pages, custom post types, menus, and widgets exported in standard WXR format
* **Astra Settings** - Complete Customizer settings, theme mods, color palettes, and typography
* **Starter Template JSON** - Single file compatible with Starter Templates by Brainstorm Force plugin (REST API ready)
* **Child Theme Files** - Properly structured child theme with style.css, functions.php, and readme.txt
* **Screenshot** - Auto-generated theme screenshot
* **Installation Guide** - Detailed readme with export metadata and installation instructions
* **URL Replacement** - Automatic conversion of external URLs to theme-relative paths

= Key Features =

* **One-Click Export** - Generate complete site package with a single button click
* **Starter Templates Compatible** - Exports in format compatible with Starter Templates plugin (REST API ready)
* **Child Theme Ready** - Creates a valid Astra child theme structure
* **Standards Compliant** - Uses WordPress WXR format for content export
* **Smart URL Replacement** - Converts absolute URLs to theme-relative paths for portability
* **Fully Documented** - Includes installation instructions and metadata
* **Clean Interface** - Simple, intuitive admin UI as top-level menu
* **Safe & Secure** - Proper nonce verification and capability checks
* **Extensible** - Filters and actions for developers to customize export behavior

= Use Cases =

* **Site Templates** - Create reusable starter sites for clients
* **Backups** - Export complete site configuration for safekeeping
* **Migrations** - Move site design to new WordPress installations
* **Staging** - Create identical copies of production sites
* **Distribution** - Package sites for sale or distribution

= Requirements =

* WordPress 6.0 or higher
* PHP 7.4 or higher
* Astra theme (active as parent or current theme)
* ZipArchive PHP extension (usually enabled by default)

= Developer Friendly =

The plugin includes numerous filters and actions for customization:

* `astra_template_exporter_child_theme_name` - Filter child theme name
* `astra_template_exporter_wxr_args` - Filter WXR export arguments
* `astra_template_exporter_settings_data` - Filter Astra settings data
* `astra_template_exporter_style_css_content` - Filter child theme CSS
* `astra_template_exporter_functions_php_content` - Filter functions.php
* `astra_template_exporter_readme_content` - Filter readme.txt content

And many more!

= Support =

For documentation, support, and feature requests:

* [Astra Documentation](https://wpastra.com/docs/)
* [Support Forum](https://wpastra.com/support/)
* [GitHub Repository](https://github.com/brainstormforce/astra-template-exporter)

== Installation ==

= Automatic Installation =

1. Log in to your WordPress dashboard
2. Navigate to Plugins > Add New
3. Search for "Astra Template Exporter"
4. Click "Install Now" and then "Activate"

= Manual Installation =

1. Download the plugin ZIP file
2. Log in to your WordPress dashboard
3. Navigate to Plugins > Add New > Upload Plugin
4. Choose the downloaded ZIP file and click "Install Now"
5. Click "Activate Plugin"

= After Activation =

1. Ensure Astra theme is active
2. Navigate to Appearance > Sites Exporter (or find it in the admin menu)
3. Click "Generate Child Theme Package"
4. Download the generated ZIP file
5. The exported child theme is ready to install on any WordPress site!

== Frequently Asked Questions ==

= Does this work with any WordPress theme? =

No, this plugin is specifically designed for the Astra theme. It requires Astra to be installed and active. The exported package is an Astra child theme.

= What content gets exported? =

All WordPress content including posts, pages, custom post types, categories, tags, menus, widgets, and media attachments (as references in WXR format).

= Are media files included in the export? =

The WXR export includes references to media files with their URLs. The actual media files are not included in the ZIP. You can use WordPress's built-in media import to download them during import.

= Can I customize what gets exported? =

Yes! The plugin includes numerous filters that allow developers to customize the export process. See the "Developer Friendly" section in the description.

= How large can the export be? =

The plugin increases PHP time limit and memory limit during export (300 seconds, 512MB). Very large sites may require server configuration adjustments.

= Where are exports stored? =

Exports are temporarily stored in `wp-content/uploads/astra-exports/`. You can clean up old exports using the "Clean Up Old Exports" button in the admin interface.

= Is this compatible with Astra Pro? =

Yes! The plugin works with both free and pro versions of Astra. It will export all available settings from your Astra installation.

= Can I import the exported child theme on WordPress.com? =

WordPress.com has restrictions on custom theme installations. The exported child theme is designed for self-hosted WordPress installations.

= Does this export WooCommerce settings? =

The current version exports WooCommerce content (products, orders) via WXR, but WooCommerce-specific settings are not included. This is planned for v1.1.

= How do I install the exported child theme? =

1. Upload the ZIP to Appearance > Themes > Add New > Upload Theme
2. Activate the child theme
3. Use WordPress Importer to import starter-content/site-export.xml
4. Import Astra settings from starter-content/astra-settings.json (manual import or via Astra settings)

== Screenshots ==

1. Main export interface with site information and one-click export button
2. Export in progress with status indicator
3. Successful export with download link
4. Generated child theme file structure
5. Utilities panel for managing old exports

== Changelog ==

= 1.2.0 =
* New - Plugin compatibility with subdirectory WordPress installations (e.g. `example.com/blog/`).
* Fix - Export file download failing due to `.htaccess` rewrite interception.
* Fix - Large export file downloads freezing the browser tab.
* Fix - Path traversal protection on the download endpoint.
* Fix - Content-Disposition header injection protection.

= 1.0.2 =
* Fix - Fixed broken documentation links.

= 1.0.1 =
* Fix - Fixed license update notification issue.

= 1.0.0 - 2025-01-XX =
* Initial release
* Complete WordPress content export (WXR format)
* Astra Customizer settings export (JSON format)
* Child theme generation with proper structure
* Auto-generated readme and documentation
* Admin UI with progress tracking
* Export cleanup utilities
* Extensible filter and action hooks
* PHP 7.4+ and WordPress 6.0+ support

== Upgrade Notice ==

= 1.0.2 =
Fixed broken documentation links.

= 1.0.1 =
Fixed license update notification issue.

= 1.0.0 =
Initial release of Astra Template Exporter. Export your Astra site as a child theme package!

== Planned Features (v1.1+) ==

* WooCommerce settings export
* Selective content export (choose post types)
* Custom branding options for child theme
* Direct import functionality
* Export scheduling and automation
* Export templates/presets
* Cloud storage integration (Dropbox, Google Drive)
* Export history and versioning

== Credits ==

Developed by the team at [Brainstorm Force](https://www.brainstormforce.com/)

Special thanks to:
* The WordPress core team for export.php functionality
* The Astra theme community for feedback and testing

== Privacy Policy ==

Astra Template Exporter does not collect or transmit any user data. All exports are generated and stored locally on your WordPress installation. The plugin does not make external API calls or send data to third-party services.
