External Links - Version 6.5

Version Description

  • Domains to Exclude no longer assumes subdomains meaning subdomains need to be specifically excluded now.
  • Entry of Domains to Exclude now allows separation by comma, space, newline/return, and tab. It will convert into a csv list.
  • Fix placeholder links (href="#") not being excluded from processing correctly.
  • Fix Plugin version number not being updated in the database options correctly.
Download this release

Release Info

Developer Mike_Koepke
Plugin Icon wp plugin External Links
Version 6.5
Comparing to
See all releases

Code changes from version 6.4.1 to 6.5

readme.txt CHANGED
@@ -23,6 +23,7 @@ Under Settings / External Links, you can configure the plugin to:
23
  - Add rel=nofollow to the links. (Note: You can use a rel="follow" attribute on links to override this.)
24
  - Open outgoing links in new windows. Note that this can damage your visitor's trust towards your site in that they can think your site used a pop-under.
25
  - Turn on "autolinks" functionality.
 
26
 
27
 
28
  = Auto Links =
@@ -60,6 +61,13 @@ The plugin supports a non-started rel="follow" attribute on links to override th
60
 
61
  == Change Log ==
62
 
 
 
 
 
 
 
 
63
  = 6.4.1 =
64
 
65
  - External Links with querystring not being excluded by Domains to Exclude
23
  - Add rel=nofollow to the links. (Note: You can use a rel="follow" attribute on links to override this.)
24
  - Open outgoing links in new windows. Note that this can damage your visitor's trust towards your site in that they can think your site used a pop-under.
25
  - Turn on "autolinks" functionality.
26
+ - Domains/subdomains you wish to Exclude from processing.
27
 
28
 
29
  = Auto Links =
61
 
62
  == Change Log ==
63
 
64
+ = 6.5 =
65
+
66
+ - Domains to Exclude no longer assumes subdomains meaning subdomains need to be specifically excluded now.
67
+ - Entry of Domains to Exclude now allows separation by comma, space, newline/return, and tab. It will convert into a csv list.
68
+ - Fix placeholder links (href="#") not being excluded from processing correctly.
69
+ - Fix Plugin version number not being updated in the database options correctly.
70
+
71
  = 6.4.1 =
72
 
73
  - External Links with querystring not being excluded by Domains to Exclude
sem-external-links-admin.php CHANGED
@@ -84,7 +84,7 @@ class external_links_admin {
84
  $$var = isset($_POST[$var]);
85
 
86
  $exclude_domains = stripslashes($_POST['exclude_domains']);
87
- $domains = explode( ',', $exclude_domains );
88
  $exclude_domains = array();
89
 
90
  global $sem_external_links;
@@ -93,13 +93,13 @@ class external_links_admin {
93
  $domain = str_replace('http://', '', $domain);
94
  $domain = str_replace('https://', '', $domain);
95
  if ( $sem_external_links->is_valid_domain_name($domain)) {
96
- $domain = $sem_external_links->extract_domain( $domain );
97
  if ( !in_array( $domain, $exclude_domains) )
98
  $exclude_domains[] = $domain;
99
  }
100
  }
101
 
102
- $exclude_domains = implode( ',', $exclude_domains );
103
 
104
  $version = sem_external_links_version;
105
  update_option('external_links', compact('global', 'icon', 'target', 'nofollow', 'text_widgets',
@@ -268,9 +268,9 @@ class external_links_admin {
268
  . '<textarea name="exclude_domains" cols="58" rows="4" class="widefat">'
269
  . esc_html($options['exclude_domains'])
270
  . '</textarea>' . "\n"
271
- . __('Domains should be separated by a comma and entered as the base domain only. &nbsp;http://, https://, www. should not be included and will be stripped off.', 'external-links')
272
  . '</label>&nbsp;&nbsp;'
273
- . '<i>' .__('Example: domain.com, domain.net, somesite.com, external.org.', 'external-links') . '</i>'
274
  . '<br />' . "\n"
275
  . '</td>'
276
  . '</tr>' . "\n";
84
  $$var = isset($_POST[$var]);
85
 
86
  $exclude_domains = stripslashes($_POST['exclude_domains']);
87
+ $domains = preg_split("/[\s,]+/", $exclude_domains);
88
  $exclude_domains = array();
89
 
90
  global $sem_external_links;
93
  $domain = str_replace('http://', '', $domain);
94
  $domain = str_replace('https://', '', $domain);
95
  if ( $sem_external_links->is_valid_domain_name($domain)) {
96
+ $domain = str_replace('www.', '', $domain);
97
  if ( !in_array( $domain, $exclude_domains) )
98
  $exclude_domains[] = $domain;
99
  }
100
  }
101
 
102
+ $exclude_domains = implode( ', ', $exclude_domains );
103
 
104
  $version = sem_external_links_version;
105
  update_option('external_links', compact('global', 'icon', 'target', 'nofollow', 'text_widgets',
268
  . '<textarea name="exclude_domains" cols="58" rows="4" class="widefat">'
269
  . esc_html($options['exclude_domains'])
270
  . '</textarea>' . "\n"
271
+ . __('Domains and subdomains should be separated by a comma, space or carriage return. &nbsp;http://, https://, www. should not be included and will be stripped off.', 'external-links')
272
  . '</label>&nbsp;&nbsp;'
273
+ . '<i>' .__('Example: domain.com, domain.net, sub.domain.com, somesite.com, external.org.', 'external-links') . '</i>'
274
  . '<br />' . "\n"
275
  . '</td>'
276
  . '</tr>' . "\n";
sem-external-links.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: External Links
4
  Plugin URI: http://www.semiologic.com/software/external-links/
5
  Description: Marks outbound links as such, with various effects that are configurable under <a href="options-general.php?page=external-links">Settings / External Links</a>.
6
- Version: 6.4.1
7
  Author: Denis de Bernardy & Mike Koepke
8
  Author URI: https://www.semiologic.com
9
  Text Domain: external-links
@@ -19,7 +19,7 @@ This software is copyright Denis de Bernardy & Mike Koepke, and is distributed u
19
 
20
  **/
21
 
22
- define('sem_external_links_version', '6.4.1');
23
 
24
  /**
25
  * external_links
@@ -31,6 +31,8 @@ class sem_external_links {
31
 
32
  protected $opts;
33
 
 
 
34
  protected $anchor_utils;
35
 
36
  /**
@@ -111,6 +113,11 @@ class sem_external_links {
111
  // more stuff: register actions and filters
112
  $this->opts = sem_external_links::get_options();
113
 
 
 
 
 
 
114
  if ( !is_admin() ) {
115
  $inc_text_widgets = false;
116
  if ( isset( $this->opts['text_widgets'] ) && $this->opts['text_widgets'] )
@@ -174,7 +181,6 @@ class sem_external_links {
174
  **/
175
 
176
  function process_content($text, $context = "global") {
177
-
178
  // short circuit if there's no anchors at all in the text
179
  if ( false === stripos($text, '<a ') )
180
  return($text);
@@ -497,7 +503,7 @@ class sem_external_links {
497
  $addthis = false;
498
  foreach( $anchor['attr']['class'] as $c => $class) {
499
  $pos = strpos( $class, "addthis_button" );
500
- if ( null !== $pos ) {
501
  $addthis = true;
502
  break;
503
  }
@@ -651,10 +657,8 @@ class sem_external_links {
651
  $link_domain = strtolower($link_domain);
652
  $link_domain = str_replace('www.', '', $link_domain);
653
 
654
- if ( isset($this->opts['exclude_domains']) ) {
655
- $exclude_domains = explode( ',', $this->opts['exclude_domains'] );
656
- $dom = $this->extract_domain($link_domain);
657
- if ( in_array( $dom, $exclude_domains) )
658
  return false;
659
  }
660
 
@@ -809,7 +813,7 @@ class sem_external_links {
809
  $updated_opts['autolinks'] = true;
810
  }
811
 
812
- $o['version'] = sem_external_links_version;
813
 
814
  update_option('external_links', $updated_opts);
815
 
3
  Plugin Name: External Links
4
  Plugin URI: http://www.semiologic.com/software/external-links/
5
  Description: Marks outbound links as such, with various effects that are configurable under <a href="options-general.php?page=external-links">Settings / External Links</a>.
6
+ Version: 6.5
7
  Author: Denis de Bernardy & Mike Koepke
8
  Author URI: https://www.semiologic.com
9
  Text Domain: external-links
19
 
20
  **/
21
 
22
+ define('sem_external_links_version', '6.5');
23
 
24
  /**
25
  * external_links
31
 
32
  protected $opts;
33
 
34
+ protected $exclude_domains;
35
+
36
  protected $anchor_utils;
37
 
38
  /**
113
  // more stuff: register actions and filters
114
  $this->opts = sem_external_links::get_options();
115
 
116
+ $this->exclude_domains = array();
117
+ if ( isset($this->opts['exclude_domains']) ) {
118
+ $this->exclude_domains = preg_split("/[\s,]+/", $this->opts['exclude_domains']);
119
+ }
120
+
121
  if ( !is_admin() ) {
122
  $inc_text_widgets = false;
123
  if ( isset( $this->opts['text_widgets'] ) && $this->opts['text_widgets'] )
181
  **/
182
 
183
  function process_content($text, $context = "global") {
 
184
  // short circuit if there's no anchors at all in the text
185
  if ( false === stripos($text, '<a ') )
186
  return($text);
503
  $addthis = false;
504
  foreach( $anchor['attr']['class'] as $c => $class) {
505
  $pos = strpos( $class, "addthis_button" );
506
+ if ( false !== $pos ) {
507
  $addthis = true;
508
  break;
509
  }
657
  $link_domain = strtolower($link_domain);
658
  $link_domain = str_replace('www.', '', $link_domain);
659
 
660
+ if ( !empty($this->exclude_domains) ) {
661
+ if ( in_array( $link_domain, $this->exclude_domains) )
 
 
662
  return false;
663
  }
664
 
813
  $updated_opts['autolinks'] = true;
814
  }
815
 
816
+ $updated_opts['version'] = sem_external_links_version;
817
 
818
  update_option('external_links', $updated_opts);
819
 
sem-external-links.pot CHANGED
@@ -1,174 +1,149 @@
1
- # Copyright (C) 2014 External Links
2
  # This file is distributed under the same license as the External Links package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: External Links 6.4\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/sem-external-"
7
- "links\n"
8
- "POT-Creation-Date: 2014-12-13 15:59:51+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
 
16
- #: sem-external-links-admin.php:109
17
  msgid "Settings saved."
18
  msgstr ""
19
 
20
- #: sem-external-links-admin.php:133
21
- msgid ""
22
- "Note: Your rel=nofollow preferences is being ignored because the dofollow "
23
- "plugin is enabled on your site."
24
  msgstr ""
25
 
26
- #: sem-external-links-admin.php:138
27
  msgid "External Links Settings"
28
  msgstr ""
29
 
30
- #: sem-external-links-admin.php:144
31
  msgid "Apply Globally"
32
  msgstr ""
33
 
34
- #: sem-external-links-admin.php:152
35
- msgid ""
36
- "Apply these settings to all outbound links on the site except those in "
37
- "scripts, styles and the html head section."
38
  msgstr ""
39
 
40
- #: sem-external-links-admin.php:159
41
  msgid "Apply to Text Widgets"
42
  msgstr ""
43
 
44
- #: sem-external-links-admin.php:167
45
- msgid ""
46
- "Apply these settings to any text widgets in addition to post, page and "
47
- "comments content."
48
  msgstr ""
49
 
50
- #: sem-external-links-admin.php:174
51
  msgid "Treat Subdomains as Local"
52
  msgstr ""
53
 
54
- #: sem-external-links-admin.php:182
55
  msgid "Treat any subdomains for this site as a local link."
56
  msgstr ""
57
 
58
- #: sem-external-links-admin.php:185
59
- msgid ""
60
- "Example: If your site is at domain.com and you also have store.domain.com, "
61
- "any link to store.domain.com will be treated as local."
62
  msgstr ""
63
 
64
- #: sem-external-links-admin.php:191
65
  msgid "Auto Convert Text Urls"
66
  msgstr ""
67
 
68
- #: sem-external-links-admin.php:199
69
  msgid "Automatically converts text urls into clickable urls."
70
  msgstr ""
71
 
72
- #: sem-external-links-admin.php:202
73
- msgid ""
74
- "Note: If this option is enabled then if www.example.com is found in your "
75
- "text, it will be converted to an html &lt;a&gt; link.\""
76
  msgstr ""
77
 
78
- #: sem-external-links-admin.php:204
79
- msgid ""
80
- "This conversion will occur first so external link treatment for nofollow, "
81
- "icon and target will be applied to this auto links."
82
  msgstr ""
83
 
84
- #: sem-external-links-admin.php:210
85
  msgid "Add No Follow"
86
  msgstr ""
87
 
88
- #: sem-external-links-admin.php:218
89
  msgid "Add a rel=\"nofollow\" attribute to outbound links."
90
  msgstr ""
91
 
92
- #: sem-external-links-admin.php:221
93
- msgid ""
94
- "Note: You can override this behavior by adding the attribute rel=\"follow\" "
95
- "to individual links."
96
  msgstr ""
97
 
98
- #: sem-external-links-admin.php:227
99
  msgid "Add Icons"
100
  msgstr ""
101
 
102
- #: sem-external-links-admin.php:235
103
  msgid "Mark outbound links with an icon."
104
  msgstr ""
105
 
106
- #: sem-external-links-admin.php:238
107
- msgid ""
108
- "Note: You can override this behavior by adding a class=\"no_icon\" or "
109
- "\"noicon\" to individual links."
110
  msgstr ""
111
 
112
- #: sem-external-links-admin.php:244
113
  msgid "Open in New Windows"
114
  msgstr ""
115
 
116
- #: sem-external-links-admin.php:252
117
  msgid "Open outbound links in new windows."
118
  msgstr ""
119
 
120
- #: sem-external-links-admin.php:255
121
- msgid ""
122
- "Note: Some usability experts discourage this, claiming that <a href=\"http://"
123
- "www.useit.com/alertbox/9605.html\">this can damage your visitors' trust</a> "
124
- "towards your site. Others highlight that computer-illiterate users do not "
125
- "always know how to use the back button, and encourage the practice for that "
126
- "reason."
127
  msgstr ""
128
 
129
- #: sem-external-links-admin.php:261
130
  msgid "Domains to Exclude"
131
  msgstr ""
132
 
133
- #: sem-external-links-admin.php:265
134
  msgid "External site domains that should be excluded from processing:"
135
  msgstr ""
136
 
137
- #: sem-external-links-admin.php:269
138
- msgid ""
139
- "Domains should be separated by a comma and entered as the base domain only. "
140
- "&nbsp;http://, https://, www. should not be included and will be stripped "
141
- "off."
142
  msgstr ""
143
 
144
- #: sem-external-links-admin.php:271
145
- msgid "Example: domain.com, domain.net, somesite.com, external.org."
146
  msgstr ""
147
 
148
- #: sem-external-links-admin.php:280
149
  msgid "Save Changes"
150
  msgstr ""
151
 
152
- #. #-#-#-#-# sem-external-links.pot (External Links 6.4) #-#-#-#-#
153
- #. Plugin Name of the plugin/theme
154
- #: sem-external-links-info.php:2 sem-external-links.php:835
155
- #: sem-external-links.php:836
156
  msgid "External Links"
157
  msgstr ""
158
 
159
- #. #-#-#-#-# sem-external-links.pot (External Links 6.4) #-#-#-#-#
160
- #. Description of the plugin/theme
161
  #: sem-external-links-info.php:3
162
- msgid ""
163
- "Marks outbound links as such, with various effects that are configurable "
164
- "under <a href=\"options-general.php?page=external-links\">Settings / "
165
- "External Links</a>."
166
  msgstr ""
167
 
168
  #. Plugin URI of the plugin/theme
169
  msgid "http://www.semiologic.com/software/external-links/"
170
  msgstr ""
171
 
 
 
 
 
172
  #. Author of the plugin/theme
173
  msgid "Denis de Bernardy & Mike Koepke"
174
  msgstr ""
1
+ # Copyright (C) 2015 External Links
2
  # This file is distributed under the same license as the External Links package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: External Links 6.5\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/sem-external-links\n"
7
+ "POT-Creation-Date: 2015-02-02 16:39:12+00:00\n"
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: sem-external-links-admin.php:111
16
  msgid "Settings saved."
17
  msgstr ""
18
 
19
+ #: sem-external-links-admin.php:135
20
+ msgid "Note: Your rel=nofollow preferences is being ignored because the dofollow plugin is enabled on your site."
 
 
21
  msgstr ""
22
 
23
+ #: sem-external-links-admin.php:140
24
  msgid "External Links Settings"
25
  msgstr ""
26
 
27
+ #: sem-external-links-admin.php:146
28
  msgid "Apply Globally"
29
  msgstr ""
30
 
31
+ #: sem-external-links-admin.php:154
32
+ msgid "Apply these settings to all outbound links on the site except those in scripts, styles and the html head section."
 
 
33
  msgstr ""
34
 
35
+ #: sem-external-links-admin.php:161
36
  msgid "Apply to Text Widgets"
37
  msgstr ""
38
 
39
+ #: sem-external-links-admin.php:169
40
+ msgid "Apply these settings to any text widgets in addition to post, page and comments content."
 
 
41
  msgstr ""
42
 
43
+ #: sem-external-links-admin.php:176
44
  msgid "Treat Subdomains as Local"
45
  msgstr ""
46
 
47
+ #: sem-external-links-admin.php:184
48
  msgid "Treat any subdomains for this site as a local link."
49
  msgstr ""
50
 
51
+ #: sem-external-links-admin.php:187
52
+ msgid "Example: If your site is at domain.com and you also have store.domain.com, any link to store.domain.com will be treated as local."
 
 
53
  msgstr ""
54
 
55
+ #: sem-external-links-admin.php:193
56
  msgid "Auto Convert Text Urls"
57
  msgstr ""
58
 
59
+ #: sem-external-links-admin.php:201
60
  msgid "Automatically converts text urls into clickable urls."
61
  msgstr ""
62
 
63
+ #: sem-external-links-admin.php:204
64
+ msgid "Note: If this option is enabled then if www.example.com is found in your text, it will be converted to an html &lt;a&gt; link.\""
 
 
65
  msgstr ""
66
 
67
+ #: sem-external-links-admin.php:206
68
+ msgid "This conversion will occur first so external link treatment for nofollow, icon and target will be applied to this auto links."
 
 
69
  msgstr ""
70
 
71
+ #: sem-external-links-admin.php:212
72
  msgid "Add No Follow"
73
  msgstr ""
74
 
75
+ #: sem-external-links-admin.php:220
76
  msgid "Add a rel=\"nofollow\" attribute to outbound links."
77
  msgstr ""
78
 
79
+ #: sem-external-links-admin.php:223
80
+ msgid "Note: You can override this behavior by adding the attribute rel=\"follow\" to individual links."
 
 
81
  msgstr ""
82
 
83
+ #: sem-external-links-admin.php:229
84
  msgid "Add Icons"
85
  msgstr ""
86
 
87
+ #: sem-external-links-admin.php:237
88
  msgid "Mark outbound links with an icon."
89
  msgstr ""
90
 
91
+ #: sem-external-links-admin.php:240
92
+ msgid "Note: You can override this behavior by adding a class=\"no_icon\" or \"noicon\" to individual links."
 
 
93
  msgstr ""
94
 
95
+ #: sem-external-links-admin.php:246
96
  msgid "Open in New Windows"
97
  msgstr ""
98
 
99
+ #: sem-external-links-admin.php:254
100
  msgid "Open outbound links in new windows."
101
  msgstr ""
102
 
103
+ #: sem-external-links-admin.php:257
104
+ msgid "Note: Some usability experts discourage this, claiming that <a href=\"http://www.useit.com/alertbox/9605.html\">this can damage your visitors' trust</a> towards your site. Others highlight that computer-illiterate users do not always know how to use the back button, and encourage the practice for that reason."
 
 
 
 
 
105
  msgstr ""
106
 
107
+ #: sem-external-links-admin.php:263
108
  msgid "Domains to Exclude"
109
  msgstr ""
110
 
111
+ #: sem-external-links-admin.php:267
112
  msgid "External site domains that should be excluded from processing:"
113
  msgstr ""
114
 
115
+ #: sem-external-links-admin.php:271
116
+ msgid "Domains and subdomains should be separated by a comma, space or carriage return. &nbsp;http://, https://, www. should not be included and will be stripped off."
 
 
 
117
  msgstr ""
118
 
119
+ #: sem-external-links-admin.php:273
120
+ msgid "Example: domain.com, domain.net, sub.domain.com, somesite.com, external.org."
121
  msgstr ""
122
 
123
+ #: sem-external-links-admin.php:282
124
  msgid "Save Changes"
125
  msgstr ""
126
 
127
+ #: sem-external-links-info.php:2 sem-external-links.php:862
128
+ #: sem-external-links.php:863
 
 
129
  msgid "External Links"
130
  msgstr ""
131
 
 
 
132
  #: sem-external-links-info.php:3
133
+ msgid "Marks outbound links as such, with various effects that are configurable under <a href=\"options-general.php?page=external-links\">Settings / External Links</a>."
134
+ msgstr ""
135
+ #. Plugin Name of the plugin/theme
136
+ msgid "External Links"
137
  msgstr ""
138
 
139
  #. Plugin URI of the plugin/theme
140
  msgid "http://www.semiologic.com/software/external-links/"
141
  msgstr ""
142
 
143
+ #. Description of the plugin/theme
144
+ msgid "Marks outbound links as such, with various effects that are configurable under <a href=\"options-general.php?page=external-links\">Settings / External Links</a>."
145
+ msgstr ""
146
+
147
  #. Author of the plugin/theme
148
  msgid "Denis de Bernardy & Mike Koepke"
149
  msgstr ""