From 0b9cabbf1512e1464496711be8ea72ba795d3c47 Mon Sep 17 00:00:00 2001 From: Iain Date: Tue, 5 Mar 2019 11:50:59 +0000 Subject: [PATCH] Make mu-plugin for Composer and add instructions. --- README.md | 10 ++++++++-- composer.json | 23 ++++++++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 01e5cb4..6319e6f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,13 @@ This must-use plugin adds page cache purging functionality to your WordPress sit ## Install -Copy the contents of the `src` directory to `/wp-content/mu-plugins`, giving a directory structure like so: +You can install the mu-plugin with Composer: + +```bash +composer require deliciousbrains/spinupwp-mu-plugin +``` + +Or manually by downloading the zip and then copying the contents of the `src` directory to `/wp-content/mu-plugins`, giving a directory structure like so: ``` ├── wp-content @@ -15,7 +21,7 @@ Copy the contents of the `src` directory to `/wp-content/mu-plugins`, giving a d └── themes ``` -Add the following constants to your `wp-config.php`: +Finally add the following constants to your `wp-config.php`: ``` define( 'WP_CACHE_KEY_SALT', '{DOMAIN}' ); diff --git a/composer.json b/composer.json index 6d334ee..6d66ac7 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,16 @@ { - "name": "deliciousbrains/spinupwp-mu-plugin", - "description": "WordPress must-use plugin for sites hosted with SpinupWP", - "license": "GPLv2", - "authors": [ - { - "name": "Delicious Brains", - "email": "nom@deliciousbrains.com" - } - ] + "name": "deliciousbrains/spinupwp-mu-plugin", + "description": "WordPress must-use plugin for sites hosted with SpinupWP", + "license": "GPLv2", + "authors": [ + { + "name": "Delicious Brains", + "email": "nom@deliciousbrains.com" + } + ], + "type": "wordpress-muplugin", + "require": { + "composer/installers": "~1.0", + "lkwdwrd/wp-muplugin-loader": "~1.0.0" + } }