PHPackages                             eriktorsner/wp-deployhelper - 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. eriktorsner/wp-deployhelper

ActiveLibrary

eriktorsner/wp-deployhelper
===========================

A small util for deploying WordPress installations via ftp. Only fast.

0.1.1(10y ago)018MITPHPPHP &gt;=5.3.3

Since Jan 11Pushed 10y agoCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

wp-deployhelper
===============

[](#wp-deployhelper)

Simple command line utility to assist deployments via ftp. Intended for the specific condition where a remote server is accessible via ftp and http. Typically, this is the case when deploying to shared host like Bluehost or GoDaddy standard web accounts.

wp-deployhelper was originally written as a support package for [WP Bootstrap](https://github.com/eriktorsner/wp-bootstrap), a deployment tool for WordPress, hence the name.

Concept
-------

[](#concept)

wp-deployhelper uses a combination of ftp and http to transfer compressed sets of changed files to a remote server. By keeping track of both local and remote state, the number of files transferred can be kept to a minimum speed kept to a maximum. Typical time to transfer a standard (empty) WordPress install to Bluehost is around 30s on the first transfer and 5-8s for incremental updates.

wp-deployhelper also comes with a rewrite feature that allows individual files to be rewritten using regular expressions after unpack. Typically used to change passwords or database host in configuration files.

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

[](#installation)

To add this package as a local, per-project dependency to your project, simply add a dependency on `eriktorsner/wp-deployhelper` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency wp-bootstrap:

```
{
    "require": {
        "eriktorsner/wp-deployhelper": "0.1.*"
    }
}

```

Then

```
$ composer update

```

Configuration
-------------

[](#configuration)

wp-deployhelper uses a single json configuration file that needs to be in the project root folder named ftpsettings.json.

```
{
    "host": "ftp.mydomain.com",
    "user": "mydomain",
    "pass": "secret",
    "remotePath": "/public_html",
    "localPath": "/vagrant/www/wordpress-default",
    "httpUrl": "www.mydomain.com",
    "rewrite": [{
        "file": "/wp-config.php",
        "pattern": "/define\\('DB_HOST', '.+'\\);/i",
        "replace": "define('DB_HOST', 'localhost');"
    }]
}

```

NameDescriptionhostftp host nameuserftp user namepassftp passwordremotePathpath on the remote serverlocalPathpath on the local serverhttpUrlhttp url that corresponds to the remote pathrewritererwrite rules, see below**Notes:** host, user and pass are used to connect to the remote server using the standard php ftp client. Currently no support for alternative ports etc.

remotePath and httpUrl needs to match. A php script will be uploaded to the remote path and is expected to be accessible using the httpUrl, if these don't match, wp-deployhelper will not work at all.

**Rewrite rules**The rewrite rules are an array of objects, each representing a rule. On files that matches the *file* name/glob pattern a [preg\_replace](http://php.net/manual/en/function.preg-replace.php) will be made. If the preg\_replace results in any hits, the file is saved with its new content.

- **file:** a file name or glob pattern checked using php [fnmatch](http://php.net/manual/en/function.fnmatch.php). As each file is unpacked, it's name is checked against *file* and if it matches, the rewrite pattern is applied
- **pattern** Passed in as the pattern argument to preg\_replace
- **replace** Passed in as the replace argument to preg\_replace

Running
-------

[](#running)

wp-deplyhelper only has one command with no arguments:

```
$ vendor/bin/wp-deployhelper deploy

```

Saved state
-----------

[](#saved-state)

After each run local and remote state is saved in the subfolder wp-deployhelper directly under the project root. There's currently no way to alter the state folder path or name.

Rules
-----

[](#rules)

The rules for what files to transfer or delete are currently not configurable. The intended use case is that the local server controls what files that are supposed to exist on the server. However, files that are added "runtime" on the server will not be removed.

LocalRemoteResultReasoningNEW, MOD\*Copied to remoteAny new or modified local file will be transferred regardless of remote stateEXISTSDEL, MODCopied to remoteA remotely modified or deleted file will be replaced by the original from localDEL\*Deleted from remoteDeleted local file will delete the file remotely\*NEWNo actionFiles added remotely are assumed to be correctly added by the application itself**Note:** A locally renamed file will be treated as two files. One deleted and one new.

Detailed description
--------------------

[](#detailed-description)

**Step 1.** wp-deployhelper works by creating a complete (recursive) list of all local and remote files. To get the remote index, a php a script is pushed to the target server to take advantage of the php *scandir* fundtion rather than relying on indexing via ftp (slow). The two indexes as first compared against saved state for both the local and remote sides to figure out which files that needs to be transferred or deleted on the remote server.

**Step 2.** In the next step, wp-deployhelper creates a zip archive with all the needed files as well as some meta information. The zip archive is then sent to the target server via ftp (to avoid potential file upload limitations). The php scrip is then called to unpack the archive, delete files that should be deleted etc.

**Step 3.** As the last step, wp-deployhelper takes a new index of the remote state and saves both the local and remote states.

On the local side, the indexing process uses md5 file hashes to detect modified files. But for performance reasons, the remote side just hashes modification and file size. Theoretically, it's possible to do changes on remote files that goes undetected, but in reality that should be rare.

Security
--------

[](#security)

Currently wp-deployhelper is rather insecure since it relies on plain ftp for the file transfers. To increase security, wp-deployhelper uses a (pseudo) random file name for the script and zip file. Each time the tool runs, a new random name is created. As soon as the process is finished both the zip and php files are removed from the target server.

Version history
---------------

[](#version-history)

**0.1.0**

- First version. Support for remote deploys and rewrite
- Tested on Bluehost, Loopia (SWE)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

2

Last Release

3771d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/03c44b3a07e257cc3a9ef1db7960e470db98bc41d03f99073b37443ddf7f33f7?d=identicon)[eriktorsner](/maintainers/eriktorsner)

---

Top Contributors

[![eriktorsner](https://avatars.githubusercontent.com/u/2832047?v=4)](https://github.com/eriktorsner "eriktorsner (11 commits)")

---

Tags

ftpwordpress

### Embed Badge

![Health badge](/badges/eriktorsner-wp-deployhelper/health.svg)

```
[![Health](https://phpackages.com/badges/eriktorsner-wp-deployhelper/health.svg)](https://phpackages.com/packages/eriktorsner-wp-deployhelper)
```

###  Alternatives

[roots/wordpress

WordPress is open source software you can use to create a beautiful website, blog, or app.

19116.9M257](/packages/roots-wordpress)[aristath/kirki

Extending the WordPress customizer

1.3k73.0k4](/packages/aristath-kirki)[wpreadme2markdown/wpreadme2markdown

Convert WordPress Plugin readme.txt to Markdown

9564.6k4](/packages/wpreadme2markdown-wpreadme2markdown)[wpstarter/framework

The WpStarter Framework - Laravel Framework for WordPress

1810.1k4](/packages/wpstarter-framework)

PHPackages © 2026

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