Aaron Fryer

WordPress must use plugins.

Must use plugins are plugins that can't be deactivated or updated in the CMS. They are a great way of "foolproofing" a website.

What are must use plugins?

Must use plugins are plugins that cannot be deactivated and are essential for the website to function correctly. These are a great way of “foolproofing” your website for a client.

What are the positives?

Cannot be deactivated Are not visible in the main plugin list so are “invisible” to a client They are loaded before regular plugins

What are the negatives?

WordPress looks for PHP files and not files in folders so plugins need to be loaded in. Updates need to be manually – this isn’t a negative in the “idiotproofing” sense but when we do site maintenance we would have to manually check if a plugin has updates.

What is the use case?

Lets say our website requires certain plugins and cannot function without them such as Timber and Gravity Forms. We want to ensure that they are always on and the client doesn’t update them (especially timber). We would place these in our mu-plugins folder.

How do we implement must use plugins?

Lets start by navigating to our wp-config folder and create a folder next to our plugins folder called mu-plugins. Inside mu-plugins create a .php file Inside that file include your plugin files like so:

require_once(__DIR__ . '/timber-library/timber.php');

An you should now have Timber loaded as a must use plugin.

Posted in Coding, Tutorials, Learning, Blog on Feb 05, 2017