Disable REST API - Version 1.0

Version Description

  • Initial Release

=

Download this release

Release Info

Developer dmchale
Plugin Icon 128x128 Disable REST API
Version 1.0
Comparing to
See all releases

Version 1.0

Files changed (2) hide show
  1. disable-json-api.php +13 -0
  2. readme.txt +49 -0
disable-json-api.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Disable JSON API
4
+ * Plugin URI: http://www.binarytemplar.com/disable-json-api
5
+ * Description: Uses the built-in filters of the JSON REST API to disable its functionality
6
+ * Version: 1.0
7
+ * Author: Dave McHale
8
+ * Author URI: http://www.binarytemplar.com
9
+ * License: GPL2+
10
+ */
11
+
12
+ add_filter('json_enabled', '__return_false');
13
+ add_filter('json_jsonp_enabled', '__return_false');
readme.txt ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Disable JSON API ===
2
+ Contributors: dmchale
3
+ Tags: admin, api, json, REST, rest-api, disable
4
+ Requires at least: 4.0
5
+ Tested up to: 4.0
6
+ Stable tag: 1.0
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Uses the built-in filters of the JSON REST API to disable its functionality.
11
+
12
+ == Description ==
13
+
14
+ The JSON REST API is currently in development via the [JSON REST API](https://wordpress.org/plugins/json-rest-api/)
15
+ plugin by Ryan McCue. Soon, this functionality will become a part of WordPress Core. While this is very exciting news
16
+ for many reasons, it is also not functionality that every site admin is going to want enabled on their website.
17
+ Similar to other plugins which already disable the XML-RPC protocol, this plugin looks to make your life simple by
18
+ allowing you to disable the JSON REST API simply by installing and activating this plugin.
19
+
20
+ If you are such an admin, you can install this plugin now to ensure that your site will not support the JSON REST API
21
+ when it is launched as a part of WordPress Core.
22
+
23
+ This plugin simply uses two filters that are built into the API which turn off support for JSON and JSONP,
24
+ respectively. Nothing is done which is not intended by the API author(s).
25
+
26
+ == Installation ==
27
+
28
+ 1. Upload the `disable-json-api` directory to the `/wp-content/plugins/` directory via FTP
29
+ 1. Alternatively, upload the `disable-json-api_v#.#.zip` file to the 'Plugins->Add New' page in your WordPress admin
30
+ area
31
+ 1. Activate the plugin through the 'Plugins' menu in WordPress
32
+
33
+ == Frequently Asked Questions ==
34
+
35
+ n/a
36
+
37
+ == Screenshots ==
38
+
39
+ 1. The JSON returned by a website that is protected by this plugin.
40
+
41
+ == Changelog ==
42
+
43
+ = 1.0 =
44
+ * Initial Release
45
+
46
+ == Upgrade Notice ==
47
+
48
+ = 1.0 =
49
+ * Initial Release