Title: Upgrade WooCommerce on VIP
Author: WordPress VIP Documentation
Published: June 4, 2021
Last modified: February 29, 2024

---

 1. [Plugins](https://docs.wpvip.com/plugins/)
 2. [WooCommerce](https://docs.wpvip.com/plugins/woocommerce/)
 3. Upgrade WooCommerce on VIP

#  Upgrade WooCommerce on VIP

Tthe WooCommerce plugin and related extensions should be maintained on the most 
up to date release version. This is essential for application security, and provides
the benefits of bug fixes and performance improvements, as well as having access
to new features. 

VIP customers with WooCommerce stores should follow the [WooCommerce Development Blog](https://developer.woocommerce.com/blog/)
to receive notifications of available version releases in a timely manner.

[New release versions of the WooCommerce plugin](https://github.com/woocommerce/woocommerce/releases)
and WooCommerce extensions should be tested as soon as possible in a [VIP Local Development Environment](https://docs.wpvip.com/vip-local-development-environment/),
followed by testing in a non-production VIP Platform environment (e.g. develop, 
preprod).

## Error logging methods

### VIP Local Development Environment

On local development environments, [`WP_DEBUG` can be used to log issues](https://docs.wpvip.com/wordpress-on-vip/php/error-reporting/#h-logging)
while testing extension and core updates. 

### VIP Platform non-production environment

As a precaution, a back up of the environment’s database should be run prior to 
deploying the upgraded plugin. [A fresh database backup can be generated](https://docs.wpvip.com/databases/backups/generate-a-fresh-database-backup/)
in the VIP Dashboard or with VIP-CLI.

 * The [`WC_Logger` class](https://woocommerce.github.io/code-reference/classes/WC-Logger.html)
   is recommended for custom logging, and WooCommerce has a published [in-depth explanation for its use](https://developer.woocommerce.com/2017/01/26/improved-logging-in-woocommerce-2-7/).
 * Custom errors can be [manually logged](https://docs.wpvip.com/manually-log-errors-in-new-relic/)
   in New Relic. [Enablement of New Relic for an environment](https://docs.wpvip.com/performance/new-relic/)
   and [New Relic user access](https://docs.wpvip.com/manage-user-access/new-relic/)
   can be managed in the VIP Dashboard.

## Testing and validation criteria

**Caution**

Third-party integrations for WooCommerce on non-production environments should be
set to “test-mode”, “non-production” or “sandbox” mode to prevent sending and receiving
live order data, or prevent sending test order data to production integration endpoints.

Tools and materials provided by WooCommerce are available for end-to-end testing
to assist with the plugin upgrade process.

 * [WooCommerce E2E Boilerplate ](https://developer.woocommerce.com/2021/02/11/jump-start-your-end-to-end-testing-with-the-woocommerce-e2e-boilerplate/)
 * [WooCommerce README](https://github.com/woocommerce/woocommerce/blob/master/tests/e2e/README.md)

Below are 2 sets of non-exhaustive lists of features and functionality that should
be tested as part of a WooCommerce plugin upgrade. Results of each test should have
identical results on non-production and production in order for the test to be considered
as “successful”.

### Front end functionality testing

Visually confirm that WooCommerce pages load as expected such as:

 * product pages
 * category pages
 * shop page
 * cart
 * checkout

Log into the “My Account” page for a test user.

 * Confirm that user account information for the test user appears as expected
 * Confirm that order history for the test user appears as expected

Test purchase flow functionality such as:

 * adding and removing items in a cart
 * applying a coupon code to a checkout page
 * removing a coupon from a checkout page
 * shipping costs are calculated correctly
 * taxes are calculated correctly and for the correct region
 * completing a purchase
 * checkout flow and experience should be identical to the production site

### Backend testing in the WordPress Admin dashboard

In the WordPress Admin dashboard, test order processing by performing each step 
of the order fulfillment process. Unique or multiple order processes (manual invoicing,
telesales, etc.) should also be tested individually.

 * Test backend search by searching for customer data and order data.
 * Test if products can be added/modified, or removed as expected.
 * Refer to stock management data and verify if data is modified as expected for
   incoming orders, processed returns, and stock deliveries.

## Prepare for a plugin upgrade on production

Before upgrading a plugin on a production environment, have a recovery plan in place.
Having this plan in place beforehand will allow a team to act more quickly and confidently
to resolve any unexpected issues.

 * Deploying a plugin upgrade to production is recommended only after thorough testing
   on non-production environments has been completed.
 * Determine a time of day to perform the plugin upgrade that will be least disruptive
   to a site based on average daily site traffic and the availability of internal
   or third-party development team resources.. 
 * As an extra precaution, [a database backup can be generated](https://docs.wpvip.com/databases/backups/generate-a-fresh-database-backup/)
   in the VIP Dashboard or with VIP-CLI just prior to a scheduled plugin upgrade.
 * If there is data loss due to an unexpected issue during the upgrade, the [database backup file generated prior to the upgrade can be imported](https://docs.wpvip.com/databases/import/import-with-vip-cli/)
   to restore the data. 
 * Once a pull request for a plugin upgrade is merged to the GitHub branch that 
   deploys to production, [monitor New Relic](https://docs.wpvip.com/tools-for-site-management/new-relic/)
   for warnings and errors, and run end-to-end tests on production.
 * If a code reversion is necessary, [rollbacks to a previous commit can be performed in the VIP Dashboard](https://docs.wpvip.com/github-repository/code-deployments/rollbacks/).

Last updated: February 29, 2024