Disable XML-RPC-API - Version 1.0.7

Version Description

  • Fix blank page when using W3 Total Cache and some other cache plugins
Download this release

Release Info

Developer aminnz
Plugin Icon 128x128 Disable XML-RPC-API
Version 1.0.7
Comparing to
See all releases

Code changes from version 1.0.6 to 1.0.7

Files changed (2) hide show
  1. disable-xml-rpc-api.php +5 -8
  2. readme.txt +5 -1
disable-xml-rpc-api.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Disable XML-RPC-API
4
  Plugin URI: https://neatma.com/
5
  Description: Simple plugin to disable XML-RPC API and X-Pingback in WordPress 3.5+ for faster and more secure website.
6
- Version: 1.0.6
7
  Tested up to: 5.6
8
  Requires at least: 3.5
9
  Author: Amin Nazemi
@@ -17,8 +17,6 @@ require_once(dsxmlrpc_plugin_url . '/lib/admin-notices/persist-admin-notices-dis
17
  require_once(dsxmlrpc_plugin_url . 'admin/admin.php');
18
 
19
  add_action( 'admin_init', array( 'PAnD', 'init' ) );
20
-
21
-
22
  add_filter('xmlrpc_enabled', '__return_false');
23
 
24
 
@@ -26,17 +24,16 @@ add_filter('xmlrpc_enabled', '__return_false');
26
 
27
  add_filter( 'wp_headers', 'dsxmlrpc_x_pingback' );
28
  add_filter('pings_open', '__return_false', PHP_INT_MAX);
29
- add_action('wp_head','dsxmlrpc_wp_head_buffer');
30
 
31
  function dsxmlrpc_x_pingback( $headers ) {
32
  unset( $headers['X-Pingback'] );
33
  return $headers;
34
  }
35
  function dsxmlrpc_wp_head_buffer() {
36
- $in = ob_get_clean();
37
- $in = preg_replace('#<link rel="pingback"(.*?)>#', '', $in);
38
-
39
- echo $in;
40
  }
41
 
42
 
3
  Plugin Name: Disable XML-RPC-API
4
  Plugin URI: https://neatma.com/
5
  Description: Simple plugin to disable XML-RPC API and X-Pingback in WordPress 3.5+ for faster and more secure website.
6
+ Version: 1.0.7
7
  Tested up to: 5.6
8
  Requires at least: 3.5
9
  Author: Amin Nazemi
17
  require_once(dsxmlrpc_plugin_url . 'admin/admin.php');
18
 
19
  add_action( 'admin_init', array( 'PAnD', 'init' ) );
 
 
20
  add_filter('xmlrpc_enabled', '__return_false');
21
 
22
 
24
 
25
  add_filter( 'wp_headers', 'dsxmlrpc_x_pingback' );
26
  add_filter('pings_open', '__return_false', PHP_INT_MAX);
27
+ add_action('wp_head','dsxmlrpc_wp_head_buffer', PHP_INT_MAX);
28
 
29
  function dsxmlrpc_x_pingback( $headers ) {
30
  unset( $headers['X-Pingback'] );
31
  return $headers;
32
  }
33
  function dsxmlrpc_wp_head_buffer() {
34
+ $in = ob_get_contents();
35
+ $out = preg_replace('#<link rel="pingback"(.*?)>#', '', $in);
36
+ echo $out;
 
37
  }
38
 
39
 
readme.txt CHANGED
@@ -21,6 +21,7 @@ Pretty simply, this plugin disables the XML-RPC API on a WordPress site running
21
 
22
  * Disable access to xmlrpc.php file using .httacess file
23
  * Disable X-pingback API to minimize CPU usage
 
24
  * Remove and disable xmlrpc API entirely
25
 
26
 
@@ -66,4 +67,7 @@ screenshot-1.png
66
  * Add ability to fix htaccess
67
 
68
  = 1.0.6 =
69
- * Fix warnings for htaccess permission
 
 
 
21
 
22
  * Disable access to xmlrpc.php file using .httacess file
23
  * Disable X-pingback API to minimize CPU usage
24
+ * Remove ping back ping link from header
25
  * Remove and disable xmlrpc API entirely
26
 
27
 
67
  * Add ability to fix htaccess
68
 
69
  = 1.0.6 =
70
+ * Fix warnings for htaccess permission
71
+
72
+ = 1.0.7 =
73
+ * Fix blank page when using W3 Total Cache and some other cache plugins