File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 31
31
echo "No errors ! " ;
32
32
} else {
33
33
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
35
35
}
36
36
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
38
38
}
39
39
}
40
40
if (!$ wputools_is_public ) {
Original file line number Diff line number Diff line change @@ -491,6 +491,7 @@ function wputools_diagnostic_check_domain_is_preproduction($domainName) {
491
491
492
492
function wputools_test_rss_feed ($ rss_url ) {
493
493
global $ wputools_errors ;
494
+ global $ wputools_notices ;
494
495
495
496
libxml_use_internal_errors (true );
496
497
@@ -499,7 +500,16 @@ function wputools_test_rss_feed($rss_url) {
499
500
return ;
500
501
}
501
502
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
+
503
513
if ($ rss_content === false ) {
504
514
$ error_text = '' ;
505
515
foreach (libxml_get_errors () as $ error ) {
Original file line number Diff line number Diff line change 2
2
3
3
WPUTools (){
4
4
5
- local _WPUTOOLS_VERSION=' 0.123.2 ' ;
5
+ local _WPUTOOLS_VERSION=' 0.123.3 ' ;
6
6
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)
7
7
local _PHP_VERSIONS_OBSOLETES=(7.0 7.1 7.2 7.3 7.4 8.0)
8
8
local _PHP_VERSIONS_ADVANCED=(8.3 8.4 8.5 9.0)
You can’t perform that action at this time.
0 commit comments