Skip to content

Commit

Permalink
Update docs (#183)
Browse files Browse the repository at this point in the history
* Update docs.
* Add support links
* Refresh some descriptions and explainations
* Grammar & syntax improvements

Co-authored-by: John James Jacoby <[email protected]>
  • Loading branch information
spacedmonkey and JJJ authored Aug 30, 2021
1 parent 69d3eea commit a109785
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 28 deletions.
27 changes: 17 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
# Contributing

Contributions to WP Multi Network are much appreciated. You can help out in several ways:
Contributions are greatly appreciated. You can help in several ways:

* [File an issue.](https://github.com/stuttter/wp-multi-network/issues/new)
* [Open a pull-request.](https://github.com/stuttter/wp-multi-network/compare)
* [Translate the plugin.](https://translate.wordpress.org/projects/wp-plugins/wp-multi-network)
* [Translate some strings.](https://translate.wordpress.org/projects/wp-plugins/wp-multi-network)

## Requirements & Recommendations

When contributing code to WP Multi Network, please keep the folowing in mind:
When contributing code specifically, please keep the following in mind:

* Write code that is backward-compatible to PHP 5.2 and WordPress 4.6.
* Write code that is backward-compatible to PHP 5.2 and WordPress 4.9.
* Follow the [WordPress coding and documentation standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/).
* If possible, provide integration tests for your changes.
* If applicable, provide integration tests for your changes.

WP Multi Network provides easy-to-use workflows for both running integration tests (using PHPUnit) and checking coding and documentation standards (using PHPCodeSniffer). The plugin is integrated with Travis-CI in order to ensure those always pass.
This project provides workflows for:

* running integration tests (using PHPUnit)
* checking coding and documentation standards (using PHPCodeSniffer).

It is also integrated with Travis-CI to ensure those always pass.

### PHPUnit and PHPCS Workflows

It is recommended to run integration tests and PHPCodeSniffer locally before committing, to check in advance that your changes do not cause unexpected issues. Here is how you can do that:

* After cloning the plugin, you need to set up its dependencies by running `composer install`, and then `composer config-phpcs` to set up the WordPress Coding Standards. You only need to do this once.
* In order to run the integration tests, you need to run `vendor/bin/phpunit`.
* In order to check against the WordPress Coding Standards, you need to run `vendor/bin/phpcs`.
* `composer install`: Set up all plugin dependencies
* `vendor/bin/phpunit`: Run the integration tests.
* `vendor/bin/phpcs`: Check against the WordPress Coding Standards.

### Writing Integration Tests

Integration tests should go into the `tests/integration/tests` directory. Each test class should extend the `WPMN_UnitTestCase` class, and file names should be prefixed with `test-`.
* Integration tests go into the `tests/integration/tests` directory.
* File names must be prefixed with `test-`.
* Each test class must extend the `WPMN_UnitTestCase` class.
45 changes: 30 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,33 @@

# WP Multi Network

A Network Management UI for global admins in a WordPress Multisite environment
Provides a Network Management Interface for global administrators in WordPress Multisite installations.

Turn your multi-site installation of WordPress into many multi-site networks, all surrounding one central user base.
Turn your WordPress Multisite installation into many multisite networks, surrounding one global set of users.

WP Multi Network allows cape wearing super-admins to create new networks of sites, allowing for infinitely extensible site, network, and domain arrangements.
* Reveals hidden WordPress Multisite functionality.
* Includes a "Networks" top-level Network-Admin menu.
* Includes a List Table for viewing available networks.
* Allows moving subsites between networks.
* Allows global administrators to create new networks with their own sites and domain arrangements.
* Group sites into logical networks using nearly any combination of domain (example.org) and path (/site/).

# Installation

* Download and install using the built in WordPress plugin installer.
* Activate in the "Plugins" network admin panel using the "Network Activate" link.
* Comment out the `DOMAIN_CURRENT_SITE` line in your `wp-config.php` file. If you don't have this line, you probably need to enable multisite.

### Shared Cookies
### Cookie Configuration

Stash something like this in your `wp-config.php` to use a single cookie configuration across all sites & networks.

Replace `example.com` with the domain for the main site in your primary network.

Stash something similar to this in your `wp-config.php` to share cookies across all sites & networks.
```php
// Cookies
define( 'COOKIEHASH', md5( 'yourdomain.com' ) );
define( 'COOKIE_DOMAIN', 'yourdomain.com' );
define( 'COOKIEHASH', md5( 'example.com' ) );
define( 'COOKIE_DOMAIN', 'example.com' );
define( 'ADMIN_COOKIE_PATH', '/' );
define( 'COOKIEPATH', '/' );
define( 'SITECOOKIEPATH', '/' );
Expand All @@ -38,7 +46,10 @@ define( 'LOGGED_IN_COOKIE', 'thing_logged_in' . COOKIEHASH );

### Domain/Sub-domain flexibility

Stash something similar to this in your `wp-config.php` to make new site/network/domain creation and resolution as flexible as possible. You'll likely need some server configuration outside of WordPress to help with this (documentation pending.)
Stash something like this in your `wp-config.php` to make new site/network/domain creation and resolution as flexible as possible.

You'll likely need some server configuration outside of WordPress to help with this (documentation pending.)

```php
// Multisite
define( 'MULTISITE', true );
Expand All @@ -57,8 +68,8 @@ define( 'DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST'] );
* These are purposely set for maximum compliance with multisite and
* multinetwork. Your config may vary.
*/
define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] );
define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] );
define( 'WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] );
define( 'WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] );
```

### Single Sign-on
Expand All @@ -73,22 +84,26 @@ Yes you can. That is what this plugin does best.

### Will this work on standard WordPress?

You need to have multi-site functionality enabled before using this plugin. https://codex.wordpress.org/Create_A_Network
You need to have WordPress Multisite enabled before using this plugin.

See: https://codex.wordpress.org/Create_A_Network

### Where can I get support?

The WordPress support forums: https://wordpress.org/tags/wp-multi-network/
Community: https://wordpress.org/support/plugin/wp-multi-network

Development: https://github.com/stuttter/wp-multi-network/discussions

### What's up with uploads?

WP Multi-Network needs to be running to set the upload path for new sites. As such, all new networks created with this plugin will have it network activated. If you do disable it on one of your networks, any new site on that network will upload files to that network's root site, effectively causing them to be broken.

(TL;DR - Leave this plugin activated and it will make sure uploads go where they're suppose do.)
Leave this plugin activated, and it will make sure uploads go where they are expected to.

### Can I achieve a multi-level URL path structure domain/network/site with subfolder network?

To achieve nested folder paths in this fashion `network1/site1`, `network1/site2` etc, please follow the steps in this [article](https://github.com/stuttter/wp-multi-network/wiki/WordPress-Multisite-With-Nested-Folder-Paths) to construct a custom `sunrise.php` (Thanks to https://paulund.co.uk for providing these steps).
To achieve nested folder paths in this fashion `network1/site1`, `network1/site2` etc, please follow the steps in this [article](https://github.com/stuttter/wp-multi-network/wiki/WordPress-Multisite-With-Nested-Folder-Paths) to construct a custom `sunrise.php` (Thanks to [Paul Underwood](https://paulund.co.uk) for providing these steps).

### Can I contribute?

Please! The number of users needing multiple WordPress networks is growing fast. Having an easy-to-use interface and powerful set of functions is critical to managing complex WordPress installations. If this is your thing, please help us out! Read more in the [plugin contributing guidelines](https://github.com/stuttter/wp-multi-network/blob/master/CONTRIBUTING.md).
Yes! Having an easy-to-use interface and powerful set of functions is critical to managing complex WordPress installations. If this is your thing, please help us out! Read more in the [plugin contributing guidelines](https://github.com/stuttter/wp-multi-network/blob/master/CONTRIBUTING.md).
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "stuttter/wp-multi-network",
"description": "A Network Management UI for global administrators in WordPress Multisite",
"homepage": "https://github.com/stuttter/wp-multi-network",
"description": "Provides a Network Management Interface for global administrators in WordPress Multisite installations.",
"homepage": "https://wordpress.org/plugins/wp-multi-network/",
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"authors": [
Expand All @@ -10,6 +10,11 @@
"email": "[email protected]"
}
],
"support": {
"source": "https://github.com/stuttter/wp-multi-network",
"issues": "https://github.com/stuttter/wp-multi-network/issues",
"forum": "https://github.com/stuttter/wp-multi-network/discussions"
},
"require": {
"php": ">=5.2",
"composer/installers": "^1.0"
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ You can activate it, but it won't do anything. You need to have the multisite fu

= Where can I get support? =

The WordPress support forums: https://wordpress.org/support/plugin/wp-multi-network/
Create a GitHub issue: https://github.com/stuttter/wp-multi-network/issues/new

= What about multisite constants? =

Expand Down

0 comments on commit a109785

Please sign in to comment.