WordPress: Cloning a Live Site to make a Test Site

A common task when administrating WordPress is to set up a copy of an existing site in a sub-directory of the same server, which can be used to test potentially site-breaking changes (such as plugin updates). I recently had to do this on a website with a particularly large amount of data, and my usual technique of cloning a WordPress site was not sufficient. In this article I will be documenting what I learned from this job.

Continue reading “WordPress: Cloning a Live Site to make a Test Site”

BASH: Minifying and combining JavaScript files

Sass has the nice feature of taking a group of source files and putting them together as a single CSS file, with the advantage of reducing the number of HTTP connections the web browser has to open when loading your webpage, thus speeding it up. It also has the option to minify the code—taking out any characters that are purely cosmetic. In this article we will perform a similar task for JavaScript files, using BASH and a JavaScript minifier program.

Continue reading “BASH: Minifying and combining JavaScript files”

BASH: Making a simple ‘Yes/No’ Prompt

On Linux I often use the shutdown now command to shut down my computer, so I thought I would alias it to sdn. However, I was concerned that it might be too easy to accidentally type these three characters and end up losing unsaved work, so I decided to implement a prompt to confirm the shutdown. In this article we shall be looking at how I implemented this with a simple BASH script.

Continue reading “BASH: Making a simple ‘Yes/No’ Prompt”