# Plugin & Theme Downloader - User Guide

## Table of Contents

1. [Getting Started](#getting-started)
2. [Downloading Plugins](#downloading-plugins)
3. [Downloading Themes](#downloading-themes)
4. [Bulk Downloads](#bulk-downloads)
5. [Understanding the Interface](#understanding-the-interface)
6. [Troubleshooting](#troubleshooting)

---

## Getting Started

### System Requirements

Before using Plugin & Theme Downloader, ensure your server meets these requirements:

- **WordPress:** 5.0 or higher
- **PHP:** 7.4 or higher
- **PHP Extension:** ZipArchive (enabled on most hosts)

### Accessing the Plugin

After activation, you'll find two new menu items:

1. **Plugins → Download Plugins** - For downloading plugins
2. **Appearance → Download Themes** - For downloading themes

Both pages share the same interface, just filtered for their respective content type.

---

## Downloading Plugins

### Single Plugin Download

1. Navigate to **Plugins → Download Plugins**
2. Find the plugin you want to download in the list
3. Click the blue **Download** button on the right
4. The plugin will download as `plugin-name.zip`

### What's Included in the Download

When you download a plugin, the ZIP file contains:

- All plugin files and folders
- Exactly as they exist on your server
- Including any customizations you've made

---

## Downloading Themes

### Single Theme Download

1. Navigate to **Appearance → Download Themes**
2. Find the theme you want to download
3. Click the blue **Download** button
4. The theme will download as `theme-name.zip`

### Child Themes

Child themes are listed separately from their parent themes. To fully migrate a child theme setup:

1. Download the parent theme
2. Download the child theme
3. Install both on the destination site (parent first)

---

## Bulk Downloads

### Selecting Multiple Items

1. Use the checkbox on the left of each item to select it
2. The "X selected" counter updates as you select items
3. Use the checkbox in the header row to "Select All"

### Downloading Selected Items

1. After selecting your items, click **Download Selected**
2. All selected items are bundled into a single ZIP file
3. The filename will be:
   - `plugins-bundle-2026-02-02-143052.zip` for plugins
   - `themes-bundle-2026-02-02-143052.zip` for themes

### Bundle Contents

The bundle ZIP contains each plugin/theme in its own folder:

```
plugins-bundle-2026-02-02-143052.zip
├── plugin-one/
│   └── (all plugin-one files)
├── plugin-two/
│   └── (all plugin-two files)
└── plugin-three/
    └── (all plugin-three files)
```

---

## Understanding the Interface

### Column Descriptions

| Column | Description |
|--------|-------------|
| Checkbox | Select items for bulk download |
| Name | Plugin/theme name with status badge |
| Version | Current installed version |
| Author | Developer/company name |
| Action | Download button |

### Status Badges

- **Active** (green) - Currently activated
- **Inactive** (red) - Installed but not activated

Inactive items appear slightly faded for easy identification.

### Navigation Tabs

Both pages include tabs to quickly switch between:

- **Plugins** tab - Shows all plugins
- **Themes** tab - Shows all themes

---

## Troubleshooting

### Download Button Doesn't Work

**Possible causes:**

1. **JavaScript error** - Check browser console for errors
2. **Plugin conflict** - Try deactivating other plugins temporarily
3. **Server timeout** - Large plugins may timeout; contact your host

**Solution:** Refresh the page and try again. If the issue persists, check for JavaScript errors in your browser's developer console.

### ZIP File Is Corrupted

**Possible causes:**

1. **Incomplete download** - Connection interrupted
2. **Server memory limit** - Large plugins exceed memory

**Solution:**

1. Try downloading again
2. For large plugins, ask your host to increase PHP memory limit
3. Download smaller batches instead of many at once

### "ZipArchive Not Available" Error

**Cause:** Your server doesn't have the ZipArchive PHP extension.

**Solution:** Contact your hosting provider to enable the ZipArchive extension.

### Permission Denied Error

**Cause:** You don't have administrator privileges.

**Solution:** Only users with the `manage_options` capability (typically Administrators) can use this plugin.

### Plugin/Theme Not Listed

**Possible causes:**

1. **Not installed** - Only installed items appear
2. **Must-use plugin** - mu-plugins are not supported
3. **Drop-in** - Drop-ins (like advanced-cache.php) are not supported

---

## Tips & Best Practices

### Before Major Updates

Download plugins/themes before updating them. If an update causes issues, you'll have the previous version ready to restore.

### Migration Workflow

When migrating plugins to another site:

1. Download the plugin
2. Note any settings/configurations
3. Upload to destination site
4. Reconfigure settings (not included in download)

### Regular Backups

While this plugin is great for quick downloads, it's not a replacement for comprehensive backup solutions. Use it alongside a full backup plugin.

---

## Getting Help

If you encounter issues not covered here:

1. Check the [FAQ](../README.md#faq) in the main README
2. Search existing [GitHub Issues](https://github.com/chrsinteractive/plugin-theme-downloader/issues)
3. Open a new issue with:
   - WordPress version
   - PHP version
   - Browser and version
   - Steps to reproduce
   - Any error messages
