Securing your WordPress site running on Nginx

Nginx is a modern and fast web server software. If you are not familiar with Nginx, you might be familiar with the Apache HTTP web server software. Both of them can serve your WordPress-powered site, though there are notable differences in performance and the way they work. I won’t be comparing them in this article, […]

Submitting your Composer-powered plugin to Packagist.org

Are you working on a new super useful WordPress plugin? Do you want it to be developer-friendly? Define it as a Composer package and submit it to the official Composer package repository: Packagist.org. Other programmers can then require your plugin as a dependency to their projects. You’ll make their lives much better and they’ll give […]

Automated WordPress installation with Ansible

In the second article of the Ansible and WordPress series, we discussed the basic Ansible project structure and setting up WP-CLI and PHP. Today, I’ll walk you through creating a new database, adding a new user with correct permissions to this database, downloading WordPress with WP-CLI and configuring it properly to use our newly created […]

Ansible and WordPress: roles and playbooks

Since writing the article on why you should use Ansible for managing your WordPress deploys on VPS servers, I’ve added some basic configurations to my GitHub repo about this topic. In this article, we’ll be discussing how the standard Ansible project folder structure looks like and I’ll show you how to set up simple roles […]

Automated server configuration with Ansible

In this series of articles, we’ll be automating server (VPS) configuration with the help of Ansible, an open source IT automation platform. Interested in not having to install and set up Apache/Nginx, PHP and MySQL with WordPress on your VPS servers manually? Then read more! But first, let me tell you a short story of […]

Custom routing mechanism in WordPress themes (MVC like)

I had a need to implement custom routing system in my WordPress theme. I’m developing a web application, not a typical theme. There is a predefined set of pages in the app and each of them has its own view (template). Ideally, the design and structure (HTML/CSS) of these templates are located in files, not […]

PHP error reporting and logging

Logging and error reporting are parts of a debugging process. For some programmers, putting define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘SAVEQUERIES’, true); define(‘SCRIPT_DEBUG’, true); in the wp-config.php file is the end of the story. Let’s discuss how we can improve the debugging process of our WordPress-based web app.

Better WordPress profiling with xhprof and $ignoredFunctions

Are you profiling your WordPress-based web application/site with xhprof? Go read my other article about how to install and configure xhprof profiler with WordPress. Even if you are already familiar with xhprof, there is a small but important problem: the profiling results are unnecessary bloated.

add_filter

Global function add_filter is an integral part of WordPress core. Together with the function apply_filters, you can extend WordPress core, plugins and themes without touching a single line in them. Thanks to this, updates become straightforward — just copy and replace the old code with the new one. I’ll be explaining sections of WordPress core, […]

Profiling WordPress with xhprof on Mac OS X 10.10

A WordPress site usually comprises a theme and many plugins. If loading speeds and server load are fine for you, congratulations. Otherwise, you have to profile your WordPress-based application. Simply put, profiling means to measure how much CPU time and memory each executed function took. Let’s say you create a custom function to count from […]