PHPackages                             britco/wp-cli-schema - 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. [CLI &amp; Console](/categories/cli)
4. /
5. britco/wp-cli-schema

ActiveWordpress-plugin[CLI &amp; Console](/categories/cli)

britco/wp-cli-schema
====================

v0.1.3(10y ago)065MITPHP

Since Aug 12Pushed 10y ago6 watchersCompare

[ Source](https://github.com/britco/wp-cli-schema)[ Packagist](https://packagist.org/packages/britco/wp-cli-schema)[ RSS](/packages/britco-wp-cli-schema/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

wp-cli-schema
-------------

[](#wp-cli-schema)

[![Circle CI](https://camo.githubusercontent.com/61dc2f1c1e596a427eb4f0897806bbb359aaa4c82f701ae753f346ecb5e36f31/68747470733a2f2f636972636c6563692e636f6d2f67682f62726974636f2f77702d636c692d736368656d612f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/britco/wp-cli-schema/tree/master)

Adds extra commands to [wp-cli](http://wp-cli.org/) to do schema upgrades for Wordpress. It allows you to do DB upgrades on deploy, instead of having to do hacks like re-activating your plugin so it fires activation hooks again.

Also you don't have to worry about the PHP process timing out since it's executed in the CLI context and not the browser.

Usage
-----

[](#usage)

In your plugin, add a hook for the `schema_upgrade` action. It should behave similar to [https://codex.wordpress.org/Creating\_Tables\_with\_Plugins](https://codex.wordpress.org/Creating_Tables_with_Plugins). You should write it in a way where it can repeatedly run without harm. For example, if one of your plugins needs to create a new term:

```
add_action('schema_upgrade', function() {
  if(!term_exists('Category', 'segment')) {
    wp_insert_term('Category', 'segment');
  }
});

```

**Add the schema upgrade to your deploy process**

```
wp schema upgrade

```

When this runs, it will essentially call `do_action('schema_upgrade')`.

License
-------

[](#license)

Available under the MIT License.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

3932d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4ddc59ed11905f3ff2b2526bdfca72ca82f5353999d951ea2ea8176b098e3970?d=identicon)[pdufour](/maintainers/pdufour)

---

Top Contributors

[![pdufour](https://avatars.githubusercontent.com/u/1239145?v=4)](https://github.com/pdufour "pdufour (16 commits)")

### Embed Badge

![Health badge](/badges/britco-wp-cli-schema/health.svg)

```
[![Health](https://phpackages.com/badges/britco-wp-cli-schema/health.svg)](https://phpackages.com/packages/britco-wp-cli-schema)
```

###  Alternatives

[fuel/oil

FuelPHP 1.x Oil Package

1051.2M5](/packages/fuel-oil)[ceeram/clear_cache

Clear CakePHP caches from shell, app or debug\_kit panel

85123.8k3](/packages/ceeram-clear-cache)[humanmade/orphan-command

WP-CLI command to list and delete orphan WordPress entities and metadata.

4519.1k](/packages/humanmade-orphan-command)

PHPackages © 2026

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