View Categories

Fixing a Corrupted or Empty ZIP Download

If a ZIP from Download Plugins and Themes in ZIP from Dashboard will not open, or arrives empty or truncated, go to WPFactory > Download plugins and Themes > Advanced Settings, switch the ZIP library, set a writable Temporary directory, and stop PHP notices from printing on screen. Both settings are free.

Why a downloaded ZIP ends up corrupted #

Download Plugins and Themes copies the plugin or theme folder into a ZIP in a temporary directory on your server, then streams that file to your browser. The original plugin files are only read, never changed. A broken archive almost always comes from one of these points:

  • Extra output mixed into the file. The ZIP is streamed as-is, so any PHP warning, notice or deprecation message printed on screen at that moment is sent along with it and the archive will not open.
  • A silent ZIP library failure. With ZipArchive, the plugin does not check each file as it is added, so an incomplete archive can still be sent. PclZip reports its errors as an admin notice instead.
  • An unwritable or cleared temporary directory, which leaves the archive empty.
  • Memory or time limits hit partway through a large download, which truncates the file.

Fix a corrupted or empty ZIP step by step #

1. Download again #

A single corrupted download is often a temporary network or server hiccup. Retry the download once before digging deeper. Run one download at a time: each ZIP is built under a fixed name (for example plugins.zip for Download all), and an existing file with that name is deleted before the new one is written, so two simultaneous downloads of the same item can interfere.

2. Stop PHP notices from printing on screen #

If WP_DEBUG is on and errors are displayed, notices end up inside the ZIP. In wp-config.php, set WP_DEBUG_DISPLAY to false (you can keep logging to a file), then download again. On PHP 8.2 and later, see fixing PHP 8.2 deprecation notices.

3. Switch the ZIP library #

Go to WPFactory > Download plugins and Themes > Advanced Settings and change ZIP library from ZipArchive to PclZip (or the reverse). Some server configurations produce broken archives with one library but not the other. Click Save settings, then retry.

4. Set a writable temporary directory #

The ZIP is built in a temporary directory before it is sent to your browser. If that directory is not writable, or is cleared mid-build, the archive can come out empty. In Advanced Settings, set Temporary directory to a path you know is writable by the web server, then try again. Left blank, the plugin uses the system temporary directory shown under the field, falling back to PHP’s upload temporary directory and then your wp-content/uploads folder.

5. Raise the memory limit for large downloads #

If the problem only happens with Download all or with large plugins, the server may be running out of memory partway through. Increase your WordPress memory limit and retry. See fixing Download all failures on large sites for more.

6. Check for server restrictions #

An open_basedir restriction or missing zlib extension can stop the archive from being written correctly. Check your server error log, or ask your host to confirm these are in order.

Options that affect the ZIP #

Label Option ID Default Free/Pro
ZIP library alg_download_plugins_dashboard_zip_library ZipArchive if available, otherwise PclZip Free
Temporary directory alg_download_plugins_dashboard_temp_dir Blank (system temporary directory) Free
Auto Delete ZIP files alg_download_plugins_dashboard_delete_zip No Pro

FAQ #

Can a corrupted download damage the plugin on my site? #

No. The plugin only reads the plugin or theme folder and writes a copy into the temporary directory. Your installed files stay exactly as they were.

Which ZIP library should I use? #

Leave the default unless you have a problem. The plugin picks ZipArchive when your server has it and PclZip otherwise. If archives break, try the other one: PclZip shows an error notice when it fails, which makes the cause easier to spot.

I see “Something went wrong…” instead of a download. What does it mean? #

The archive could not be created, for example because the folder is empty or unreadable. When the library returns a reason, the notice shows it instead, such as “ZipArchive can not open a new zip archive” with an error code. Check the temporary directory and folder permissions, as described in fixing download failures caused by server errors.

Get more control #

These fixes use free settings. Download Plugins and Themes in ZIP from Dashboard Pro adds scheduled (periodical) downloads, bulk download of selected plugins, auto-delete of ZIP files after download and download link styling. See what Pro unlocks.

Still stuck? Note any error message shown after the download, then open a ticket with your server and plugin details on the Download Plugins and Themes support forum.

 

Download Plugins and Themes from WordPress Dashboard