-
Notifications
You must be signed in to change notification settings - Fork 28
/
README.txt
112 lines (78 loc) · 4.54 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
=== Multisite JSON API ===
Contributors: remkade
Tags: json, api, multisite
Requires at least: 3.5.1
Tested up to: 3.9.1
Stable tag: trunk
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
This provides several endpoints for creating, listing, and deleting sites with JSON formatted data.
== Description ==
This is a Wordpress Plugin that adds JSON endpoints for creating, listing, and deleting sites on multisite.
This plugin aims to be simple to make Wordpress polyglot environments not only possible, but practical.
== Installation ==
You can install this using all the usual methods. The only thing different is that this plugin **must** but network activated.
= Using The WordPress Dashboard =
1. Navigate to the 'Add New' in the plugins dashboard
2. Search for 'multisite json api'
3. Click 'Install Now'
4. Network Activate the plugin on the Plugin dashboard
= Uploading in WordPress Dashboard =
1. Navigate to the 'Add New' in the plugins dashboard
2. Navigate to the 'Upload' area
3. Select `multisite-json-api.zip` from your computer
4. Click 'Install Now'
5. Network Activate the plugin in the Plugin dashboard
= Using FTP =
1. Download `multisite-json-api.zip`
2. Extract the `multisite-json-api` directory to your computer
3. Upload the `multisite-json-api` directory to the `/wp-content/plugins/` directory
4. Network Activate the plugin in the Plugin dashboard
== Frequently Asked Questions ==
= Where is the documentation for the API? =
Take a look at the [github page](http://github.com/remkade/multisite-json-api/) for the full documentation.
== Screenshots ==
None
== Changelog ==
= 1.0.0 =
* Create, List, Delete are all working.
= 0.5.0 =
* Almost feature complete
= 0.0.1 =
* Initial creation
== Upgrade Notice ==
= 1.0.0 =
Full set of basic features implemented. You shouldn't be running anything before this release.
= 0.5.0 =
List and Create endpoints work.
== API Documentation ==
= Security =
Make sure you limit access to the enpoints! You should not allow any yahoo off the internet to scan your site and look for these endpoints. I highly recommend some sort of `.htaccess` or nginx configuration settings to deny access to all but the local addresses you use for the API clients. More info on the [github page](http://github.com/remkade/multisite-json-api/).
= Authentication =
All of the endpoints require you to authenticate with an existing wordpress user. Currently all require the superadmin role, but that may change.
Username and password are passed with the HTTP Headers `Username` and `Password` respectively. These are plain text so you need to be using SSL (which you are doing already right?).
= Create Site =
- **URL:** /wp-content/multisite-json-api/endpoints/create-site.php
- **Method:** POST
- **Works with subdomains?:** yes
- **Works with subdirectories?** yes
- **Payload example:** `{"email": "[email protected]", "site_name": "awesomeblog", "title": "Awesome Blog", "password":"123456"}`
- **Description:** Creates a site. If the email address does not exist this will create a new user with that email address. The `site_name` is the path or subdomain you would like to use, password os optional, if not set will fallback to a random generated one.
= List Sites =
- **URL:** /wp-content/multisite-json-api/endpoints/list-sites.php
- **Method:** GET
- **Works with subdomains?:** yes
- **Works with subdirectories?** yes
- **Payload example:** No payload, only GET variables
- **GET Variables:** public, spam, archived, deleted
- **Description:** Lists sites by wordpress tags. All of the variables are boolean 0 or 1, and will list sites where that variable is set to the boolean provided. For example: `?public=1&deleted=0` will list all sites that are public but not deleted.
= Delete Site =
- **URL:** /wp-content/multisite-json-api/endpoints/delete-site.php
- **Method:** DELETE
- **Works with subdomains?:** yes
- **Works with subdirectories?** yes
- **Payload example:** `{"blog_id": 49, "drop": false}`
- **Description:** Deletes a site. If `drop` is set to `true` wordpress will remove the site from the database completely. Otherwise the only thing this does is set the `deleted` attribute on the site to `true`.
== Updates ==
The basic structure of this plugin was cloned from the [WordPress-Plugin-Boilerplate](https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate) project.
This plugin supports the [GitHub Updater](https://github.com/afragen/github-updater) plugin, so if you install that, this plugin becomes automatically updateable direct from GitHub. Any submission to WP.org repo will make this redundant.