No Self Pings - Version 1.1.3

Version Description

  • Enhancement: Improved plugin meta
  • Maintenance: Beefed up code quality even more
Download this release

Release Info

Developer dartiss
Plugin Icon 128x128 No Self Pings
Version 1.1.3
Comparing to
See all releases

Code changes from version 1.1.2 to 1.1.3

Files changed (3) hide show
  1. no-self-pings.php +65 -54
  2. readme.txt +12 -14
  3. uninstall.php +8 -9
no-self-pings.php CHANGED
@@ -1,35 +1,25 @@
1
  <?php
2
- /*
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
10
- */
11
 
12
- /**
13
- * No Self Pings
14
- *
15
- * PKeeps WordPress from sending pings to your own site.
16
- *
17
- * @package no-self-ping
18
- * @since 0.1
19
- */
20
 
21
  /**
22
- * Add meta to plugin details
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 ) {
34
 
35
  if ( false !== strpos( $file, 'no-self-pings.php' ) ) {
@@ -37,6 +27,10 @@ function no_self_ping_plugin_meta( $links, $file ) {
37
  $links = array_merge( $links, array( '<a href="https://github.com/dartiss/no-self-ping">' . __( 'Github', 'no-self-ping' ) . '</a>' ) );
38
 
39
  $links = array_merge( $links, array( '<a href="https://wordpress.org/support/plugin/no-self-ping">' . __( 'Support', 'no-self-ping' ) . '</a>' ) );
 
 
 
 
40
  }
41
 
42
  return $links;
@@ -45,18 +39,44 @@ function no_self_ping_plugin_meta( $links, $file ) {
45
  add_filter( 'plugin_row_meta', 'no_self_ping_plugin_meta', 10, 2 );
46
 
47
  /**
48
- * Process Pings
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 ) {
56
 
57
  $home = esc_url( home_url() );
58
 
59
- // Get any additional URLs and explode into an array
60
 
61
  $extra_urls = sanitize_option( 'ping_sites', get_option( 'no_self_pings_option', '' ) );
62
 
@@ -67,7 +87,7 @@ function no_self_ping( &$links ) {
67
  }
68
 
69
  // Process each link in the content and remove is it matches the current site URL or one of
70
- // the additional URLs provided
71
 
72
  foreach ( $links as $l => $link ) {
73
 
@@ -88,13 +108,10 @@ function no_self_ping( &$links ) {
88
  add_action( 'pre_ping', 'no_self_ping' );
89
 
90
  /**
91
- * Add to settings
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' );
@@ -107,13 +124,10 @@ function no_self_pings_settings_init() {
107
  add_action( 'admin_init', 'no_self_pings_settings_init' );
108
 
109
  /**
110
- * Sectoin callback
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 */
@@ -122,13 +136,10 @@ function no_self_pings_section_callback() {
122
  }
123
 
124
  /**
125
- * Settings callback
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', '' ) );
1
  <?php
2
+ /**
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.3
7
+ Author: David Artiss
8
+ Author URI: https://artiss.blog
9
  Text Domain: no-self-ping
 
10
 
11
+ @package no-self-ping
12
+ */
 
 
 
 
 
 
13
 
14
  /**
15
+ * Add meta to plugin details
16
+ *
17
+ * Add options to plugin meta line
18
+ *
19
+ * @param string $links Current links.
20
+ * @param string $file File in use.
21
+ * @return string Links, now with settings added.
22
+ */
 
 
 
23
  function no_self_ping_plugin_meta( $links, $file ) {
24
 
25
  if ( false !== strpos( $file, 'no-self-pings.php' ) ) {
27
  $links = array_merge( $links, array( '<a href="https://github.com/dartiss/no-self-ping">' . __( 'Github', 'no-self-ping' ) . '</a>' ) );
28
 
29
  $links = array_merge( $links, array( '<a href="https://wordpress.org/support/plugin/no-self-ping">' . __( 'Support', 'no-self-ping' ) . '</a>' ) );
30
+
31
+ $links = array_merge( $links, array( '<a href="https://artiss.blog/donate">' . __( 'Donate', 'no-self-ping' ) . '</a>' ) );
32
+
33
+ $links = array_merge( $links, array( '<a href="https://wordpress.org/support/plugin/no-self-ping/reviews/#new-post">' . __( 'Write a Review', 'no-self-ping' ) . '&nbsp;⭐️⭐️⭐️⭐️⭐️</a>' ) );
34
  }
35
 
36
  return $links;
39
  add_filter( 'plugin_row_meta', 'no_self_ping_plugin_meta', 10, 2 );
40
 
41
  /**
42
+ * Add Settings link to plugin list
43
+ *
44
+ * Add a Settings link to the options listed against this plugin
45
+ *
46
+ * @param string $links Current links.
47
+ * @param string $file File in use.
48
+ * @return string Links, now with settings added.
49
+ */
50
+ function no_self_ping_settings_link( $links, $file ) {
51
+
52
+ static $this_plugin;
53
+
54
+ if ( ! $this_plugin ) {
55
+ $this_plugin = plugin_basename( __FILE__ );
56
+ }
57
+
58
+ if ( strpos( $file, 'no-self-pings.php' ) !== false ) {
59
+ $settings_link = '<a href="' . admin_url() . 'options-discussion.php">' . __( 'Settings', 'no-self-ping' ) . '</a>';
60
+ array_unshift( $links, $settings_link );
61
+ }
62
 
63
+ return $links;
64
+ }
65
+
66
+ add_filter( 'plugin_action_links', 'no_self_ping_settings_link', 10, 2 );
67
+
68
+ /**
69
+ * Process Pings
70
+ *
71
+ * Before pinging the curated URLs, remove any that belong to this installation
72
+ *
73
+ * @param string $links URLs from post content.
74
+ */
75
  function no_self_ping( &$links ) {
76
 
77
  $home = esc_url( home_url() );
78
 
79
+ // Get any additional URLs and explode into an array.
80
 
81
  $extra_urls = sanitize_option( 'ping_sites', get_option( 'no_self_pings_option', '' ) );
82
 
87
  }
88
 
89
  // Process each link in the content and remove is it matches the current site URL or one of
90
+ // the additional URLs provided.
91
 
92
  foreach ( $links as $l => $link ) {
93
 
108
  add_action( 'pre_ping', 'no_self_ping' );
109
 
110
  /**
111
+ * Add to settings
112
+ *
113
+ * Add a field to the Discussion settings screens to capture additional URLs
114
+ */
 
 
 
115
  function no_self_pings_settings_init() {
116
 
117
  add_settings_section( 'no_self_pings_section', __( 'No Self Pings', 'no-self-ping' ), 'no_self_pings_section_callback', 'discussion' );
124
  add_action( 'admin_init', 'no_self_pings_settings_init' );
125
 
126
  /**
127
+ * Section callback
128
+ *
129
+ * Create the new section that we've added to the Discussion settings screen
130
+ */
 
 
 
131
  function no_self_pings_section_callback() {
132
 
133
  /* translators: %s: URL of website */
136
  }
137
 
138
  /**
139
+ * Settings callback
140
+ *
141
+ * Output the settings field
142
+ */
 
 
 
143
  function no_self_pings_setting_callback() {
144
 
145
  $urls = sanitize_option( 'ping_sites', get_option( 'no_self_pings_option', '' ) );
readme.txt CHANGED
@@ -1,14 +1,15 @@
1
  === No Self Pings ===
2
  Contributors: mdawaffe, dartiss
 
3
  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.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Keeps WordPress from sending pings to your own site.
12
 
13
  == Description ==
14
 
@@ -18,19 +19,12 @@ Some people do not like this behavior; it clutters up their comments.
18
 
19
  This plugin disables intra-blog pinging.
20
 
21
- The technical stuff...
22
-
23
- * Designed for both single and multi-site installations
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.
31
 
32
  Please visit the [Github page](https://github.com/dartiss/no-self-ping "Github") for the latest code development, planned enhancements and known issues.
33
 
 
 
34
  == Installation ==
35
 
36
  No Self Pings can be found and installed via the Plugin menu within WordPress administration (Plugins -> Add New). Alternatively, it can be downloaded from WordPress.org and installed manually...
@@ -48,6 +42,10 @@ It's now ready to go.
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
@@ -71,5 +69,5 @@ It's now ready to go.
71
 
72
  == Upgrade Notice ==
73
 
74
- = 1.1.2 =
75
- * Code quality and accessibility improvements
1
  === No Self Pings ===
2
  Contributors: mdawaffe, dartiss
3
+ Donate link: https://artiss.blog/donate
4
  Tags: pingback, ping, trackback
5
  Requires at least: 4.6
6
+ Tested up to: 5.4
7
  Requires PHP: 5.3
8
+ Stable tag: 1.1.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ 🏓 Keeps WordPress from sending pings to your own site.
13
 
14
  == Description ==
15
 
19
 
20
  This plugin disables intra-blog pinging.
21
 
 
 
 
 
 
 
 
 
 
22
  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.
23
 
24
  Please visit the [Github page](https://github.com/dartiss/no-self-ping "Github") for the latest code development, planned enhancements and known issues.
25
 
26
+ This plugin was original developed by the awesome [Michael D. Adams](https://profiles.wordpress.org/mdawaffe/).
27
+
28
  == Installation ==
29
 
30
  No Self Pings can be found and installed via the Plugin menu within WordPress administration (Plugins -> Add New). Alternatively, it can be downloaded from WordPress.org and installed manually...
42
 
43
  [Learn more about my version numbering methodology](https://artiss.blog/2016/09/wordpress-plugin-versioning/ "WordPress Plugin Versioning")
44
 
45
+ = 1.1.3 =
46
+ * Enhancement: Improved plugin meta
47
+ * Maintenance: Beefed up code quality even more
48
+
49
  = 1.1.2 =
50
  * 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
51
  * Enhancement: Improved accessibility where we've added the new field to the admin settings, so it's now WCAG 2.0 compliant
69
 
70
  == Upgrade Notice ==
71
 
72
+ = 1.1.3 =
73
+ * Code quality and plugin meta improvements
uninstall.php CHANGED
@@ -1,19 +1,18 @@
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' );
1
  <?php
2
  /**
3
+ * Uninstaller
4
+ *
5
+ * Uninstall the plugin by removing any options from the database
6
+ *
7
+ * @package no-self-pings
8
+ */
 
9
 
10
+ // If the uninstall was not called by WordPress, exit.
11
 
12
  if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
13
  exit();
14
  }
15
 
16
+ // Remove options.
17
 
18
  delete_option( 'no_self_pings_option' );