Skip to content

Plesk Smart Updates — staged plugin and core updates with automatic rollback

Use WordPress Toolkit's Smart Updates to test plugin and core updates on a clone, compare rendered output, and roll back automatically if the update breaks the site — fleet-wide.

You ran a fleet-wide WordPress plugin update on a Thursday afternoon. Eight sites went down because a plugin’s new version dropped a column the theme depended on. The customers found out before you did. The post-mortem question was the same as every WordPress post-mortem: “did anyone test these on a staging copy first?” The honest answer is no — there were 137 sites, and nobody is going to clone, update, smoke-test, and promote 137 sites by hand. Smart Updates is the answer that does not require human-in-the-loop on every site. It clones, updates the clone, takes a screenshot before and after, compares the rendered output with a perceptual diff, and either promotes the update or rolls it back automatically.

What’s happening

Smart Updates is a WordPress Toolkit Premium feature. When you invoke --smart-update on a site (or a tag, or all), Toolkit (1) creates a clone of the site under a temporary subdomain inside the same subscription, (2) runs the plugin or core update on the clone, (3) walks a configurable list of URLs on the clone — by default the home page, a sample post, the archive page, and a category page — taking screenshots and parsing the HTML, (4) compares each rendered page against a pre-update baseline from the live site, (5) reports a similarity score and a per-URL diff, (6) either flips the update to live (with a pre-flip backup) or discards the clone and reports failure. The trigger is set per site or fleet-wide; the rollback window is set per site or fleet-wide; restore points are kept for a configurable number of days. The result is updates that ship in batches without you watching each one — and the ones that break catch themselves on the clone instead of in production.

How to verify

Confirm Smart Updates is licensed and enabled on the panel:

plesk ext wp-toolkit --info | grep -i smart
plesk bin license --info | grep -E 'WP-Edition|Premium|Smart'

A site that has Smart Updates enabled shows the flag in --info:

plesk ext wp-toolkit --info --instance-id 47 | grep -E 'smart_updates|auto_updates_policy'
# smart_updates: enabled
# auto_updates_policy: smart

Recent Smart Update runs on a site:

plesk ext wp-toolkit --smart-update-history --instance-id 47 | tail -30

After a Smart Update has run, the clone is automatically cleaned up — verify no orphan clones remain:

plesk db -e "
  SELECT d.name AS domain, c.created
  FROM domains d
  JOIN smartupdates_clones c ON c.original_domain_id = d.id
  WHERE c.status NOT IN ('promoted','discarded')
  AND c.created < NOW() - INTERVAL 1 DAY;
"

Orphan clones survive a panel crash mid-update — they should be cleaned manually so the customer’s quota isn’t double-counted.

The fix

The day-to-day Smart Updates flow is per-site or fleet-wide; both are CLI-driven.

1. Enable Smart Updates on a site

plesk ext wp-toolkit --enable-smart-updates \
  --instance-id 47

Toolkit immediately records a baseline of the home page + sample URLs as the “before” reference. Subsequent updates compare against this baseline.

2. Run a Smart Update for a single site

plesk ext wp-toolkit --smart-update \
  --instance-id 47 \
  --updates-core true \
  --updates-plugins true \
  --updates-themes true \
  --similarity-threshold 90 \
  --restore-point true

What happens, in order: clone is created at smart-update-clone-47.example.com, all updates are applied to the clone, every URL in the comparison set is rendered before and after, perceptual diff is computed (0-100 similarity), and if every URL is above 90% similar and all HTTP responses are 200, the update is promoted to live with a restore point taken first. Otherwise the clone is discarded, the live site is untouched, and the run is logged as failed.

3. Tune the comparison set per site

The default set (home, latest post, latest page, category) is rarely enough for sites with complex layouts. Add the checkout flow on a WooCommerce site, the contact form on a marketing site, the gated content page on a membership site:

plesk ext wp-toolkit --smart-update-config \
  --instance-id 47 \
  --check-urls "/checkout/, /cart/, /my-account/, /shop/" \
  --check-screenshot true \
  --check-statuscode true \
  --check-content true

--check-content parses the HTML and compares structural similarity; --check-screenshot does the perceptual image diff; --check-statuscode is a baseline that flags any URL that started returning 500 after the update.

4. Fleet-wide Smart Update with a tag filter

Run Smart Updates across every production-tagged site at 2 AM Sunday:

plesk ext wp-toolkit --smart-update \
  --tags "production" \
  --updates-core true \
  --updates-plugins true \
  --updates-themes false \
  --similarity-threshold 92 \
  --restore-point true \
  --output-format json \
  > /var/log/plesk/smart-update-$(date +%F).json

The JSON output lists per-site result: promoted, rolled_back, error. A nightly cron that emails the log to the on-call address makes the operation visible.

cat > /etc/cron.d/smart-update-fleet <<'CRON'
0 2 * * 0 root /usr/local/bin/plesk-smart-update-fleet.sh
CRON

cat > /usr/local/bin/plesk-smart-update-fleet.sh <<'SCRIPT'
#!/usr/bin/env bash
set -euo pipefail
LOG=/var/log/plesk/smart-update-$(date +%F).json
plesk ext wp-toolkit --smart-update \
  --tags production \
  --updates-core true \
  --updates-plugins true \
  --similarity-threshold 92 \
  --restore-point true \
  --output-format json > "${LOG}"

FAILS=$(jq -r '[.[] | select(.status != "promoted")] | length' "${LOG}")
if [[ "${FAILS}" -gt 0 ]]; then
  jq -r '.[] | select(.status != "promoted") | "\(.domain): \(.status) — \(.reason)"' "${LOG}" \
    | mail -s "Smart Updates: ${FAILS} sites need attention" oncall@example.com
fi
SCRIPT
chmod 700 /usr/local/bin/plesk-smart-update-fleet.sh

5. Restore-point inventory and pruning

Restore points consume disk. Toolkit lets you set retention per site or panel-wide:

# Panel-wide: keep restore points 14 days, max 4 per site
plesk ext wp-toolkit --restore-points-config \
  --retention-days 14 \
  --max-per-instance 4

Roll a site back manually if the post-promotion smoke test (yours, not Toolkit’s) reveals a regression:

plesk ext wp-toolkit --restore --instance-id 47 --restore-point-id 312

6. When Smart Updates can’t help — staging vs Smart Updates

Smart Updates is the right tool when the update is a routine plugin/core bump and the site’s surface is predictable. It is not a substitute for a real staging environment when the change is a theme swap, a database schema migration, a hosting environment change, or anything that requires manual interaction. Toolkit has a separate “Clone → Staging → Push” workflow for those:

# Create a long-lived staging clone for big-bang changes
plesk ext wp-toolkit --clone \
  --instance-id 47 \
  --target-domain staging.example.com

# After manual QA on staging.example.com, promote to live
plesk ext wp-toolkit --copy \
  --source-instance-id 89 \
  --target-instance-id 47 \
  --content full

Use Smart Updates for the routine — that’s where it pays for itself by catching the 5-10% of updates that would have taken a customer down. Use staging clones for the deliberate, infrequent, risky changes.

7. Reading a failed Smart Update

When Toolkit rolls back, the failure reason is in the run history. The two most common reasons are: similarity score below threshold (often because the plugin update changed CSS class names or DOM structure) and an HTTP error after the update (often a fatal PHP error from a plugin incompatibility). Inspect the failure:

plesk ext wp-toolkit --smart-update-history --instance-id 47 --format=json \
  | jq '.[0]'

Re-run the update on a manual clone if you want to see the actual rendered diff, fix the underlying plugin incompatibility, and re-run the Smart Update; or downgrade the comparison threshold for that site if the false-positive rate is too high.

plesk ext wp-toolkit --smart-update-config \
  --instance-id 47 \
  --similarity-threshold 85

Aim for 90% by default; 85% for sites with heavy animation, A/B tests, or weather widgets that change on every render; 95% for static marketing sites where any visible delta is bad.

Smart Updates plus fleet tags is what turns a 137-site Plesk node from “we’ll patch on the next quiet weekend” into “patches roll on Sundays and the on-call gets a list of three sites to look at on Monday.” The maintenance window is no longer constrained by how many tabs a human can keep open.

Run Smart Updates across an Enterprise WordPress fleet with Stack Harbor’s on-call team watching the post-update report — or bring us your fleet and we’ll wire the cron and the alerting.