fetch_feed() returns no rss data
-
I recently moved to a new server that has PHP 7.0. Everything seems to be working but I have a problem with the fetch_feed() function. It doesn’t return any data. I’m using the code below to test and have tested with a lot of feeds. Same result every time.
I’ve also tried using curl from the command line of the server, and this is working without any problem. So there seems to be a problem in wordpress.
I have tried WP_DEBUG and enabling error_reporting. But I get no errors.
What could be the problem?
add_action('init', 'testfetchfeed'); function testfetchfeed () { if (isset($_REQUEST['testfetchfeed'])) { $rss = fetch_feed('https://en.blog.wordpress.com/feed/'); if (is_wp_error($rss)) { echo $rss->get_error_message(); } else { print_r($rss); } exit; } }
SimplePie Object ( [data] => Array ( ) [error] => [sanitize] => WP_SimplePie_Sanitize_KSES Object ( [base] => [remove_div] => 1 [image_handler] => [strip_htmltags] => Array ( [0] => base [1] => blink [2] => body [3] => doctype [4] => embed [5] => font [6] => form [7] => frame [8] => frameset [9] => html [10] => iframe [11] => input [12] => marquee [13] => meta [14] => noscript [15] => object [16] => param [17] => script [18] => style ) [encode_instead_of_strip] => [strip_attributes] => Array ( [0] => bgsound [1] => class [2] => expr [3] => id [4] => style [5] => onclick [6] => onerror [7] => onfinish [8] => onmouseover [9] => onmouseout [10] => onfocus [11] => onblur [12] => lowsrc [13] => dynsrc ) [strip_comments] => [output_encoding] => UTF-8 [enable_cache] => 1 [cache_location] => ./cache [cache_name_function] => md5 [timeout] => 10 [useragent] => [force_fsockopen] => [replace_url_attributes] => Array ( [a] => href [area] => href [blockquote] => cite [del] => cite [form] => action [img] => Array ( [0] => longdesc [1] => src ) [input] => src [ins] => cite [q] => cite ) ) [useragent] => SimplePie/1.3.1 (Feed Parser; https://simplepie.org; Allow like Gecko) Build/20141218193430 [feed_url] => https://en.blog.wordpress.com/feed/ [file] => [raw_data] => [timeout] => 10 [force_fsockopen] => [force_feed] => [cache] => 1 [cache_duration] => 86400 [autodiscovery_cache_duration] => 604800 [cache_location] => ./cache [cache_name_function] => md5 [order_by_date] => 1 [input_encoding] => [autodiscovery] => 31 [registry] => SimplePie_Registry Object ( [default:protected] => Array ( [Cache] => SimplePie_Cache [Locator] => SimplePie_Locator [Parser] => SimplePie_Parser [File] => SimplePie_File [Sanitize] => SimplePie_Sanitize [Item] => SimplePie_Item [Author] => SimplePie_Author [Category] => SimplePie_Category [Enclosure] => SimplePie_Enclosure [Caption] => SimplePie_Caption [Copyright] => SimplePie_Copyright [Credit] => SimplePie_Credit [Rating] => SimplePie_Rating [Restriction] => SimplePie_Restriction [Content_Type_Sniffer] => SimplePie_Content_Type_Sniffer [Source] => SimplePie_Source [Misc] => SimplePie_Misc [XML_Declaration_Parser] => SimplePie_XML_Declaration_Parser [Parse_Date] => SimplePie_Parse_Date ) [classes:protected] => Array ( [Sanitize] => WP_SimplePie_Sanitize_KSES [Cache] => WP_Feed_Cache [File] => WP_SimplePie_File ) [legacy:protected] => Array ( [0] => WP_SimplePie_Sanitize_KSES [1] => WP_Feed_Cache [2] => WP_SimplePie_File ) ) [max_checked_feeds] => 10 [all_discovered_feeds] => Array ( ) [image_handler] => [multifeed_url] => Array ( ) [multifeed_objects] => Array ( ) [config_settings] => [item_limit] => 0 [strip_attributes] => Array ( [0] => bgsound [1] => class [2] => expr [3] => id [4] => style [5] => onclick [6] => onerror [7] => onfinish [8] => onmouseover [9] => onmouseout [10] => onfocus [11] => onblur [12] => lowsrc [13] => dynsrc ) [strip_htmltags] => Array ( [0] => base [1] => blink [2] => body [3] => doctype [4] => embed [5] => font [6] => form [7] => frame [8] => frameset [9] => html [10] => iframe [11] => input [12] => marquee [13] => meta [14] => noscript [15] => object [16] => param [17] => script [18] => style ) )
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘fetch_feed() returns no rss data’ is closed to new replies.