/notify-for-wordpress

A notification plugin to help editors keep their content up-to-date

Primary LanguagePHPMIT LicenseMIT

MoJ logo
Notify For Wordpress

repo standards badge License



A notification plugin to help editors keep website content up-to-date.

Installation

Composer - Automated

It is possible to load this plugin using composer with the following preparation and definitions set:

  1. Installer paths
  2. Repository location
  3. Require definition

Installer paths

Find out about installers in the composer documentation.

The composer installers plugin will assist in placing this plugin in the correct location, within your installation.

In the location of your projects composer.json, run this command:

composer require composer/installers ^1.0

Result:

{
    "name": "your/project",
    "require": {
        "composer/installers": "~1.0"
    }
}

Let's assume our target location is the /wordpress/plugins/ directory. We would execute the following to add the location.

composer config --json extra.installer-paths '{"wordpress/plugins/{$name}/":["type:wordpress-plugin"]}'

Result

"extra": {
    "installer-paths": {
        "wordpress/plugins/{$name}/": ["type:wordpress-plugin"]
    }
}

The installer-paths property of composers' extra node instructs composer to place the plugin in the defined location.

Next, we need to add to, or create, a repositories node and add the following vcs snippet in your projects' composer.json file.

We can do this simply by executing this command:

composer config repositories.ministryofjustice vcs "https://github.com/ministryofjustice/notify-for-wordpress"
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/ministryofjustice/notify-for-wordpress"
    }
]

Once we have our VCS (Version Control System) defined, we can call the plugin by including the string in the require node of the JSON object.

composer require ministryofjustice/notify-for-wordpress dev-main

Result:

"ministryofjustice/notify-for-wordpress": "dev-main"

When you run composer install in your project, the plugin will be placed in the defined location, not the default vendor directory.

Manual installation

Download this repository, unzip and copy the folder into your WordPress plugin file directory.

Prerequisites

You will need to have a working version of WordPress to run this plugin.

Coding guidelines

This plugin follows standards set by the WordPress organisation. https://developer.wordpress.org/plugins/

Further this plugin, when possible follows the PHP Framework Interop Group's standards. http://www.php-fig.org/