WordPress Plugin: MagpieRSS Hotfix for Enclosure Support and Character Encoding Issues
Latest version: 1.2 – Released 16th December 2008 This hotfix adds support for RSS enclosures to MagpieRSS, the RSS parser behind the fetch_rss() function in WordPress.
Last reviewed
The WordPress section is where this page belongs. The section is 18 pages deep.
The wording is the original. Where an old note was brief, it is still brief here.
The thread under the original note was kept: 20 replies, left between 2008 and 2010.
Description
It also forces MagpieRSS to use UTF-8 character encoding, which fixes some issues with feeds that contain non-ASCII characters.
Is this plugin for me?
This plugin is only going to be of use to you if:
- You are fetching feeds on your blog with the
fetch_rss()function and want to parse enclosures contained in the feed; or - You are fetching feeds on your blog either with the RSS Sidebar Widget or with
fetch_rss()and question marks are showing up somewhere in the feed where special characters are supposed to be.
Installation
- Unzip the ZIP file and drop the folder straight into your
wp-content/pluginsdirectory. - Activate the plugin through the ‘Plugins’ menu in WordPress.
- That’s it! You can now parse enclosures contained in feeds fetched by WordPress.
Download
ZIP file from downloads.wordpress.org
FAQ
For FAQs, including how to parse enclosures in your feed, please see the plugin’s FAQ page on wordpress.org.
Any comments, questions, queries, suggestions, complaints, etc, please leave a comment!
The pages listed after it were written around the same time and tend to share their subject matter. Nothing here is restated from memory: a number without a source does not get printed.
From the original thread
20 replies20 replies were left on this page between 2008 and 2010, kept as they were written. The avatars, profile links and reply form of the software that collected them are not part of this archive, and the addresses readers pasted are kept as text rather than as links.
gilles
hello,
how can i show enclosure in this rss feed.?
http://www.premiere.fr/recherche/export_rss?type=actustarsthanks
Ludicrous
Hey Gilles, take a look at the plugin FAQ where I’ve included some sample code for grabbing the enclosures from a feed. It should be enough to get you started.
Hank
I followed your instructions. However, when trying to activate I get the follow error:
Fatal error: Cannot redeclare fetch_rss() (previously declared in /path/to/server/htdocs/wp-includes/rss.php:390) in /path/to/server/htdocs/wp-content/plugins/magpierss-hotfix.php on line 525
I don’t understand how you are trying to override fetch_rss()
Apart from copying your code into the rss.php file, do you have a nicer /plugin way?
Thanks for the plugin /your help.
Ludicrous
Hank, that’s odd.
The function
fetch_rss()is a pluggable function. This means that a plugin can override it simply by declaring it. If you take a look atwp-includes/rss.phpyou’ll note thatfetch_rss()is wrapped in a check:if ( !is_function('fetch_rss') ){…function here…}I have an idea why this error is ocurring though. I’ll push an updated version of the plugin out shortly.
John.
Ludicrous
Version 1.0.1 released – Wrap the patched fetch_rss() function in a function_exists() check to prevent errors upon activation.
Hank
John, thanks for the update. No error messages when updating now indeed. However, I can’t retrieve the enclosure url following your instructions. Any idea what’s causing this?
Hank
Just interested: which plugins are you using for previewing comments /subscription management?
Ludicrous
Hank, which version of WordPress are you using?
Comment preview plugin is here and comment subsription plugin is here :)
Hank
John, thanks for the links! I am using WordPresss version 2.6.3
Ludicrous
Hank, can you send me the code you’re using to get the enclosure links? Feel free to email me at the email address shown here.
Ludicrous
Version 1.1 released – The plugin now clears WordPress’ RSS cache upon activation so fresh feeds are fetched and then cached complete with their enclosures.
James Mentz
John, you have saved my sanity with this ingenious little plugin!
Many thanks.
Lisa
WARNING: This “hotfix” is a nightmare to deactivate. Since it didn’t fix my problem (I still got those weird symbols), I tried to rid my WP installation of the plugin, only to have it return the error Hank mentions above. Your code really needs to be changed so it doesn’t create hassles for users who decide they don’t want the plugin after trying it out.
How do I get the plugin completely out of my installation without having to install WP all over again from scratch? Please provide the solution here so future users can find it easily.
Ludicrous
Hi Lisa, thanks for the comment.
Sorry the plugin didn’t fix your character encoding issue. Do you have a link to your blog?
If you can’t deactivate the plugin from the Plugins menu in WordPress, simply delete the plugin files from your server and the plugin will be automatically deactivated.
Please let me know if your blog still shows any errors after deleting the plugin.
Ludicrous
Plugin version 1.2 released. Fixes possible errors on activation.
Rarst
I am using KB Advanced RSS plugin that uses MagpieRSS. Looking for solution for enclosures and tried your plugin but it makes KB Advanced RSS die (no error messages). Can’t figure out why because it breaks even on feeds that have no enclosures.
Unfortunately author of that one is not providing support at moment. :(
Any hints what else I can try to get enclosures support?
Rarst
PS I tried patching rss.php with your fix for enclosure and it works (also got rid of extra array level). So KB Advanced RSS is probably getting broken by something else in your plugin.
Big thanks. :) Now I have to figure out how to apply fix without messing with rss.php
Danmark Bag Facaden
i have on my wordpress blog, in my, tag page is have NewsFeeds (NyhedsLinks) from other news sources and im trying to solve how to iframe the_permalink() in blog post so that i can retrieve the whole feed in my blog in a iframe =) thx for this magpierss hotfix ;o)
Ways For Kids To Make Money Online
Hi,
I was searching the internet on how am I going to solve this problem of mine. I was trying to activate a plugin called backlink energizer, this is a plugin that indexes your backlinks faster. I was prompted with the following error when trying to activate it.
Fatal error: Cannot redeclare fetch_rss() (previously declared in /home/panyang/public_html/waysforkidstomakemoneyonline.com/wp-includes/rss.php:404) in /home/panyang/public_html/waysforkidstomakemoneyonline.com/wp-content/plugins/energizer/lib/rss_fetch.inc on line 221
I did try installing your plugin hoping to fix this. But I still get the same error.
Ludicrous
You’ll need to contact the author of that plugin to get it fixed. Sounds like the plugin hasn’t been updated to support recent versions of WordPress.