Unlock the secrets of my WordPress development process: From the nuances of Windows 11 to the convenience of Dropbox syncing, here’s everything you need to know.
Operating System
Let’s start at the bottom of the stack with my operating system of choice, Windows 11.
I’ve been a Windows user since 3.11, building my own PC from scratch since 1990 (386DX).
Windows 11 has a built-in Linux kernel called Windows Subsystem for Linux (WSL) if I need to run projects under Linux. I run Ubuntu for those projects.
We only have one Apple device in our household. My wife’s iPod.
Developing Locally With LocalWP
I used to run PHP, MariaDB and Nginx as Windows services using a service wrapper, which worked well for PHP 5.6 projects.
When PHP got the updates to version 7 and now version 8, I needed a quicker way of switching between different versions, so now my tool of choice is LocalWP from the talented humans at Flywheel.
I can easily switch PHP versions and web server instances (Nginx or Apache). My current go-to LocalWP configuration is Nginx 1.16, MariaDB 10.4 and PHP 8.2
Using SSL on Windows is rather complicated. However, LocalWP makes it easy with a couple of clicks.
Coding With PHPStorm IDE
Do you remember Macromedia Dreamweaver 8? That’s a blast from the past, but it was a step up from Notepad++.
Today the Integrated Development Environment (IDE) landscape has changed a lot, and the top two for web development have to be IntelliJ’s PHPStorm and Microsoft’s Visual Studio.
I’ve used PHPStorm for over ten years and happily pay the license fee yearly. It supports everything I need within one environment: PHP editing (of course), PHPDoc, JavaScript, CSS, HTML, SSH, sFTP, Git, Linting, .gitignore, Node.js, and more.
Migrating With WP-CLI
Everything runs faster on a Command Line Interface, including WordPress.
I love using WP-CLI on all my projects. I mostly use it for quickly updating sites.
wp plugin update --all
wp theme update --all
wp core update
wp core update-db
Boom 💥 Everything is updated. Even faster when you add them to a single batch file – I have several for all my WP-CLI commands.
When I migrate a site to another server, I use WP-CLI to move the database, replacing the old URL with the new site URL.
wp search-replace "//localsite.local" "//livedomain.com"
wp db export
wp search-replace "//livedomain.com" "//localsite.local"
Easy peasy, lemon squeezy. 🍋
WordPress Blueprints
LocalWP allows you to store pre-configured WordPress sites as blueprints to clone a new site. It makes it super easy to spin up a new site depending on the type of project.
I have several blueprints for WooCommerce, LearnDash, Membership, Elementor, GeneratePress etc.
My basic WordPress GeneratePress business site stack has the following themes and plugins pre-installed and configured:
Themes
- GeneratePress
- GenerateChild
Plugins
- Advanced Custom Fields PRO
- CleanTalk
- Conditional Blocks Pro
- GenerateBlocks
- GenerateBlocks Pro
- GP Premium
- Gravity Forms
- Gravity Forms Webhooks Add-On
- Gravity Forms Zero Spam
- Scripts-To-Footer
- SEOPress
- SEOPress PRO
- Wordfence Security
- Zapier for WordPress
Syncing Sites Between Machines
I often work on client sites using my Dell XPS laptop, so I must replicate the working environment, WordPress files and database between at least two machines.
Files are easy, but no tools exist to synchronise a MySQL database between machines.
I use Dropbox and WP-CLI.
My Dropbox folder is on drive D on my main machine, but I have a symbolic directory mapped to C:\Dropbox. My laptop only has a single drive, so the Dropbox folder sits on drive C.
Using the symbolic link on my main machine and going through C drive, the file paths to LocalWP projects remain the same on each machine.
Now for the tricky bit – how do I sync the database between machines?
Easy – I have a batch file called db-out.bat for exporting the database and a batch file called db-in.bat for importing the database.
At the end of working on a project on either machine, I call db-out, which generates a ‘today.sql’ file. That SQL file is synched with Dropbox to the other machine.
When I log in to start work on the other machine, I call db-in.bat. Same DB on both machines! Boom 💥
Here are the contents of both files.
db-out.bat
call wp db export today.sql
call del wp-content\~$debug.log
db-in.bat
call wp db reset --yes
call wp db import today.sql
call del wp-content\~$debug.logs
Hosting With Wordify
My web host of choice is Wordify. They offer free development sites, ideal as testing sites to share with clients for feedback.
Their hosting is amazing and fast with their BunnyCDN integration and WordPress-optimised caching.
Support is five-star as well. Oh – and they are an Aussie company. Look no further. 👀
Advanced Development Stack
I have a more advanced development stack that uses NPM, Webpack, Composer and all those other goodies, but this is overkill for most of my client projects.
What’s Your WordPress Development Stack?
I want to know more about how you develop your WordPress websites locally.
Hit reply and tell me your setup.
Until next time, keep thriving.
Wil.