{"id":317,"date":"2007-01-06T08:51:31","date_gmt":"2007-01-06T08:51:31","guid":{"rendered":"http:\/\/neosmart.net\/blog\/archives\/317"},"modified":"2023-01-28T15:53:54","modified_gmt":"2023-01-28T21:53:54","slug":"wordpress-206-and-feedburner-disconnects","status":"publish","type":"post","link":"https:\/\/neosmart.net\/blog\/wordpress-206-and-feedburner-disconnects\/","title":{"rendered":"WordPress 2.0.6 and FeedBurner Disconnects"},"content":{"rendered":"<p><strong>This article provides a workaroud for WordPress 2.0.6 and chronic FeedBurner disconnects. It&#8217;s essential that you upgrade to WordPress 2.0.6 immediately in order to prevent your blog from being taken over by hackers! Upgrade, then follow these instructions to get it to play nicely with FeedBurner afterwards.<\/strong>\n<\/p>\n<p><strong>The Problem<\/strong>\n<\/p>\n<p>After upgrading to WordPress 2.0.6 or WordPress 2.1 Beta, your FeedBurner feed will, at times, give you an &#8220;invalid xml&#8221; error, and &#8220;FeedMedic&#8221; will show you something like this:\n<\/p>\n<blockquote>\n<p>Your server disconnected us before sending the full source feed content. If your blogging platform is TextPattern, this is a known bug, and a fix can be found here: <a href=\"http:\/\/forum.textpattern.com\/viewtopic.php?id=11247\" rel=\"follow\">http:\/\/forum.textpattern.com\/viewtopic.php?id=11247<\/a>\n  <\/p>\n<\/blockquote>\n<p><!--more--><\/p>\n<p><strong>Explanation<\/strong>\n<\/p>\n<p>FeedBurner uses something called &#8220;Conditional Get requests&#8221; to ask your server whether or not the page has changed since the last it viewed it, in order to save you some bandwidth. Depending on how popular your site is, FeedBurner may hit up your feed up to hundreds of times a day, so this is a really good idea! Unfortunately, in WordPress 2.0.6, your site doesn&#8217;t respond in a way that FeedBurner recognizes. The 304 headers it sends back to let it know that the content hasn&#8217;t changed are malformed and corrupt &#8211; and FeedBurner has no idea what they mean.\n<\/p>\n<p><strong>Workaround 1<\/strong>\n<\/p>\n<p>Thanks to <a href=\"http:\/\/markjaquith.com\/\" rel=\"follow\">Mark Jaquith<\/a>, there&#8217;s a little change you can make to your code to make it work the way it&#8217;s supposed to. This very same change will be included in WordPress 2.0.7, so you don&#8217;t have to worry about unsafe changes. You can grab the unified diff file <a href=\"http:\/\/markjaquith.wordpress.com\/2007\/01\/06\/wordpress-206-feedburner-issue-and-fix\/\" rel=\"follow\">here<\/a>, if you like.\n<\/p>\n<p>Open \/wp-includes\/functions.php and find the following code:\n<\/p>\n<pre lang='php'>if ( substr(php_sapi_name(), 0, 3) == &amp;#8216;cgi&amp;#8217; )&lt;br \/&gt;\n\t\t@header(&amp;#8220;HTTP\/1.1 $header $text&amp;#8221;);&lt;br \/&gt;\n\telse&lt;br \/&gt;\n\t\t@header(&amp;#8220;Status: $header $text&amp;#8221;);&lt;br \/&gt;\n}<\/pre>\n<p>Replace that code block with this code below, which commetns out the trouble-causing portions:\n<\/p>\n<pre lang='php'>\/\/ \tif ( substr(php_sapi_name(), 0, 3) == &amp;#8216;cgi&amp;#8217; )&lt;br \/&gt;\n\t\t@header(&amp;#8220;HTTP\/1.1 $header $text&amp;#8221;);&lt;br \/&gt;\n\/\/\telse&lt;br \/&gt;\n\/\/\t\t@header(&amp;#8220;Status: $header $text&amp;#8221;);&lt;br \/&gt;\n}<\/pre>\n<p>Save the file and exit. Resync your feed at FeedBurner.\n<\/p>\n<p><strong>Workaround 2<\/strong>\n<\/p>\n<p>If you&#8217;re not feeling up to messing with the WordPress source code and would rather not possibly have to fix something later, you can create a php script that &#8220;relays&#8221; the content of your feed to FeedBurner for you. All you have to do is cut and paste the code below into&nbsp;a file of your own on your server &#8211; or any other as a matter of fact. Then, just point FeedBurner<em> to this file<\/em> instead, and you&#8217;re done.&nbsp;Just remember: this file doesn&#8217;t cache!&nbsp;\n<\/p>\n<p>Create a file called FeedBurner.php, which contains the following code:\n<\/p>\n<pre lang='php'>&lt;?php\n$uri=&quot;http:\/\/neosmart.net\/blog\/feed\/&quot;; \/\/Replace this URI with the URI to *your* feed!!\n\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $uri);\ncurl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);\necho curl_exec($ch);\n$status = curl_close($ch);\n?&gt;<\/pre>\n<p>The code&#8217;s that simple. Upload this file to a webserver, and point FeedBurner to the URI for this file, and you&#8217;ll no longer get that ugly error!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article provides a workaroud for WordPress 2.0.6 and chronic FeedBurner disconnects. It&#8217;s essential that you upgrade to WordPress 2.0.6 immediately in order to prevent your blog from being taken over by hackers! Upgrade, then follow these instructions to get &hellip; <a href=\"https:\/\/neosmart.net\/blog\/wordpress-206-and-feedburner-disconnects\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[56,190,166,101,124,54],"class_list":["post-317","post","type-post","status-publish","format-standard","hentry","category-software","tag-bugs","tag-caching","tag-feedburner","tag-feeds","tag-php","tag-wordpress"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4xDa-57","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/comments?post=317"}],"version-history":[{"count":1,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/317\/revisions"}],"predecessor-version":[{"id":5017,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/317\/revisions\/5017"}],"wp:attachment":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/media?parent=317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/categories?post=317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/tags?post=317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}