Skip to main content

Customizing the Wordpress Installation in Installatron

3 min read

I got a question on how to customize the Wordpress packages inside of a Domain of One's Own instance so I thought I'd share how we do it. I recently wrote about how OU Create was "shipping with Hypothes.is" so I understand why some folks are interested in curating themes and plugins for their specific community. We don't auto-install themes (mostly to keep Wordpress installations light and quick) but we do have a handful of different plugins, most of which are security recommendations such as Cookies for Comments. Anyways, to customize Installatron, you need to login to WHM, navigate to Installatron, and then head over to Customize:

Here is the custom code we have in that box:

What you can see is that there are three specific functions that one call call in order to activate plugins/themes (there's also some specific code for MediaWiki, which is basically a useless applications at its core, and requires several different plugins to even be worth your time--I'm ranting because I sort of despise of MediaWiki!)

The first is that you need to register the zip file, usually located in the Wordpress plugin/theme library, though it's not mandatory:

$this->registerArchive("hypothesis","https://downloads.wordpress.org/plugin/hypothesis.0.4.7.zip", "zip");

Next, you'll want to install the plugin/theme into the correct directory:

$o->extract("hypothesis", "wp-content/plugins");

You'll want to change /plugins to /themes if it's a theme

Last, you'll want to decide whether you activate it or not. We have chosen to install Hypothes.is but not activate it, allowing the user to make that decision. But in the event you want to activate it, you'll want to tack it on to this array:

>$o->db_query("UPDATE `{$o->db_prefix}options` SET `option_value`=? WHERE `option_name`='active_plugins' LIMIT 1",array( serialize(array("cookies-for-comments/cookies-for-comments.php","wordpress-importer/wordpress-importer.php","subscribe-to-comments/subscribe-to-comments.php")) ));

As I said earlier, I'm a fan of customized approaches for different community needs. My recommendation is to pick a few specific tools or looks for your community (I always recommend Anders Noren themes) but only pick a few. Otherwise you'll installation file size will jump and really bog down the server and make users unhappy.

It's also worth mentioning that at OU we are standing on the shoulders of giants as this code as been adapted from the University of Mary Washington's Domain of One's Own installation, which was coded by Tim Owens and Martha Burtis. We aren't anything without that team.