WP Broken Link Status Checker - Version 1.0.6

Version Description

March 16th, 2019

  • Show a message in activation if any other WP Link Status version is active
  • Changed the way a constant is checked to avoid old PHP versions issues
  • Fixed bug filtering elements attributes on extracting content data
  • More info about debug behavior in the constants.php file
Download this release

Release Info

Developer seedplugins
Plugin Icon 128x128 WP Broken Link Status Checker
Version 1.0.6
Comparing to
See all releases

Code changes from version 1.0.5 to 1.0.6

Files changed (6) hide show
  1. constants.php +10 -8
  2. core/boot.php +12 -1
  3. core/crawler.php +1 -0
  4. core/debug.php +1 -1
  5. readme.txt +11 -3
  6. wp-link-status.php +38 -21
constants.php CHANGED
@@ -3,17 +3,19 @@
3
 
4
 
5
  /**
6
- * Debug control constant (uncomment to activate)
7
  */
8
- /*if (!defined('WPLNST_DEBUG')) {
9
- define('WPLNST_DEBUG', true);
10
- }*/
11
 
12
 
13
 
14
  /**
15
- * Debug trace control constant (uncomment to activate)
 
 
16
  */
17
- /*if (!defined('WPLNST_DEBUG_OUTPUT')) {
18
- define('WPLNST_DEBUG_OUTPUT', 'trace');
19
- }*/
3
 
4
 
5
  /**
6
+ * Debug control constant (remove "//" comments to activate)
7
  */
8
+ //if (!defined('WPLNST_DEBUG')) {
9
+ // define('WPLNST_DEBUG', true);
10
+ //}
11
 
12
 
13
 
14
  /**
15
+ * Debug trace control constant (remove "//" comments to activate)
16
+ * This constant depends on the constant WPLNST_DEBUG being defined with true value
17
+ * The `trace` mode generates the debug file wp-content/wplnst_trace.txt
18
  */
19
+ //if (!defined('WPLNST_DEBUG_OUTPUT')) {
20
+ // define('WPLNST_DEBUG_OUTPUT', 'trace');
21
+ //}
core/boot.php CHANGED
@@ -10,8 +10,19 @@
10
  // Check class or constants conflict relative to other active plugins
11
  if (class_exists('WPLNST_Core_Alive') || defined('WPLNST_VERSION') || defined('WPLNST_FILE') || defined('WPLNST_PATH')) {
12
 
 
 
 
 
 
 
 
 
 
 
 
13
  // No execution allowed
14
- trigger_error(__('Detected another version of WP Link Status already active. Please deactivate it before and try again to activate this plugin.', 'wplnst'), E_USER_ERROR);
15
 
16
  // Check WP version via checking version expected function, because $wp_version may have been overwritten
17
  } elseif (function_exists('add_action') && !function_exists('is_main_query')) {
10
  // Check class or constants conflict relative to other active plugins
11
  if (class_exists('WPLNST_Core_Alive') || defined('WPLNST_VERSION') || defined('WPLNST_FILE') || defined('WPLNST_PATH')) {
12
 
13
+ // Prepare message
14
+ $wplnst_message = '<h1>Multiple Versions Detected</h1>
15
+ <p>This plugin cannot be activated because there is a previous version activated.</p>
16
+ <p>Please <strong>deactivate any other WP Link Status plugin</strong> in order to activate this version.</p>
17
+ <p>Sorry for the inconvenience.</p>';
18
+
19
+ // Check go back link
20
+ if (function_exists('admin_url')) {
21
+ $wplnst_message .= "\n".'<p><a href="'.esc_url(admin_url('plugins.php')).'">&larr; Go back</a></p>';
22
+ }
23
+
24
  // No execution allowed
25
+ wp_die($wplnst_message);
26
 
27
  // Check WP version via checking version expected function, because $wp_version may have been overwritten
28
  } elseif (function_exists('add_action') && !function_exists('is_main_query')) {
core/crawler.php CHANGED
@@ -1934,6 +1934,7 @@ class WPLNST_Core_Crawler extends WPLNST_Core_Module {
1934
 
1935
  // Isolate attributes
1936
  $att_names = array_keys($attributes);
 
1937
 
1938
  // Enum filters
1939
  foreach ($this->scan->html_attributes as $filter) {
1934
 
1935
  // Isolate attributes
1936
  $att_names = array_keys($attributes);
1937
+ $att_values = array_values($attributes);
1938
 
1939
  // Enum filters
1940
  foreach ($this->scan->html_attributes as $filter) {
core/debug.php CHANGED
@@ -18,7 +18,7 @@ require_once dirname(dirname(__FILE__)).'/constants.php';
18
  * Check debug flag
19
  */
20
  function wplnst_is_debug() {
21
- return (defined('WPLNST_DEBUG') && !empty(WPLNST_DEBUG));
22
  }
23
 
24
 
18
  * Check debug flag
19
  */
20
  function wplnst_is_debug() {
21
+ return defined('WPLNST_DEBUG') && WPLNST_DEBUG;
22
  }
23
 
24
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: seedplugins, pauiglesias
3
  Tested up to: 5.1
4
  Requires PHP: 5.6
5
  Requires at least: 3.4
6
- Stable tag: 1.0.5
7
  License: GPLv2 or later
8
  Tags: broken links, broken, links, crawler, headers, http, nofollow, redirections, scan, status, checker, url
9
 
@@ -53,11 +53,11 @@ The crawler results page shows all links checked according to the scan configura
53
  >
54
  > **Pro version** provides extended search filters and the possibility to edit the post content links directly from the search results without using the WP editor, including bulk actions mode for most operations:
55
  >
56
- > http://seedplugins.com/wp-link-status/
57
  >
58
  > You can read a detailed **user guide documentation** from the plugin page that describes also the Pro version features:
59
  >
60
- > http://seedplugins.com/wp-link-status/user-guide-wpls/
61
 
62
  == Installation ==
63
 
@@ -114,6 +114,14 @@ You can add the custom field name in the "Content options" tab of the scan, sele
114
 
115
  == Changelog ==
116
 
 
 
 
 
 
 
 
 
117
  = 1.0.5 =
118
  March 7th, 2019
119
 
3
  Tested up to: 5.1
4
  Requires PHP: 5.6
5
  Requires at least: 3.4
6
+ Stable tag: 1.0.6
7
  License: GPLv2 or later
8
  Tags: broken links, broken, links, crawler, headers, http, nofollow, redirections, scan, status, checker, url
9
 
53
  >
54
  > **Pro version** provides extended search filters and the possibility to edit the post content links directly from the search results without using the WP editor, including bulk actions mode for most operations:
55
  >
56
+ > https://seedplugins.com/wp-link-status/
57
  >
58
  > You can read a detailed **user guide documentation** from the plugin page that describes also the Pro version features:
59
  >
60
+ > https://seedplugins.com/wp-link-status/user-guide-wpls/
61
 
62
  == Installation ==
63
 
114
 
115
  == Changelog ==
116
 
117
+ = 1.0.6 =
118
+ March 16th, 2019
119
+
120
+ * Show a message in activation if any other WP Link Status version is active
121
+ * Changed the way a constant is checked to avoid old PHP versions issues
122
+ * Fixed bug filtering elements attributes on extracting content data
123
+ * More info about debug behavior in the constants.php file
124
+
125
  = 1.0.5 =
126
  March 7th, 2019
127
 
wp-link-status.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Broken Link Status Checker
4
- Plugin URI: http://seedplugins.com/wp-link-status/
5
  Description: Check and manage HTTP response codes of all your content site links and images.
6
- Version: 1.0.5
7
  Author: Pau Iglesias, SeedPlugins
8
  License: GPLv2 or later
9
  Text Domain: wplnst
@@ -21,7 +21,7 @@ require dirname(__FILE__).'/core/boot.php';
21
  // This plugin constants
22
  define('WPLNST_FILE', __FILE__);
23
  define('WPLNST_PATH', dirname(WPLNST_FILE));
24
- define('WPLNST_VERSION', '1.0.5');
25
 
26
  // Check scan crawling action
27
  require_once WPLNST_PATH.'/core/alive.php';
@@ -33,31 +33,48 @@ if (is_admin()) {
33
  WPLNST_Admin::instantiate();
34
  }
35
 
36
- // Plugin activation
 
 
37
  register_activation_hook(WPLNST_FILE, 'wplnst_plugin_activation');
38
- function wplnst_plugin_activation($networkwide = false) {
39
 
40
- // Prevent network-wide activation
41
- if (is_multisite() && $networkwide) {
42
- deactivate_plugins(plugin_basename(WPLNST_FILE));
43
- wp_die('<p><strong>WP Link Status</strong> cannot be activated network-wide.</p><p>Please activate it invididually per each site where you need it.</p><p>Sorry for the inconvenience.</p>');
44
- }
 
 
 
 
45
 
46
- // Continues activation
47
- wplnst_require('core', 'register');
48
- WPLNST_Core_Register::activation();
 
49
  }
50
 
51
- // Plugin deactivation
 
 
52
  register_deactivation_hook(WPLNST_FILE, 'wplnst_plugin_deactivation');
53
- function wplnst_plugin_deactivation() {
54
- wplnst_require('core', 'register');
55
- WPLNST_Core_Register::deactivation();
 
 
 
56
  }
57
 
58
- // Plugin uninstall
 
 
59
  register_uninstall_hook(WPLNST_FILE, 'wplnst_plugin_uninstall');
60
- function wplnst_plugin_uninstall() {
61
- wplnst_require('core', 'register');
62
- WPLNST_Core_Register::uninstall();
 
 
 
63
  }
1
  <?php
2
  /*
3
  Plugin Name: WP Broken Link Status Checker
4
+ Plugin URI: https://seedplugins.com/wp-link-status/
5
  Description: Check and manage HTTP response codes of all your content site links and images.
6
+ Version: 1.0.6
7
  Author: Pau Iglesias, SeedPlugins
8
  License: GPLv2 or later
9
  Text Domain: wplnst
21
  // This plugin constants
22
  define('WPLNST_FILE', __FILE__);
23
  define('WPLNST_PATH', dirname(WPLNST_FILE));
24
+ define('WPLNST_VERSION', '1.0.6');
25
 
26
  // Check scan crawling action
27
  require_once WPLNST_PATH.'/core/alive.php';
33
  WPLNST_Admin::instantiate();
34
  }
35
 
36
+ /**
37
+ * Plugin activation hook
38
+ */
39
  register_activation_hook(WPLNST_FILE, 'wplnst_plugin_activation');
40
+ if (!function_exists('wplnst_plugin_activation')) {
41
 
42
+ function wplnst_plugin_activation($networkwide = false) {
43
+
44
+ // Prevent network-wide activation
45
+ if (is_multisite() && $networkwide) {
46
+ deactivate_plugins(plugin_basename(WPLNST_FILE));
47
+ wp_die('<p><strong>WP Link Status</strong> cannot be activated network-wide.</p>
48
+ <p>Please activate it invididually per each site where you need it.</p>
49
+ <p>Sorry for the inconvenience.</p>');
50
+ }
51
 
52
+ // Continues activation
53
+ wplnst_require('core', 'register');
54
+ WPLNST_Core_Register::activation();
55
+ }
56
  }
57
 
58
+ /**
59
+ * Plugin deactivation hook
60
+ */
61
  register_deactivation_hook(WPLNST_FILE, 'wplnst_plugin_deactivation');
62
+ if (!function_exists('wplnst_plugin_deactivation')) {
63
+
64
+ function wplnst_plugin_deactivation() {
65
+ wplnst_require('core', 'register');
66
+ WPLNST_Core_Register::deactivation();
67
+ }
68
  }
69
 
70
+ /**
71
+ * Plugin uninstall hook
72
+ */
73
  register_uninstall_hook(WPLNST_FILE, 'wplnst_plugin_uninstall');
74
+ if (!function_exists('wplnst_plugin_uninstall')) {
75
+
76
+ function wplnst_plugin_uninstall() {
77
+ wplnst_require('core', 'register');
78
+ WPLNST_Core_Register::uninstall();
79
+ }
80
  }