Why Staging Environments Are Critical for WordPress Sites

This article is part of a series created in partnership with SiteGround. Thank you for supporting the partners who make SitePoint possible.

Have you ever thought about the way you organize your WordPress development? Do you use version control? How about staging environments?

The WordPress Development Process

The advent of WordPress – one of the most consumer-friendly content management systems ever to exist – has created a different kind of development model. The accessibility of WordPress, and pre-made themes and plugins for it, allows web developers to quickly and easily create sites when requirements are low.

But it goes further than that – some of these developers don’t fully understand the languages on which the platform and their plugins are built (or understand it at all). When considering run-of-the-mill PHP or JavaScript developers, for example, many still don’t practice proper programming techniques, using things like tests, separate environments, or version control. Now, consider that the development of a simple WordPress site can be done by someone with far less training or experience (or done by a veteran programmer with the goal of being hasty). The percentage of cut corners in terms of security and maintenance concerns almost certainly goes up.

Bearing all of that in mind, the final nail in the proverbial coffin is the fact that WordPress updates and maintenance can be done so easily from right within the platform. The ability to update the platform or almost any plugin in place is fantastic, but it also means that “Cowboy Coding” – making changes directly on the live site – is very convenient and very tempting. That is, until disaster strikes.

About Staging Environments

The life cycle of many WordPress websites begins in a separate development environment in which it is built (hopefully it isn’t being built right in a live production environment). Once built, it is migrated to a production environment. And that is where things can sometimes fall apart.

What if the live, production hosting is slightly different than the dev environment, is missing some dependencies or software, has different versions, etc? Or what if updating a plugin causes the site to crash? What if a theme update breaks your child theme and you can’t immediately diagnose what is wrong?

These problems can be often prevented by using staging environments, which are often overlooked by WordPress site managers, yet are just as important for them as for other web platforms.

Setting up a Staging Environment

The goal behind setting up a staging environment is to set it up to be as identical to your live production environment as possible. Use the same hosting service, or the same kind of VPS. Mimic the live environment as closely as possible. use the same WordPress version, the same plugins, and the same configuration. One neat tip would be to use a backup/migration plugin to create a mirror copy of your website when it is first created (or do so now, if you have an existing site but no staging environment) so that the two are identical to start. Then, you can set up a subdomain (or another domain altogether) to access the site, such as staging.example.com.

Continue reading %Why Staging Environments Are Critical for WordPress Sites%


Source: Sitepoint