FMH Exporter

By fmhteam

0+ active installationsVersion 1.1.2

Adds an "Export ZIP" button to every plugin and theme, letting you download any extension as a .zip file instantly.

Description

FMH Exporter is a lightweight, secure tool that lets WordPress administrators download a ZIP of any installed plugin or theme straight from the admin. It is built for people who manage several sites: back up an extension before updating, move it to another site, or inspect its code.

Features:
* One-click ZIP downloads for plugins (Plugins page) and themes (Themes page).
* Handles single-file plugins and multi-folder plugins and themes.
* Child themes export on their own, without the parent theme.
* The ZIP uses the standard layout (one top-level folder), so it installs cleanly on any site.
* Skips development clutter by default: .git, .svn, node_modules, .DS_Store and Thumbs.db.
* Secure: nonces, capability checks, and only installed plugins and themes can be exported (no path traversal).
* Generates ZIP files on the fly in your server’s temporary directory and deletes them after download.

Installation

  1. Upload the fmh-exporter folder to /wp-content/plugins/, or upload the ZIP from Plugins > Add New > Upload Plugin.
  2. Activate the plugin.
  3. Plugins: go to Plugins > Installed Plugins and click “Export ZIP” next to any plugin.
  4. Themes: go to Appearance > Themes, click a theme to open its details, then click “Export ZIP” next to the other buttons.

FAQ

Does this work for single-file plugins?

Yes. A plugin that is a single PHP file is zipped as that file. Anything inside a folder is zipped as the whole folder.

Does exporting a child theme include the parent theme?

No. Only the child theme folder is exported. Export the parent separately if you need both.

Does it require any special server setup?

It requires the ZipArchive PHP extension, which most hosts enable by default.

Who can export?

Plugins: users who can activate plugins (administrators). Themes: users who can switch themes (administrators). On multisite, only super admins can export.

What is left out of the ZIP?

Files and folders named .git, .svn, node_modules, .DS_Store and Thumbs.db. To change the list, use the fmh_exporter_excluded filter. For example, to include everything:

add_filter( 'fmh_exporter_excluded', '__return_empty_array' );

Why is there no Export button on the theme cards?

The Themes screen is drawn by JavaScript, so the button is added to the theme details overlay, one click away from the card.

Changelog

1.1.2

  • Tested up to WordPress 7.1.

1.1.1

  • Fix: the Export ZIP button in the theme details popup now shows for every theme, not just the active one.

1.1.0

  • New: export themes as ZIP from the Appearance > Themes screen.
  • New: development files (.git, node_modules and similar) are skipped, adjustable with the fmh_exporter_excluded filter.
  • Fix: the download now stops with an error if the ZIP could not be written, instead of sending a broken file.
  • Fix: temporary files are cleaned up when ZIP creation fails.
  • Fix: nonce is now checked before the plugin lookup.
  • Fix: uses WordPress’s temp file helper, removes the time limit for large extensions, clears all output buffers, and skips broken symlinks.
  • Fix: download filename is sanitized.

1.0.0

  • Initial release.