WP Zipper

// Builder Tool

Overview:
Builds production-ready ZIP files for WordPress plugins (zipplugin) or themes (ziptheme), excluding unnecessary development files, and properly handling Composer dependencie
Date:
  • Start
    09-25
  • End
    09-25

Problem Statement

Developers often face repetitive, error-prone steps when preparing WordPress plugins and themes for deployment. Unnecessary development files, unoptimized Composer dependencies, and inconsistent packaging methods can lead to bloated or broken ZIP archives. Manually cleaning and zipping files not only wastes time but also increases the risk of releasing incomplete or oversized packages. A consistent, automated solution is needed to generate clean, production-ready ZIP archives for WordPress projects with minimal effort.

Task

The primary task of WP Zipper is to automate and standardize the process of packaging WordPress plugins and themes for production. It should intelligently identify and exclude non-production files, handle Composer dependencies in optimized form, and support user-defined exclusions through an intuitive configuration file. The tool must ensure a repeatable, predictable, and verifiable build process—allowing developers to produce deployable artifacts quickly, without manual cleanup. Additionally, it should provide separate commands for plugins and themes, making the workflow clear and consistent across different project types.

Implementation

  • Created the main wp-zipper.sh Bash script to handle plugin and theme zipping.

  • Added logic to detect command type (zipplugin or ziptheme).

  • Implemented default and custom exclusion handling via .zipperignore.

  • Integrated Composer support to install production-only dependencies.

  • Used rsync and zip to build and package clean archives.

  • Installed global commands and tested on multiple WordPress projects.

Key Features

  • Dedicated Commands: zipplugin and ziptheme commands tailor behavior for plugins or themes.

  • Automatic Exclusion: Skips common dev files and directories like .git, node_modules, tests, logs, and build scripts.

  • Custom Exclusions (.zipperignore): Define project-specific exclusions using a .gitignore-like syntax.

  • Composer Integration: Automatically installs only production dependencies with --no-dev optimization.

  • User Confirmation: Ensures the correct directory is selected before packaging.

  • Clean, Production-Ready Output: Generates a neatly named ZIP (e.g., my-plugin.zip) ready for upload or distribution.

  • Extensible Architecture: Designed to support future code checks, minification, and configuration options.

  • Cross-Platform Compatibility: Works on most Linux and macOS environments with minimal setup.

  • Easy Installation: Simple setup with just a few terminal commands to make it globally accessible.