Add a new plugin

Before adding a new plugin, we should make sure we collectively (tech@) agree upon adding it, as it could add security holes to the server.

Plugins will all be available for all websites. We don't want specific plugins for specific websites. They can enable or disable plugins in the admin area of their wordpress site.

Replace $site and <plugin-name>.

  • # wp --allow-root --path=/usr/share/wordpress --url=en.squat.net plugin install <plugin name> Where <plugin name> is the name of the plugin as shown on the wordpress.org website, ie. for https://wordpress.org/plugins/widget-shortcode/, <plugin name> is 'widget-shortcode'
  • Add a line in /root/Changelog

Check on which sites a plugin is activated

  • # WP_PLUGIN=<plugin-name>
  • # for i in $(ls /etc/wordpress/config-* | sed 's/^.*config-\(.*\)\.php$/\1/'); do echo $i; wp --allow-root --path=/usr/share/wordpress --url=$i plugin status ${WP_PLUGIN} | grep "Status:" ; done

Note: you can add "2>/dev/null" after ${WP_PLUGIN} to avoid error printing