Keep WordPress & phpMyAdmin up-to-date with a single command II

A few years ago I wrote about keeping WordPress & phpMyAdmin up-to-date with a single command. While those methods still work it is time to make a few changes (and revive this blog while I’m at it, it has been too long).

First off, using Subversion to track stable versions might keep WordPress itself up-to-date (unless something breaks due to subtle changes in the repository as I found out with WordPress 4.1), it won’t do anything for your themes or plugins.

If you like to keep everything in WordPress up-to-date through the command line (instead of FTP, which I don’t even have installed) there now fortunately is a tool called wp-cli. Updating all plugins for example is as simple as:

wp plugin --all update

There is loads more it can do, see the wp-cli site for documentation of all commands and features.

Second, while the method of using git to update phpMyAdmin in my previous article wasn’t inaccurate, it was highly inefficient. The commands would first download the whole phpMyAdmin repository (including all branches and commit history) and then switch to tracking the stable branch. This was slow and wasted a lot of space.

So here are the updated commands:

git clone --depth=1 -b STABLE https://github.com/phpmyadmin/phpmyadmin.git
git pull -q origin STABLE
composer update --no-dev

With this we tell git that we want only the latest commit (depth flag) in the stable branch (b flag). This executes must faster and occupies only about 70 MB of space instead of nearly 500 MB. I recommend calling the git pull command from a cron job every day, so that your phpMyAdmin is always up-to-date.

1 thought on “Keep WordPress & phpMyAdmin up-to-date with a single command II

  1. I sent you a message on facebook, but it has gone to your “other folder”.

    Anyway, thanks. You’ll find out what I’m thanking you for if you look there.