Building a WordPress Fleet Manager: The Work Behind the Update Button
Managing a collection of WordPress sites means repeating a lot of small tasks. Check what needs updating. Find the right installation. Check its backup status. Open the admin. Run an update. Work out whether it actually finished. Then do it again for the next site.
I wanted one place to see that work and act on it. A list of sites, some update counts, and a few useful buttons seemed like a reasonable starting point.
That became a React dashboard backed by PHP APIs, Python and Bash workers, WP-CLI, and hosting integrations. Along the way, the most useful work happened underneath the interface: deciding which information to trust, what a queued job was allowed to do, and how to explain the result when something went wrong.
Start with an inventory you can trust
Before I could automate updates, I needed a reliable picture of the installations. A hosting account is not necessarily one WordPress site. A domain is not a dependable installation identifier either. Multiple installs, staging directories, redirects, and multisite networks make that assumption fall apart.
The tool identifies an installation by its hosting account and filesystem path. Domains and URLs are properties of that installation. That distinction carries through scanning, site-specific policies, queued work, and administrator access.
The scanner also has to deal with the environment it finds. PHP warnings, unavailable commands, and partially broken installations do not produce a tidy data feed. Scan failures need to remain visible instead of quietly becoming a reassuring zero in an update count.
One particularly useful lesson came from admin access: a site being reachable over HTTPS did not mean WordPress had the correct HTTPS login URL saved. The right fix was to correct the underlying configuration and verify the exact installation, rather than relax the access check.
Give long-running work a queue
Scans, updates, and provisioning do not belong inside a browser request that has to stay open until the operation finishes. I separated requesting work from executing it.
The dashboard submits a job through an API. A worker picks it up, checks its eligibility, performs the operation, and records progress and results. The interface can poll for status without owning the lifetime of the task.
That separation also gives the privilege boundary somewhere concrete to live. The web interface does not get to run arbitrary server commands. Workers validate the requested installation, and site-level operations run under the appropriate hosting account.
Locks and duplicate-job checks matter here. A second click, a repeated planner run, or two workers seeing the same work should not turn one intended update into overlapping installations.
A schedule needs rules at execution time
Adding scheduled updates introduced a subtle problem: a job can be valid when it is queued and invalid by the time it runs.
The maintenance window may have closed. Someone may have disabled automation. The scan may be too old, the backup status may no longer qualify, or the operator may have changed an exclusion.
The planner selects eligible work and creates jobs. The worker checks the current policy again when an automatic job begins and between update items. That lets a policy change stop queued work before another package starts.
Stopping new work is also different from interrupting an installation halfway through. The emergency stop blocks subsequent operations; an installation already in progress is allowed to finish. That behavior needed to be deliberate, not an accidental consequence of how a process happened to exit.
The policy supports maintenance windows, update types, risk levels, exclusions, and site-specific overrides. Overrides still sit underneath the global controls. A site setting cannot quietly switch the whole system back on or bypass the backup gate.
Licensed packages and PHP versions complicate the happy path
An available update does not always mean there is a usable package waiting at a public download URL. Premium plugins and themes bring vendor authentication, licensing, and package availability into the workflow.
I had to keep that distinction visible. The tool uses supported vendor update routes where available and reports blocked or unavailable packages instead of pretending every update can be handled identically.
The runtime matters too. The PHP version used by a background command can differ from the website's configured runtime. Compatibility work needs to account for the command environment without silently changing the site's PHP handler just to make the tool happy.
Define what a successful update actually means
The update worker records outcomes alongside homepage health checks and recent fatal-error checks where available. It also has a per-item version recovery path for supported plugin and theme updates.
Those checks have limits. A homepage returning a successful HTTP response does not prove that checkout, a subscription renewal, an admin workflow, or every integration still works. An already unhealthy baseline also needs different interpretation from a new regression.
Recovery has limits as well. A previous premium package may not be available. Core changes can involve database migrations. Restoring an old database over newer orders or edits is a separate operational decision, not something to hide behind a generic rollback button.
I wanted the results to distinguish an update failure, a successful recovery, and a failure that still needs manual attention. Those states lead to different next steps. Calling all of them finished would make the dashboard less useful exactly when it mattered most.
Use the same care for access and provisioning
The dashboard grew beyond maintenance. It now includes administrator access for explicitly mapped installations and a workflow for creating staging sites and performing an initial launch.
For admin access, the important decisions were explicit site and user mappings, short-lived single-use grants, and keeping credentials and tokens out of ordinary URLs and logs. Unsupported or mismatched installations remain unavailable until their configuration is resolved.
Provisioning needed equally clear boundaries. New projects use fresh installations and project-specific configuration rather than copying another customer's site or license. Initial publication requires an empty live destination and preserves staging as a separate environment.
It deliberately refuses to treat a running production site as an empty launch target. A first-publish workflow and an ongoing deployment workflow have different responsibilities.
Report what happened after the queue finishes
A useful final addition was an overview of each automated batch. The report combines the saved plan with actual worker outcomes: version changes, successful updates, failures, recovery attempts, and blocked work.
The timing matters. Finding a finished marker in a log is not enough if a job still remains in the queue. A batch that stalls needs an explicitly incomplete report, followed by a final report when it eventually finishes.
Notification delivery has its own state, too. Failed submissions stay eligible for retry, and successful submissions are deduplicated. Operational summaries exclude raw logs, download credentials, and login tokens.
What I would carry into the next operations tool
I would start with stable identities and explicit states again. Give long-running work a queue. Recheck permissions and policy where the action happens. Keep recovery promises narrower than the checks can support. Make blocked work and partial failures understandable.
The frontend benefits from that structure. React can concentrate on inventory, filters, policy editing, progress, and history because the execution rules live behind the API. Separating shared state, pure update calculations, and component presentation also made the dashboard easier to extend as the operational workflows grew.
The result is a tool I can reason about when a site behaves differently from the rest. That is the part of this project I value most: the system explains what it knows, what it did, and where a person still needs to make the decision.