作为个人网站,自动升级插件的风险应该是可控的。 因此用命令行自动升级,可以免除手工下载安装的麻烦。

1. 安装 WP-CLI:

$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

$ php wp-cli.phar –info

$ chmod +x wp-cli.phar

$ sudo mv wp-cli.phar /usr/local/bin/wp

更新所有模块:

# wp –allow-root plugin  update –all

另外:

升级 WordPress 核心:

# wp –allow-root core update
Updating to version 4.6.1 (en_US)…
Downloading update from https://downloads.wordpress.org/release/wordpress-4.6.1-new-bundled.zip…
Unpacking the update…

安装新的插件:

# wp –allow-root plugin install https://downloads.wordpress.org/plugin/google-captcha.1.27.zip
Downloading install package from https://downloads.wordpress.org/plugin/google-captcha.1.27.zip…
Unpacking the package…
Installing the plugin…
Plugin installed successfully.

升级主题:

# wp –allow-root theme update –all

[bws_google_captcha]

相关文章