Version Description
- Enhancement: Because minimum VIP standards are just not enough, it now follows their hard-as-snails, full-strength standards. Because your code is worth it
- Enhancement: Improved accessibility where we've added the new field to the admin settings, so it's now WCAG 2.0 compliant
Download this release
Release Info
Developer | dartiss |
Plugin | No Self Pings |
Version | 1.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 1.1.2
- no-self-pings.php +19 -18
- readme.txt +8 -3
- uninstall.php +19 -19
no-self-pings.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: No Self Pings
|
4 |
Plugin URI: https://github.com/dartiss/no-self-ping
|
5 |
Description: Keeps WordPress from sending pings to your own site.
|
6 |
-
Version: 1.1.
|
7 |
Author: Michael D. Adams
|
8 |
Author URI: http://blogwaffe.com/
|
9 |
Text Domain: no-self-ping
|
@@ -14,8 +14,8 @@ Text Domain: no-self-ping
|
|
14 |
*
|
15 |
* PKeeps WordPress from sending pings to your own site.
|
16 |
*
|
17 |
-
* @package
|
18 |
-
* @since
|
19 |
*/
|
20 |
|
21 |
/**
|
@@ -23,11 +23,11 @@ Text Domain: no-self-ping
|
|
23 |
*
|
24 |
* Add options to plugin meta line
|
25 |
*
|
26 |
-
* @since
|
27 |
*
|
28 |
-
* @param
|
29 |
-
* @param
|
30 |
-
* @return string
|
31 |
*/
|
32 |
|
33 |
function no_self_ping_plugin_meta( $links, $file ) {
|
@@ -49,7 +49,7 @@ add_filter( 'plugin_row_meta', 'no_self_ping_plugin_meta', 10, 2 );
|
|
49 |
*
|
50 |
* Before pinging the curated URLs, remove any that belong to this installation
|
51 |
*
|
52 |
-
* @since
|
53 |
*/
|
54 |
|
55 |
function no_self_ping( &$links ) {
|
@@ -78,9 +78,9 @@ function no_self_ping( &$links ) {
|
|
78 |
foreach ( $url_array as $url ) {
|
79 |
|
80 |
$url = trim( $url );
|
81 |
-
if ( 0 === strpos( $link, $url ) &&
|
82 |
unset( $links[ $l ] );
|
83 |
-
}
|
84 |
}
|
85 |
}
|
86 |
}
|
@@ -92,14 +92,14 @@ add_action( 'pre_ping', 'no_self_ping' );
|
|
92 |
*
|
93 |
* Add a field to the Discussion settings screens to capture additional URLs
|
94 |
*
|
95 |
-
* @since
|
96 |
*/
|
97 |
|
98 |
function no_self_pings_settings_init() {
|
99 |
|
100 |
-
add_settings_section( 'no_self_pings_section', __(
|
101 |
|
102 |
-
add_settings_field( 'no_self_pings_option', __(
|
103 |
|
104 |
register_setting( 'discussion', 'no_self_pings_option' );
|
105 |
}
|
@@ -111,12 +111,13 @@ add_action( 'admin_init', 'no_self_pings_settings_init' );
|
|
111 |
*
|
112 |
* Create the new section that we've added to the Discussion settings screen
|
113 |
*
|
114 |
-
* @since
|
115 |
*/
|
116 |
|
117 |
function no_self_pings_section_callback() {
|
118 |
|
119 |
-
|
|
|
120 |
|
121 |
}
|
122 |
|
@@ -125,13 +126,13 @@ function no_self_pings_section_callback() {
|
|
125 |
*
|
126 |
* Output the settings field
|
127 |
*
|
128 |
-
* @since
|
129 |
*/
|
130 |
|
131 |
function no_self_pings_setting_callback() {
|
132 |
|
133 |
$urls = sanitize_option( 'ping_sites', get_option( 'no_self_pings_option', '' ) );
|
134 |
-
|
135 |
-
echo '<textarea name="no_self_pings_option" rows="3" class="large-text code">' . esc_attr( $urls ) . '</textarea>';
|
136 |
|
137 |
}
|
3 |
Plugin Name: No Self Pings
|
4 |
Plugin URI: https://github.com/dartiss/no-self-ping
|
5 |
Description: Keeps WordPress from sending pings to your own site.
|
6 |
+
Version: 1.1.2
|
7 |
Author: Michael D. Adams
|
8 |
Author URI: http://blogwaffe.com/
|
9 |
Text Domain: no-self-ping
|
14 |
*
|
15 |
* PKeeps WordPress from sending pings to your own site.
|
16 |
*
|
17 |
+
* @package no-self-ping
|
18 |
+
* @since 0.1
|
19 |
*/
|
20 |
|
21 |
/**
|
23 |
*
|
24 |
* Add options to plugin meta line
|
25 |
*
|
26 |
+
* @since 1.0
|
27 |
*
|
28 |
+
* @param string $links Current links
|
29 |
+
* @param string $file File in use
|
30 |
+
* @return string Links, now with settings added
|
31 |
*/
|
32 |
|
33 |
function no_self_ping_plugin_meta( $links, $file ) {
|
49 |
*
|
50 |
* Before pinging the curated URLs, remove any that belong to this installation
|
51 |
*
|
52 |
+
* @since 0.1
|
53 |
*/
|
54 |
|
55 |
function no_self_ping( &$links ) {
|
78 |
foreach ( $url_array as $url ) {
|
79 |
|
80 |
$url = trim( $url );
|
81 |
+
if ( 0 === strpos( $link, $url ) && '' !== $url ) {
|
82 |
unset( $links[ $l ] );
|
83 |
+
}
|
84 |
}
|
85 |
}
|
86 |
}
|
92 |
*
|
93 |
* Add a field to the Discussion settings screens to capture additional URLs
|
94 |
*
|
95 |
+
* @since 1.1
|
96 |
*/
|
97 |
|
98 |
function no_self_pings_settings_init() {
|
99 |
|
100 |
+
add_settings_section( 'no_self_pings_section', __( 'No Self Pings', 'no-self-ping' ), 'no_self_pings_section_callback', 'discussion' );
|
101 |
|
102 |
+
add_settings_field( 'no_self_pings_option', __( 'Additional URLs', 'no-self-ping' ), 'no_self_pings_setting_callback', 'discussion', 'no_self_pings_section', array( 'label_for' => 'no_self_pings_option' ) );
|
103 |
|
104 |
register_setting( 'discussion', 'no_self_pings_option' );
|
105 |
}
|
111 |
*
|
112 |
* Create the new section that we've added to the Discussion settings screen
|
113 |
*
|
114 |
+
* @since 1.1
|
115 |
*/
|
116 |
|
117 |
function no_self_pings_section_callback() {
|
118 |
|
119 |
+
/* translators: %s: URL of website */
|
120 |
+
esc_attr( sprintf( __( 'By default, No Self Pings will exclude pings for this site (%s) but you can supply additional URLs below. Separate multiple URLs with line breaks.', 'no-self-ping' ), esc_url( home_url() ) ) );
|
121 |
|
122 |
}
|
123 |
|
126 |
*
|
127 |
* Output the settings field
|
128 |
*
|
129 |
+
* @since 1.1
|
130 |
*/
|
131 |
|
132 |
function no_self_pings_setting_callback() {
|
133 |
|
134 |
$urls = sanitize_option( 'ping_sites', get_option( 'no_self_pings_option', '' ) );
|
135 |
+
|
136 |
+
echo '<label>Additional URLs<textarea name="no_self_pings_option" rows="3" class="large-text code">' . esc_attr( $urls ) . '</textarea></label>';
|
137 |
|
138 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: pingback, ping, trackback
|
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 4.9.4
|
6 |
Requires PHP: 5.3
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -24,6 +24,7 @@ The technical stuff...
|
|
24 |
* PHP7 compatible
|
25 |
* Passes [WordPress.com VIP](https://vip.wordpress.com) coding standards and fully compatible with their platform
|
26 |
* Fully internationalized, ready for translations. **If you would like to add a translation to this plugin then please head to the [Translating WordPress](https://translate.wordpress.org/projects/wp-plugins/no-self-ping "Translating WordPress") page**
|
|
|
27 |
* Gutenberg ready
|
28 |
|
29 |
Once activated, there's nothing for you to do. However, head to Settings -> Discussion and you'll find a field in which you can, if you wish, specify more domains that won't be pinged. Why? Well, maybe you often refer to other sites that you maintain or, particularly, you run a multi-site and don't want each blog pinging the other - specify a list here and you're sorted.
|
@@ -47,6 +48,10 @@ It's now ready to go.
|
|
47 |
|
48 |
[Learn more about my version numbering methodology](https://artiss.blog/2016/09/wordpress-plugin-versioning/ "WordPress Plugin Versioning")
|
49 |
|
|
|
|
|
|
|
|
|
50 |
= 1.1.1 =
|
51 |
* Enhancement: Code quality enhancements to bring it in line with WordPress.com VIP coding standards
|
52 |
|
@@ -66,5 +71,5 @@ It's now ready to go.
|
|
66 |
|
67 |
== Upgrade Notice ==
|
68 |
|
69 |
-
= 1.1.
|
70 |
-
*
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 4.9.4
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 1.1.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
24 |
* PHP7 compatible
|
25 |
* Passes [WordPress.com VIP](https://vip.wordpress.com) coding standards and fully compatible with their platform
|
26 |
* Fully internationalized, ready for translations. **If you would like to add a translation to this plugin then please head to the [Translating WordPress](https://translate.wordpress.org/projects/wp-plugins/no-self-ping "Translating WordPress") page**
|
27 |
+
* WCAG 2.0 Compliant at AA level
|
28 |
* Gutenberg ready
|
29 |
|
30 |
Once activated, there's nothing for you to do. However, head to Settings -> Discussion and you'll find a field in which you can, if you wish, specify more domains that won't be pinged. Why? Well, maybe you often refer to other sites that you maintain or, particularly, you run a multi-site and don't want each blog pinging the other - specify a list here and you're sorted.
|
48 |
|
49 |
[Learn more about my version numbering methodology](https://artiss.blog/2016/09/wordpress-plugin-versioning/ "WordPress Plugin Versioning")
|
50 |
|
51 |
+
= 1.1.2 =
|
52 |
+
* Enhancement: Because minimum VIP standards are just not enough, it now follows their hard-as-snails, full-strength standards. Because your code is worth it
|
53 |
+
* Enhancement: Improved accessibility where we've added the new field to the admin settings, so it's now WCAG 2.0 compliant
|
54 |
+
|
55 |
= 1.1.1 =
|
56 |
* Enhancement: Code quality enhancements to bring it in line with WordPress.com VIP coding standards
|
57 |
|
71 |
|
72 |
== Upgrade Notice ==
|
73 |
|
74 |
+
= 1.1.2 =
|
75 |
+
* Code quality and accessibility improvements
|
uninstall.php
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Uninstaller
|
4 |
-
*
|
5 |
-
* Uninstall the plugin by removing any options from the database
|
6 |
-
*
|
7 |
-
* @package
|
8 |
-
* @since
|
9 |
-
*/
|
10 |
-
|
11 |
-
// If the uninstall was not called by WordPress, exit
|
12 |
-
|
13 |
-
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
14 |
-
exit();
|
15 |
-
}
|
16 |
-
|
17 |
-
// Remove options
|
18 |
-
|
19 |
-
delete_option( 'no_self_pings_option');
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Uninstaller
|
4 |
+
*
|
5 |
+
* Uninstall the plugin by removing any options from the database
|
6 |
+
*
|
7 |
+
* @package no-self-pings
|
8 |
+
* @since 1.1
|
9 |
+
*/
|
10 |
+
|
11 |
+
// If the uninstall was not called by WordPress, exit
|
12 |
+
|
13 |
+
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
14 |
+
exit();
|
15 |
+
}
|
16 |
+
|
17 |
+
// Remove options
|
18 |
+
|
19 |
+
delete_option( 'no_self_pings_option' );
|