<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OODA Strategies&#187; FeedWordPress</title>
	<atom:link href="http://oodastrategies.com/tag/feedwordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://oodastrategies.com</link>
	<description>Build a web presence, not just a website</description>
	<lastBuildDate>Sat, 21 May 2011 04:53:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to filter out a blog from Syndication?</title>
		<link>http://oodastrategies.com/2008/04/18/how-to-filter-out-a-blog-from-syndication/</link>
		<comments>http://oodastrategies.com/2008/04/18/how-to-filter-out-a-blog-from-syndication/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 03:29:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[FeedWordPress]]></category>
		<category><![CDATA[Filter Syndicated Blogs]]></category>
		<category><![CDATA[Syndication]]></category>
		<category><![CDATA[Wordpress MU]]></category>

		<guid isPermaLink="false">http://opensourceactivism.blogivists.com/2008/04/18/how-to-filter-out-a-blog-from-syndication/</guid>
		<description><![CDATA[Here are the steps to filter out a registered blog that you now longer want appearing in the syndicated feed list (We are using FeedWordPress to syndicate our feeds): Login as an admin user Go to your Contol Panel Choose Syndication Click Edit beside the feed you need to filter a blog from Scroll down [...]]]></description>
			<content:encoded><![CDATA[<p>Here are the steps to filter out a registered blog that you now longer want appearing in the syndicated feed list (We are using <a href="http://projects.radgeek.com/feedwordpress">FeedWordPress</a> to syndicate our feeds):<br />
<span id="more-97"></span></p>
<ol>
<li>Login as an admin user</li>
<li>Go to your Contol Panel</li>
<li>Choose Syndication<br />
<a href='http://opensourceactivism.blogivists.com/files/2008/04/syndication.png' title='Syndication menu'><img src='http://opensourceactivism.blogivists.com/files/2008/04/syndication.thumbnail.png' alt='Syndication menu' /></a>
</li>
<li>Click Edit beside the feed you need to filter a blog from</li>
<li>Scroll down and find the blog(s) you want to fliter out</li>
<li>Click the dropdown and choose &#8220;get filtered out&#8221; as shown below repeating for each blog you want to filter out<br />
<a href='http://opensourceactivism.blogivists.com/files/2008/04/syndication_filterout.png' title='Syndication menu'><img src='http://opensourceactivism.blogivists.com/files/2008/04/syndication_filterout.thumbnail.png' alt='Syndication menu' /></a>
</li>
<li>Click the Save Changes button</li>
</ol>
<p>Filtering out these blogs will not remove them from the current feed however.  It only prevents them from being syndicated from this point forward.  To actually remove posts from the current feed you need to <a href="http://opensourceactivism.blogivists.com/2008/04/18/how-to-delete-offensive-syndicated-posts/">delete offensive syndicated posts</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Foodastrategies.com%2F2008%2F04%2F18%2Fhow-to-filter-out-a-blog-from-syndication%2F&amp;title=How%20to%20filter%20out%20a%20blog%20from%20Syndication%3F" id="wpa2a_2"><img src="http://oodastrategies.com/socmedia/sharethis.png" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://oodastrategies.com/2008/04/18/how-to-filter-out-a-blog-from-syndication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML Parsing Error: xml declaration not at start of external entity</title>
		<link>http://oodastrategies.com/2008/03/27/xml-parsing-error-xml-declaration-not-at-start-of-external-entity/</link>
		<comments>http://oodastrategies.com/2008/03/27/xml-parsing-error-xml-declaration-not-at-start-of-external-entity/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 23:41:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[FeedWordPress]]></category>
		<category><![CDATA[Parsing Error]]></category>
		<category><![CDATA[Wordpress MU]]></category>

		<guid isPermaLink="false">http://opensourceactivism.blogivists.com/2008/03/27/xml-parsing-error-xml-declaration-not-at-start-of-external-entity/</guid>
		<description><![CDATA[Have you ever seen this error in your WordPress feed? XML Parsing Error: xml declaration not at start of external entity I have now, multiple times. It is something that is so easy to cause without even knowing how it happened or that it happened at all for hours or days. We use WordPress MU [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever seen this error in your WordPress feed?</p>
<blockquote><p>XML Parsing Error: xml declaration not at start of external entity</p></blockquote>
<p>I have now, multiple times.  It is something that is so easy to cause without even knowing how it happened or that it happened at all for hours or days.</p>
<p>We use WordPress MU here at <a href="http://blogivists.com">Blogivists</a> running on a Linux server.  On the main page we have a <a href="http://blogivists.com/wpmu-feed/">feed</a> that displays the latest posts from all of the <a href="http://blogivists.com">blogivists</a> blogs. Yesterday, we discovered our <a href="http://blogivists.com/wpmu-feed/">feed</a> was broken and displaying the error shown above.  I had seen this error before when <a href="http://opensourceactivism.blogivists.com/2008/03/20/2-simple-wordpress-security-tasks/">securing the website</a>.</p>
<p>I recognized it immediately as being blank lines in the code outside the php tags of .  The problem becomes finding the errant code.  If you don&#8217;t have shell access you will have to go through each file you have changed to find the error.  With shell access the task becomes a little easier.  I intend to make it even easier for you.</p>
<p>I started by doing the following in the webroot of the website:</p>
<blockquote><p>find . -mtime -1 -name \*.php</p></blockquote>
<p>This gave me a list of all files that had been changed in the past 24 hours.  I then stepped through each file looking for the problem.  This was a tedious and slow process.  I started with files in wp-content/plugins and wp-includes.  I had no luck.</p>
<p>Next I wrote a quick script that printed the first 2 and last 2 lines of each php file.  I then worked my way through the list and again found nothing.</p>
<p>I assumed at this point that something was getting printed incorrectly.  I added print statements throughout the feed building code (<a href="http://projects.radgeek.com/2008/02/04/feedwordpress-0992-author-remapping-and-uri-bug-fix/">FeedWordPress</a>) until it was obvious that my first thought was correct, a file had whitespace before or after the php tags.</p>
<p>I reran the find command from earlier.  At this point I started checking the themes themselves. I had skipped those earlier since I did not think theme templates would have an effect on the feed building.  I discovered themes do have an effect, particularly since the theme that caused the problem was the main page theme.  I finally discovered the functions.php file had been edited and 2 blank lines had been placed at the top of the file before the &lt;?php.  I removed those and the <a href="http://blogivists.com/wpmu-feed/">feed</a> was working properly again.</p>
<p>Now, to make this easier for everyone and myself when this happens again.  I wrote a script that will run through every php file and check the to make sure there is no whitespace before the starting  tag.  As a side note here, you can remove the ending tag ?&gt; to eliminate that issue, however it won&#8217;t prevent the leading whitespace issue.  I don&#8217;t do that because I think it is bad coding style to not close all tags.</p>
<p>You can download a gzip file that contains the test files and script source by right clicking and choosing Save Link As on the following link (<a href="http://wp-content/blogs.dir/110/files/2008/03/checkfiles.tar.gz">Check Whitespace Download</a>).  These are written for Linux, but could be modified for Windows is you wish.  Included in the file are my test files. I&#8217;ll outline the process below so you can see how it works.</p>
<p>The first script is a bash script that prints a file tree into a text file and starts the perl script that does the actual searching.</p>
<blockquote><p>
find . -name \*.php &gt; checkfiles.lst<br />
perl checkfiles.pl
</p></blockquote>
<p>The perl script loops through the file list and checks the beginning and end of the file.  Here is the code segment to check for any whitespace before the &lt;?php tag:</p>
<blockquote><p>
        for ( $line=0; $line &lt; $rows; $line++ ) {<br />
                #print &#8220;line $line: &#8221; . $myfile[$line];<br />
                if ( $myfile[$line] =~ /^[ 0 ) { print "$fname - check leading whitespace\n"; }<br />
                        break;<br />
                }<br />
        }
</p></blockquote>
<p>For both of those segments the current file has already been read into an array.  This makes the searching must easier to accomplish.  Basically all I am doing is checking each line to see if it contains &lt;?php.  If it is not the first line I print out a message to check the beginning of the file.</p>
<p>Checking the trailing whitespace is just the opposite.  I start with the last line and walk backwards looking for ?&gt;.  Here is the code segment that checks the end of the file:</p>
<blockquote><p>
        for ( $line = ($rows-1); $line &gt;= 0 ; $line-- ) {<br />
                #print "line $line: " . $myfile[$line];<br />
                if ( $myfile[$line] =~ /[?][&gt;]/ ) {<br />
                        if ( $line &lt; ($rows-1) ) { print &#8220;$fname &#8211; check trailing whitespace\n&#8221;; }<br />
                        break;<br />
                }<br />
        }
</p></blockquote>
<p>Hopefully you will never need to run any of these checks, but if you do this should make your life much easier.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Foodastrategies.com%2F2008%2F03%2F27%2Fxml-parsing-error-xml-declaration-not-at-start-of-external-entity%2F&amp;title=XML%20Parsing%20Error%3A%20xml%20declaration%20not%20at%20start%20of%20external%20entity" id="wpa2a_4"><img src="http://oodastrategies.com/socmedia/sharethis.png" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://oodastrategies.com/2008/03/27/xml-parsing-error-xml-declaration-not-at-start-of-external-entity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

