tadrik Free store check

Guides / WooCommerce

Fixing a WooCommerce Critical Error After an Update

Updated

After an update, the site shows "There has been a critical error on this website" and the store is down. The cause is one PHP fatal error, and it is written down somewhere. Find that line, and the fix is usually one plugin, one theme file or one PHP version away.

1. Check the admin email and recovery mode

WordPress sends an email to the site admin address with the subject "Your Site is Experiencing a Technical Issue". It names the plugin or theme that crashed and contains a recovery-mode link. Open the link, log in, and deactivate the plugin it names. If that email is not there, check spam and the admin email under Settings, General.

2. Read the real error

That error screen hides the real message. You can read it two ways.

Your host's error log. Most hosts show it in the control panel under Logs or Errors. Look at the newest lines.

WordPress debug log. Add these lines to wp-config.php above the line that says "That's all, stop editing":

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Reload the broken page, then open wp-content/debug.log. Remove the three lines when you are done.

You are looking for a line that starts with PHP Fatal error and ends with a file path and line number.

3. Read the file path

The path tells you who to blame:

| Path contains | Cause | |---|---| | wp-content/plugins/woocommerce/ | A WooCommerce file crashed, usually because something else called it wrongly, or the PHP version is too old. Check the stack trace for the other plugin. | | wp-content/plugins/<other-plugin>/ | That extension is not compatible with the new WooCommerce version. | | wp-content/themes/<theme>/woocommerce/ | An overridden template in your theme is out of date. | | wp-content/themes/<theme>/functions.php | A custom snippet calls a function WooCommerce removed or renamed. | | Allowed memory size exhausted | Not a code bug: the PHP memory limit is too low for the update. |

Common messages: Call to undefined function or Call to undefined method means code is calling something that no longer exists. Uncaught TypeError often means a plugin passes the wrong kind of value to new code. Class not found can mean a plugin loaded before its dependency, or a half-finished update.

4. Get the store back

Do the least destructive step first.

  1. Deactivate the one plugin the log names. With admin access, do it from Plugins. Without it, rename that plugin's folder over FTP or your host's file manager, for example wp-content/plugins/some-plugin to some-plugin-off. WordPress deactivates a plugin whose folder is missing.
  2. Not clear which plugin? Rename the whole wp-content/plugins folder to plugins-off, confirm the site loads, rename it back, then reactivate plugins one at a time. The one that breaks the site is the cause.
  3. Theme template? Switch to a default theme such as Twenty Twenty-Five to confirm, then update the template copies under yourtheme/woocommerce/ from the new WooCommerce versions. WooCommerce, Status shows which ones are outdated.
  4. Memory? Raise the limit with define( 'WP_MEMORY_LIMIT', '256M' ); in wp-config.php, or ask your host.
  5. PHP version? Some extensions fail on a PHP version that is too new, others on one that is too old. Your host's panel switches PHP version per site. Try one step back or forward, and test checkout.

5. Roll back only if you must

If the fix is not quick, restore the last backup or install the previous WooCommerce version from the plugin's Advanced View page on WordPress.org. Take a database backup first. Orders are safe, but a database upgrade that already ran may not run backwards, so use a copy of the site on a test copy when you can.

6. Test the money path

Once the site loads, do not stop at the home page. Place a test order, pay with each method you offer, and check that the confirmation emails arrive. Fatal errors often hide on the cart, checkout and account pages, and a store can look fine while checkout is broken.

Stop it happening again

  • Update on a test copy first, or at least take a backup right before updating.
  • Update one plugin at a time so the cause is obvious.
  • Keep PHP on a supported version, and read the changelog of extensions before big WooCommerce releases.
  • Remove plugins you no longer use instead of leaving them deactivated.

If you would rather not do this at 2am

If the store is down, or the log shows an error you cannot trace, we can look at it for you. We find the exact fatal error, fix it, and test the checkout before we hand the store back.

Common questions

Will I lose orders if I roll back WooCommerce? Orders live in your database, not in the plugin files. Rolling back the plugin files does not delete them. Take a database backup first, because a database upgrade that already ran may not be reversible.

Why did the update break only my store? The update itself is rarely the cause. Usually an extension, theme template or custom snippet on your store is not compatible with the new version or with the PHP version it runs on.

Can I just wait for the plugin author to fix it? If the store is down, no. Deactivate the plugin that triggers the error so customers can check out, then wait for a compatible release.

Where do I find the exact error message? In the PHP error log (often wp-content/debug.log or your host's error log), or in the email WordPress sends to the admin address with a recovery link.