Remove XMLRPC Pingback Ping - Version 1.4

Version Description

  • New: Added a count under "Settings -> General" to see number of blocked attempts.
  • Tested up to WP 5.8
  • Added newsletter admin notice.
  • Code hardening.
Download this release

Release Info

Developer cleverplugins
Plugin Icon 128x128 Remove XMLRPC Pingback Ping
Version 1.4
Comparing to
See all releases

Code changes from version 1.3 to 1.4

README.txt CHANGED
@@ -1,14 +1,14 @@
1
  === Remove & Disable XML-RPC Pingback ===
2
  Contributors: cleverplugins, lkoudal
3
  Tags: xmlrpc, xml-rpc, ping, pingback, disable ping, disable xmlrpc, disable pingback, disable xml-rpc
4
- Requires at least: 4.0
5
  Requires PHP: 5.6
6
- Tested up to: 5.5.1
7
- Stable tag: 1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Prevent pingback, XML-RPC and denial of service attacks by disabling the XML-RPC pingback functionality.
12
 
13
  == Description ==
14
 
@@ -74,6 +74,12 @@ It could be! Use [Sucuri's WordPress DDOS Scanner](https://labs.sucuri.net/?is-m
74
 
75
  == Changelog ==
76
 
 
 
 
 
 
 
77
  = 1.3 =
78
  * 2020/09/21
79
  * Cleaned up code
@@ -86,4 +92,4 @@ It could be! Use [Sucuri's WordPress DDOS Scanner](https://labs.sucuri.net/?is-m
86
  * version bump
87
 
88
  = 1.0.0 =
89
- * First release
1
  === Remove & Disable XML-RPC Pingback ===
2
  Contributors: cleverplugins, lkoudal
3
  Tags: xmlrpc, xml-rpc, ping, pingback, disable ping, disable xmlrpc, disable pingback, disable xml-rpc
4
+ Requires at least: 5.2
5
  Requires PHP: 5.6
6
+ Tested up to: 5.8
7
+ Stable tag: 1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Prevent pingback, XML-RPC and denial of service DDOS attacks by disabling the XML-RPC pingback functionality.
12
 
13
  == Description ==
14
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.4 =
78
+ * New: Added a count under "Settings -> General" to see number of blocked attempts.
79
+ * Tested up to WP 5.8
80
+ * Added newsletter admin notice.
81
+ * Code hardening.
82
+
83
  = 1.3 =
84
  * 2020/09/21
85
  * Cleaned up code
92
  * version bump
93
 
94
  = 1.0.0 =
95
+ * First release
composer.lock ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_readme": [
3
+ "This file locks the dependencies of your project to a known state",
4
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
+ "This file is @generated automatically"
6
+ ],
7
+ "content-hash": "c7835049a1679de286f7a9cb1e8389d5",
8
+ "packages": [
9
+ {
10
+ "name": "collizo4sky/persist-admin-notices-dismissal",
11
+ "version": "1.4.4",
12
+ "source": {
13
+ "type": "git",
14
+ "url": "https://github.com/w3guy/persist-admin-notices-dismissal.git",
15
+ "reference": "900739eb6b0ec0210465f5983a6d4e0e420289e4"
16
+ },
17
+ "dist": {
18
+ "type": "zip",
19
+ "url": "https://api.github.com/repos/w3guy/persist-admin-notices-dismissal/zipball/900739eb6b0ec0210465f5983a6d4e0e420289e4",
20
+ "reference": "900739eb6b0ec0210465f5983a6d4e0e420289e4",
21
+ "shasum": ""
22
+ },
23
+ "require": {
24
+ "php": ">=5.4"
25
+ },
26
+ "type": "library",
27
+ "autoload": {
28
+ "classmap": [
29
+ "persist-admin-notices-dismissal.php"
30
+ ]
31
+ },
32
+ "notification-url": "https://packagist.org/downloads/",
33
+ "license": [
34
+ "GPL-3.0-or-later"
35
+ ],
36
+ "authors": [
37
+ {
38
+ "name": "Collins Agbonghama",
39
+ "email": "me@w3guy.com",
40
+ "role": "developer"
41
+ }
42
+ ],
43
+ "description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard.",
44
+ "time": "2020-12-31T17:12:37+00:00"
45
+ }
46
+ ],
47
+ "packages-dev": [],
48
+ "aliases": [],
49
+ "minimum-stability": "stable",
50
+ "stability-flags": [],
51
+ "prefer-stable": false,
52
+ "prefer-lowest": false,
53
+ "platform": [],
54
+ "platform-dev": [],
55
+ "plugin-api-version": "1.1.0"
56
+ }
images/sn-icon.png ADDED
Binary file
index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
phpcs.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPress Coding Standards" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
3
+
4
+ <description>The Coding standard for the WordPress Coding Standards itself.</description>
5
+
6
+ <file>.</file>
7
+
8
+ <arg value="sp"/>
9
+ <arg name="extensions" value="php"/>
10
+
11
+ <exclude-pattern>/bin/class-ruleset-test.php</exclude-pattern>
12
+ <!-- Exclude Composer vendor directory. -->
13
+ <exclude-pattern>*/vendor/*</exclude-pattern>
14
+
15
+ <rule ref="WordPress-Extra">
16
+ <exclude name="WordPress.Files.FileName"/>
17
+ </rule>
18
+
19
+ <!-- <rule ref="WordPress-Docs"/> -->
20
+
21
+ <!-- Enforce PSR1 compatible namespaces. -->
22
+ <rule ref="PSR1.Classes.ClassDeclaration"/>
23
+
24
+ <rule ref="WordPress.Arrays.MultipleStatementAlignment">
25
+ <properties>
26
+ <property name="alignMultilineItems" value="!=100"/>
27
+ <property name="exact" value="false" phpcs-only="true"/>
28
+ </properties>
29
+ </rule>
30
+
31
+ <rule ref="PSR2.Methods.FunctionClosingBrace"/>
32
+
33
+ <rule ref="WordPress.NamingConventions.PrefixAllGlobals.DeprecatedWhitelistCommentFound">
34
+ <!-- False positive for whitelist comment recognition, but no use fixing this now
35
+ as the WPCS native whitelist comments are deprecated anyhow. -->
36
+ <exclude-pattern>/WordPress/AbstractClassRestrictionsSniff\.php$</exclude-pattern>
37
+ </rule>
38
+ </ruleset>
remove-xmlrpc-pingback-ping.php CHANGED
@@ -1,96 +1,215 @@
1
- <?php
2
- /*
3
- Plugin Name: Remove XMLRPC Pingback Ping
4
- Plugin URI: http://wordpress.org/plugins/remove-xmlrpc-pingback-ping
5
- Description: Prevent WordPress from participating in and being a victim of pingback denial of service attacks.
6
- Version: 1.3
7
- Author: WP Security Ninja
8
- Author URI: https://wpsecurityninja.com/
9
- License: GPL-2.0+
10
- License URI: http://www.gnu.org/licenses/gpl-2.0.txt
11
-
12
- Copyright 2014 - 2019 Web factory Ltd (email: support@webfactoryltd.com)
13
- Copyright 2019 - WP Security Ninja (email: support@wpsecurityninja.com)
14
-
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License, version 2, as
17
- published by the Free Software Foundation.
18
-
19
- This program is distributed in the hope that it will be useful,
20
- but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- GNU General Public License for more details.
23
-
24
- You should have received a copy of the GNU General Public License
25
- along with this program; if not, write to the Free Software
26
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
- */
28
-
29
- // If this file is called directly, abort.
30
- if ( ! defined( 'WPINC' ) ) {
31
- die;
32
- }
33
-
34
- define('RXPP_PLUGIN_URL', plugin_dir_path(__FILE__));
35
-
36
- require RXPP_PLUGIN_URL . 'vendor/autoload.php';
37
- //require RXPP_PLUGIN_URL . 'vendor/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php'
38
- add_action( 'admin_init', array( 'PAnD', 'init' ) );
39
-
40
- add_action( 'admin_notices', 'xrpp_admin_notice_blocked_attempts' );
41
-
42
- function xrpp_admin_notice_blocked_attempts() {
43
- if ( ! PAnD::is_admin_notice_active( 'xrpp-admin-notice-14' ) ) {
44
- return;
45
- }
46
- $rxpp_blocked_methods_count = get_option('rxpp_blocked_methods_count', false);
47
- ?>
48
- <div data-dismissible="xrpp-admin-notice-14" class="updated notice notice-success is-dismissible">
49
- <h2>Protected from XML-RPC pingback DOS attacks!</h2>
50
- <p>You are preventing denial of service attacks on your website.</p>
51
- <?php
52
- if ( $rxpp_blocked_methods_count ) {
53
- ?>
54
- <p><strong><?php printf( esc_html__( '%s blocked attempts so far!', 'remove-xmlrpc-pingback-ping' ), number_format_i18n($rxpp_blocked_methods_count ) ); ?></strong></p>
55
- <?php
56
- }
57
- ?>
58
-
59
-
60
- <p>Serious about security? Try out our Security Ninja plugin that protects you for many more problems.</p>
61
- <table>
62
- <th>
63
- <td>
64
- <a class="button button-secondary" href="https://wpsecurityninja.com/?utm_source=remove_xmlrpc_plugin&utm_medium=plugin&utm_content=notice" aria-label="Visit wpsecurityninja.com now" data-name="WP Security Ninja" target="_blank" rel="noopener">Visit wpsecurityninja.com</a>
65
- </td>
66
- <td>or</td>
67
- <td>
68
- <a class="button button-primary" href="<?php echo esc_url( admin_url('plugin-install.php?s="Security+Ninja+–+Secure+Firewall+%26+Secure+Malware+Scanner"+"WP+Security+Ninja"&tab=search&type=term') ); ?>" aria-label="Install WP Security Ninja free" data-name="WP Security Ninja">Install for free</a>
69
- </td>
70
- </th>
71
- </table>
72
- <p></p>
73
-
74
- </div>
75
- <?php
76
- }
77
-
78
- add_filter( 'xmlrpc_methods', 'rxpp_remove_xmlrpc_pingback_ping' );
79
- function rxpp_remove_xmlrpc_pingback_ping( $methods ) {
80
- unset( $methods['pingback.ping'] );
81
- $rxpp_blocked_methods_count = get_option('rxpp_blocked_methods_count', 0);
82
- $rxpp_blocked_methods_count++;
83
- update_option( 'rxpp_blocked_methods_count', $rxpp_blocked_methods_count, false );
84
- return $methods;
85
- }
86
-
87
- register_uninstall_hook(__FILE__, 'do_rxpp_uninstall_function');
88
- function do_rxpp_uninstall_function() {
89
- delete_option( 'rxpp_blocked_methods_count' );
90
- }
91
-
92
-
93
-
94
-
95
-
96
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Remove XMLRPC Pingback Ping
4
+ Plugin URI: http://wordpress.org/plugins/remove-xmlrpc-pingback-ping
5
+ Description: Prevent WordPress from participating in and being a victim of pingback denial of service attacks.
6
+ Version: 1.4
7
+ Author: WP Security Ninja
8
+ Author URI: https://wpsecurityninja.com/
9
+ License: GPL-2.0+
10
+ License URI: http://www.gnu.org/licenses/gpl-2.0.txt
11
+
12
+ Copyright 2014 - 2019 Web factory Ltd (email: support@webfactoryltd.com)
13
+ Copyright 2019 - WP Security Ninja (email: support@wpsecurityninja.com)
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License, version 2, as
17
+ published by the Free Software Foundation.
18
+
19
+ This program is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ GNU General Public License for more details.
23
+
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program; if not, write to the Free Software
26
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
+ */
28
+
29
+ // If this file is called directly, abort.
30
+ if ( ! defined( 'WPINC' ) ) {
31
+ die;
32
+ }
33
+
34
+ define( 'RXPP_PLUGIN_URL', plugin_dir_path( __FILE__ ) );
35
+
36
+ require RXPP_PLUGIN_URL . 'vendor/autoload.php';
37
+ add_action( 'admin_init', array( 'PAnD', 'init' ) );
38
+
39
+ add_filter( 'admin_init', 'xrpp_settings_register_fields' );
40
+ add_action( 'admin_notices', 'xrpp_admin_notice_blocked_attempts' );
41
+ add_filter( 'xmlrpc_methods', 'rxpp_remove_xmlrpc_pingback_ping' );
42
+ register_uninstall_hook( __FILE__, 'do_rxpp_uninstall_function' );
43
+
44
+ /**
45
+ * Returns current plugin version (read dynamically from file itself)
46
+ *
47
+ * @author Lars Koudal
48
+ * @since v0.0.1
49
+ * @version v1.0.0 Monday, August 9th, 2021.
50
+ * @access public static
51
+ * @return mixed
52
+ */
53
+ function xrpp_get_plugin_version() {
54
+ $plugin_data = get_file_data( __FILE__, array( 'version' => 'Version' ), 'plugin' );
55
+ return $plugin_data['version'];
56
+ }
57
+
58
+
59
+
60
+ /**
61
+ * xrpp_admin_notice_blocked_attempts.
62
+ *
63
+ * @author Lars Koudal
64
+ * @since v0.0.1
65
+ * @version v1.0.0 Monday, August 9th, 2021.
66
+ * @return void
67
+ */
68
+ function xrpp_admin_notice_blocked_attempts() {
69
+
70
+ if ( PAnD::is_admin_notice_active( 'xrpp-newsletter-notice-30' ) ) {
71
+ ?>
72
+ <div data-dismissible="xrpp-newsletter-notice-30" class="updated notice notice-success is-dismissible">
73
+ <h3>Join the WP Security Ninja Newsletter</h3>
74
+
75
+ <p>WordPress security made easy - Protect your website from hackers and malicious software.</p>
76
+
77
+ <form class="ml-block-form" action="https://static.mailerlite.com/webforms/submit/h9i9y0" data-code="h9i9y0" method="post" target="_blank">
78
+
79
+ <table>
80
+ <tbody>
81
+ <tr>
82
+ <td>
83
+ <img src="<?php echo esc_url( plugin_dir_url( __FILE__ ) . 'images/sn-icon.png' ); ?>" class="alignleft" width="100" style="margin-right:10px;" alt="Sign up for wpsecurityninja.com newsletter">
84
+ </td>
85
+ <td>
86
+ <input type="text" class="regular-text" data-inputmask="" name="fields[name]" placeholder="Name" autocomplete="name" style="width:15em;">
87
+ </td>
88
+ <td>
89
+ <input aria-label="email" aria-required="true" data-inputmask="" type="email" class="regular-text required email" data-inputmask="" name="fields[email]" placeholder="Email" autocomplete="email" style="width:15em;">
90
+ </td>
91
+ <td>
92
+ <button type="submit" class="button button-primary">Subscribe</button>
93
+ </td>
94
+ </tr>
95
+ </table>
96
+
97
+ <input type="hidden" name="fields[signupsource]" value="RXPP Plugin <?php echo esc_attr( xrpp_get_plugin_version() ); ?>">
98
+ <input type="hidden" name="ml-submit" value="1">
99
+ <input type="hidden" name="anticsrf" value="true">
100
+ </form>
101
+ <p>You can unsubscribe anytime. For more details, review our <a href="https://wpsecurityninja.com/privacy-policy/" target="_blank">Privacy Policy</a>.</p>
102
+ <p><small>Signup form is shown every 30 days until dismissed</small></p>
103
+ </div>
104
+
105
+ <?php
106
+ }
107
+
108
+ if ( ! PAnD::is_admin_notice_active( 'xrpp-admin-notice-14' ) ) {
109
+ return;
110
+ }
111
+ $rxpp_blocked_methods_count = get_option( 'rxpp_blocked_methods_count', false );
112
+ ?>
113
+ <div data-dismissible="xrpp-admin-notice-14" class="updated notice notice-success is-dismissible">
114
+ <h2>Protected from XML-RPC pingback DOS attacks!</h2>
115
+ <p>You are preventing denial of service attacks on your website.</p>
116
+ <?php
117
+ if ( $rxpp_blocked_methods_count ) {
118
+ ?>
119
+ <p><strong>
120
+ <?php
121
+ // translators: Show number of attempts blocked so far
122
+ printf( esc_html__( '%s blocked attempts so far!', 'remove-xmlrpc-pingback-ping' ), esc_attr( $rxpp_blocked_methods_count ) );
123
+ ?>
124
+ </strong></p>
125
+ <?php
126
+ }
127
+ ?>
128
+
129
+
130
+ <p>Serious about security? Try out our Security Ninja plugin that protects you for many more security problems.</p>
131
+ <table>
132
+ <th>
133
+ <td>
134
+ <a class="button button-secondary" href="https://wpsecurityninja.com/?utm_source=remove_xmlrpc_plugin&utm_medium=plugin&utm_content=notice" aria-label="Visit wpsecurityninja.com now" data-name="WP Security Ninja" target="_blank" rel="noopener">Visit wpsecurityninja.com</a>
135
+ </td>
136
+ <td>or</td>
137
+ <td>
138
+ <a class="button button-primary" href="<?php echo esc_url( admin_url( 'plugin-install.php?s="Security+Ninja+–+Secure+Firewall+%26+Secure+Malware+Scanner"+"WP+Security+Ninja"&tab=search&type=term' ) ); ?>" aria-label="Install WP Security Ninja free" data-name="WP Security Ninja">Install for free</a>
139
+ </td>
140
+ </th>
141
+ </table>
142
+ <p></p>
143
+
144
+ </div>
145
+ <?php
146
+ }
147
+
148
+
149
+
150
+ /**
151
+ * rxpp_remove_xmlrpc_pingback_ping.
152
+ *
153
+ * @author Lars Koudal
154
+ * @since v0.0.1
155
+ * @version v1.0.0 Monday, August 9th, 2021.
156
+ * @param mixed $methods
157
+ * @return mixed
158
+ */
159
+ function rxpp_remove_xmlrpc_pingback_ping( $methods ) {
160
+ unset( $methods['pingback.ping'] );
161
+ // update count
162
+ $rxpp_blocked_methods_count = get_option( 'rxpp_blocked_methods_count', 0 );
163
+ $rxpp_blocked_methods_count++;
164
+ update_option( 'rxpp_blocked_methods_count', $rxpp_blocked_methods_count, false );
165
+ return $methods;
166
+ }
167
+
168
+
169
+ /**
170
+ * do_rxpp_uninstall_function.
171
+ *
172
+ * @author Lars Koudal
173
+ * @since v0.0.1
174
+ * @version v1.0.0 Monday, August 9th, 2021.
175
+ * @return void
176
+ */
177
+ function do_rxpp_uninstall_function() {
178
+ delete_option( 'rxpp_blocked_methods_count' );
179
+ }
180
+
181
+
182
+ /**
183
+ * xrpp_settings_register_fields.
184
+ *
185
+ * @author Lars Koudal
186
+ * @since v0.0.1
187
+ * @version v1.0.0 Tuesday, August 10th, 2021.
188
+ * @global
189
+ * @return void
190
+ */
191
+ function xrpp_settings_register_fields() {
192
+ register_setting( 'general', 'blocked_pingback_ping', 'esc_attr' );
193
+ add_settings_field( 'blocked_pingback_ping', '<label for="blocked_pingback_ping">' . __( 'Blocked pingback.ping attacks', 'xrpp_blocked_count' ) . '</label>', 'xrpp_settings_fields_html', 'general' );
194
+ }
195
+
196
+
197
+ /**
198
+ * xrpp_settings_fields_html.
199
+ *
200
+ * @author Lars Koudal
201
+ * @since v0.0.1
202
+ * @version v1.0.0 Tuesday, August 10th, 2021.
203
+ * @global
204
+ * @return void
205
+ */
206
+ function xrpp_settings_fields_html() {
207
+ $value = get_option( 'rxpp_blocked_methods_count', 0 );
208
+ echo esc_html( number_format_i18n( $value ) );
209
+ echo '<p class="description">Proteced by the Remove & Disable XML-RPC Pingback plugin.</p>';
210
+ }
211
+
212
+
213
+
214
+
215
+
vendor/collizo4sky/persist-admin-notices-dismissal/CHANGES.md CHANGED
@@ -1,18 +1,21 @@
 
 
 
1
  #### 1.4.3
2
- * added filter hook `pand_dismiss_notice_js_url` in case you're using this in a theme or a local environment that doesn't quite find the correct URL.
3
- * added filter hook `pand_theme_loader` that returns a boolean for simpler usage of the `pand_dismiss_notice_js_url` hook
4
 
5
  #### 1.4.2
6
  * No changes to `class PAnD`
7
- * updated `.gitignore` and `.gitattributes`
8
- * now use classmap in composer's autoloader, should be more efficient
9
 
10
  #### 1.4.1
11
- * fixed the `forever` setting with options
12
 
13
  #### 1.4.0
14
  * WPCS 1.1.0 linting done
15
- * switched from storing timeout in transients to storing in the options table, this should play much better with object caching
16
 
17
  #### 1.3.x
18
- * uses transients to store timeout
1
+ #### 1.4.4
2
+ * Added support for extra dismissible links via `.dismiss-this` CSS class.
3
+
4
  #### 1.4.3
5
+ * Added filter hook `pand_dismiss_notice_js_url` in case you're using this in a theme or a local environment that doesn't quite find the correct URL.
6
+ * Added filter hook `pand_theme_loader` that returns a boolean for simpler usage of the `pand_dismiss_notice_js_url` hook
7
 
8
  #### 1.4.2
9
  * No changes to `class PAnD`
10
+ * Updated `.gitignore` and `.gitattributes`
11
+ * Now use classmap in composer's autoloader, should be more efficient
12
 
13
  #### 1.4.1
14
+ * Fixed the `forever` setting with options
15
 
16
  #### 1.4.0
17
  * WPCS 1.1.0 linting done
18
+ * Switched from storing timeout in transients to storing in the options table, this should play much better with object caching
19
 
20
  #### 1.3.x
21
+ * Uses transients to store timeout
vendor/collizo4sky/persist-admin-notices-dismissal/composer.json CHANGED
@@ -1,12 +1,24 @@
1
  {
2
  "name": "collizo4sky/persist-admin-notices-dismissal",
3
  "description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard.",
 
 
 
4
  "authors": [
5
  {
6
  "name": "Collins Agbonghama",
7
- "email": "me@w3guy.com"
 
8
  }
9
  ],
 
 
 
 
 
 
 
 
10
  "autoload": {
11
  "classmap": [
12
  "persist-admin-notices-dismissal.php"
1
  {
2
  "name": "collizo4sky/persist-admin-notices-dismissal",
3
  "description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard.",
4
+ "version": "1.4.4",
5
+ "type": "library",
6
+ "license": "GPL-3.0-or-later",
7
  "authors": [
8
  {
9
  "name": "Collins Agbonghama",
10
+ "email": "me@w3guy.com",
11
+ "role": "developer"
12
  }
13
  ],
14
+ "prefer-stable": true,
15
+ "require": {
16
+ "php": ">=5.4"
17
+ },
18
+ "support": {
19
+ "issues": "https://github.com/w3guy/persist-admin-notices-dismissal/issues",
20
+ "source": "https://github.com/w3guy/persist-admin-notices-dismissal"
21
+ },
22
  "autoload": {
23
  "classmap": [
24
  "persist-admin-notices-dismissal.php"
vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js CHANGED
@@ -2,14 +2,14 @@
2
  //shorthand for ready event.
3
  $(
4
  function () {
5
- $( 'div[data-dismissible] button.notice-dismiss' ).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
 
14
  // remove the dismissible length from the attribute value and rejoin the array.
15
  dismissible_length = attr_value.pop();
@@ -25,6 +25,7 @@
25
 
26
  // We can also pass the url value separately from ajaxurl for front end AJAX implementations
27
  $.post( ajaxurl, data );
 
28
  }
29
  );
30
  }
2
  //shorthand for ready event.
3
  $(
4
  function () {
5
+ $( 'div[data-dismissible] button.notice-dismiss, div[data-dismissible] .dismiss-this' ).on("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.closest("div[data-dismissible]").attr( 'data-dismissible' ).split( '-' );
13
 
14
  // remove the dismissible length from the attribute value and rejoin the array.
15
  dismissible_length = attr_value.pop();
25
 
26
  // We can also pass the url value separately from ajaxurl for front end AJAX implementations
27
  $.post( ajaxurl, data );
28
+ $this.closest("div[data-dismissible]").hide('slow');
29
  }
30
  );
31
  }
vendor/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Persist Admin notices Dismissal
5
  *
6
- * Copyright (C) 2016 Collins Agbonghama <http://w3guy.com>
7
  *
8
  * This program is free software: you can redistribute it and/or modify
9
  * it under the terms of the GNU General Public License as published by
@@ -22,7 +22,6 @@
22
  * @author Collins Agbonghama
23
  * @author Andy Fragen
24
  * @license http://www.gnu.org/licenses GNU General Public License
25
- * @version 1.4.3
26
  */
27
 
28
  /**
3
  /**
4
  * Persist Admin notices Dismissal
5
  *
6
+ * Copyright (C) 2016 Collins Agbonghama <https://w3guy.com>
7
  *
8
  * This program is free software: you can redistribute it and/or modify
9
  * it under the terms of the GNU General Public License as published by
22
  * @author Collins Agbonghama
23
  * @author Andy Fragen
24
  * @license http://www.gnu.org/licenses GNU General Public License
 
25
  */
26
 
27
  /**
vendor/composer/ClassLoader.php CHANGED
@@ -60,7 +60,7 @@ class ClassLoader
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', $this->prefixesPsr0);
64
  }
65
 
66
  return array();
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
64
  }
65
 
66
  return array();
vendor/composer/installed.json CHANGED
@@ -1,20 +1,23 @@
1
  [
2
  {
3
  "name": "collizo4sky/persist-admin-notices-dismissal",
4
- "version": "1.4.3",
5
- "version_normalized": "1.4.3.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/w3guy/persist-admin-notices-dismissal.git",
9
- "reference": "2d7d8bb3cba631ad227c92296a4b675d7cbc71d7"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/w3guy/persist-admin-notices-dismissal/zipball/2d7d8bb3cba631ad227c92296a4b675d7cbc71d7",
14
- "reference": "2d7d8bb3cba631ad227c92296a4b675d7cbc71d7",
15
  "shasum": ""
16
  },
17
- "time": "2019-03-12T05:19:51+00:00",
 
 
 
18
  "type": "library",
19
  "installation-source": "dist",
20
  "autoload": {
@@ -23,10 +26,14 @@
23
  ]
24
  },
25
  "notification-url": "https://packagist.org/downloads/",
 
 
 
26
  "authors": [
27
  {
28
  "name": "Collins Agbonghama",
29
- "email": "me@w3guy.com"
 
30
  }
31
  ],
32
  "description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard."
1
  [
2
  {
3
  "name": "collizo4sky/persist-admin-notices-dismissal",
4
+ "version": "1.4.4",
5
+ "version_normalized": "1.4.4.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/w3guy/persist-admin-notices-dismissal.git",
9
+ "reference": "900739eb6b0ec0210465f5983a6d4e0e420289e4"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/w3guy/persist-admin-notices-dismissal/zipball/900739eb6b0ec0210465f5983a6d4e0e420289e4",
14
+ "reference": "900739eb6b0ec0210465f5983a6d4e0e420289e4",
15
  "shasum": ""
16
  },
17
+ "require": {
18
+ "php": ">=5.4"
19
+ },
20
+ "time": "2020-12-31T17:12:37+00:00",
21
  "type": "library",
22
  "installation-source": "dist",
23
  "autoload": {
26
  ]
27
  },
28
  "notification-url": "https://packagist.org/downloads/",
29
+ "license": [
30
+ "GPL-3.0-or-later"
31
+ ],
32
  "authors": [
33
  {
34
  "name": "Collins Agbonghama",
35
+ "email": "me@w3guy.com",
36
+ "role": "developer"
37
  }
38
  ],
39
  "description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard."