Disable XML-RPC-API - Version 2.1.4.1

Version Description

Download this release

Release Info

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

Code changes from version 2.1.4 to 2.1.4.1

Files changed (5) hide show
  1. admin/admin.js +100 -0
  2. admin/admin.php +0 -104
  3. disable-xml-rpc-api.php +40 -1
  4. index.php +1 -34
  5. readme.txt +1 -1
admin/admin.js ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ //shorthand for ready event.
3
+ $(
4
+ function () {
5
+ $( 'div[data-dismissible] a.dismiss-wpsg' ).click(
6
+ function (event) {
7
+ event.preventDefault();
8
+ var $this = $( this );
9
+
10
+ var attr_value, option_name, dismissible_length, data;
11
+
12
+ attr_value = $this.parent().attr( 'data-dismissible' ).split( '-' );
13
+ console.log(attr_value);
14
+ // remove the dismissible length from the attribute value and rejoin the array.
15
+ dismissible_length = attr_value.pop();
16
+
17
+ option_name = attr_value.join( '-' );
18
+
19
+ data = {
20
+ 'action': 'dismiss_admin_notice',
21
+ 'option_name': option_name,
22
+ 'dismissible_length': dismissible_length,
23
+ 'nonce': dismissible_notice.nonce
24
+ };
25
+
26
+ // We can also pass the url value separately from ajaxurl for front end AJAX implementations
27
+ $.post( ajaxurl, data );
28
+ $this.parent().addClass('hide');
29
+ }
30
+ );
31
+ }
32
+
33
+
34
+
35
+ )
36
+ $(
37
+ function () {
38
+ $( 'div[data-dismissible] a.remind-wpsg' ).click(
39
+ function (event) {
40
+ event.preventDefault();
41
+ var $this = $( this );
42
+
43
+ var attr_value, option_name, data;
44
+
45
+ attr_value = $this.parent().attr( 'data-dismissible' ).split( '-' );
46
+ // remove the dismissible length from the attribute value and rejoin the array.
47
+
48
+
49
+ option_name = attr_value.join( '-' );
50
+
51
+ data = {
52
+ 'action': 'dismiss_admin_notice',
53
+ 'option_name': option_name,
54
+ 'dismissible_length': 10,
55
+ 'nonce': dismissible_notice.nonce
56
+ };
57
+
58
+ // We can also pass the url value separately from ajaxurl for front end AJAX implementations
59
+ $.post( ajaxurl, data );
60
+ $this.parent().addClass('hide');
61
+ }
62
+ );
63
+ }
64
+ )
65
+
66
+ }(jQuery));
67
+
68
+ jQuery( document ).ready( function( $ ) {
69
+ var ratings = $( '.rating-stars' );
70
+ var selectedClass = 'dashicons-star-filled';
71
+
72
+ function dxtoggleStyles( currentInput ) {
73
+ var thisInput = $( currentInput );
74
+ var index = parseInt( thisInput.val() );
75
+
76
+ stars.removeClass( selectedClass );
77
+ stars.slice( 0, index ).addClass( selectedClass );
78
+ }
79
+
80
+ // If the ratings exist on the page
81
+ if ( ratings.length !== 0 ) {
82
+ var inputs = ratings.find( 'input[type="radio"]' );
83
+ var labels = ratings.find( 'label' );
84
+ var stars = inputs.next();
85
+
86
+ inputs.on( 'change', function( event ) {
87
+ dxtoggleStyles( event.target )
88
+ } );
89
+ inputs.on( 'click', function( event ) {
90
+ window.open("https://wordpress.org/support/plugin/disable-xml-rpc-api/reviews/#new-post");
91
+ } );
92
+ labels.hover( function( event ) {
93
+ $curInput = $( event.currentTarget ).find( 'input' );
94
+ dxtoggleStyles( $curInput );
95
+ }, function () {
96
+ $currentSelected = ratings.find( 'input[type="radio"]:checked' );
97
+ dxtoggleStyles( $currentSelected )
98
+ } );
99
+ }
100
+ });
admin/admin.php CHANGED
@@ -30,74 +30,6 @@ function dsxmlrpc_admin_notice_wpsg() {
30
  <span class="dashicons dashicons-dismiss" style="margin-left: 15px;color: #ff5722;vertical-align:-webkit-baseline-middle;"></span><a style="color:#ff5722;" class="dismiss-wpsg" href="#">Not Intrested!</a>
31
 
32
  </div>
33
- <script type="text/javascript">
34
- (function ($) {
35
- //shorthand for ready event.
36
- $(
37
- function () {
38
- $( 'div[data-dismissible] a.dismiss-wpsg' ).click(
39
- function (event) {
40
- event.preventDefault();
41
- var $this = $( this );
42
-
43
- var attr_value, option_name, dismissible_length, data;
44
-
45
- attr_value = $this.parent().attr( 'data-dismissible' ).split( '-' );
46
- console.log(attr_value);
47
- // remove the dismissible length from the attribute value and rejoin the array.
48
- dismissible_length = attr_value.pop();
49
-
50
- option_name = attr_value.join( '-' );
51
-
52
- data = {
53
- 'action': 'dismiss_admin_notice',
54
- 'option_name': option_name,
55
- 'dismissible_length': dismissible_length,
56
- 'nonce': dismissible_notice.nonce
57
- };
58
-
59
- // We can also pass the url value separately from ajaxurl for front end AJAX implementations
60
- $.post( ajaxurl, data );
61
- $this.parent().addClass('hide');
62
- }
63
- );
64
- }
65
-
66
-
67
-
68
- )
69
- $(
70
- function () {
71
- $( 'div[data-dismissible] a.remind-wpsg' ).click(
72
- function (event) {
73
- event.preventDefault();
74
- var $this = $( this );
75
-
76
- var attr_value, option_name, data;
77
-
78
- attr_value = $this.parent().attr( 'data-dismissible' ).split( '-' );
79
- // remove the dismissible length from the attribute value and rejoin the array.
80
-
81
-
82
- option_name = attr_value.join( '-' );
83
-
84
- data = {
85
- 'action': 'dismiss_admin_notice',
86
- 'option_name': option_name,
87
- 'dismissible_length': 10,
88
- 'nonce': dismissible_notice.nonce
89
- };
90
-
91
- // We can also pass the url value separately from ajaxurl for front end AJAX implementations
92
- $.post( ajaxurl, data );
93
- $this.parent().addClass('hide');
94
- }
95
- );
96
- }
97
- )
98
-
99
- }(jQuery));
100
- </script>
101
  <style>
102
  #dsxmlrpc-wpsg-notice.hide,#dsxmlrpc-wpsg-notice .notice-dismiss {
103
  display:none;
@@ -154,42 +86,6 @@ function dsxmlrpc_admin_notice_review() {
154
 
155
  </div>
156
 
157
- <script>
158
-
159
- jQuery( document ).ready( function( $ ) {
160
- var ratings = $( '.rating-stars' );
161
- var selectedClass = 'dashicons-star-filled';
162
-
163
- function dxtoggleStyles( currentInput ) {
164
- var thisInput = $( currentInput );
165
- var index = parseInt( thisInput.val() );
166
-
167
- stars.removeClass( selectedClass );
168
- stars.slice( 0, index ).addClass( selectedClass );
169
- }
170
-
171
- // If the ratings exist on the page
172
- if ( ratings.length !== 0 ) {
173
- var inputs = ratings.find( 'input[type="radio"]' );
174
- var labels = ratings.find( 'label' );
175
- var stars = inputs.next();
176
-
177
- inputs.on( 'change', function( event ) {
178
- dxtoggleStyles( event.target )
179
- } );
180
- inputs.on( 'click', function( event ) {
181
- window.open("https://wordpress.org/support/plugin/disable-xml-rpc-api/reviews/#new-post");
182
- } );
183
- labels.hover( function( event ) {
184
- $curInput = $( event.currentTarget ).find( 'input' );
185
- dxtoggleStyles( $curInput );
186
- }, function () {
187
- $currentSelected = ratings.find( 'input[type="radio"]:checked' );
188
- dxtoggleStyles( $currentSelected )
189
- } );
190
- }
191
- });
192
- </script>
193
  </div>
194
  <style>
195
  a.dsxmlrpc-ratings span:hover {
30
  <span class="dashicons dashicons-dismiss" style="margin-left: 15px;color: #ff5722;vertical-align:-webkit-baseline-middle;"></span><a style="color:#ff5722;" class="dismiss-wpsg" href="#">Not Intrested!</a>
31
 
32
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  <style>
34
  #dsxmlrpc-wpsg-notice.hide,#dsxmlrpc-wpsg-notice .notice-dismiss {
35
  display:none;
86
 
87
  </div>
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  </div>
90
  <style>
91
  a.dsxmlrpc-ratings span:hover {
disable-xml-rpc-api.php CHANGED
@@ -1,4 +1,15 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  namespace dsxmlrpc;
4
 
@@ -6,6 +17,20 @@ if (!defined('ABSPATH')) {
6
  exit;
7
  }
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  /**
10
  * Class xmlrpcSecurity
11
  * @package dsxmlrpc
@@ -34,6 +59,8 @@ class xmlrpcSecurity
34
  add_action('upgrader_process_complete', [$this, 'after_update'], 10, 2);
35
  add_action('init', [$this, 'speedUpWordpress']);
36
 
 
 
37
  add_action('skelet_options_inside', [$this, 'optionsSidebar']);
38
 
39
  if (isset($disabled_methods) && is_array($disabled_methods)) {
@@ -504,4 +531,16 @@ allow from all
504
  return $data;
505
  }
506
 
507
- }
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ /*
3
+ Plugin Name: Disable XML-RPC-API
4
+ Plugin URI: https://neatma.com/dsxmlrpc-plugin/
5
+ Description: Lightweight plugin to disable XML-RPC API and Pingbacks,Trackbacks for faster and more secure website.
6
+ Version: 2.1.4.1
7
+ Tested up to: 6.0
8
+ Requires at least: 3.5
9
+ Author: Neatma
10
+ Author URI: https://neatma.com/
11
+ License: GPLv2
12
+ */
13
 
14
  namespace dsxmlrpc;
15
 
17
  exit;
18
  }
19
 
20
+
21
+ // Constants
22
+ define('DSXMLRPC_FILE', __FILE__);
23
+ define('DSXMLRPC_PLUGIN_FILE', plugin_dir_path(__FILE__));
24
+ define('DSXMLRPC_URL', plugin_dir_url(__FILE__));
25
+ define('DSXMLRPC_HOME_PATH', function_exists('get_home_path') ? get_home_path() : ABSPATH);
26
+
27
+ require_once(DSXMLRPC_PLUGIN_FILE . '/admin/admin.php');
28
+ require_once(DSXMLRPC_PLUGIN_FILE . '/lib/skelet/framework.config.php');
29
+ if (!class_exists('PAnD')) {
30
+ require_once(DSXMLRPC_PLUGIN_FILE . '/lib/admin-notices/persist-admin-notices-dismissal.php');
31
+ }
32
+
33
+
34
  /**
35
  * Class xmlrpcSecurity
36
  * @package dsxmlrpc
59
  add_action('upgrader_process_complete', [$this, 'after_update'], 10, 2);
60
  add_action('init', [$this, 'speedUpWordpress']);
61
 
62
+ add_action( 'admin_enqueue_scripts', [$this, 'load_plugin_scripts']);
63
+
64
  add_action('skelet_options_inside', [$this, 'optionsSidebar']);
65
 
66
  if (isset($disabled_methods) && is_array($disabled_methods)) {
531
  return $data;
532
  }
533
 
534
+
535
+ /**
536
+ * Enqueue plugin scripts.
537
+ */
538
+ function load_plugin_scripts() {
539
+ wp_enqueue_script( 'dsxmlrpc_admin', DSXMLRPC_URL . '/admin/admin.js', array('jquery'), '1.0.1' );
540
+ }
541
+
542
+ }
543
+
544
+
545
+ // Initialize the main class
546
+ xmlrpcSecurity::initialize();
index.php CHANGED
@@ -1,35 +1,2 @@
1
- <?php
2
- /*
3
- Plugin Name: Disable XML-RPC-API
4
- Plugin URI: https://neatma.com/dsxmlrpc-plugin/
5
- Description: Lightweight plugin to disable XML-RPC API and Pingbacks,Trackbacks for faster and more secure website.
6
- Version: 2.1.4
7
- Tested up to: 6.0
8
- Requires at least: 3.5
9
- Author: Neatma
10
- Author URI: https://neatma.com/
11
- License: GPLv2
12
- */
13
-
14
- if ( ! defined( 'ABSPATH' ) ) {
15
- exit;
16
- }
17
-
18
- use dsxmlrpc\xmlrpcSecurity;
19
-
20
- // Constants
21
- define('DSXMLRPC_FILE', __FILE__);
22
- define('DSXMLRPC_PLUGIN_FILE', plugin_dir_path(__FILE__));
23
- define('DSXMLRPC_URL', plugin_dir_url(__FILE__));
24
- define('DSXMLRPC_HOME_PATH', function_exists('get_home_path') ? get_home_path() : ABSPATH);
25
-
26
- require_once(DSXMLRPC_PLUGIN_FILE . 'disable-xml-rpc-api.php');
27
- require_once(DSXMLRPC_PLUGIN_FILE . '/admin/admin.php');
28
- require_once(DSXMLRPC_PLUGIN_FILE . '/lib/skelet/framework.config.php');
29
- if (!class_exists('PAnD')) {
30
- require_once(DSXMLRPC_PLUGIN_FILE . '/lib/admin-notices/persist-admin-notices-dismissal.php');
31
- }
32
-
33
- // Initialize the main class
34
- xmlrpcSecurity::initialize();
35
 
1
+ <?php // silence is golden
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://neatma.com
5
  Contributors: aminnz,neatmarketing
6
  Description: Simple plugin to disable XML-RPC API and X-Pingback for faster and more secure website.
7
  Tags: disable xml-rpc, xmlrpc, disable xmlrpc,remove xmlrpc, XML-RPC, pingback, stop brute force attacks
8
- Version: 2.1.4
9
  Tested up to: 6.0
10
  Requires at least: 3.5
11
  Author: Neatma
5
  Contributors: aminnz,neatmarketing
6
  Description: Simple plugin to disable XML-RPC API and X-Pingback for faster and more secure website.
7
  Tags: disable xml-rpc, xmlrpc, disable xmlrpc,remove xmlrpc, XML-RPC, pingback, stop brute force attacks
8
+ Version: 2.1.4.1
9
  Tested up to: 6.0
10
  Requires at least: 3.5
11
  Author: Neatma