WPManager

darkware.org WPManager

WPManager

Posted By darkware

WPManager is a standalone application for external management of a multisite WordPress installation. It aims to automate many of the standard tasks involved with WordPress administration while providing an extra layer of control and monitoring. While the WordPress Dashboard already provides many of these functions, WPManager aims to separate the control of them to achieve a few different goals:

  • Increased security by allowing greater restrictions within WordPress and on the webserver.
  • Improved performance due to offloading of many administrative tasks
  • More consistent behavior through the use of automated configuration checks and repairs
  • Better tools for managing multiple sites
  • Additional capabilities provided by integration with the host operating system

Motivation

As with so many software projects, laziness is the mother of invention. WordPress really does do a pretty good job at making updates and installs easy. However, a decent sized install of WordPress is going to see updates arriving every few days and as easy as it is to apply the updates, I would simply rather that they happen automatically. Solving that problem was the core of the first versions of WPManager. It applied updates quickly, automatically, and in a method that actually let me drastically increase the security of the platform while doing it.

From there, the mere possibility of simplifying a task provided the motivation. WordPress's internal cron mechanism slows down page loading, but it's a pain to set up a new cron job every time you add a new WordPress site. WPManager already knows all about the sites, so why not have it manage the cron tasks? Why not have WPManager handle core software updates, too? If it is already keeping track of all the files, why not let it take control of file permissions?

Eventually, you end up with a set of features large enough that you can just happily forget that it's even there. It handles most of the maintenance for you, while you can focus just on actually using WordPress.

Features / Functionality

WPManager is designed as a unifying framework for implementing a large number of management functions.  At its core, it is designed to take care of the most common administrative tasks

  • Automated updates of installed plugins, themes, and WordPress core software
  • Install/Uninstall of plugins and themes to match a defined list
  • Executing WordPress cron events
  • Extracting basic statistics about the sites and software in use

These actions are run in parallel where possible, using a system that attempts to minimize the number of times information must be loaded.

Integrated Optimized Cron Agent

For single site installs of WordPress, the built-in cron is usually good enough. For multisite installs, this can become a problem. Usually, multisite installs use the OS cron daemon along with curl/wget to manually invoke WordPress's cron handler. This works for moderate-sized installs, but still requires that the cron handler be invoked for every site according to a given schedule. WPManager takes over the job of the OS cron daemon, and uses its knowledge of the WordPress install to invoke only the cron hooks that request execution, and only when they need to be invoked.

File Integrity Checking

WPManager includes an internal file integrity checker. It uses cryptographic hashes to look for files that have recently changed so they can be reported and analyzed for security issues.

Dropwizard REST Interface

WPManager uses Dropwizard to provide a built-in REST interface. This is intended to provide information about the selected WordPress instance such as lists of sites, users, plugins, and themes as well as information about the actions WPManager takes including event logs, running actions, and cron schedules. It will also provide some capabilities for directly triggering actions such as installing plugins or themes or modifying configuration variables. Paired with an AJAX-based front-end, it would create a fully featured management UI.

File Permissions Control

WPManager includes periodic checks and corrections of file permissions within the the installations directory. The configuration is very lightweight, aiming to set permissions based on examples, rather than extensive listing of rules.

Post / Email Support

WPManager supports the posting of reports of various actions to a monitoring blog within the WordPress instance. Initial support is based around the reporting of theme and plugin installation and updates, but future support will include other types of reports.

WP-CLI Integration

Instead of re-inventing the wheel, limiting itself to the less functional XML-RPC API, or demanding the installation of an interface plugin, WPManager leverages the popular WP-CLI tool for directly interacting with WordPress via PHP. Not only does this eliminate the load a management tool would normally place on a webserver, but it allows for escalated privileges and greater efficiency in processing results by using WP-CLI's built-in loading restrictions and data formatting options.