WordPress.org

Ready to get started?Download WordPress

Forums

RSS Image Feed
[resolved] Featured image (19 posts)

  1. Nasah
    Member
    Posted 11 months ago #

    Hey, great plugin (after working around the get_headers() issue).

    But I was wondering whether it would be possible to check for featured image and put this in the rss feed, so if there is no images in the post itself, it would be possible to put the featured image in the rss instead.

    https://wordpress.org/plugins/rss-image-feed/

  2. tepelstreel
    Member
    Plugin Author

    Posted 11 months ago #

    Hi there,

    what get_headers() issue? People seem to have the strangest things occuring with the plugin that I never undergo in my testing environments. ;)

    I'm at the moment working on the plugin once again and actually had the same thoughts about the featured image.

    Regards

  3. Nasah
    Member
    Posted 11 months ago #

    Well get_headers() throws an error on some server enviroments (those with PHP Allow URL fopen set to OFF). But seems to only be a restriction in my test enviroment and not a problem on the production enviroment. So outcommented lines 115-116 to stop the error thrown on line 271. But let's get past that :-)

    I was looking into the get_feed_image function, if it would be possible to add a statement in the lines of:
    -------------------------------------------------------------------

    if (!$rif_thumb) :
    
    if ( has_post_thumbnail( $post->ID ) ){
    $img_container = '' . get_the_post_thumbnail( $post->ID, 'rss-thumbnail', array( 'style' => 'margin:0; border: 10px solid #202020' ) ) . '' . $img_container;
    }
    		endif;
    
    		return $img_container;

    ------------------------------------------------------------------

    The above is not correct I know, but just an example to show my line of thought. Still working on my WP skills :)

    And thx by the way for the quick reply.

    Kind regards

  4. tepelstreel
    Member
    Plugin Author

    Posted 11 months ago #

    I'm not that far yet, since I try to change the entire image class in my whole framework to something more useful. It seems to use WP functions that in deed use the fopen.

    Your thumbnail idea seems ok at a first quick glance. What I'm planning to do right now, is to implement a new image size 'rss-image' and see that WP does all the work, if the image is not hotlinked.

    And thank you for actually explaning a problem, that I cannot produce myself. It makes things a lot easier. :)

    Kind regards

  5. tepelstreel
    Member
    Plugin Author

    Posted 11 months ago #

    The plugin now searches first for the featured image, then for the first image, attached to the post and last for any html image tag, it can find in the post content.

    That should give you the behaviour, you were looking for.

    Best

  6. Nasah
    Member
    Posted 11 months ago #

    Hi again, I haven't been able to test the new version as I get an error.

    Warning: Cannot modify header information - headers already sent in wp-includes/pluggable.php on line 896

  7. tepelstreel
    Member
    Plugin Author

    Posted 11 months ago #

    Hi again,

    about which version are you talking? 3.5? That should be the one with all the bugs fixed and it works as well in my multisite as in my singlesite testing environment.

    Best

  8. Nasah
    Member
    Posted 11 months ago #

    Well I downloaded version 3.5 from here, and it throws the mentioned error. Here is the link to the feed: http://selgolb.cphadsdemo.dk/feed/

    Regards

  9. tepelstreel
    Member
    Plugin Author

    Posted 11 months ago #

    What are your settings for the feed? I must have overlooked something while testing. Do you test the plugin using a multisite installation or single site?

    Do you tell WP to show the whole post in the feed or just a summary?

    And finally (especially if using the summary) do your posts have en excerpt?

    Loads of stuff that I need to know :)

    http://yritys-test.waldemarstoffel.com/feed (single site)
    http://esc-blogg.atelier-fuenf.de/feed (multisite)

    That's how they work in my testing environments...

  10. Nasah
    Member
    Posted 11 months ago #

    The site is on a single site and set to show the whole post in the blog. just deactivated all my plugins, now it seems to get worse...

  11. tepelstreel
    Member
    Plugin Author

    Posted 11 months ago #

    Issues should be fixed in the latest version. At least, I didn't have anything in my error logs in the testing environment

  12. Nasah
    Member
    Posted 11 months ago #

    Sorry for being a pain, dude. But now there seems to be no feed at all, just blanks it out... Also when I click save to save settings in the options page for the plugin, it goes blank...

  13. tepelstreel
    Member
    Plugin Author

    Posted 11 months ago #

    Aaargh!

    Why don't I ever get these errors on testing? It would make things easier. Do you work in debug mode?

    I'll try to figure out, what is happening.

    Sorry.

  14. tepelstreel
    Member
    Plugin Author

    Posted 11 months ago #

    Should be solved. But I thought that so often, when the thing worked with me...

  15. Nasah
    Member
    Posted 10 months ago #

    Hej Waldemar,

    It still gives problems. Error message:

    Warning: Cannot modify header information - headers already sent in /wp-includes/feed-rss2.php on line 8

    But when I remove (outcomment) line 8 in the feed-rss2.php:

    header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);

    It works perfect.

    I use the standard rss2 feed php files included in WP-include.

    Feed with error (this installation is set to not throw errors, but the layout says it all):
    http://selgolb.cphadsdemo.dk/feed/

    Working feed (outcommented line 8):
    http://www.fashionvictim.dk/?feed=rss2

    I will just modify my code in the rss files where the plugin is needed, but thought you might want a detailed description about a possible error on some installations.

    (maybe if/isset/else header statement can cure this problem?)

    Cheers :-)

  16. Nasah
    Member
    Posted 10 months ago #

    Update.

    A problem with outcommenting line 8, is that now I can't use my rss2 feed in my RSS importer on another site (feed to post). temporary fix is to outcomment the same code (line 8 again) in the feed-atom.php and use the atom feed instead of RSS2...

  17. Nasah
    Member
    Posted 10 months ago #

    Another update.

    I had to deactivate the plugin on one of the sites as it broke my
    site:

    Warning: Cannot modify header information - headers already sent in /wp-includes/pluggable.php on line 896
    
    line 896: header("Location: $location", true, $status);
    
    	return true;

    Sorry...

  18. Nasah
    Member
    Posted 10 months ago #

    line 896 sorroundings:

    if ( !$is_IIS && php_sapi_name() != 'cgi-fcgi' )
    		status_header($status); // This causes problems on IIS and some FastCGI setups
    
    	header("Location: $location", true, $status);
    
    	return true;
  19. tepelstreel
    Member
    Plugin Author

    Posted 10 months ago #

    Hi there,

    sorry to hear that. And I really don't know at all, what to do with it. I don't touch anything with the plugin. I just use the hooks for the rss_excerpt and the feed_content to modify the output by putting an image in front of it.

    Usually the headers already sent stuff comes, when a plugin is causing an error and actually wants to write some error code, while wordpress is busy doing something else.

    When testing the darned thing, I work in debug mode with error logs on, to really retrieve everything, I possibly could do wrong.

    http://esc-blogg.atelier-fuenf.de/feed works perfect with a clean errorlog in a multisite installation.

    http://wasistlos.waldemarstoffel.com/feed works perfect as a single site setup.

    Do you have anything running on one of those websites, that might interfere? Like hosting your images on a cloud service?

Reply

You must log in to post.

About this Plugin

About this Topic