I’ve made a debug file using part of the preview and feed import source codes to test de feed, but it shows OK:
https://esquadraodecristo.com.br/wp-content/plugins/wp-rss-multi-importer/teste_wp.php
Hope it helps. Probably some problem on database data insert???
<?php
header('Content-Type: text/html; charset=UTF-8');
define("ABSPATH", "/home/xyz/public_html/");
define("WPINC", "wp-includes/");
require_once( 'inc/excerpt_functions.php' );
require_once( 'inc/global_settings.php' );
require_once( ABSPATH . WPINC . 'class-simplepie.php' );
class SimplePie_RSSMI extends SimplePie {
}
//### PART OF inc/custom_posts.php - function rssmi_preview_meta_box() {
global $post;
$feed_url = 'https://www.facebook.com/feeds/page.php?format=rss20&id=320495677986689';//get_post_meta( $post->ID, 'rssmi_url', true );
$feed = wp_rss_fetchFeed( $feed_url, 20, true, 0 );
if ( ! $feed->error() ) {
$items = $feed->get_items();
$feedCount = count( $items );
echo "FEED COUNT: $feedCount<BR>";
echo "FEED ITEMS:<BR>";
$count = 0;
$feedlimit = 5;
foreach ( $items as $item ) {
echo '<ul>';
echo '<li>'; // . html_entity_decode( $item->get_title() );
echo '<b>Post Object Title (import feeds):</b> ' . html_entity_decode($item->get_title());
echo '<br><b>Facebook Title (import posts):</b> ' . rssmi_fb_title_filter( $feed_url, html_entity_decode($item->get_title()) );
echo '</li>';
echo '</ul>';
}
}
else echo "<strong>Invalid feed URL</strong>";
//### PART OF inc/admin_init.php - wp_rss_fetchFeed
function wp_rss_fetchFeed( $url, $timeout = 10, $forceFeed = false, $showVideo = 0 ) {
$feed = new SimplePie_RSSMI();
$feed->set_feed_url( $url );
$feed->force_feed( $forceFeed );
$feed->set_autodiscovery_level( SIMPLEPIE_LOCATOR_ALL );
if ( $showVideo == 1 ) {
$strip_htmltags = $feed->strip_htmltags;
array_splice( $strip_htmltags, array_search( 'iframe', $strip_htmltags ), 1 );
$feed->strip_htmltags( $strip_htmltags );
}
$feed->enable_cache( false );
$feed->set_timeout( $timeout );
$feed->init();
$feed->handle_content_type();
return $feed;
}
?>