PHPackages                             wpconstructor/scripts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. wpconstructor/scripts

ActiveLibrary

wpconstructor/scripts
=====================

WPConstructor Scripts: Composer-driven PHP scripts for building, backing up, and distributing WordPress plugins consistently and safely.

01↑2900%PHP

Since Mar 29Pushed 1mo agoCompare

[ Source](https://github.com/WPConstructor/scripts)[ Packagist](https://packagist.org/packages/wpconstructor/scripts)[ RSS](/packages/wpconstructor-scripts/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

WPConstructor Scripts
=====================

[](#wpconstructor-scripts)

A collection of **Composer-driven PHP scripts** for building, backing up, and distributing WordPress plugins consistently and safely.

---

Why I Built WPConstructor Scripts
---------------------------------

[](#why-i-built-wpconstructor-scripts)

While building WordPress plugins, I kept repeating the same Composer scripts—copying assets, creating ZIPs, backing up files, and securing directories. It became repetitive and error-prone.

So I built WPConstructor Scripts: a reusable setup that handles all the common plugin build tasks in one place, instead of rewriting them every time.

---

Installation
------------

[](#installation)

Install WPConstructor Scripts via Composer as a dev dependency:

```
composer require wpconstructor/scripts --dev
```

Then, add the following to your plugin’s `composer.json` under the `"scripts"` section:

```
"scripts": {
    "build:update": "php vendor/wpconstructor/scripts/scripts/build-vendor.php && php vendor/wpconstructor/scripts bin/copy-assets.php && php vendor/wpconstructor/scripts/scripts/add-index-php.php && npx @wpconstructor minify-assets assets",
    "build": "php vendor/wpconstructor/scripts/bin/run-build.php",
    "cfp": "php vendor/wpconstructor/scripts/bin/cfp.php",
    "clean": "php vendor/wpconstructor/scripts/bin/clean.php",
    "backup:packages": "php vendor/wpconstructor/scripts/bin/backup-packages.php",
    "backup:plugin": "php vendor/wpconstructor/scripts/bin/backup-plugin.php",
    "backup:all-plugins": "php vendor/wpconstructor/scripts/bin/backup-all-plugins.php"
}
```

---

Usage Examples
--------------

[](#usage-examples)

### Asset &amp; Security Helpers

[](#asset--security-helpers)

- **Build Update**

```
composer run build:update
```

Updates plugin assets to the correct directories, creating nested folders like:
`assets/wpconstructor/dashboard/images`.

- **Add Index Files (included in build)**
    Automatically adds `index.php` to all asset directories to prevent directory listing.

---

### Build &amp; Distribution

[](#build--distribution)

- **Build Plugin**

```
composer run build
```

Runs the full build process:

1. Copies vendor files to `dist-vendor`
2. Removes empty directories
3. Adds `index.php` files
4. Creates a distributable ZIP in `dist/plugin-name-version-date.zip`

- **Clean Project**

```
composer run clean
```

Removes empty directories and cleans build artifacts.

---

### Maintenance Utilities

[](#maintenance-utilities)

- **Check File Permissions**

```
composer run cfp
```

Scans your WordPress installation for files without write permissions.

---

### Backup Scripts

[](#backup-scripts)

- **Backup Current Plugin**

```
composer run backup:plugin
```

Creates a backup of the current plugin in `wordpress-root/../plugin-backups`.

- **Backup All Plugins**

```
composer run backup:all-plugins
```

Backs up all plugins to `wordpress-root/../all-plugins-backup`.

Optional:

```
composer run backup:all-plugins -- --only-wpconstr
```

- **Backup Packages Directory**

```
composer run backup:packages
```

Backs up the entire `packages` directory to `wordpress-root/../packages-backup`.

---

One Workflow, Everywhere
------------------------

[](#one-workflow-everywhere)

With WPConstructor Scripts, every plugin build looks the same:

1. Assets copied
2. Vendors trimmed
3. Empty directories removed
4. Index files added
5. ZIP created
6. Backups secured

No guessing. No half-forgotten steps. No copy-pasting scripts between repos.

---

License
-------

[](#license)

MIT License © 2026 by WPConstructor

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance60

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd553556cb0de9b0ae9b62287e840cc096978cb02dedb42194c505bc926959a2?d=identicon)[WPConstructor](/maintainers/WPConstructor)

---

Top Contributors

[![WPConstructor](https://avatars.githubusercontent.com/u/198608876?v=4)](https://github.com/WPConstructor "WPConstructor (3 commits)")

### Embed Badge

![Health badge](/badges/wpconstructor-scripts/health.svg)

```
[![Health](https://phpackages.com/badges/wpconstructor-scripts/health.svg)](https://phpackages.com/packages/wpconstructor-scripts)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
