#2864 closed enhancement (invalid)
Magpie falling behind feed developments
Reported by: | skeltoac | Owned by: | link92 |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0.3 |
Component: | Optimization | Keywords: | magpie rss atom rdf xml bg|has-patch bg|needs-testing |
Focuses: | Cc: |
Description
MagpieRSS doesn't know how to handle new elements in XML. It doesn't understand Atom 1.0 or RSS 2.0 very well. It is lossy. It doesn't use wp_object_cache. It needs an update.
Rather than tweak Magpie to handle each new thing that comes along, I've put together an XML parser that handles Atom, RSS and RDF feeds and provides an way to add support for new kinds of XML elements. It has default logic to handle any XML data in a feed and can be extended via plugins to add logic for handling special elements. It uses wp_object_cache whenever possible; otherwise it falls back on the database.
fetch_rss is emulated very well and much extra data is available in the array returned but some elements, such as Atom elements with both attributes and inner text, may lose some of their meaning. It may be best to start using a lossless format or tweak the array so that attributes are always preserved.
This code is in use on wordpress.com right now. It needs scrutiny and testing on other platforms as well.
Attachments (4)
Change History (16)
#2
@
18 years ago
In magpie, the object member 'summary' held the value of whatever was between 'description' or 'content' tags. How about including that feature in your parser, for backwards-compatibility?
#3
@
18 years ago
Just quickly skimming through the code, I think I can see some pretty major shortcomings within the parser. Atom 1.0 has got a "type" attribute(and Atom 0.3 has "mode"), which must be used to format the data correctly (eg. decoding entities).
I personally am one of the two developers of SimplePie, another PHP feed parser, and I may well try and hack it into WP sometime before term starts (22nd Aug). Catch me on IRC sometime (I'm gsnedders, this is just a nick I used a while ago).
#4
@
18 years ago
I've attached two files: a new rss.php, and simplepie.patch (which patches wp-admin/index.php, due to the completely different syntax). It assumes there's simplepie.inc in wp-includes, and that needs to be a recent SVN copy, due to it using some features that aren't in the latest release. It's very stable at the moment (it's actually massively less buggy than the latest "stable" release), and probably won't break for quite a while. So, till SP 1.0 Beta 3 is out, just grab the SVN copy.
One of the things about this, and should be obvious from the fact I'm not including simplepie.inc here, is that we now don't need any modifications to the feed parser itself, undoubtedly easier from a maintenance point of view.
#8
@
18 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
This is entirely unacceptable.
We just broke everything that uses our RSS libraries in the world. If simplepie can't maintain the same external functions, like fetch_rss and the old object structure, then we shouldn't use it. Nothing in WP should have changed except the library.
Also, the dashboard is now loading entire posts rather than descriptions.
New rss.php uploaded.
Incutio's HTTP client need not be used, but it does an efficient job and allows us to handle HTTP codes >200 ourselves. For instance, we can cache redirects. Proposals welcome.