Automatic health check

After a risky change, PowerWP AI loads your site again and reverts the change if the site now shows a fatal error. What is checked, and its limits.

Some changes can take a whole site down: a PHP file with a mistake, an update that does not fit your theme, a wrong site address. After those changes PowerWP AI loads your site again. If it was healthy before and is broken now, PowerWP AI undoes the change right away and tells your AI app what happened.

How it works#

  1. PowerWP AI loads your home page and the admin side to see that the site works now. A recent result (up to 60 seconds old) can be reused.
  2. It makes the change.
  3. It loads both again. If both are fine, the change stays and the AI app is told "Site health verified after the change."
  4. If the site is broken now and was fine before, PowerWP AI reverts the change and loads the site once more to check it.

The site counts as broken when a page answers with a server error (HTTP 500 or higher), shows a PHP fatal error, a parse error, "Allowed memory size" or "Maximum execution time" message, or shows the WordPress critical-error page. The admin side counts as broken when it does not answer as expected.

A page that only quotes an error message, such as a support article about PHP errors, is not taken for a broken page.

The AI app receives an answer like this, and the change is marked as failed in the change log:

The change broke the site (home: PHP Fatal error ...), so it was AUTOMATICALLY REVERTED. Site after revert: healthy.

Which changes are checked#

ChangeWhen it is checked
Files, through fs_write, fs_edit, fs_delete, fs_move, archive_extract or an upload through a transfer linkThe file is PHP code in the plugins, must-use plugins or themes folder or in the WordPress root folder, or it is .htaccess, .user.ini, php.ini or wp-config.php. Extracting an archive into a plugins, must-use plugins or themes folder is always checked, and so is deleting or moving a whole folder in them.
Settings, through option_updatesiteurl, home, permalink_structure and rewrite_rules. The options that hold the active plugins and the theme cannot be changed with option_update. plugin_manage and theme_manage do that, and they are checked below.
Plugins, through plugin_manageActivate, deactivate, install and update.
Themes, through theme_manageSwitch (activate), install and update.
Debug mode, through debug_modeThe change to wp-config.php.

PHP files are also checked for syntax errors before they are written, so a typo is refused before it reaches the site.

Other changes are not health-checked: content, products, orders, database rows, file copies, and deleting a plugin (which must be deactivated first). Roll those back from the change log if something looks wrong.

What it cannot do#

  • It needs your server to load its own pages. If your host blocks that, PowerWP AI cannot verify the change. The answer then says it could not verify the site, and nothing is reverted. PowerWP AI › Dashboard › Environment checks tells you whether this works.
  • It only reverts what it broke. If the site was already failing before the change, the change stays and the answer says so.
  • It is not a full test. It sees fatal errors and server errors. It does not see a broken layout or a checkout that no longer works. Check the pages that matter after a plugin or theme update.
  • A revert puts back what was recorded. After a plugin update it restores the plugin's files. It may not undo database changes the new version already made. Ask for a backup before big updates.

If the site is still failing after a revert, the answer says "still failing - investigate immediately". Then rescue mode helps your AI app reach the site.

Settings#

Under Settings › Safety & rollback:

SettingDefaultWhat it does
Health check after risky changesOnLoads the site after the changes listed above to make sure it still works. Off means no check at all.
Revert changes that break the siteOnReverts a change automatically when the check finds a fatal error. Off means the AI app gets a warning and the change stays.

With the second setting off, the AI app is told: "WARNING: the site broke after this change (auto-revert is disabled). Roll it back with changes_rollback."

File tools also take a health_check option with the values auto (the default), always and never. An AI app that passes never skips the check for that call. The settings above always win: with the health check switched off, nothing is checked.

Example prompts#

Update the "Store Locator" plugin. Take a checkpoint first, and tell me what the health check reported.
Add this snippet to my child theme's functions.php. Preview the change first.
↑↓ moveEnter open