Best practices updating WordPress, WooCommerce & Plugins.
In this guide I will explain to you how to use best practises in updating WordPress, WooCommerce & Plugins so that you don’t have a dilemma on your hands if you have a website that operates live and crashed because of a update.
The biggest problem with updating is that most people goes strait for the update button in WordPress and this can sometimes leads to your website crashing or not working as it should. Especially if its been a while since the website was last updated. This can create havoc on a live site and its a nightmare that you don’t want to experience.
To update your website I recommend you perform the procedure on a test server. By going this route you are not affecting your live website and you would have enough time to find the problem(s). If you absolutely have to update on a live website you can do this also, but just note that there is a risk that your site might crash or functionality not working. This can lead to your website experience downtime in the case of a full restore.
- Plan the time of the update and make sure you have enough time available if something goes wrong.
- Install a maintenance plugin that blocks access to your site, but also displays a nice message to your visitors or customers that you are busy performing updates. You could try the following plugin.:
- Backup! Perform a backup of the WordPress files and the database before you attempt to do any updates. You want to be able to restore to a working version of your website if something goes horribly wrong.
- Manually copy the plugins folder via a FTP client from the server located @ YOURDOMAIN/wp-content/plugins to a folder on your machine. You want a previous version of a plugin if something breaks with a new updated version. I usually keep my current or previous plugins grouped in date folders for example.: /backups/plugins/11-2014/ or /backups/plugins/11-2015/.
Before you update I want to introduce you to the correct way of updating a WordPress or WooCommerce website.
Setup a Test environment
Create a subdomain or ask your hosting company to create one for you. You don’t pay extra for a subdomain. For example. test.mydomainname.com. Restore your current version of your website on this domain.
- Restore the WordPress files to the test.mydomainname.com.
- Create a new database (different name) and import the current database that you did a backup off.
- Remember to update the database name and credentials in the wp-config.php file that you will find in the root folder of WordPress for the test.mydomainname.com.
- You would need to change two fields in the database to reflect the new domain. You will find it under the wp_options table in the database. Under the FIELD option_name look for the values.:
- siteurl.: The current siteurl URL needs to be updated to reflect the new test.mydomainname.com domain name.
- home.: The current home URL needs to be updated to reflect the new test.mydomainname.com domain name.
- After you done the above and you can successfully log into the WordPress back-end you will need to update the permalinks located under WordPress > Settings > Permalinks. Just click save.
- Now everything should be working as it should under the new test domain name. Just note that some static links will revert back to the live site.
The bonus of having a testing website(s) is that you can start to experiment and install new plugins without having to worry that your live site might break.
Updating WordPress, WooCommerce, Plugins & Theme.
- First update the important stuff like WordPress, WooCommerce and your theme.
- Now you can start to update each plugin ONE BY ONE. You want to update each plugin ONE BY ONE to make sure everything works else you are going to create more work for yourself in solving the issue. Trust me it takes much, much longer to find the problem if you don’t know what is causing the issue. Create a habit of writing down what plugin name you updated from the old version to current version in a document so that you can easily keep track if things start to break. So if you update one plugin and suddenly you get a white screen of death you would immediately know what plugin update is causing the problem. This can be easily fixed and much faster than to sit and test each plugin from the start to see which one is the culprit.
- Test and retest everything especially payment gateways. You don’t want to find out two days down the road why your shop is not generating sales, because of a payment gateway that is not functioning.
The other issue that I have notice since working on some of my new customers websites is that many of their plugins is way behind the current version. This creates a unstable website and not even to mention the security holes left wide open for naughty people.I am going to use WooCommerce as an example here. Also what happens is if you have a outdated plugin and a new WooCommerce version is released somewhere down the line that plugin is going to stop working correctly if it is not up to date with current WooCommerce code. Yes WooCommerce does make their software backwards compatible, but only to a limited version. It is very important to stay current with updates. Updates is an improvement to the current version of the software or a introduction to new features. Updates closes security holes and solve software bugs found in the previous version and makes your website secure and stable.
I hope this article will help some of you out there. If you have some ideas I can add to this article, please share.