Author’s motivation and background story

How the author got into writing a paper on WordPress performance optimizations?

When I was younger (about 12–13 years old), I started to wonder about how the Internet and the web sites work and from what are they made of. That marked my life-long interest in web development. A few years ago, me and my friend wanted to create our first blog. That was the first time I stumbled upon WordPress. However, it was not until the year 2014, especially the summer of that year, that my interest in the WordPress web development started to get more serious. Getting back to the Comenius University to finish my computer science bachelor studies, it was then quite natural for me to select such a topic for my bachelor’s work.

Last year (2014), I got to work on an interesting Bitcoin-related project consisting primarily of a WordPress-powered news outlet. When I joined the developer’s team of the company behind the site, I was shocked by the poor performance and resource usage of the site. No one was into optimizing the server or the site (application) itself, but visitors were unsatisfied and complaining most of the time, so I took that part of the business as my responsibility.

Optimizing the web application

I started with rewriting the application extensions (such as plugins) programmed by developers who joined the company before me. I managed to decrease the loading times considerably mainly due to the fact that the original code was not architected and designed very well. After some time, an idea struck me — what we should concentrate on is making the underlying server software (stack) faster. As an example, what if we replaced Apache HTTP web server application with Nginx one? What if we install a PHP opcode caching? Or even better, what if we replace the original .php interpreter with Facebook’s HHVM?

The results

The results were great — loading time decreased, memory usage decreased and visitor count increased. Although we did not apply all of the tips and tricks which will be outlined and described in this paper, we still got an enormous performance improvements. These are the reasons why I am confident that after reading, studying and applying at least a part of what has been said will make a difference to your WordPress-based web site or application.

What is WordPress and why it needs performance optimizations

A brief introduction to WordPress

To cite, WordPress is web software you can use to create a beautiful website or blog. Simply put, WordPress is a very powerful, open source web publishing software, content management system and a web platform for building rich web applications. People and companies are using WordPress for various purposes and reasons, most notably for their blogs, websites, e-commerce solutions and large portals. At the time of writing (January 2015), it is estimated that about 23% 1 of all websites, whose content management system is known, is being run on WordPress. This number is quite astonishing because it means that visiting five random websites, one of them will be a WordPress-powered one.

A WordPress-powered website is composed of themes and plugins. A WordPress theme is a collection of scripts, stylesheets and images which make up the look and feel or even functionality of one’s website. It can be downloaded from different web repositories or even bought for as low as 40 US dollars. After it is downloaded, it can be copied into a designated folder inside the WordPress file structure and then activated through the WordPress Dashboard. A WordPress plugin is a pluggable piece of software which enhances the basic WordPress functionality, thus enabling its users to heavily modify their WordPress-based web applications and sites. At the time of writing (January 2015), there are about 3,000 free themes and 35,000 free plugins hosted on the public and open source repository. As we can all see and agree on from these facts and numbers, WordPress has a huge community and following.

Why WordPress needs performance optimizations?

WordPress, contrary to popular belief, was designed in mind with high performance and efficiency. Indeed, it is quite fast out of the box, after a fresh installation. However, as it is extremely extensible and pluggable, its users tend to use plenty of plugins and complex themes. These extensions are usually not tested and properly optimized before their release into the public repositories and online markets. Most of the best-selling themes are shipped with a large number of features and eye-candy effects, attracting the customer’s attention, while increasing the overall impact and load on the underlying server.

Another very important factor in the performance degradation of these system is a prevalent amateurism among many web hosting companies, system administrators and web developers. As the result of the widespread usage of WordPress-based web sites, many unskilled people jump into its development and administration, seeing the possible profit but forgetting about all the ‘mess’ they usually make.

With all of what has been said, I believe I have convinced the reader of this paper about the seriousness of the performance issues of WordPress-powered web applications and sites.

If WordPress is so popular, what are the available solutions to these problems?

I would be lying if I said there are not any solutions present at the current moment. The Internet and all of its blogs are full of articles discussing the endless possibilities of ‘fixing’ the WordPress speed and resources related issues. However, the common problem with these articles is their incompleteness and lack of attention to details. While you can find at least a hundred top ten lists of the best performance-increasing plugins and extensions, you hardly find a step by step guide focused only on making WordPress site faster and less resource-hungry.

For those readers who do not find time to read our whole paper, there exist several commercial solutions aimed at solving a large part of the WordPress-powered web applications and sites performance problems. Although I do not have direct experiences of using their services, looks like a promising and reliable WordPress hosting with speed optimizations in mind.

Coding in the cloud without the need of local environment

At our company, we have been getting a few WordPress-based website jobs lately. Usually, three of us work simultaneously on such a project and need to edit the same codebase with the same database (so the theme settings and content stays the same). We can share the changed files through git and database through exports and imports. However, this process is tedious and it slows down the development speed. Continue reading “Coding in the cloud without the need of local environment”

How To Fix WordPress 3.8 ImageMagic Media Upload Error

Lately, I’ve been working on some WordPress projects for my clients and had this ‘Http Error’ when uploading images (only images) to the Media Library. What didn’t help?
– Switching to the browser uploader. (When I switched I had a Proxy Error and blank page instead.)
– Chmoding wp-content/uploads or the entire WordPress directory to either 755 and 777.
– Deactivating all plugins and switching to the default Twenty Fourteen theme.
Continue reading “How To Fix WordPress 3.8 ImageMagic Media Upload Error”

How to diff two files easily in vim

As the saying goes, if you do something for the first time, do it. If you do it for the second time, copy-paste the process. If you do it for the third time, find a way how to save the process somewhere so you don’t need to find and copy-paste it. And I need to diff some files again…

So, how to do it in my favorite editor vim? Easily.

  1. Open the first file.
  2. Open the second file in the same window (so you have the files side by side). This can be done with theCtrl + w vcommand.
  3. Then, in the first window type the command:windo :diffthis

Here you go.

Writing WordPress Articles with Code Examples in Vim using Markdown

Lately, I’v been thinking about writing blog articles in Vim and finally, I found a solution! But before we get to the how to part of the article, let my first outline some of the reasons I wanted to use Vim for article writing instead of WordPress online text editor.
Continue reading “Writing WordPress Articles with Code Examples in Vim using Markdown”

PhpStorm and why I use it

For those who didn’t have any prior experience with JetBrains IDEs and applications, I can say that they are always top quality and very well known among large groups of developers. In this article, however, I’ll be focusing just on their web development IDE called PhpStorm (or the second IDE without PHP support called WebStorm), its advantages, disadvantages and usage cases.phpstorm_general Continue reading “PhpStorm and why I use it”

Create Google Map with Marker and Geocoder

As I’m learning JavaScript, I got an idea to make a simple Google Map with some additional stuff just to try it. I like the results so I decided to write a tutorial on how to make it. In this guide you’ll learn how to include Google Map on your website, how you make use of Google Geocoder to translate address into Google Maps latitude and longitude and how to make a simple marker with an info window and custom icon.  Continue reading “Create Google Map with Marker and Geocoder”