diff --git a/tools/diagnostic/inc/40-wordpress.php b/tools/diagnostic/inc/40-wordpress.php index ff3e82f..38f0334 100644 --- a/tools/diagnostic/inc/40-wordpress.php +++ b/tools/diagnostic/inc/40-wordpress.php @@ -299,6 +299,33 @@ function wputools_diagnostic_check_is_preproduction($domainName) { $wputools_errors[] = sprintf('Homepage took %s seconds to load.', $info['total_time']); } +/* ---------------------------------------------------------- + Check RSS +---------------------------------------------------------- */ + +function wputools_test_rss_feed($rss_url) { + global $wputools_errors; + + if (empty($rss_url)) { + $wputools_errors[] = __('The RSS URL is empty.'); + return; + } + + $rss_content = @simplexml_load_file($rss_url); + if ($rss_content === false) { + $wputools_errors[] = __('Failed to load RSS feed. Please check the URL.'); + return; + } + + $items = $rss_content->channel->item; + if (empty($items)) { + $wputools_errors[] = __('No articles found in the RSS feed.'); + return; + } +} + +wputools_test_rss_feed(site_url() . '/feed'); + /* ---------------------------------------------------------- Compare WP Version ---------------------------------------------------------- */ diff --git a/wputools.sh b/wputools.sh index 3a695bc..d168e96 100644 --- a/wputools.sh +++ b/wputools.sh @@ -2,7 +2,7 @@ WPUTools(){ -local _WPUTOOLS_VERSION='0.86.0'; +local _WPUTOOLS_VERSION='0.87.0'; 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) local _PHP_VERSIONS_OBSOLETES=(7.0 7.1 7.2 7.3 7.4) local _PHP_VERSIONS_ADVANCED=(8.2 8.3 8.4 8.5 9.0)