Autoblog "featured image" not working properly.

Looks like my Divi theme might be conflicting? I can't see the WYSIWYG editor and the Autoblog keeps pulling in 1x1 images as the "featured image".

  • Predrag Dubajic

    Hi Aryeh,

    Hope you're doing well.

    I'm afraid that the feed you are using is broken, when I visit http://feeds.reuters.com/reuters/USVideoBusiness all I can see is this:

    On my first visit it was working fine but after a couple of refreshes while I was checking it it stopped loading.

    While it was loading it appeared to me that the feed itself doesn't provide any images, and AutoBlog can only fetch the content that feed itself allows.

    I also checked your posts and pages and the Visual editor seems to be working fine in there, could you provide us some more info about this issue, and perhaps provide us some steps we can follow in order to replicate?

    Best regards,
    Predrag

  • Aryeh East

    Ok a few things:

    1. The feed works fine for me (you might have just experienced a brief downtime). This is a video feed and there are .mp4 files in this feed. See this screenshot

    https://www.dropbox.com/s/fwg5ka43mttqbdr/Screenshot%202018-03-28%2010.15.26.png?dl=0

    Why isn't autoblog parsing those in any way? I'd like to show those videos on the site (I realize there might be some manual labor in this process, but they're not being pulled in at all.

  • Predrag Dubajic

    Hi Aryeh,

    I was doing some additional testing and it seems like the SimplePie, which is default WP RSS reader and also used by AutoBlog, is not able to read this feed properly, it could be due to the feed not validating properly but I'm not completely sure.

    I will need to forward this over to our developers so they can check it out further.
    Please note that developer response might be slower than usual staff response, so we appreciate your patience on this.

    Best regards,
    Predrag

  • Ivan

    Hi Aryeh East !

    First of all, it seems there isn't any image in that feed. That's why it doesn't add any images.
    Regarding videos - as you mentioned in Live Chat, that addon is called Youtube Feed Import but as you can see, these aren't Youtube videos. So, that's why it doesn't add any videos to posts.
    Anyway, if you'd like to add those videos - you could try adding the following snippet in a MU plugin ( more info about MU plugins is here )

    <?php
    function autoblog_add_custom_video_process_content( $content, $details, SimplePie_Item $item ) {
    	if ( empty( $details['url'] ) || 'http://feeds.reuters.com/reuters/USVideoBusiness' !== $details['url'] ) {
    		return $content;
    	}
    
    	//we will remove the post sanitize for cron
    	remove_filter('content_save_pre', 'wp_filter_post_kses');
    	remove_filter('content_filtered_save_pre', 'wp_filter_post_kses');
    
    	//we need to check does the disable santinitize add-on activated
    	$method = trim(isset($details['utubeimport']) ? $details['utubeimport'] : 'ASC');
    	if (empty($method)) {
    		return $content;
    	}
    
    	if ($method === 'ENCLOSURE') {
    		$content = autoblog_add_custom_video_find_in_enclosure($item, $content, $details);
    	}
    	return $content;
    }
    
    function autoblog_add_custom_video_find_in_enclosure($item, $content, $details)
    {
    	$enclosures = $item->get_enclosures();
    	$link = null;
    	foreach ($enclosures as $enclosure) {
    		$rv_link = $enclosure->link;
    		if (preg_match('#^https?://.*\.mp4#i', $rv_link)) {
    			$link = $rv_link;
    			break;
    		}
    	}
    
    	if (!empty($link)) {
    		$iframe = isset($details['utubeimport_iframe']) ? $details['utubeimport_iframe'] :
    			'<iframe width="560" height="349" src="SRC_LINK" frameborder="0" allowfullscreen="0"></iframe>';
    		$iframe = str_replace('SRC_LINK', esc_url($link), $iframe);
    		return $iframe . $content;
    	}
    	return $content;
    }
    
    add_filter('autoblog_post_content_before_import', 'autoblog_add_custom_video_process_content', 10, 3);

    And also, you should check this option

    Best,
    Ivan.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.