WordPress Installer

A software and website developer always seeks opportunities to enhance processes. For my web development, I have developed a command line application called WordPress Installer.

The application downloads the latest version of WordPress and prepares the setup for a new local domain with XAMPP. Learn more about XAMPP.

Example

Let's say we wish to create a local website for an online bakery.

install the-cookie-bakery

The online bakery will need an online store such as WooCommerce. For their SEO optimization they will use Yoast SEO tools. A contact form is in order as well, such as Contact Form 7.

We will add the plugins as follows:
add the-cookie-bakery woocommerce yoast contactform7

This will install the plugins automatically in the correct folders.

How does it work?

If we look at the URL for a plugin such as WooCommerce, we find that it is https://wordpress.org/plugins/woocommerce/.

However, a plugin such as Yoast SEO does not have the URL as we might expect https://wordpress.org/plugins/yoast-seo/ does not exist. The correct URL is https://wordpress.org/plugins/wordpress-seo/.
Therefore I have added a mapping feature as well. It is easier to remember yoast instead of wordpress-seo.

The application takes the arguments, maps them to the correct name if necessary and parses them into the URL. On the page, it will fetch the URL of the zip file. This zip file will be downloaded and extracted in the plugins directory of the domain you gave up.

What is next?

If you develop many online stores, the plugins you need are usually similar. Therefore I will add a feature to create a dependency file. The command would look something like this:

add the-cookie-bakery -d online-store

This command will search for a file named online-store.txt in your installation folder. The file simply contains a list of the plugins names which will be downloaded in the domain name folder.

woocommerce
yoast
contactform7

Suggestions

If you have any suggestions or if you have discovered some bugs, please let me know. I will be happy to look into it.

Links

Find the repository on GitHub