Connect with us

Tutorials

8 Reasons Why NOT To Develop WordPress Locally

Published

on

8 Reasons Why NOT To Develop WordPress Locally


Yep, we’re going there. While we haven’t completely abandoned local development, we believe that in today’s current WordPress environment, online staging is the way to go.

Local development in WordPress is really good―in theory. While you could spout a list of its pros, they could easily be flipped to cons.

Up for a good debate? Taking one point at a time, we’ll explain why we think online hosting is the better option in developing environments.

Continue reading, or jump ahead using these links:

Ok, let’s look into the particulars.

A Coat of Primer

First, we’ll cover a few definitions, as they can be used differently, and we want to unify context.

Localhost is used by most people when they’re referring to their PC. But all tech with access to the internet has a localhost―from smart refrigerators to hosted servers. For more clarity, we’ll use online versus local.

Staging is a copy of your website where you do edits/test/changes and the like.

Production is your live website.

Both staging and production can be online or local.

We could wrangle over the meaning of these words, but kindly consider them as outlined above, at least as it pertains to this article. 😏

Now on to the heart of the matter.

Deconstructing the Environment

You can get started with your own environment in WordPress using one of two approaches: local development, or remote hosted development (online).

Local or online dev
Local development (your PC) versus online (remote hosted server).

Because we are taking the stance of pro online development in this article, we’ll posit the following points that express developing locally isn’t the best way to go.

1. Dinghy vs Cruiser

It’s much more likely for you to experience issues on your own PC, as opposed to an online, hosted server. So with local development, there’s a greater risk of losing progress made during any given session, or even the full lot of your work.

In online development, the environment can be handled by industry professionals (a reliable host), leaving you to focus on the work itself.

2. Resource Rift

Your own PC rarely equals that of an online server, meaning the same code will run very differently in each environment.

Since your local system might give unlimited access to resources, the site and code will process much faster and with greater freedom (i.e. not hitting any kinds of limits). Not so in an online server, especially with lower resources. Imagine a 64 gig personal computer vs a 1 gig hosting plan.

With online development, staging is pretty much exactly the same as production environments, in terms of specs. That means you can properly test your code, and know with relative certainty it will act the same in both. There is no confusion for you in regard to what works and what doesn’t.

To be more specific, you might have 10 minutes of execution locally, while a server might have 300s PHP execution (e.g. 5 minutes of a code running). If it doesn’t finish it’s going to error out. Hence the same code would run properly locally, but won’t work on a production server.

This may sound counter to the argument, pointing out that local resources far surpass those of online servers, but in this case it’s not about more voluminous specs. It’s vital that in staging (development), you always have equal or lesser specifications than production. In this way, you can test your code/site/etc., and know that if it handles well with smaller resources (e.g. a 1 GB server), it won’t have issues with larger resources (e.g. a 64 GB PC). The same can’t be said of the reverse.

3. (Not Han) Solo Setup

On local, you have to set everything up yourself, which can become a tangled mess pretty quickly, even with 1-click apps. Unless you’re an advanced dev/techie, you aren’t likely to find easy solutions, and are likely to spend a lot of time on trial and error.

4. Needles in a Haystack… Or More Accurately… Code in a Dev Stack

It’s easier to just edit a WP site on a staging environment that is pre-set to work with your server, than do it locally and have to try to replace your database back and forth manually between local -> online.

Consider the following… You create a new post on your site, and attach 2 images to it. This means multiple files (because WP generates thumbnails from the images as well), and multiple database entries in various tables.

You have to know what you are doing to get those changes from your local site to an online one, much like a migration. You either replace the whole site from the ground up, or you have to pinpoint the necessary changes behind the scenes and move those over. It’s usually easier to just create the post online again, than trying to navigate those changes. Why double your efforts?

5. Theme Threats & Plugin Problems

The same goes for themes and plugins. Why not just make changes in an online environment, and when it works, sync from staging to production within a matter of seconds? Avoid needing to upload all those things and do all the configuration from scratch. Sidestep the likelihood of forgetting something in the re-setup.

You can’t completely validate in your local environment anyway. Even for simple theme changes, you won’t be able to run a GTMetrix scan without first pushing it somewhere online, then running the tests. Again, this begs the question, why not do it in an online staging environment straight out of the gate, and remove the extra step?

6. Alternate Access & Redirect Rules

As stated previously, a local setup can be very different from a hosted, online one.

For example: AMP stacks use an Apache server, while other hosts/servers use Nginx, LiteSpeed, etc. These use different redirect rules via the .htaccess file. So any plugins set to use Apache locally, won’t work properly when you push that site to a server with Nginx, (or LightSpeed, etc). In this case, they’d all have to be re-setup.

For this reason alone it’s preferable to develop online. If you have a staging option which is essentially built on the same (or equal) system, it will simply work in production, since it’s 100% compatible. You know exactly how your site/plugins/themes etc. are going to behave.

7. (Not Harry) Potter-ing Past

For some folks, developing locally is a leftover remnant from an era of slow-as-molasses dial-ups. These were unstable and costly, which made it easier to set up a site locally and push everything online in one go. With today’s vastly superior connectivity options, this is no longer the case.

8. Epic Ecosystem

Big, heavy projects can involve all kinds of development. They are rarely local, almost always on a 100% similar copied staging server that includes Git and other development tools―which are much more complicated if you’re not fully versed in them.

Paired Platforms

There’s another route you could choose. That is, using a hosting provider-associated platform for development, like DevKinsta (>> Kinsta), or Local (>> Flywheel or WP Engine).

These offer great ease of use (no intimate coding knowledge required), and run on your PC, with online and localhost environments to match your preferences.

Local and DevKinsta are free to use. However, you will incur costs if you use their hosting when you eventually deploy your site. If you opt out of paying for their services in lieu of another company, you’re likely to run into those compatibility issues we discussed earlier, when you’re ready to push to production. If you are interested in using Flywheel, this is a helpful article we wrote about it.

Instead, you could select a hosting company to begin with that offers a simple staging-to-live online solution. For example, WPMU DEV offers the convenience and ease of a hosted staging platform on our servers, so you can work out all the kinks, then go live with one-click sync.

wpmudev 1-click sync staging to production
Pick, click – slick! (Featured in WPMU DEV’s hosting options.)

(AMP)le Coverage

If you’ve read through the full article, thanks for hearing us out! Hopefully we’ve presented a clear, compelling case for why we prefer online (over local) development, while still respecting those who might choose the latter.

We recognize there are decent resources available for developing locally in WordPress. You’ve got your free AMP (Apache-MySQL-PHP) stacks, such as XAMPP, MAMP, & WAMP, which simulate what managed WordPress hosts would provide for you on their web servers.

WP AMP stack
AMP stacks for developing locally in WordPress.

While these are devised to work with a selection of other software, tools, & operating systems, they also entail installing, configuring, and updating them yourself. This is a time-consuming, on-going task, made that much greater should you be unfamiliar with them.

If you’re still of the mind to go the local route, we have quite a few helpful articles on our blog with valuable information on the subject:

Chances are you have enough to do building and managing your sites, without the added hassle of fixing the unexpected outcomes that tend to come with an unassisted move from local to online.

If your website is revenue producing (for you personally, or your clients), you’re probably going to go for a quality hosting service anyway. It makes sense to use one to begin with that incorporates an all-in-one solution, with a smooth, clean sync for staging to production.

Website development can be a joy or a hardship. In the end, you should opt for the environment that best suits your needs and skill level, and syncs easily on a reliable server.



Source link

Continue Reading
Click to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.