Recently I was playing with wp-o-matic WordPress Plugin using a feed from Yahoo pipes. For the uninitiated, wp-o-matic is a WordPress Plugin which enables you to create new posts automatically from RSS or Atom feeds and Yahoo pipes is an interactive feed aggregator and manipulator.
After configuring everything, wp-o-matic kept on saying “0 posts fetched”, even though there were some posts in the feed generated by Yahoo pipes. After some research, I found out that I was not the only one facing this issue and there seems to be a bug in wp-o-matic which breaks feed urls having ampersand (&) character.
After digging into the code further, I found out the url is HTML encoded and stored in the database and is not decoded while retrieved. This occurs in the addCampaignFeed()
function at line 1011 in the wpomatic.php file.
function addCampaignFeed($id, $feed)
{
global $wpdb;
$simplepie = $this->fetchFeed($feed, true);
$url = $wpdb->escape($simplepie->subscribe_url());
// code continues
In the above code, the function $simplepie->subscribe_url()
returns the html encoded url. So to fix this, we have to pass the url to the htmlspecialchars_decode
function. So to fix the bug we have to use the below code.
function addCampaignFeed($id, $feed)
{
global $wpdb;
$simplepie = $this->fetchFeed($feed, true);
$url = $wpdb->escape(htmlspecialchars_decode($simplepie->subscribe_url()));
// code continues
I have also notified the Plugin author about this and hopefully should be fixed soon, till then you can use the above code change if you are using feed from Yahoo pipes.
You’re lucky!!
In my case, every thing’s ok but the images and html code did not showed. I don know how to fixed, do you know?
I have a similar problem but your fix doesn’t work.
When I do this..
{content}
Go to Article Source
With this type of URL..
http://ezinearticles.com/?Follow-These-Tips-and-Stop-Snoring-Now&id=2631609
The ‘&’ is removed to give this..
http://ezinearticles.com/?Follow-These-Tips-and-Stop-Snoring-Nowid=2631609
Any ideas anybody??
Are you getting issue after applying my fix?
Yes. I applied your fix a while ago. Wp O Matic works fine with all other feeds, it just drops the ‘&’ if there is one in the URL. This means that readers cannot make the jump to the authors original article.
I’ve been after a fix for a good while but not found anything yet.
I forgot to mention that this also happens with Feedwordpress and Yaab aswell. Could it be something to do with Simplepie?
@Robert,
Yeah even I guess that it should be an issue with SimplePie. Let me investigate it further.
Great fix — tried it and it worked great. thanks for the hack! just need to get it into the original now …
@Jeremy,
Nice to know that my fix worked for you. Yeah even I am waiting for this fix to get into the core of the Plugin.
Sudar it’s great tips. Thank you so muchhhh, now I know why i got 0 post from wp omatic … very nice and good point to help
thanks, nice catch. hard to believe that it’s now november and the fix still didnt make it into the official download. But your patch fixed it perfectly. One thing to note though – if you’re a total noob with WP like me – you have to delete your feeds and add them back after making this fix…
Its work for me. thanks man
did you know how I can do the same for WP-RSSImport
No rss plugin work with pipes.
Senks for your post from Ukraine!!!
thanks, works great!
This didn’t work for me at first, but then I re-added the feeds and deleted the old ones at which point it worked just fine.
Thanks
worked for me..thanks a ton
Oh man thank you so much for this! I was getting crazy already here, all this because of of htmlspecialchars(amp)? Wow, the developer should have looked further into this…
Its work for me. thanks man