cameronterry / dark-matter

A highly opinionated domain mapping plugin for WordPress Networks
Other
12 stars 2 forks source link

WIP: 2.0.0 #30

Closed cameronterry closed 5 years ago

cameronterry commented 5 years ago

VERY MUCH STILL A WORK IN PROGRESS AND NOT COMPLETE BY ANY MEANS.

Complete rebuild of the plugin.

New Features

Improvements over 1.x.x

Backward Compatibility Notices

CLI Commands

Add / Update / Remove Domains

Examples of adding, removing and updating a domain for a Site.

wp --url="sites.my.com/siteone" darkmatter domain add www.example.com --primary --https
wp --url="sites.my.com/siteone" darkmatter domain remove www.example.com
wp --url="sites.my.com/siteone" darkmatter domain remove www.example.com --force
wp --url="sites.my.com/siteone" darkmatter domain set www.example.com --primary
wp --url="sites.my.com/siteone" darkmatter domain set www.example.com --secondary

Listing Domains

Examples of listing domains for a Site.

wp --url="sites.my.com/siteone" darkmatter domain list
wp --url="sites.my.com/siteone" darkmatter domain list --format=json

Examples of listing domains for the entire Network.

wp darkmatter domain list
wp darkmatter domain list --format=csv

Retrieve all the primary domains for the Network.

wp darkmatter domain list --primary

Reserving Domains

Reserving a domain. This allows an administrator to setup the primary and / or secondary domains but stop Dark Matter performing redirects and rewrites. Please note; domains are enabled by default.

wp --url="sites.my.com/siteone" darkmatter domain add www.example.com --primary --https --disable
wp --url="sites.my.com/siteone" darkmatter domain set www.example.com --enable
wp --url="sites.my.com/siteone" darkmatter domain set www.example.com --disable

Restricting Domains

Examples of adding and removing a restricted domains for a Network. This permits administrators to stop domains from being used for a WordPress website; useful for organisations which use multiple CMS.

wp darkmatter restrict add www.example.com
wp darkmatter restrict remove www.example.com

Examples of retrieving a list of all restricted domains for a Network.

wp darkmatter restrict list
wp darkmatter restrict list --format=json
wp darkmatter restrict list --format=ids

Check / Upgrade Sunrise Dropin plugin

The following commands can be used to check if the Sunrise Dropin plugin (sunrise.php) matches the version contained with the Dark Matter plugin. You can also use the update command to install or update Sunrise Dropin.

Check if the Sunrise Dropin plugin matches the version within the installed version of Dark Matter.

wp darkmatter dropin check

Install the Sunrise Dropin plugin (this command will error if a sunrise.php file already exists).

wp darkmatter dropin update

Update and / or replace the Sunrise Dropin plugin with the version within the installed version of Dark Matter.

wp darkmatter dropin update --force
svandragt commented 5 years ago

The following syntax would make more sense to me conceptually:

# add and enable
wp --url="sites.my.com/siteone" darkmatter domain add www.example.com --primary --https --enable
# reserve and enable
wp --url="sites.my.com/siteone" darkmatter domain add www2.example.com 
wp --url="sites.my.com/siteone" darkmatter domain set www2.example.com --enable
wp --url="sites.my.com/siteone" darkmatter domain set www2.example.com --disable
svandragt commented 5 years ago

Grats