Modern WordPress development and deployment

Happy WordPressing

When we talk about WordPress, people start thinking about small blogs, companies’ websites, or eCommerce platforms. But what they don’t know is that more than 35% of the entire internet and 62% of the CMS based websites use WordPress. This article covers some advanced and modern technologies at WordPress development and deployment phases, that some experts and developers did not know about WordPress. This information will allow for a rapid and more stable website performance and delivery.

Related: WordPress: It’s not just for blogs 

Dependency Manager

Although, we can install/update plugins and themes in WordPress in few clicks directly from the control panel, but it’s not easy to migrate them between development, staging, and production environments for larger projects, and without setting the site into maintenance mode.

If you are a PHP developer; then you’ll know who that a Composer dependency manager can help you with so much, but you may not know that there is a repository called WPackagist that allows you to install plugins and themes as a composer dependencies. It’s not only that, you can also use composer to install WordPress core itself.

Continuous integration and delivery (CI/CCD)

wordpress development integration and delivery

Once we prepare our WordPress project for multiple environments, how can we ship our website automatically between them?

Here is where CI/CD tools like BranchCI come into place. It will allow you to build, test, and deploy your WordPress automatically.

Imagine your code in a Git repository, once you push a new code to the development branch, BranchCI will clone the project, run any composer and NPM tasks, validate your code according to the WordPress coding standards, run your PHP unit tests, and finally deploy to staging server using Rsync if all the tasks are passed.

Automation through CLI

Some developers would love to use command line interface to automate some tasks, and WP-CLI can give them what they need. It allows you to install the core, plugins and themes using the command line, but wait, did we not overcome this using the dependency manager?

The main power of the CLI is that it offers extra help for:

  1. Adding, removing, and flushing WordPress cache.
  2. Adding, removing, and listing capabilities of a user role.
  3. Moderating and managing comments.
  4. Generating and reading config file.
  5. Testing, running, and managing WordPress cron jobs.
  6. Exporting and importing WXR file.
  7. Providing some i18n tools for WP.
  8. Installing, activating and managing language pack.
  9. Managing the maintenance mode (enable, disable)
  10. Import files and regenerate thumbnails after registering new image size.
  11. Generates code for post types, taxonomies, plugins, child themes, etc.

And many other options and commands that you can review at the WP-CLI documentation.

Just imagine yourself developing an enterprise level project using WordPress the old way, installing and testing plugins and themes between scattered environments, using FTP to upload your new and updated files, and doing many things manually without the CLI!

Moving forward in this article we will focus on different perspectives of WordPress development. Starting from a developer who installs and uses WordPress plugins and themes, to a developer who develops them by himself and notices how modern WordPress development changes the way they’re evolved.

Modern Plugin Development

wordpress development plugins

Most likely, the PHP developer who works on WordPress plugins works with a PHP framework like Laravel, once they switch to work in a WordPress plugin, they feel disconnected from the modern stack, and they keep dreaming of WordPress being rewritten from scratch using such a framework.

Roots.io takes the initiative and puts back the fun in the WordPress plugin development, by introducing the Laravel or Ruby on Rails workflow to the WordPress world.  They developed a tool called Clover that will help you:

  • Create the initial structure of your plugin
  • Help you separate the code from the views and other resources
  • Make it easy to build configurable and testable plugin.
  • Allow you to use Blade and Eloquent ORM.
  • Allow you to build modern frontend using Laravel Mix.
  • Generate stubs easily using Artisan-like command interface.

It’s currently in beta mode, so make sure you subscribe and prepare yourself to use it, or at least benefit from their structure and concepts until it’s ready.

Modern Theme Development

The same company also offers another tool called Saga for theme developers with both backend and frontend workflow in mind. It offers a well-documented and supported WordPress starter theme with a modern development workflow.

Your theme will be configured to use Sass, automatically check JavaScript for errors, optimize images, enable synchronized browser testing, and more with their Webpack based setup supported with any frontend framework you confirm with including Bootstrap, Bulma, Foundation, Tachyons, and Tailwind.

The power of Laravel Blade is in your hand again with a well-organized theme folder structure, and to your surprise you’ll still have the ultimate power of the WordPress template hierarchy which will allow you to benefit from the best tools available in both worlds.

Final words about WordPress development

As we can see, both WordPress plugins and themes developers and the developers who use them to develop WordPress websites are able to use some modern tools to make WordPress development exciting. But what if your system becomes too big, and you find yourself serving millions of requests per day?

DevOps engineers would want to know that WordPress is not a traditional old school CMS, and that it supports the modern devops stacks like having official docker image and Kubernetes friendly with ready-made configurable helm charts.

No matter how big or small your case or project size is, you will find the suitable tool to help you through modern WordPress development and deployment, and with a careful selection of the plugins and themes, and an expert developer who can use these tools; WordPress can exceed your expectations when it comes to website sizes and the types of cases it can serve.

Image by: Launchpresso via Unsplash.