WP External Links (nofollow new tab seo) - Version 2.1.1

Version Description

  • Fixed updating old plugin values
  • Fixed links containing rel="external" will also be treated as external
  • Fixed prevent caching old styles and scripts
Download this release

Release Info

Developer freelancephp
Plugin Icon 128x128 WP External Links (nofollow new tab seo)
Version 2.1.1
Comparing to
See all releases

Code changes from version 2.1.0 to 2.1.1

Files changed (42) hide show
  1. includes/admin/class-wpel-network-page.php +4 -25
  2. includes/admin/class-wpel-settings-page.php +4 -25
  3. includes/admin/network-fields/class-wpel-network-admin-fields.php +3 -1
  4. includes/admin/network-fields/class-wpel-network-fields.php +3 -1
  5. includes/admin/settings-fields/class-wpel-admin-fields.php +3 -1
  6. includes/admin/settings-fields/class-wpel-exceptions-fields.php +3 -1
  7. includes/admin/settings-fields/class-wpel-excluded-link-fields.php +3 -1
  8. includes/admin/settings-fields/class-wpel-external-link-fields.php +3 -1
  9. includes/admin/settings-fields/class-wpel-internal-link-fields.php +3 -1
  10. includes/admin/settings-fields/class-wpel-link-fields-base.php +3 -1
  11. includes/class-wpel-front-ignore.php +1 -1
  12. includes/class-wpel-front.php +6 -26
  13. includes/class-wpel-link.php +2 -2
  14. includes/class-wpel-plugin.php +14 -2
  15. includes/class-wpel-register-hooks.php +156 -0
  16. includes/class-wpel-register-scripts.php +75 -0
  17. includes/class-wpel-template-tags.php +1 -1
  18. includes/{class-wpel-registerhooks.php → class-wpel-update.php} +17 -97
  19. libs/fwp/class-fwp-settings-section-fields.php +3 -3
  20. libs/fwp/filter-hooks/class-fwp-final-output.php +0 -2
  21. libs/fwp/filter-hooks/class-fwp-widget-output.php +3 -5
  22. libs/wprun/class-wprun-base.php +8 -10
  23. public/images/link-icon-example.png +0 -0
  24. readme.txt +443 -422
  25. screenshot-2.png +0 -0
  26. templates/network-page/help-tabs/under-construction.php +1 -1
  27. templates/network-page/main.php +1 -1
  28. templates/network-page/tab-contents/network-admin-settings.php +1 -1
  29. templates/network-page/tab-contents/network-settings.php +1 -1
  30. templates/partials/nav-tabs.php +1 -1
  31. templates/partials/tab-contents/fields-default.php +1 -1
  32. templates/partials/tab-contents/support.php +1 -1
  33. templates/requirements-notice.php +1 -1
  34. templates/settings-page/help-tabs/data-attributes.php +1 -1
  35. templates/settings-page/help-tabs/under-construction.php +1 -1
  36. templates/settings-page/main.php +1 -1
  37. templates/settings-page/tab-contents/admin.php +1 -1
  38. templates/settings-page/tab-contents/exceptions.php +1 -1
  39. templates/settings-page/tab-contents/excluded-links.php +1 -1
  40. templates/settings-page/tab-contents/external-links.php +1 -1
  41. templates/settings-page/tab-contents/internal-links.php +1 -1
  42. wp-external-links.php +4 -3
includes/admin/class-wpel-network-page.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -127,30 +127,9 @@ final class WPEL_Network_Page extends WPRun_Base_1x0x0
127
  */
128
  protected function action_admin_enqueue_scripts()
129
  {
130
- // set admin style
131
- wp_enqueue_style(
132
- 'wpel-admin-style'
133
- , plugins_url( '/public/css/wpel-admin.css', WPEL_Plugin::get_plugin_file() )
134
- , array()
135
- , '2.1.0'
136
- );
137
-
138
- // set wpel admin script
139
- wp_enqueue_script(
140
- 'wpel-admin-settings'
141
- , plugins_url( '/public/js/wpel-admin.js', WPEL_Plugin::get_plugin_file() )
142
- , array('jquery')
143
- , '2.1.0'
144
- , true
145
- );
146
-
147
- // set style
148
- wp_enqueue_style(
149
- 'font-awesome'
150
- , 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'
151
- , array()
152
- , null
153
- );
154
  }
155
 
156
  /**
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
127
  */
128
  protected function action_admin_enqueue_scripts()
129
  {
130
+ wp_enqueue_style( 'font-awesome' );
131
+ wp_enqueue_style( 'wpel-admin-style' );
132
+ wp_enqueue_script( 'wpel-admin-script' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
 
135
  /**
includes/admin/class-wpel-settings-page.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -175,30 +175,9 @@ final class WPEL_Settings_Page extends WPRun_Base_1x0x0
175
  */
176
  protected function action_admin_enqueue_scripts()
177
  {
178
- // set admin style
179
- wp_enqueue_style(
180
- 'wpel-admin-style'
181
- , plugins_url( '/public/css/wpel-admin.css', WPEL_Plugin::get_plugin_file() )
182
- , array()
183
- , '2.1.0'
184
- );
185
-
186
- // set wpel admin script
187
- wp_enqueue_script(
188
- 'wpel-admin-settings'
189
- , plugins_url( '/public/js/wpel-admin.js', WPEL_Plugin::get_plugin_file() )
190
- , array('jquery')
191
- , '2.1.0'
192
- , true
193
- );
194
-
195
- // set style
196
- wp_enqueue_style(
197
- 'font-awesome'
198
- , 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'
199
- , array()
200
- , null
201
- );
202
  }
203
 
204
  /**
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
175
  */
176
  protected function action_admin_enqueue_scripts()
177
  {
178
+ wp_enqueue_style( 'font-awesome' );
179
+ wp_enqueue_style( 'wpel-admin-style' );
180
+ wp_enqueue_script( 'wpel-admin-script' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  }
182
 
183
  /**
includes/admin/network-fields/class-wpel-network-admin-fields.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -35,6 +35,8 @@ final class WPEL_Network_Admin_Fields extends FWP_Settings_Section_Fields_1x0x0
35
  if ( is_network_admin() ) {
36
  add_action( 'network_admin_edit_'. $this->get_setting( 'option_group' ) , $this->get_callback( 'save_network_settings' ) );
37
  }
 
 
38
  }
39
 
40
  protected function save_network_settings()
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
35
  if ( is_network_admin() ) {
36
  add_action( 'network_admin_edit_'. $this->get_setting( 'option_group' ) , $this->get_callback( 'save_network_settings' ) );
37
  }
38
+
39
+ parent::init();
40
  }
41
 
42
  protected function save_network_settings()
includes/admin/network-fields/class-wpel-network-fields.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -39,6 +39,8 @@ final class WPEL_Network_Fields extends FWP_Settings_Section_Fields_1x0x0
39
  if ( is_network_admin() ) {
40
  add_action( 'network_admin_edit_'. $this->get_setting( 'option_group' ) , $this->get_callback( 'save_network_settings' ) );
41
  }
 
 
42
  }
43
 
44
  /**
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
39
  if ( is_network_admin() ) {
40
  add_action( 'network_admin_edit_'. $this->get_setting( 'option_group' ) , $this->get_callback( 'save_network_settings' ) );
41
  }
42
+
43
+ parent::init();
44
  }
45
 
46
  /**
includes/admin/settings-fields/class-wpel-admin-fields.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -31,6 +31,8 @@ final class WPEL_Admin_Fields extends FWP_Settings_Section_Fields_1x0x0
31
  ),
32
  ),
33
  ) );
 
 
34
  }
35
 
36
  /**
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
31
  ),
32
  ),
33
  ) );
34
+
35
+ parent::init();
36
  }
37
 
38
  /**
includes/admin/settings-fields/class-wpel-exceptions-fields.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -64,6 +64,8 @@ final class WPEL_Exceptions_Fields extends FWP_Settings_Section_Fields_1x0x0
64
  ),
65
  ),
66
  ) );
 
 
67
  }
68
 
69
  /**
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
64
  ),
65
  ),
66
  ) );
67
+
68
+ parent::init();
69
  }
70
 
71
  /**
includes/admin/settings-fields/class-wpel-excluded-link-fields.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -33,6 +33,8 @@ final class WPEL_Excluded_Link_Fields extends WPEL_Link_Fields_Base
33
  'title' => __( 'Excluded Links', 'wp-external-links' ),
34
  'fields' => $fields,
35
  ) );
 
 
36
  }
37
 
38
  }
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
33
  'title' => __( 'Excluded Links', 'wp-external-links' ),
34
  'fields' => $fields,
35
  ) );
36
+
37
+ parent::init();
38
  }
39
 
40
  }
includes/admin/settings-fields/class-wpel-external-link-fields.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -52,6 +52,8 @@ final class WPEL_External_Link_Fields extends WPEL_Link_Fields_Base
52
  'title' => __( 'External Links', 'wp-external-links' ),
53
  'fields' => $fields,
54
  ) );
 
 
55
  }
56
 
57
  /**
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
52
  'title' => __( 'External Links', 'wp-external-links' ),
53
  'fields' => $fields,
54
  ) );
55
+
56
+ parent::init();
57
  }
58
 
59
  /**
includes/admin/settings-fields/class-wpel-internal-link-fields.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -33,6 +33,8 @@ final class WPEL_Internal_Link_Fields extends WPEL_Link_Fields_Base
33
  'title' => __( 'Internal Links', 'wp-external-links' ),
34
  'fields' => $fields,
35
  ) );
 
 
36
  }
37
 
38
  }
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
33
  'title' => __( 'Internal Links', 'wp-external-links' ),
34
  'fields' => $fields,
35
  ) );
36
+
37
+ parent::init();
38
  }
39
 
40
  }
includes/admin/settings-fields/class-wpel-link-fields-base.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -89,6 +89,8 @@ abstract class WPEL_Link_Fields_Base extends FWP_Settings_Section_Fields_1x0x0
89
  'default_value' => '1',
90
  ),
91
  );
 
 
92
  }
93
 
94
  /**
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
89
  'default_value' => '1',
90
  ),
91
  );
92
+
93
+ parent::init();
94
  }
95
 
96
  /**
includes/class-wpel-front-ignore.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
includes/class-wpel-front.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -28,7 +28,7 @@ final class WPEL_Front extends WPRun_Base_1x0x0
28
 
29
  // apply page sections
30
  if ( $this->opt( 'apply_all' ) ) {
31
- add_action( 'final_output', $this->get_callback( 'scan' ) );
32
  } else {
33
  $filter_hooks = array();
34
 
@@ -45,7 +45,7 @@ final class WPEL_Front extends WPRun_Base_1x0x0
45
  }
46
 
47
  foreach ( $filter_hooks as $hook ) {
48
- add_filter( $hook, $this->get_callback( 'scan' ) );
49
  }
50
  }
51
  }
@@ -63,7 +63,7 @@ final class WPEL_Front extends WPRun_Base_1x0x0
63
  }
64
 
65
  /**
66
- * Enqueue scripts and styles
67
  */
68
  protected function action_wp_enqueue_scripts()
69
  {
@@ -75,21 +75,11 @@ final class WPEL_Front extends WPRun_Base_1x0x0
75
  }
76
 
77
  if ( 'fontawesome' === $icon_type_int || 'fontawesome' === $icon_type_ext ) {
78
- wp_enqueue_style(
79
- 'font-awesome'
80
- , 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'
81
- , array()
82
- , null
83
- );
84
  }
85
 
86
  if ( $this->opt( 'icon_type', 'external-links' ) || $this->opt( 'icon_type', 'internal-links' ) ) {
87
- wp_enqueue_style(
88
- 'wpel-style'
89
- , plugins_url( '/public/css/wpel.css', WPEL_Plugin::get_plugin_file() )
90
- , array()
91
- , null
92
- );
93
  }
94
  }
95
 
@@ -160,16 +150,6 @@ final class WPEL_Front extends WPRun_Base_1x0x0
160
  $link = new WPEL_Link( 'a', $label );
161
  $link->set_atts( $atts );
162
 
163
- // /**
164
- // * Filter whether settings will be applied on this links
165
- // * @param WPEL_Link $link
166
- // */
167
- // $apply_link = apply_filters( 'wpel_apply_link', $link );
168
- //
169
- // if ( false === $apply_link ) {
170
- // return false;
171
- // }
172
-
173
  /**
174
  * Action triggered before link settings will be applied
175
  * @param WPEL_Link $link
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
28
 
29
  // apply page sections
30
  if ( $this->opt( 'apply_all' ) ) {
31
+ add_action( 'final_output', $this->get_callback( 'scan' ), 10000000000 );
32
  } else {
33
  $filter_hooks = array();
34
 
45
  }
46
 
47
  foreach ( $filter_hooks as $hook ) {
48
+ add_filter( $hook, $this->get_callback( 'scan' ), 10000000000 );
49
  }
50
  }
51
  }
63
  }
64
 
65
  /**
66
+ * Action for "wp_enqueue_scripts"
67
  */
68
  protected function action_wp_enqueue_scripts()
69
  {
75
  }
76
 
77
  if ( 'fontawesome' === $icon_type_int || 'fontawesome' === $icon_type_ext ) {
78
+ wp_enqueue_style( 'font-awesome' );
 
 
 
 
 
79
  }
80
 
81
  if ( $this->opt( 'icon_type', 'external-links' ) || $this->opt( 'icon_type', 'internal-links' ) ) {
82
+ wp_enqueue_style( 'wpel-style' );
 
 
 
 
 
83
  }
84
  }
85
 
150
  $link = new WPEL_Link( 'a', $label );
151
  $link->set_atts( $atts );
152
 
 
 
 
 
 
 
 
 
 
 
153
  /**
154
  * Action triggered before link settings will be applied
155
  * @param WPEL_Link $link
includes/class-wpel-link.php CHANGED
@@ -7,7 +7,7 @@
7
  *
8
  * @package WPEL
9
  * @category WordPress Plugin
10
- * @version 2.1.0
11
  * @author Victor Villaverde Laan
12
  * @link http://www.finewebdev.com
13
  * @link https://github.com/freelancephp/WP-External-Links
@@ -30,7 +30,7 @@ class WPEL_Link extends FWP_HTML_Element_1x0x0
30
  */
31
  public function is_external()
32
  {
33
- return 'external' === $this->get_attr( 'data-wpel-link' );
34
  }
35
 
36
  /**
7
  *
8
  * @package WPEL
9
  * @category WordPress Plugin
10
+ * @version 2.1.1
11
  * @author Victor Villaverde Laan
12
  * @link http://www.finewebdev.com
13
  * @link https://github.com/freelancephp/WP-External-Links
30
  */
31
  public function is_external()
32
  {
33
+ return 'external' === $this->get_attr( 'data-wpel-link' ) || $this->has_attr_value( 'rel', 'external' );
34
  }
35
 
36
  /**
includes/class-wpel-plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -33,7 +33,8 @@ final class WPEL_Plugin extends WPRun_Base_1x0x0
33
  self::$plugin_file = $plugin_file;
34
  self::$plugin_dir = untrailingslashit( $plugin_dir );
35
 
36
- WPEL_Registerhooks::create();
 
37
 
38
  // network admin page
39
  $network_page = WPEL_Network_Page::create( array(
@@ -62,6 +63,17 @@ final class WPEL_Plugin extends WPRun_Base_1x0x0
62
 
63
  WPEL_Template_Tags::create();
64
  }
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
 
67
  /**
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
33
  self::$plugin_file = $plugin_file;
34
  self::$plugin_dir = untrailingslashit( $plugin_dir );
35
 
36
+ WPEL_Register_Hooks::create();
37
+ WPEL_Register_Scripts::create();
38
 
39
  // network admin page
40
  $network_page = WPEL_Network_Page::create( array(
63
 
64
  WPEL_Template_Tags::create();
65
  }
66
+
67
+ // update procedures
68
+ WPEL_Update::create();
69
+ }
70
+
71
+ /**
72
+ * Action for "plugins_loaded"
73
+ */
74
+ protected function action_plugins_loaded()
75
+ {
76
+ load_plugin_textdomain( 'wp-external-links', false, WPEL_Plugin::get_plugin_dir( '/languages' ) );
77
  }
78
 
79
  /**
includes/class-wpel-register-hooks.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPEL_Register_Hooks
4
+ *
5
+ * @package WPEL
6
+ * @category WordPress Plugin
7
+ * @version 2.1.1
8
+ * @author Victor Villaverde Laan
9
+ * @link http://www.finewebdev.com
10
+ * @link https://github.com/freelancephp/WP-External-Links
11
+ * @license Dual licensed under the MIT and GPLv2+ licenses
12
+ */
13
+ final class WPEL_Register_Hooks extends WPRun_Base_1x0x0
14
+ {
15
+
16
+ /**
17
+ * Initialize
18
+ */
19
+ protected function init()
20
+ {
21
+ register_activation_hook(
22
+ WPEL_Plugin::get_plugin_file()
23
+ , $this->get_callback( 'activate' )
24
+ );
25
+
26
+ register_uninstall_hook(
27
+ WPEL_Plugin::get_plugin_file()
28
+ , $this->get_callback( 'uninstall' )
29
+ );
30
+ }
31
+
32
+ /**
33
+ * Plugin activation procedure
34
+ */
35
+ protected function activate( $networkwide )
36
+ {
37
+ global $wpdb;
38
+
39
+ if ( is_multisite() && $networkwide ) {
40
+ // network activation
41
+ $sites = wp_get_sites();
42
+ $active_blog = $wpdb->blogid;
43
+
44
+ foreach ( $sites as $site ) {
45
+ switch_to_blog( $site[ 'blog_id' ] );
46
+ $this->activate_site();
47
+ }
48
+
49
+ // switch back to active blog
50
+ switch_to_blog( $active_blog );
51
+
52
+ $this->activate_network();
53
+ } else {
54
+ // single site activation
55
+ $this->activate_site();
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Activate network
61
+ * @return void
62
+ */
63
+ private function activate_network()
64
+ {
65
+ $network_already_set = get_site_option( 'wpel-network-settings' );
66
+
67
+ if ( $network_already_set ) {
68
+ return;
69
+ }
70
+
71
+ // network default settings
72
+ $network_values = WPEL_Network_Fields::get_instance()->get_default_values();
73
+ $network_admin_values = WPEL_Network_Admin_Fields::get_instance()->get_default_values();
74
+
75
+ update_site_option( 'wpel-network-settings', $network_values );
76
+ update_site_option( 'wpel-network-admin-settings', $network_admin_values );
77
+ }
78
+
79
+ /**
80
+ * Activate site
81
+ * @return void
82
+ */
83
+ private function activate_site()
84
+ {
85
+ $site_already_set = get_option( 'wpel-external-link-settings' );
86
+
87
+ if ( $site_already_set ) {
88
+ return;
89
+ }
90
+
91
+ // get default values
92
+ $external_link_values = WPEL_External_Link_Fields::get_instance()->get_default_values();
93
+ $internal_link_values = WPEL_Internal_Link_Fields::get_instance()->get_default_values();
94
+ $excluded_link_values = WPEL_Excluded_Link_Fields::get_instance()->get_default_values();
95
+ $exceptions_link_values = WPEL_Exceptions_Fields::get_instance()->get_default_values();
96
+ $admin_link_values = WPEL_Admin_Fields::get_instance()->get_default_values();
97
+
98
+ // update new values
99
+ update_option( 'wpel-external-link-settings', $external_link_values );
100
+ update_option( 'wpel-internal-link-settings', $internal_link_values );
101
+ update_option( 'wpel-excluded-link-settings', $excluded_link_values );
102
+ update_option( 'wpel-exceptions-settings', $exceptions_link_values );
103
+ update_option( 'wpel-admin-settings', $admin_link_values );
104
+
105
+ // update meta data
106
+ $plugin_data = get_plugin_data( WPEL_Plugin::get_plugin_file() );
107
+ update_option( 'wpel-version', $plugin_data[ 'Version' ] );
108
+ }
109
+
110
+ /**
111
+ * Uninstall site
112
+ */
113
+ protected function uninstall()
114
+ {
115
+ global $wpdb;
116
+
117
+ if ( is_multisite() ) {
118
+ // network activation
119
+ $sites = wp_get_sites();
120
+ $active_blog = $wpdb->blogid;
121
+ foreach ( $sites as $site ) {
122
+ switch_to_blog( $site[ 'blog_id' ] );
123
+ $this->uninstall_site();
124
+ }
125
+
126
+ // switch back to active blog
127
+ switch_to_blog( $active_blog );
128
+
129
+ // network settings
130
+ delete_site_option( 'wpel-network-settings' );
131
+ delete_site_option( 'wpel-network-admin-settings' );
132
+ } else {
133
+ // single site activation
134
+ $this->uninstall_site();
135
+ }
136
+ }
137
+
138
+ /**
139
+ * Plugin uninstall procedure
140
+ */
141
+ protected function uninstall_site()
142
+ {
143
+ // delete options
144
+ delete_option( 'wpel-external-link-settings' );
145
+ delete_option( 'wpel-internal-link-settings' );
146
+ delete_option( 'wpel-excluded-link-settings' );
147
+ delete_option( 'wpel-exceptions-settings' );
148
+ delete_option( 'wpel-admin-settings' );
149
+
150
+ delete_option( 'wpel-version' );
151
+ delete_option( 'wpel-show-notice' );
152
+ }
153
+
154
+ }
155
+
156
+ /*?>*/
includes/class-wpel-register-scripts.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPEL_Register_Scripts
4
+ *
5
+ * @package WPEL
6
+ * @category WordPress Plugin
7
+ * @version 2.1.1
8
+ * @author Victor Villaverde Laan
9
+ * @link http://www.finewebdev.com
10
+ * @link https://github.com/freelancephp/WP-External-Links
11
+ * @license Dual licensed under the MIT and GPLv2+ licenses
12
+ */
13
+ final class WPEL_Register_Scripts extends WPRun_Base_1x0x0
14
+ {
15
+
16
+ /**
17
+ * Action for "wp_enqueue_scripts"
18
+ */
19
+ protected function action_wp_enqueue_scripts()
20
+ {
21
+ $this->register_scripts();
22
+ }
23
+
24
+ /**
25
+ * Action for "admin_enqueue_scripts"
26
+ */
27
+ protected function action_admin_enqueue_scripts()
28
+ {
29
+ $this->register_scripts();
30
+ }
31
+
32
+ /**
33
+ * Register styles and scripts
34
+ */
35
+ protected function register_scripts()
36
+ {
37
+ $plugin_version = get_option( 'wpel-version' );
38
+
39
+ // set style font awesome icons
40
+ wp_register_style(
41
+ 'font-awesome'
42
+ , 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'
43
+ , array()
44
+ , $plugin_version
45
+ );
46
+
47
+ // front style
48
+ wp_register_style(
49
+ 'wpel-style'
50
+ , plugins_url( '/public/css/wpel.css', WPEL_Plugin::get_plugin_file() )
51
+ , array()
52
+ , $plugin_version
53
+ );
54
+
55
+ // set admin style
56
+ wp_register_style(
57
+ 'wpel-admin-style'
58
+ , plugins_url( '/public/css/wpel-admin.css', WPEL_Plugin::get_plugin_file() )
59
+ , array()
60
+ , $plugin_version
61
+ );
62
+
63
+ // set wpel admin script
64
+ wp_register_script(
65
+ 'wpel-admin-script'
66
+ , plugins_url( '/public/js/wpel-admin.js', WPEL_Plugin::get_plugin_file() )
67
+ , array( 'jquery' )
68
+ , $plugin_version
69
+ , true
70
+ );
71
+ }
72
+
73
+ }
74
+
75
+ /*?>*/
includes/class-wpel-template-tags.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
includes/{class-wpel-registerhooks.php → class-wpel-update.php} RENAMED
@@ -1,16 +1,16 @@
1
  <?php
2
  /**
3
- * Class WPEL_RegisterHooks
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
11
  * @license Dual licensed under the MIT and GPLv2+ licenses
12
  */
13
- final class WPEL_Registerhooks extends WPRun_Base_1x0x0
14
  {
15
 
16
  /**
@@ -18,69 +18,38 @@ final class WPEL_Registerhooks extends WPRun_Base_1x0x0
18
  */
19
  protected function init()
20
  {
21
- register_activation_hook(
22
- WPEL_Plugin::get_plugin_file()
23
- , $this->get_callback( 'activate' )
24
- );
25
-
26
- register_uninstall_hook(
27
- WPEL_Plugin::get_plugin_file()
28
- , $this->get_callback( 'uninstall' )
29
- );
30
  }
31
 
32
  /**
33
- * Plugin activation procedure
34
  */
35
- protected function activate( $networkwide )
36
  {
37
- global $wpdb;
38
-
39
- if ( is_multisite() && $networkwide ) {
40
- // network activation
41
- $sites = wp_get_sites();
42
- $active_blog = $wpdb->blogid;
43
-
44
- foreach ( $sites as $site ) {
45
- switch_to_blog( $site[ 'blog_id' ] );
46
- $this->activate_site();
47
- }
48
-
49
- // switch back to active blog
50
- switch_to_blog( $active_blog );
51
-
52
- $this->activate_network();
53
- } else {
54
- // single site activation
55
- $this->activate_site();
56
- }
57
  }
58
 
59
  /**
60
- * Activate network
61
  * @return void
62
  */
63
- private function activate_network()
64
  {
65
- $network_already_set = get_site_option( 'wpel-network-settings' );
66
-
67
- if ( $network_already_set ) {
68
- return;
69
- }
70
 
71
- // network default settings
72
- $network_values = WPEL_Network_Fields::get_instance()->get_default_values();
73
- $network_admin_values = WPEL_Network_Admin_Fields::get_instance()->get_default_values();
74
 
75
- update_site_option( 'wpel-network-settings', $network_values );
76
- update_site_option( 'wpel-network-admin-settings', $network_admin_values );
 
77
  }
78
 
79
  /**
80
- * Activate site
81
  * @return void
82
  */
83
- private function activate_site()
84
  {
85
  $site_already_set = get_option( 'wpel-external-link-settings' );
86
 
@@ -164,55 +133,6 @@ final class WPEL_Registerhooks extends WPRun_Base_1x0x0
164
  update_option( 'wpel-excluded-link-settings', $excluded_link_values );
165
  update_option( 'wpel-exceptions-settings', $exceptions_link_values );
166
  update_option( 'wpel-admin-settings', $admin_link_values );
167
-
168
- // update meta data
169
- $plugin_data = get_plugin_data( WPEL_Plugin::get_plugin_file() );
170
- update_option( 'wpel-version', $plugin_data[ 'Version' ] );
171
- update_option( 'wpel-show-notice', true );
172
- }
173
-
174
- /**
175
- * Uninstall site
176
- */
177
- protected function uninstall()
178
- {
179
- global $wpdb;
180
-
181
- if ( is_multisite() ) {
182
- // network activation
183
- $sites = wp_get_sites();
184
- $active_blog = $wpdb->blogid;
185
- foreach ( $sites as $site ) {
186
- switch_to_blog( $site[ 'blog_id' ] );
187
- $this->uninstall_site();
188
- }
189
-
190
- // switch back to active blog
191
- switch_to_blog( $active_blog );
192
-
193
- // network settings
194
- delete_site_option( 'wpel-network-settings' );
195
- delete_site_option( 'wpel-network-admin-settings' );
196
- } else {
197
- // single site activation
198
- $this->uninstall_site();
199
- }
200
- }
201
-
202
- /**
203
- * Plugin uninstall procedure
204
- */
205
- protected function uninstall_site()
206
- {
207
- // delete options
208
- delete_option( 'wpel-external-link-settings' );
209
- delete_option( 'wpel-internal-link-settings' );
210
- delete_option( 'wpel-excluded-link-settings' );
211
- delete_option( 'wpel-exceptions-settings' );
212
- delete_option( 'wpel-admin-settings' );
213
-
214
- delete_option( 'wpel-version' );
215
- delete_option( 'wpel-show-notice' );
216
  }
217
 
218
  }
1
  <?php
2
  /**
3
+ * Class WPEL_Update
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
11
  * @license Dual licensed under the MIT and GPLv2+ licenses
12
  */
13
+ final class WPEL_Update extends WPRun_Base_1x0x0
14
  {
15
 
16
  /**
18
  */
19
  protected function init()
20
  {
21
+ $this->update_to_v2();
 
 
 
 
 
 
 
 
22
  }
23
 
24
  /**
25
+ * Action for "admin_init"
26
  */
27
+ protected function action_admin_init()
28
  {
29
+ $this->update_version();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  }
31
 
32
  /**
33
+ * Update version
34
  * @return void
35
  */
36
+ private function update_version()
37
  {
38
+ $plugin_data = get_plugin_data( WPEL_Plugin::get_plugin_file() );
 
 
 
 
39
 
40
+ $current_version = $plugin_data[ 'Version' ];
41
+ $saved_version = get_option( 'wpel-version' );
 
42
 
43
+ if ( $current_version !== $saved_version ) {
44
+ update_option( 'wpel-version', $current_version );
45
+ }
46
  }
47
 
48
  /**
49
+ * Update procedure to v2.x
50
  * @return void
51
  */
52
+ private function update_to_v2()
53
  {
54
  $site_already_set = get_option( 'wpel-external-link-settings' );
55
 
133
  update_option( 'wpel-excluded-link-settings', $excluded_link_values );
134
  update_option( 'wpel-exceptions-settings', $exceptions_link_values );
135
  update_option( 'wpel-admin-settings', $admin_link_values );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  }
137
 
138
  }
libs/fwp/class-fwp-settings-section-fields.php CHANGED
@@ -49,9 +49,9 @@ abstract class FWP_Settings_Section_Fields_1x0x0 extends WPRun_Base_1x0x0
49
  private $option_values = array();
50
 
51
  /**
52
- * After init
53
  */
54
- protected function after_init()
55
  {
56
  $this->set_option_values();
57
  $this->set_html_fields();
@@ -231,7 +231,7 @@ abstract class FWP_Settings_Section_Fields_1x0x0 extends WPRun_Base_1x0x0
231
  {
232
  $field_method = 'show_'. $args[ 'key' ];
233
 
234
- if (is_callable( array( $this, $field_method ) ) ) {
235
  $this->{ $field_method }( $args );
236
  }
237
  }
49
  private $option_values = array();
50
 
51
  /**
52
+ * Init
53
  */
54
+ protected function init()
55
  {
56
  $this->set_option_values();
57
  $this->set_html_fields();
231
  {
232
  $field_method = 'show_'. $args[ 'key' ];
233
 
234
+ if ( is_callable( array( $this, $field_method ) ) ) {
235
  $this->{ $field_method }( $args );
236
  }
237
  }
libs/fwp/filter-hooks/class-fwp-final-output.php CHANGED
@@ -2,8 +2,6 @@
2
  /**
3
  * Class FWP_Final_Output_1x0x0
4
  *
5
- * @todo multiple versions - multiple filter applies
6
- *
7
  * @package FWP
8
  * @category WordPress Library
9
  * @version 1.0.0
2
  /**
3
  * Class FWP_Final_Output_1x0x0
4
  *
 
 
5
  * @package FWP
6
  * @category WordPress Library
7
  * @version 1.0.0
libs/fwp/filter-hooks/class-fwp-widget-output.php CHANGED
@@ -2,10 +2,8 @@
2
  /**
3
  * Class Widget_Output_1x0x0
4
  *
5
- * This component was inspired by:
6
- * @todo
7
- *
8
- * @todo multiple versions - multiple filter applies
9
  *
10
  * @package FWP
11
  * @category WordPress Library
@@ -65,7 +63,7 @@ class FWP_Widget_Output_1x0x0 extends WPRun_Base_1x0x0
65
 
66
  $widget_id_base = $wp_registered_widgets[ $widget_id ][ 'callback' ][ 0 ]->id_base;
67
 
68
- if ( !is_callable( $original_callback ) ) {
69
  return;
70
  }
71
 
2
  /**
3
  * Class Widget_Output_1x0x0
4
  *
5
+ * This component was inspired by the 'widget_content' filter of
6
+ * Widget Logic Plugin by Alan Trewartha (http://freakytrigger.co.uk/author/alan/)
 
 
7
  *
8
  * @package FWP
9
  * @category WordPress Library
63
 
64
  $widget_id_base = $wp_registered_widgets[ $widget_id ][ 'callback' ][ 0 ]->id_base;
65
 
66
+ if ( ! is_callable( $original_callback ) ) {
67
  return;
68
  }
69
 
libs/wprun/class-wprun-base.php CHANGED
@@ -109,18 +109,16 @@ abstract class WPRun_Base_1x0x0
109
  $this->set_hook_methods();
110
  }
111
 
112
- $init_methods = array( 'before_init', 'init', 'after_init' );
 
113
 
114
- // call init methods
115
- foreach ( $init_methods as $method_name ) {
116
- if ( method_exists( $this, $method_name ) ) {
117
- $method_reflection = new ReflectionMethod( get_called_class(), $method_name );
118
 
119
- if ( $method_reflection->isProtected() ) {
120
- call_user_func_array( array( $this, $method_name ), $this->arguments );
121
- } else {
122
- trigger_error( 'Method "'. $method_name .'" should be made protected in class "'. get_called_class() .'".' );
123
- }
124
  }
125
  }
126
  }
109
  $this->set_hook_methods();
110
  }
111
 
112
+ // call init method
113
+ $method_name = 'init';
114
 
115
+ if ( method_exists( $this, $method_name ) ) {
116
+ $method_reflection = new ReflectionMethod( get_called_class(), $method_name );
 
 
117
 
118
+ if ( $method_reflection->isProtected() ) {
119
+ call_user_func_array( array( $this, $method_name ), $this->arguments );
120
+ } else {
121
+ trigger_error( 'Method "'. $method_name .'" should be made protected in class "'. get_called_class() .'".' );
 
122
  }
123
  }
124
  }
public/images/link-icon-example.png DELETED
Binary file
readme.txt CHANGED
@@ -1,422 +1,443 @@
1
- === WP External Links (nofollow new tab seo) ===
2
- Contributors: freelancephp
3
- Tags: links, new window, new tab, external links, nofollow, follow, seo, noopener, noreferrer, internal links, link icon, link target, _blank, wpmu
4
- Requires at least: 4.2.0
5
- Tested up to: 4.5.2
6
- Stable tag: 2.1.0
7
-
8
- Open external links in a new tab / window, add "nofollow", "noopener" and font icons, SEO and more. Also for internal links.
9
-
10
-
11
- == Description ==
12
-
13
- Configure settings for all internal and external links on your site.
14
-
15
- > <strong>=== NEW: Version 2 ===</strong><br>
16
- > WPEL plugin was rebuilt completely and has lots of new features, like "noopener", font icons, internal links options and WPMU settings.
17
-
18
- = Features =
19
- * Open links in new window or tab
20
- * Add "follow" or "nofollow"
21
- * Add "noopener" and "noreferrer" (for security)
22
- * Add link icons (font icons: font awesome, dashicons)
23
- * Set other attributes like title and CSS classes
24
- * Scan posts, comments, widgets or the whole page
25
- * Better SEO
26
-
27
- = And more... =
28
- * Network Settings (WPMU support)
29
- * Use template tag to apply plugin settings on specific contents
30
- * Set data-attribute to change how individual links will be treated
31
- * Use action and filters to implement your specific needs
32
-
33
- = Easy to use =
34
- After activating you can set all options for external and internal links on the plugins admin page.
35
-
36
- = On the fly =
37
- The plugin filters the output and changes the links on the fly. The real contents (posts, pages, widget etcetera) will not be changed in the database.
38
- When deactivating the plugin, all contents will be the same as it was before.
39
-
40
- = Requirements =
41
- * PHP version 5.3 or up
42
- * WordPress version 4.2 or up
43
-
44
- If you want support for older versions of PHP or WordPress then download and install [version 1.81](https://downloads.wordpress.org/plugin/wp-external-links.1.81.zip) of this plugin.
45
-
46
- = Sources =
47
- * [Documentation](http://wordpress.org/extend/plugins/wp-external-links/other_notes/)
48
- * [FAQ](http://wordpress.org/extend/plugins/wp-external-links/faq/)
49
- * [Github](https://github.com/freelancephp/WP-External-Links)
50
-
51
- > <strong>Like this plugin?</strong><br>
52
- > [Rate it](http://wordpress.org/support/view/plugin-reviews/wp-external-links) to support the development of this plugin.
53
-
54
-
55
- == Installation ==
56
-
57
- 1. Go to `Plugins` in the Admin menu
58
- 1. Click on the button `Add new`
59
- 1. Search for `WP External Links` and click 'Install Now' OR click on the `upload` link to upload `wp-external-links.zip`
60
- 1. Click on `Activate plugin`
61
-
62
-
63
- == Frequently Asked Questions ==
64
-
65
- = I want certain posts or pages to be ignored by the plugin. How? =
66
-
67
- By using the `wpel_apply_settings` filter you can stop the plugin from processing that page, f.e.:
68
-
69
- `add_action( 'wpel_apply_settings', function () {
70
- global $post;
71
- $ignored_post_ids = array( 1, 2, 4 );
72
-
73
- if ( in_array( $post->ID, $ignored_post_ids ) ) {
74
- return false;
75
- }
76
-
77
- return true;
78
- }, 10 );`
79
-
80
- Using this filter you can ignore any request, like certain category, archive etcetera.
81
-
82
- = I want specific links to be ignored by the plugin. How? =
83
-
84
- By using the `wpel_before_apply_link` filter you can skip specific links from being processed by WPEL plugin, f.e.:
85
-
86
- `add_action( 'wpel_before_apply_link', function ( $link ) {
87
- // ignore links with class "some-cls"
88
- if ( $link->has_attr_value( 'class', 'some-cls' ) ) {
89
- $link->set_ignore();
90
- }
91
- }, 10 );`
92
-
93
-
94
- = How to create a redirect for external links? (f.e. affiliate links) =
95
-
96
- Create redirect by using the `wpel_link` action. Add some code to functions.php of your theme, like:
97
-
98
- `add_action( 'wpel_link', function ( $link ) {
99
- // check if link is an external links
100
- if ( $link->is_external() ) {
101
- // get current url
102
- $url = $link->get_attr( 'href' );
103
-
104
- // set redirect url
105
- $redirect_url = '//somedom.com?url='. urlencode( $url );
106
- $link->set_attr( 'href', $redirect_url );
107
- }
108
- }, 10, 1 );`
109
-
110
- = How to open external links in a new popup window? =
111
-
112
- By adding this JavaScript code to your site:
113
-
114
- `jQuery(function ($) {
115
-
116
- $('a[data-wpel-link="external"]').click(function (e) {
117
- // open link in popup window
118
- window.open($(this).attr('href'), '_blank', 'width=800, height=600');
119
-
120
- // stop default and other behaviour
121
- e.preventDefault();
122
- e.stopImmediatePropagation();
123
- });
124
-
125
- });`
126
-
127
- See more information on the [window.open() method](http://www.w3schools.com/jsref/met_win_open.asp).
128
-
129
- = How to add an confirm (or alert) when opening external links? =
130
-
131
- Add this JavaScript code to your site:
132
-
133
- `jQuery(function ($) {
134
-
135
- $('a[data-wpel-link="external"]').click(function (e) {
136
- if (!confirm('Are you sure you want to open this link?')) {
137
- // cancelled
138
- e.preventDefault();
139
- e.stopImmediatePropagation();
140
- }
141
- });
142
-
143
- });`
144
-
145
- = I am a plugin developer and my plugin conflicts with WPEL. How can I solve the problem? =
146
-
147
- If your plugin contains links it might be filtered by the WPEL plugin as well, causing a conflict.
148
- Here are some suggestions on solving the problem:
149
-
150
- 1. Add `data-wpel-link="ignore"` to links that need to be ignored by WPEL plugin
151
- 1. Use `wpel_before_apply_link`-action to ignore your links (f.e. containing certain class or data-attribute)
152
- 1. Use `wpel_apply_settings`-filter to ignore complete post, pages, categories etc
153
-
154
-
155
- [Do you have a question? Please ask me](http://www.finewebdev.comcontact/)
156
-
157
-
158
- == Screenshots ==
159
-
160
- 1. Link Icons
161
- 1. Admin Settings Page
162
- 1. WPMU Network Settings Page
163
-
164
-
165
- == Documentation ==
166
-
167
- After activating you can set all options for external and internal links.
168
-
169
- = Data attribute "data-wpel-link" =
170
-
171
- It's possible to add a special data attribute to individual links, so they will be marked (and treated)
172
- as external link, internal link, excluded link or completely ignored.
173
-
174
- `<a href="http://somedomain.com" data-wpel-link="ignore">Go to somedomain</a>`
175
-
176
- Possible values are `external`, `internal`, `exclude` or `ignore`. All links filtered
177
- by the plugin will contain this data attribute and the value on how they were treated.
178
-
179
- = Action "wpel_link" =
180
-
181
- Use this action to change the link object after all plugin settings have been applied.
182
-
183
- `add_action( 'wpel_link', ( $link_object ) {
184
- if ( $link_object->is_external() ) {
185
- // get current url
186
- $url = $link_object->getAttribute( 'href' );
187
-
188
- // set redirect url
189
- $redirect_url = '//somedom.com?url='. urlencode( $url );
190
- $link_object->setAttribute( 'href', $redirect_url );
191
- }
192
- }, 10, 1 );`
193
-
194
- The link object is an instance of WPEL_Link class.
195
-
196
- = Action hook "wpel_before_apply_link" =
197
-
198
- Use this action to change the link object before the plugin settings have been applied on that link.
199
- You can use this filter to ignore individual links from being processed. Or change how they will be treated
200
- by the WPEL plugin, f.e. make an internal link external.
201
-
202
- `add_action( 'wpel_before_apply_link', function ( $link ) {
203
- // ignore links with class "some-cls"
204
- if ( $link->has_attr_value( 'class', 'some-cls' ) ) {
205
- $link->set_ignore();
206
- }
207
-
208
- // mark and treat links with class "ext-cls" as external link
209
- if ( $link->has_attr_value( 'class', 'ext-cls' ) ) {
210
- $link->set_external();
211
- }
212
- }, 10 );`
213
-
214
- = Filter hook "wpel_apply_settings" =
215
-
216
- When filter returns false the plugin settings will not be applied. Can be used when f.e. certain posts or pages should be ignored by this plugin.
217
-
218
- `add_filter( 'wpel_apply_settings', '__return_false' );`
219
-
220
-
221
- See [FAQ](https://wordpress.org/plugins/wp-external-links/faq/) for more info.
222
-
223
-
224
- == Changelog ==
225
-
226
- = 2.1.0 =
227
- * Added tab with options for excluded links
228
- * Added `wpel-no-icon` class to set on links
229
- * Added action `wpel_before_apply_link`
230
- * Added option ignore mailto links
231
- * Fixed ignore links of admin bar
232
- * Fixed regexp for ignoring tags
233
- * Fixed text domain to text slug
234
- * Made filters `wpel_before_filter` and `wpel_after_filter` "private"
235
- * Removed DOMElement dependency
236
- * Removed rel="external" option for internal links
237
- * Removed filter `wpel_regexp_link` (this should not be changed)
238
-
239
- = 2.0.4 =
240
- * Fixed DOMElement breaks of text containing `&`
241
-
242
- = 2.0.3 =
243
- * Fixed bug ignoring links in <header> section
244
-
245
- = 2.0.2 =
246
- * Fixed bug parsing empty attributess
247
- * Changed mailto links wil be completely ignored
248
-
249
- = 2.0.1 =
250
- * Fixed mark mailto links as excluded
251
- * Fixed include / exclude url's
252
-
253
- = 2.0.0 =
254
- * REQUIREMENTS: PHP 5.3+
255
- * Complete rebuilt
256
- * Added `noopener` and `noreferrer`
257
- * Added font icons (font awesome and dashicons)
258
- * Added options for internal links
259
- * Added Network settings (WPMU support)
260
- * Contribution: David Page solving bug `home_url()`
261
-
262
- = 1.81 =
263
- * Security update (reported by Vulnerability Lab)
264
- * Some small changes
265
-
266
- = 1.80 =
267
- * Added filter hook wpel_external_link_attrs to change attributes before creating the link
268
- * Added filter hook wpel_ignored_external_links
269
- * Removed phpQuery option
270
- * Moved ignore selectors option
271
-
272
- = 1.70 =
273
- * Added option to ignore all subdomains
274
-
275
- = 1.62 =
276
- * Fixed php error when using phpQuery option
277
-
278
- = 1.61 =
279
- * Fixed deprecated split() function
280
- * Fixed deprecated $wp_version
281
-
282
- = 1.60 =
283
- * Added option to replace "follow" values of external links with "nofollow"
284
- * Updated FAQ with custom solutions
285
-
286
- = 1.56 =
287
- * Fixed bug jQuery as dependency for js scripts
288
- * Fixed bug "no-icon class in same window" working with javascript
289
- * Fixed bug setting defaults on installation
290
-
291
- = 1.55 =
292
- * Fixed bug JS error: Uncaught TypeError: undefined is not a function
293
- * Fixed bug PHP error for links without href attribute ("undefined index href")
294
- * Replaced deprecated jQuery .live() to .on() (contribution by Alonbilu)
295
-
296
- = 1.54 =
297
- * Fixed bug opening links containing html tags (like <b>)
298
-
299
- = 1.53 =
300
- * Fixed bug also opening ignored URL's on other tab/window when using javascript
301
- * Changed javascript open method (data-attribute)
302
-
303
- = 1.52 =
304
- * Added filter hook wpel_internal_link
305
- * Fixed use_js option bug
306
- * Fixed bug loading non-existing stylesheet
307
- * Minified javascripts
308
-
309
- = 1.51 =
310
- * Fixed also check url's starting with //
311
- * Fixed wpel_external_link also applied on ignored links
312
-
313
- = 1.50 =
314
- * Removed stylesheet file to save extra request
315
- * Added option for loading js file in wp_footer
316
- * Fixed bug with data-* attributes
317
- * Fixed bug url's with hash at the end
318
- * Fixed PHP errors
319
-
320
- = 1.41 =
321
- * Fixed Bug: wpmel_external_link filter hook was not working correctly
322
-
323
- = 1.40 =
324
- * Added action hook wpel_ready
325
- * Added filter hook wpel_external_link
326
- * Added output flush on wp_footer
327
- * Fixed Bug: spaces before url in href-attribute not recognized as external link
328
- * Fixed Bug: external links not processed (regexpr tag conflict starting with an a, like <aside> or <article>)
329
- * Cosmetic changes: added "Admin Settings", replaced help icon, restyled tooltip texts, removed "About this plugin" box
330
-
331
- = 1.31 =
332
- * Fixed passing arguments by reference using & (deprecated for PHP 5.4+)
333
- * Fixed options save failure by adding a non-ajax submit fallback
334
-
335
- = 1.30 =
336
- * Re-arranged options in metaboxes
337
- * Added option for no icons on images
338
-
339
- = 1.21 =
340
- * Fixed phpQuery bugs (class already exists and loading stylesheet)
341
- * Solved php notices
342
-
343
- = 1.20 =
344
- * Added option to ignore certain links or domains
345
- * Solved tweet button problem by adding link to new ignore option
346
- * Made JavaScript method consistent to not using JS
347
- * Solved PHP warnings
348
- * Solved bug adding own class
349
- * Changed bloginfo "url" to "wpurl"
350
-
351
- = 1.10 =
352
- * Resolved old parsing method (same as version 0.35)
353
- * Option to use phpQuery for parsing (for those who didn't experience problems with version 1.03)
354
-
355
- = 1.03 =
356
- * Workaround for echo DOCTYPE bug (caused by attributes in the head-tag)
357
-
358
- = 1.02 =
359
- * Solved the not working activation hook
360
-
361
- = 1.01 =
362
- * Solved bug after live testing
363
-
364
- = 1.00 =
365
- * Added option for setting title-attribute
366
- * Added option for excluding filtering certain external links
367
- * Added Admin help tooltips using jQuery Tipsy Plugin
368
- * Reorginized files and refactored code to PHP5 (no support for PHP4)
369
- * Added WP built-in meta box functionallity (using the `WP_Meta_Box_Page` Class)
370
- * Reorganized saving options and added Ajax save method (using the `WP_Option_Forms` Class)
371
- * Removed Regexp and using phpQuery
372
- * Choose menu position for this plugin (see "Screen Options")
373
- * Removed possibility to convert all `<a>` tags to xhtml clean code (so only external links will be converted)
374
- * Removed "Solve problem" options
375
-
376
- = 0.35 =
377
- * Widget Logic options bug
378
-
379
- = 0.34 =
380
- * Added option only converting external `<a>` tags to XHTML valid code
381
- * Changed script attribute `language` to `type`
382
- * Added support for widget_content filter of the Logic Widget plugin
383
-
384
- = 0.33 =
385
- * Added option to fix js problem
386
- * Fixed PHP / WP notices
387
-
388
- = 0.32 =
389
- * For jQuery uses live() function so also opens dynamicly created links in given target
390
- * Fixed bug of changing `<abbr>` tag
391
- * Small cosmetical adjustments
392
-
393
- = 0.31 =
394
- * Small cosmetical adjustments
395
-
396
- = 0.30 =
397
- * Improved Admin Options, f.e. target option looks more like the Blogroll target option
398
- * Added option for choosing which content should be filtered
399
-
400
- = 0.21 =
401
- * Solved bug removing icon stylesheet
402
-
403
- = 0.20 =
404
- * Put icon styles in external stylesheet
405
- * Can use "ext-icon-..." to show a specific icon on a link
406
- * Added option to set your own No-Icon class
407
- * Made "Class" optional, so it's not used for showing icons anymore
408
- * Added 3 more icons
409
-
410
- = 0.12 =
411
- * Options are organized more logical
412
- * Added some more icons
413
-
414
- = 0.11 =
415
- * JavaScript uses window.open() (tested in FireFox Opera, Safari, Chrome and IE6+)
416
- * Also possible to open all external links in the same new window
417
- * Some layout changes on the Admin Options Page
418
-
419
- = 0.10 =
420
- * Features: opening in a new window, set link icon, set "external", set "nofollow", set css-class
421
- * Replaces external links by clean XHTML <a> tags
422
- * Internalization implemented (no language files yet)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP External Links (nofollow new tab seo) ===
2
+ Contributors: freelancephp
3
+ Tags: links, new window, new tab, external links, nofollow, follow, seo, noopener, noreferrer, internal links, link icon, link target, _blank, wpmu
4
+ Requires at least: 4.2.0
5
+ Tested up to: 4.7.3
6
+ Stable tag: 2.1.1
7
+
8
+ Open external links in a new tab / window, add "nofollow", "noopener" and font icons, SEO and more. Also for internal links.
9
+
10
+
11
+ == Description ==
12
+
13
+ Configure settings for all internal and external links on your site.
14
+
15
+ > <strong>=== NEW: Version 2 ===</strong><br>
16
+ > WPEL plugin was completely rebuilt and has lots of new features, like "noopener", font icons, internal links options and WPMU settings.
17
+
18
+ = Features =
19
+ * Open links in new window or tab
20
+ * Add "follow" or "nofollow"
21
+ * Add "noopener" and "noreferrer" (for security)
22
+ * Add link icons (font icons: font awesome, dashicons)
23
+ * Set other attributes like title and CSS classes
24
+ * Scan posts, comments, widgets or the whole page
25
+ * Better SEO
26
+
27
+ = And more... =
28
+ * Network Settings (WPMU support)
29
+ * Use template tag to apply plugin settings on specific contents
30
+ * Set data-attribute to change how individual links will be treated
31
+ * Use action and filters to implement your specific needs
32
+
33
+ = Easy to use =
34
+ After activating you can set all options for external and internal links on the plugins admin page.
35
+
36
+ = On the fly =
37
+ The plugin filters the output and changes the links on the fly. The real contents (posts, pages, widget etcetera) will not be changed in the database.
38
+ When deactivating the plugin, all contents will be the same as it was before.
39
+
40
+ = Requirements =
41
+ * PHP version 5.3 or up
42
+ * WordPress version 4.2 or up
43
+
44
+ If you want support for older versions of PHP or WordPress then download and install [version 1.81](https://downloads.wordpress.org/plugin/wp-external-links.1.81.zip) of this plugin.
45
+
46
+ = Sources =
47
+ * [Documentation](http://wordpress.org/extend/plugins/wp-external-links/other_notes/)
48
+ * [FAQ](http://wordpress.org/extend/plugins/wp-external-links/faq/)
49
+ * [Github](https://github.com/freelancephp/WP-External-Links)
50
+
51
+ > <strong>Like this plugin?</strong><br>
52
+ > [Rate it](http://wordpress.org/support/view/plugin-reviews/wp-external-links) to support the development of this plugin.
53
+
54
+
55
+ == Installation ==
56
+
57
+ 1. Go to **Plugins** in the Admin menu
58
+ 1. Click on the button **Add new**
59
+ 1. Search for **WP External Links** and click **Install Now**
60
+ 1. Click on the **Activate plugin** link
61
+
62
+ = Install Older Version =
63
+
64
+ When you have an older version of WordPress (version 4.1 or less) or PHP (version 5.2.x) you can only use an older
65
+ version of this plugin.
66
+
67
+ 1. [Download version 1.81](https://plugins.svn.wordpress.org/wp-external-links/tags/1.81)
68
+ 1. Go to **Plugins** in admin
69
+ 1. Click **New Plugin**
70
+ 1. Click **Upload Plugin**
71
+ 1. Choose the downloaded file and click **Install Now**
72
+ 1. Click on the **Activate plugin** link
73
+
74
+
75
+ == Frequently Asked Questions ==
76
+
77
+ = I want certain posts or pages to be ignored by the plugin. How? =
78
+
79
+ By using the `wpel_apply_settings` filter you can stop the plugin from processing that page, f.e.:
80
+
81
+ `add_action( 'wpel_apply_settings', function () {
82
+ global $post;
83
+ $ignored_post_ids = array( 1, 2, 4 );
84
+
85
+ if ( in_array( $post->ID, $ignored_post_ids ) ) {
86
+ return false;
87
+ }
88
+
89
+ return true;
90
+ }, 10 );`
91
+
92
+ Using this filter you can ignore any request, like certain category, archive etcetera.
93
+
94
+ = I want specific links to be ignored by the plugin. How? =
95
+
96
+ By using the `wpel_before_apply_link` filter you can skip specific links from being processed by WPEL plugin, f.e.:
97
+
98
+ `add_action( 'wpel_before_apply_link', function ( $link ) {
99
+ // ignore links with class "some-cls"
100
+ if ( $link->has_attr_value( 'class', 'some-cls' ) ) {
101
+ $link->set_ignore();
102
+ }
103
+ }, 10 );`
104
+
105
+
106
+ = How to create a redirect for external links? (f.e. affiliate links) =
107
+
108
+ Create redirect by using the `wpel_link` action. Add some code to functions.php of your theme, like:
109
+
110
+ `add_action( 'wpel_link', function ( $link ) {
111
+ // check if link is an external links
112
+ if ( $link->is_external() ) {
113
+ // get current url
114
+ $url = $link->get_attr( 'href' );
115
+
116
+ // set redirect url
117
+ $redirect_url = '//somedom.com?url='. urlencode( $url );
118
+ $link->set_attr( 'href', $redirect_url );
119
+ }
120
+ }, 10, 1 );`
121
+
122
+ = How to open external links in a new popup window? =
123
+
124
+ By adding this JavaScript code to your site:
125
+
126
+ `jQuery(function ($) {
127
+
128
+ $('a[data-wpel-link="external"]').click(function (e) {
129
+ // open link in popup window
130
+ window.open($(this).attr('href'), '_blank', 'width=800, height=600');
131
+
132
+ // stop default and other behaviour
133
+ e.preventDefault();
134
+ e.stopImmediatePropagation();
135
+ });
136
+
137
+ });`
138
+
139
+ See more information on the [window.open() method](http://www.w3schools.com/jsref/met_win_open.asp).
140
+
141
+ = How to add an confirm (or alert) when opening external links? =
142
+
143
+ Add this JavaScript code to your site:
144
+
145
+ `jQuery(function ($) {
146
+
147
+ $('a[data-wpel-link="external"]').click(function (e) {
148
+ if (!confirm('Are you sure you want to open this link?')) {
149
+ // cancelled
150
+ e.preventDefault();
151
+ e.stopImmediatePropagation();
152
+ }
153
+ });
154
+
155
+ });`
156
+
157
+ = I am a plugin developer and my plugin conflicts with WPEL. How can I solve the problem? =
158
+
159
+ If your plugin contains links it might be filtered by the WPEL plugin as well, causing a conflict.
160
+ Here are some suggestions on solving the problem:
161
+
162
+ 1. Add `data-wpel-link="ignore"` to links that need to be ignored by WPEL plugin
163
+ 1. Use `wpel_before_apply_link`-action to ignore your links (f.e. containing certain class or data-attribute)
164
+ 1. Use `wpel_apply_settings`-filter to ignore complete post, pages, categories etc
165
+
166
+
167
+ [Do you have a question? Please ask me](http://www.finewebdev.comcontact/)
168
+
169
+
170
+ == Screenshots ==
171
+
172
+ 1. Link Icons
173
+ 1. Admin Settings Page
174
+ 1. WPMU Network Settings Page
175
+
176
+
177
+ == Documentation ==
178
+
179
+ After activating you can set all options for external and internal links.
180
+
181
+ = Data attribute "data-wpel-link" =
182
+
183
+ Links being processed by this plugin will also contain the data-attribute `data-wpel-link`.
184
+ The plugin could set the value to `external`, `internal` or `exclude`, meaning how the
185
+ link was processed.
186
+
187
+ You can also set the data-attribute yourself. This way you can force how the plugin will process
188
+ certain links.
189
+
190
+ When you add the value `ignore`, the link will be completely ignored by the plugin:
191
+
192
+ `<a href="http://somedomain.com" data-wpel-link="ignore">Go to somedomain</a>`
193
+
194
+
195
+ = Action "wpel_link" =
196
+
197
+ Use this action to change the link object after all plugin settings have been applied.
198
+
199
+ `add_action( 'wpel_link', ( $link_object ) {
200
+ if ( $link_object->is_external() ) {
201
+ // get current url
202
+ $url = $link_object->getAttribute( 'href' );
203
+
204
+ // set redirect url
205
+ $redirect_url = '//somedom.com?url='. urlencode( $url );
206
+ $link_object->setAttribute( 'href', $redirect_url );
207
+ }
208
+ }, 10, 1 );`
209
+
210
+ The link object is an instance of `WPEL_Link` class.
211
+
212
+ = Action hook "wpel_before_apply_link" =
213
+
214
+ Use this action to change the link object before the plugin settings will be applied on the link.
215
+ You can use this filter f.e. to ignore individual links from being processed. Or change dynamically how
216
+ they will be treated by this plugin.
217
+
218
+ `add_action( 'wpel_before_apply_link', function ( $link ) {
219
+ // ignore links with class "some-cls"
220
+ if ( $link->has_attr_value( 'class', 'some-cls' ) ) {
221
+ $link->set_ignore();
222
+ }
223
+
224
+ // mark and treat links with class "ext-cls" as external link
225
+ if ( $link->has_attr_value( 'class', 'ext-cls' ) ) {
226
+ $link->set_external();
227
+ }
228
+ }, 10 );`
229
+
230
+ = Filter hook "wpel_apply_settings" =
231
+
232
+ When filter returns false the plugin settings will not be applied. Can be used when f.e. certain posts or pages should be ignored by this plugin.
233
+
234
+ `add_filter( 'wpel_apply_settings', '__return_false' );`
235
+
236
+
237
+ See [FAQ](https://wordpress.org/plugins/wp-external-links/faq/) for more info.
238
+
239
+
240
+ == Changelog ==
241
+
242
+ = 2.1.1 =
243
+ * Fixed updating old plugin values
244
+ * Fixed links containing rel="external" will also be treated as external
245
+ * Fixed prevent caching old styles and scripts
246
+
247
+ = 2.1.0 =
248
+ * Added tab with options for excluded links
249
+ * Added `wpel-no-icon` class to set on links
250
+ * Added action `wpel_before_apply_link`
251
+ * Added option ignore mailto links
252
+ * Fixed ignore links of admin bar
253
+ * Fixed regexp for ignoring tags
254
+ * Fixed text domain to text slug
255
+ * Made filters `wpel_before_filter` and `wpel_after_filter` "private"
256
+ * Removed DOMElement dependency
257
+ * Removed rel="external" option for internal links
258
+ * Removed filter `wpel_regexp_link` (this should not be changed)
259
+
260
+ = 2.0.4 =
261
+ * Fixed DOMElement breaks of text containing `&`
262
+
263
+ = 2.0.3 =
264
+ * Fixed bug ignoring links in <header> section
265
+
266
+ = 2.0.2 =
267
+ * Fixed bug parsing empty attributess
268
+ * Changed mailto links wil be completely ignored
269
+
270
+ = 2.0.1 =
271
+ * Fixed mark mailto links as excluded
272
+ * Fixed include / exclude url's
273
+
274
+ = 2.0.0 =
275
+ * REQUIREMENTS: PHP 5.3+
276
+ * Complete rebuilt
277
+ * Added `noopener` and `noreferrer`
278
+ * Added font icons (font awesome and dashicons)
279
+ * Added options for internal links
280
+ * Added Network settings (WPMU support)
281
+ * Contribution: David Page solving bug `home_url()`
282
+
283
+ = 1.81 =
284
+ * Security update (reported by Vulnerability Lab)
285
+ * Some small changes
286
+
287
+ = 1.80 =
288
+ * Added filter hook wpel_external_link_attrs to change attributes before creating the link
289
+ * Added filter hook wpel_ignored_external_links
290
+ * Removed phpQuery option
291
+ * Moved ignore selectors option
292
+
293
+ = 1.70 =
294
+ * Added option to ignore all subdomains
295
+
296
+ = 1.62 =
297
+ * Fixed php error when using phpQuery option
298
+
299
+ = 1.61 =
300
+ * Fixed deprecated split() function
301
+ * Fixed deprecated $wp_version
302
+
303
+ = 1.60 =
304
+ * Added option to replace "follow" values of external links with "nofollow"
305
+ * Updated FAQ with custom solutions
306
+
307
+ = 1.56 =
308
+ * Fixed bug jQuery as dependency for js scripts
309
+ * Fixed bug "no-icon class in same window" working with javascript
310
+ * Fixed bug setting defaults on installation
311
+
312
+ = 1.55 =
313
+ * Fixed bug JS error: Uncaught TypeError: undefined is not a function
314
+ * Fixed bug PHP error for links without href attribute ("undefined index href")
315
+ * Replaced deprecated jQuery .live() to .on() (contribution by Alonbilu)
316
+
317
+ = 1.54 =
318
+ * Fixed bug opening links containing html tags (like <b>)
319
+
320
+ = 1.53 =
321
+ * Fixed bug also opening ignored URL's on other tab/window when using javascript
322
+ * Changed javascript open method (data-attribute)
323
+
324
+ = 1.52 =
325
+ * Added filter hook wpel_internal_link
326
+ * Fixed use_js option bug
327
+ * Fixed bug loading non-existing stylesheet
328
+ * Minified javascripts
329
+
330
+ = 1.51 =
331
+ * Fixed also check url's starting with //
332
+ * Fixed wpel_external_link also applied on ignored links
333
+
334
+ = 1.50 =
335
+ * Removed stylesheet file to save extra request
336
+ * Added option for loading js file in wp_footer
337
+ * Fixed bug with data-* attributes
338
+ * Fixed bug url's with hash at the end
339
+ * Fixed PHP errors
340
+
341
+ = 1.41 =
342
+ * Fixed Bug: wpmel_external_link filter hook was not working correctly
343
+
344
+ = 1.40 =
345
+ * Added action hook wpel_ready
346
+ * Added filter hook wpel_external_link
347
+ * Added output flush on wp_footer
348
+ * Fixed Bug: spaces before url in href-attribute not recognized as external link
349
+ * Fixed Bug: external links not processed (regexpr tag conflict starting with an a, like <aside> or <article>)
350
+ * Cosmetic changes: added "Admin Settings", replaced help icon, restyled tooltip texts, removed "About this plugin" box
351
+
352
+ = 1.31 =
353
+ * Fixed passing arguments by reference using & (deprecated for PHP 5.4+)
354
+ * Fixed options save failure by adding a non-ajax submit fallback
355
+
356
+ = 1.30 =
357
+ * Re-arranged options in metaboxes
358
+ * Added option for no icons on images
359
+
360
+ = 1.21 =
361
+ * Fixed phpQuery bugs (class already exists and loading stylesheet)
362
+ * Solved php notices
363
+
364
+ = 1.20 =
365
+ * Added option to ignore certain links or domains
366
+ * Solved tweet button problem by adding link to new ignore option
367
+ * Made JavaScript method consistent to not using JS
368
+ * Solved PHP warnings
369
+ * Solved bug adding own class
370
+ * Changed bloginfo "url" to "wpurl"
371
+
372
+ = 1.10 =
373
+ * Resolved old parsing method (same as version 0.35)
374
+ * Option to use phpQuery for parsing (for those who didn't experience problems with version 1.03)
375
+
376
+ = 1.03 =
377
+ * Workaround for echo DOCTYPE bug (caused by attributes in the head-tag)
378
+
379
+ = 1.02 =
380
+ * Solved the not working activation hook
381
+
382
+ = 1.01 =
383
+ * Solved bug after live testing
384
+
385
+ = 1.00 =
386
+ * Added option for setting title-attribute
387
+ * Added option for excluding filtering certain external links
388
+ * Added Admin help tooltips using jQuery Tipsy Plugin
389
+ * Reorginized files and refactored code to PHP5 (no support for PHP4)
390
+ * Added WP built-in meta box functionallity (using the `WP_Meta_Box_Page` Class)
391
+ * Reorganized saving options and added Ajax save method (using the `WP_Option_Forms` Class)
392
+ * Removed Regexp and using phpQuery
393
+ * Choose menu position for this plugin (see "Screen Options")
394
+ * Removed possibility to convert all `<a>` tags to xhtml clean code (so only external links will be converted)
395
+ * Removed "Solve problem" options
396
+
397
+ = 0.35 =
398
+ * Widget Logic options bug
399
+
400
+ = 0.34 =
401
+ * Added option only converting external `<a>` tags to XHTML valid code
402
+ * Changed script attribute `language` to `type`
403
+ * Added support for widget_content filter of the Logic Widget plugin
404
+
405
+ = 0.33 =
406
+ * Added option to fix js problem
407
+ * Fixed PHP / WP notices
408
+
409
+ = 0.32 =
410
+ * For jQuery uses live() function so also opens dynamicly created links in given target
411
+ * Fixed bug of changing `<abbr>` tag
412
+ * Small cosmetical adjustments
413
+
414
+ = 0.31 =
415
+ * Small cosmetical adjustments
416
+
417
+ = 0.30 =
418
+ * Improved Admin Options, f.e. target option looks more like the Blogroll target option
419
+ * Added option for choosing which content should be filtered
420
+
421
+ = 0.21 =
422
+ * Solved bug removing icon stylesheet
423
+
424
+ = 0.20 =
425
+ * Put icon styles in external stylesheet
426
+ * Can use "ext-icon-..." to show a specific icon on a link
427
+ * Added option to set your own No-Icon class
428
+ * Made "Class" optional, so it's not used for showing icons anymore
429
+ * Added 3 more icons
430
+
431
+ = 0.12 =
432
+ * Options are organized more logical
433
+ * Added some more icons
434
+
435
+ = 0.11 =
436
+ * JavaScript uses window.open() (tested in FireFox Opera, Safari, Chrome and IE6+)
437
+ * Also possible to open all external links in the same new window
438
+ * Some layout changes on the Admin Options Page
439
+
440
+ = 0.10 =
441
+ * Features: opening in a new window, set link icon, set "external", set "nofollow", set css-class
442
+ * Replaces external links by clean XHTML <a> tags
443
+ * Internalization implemented (no language files yet)
screenshot-2.png CHANGED
Binary file
templates/network-page/help-tabs/under-construction.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/network-page/main.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/network-page/tab-contents/network-admin-settings.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/network-page/tab-contents/network-settings.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/partials/nav-tabs.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/partials/tab-contents/fields-default.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/partials/tab-contents/support.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/requirements-notice.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/settings-page/help-tabs/data-attributes.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/settings-page/help-tabs/under-construction.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/settings-page/main.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/settings-page/tab-contents/admin.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/settings-page/tab-contents/exceptions.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/settings-page/tab-contents/excluded-links.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/settings-page/tab-contents/external-links.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
templates/settings-page/tab-contents/internal-links.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link http://www.finewebdev.com
10
  * @link https://github.com/freelancephp/WP-External-Links
wp-external-links.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
- * @version 2.1.0
8
  * @author Victor Villaverde Laan
9
  * @link https://wordpress.org/plugins/wp-external-links/
10
  * @link https://github.com/freelancephp/WP-External-Links
@@ -12,7 +12,7 @@
12
  *
13
  * @wordpress-plugin
14
  * Plugin Name: WP External Links
15
- * Version: 2.1.0
16
  * Plugin URI: https://wordpress.org/plugins/wp-external-links/
17
  * Description: Open external links in a new tab or window, adding "nofollow" and "noopener", set font icon, SEO friendly options and more.
18
  * Author: Victor Villaverde Laan
@@ -37,7 +37,8 @@ if ( ! function_exists( 'wpel_init' ) ):
37
  if ( ! function_exists( 'wpel_requirements_notice' ) ) {
38
  function wpel_requirements_notice()
39
  {
40
- include __DIR__ .'/templates/requirements-notice.php';
 
41
  }
42
 
43
  add_action( 'admin_notices', 'wpel_requirements_notice' );
4
  *
5
  * @package WPEL
6
  * @category WordPress Plugin
7
+ * @version 2.1.1
8
  * @author Victor Villaverde Laan
9
  * @link https://wordpress.org/plugins/wp-external-links/
10
  * @link https://github.com/freelancephp/WP-External-Links
12
  *
13
  * @wordpress-plugin
14
  * Plugin Name: WP External Links
15
+ * Version: 2.1.1
16
  * Plugin URI: https://wordpress.org/plugins/wp-external-links/
17
  * Description: Open external links in a new tab or window, adding "nofollow" and "noopener", set font icon, SEO friendly options and more.
18
  * Author: Victor Villaverde Laan
37
  if ( ! function_exists( 'wpel_requirements_notice' ) ) {
38
  function wpel_requirements_notice()
39
  {
40
+ // php 5.2 doesn't yet support __DIR__
41
+ include dirname( __FILE__ ) .'/templates/requirements-notice.php';
42
  }
43
 
44
  add_action( 'admin_notices', 'wpel_requirements_notice' );