Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter Fernando

    (@fernandocguedes)

    There are other issues involving latin characters:

    1) In “Categories”, when I add a latin char at “Filter Words”, the the feed items return “No Imported Feeds Found”.
    If I remove the latin char, it brings the items.

    Example:
    – Filter Words “#NOTICIA,#NOTICIAS,#NOTíCIA,#NOTíCIAS” = “No Imported Feeds Found” on Feed Items
    – Filter Words “#NOTICIA,#NOTICIAS” = List the items on Feed Items

    2) It doesn’t import the feed when I put latin chars on the Filter Words as well.

    Thanks!

    (Sorry for my bad English)

    Plugin Author Allen

    (@amweiss98)

    yes, we are are aware of this issue and we will try to fix it asap.

    Thread Starter Fernando

    (@fernandocguedes)

    OK, thanks!

    If you need some hand on fixing it (programming) please let me know.

    Cheers

    Plugin Author Allen

    (@amweiss98)

    sure, if you want to try fixing this yourself, the file is the excerpt_functions.php file. The filter is in the include_post.php function (line 22) and the show_excerpt function processes most of the content – and these two functions are likely the ones where the latin characters are having a problem.

    Now, one thing to note, make sure you don’t have any problem by putting the feed here:

    https://simplepie.org/demo/

    since if it doesn’t look right there, that’s the program that reads the feeds and has been known to mess up the non-latin characters sometimes.

    If you get a solution, let me know here. Thanks.

    Thread Starter Fernando

    (@fernandocguedes)

    Thanks for that!

    I was using a incorrect facebook feed format (atom10). When I changed it do RSS20 the title returns OK on SimplePie.

    If someone has the same problem here is how to fix that:
    https://www.facebook.com/feeds/page.php?format=atom10&id=XXXXXXX
    –> Change ATOM10 to RSS20 as:
    https://www.facebook.com/feeds/page.php?format=rss20&id=XXXXXXX

    But the plugin shows the same problem on autopost.

    I’ve cloned the site and will try to to help on the fix.

    I will let you know as soon as I have news.

    Cheers

    Thread Starter Fernando

    (@fernandocguedes)

    I didn’t get a fix, but there are some info that could help:

    SIMPLE PIE SETTINGS / FEED PREVIEW

    When I check the option on “Global Settings/SimplePie Settings”, the “Feed Preview” at “Feed List / Edit” (custom_posts.php , line 603) shows invalid caracters (using “fetch_feed” function).

    When I uncheck it, it shows OK using “wp_rss_fetchFeed” function.

    IMPORT FEEDS

    Then, I’ve changed all fetch_feed function calls on “import_feeds.php” to see if the “noDirectFetch” var was set incorrectly but it was never called (that part is OK).

    So, at the feed preview it collects the title OK but on rss feed importing it is not OK.

    SimplePie RSS URL Preview: https://simplepie.org/demo/?feed=https%3A%2F%2Fwww.facebook.com%2Ffeeds%2Fpage.php%3Fformat%3Drss20%26id%3D320495677986689
    RSS: https://www.facebook.com/feeds/page.php?format=rss20&id=320495677986689

    I’m not a good PHP programmer, sorry if it didn’t help you, bro.

    If I got some time tomorrow I’ll try to continue looking for this fix.

    Thanks!

    Plugin Author Allen

    (@amweiss98)

    are you using the shortcode or the AutoPost, by the way – since I know the AutoPost decodes the title in the same way as the preview.

    Thread Starter Fernando

    (@fernandocguedes)

    I’m using AutoPost.

    That’s what I’m trying to understand, because as far as I noticed autopost uses “wp_rss_fetchFeed” function, the same used on the preview.

    But the title CUT at the first occurrence of special char in the autopost =/

    RSS at SimplePie = OK
    Preview = OK
    Autopost = Title cut at(before) first “latin” special char (á é í ó ? à …).

    You can test with the RSS that I sent on my previous post.

    Thanks!!!

    Thread Starter Fernando

    (@fernandocguedes)

    Hey mate! Did you have some news about that?

    I’m stuck with this problem ??

    Thread Starter Fernando

    (@fernandocguedes)

    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;
    }
    
    ?>
    Plugin Author Allen

    (@amweiss98)

    It is likely a problem on the database insert, then, but not the code that inserts the content, but the database itself, like what type of Server connection collation do you have (I have utf8mb4_general_ci), or what type of Server charset do you have (I have UTF-8 Unicode (utf8)) and I don’t run into any problems.

    Thread Starter Fernando

    (@fernandocguedes)

    Database (tables) collation: “utf8_general_ci” –> It was set by the WordPress installer. Should I change it to utf8mb4_general_ci ?
    Server collation: UTF8 –> Default

    Did you tried to use the Facebook RSS Feed that I’m using? https://www.facebook.com/feeds/page.php?format=rss20&id=320495677986689

    Thanks again!

    Do you get the feeds? Is this Facebook feature still acive? All of Facebook feed-links I see here are broke..

    Hello Tom,

    Seems something wrong with Facebook. I’ve same problem like you are confronting.

    Look at it: https://prntscr.com/5yhdaj

    Maybe Allen can help us with it.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Autopost "Make Facebook Feed Titles" problem – Latin special characters’ is closed to new replies.