Skip to content

Commit f8bdc5c

Browse files
committed
v 0.123.3
Diagnostic : - Better RSS error detection. - Fixed « view » mode.
1 parent a32edf1 commit f8bdc5c

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

tools/diagnostic/header.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
echo "No errors !";
3232
} else {
3333
foreach ($wputools_errors as $error) {
34-
echo "\033[31m- " . $error . "\033[0m\n"; // Red color for errors
34+
echo($wputools_is_cli ? ("\033[31m- " . $error . "\033[0m") : $error) . "\n"; // Red color for errors
3535
}
3636
foreach ($wputools_notices as $notice) {
37-
echo "\033[33m- " . $notice . "\033[0m\n"; // Yellow color for notices
37+
echo($wputools_is_cli ? ("\033[33m- " . $notice . "\033[0m") : $notice) . "\n"; // Yellow color for notices
3838
}
3939
}
4040
if (!$wputools_is_public) {

tools/diagnostic/inc/40-wordpress.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ function wputools_diagnostic_check_domain_is_preproduction($domainName) {
491491

492492
function wputools_test_rss_feed($rss_url) {
493493
global $wputools_errors;
494+
global $wputools_notices;
494495

495496
libxml_use_internal_errors(true);
496497

@@ -499,7 +500,16 @@ function wputools_test_rss_feed($rss_url) {
499500
return;
500501
}
501502

502-
$rss_content = @simplexml_load_file($rss_url);
503+
$rss_content_text = file_get_contents($rss_url);
504+
$rss_content = @simplexml_load_string($rss_content_text);
505+
if ($rss_content === false) {
506+
$rss_content_text = html_entity_decode($rss_content_text);
507+
$rss_content = @simplexml_load_string($rss_content_text);
508+
if ($rss_content) {
509+
$wputools_notices[] = __('The RSS Feed was parsed, but had an encoding problem.');
510+
}
511+
}
512+
503513
if ($rss_content === false) {
504514
$error_text = '';
505515
foreach (libxml_get_errors() as $error) {

wputools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
WPUTools(){
44

5-
local _WPUTOOLS_VERSION='0.123.2';
5+
local _WPUTOOLS_VERSION='0.123.3';
66
local _PHP_VERSIONS=(7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 9.0)
77
local _PHP_VERSIONS_OBSOLETES=(7.0 7.1 7.2 7.3 7.4 8.0)
88
local _PHP_VERSIONS_ADVANCED=(8.3 8.4 8.5 9.0)

0 commit comments

Comments
 (0)