@shaunroseltgmailcom
Hi Shaun,
First of all
42 | WARNING | INI directive ‘safe_mode’ is deprecated since PHP 5.3 and removed since PHP 5.4
is a false positive, you may ignore. For the others see below.
This plugin has been very useful for me and have found no other plugin that will do the same job. I have been fixing the deprecated code for the past couple of years in order to use the latest PHP version on the server, without being flooded with notices, warnings and errors. I use version 1.11.5 because that is the version that I have been fixing. I know that version 1.11.8 will throw errors that I had already corrected in version 1.11.5 and don’t have time to find out what was changed by the plugin support since that version.
FILE: /broken-link-checker/modules/extras/plaintext-url-parser-base.php
Comment out Line 82 and add new line. If you have problems reverse the process.
// if ( !filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED) ){ DEPRECATED SINCE php 7.3 Delete ", FILTER_FLAG_HOST_REQUIRED" from line 82
if ( !filter_var($url, FILTER_VALIDATE_URL) ){
The following is a copy of my posting 4 months and 2 weeks ago:
It would appear that someone had access to the repository that does not understand the issues. I had posted about the PHP 7.2 warnings almost a year ago and fixed them myself when there was no response from support. The plugin has since been working well on several sites. I cannot be responsible for any problems, but you may wish to try the changes I have been using.
FILE: /wp-content/plugins/broken-link-checker/core/core.php
FOUND 1 WARNING AFFECTING LINE 957 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead
comment out line 957 with // as below and add the new code. If you have problems reverse the process.
// uasort($modules['container'], create_function('$a, $b', 'return strcasecmp($a["Name"], $b["Name"]);')); // Change to anonymous function in line 958 to avoid deprecated 'create_function' in PHP 7.2
uasort($modules['container'], function($a, $b) { return strcasecmp($a["Name"], $b["Name"]); });
FILE: /wp-content/plugins/broken-link-checker/modules/checkers/http.php
FOUND 1 WARNING AFFECTING LINE 147 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead
comment out line 147 with // as below and add the new code. If you have problems reverse the process.
// create_function('$str','return rawurlencode($str[0]);'), Change to anonymous function in line 148 to avoid deprecated 'create_function' in PHP 7.2
function ($str) { return rawurlencode($str[0]);