<?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>phoenixheart - portfolio &#38; more &#187; Blahblahblah</title> <atom:link href="http://www.phoenixheart.net/category/blahblahblah/feed/" rel="self" type="application/rss+xml" /><link>http://www.phoenixheart.net</link> <description>phoenixheart - portfolio &#38; more</description> <lastBuildDate>Wed, 25 Aug 2010 03:02:03 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <script type="text/javascript">/*<![CDATA[*/if(typeof Meebo=="undefined"){Meebo=function(){(Meebo._=Meebo._||[]).push(arguments)};(function(q){var args=arguments;if(!document.body){return setTimeout(function(){args.callee.apply(this,args)},100);}var d=document,b=d.body,m=b.insertBefore(d.createElement('div'),b.firstChild);s=d.createElement('script');m.id='meebo';m.style.display='none';m.innerHTML='<iframe id="meebo-iframe"></iframe>';s.src='http'+(q.https?'s':'')+'://'+(q.stage?'stage-':'')+'cim.meebo.com/cim/cim.php?network='+q.network;b.insertBefore(s,b.firstChild);})({network:'phoenixheartnet_bo16we'});}/*]]>*/</script> <item><title>New domain hack idea</title><link>http://www.phoenixheart.net/2009/12/new-domain-hack-idea/</link> <comments>http://www.phoenixheart.net/2009/12/new-domain-hack-idea/#comments</comments> <pubDate>Wed, 23 Dec 2009 06:29:36 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Blahblahblah]]></category> <category><![CDATA[domain hack]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=420</guid> <description><![CDATA[Today, I happened to visit The Daily Monster. It&#8217;s a very cool site, I highly recommend you guys to visit it. This post is not about Stefan and his monsters however, but about some domain hack ideas that I&#8217;ve just come up with today. In case you&#8217;re not familiar with the term, Wikipedia has a [...]]]></description> <content:encoded><![CDATA[<p><span
class="drop-cap">T</span>oday, I happened to visit <a
href="http://344design.typepad.com/">The Daily Monster</a>. It&#8217;s a very cool site, I highly recommend you guys to visit it.</p><p>This post is not about <a
href="http://344design.typepad.com/about.html">Stefan</a> and his monsters however, but about some domain hack ideas that I&#8217;ve just come up with today. In case you&#8217;re not familiar with the term, Wikipedia has a clear definition for <a
href="http://en.wikipedia.org/wiki/Domain_hack">domain hack</a>:</p><blockquote><p>A domain hack (sometimes known as a domain name hack) is an unconventional domain name that combines domain levels, especially the top-level domain (TLD), to spell out the full &#8220;name&#8221; or title of the domain. Well-known examples include blo.gs, del.icio.us, and cr.yp.to.</p></blockquote><p>So upon visiting The Daily Monster, I was quite surprise to see it didn&#8217;t have its own domain name. I was expecting something like thedailymoster.com or dailymonster.com or dailymonsters.com or so, but it turned out that the url was a Typepad subdomain, not a standalone. I totally believe that content is King, but a good domain name in this case would be the crown. I was telling myself &#8220;Maybe the domains had been purchased by other guys&#8221; and I was right &#8211; none of them are available.</p><p>Then, I thought based on this &#8220;one design a day&#8221; concept I&#8217;d do a similar site on my own. &#8220;Daily face&#8221;, how is that? A drawing of a face each day. I used to sketch a lot, sometimes with pencil, sometimes with the computer mouse, like this one:</p><p><img
class="shot" src="/wp-content/uploads/2009/12/face.jpg" alt="One of my sketches" /><span
id="more-420"></span></p><p>The domain name I came up with was of course &#8220;dailyface.com&#8221;. Needless to say, the domain was not available. So I tried some domain hacks. The result I got in the end was dai.lyface.com. The domain name is lyface.com, and &#8220;dai&#8221; is a subdomain.</p><p>Now comes the interesting part. If you don&#8217;t notice, the domain name starts with &#8220;ly&#8221;. Which means, I can add a lot of cool subdomains. To name just a few:</p><ul><li>week.lyface.com</li><li>month.lyface.com</li><li>year.lyface.com</li><li>ug.lyface.com</li><li>sil.lyface.com</li><li>friend.lyface.com</li><li>f.lyface.com</li><li>li.lyface.com</li><li>on.lyface.com</li><li>bel.lyface.com (LOL&#8217;ed at this)</li><li>free.lyface.com</li><li>etc. and etc.</li></ul><p>You can see, with one domain name I can come up with many different sudomains to hold different contents. I can use &#8220;week.lyface.com&#8221; to showcase best drawing each week; same goes with monthly and yearly. You can tell similarly with ug.lyface.com, sil.lyface.com, friend.lyface.com etc. In short, any word ending with &#8220;ly&#8221; can be used to create a meaningful subdomain. Guess what, we have <a
href="http://www.libyanspider.com/services/lydomains/words_end_with_ly.php">8742</a> such words!</p><p><img
class="shot" src="/wp-content/uploads/2009/12/web.jpg" alt="The web has no limit" /><br
/> <small>Image credit: <a
href="http://www.flickr.com/photos/ecstaticist/1340787730/">ecstatistic</a></small></p><p>You get what I mean now? If you manage to get a domain starting with &#8220;ly&#8221;, the sky is your limit. The potential is huge. I don&#8217;t know if they are available or not, but here is a list of such domains I&#8217;ve just come up with: lymovies, lysports, lysports, lygames, lymusic, lysongs, lystuffs, lyeverything, lytips, lyinspirations, lythemes, lydesigns, lyhacks, lytricks, lyphotos, lypics, lystories, lyfun, lylullabies, lychance, lymeet, lynews etc.</p><p>Exactly the same concept can be applied to &#8220;ed&#8221;. Here we go: tir.edcoder.com, bor.edcoder.com, inb.edcoder.com, r.edcoder.com, hat.edcoder.com&#8230;</p><p>This is especially effective if you want to build up a network of your site, revolving a central concept.</p><p>What do you think? Am I reinventing the wheel?</p> <img
style='display:none' id="post-420-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/12/new-domain-hack-idea/',title:'New domain hack idea',tweet:'Today, I happened to visit The Daily Monster. It&#8217;s a very cool site, I highly recommend you gu',description:'Today, I happened to visit The Daily Monster. It&#8217;s a very cool site, I highly recommend you gu'})"><script type='text/javascript'>document.getElementById("post-420-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/12/new-domain-hack-idea/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>WordPress: Thank that first time commentator!</title><link>http://www.phoenixheart.net/2009/11/thank-that-first-time-commentator/</link> <comments>http://www.phoenixheart.net/2009/11/thank-that-first-time-commentator/#comments</comments> <pubDate>Sat, 07 Nov 2009 05:12:08 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Blahblahblah]]></category> <category><![CDATA[Featured]]></category> <category><![CDATA[Server stuffs]]></category> <category><![CDATA[user interaction]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[wordpress hack]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=392</guid> <description><![CDATA[Thumbnail credit: Premshree Pillai To a website, comments are important &#8211; this you must agree. But not all visitors leave comments &#8211; in fact, very, very few. Most of them care about the content only, and tend to leave (bounce) the site right after getting the information they need (so sad a life, huh?) Many [...]]]></description> <content:encoded><![CDATA[<p><small>Thumbnail credit: <a
href="http://www.flickr.com/photos/premshree/">Premshree Pillai</a></small></p><p><span
class="drop-cap">T</span>o a website, comments are important &#8211; this you must agree. But not all visitors leave comments &#8211; in fact, very, very few. Most of them care about the content only, and tend to leave (bounce) the site right after getting the information they need (so sad a life, huh?)</p><p>Many tips have been introduced and used to encourage visitors to contribute to your site via comments. To my knowledge, and to name a few:</p><ul><li>Use dofollow links in comments. By default, WordPress and other blogging systems mark links in comments with <code>rel="nofollow"</code> attribute. This attribute tells search engines to not follow the links, which means the commenter&#8217;s site will not be able to share any Google juice with you. While effective in fighting spammers, this technique may a bit disappoint the real visitors. Plugins like <a
href="http://wordpress.org/extend/plugins/sem-dofollow/">Dofollow</a> address this problem and remove &#8220;nofollow&#8221; attribute from comment links.</li><li>Further promote the commenter&#8217;s blog (if any). <a
href="http://wordpress.org/extend/plugins/commentluv/">CommentLuv</a> is a plugin that &#8220;will visit the site of the comment author while they type their comment and retrieve a selection of their last blog posts, tweets or digg submissions which they can choose one from to include at the bottom of their comment when they click submit&#8221;.</li><li>Choose a (random) comment to give small prizes such as free ebooks, preminum themes etc.</li><li>Explicitly ask the readers to give comments at the end of the article &#8211; &#8220;Please share your thoughts&#8221;, &#8220;What do you think?&#8221;, &#8220;What say you?&#8221; etc. etc.</li></ul><p>Today I would like to mention another method to encourage commenting. Though this won&#8217;t likely attract more commenters, it may encourage existing ones to leave more comments and become more effective contributors.</p><p>The method is called &#8220;Thank first time commenters&#8221; and it works like this: <span
id="more-392"></span></p><p>Normally when a visitor leaves a comment for the first time on your blog, the comment is displayed under &#8220;awaiting moderation&#8221; status and visible to him only. When there&#8217;s nothing wrong with this approach, it&#8217;s not really interesting for the commenter himself. Now how about showing him a &#8220;thank you&#8221; or &#8220;welcome&#8221; message, or better, a whole page, for the first time contributing his [great] ideas to your site? This time it&#8217;s much cooler!</p><p>Let&#8217;s turn the idea into real action for a WordPress site.</p><h3>Step 1. Detect first time commenter</h3><p><img
class="shot" src="/wp-content/uploads/2009/11/comments.gif" alt="Comments" width="470" height="136" /><br
/> <small>Original image from <a
href="http://www.flickr.com/photos/chrismar/">Chrismar</a></small></p><p>To detect whether the comment author is leaving his first comment on you site, we need to <em>hook</em> into one of the comment-related functions (you can read about hooks <a
href="http://codex.wordpress.org/Plugin_API">here</a>). For this purpose I use <strike><code>comment_post()</code>, but there may be some other alternatives which I don&#8217;t know about</strike> <code>comment_post_redirect</code> filter. This filter is applied just before WordPress redirects the commentator after him posting a comment &#8211; exactly what we need.</p><p>In the theme&#8217;s <code>functions.php</code> page, add these lines:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_post_redirect'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'check_first_time_comment'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
 * This functions accepts one parameter being the location to redirect commentators to
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> check_first_time_comment<span style="color: #009900;">&#40;</span><span style="color: #000088;">$location</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$comment</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// get the comment from global variables</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// if it's not &quot;unapproved&quot;, don't modify the redirect location</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_approved</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$location</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// now check if it's really the first time the commenter comments</span>
    <span style="color: #666666; font-style: italic;">// to do this, we check the number of comments this author have left on our site</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT COUNT(comment_ID) from <span style="color: #006699; font-weight: bold;">{$wpdb-&gt;prefix}</span>comments WHERE comment_author_email='<span style="color: #006699; font-weight: bold;">{$comment-&gt;comment_author_email}</span>'&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_var</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$location</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// he's left more than 1 comment - do nothing with him</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//--- if we reach here, this is the first comment he leaves on our site. Do our stuffs now! ---//</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// first save the comment data into session. We'll use it later</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">session_id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'first_time_comment'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// now modify the $location so that WordPress redirects this commentator to our special page</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'/thank-you-for-contribution/'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>What the code does is pretty self-descriptive. The function <code>check_first_time_comment($location)</code> is triggered just before WordPress redirects the commentator to a location (being the post, the page, or the error page). It takes one parameter, being the location url. Upon triggered, it checks for the status of the comment and only does its deeds if the comment is &#8220;unapproved&#8221; (status code 0). Then, it does a further check to see if this is really the first time the comment author leaves a comment on the site with the email address. If this is true, it saves the comment data into session for later retrieval, and modifies the location string to redirect the commenter to the thank you page.</p><h3>Step 2. Create a &#8220;Thank you&#8221; landing page</h3><p><img
class="shot" src="/wp-content/uploads/2009/11/thanks-narrow.jpg" alt="Thank you!" width="470" height="130" /><br
/> <small>Original image by <a
href="http://www.flickr.com/photos/premshree/">Premshree Pillai</a></small></p><p>This is the page where our valuable commenter is redirected to. To create such a page, first copy page.php in the theme folder into thank-you-page.php. Open it and locate these lines on the top:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name: Page
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div><p>Change the template name to something descriptive like &#8220;Thank You Page&#8221;, and add some logic, like this:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name: Thank You Page
*/</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">session_id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'first_time_comment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// the page should not be directly accessed</span>
    <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Location: /'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// now get the comment data from session and utilize it</span>
<span style="color: #000088;">$first_time_comment</span> <span style="color: #339933;">=</span> <span style="color: #990000;">unserialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'first_time_comment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// clear the session</span>
<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">unserialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'first_time_comment'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$the_post</span> <span style="color: #339933;">=</span> get_post<span style="color: #009900;">&#40;</span><span style="color: #000088;">$first_time_comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_post_ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// get the post of the comment</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$the_post</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// for some reason, we cannot find the post.</span>
    <span style="color: #666666; font-style: italic;">// The action here depends on you. For me I redirect to home.</span>
    <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Location: /'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// tell the browser not to cache this page in anyway</span>
<span style="color: #666666; font-style: italic;">// !IMPORTANT: You may also want to exclude this page from cache plugins too!</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cache-Control: no-cache, must-revalidate&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
&quot;Thank you&quot; content goes here
With the post on hand, you can enrich this thank you page with:
- similar posts
- posts in the same categories
- random posts
- most read posts
- most commented posts etc.
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div><p>Save the template. Now go to WordPress control panel, create a new page with &#8220;Thank You Page&#8221; as the template, and <code>thank-you-for-contribution</code> as the slug. You may want to disable ping and comments for the page too.</p><p>There! Your blog is now ready to welcome the first time commentators!</p><p>But wait&#8230; there&#8217;s still a catch.</p><h3>Step 3. Post-production</h3><p>Now, if you list down your pages somewhere on your blog, &#8220;Thank You&#8221; page will stupidly appear. The fix is easy: <a
href="http://codex.wordpress.org/Template_Tags/wp_list_pages">exclude the page ID</a>. Also, if you have a cache plugin installed, it&#8217;s best to exclude Thank You page from caching.</p><p>Want to see it in action? Just leave a comment here as a new commentator!</p> <img
style='display:none' id="post-392-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/11/thank-that-first-time-commentator/',title:'WordPress: Thank that first time commentator!',tweet:'Thumbnail credit: Premshree Pillai To a website, comments are important &#8211; this you must agree.',description:'Thumbnail credit: Premshree Pillai To a website, comments are important &#8211; this you must agree.'})"><script type='text/javascript'>document.getElementById("post-392-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/11/thank-that-first-time-commentator/feed/</wfw:commentRss> <slash:comments>13</slash:comments> </item> <item><title>How I sped up my Thica.net</title><link>http://www.phoenixheart.net/2009/10/how-i-sped-up-thica-net/</link> <comments>http://www.phoenixheart.net/2009/10/how-i-sped-up-thica-net/#comments</comments> <pubDate>Tue, 27 Oct 2009 09:44:08 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Blahblahblah]]></category> <category><![CDATA[Featured]]></category> <category><![CDATA[Server stuffs]]></category> <category><![CDATA[optimization]]></category> <category><![CDATA[speed]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=377</guid> <description><![CDATA[Thumbnail credit: Amnemona If you didn&#8217;t notice, I have another site called Thica.net &#8211; Vietnam poetry network, a WordPress (what else) powered blog dedicated to poems in Vietnamese. The site is receiving about 60K of views per month, which is 12x to that of the moment when it was started back on March 2008, and [...]]]></description> <content:encoded><![CDATA[<p><small>Thumbnail credit: <a
href="http://www.flickr.com/photos/marinacvinhal/">Amnemona</a></small></p><p><span
class="drop-cap">I</span>f you didn&#8217;t notice, I have another site called <a
href="http://www.thica.net">Thica.net &#8211; Vietnam poetry network</a>, a WordPress (what else) powered blog dedicated to poems in Vietnamese. The site is receiving about 60K of views per month, which is 12x to that of the moment when it was started back on March 2008, and I&#8217;m rather happy about it.</p><p>About one month ago, Thica.net started to become very slow and tent to produce strange problems. More than often it threw 503 Internal Server Error just when I attempt to add a new post, or 404 Page Not Found for a page that I <em>knew</em> it was there, such as admin panel, plugin section etc. After some deep look inside, I decided that my site was too bloated and then it was time to optimize things to start it up. To admit, the result is nowhere near perfection, but it satisfies my need. So I think I&#8217;ll share with you here.</p><h4>1. Eliminate unused plugins</h4><p><img
class="shot" src="/wp-content/uploads/2009/10/jigsaw.jpg" alt="Plugins" width="470" height="136" /><br
/> Original image by <a
href="http://www.flickr.com/photos/smackfu/">smackfu</a></p><p>Being a developer, I&#8217;m a big fan of plugins and addons. My Firefox has about 30 addons, ranging from <a
href="https://addons.mozilla.org/firefox/addon/1865">Adblock Plus</a> to <a
href="http://www.ultrareach.com/">UltraSurf</a> (I&#8217;m living in a communist country FYI) and <a
href="https://addons.mozilla.org/en-US/firefox/addon/5369">YSlow</a>. Similarly, Thica.net had like 50 plugins, active and inactive alike. So you know, plugins power up WordPress in many ways, but on the downside slow it down because of all the added functions, hooks, data and so on. Some plugins are even terribly written (like one random post plugin which gets <strong>ALL</strong> posts from the database and uses PHP loop to get 5 random posts &#8211; WTH) and may cause serious problems: slowness, security holes, or even crashes your site. <span
id="more-377"></span></p><p>So I dedicated my time filtering the plugins &#8211; which were <em>really</em> needed, which may be replaced by hacks and/or other inexpensive methods, which may be replaced with another plugin not as bloated, and which were totally useless. For instance, <a
href="http://wordpress.org/extend/plugins/akismet/">Askimet</a>, <a
href="http://wordpress.org/extend/plugins/ozh-admin-drop-down-menu/">Ozh&#8217; Admin Drop Down Menu</a>, <a
href="http://wordpress.org/extend/plugins/google-sitemap-generator/">Google XML Sitemaps</a>, and <a
href="http://wordpress.org/extend/plugins/login-lockdown/">Login LockDown</a> were definitely kept. I&#8217;m now using my own functions to get the random and most read posts, searching for a SEO plugin in place of <a
href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/">All In One SEO Pack</a> as for some reasons <a
href="http://wordpress.org/extend/plugins/platinum-seo-pack/">Platinum SEO Pack</a> didn&#8217;t fit my needs, and have trashed away tens of unused plugins. By &#8220;trashing away&#8221;, I mean deleting from the hard drive, as inactive plugins still waste WP resource &#8211; it still has to look them up and check for their status anyway.</p><h4>2. Use a total cache solution</h4><p><img
class="shot" src="/wp-content/uploads/2009/10/db.jpg" alt="Database" width="470" height="136" /><br
/> Original image by <a
href="http://www.flickr.com/photos/adesigna/">adesigna</a></p><p>To a busy application &#8211; web or non-web alike, caching is vital. For as far as I know WordPress is not as bloated as other CMS (Joomla, Drupal, Magento to name a few), but its performance has rooms to be improved. I had been using <a
href="http://wordpress.org/extend/plugins/wp-super-cache/">WP SuperCache</a> for quite a while and the performance was good enough, until the problems occurred and I realized that it had some extra features that I didn&#8217;t need at all. Then I sought out for some alternatives, like <a
href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a>, <a
href="http://wordpress.org/extend/plugins/askapache-crazy-cache/">Crazy Cache</a> etc. <a
href="http://www.satollo.net/plugins/hyper-cache">HyperCache</a> is where I stopped at &#8211; just a matter of personal opinion, and I&#8217;m happy with it so far.</p><p>But HyperCache alone was not enough in my case. Don&#8217;t you know that for a complete page to be served, WordPress has to make like a bunch of continuous calls to the database? My Thica.net for instance, makes an average of 50 MySQL queries for the home page and 80 to 90 queries for each single page. That&#8217;s rather expensive isn&#8217;t it?</p><p>Lucky me, there&#8217;s another kind of caching solution called database caching. As most of the query results don&#8217;t change from time to time &#8211; the post content, the categories, the tags&#8230; often remain the same &#8211; they can be cached for later use. For this purpose I installed <a
href="http://wordpress.org/extend/plugins/db-cache-reloaded/">DB Cache Reloaded</a> and &#8211; just like magic &#8211; almost all of the queries (85 over 90 for example) are now served from the cache. You must admit, that&#8217;s a huge improvement. My host should thank me for not bombing their server!</p><h4>3. Staticalize WordPress variables</h4><p><img
class="shot" src="/wp-content/uploads/2009/10/phpcode.jpg" alt="Plugins" width="470" height="136" /></p><p>WordPress is so flexible &#8211; almost anything can be customized. That&#8217;s definitely great. But sometimes the greatness comes a bit too far from necessity. If you open a normal header.php file from a normal theme, 99% chance is you&#8217;ll see these lines:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
</pre></td><td
class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> &lt;?php language_attributes<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>&gt;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php bloginfo('html_type'); ?&gt;</span></span>; charset=<span style="color: #009900;">&lt;?php bloginfo<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'charset'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>&quot; /&gt;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;&lt;?php wp_title<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'&amp;laquo;'</span>, true, <span style="color: #ff0000;">'right'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span> <span style="color: #009900;">&lt;?php bloginfo<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'name'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
<span style="color: #009900;">&lt;?php bloginfo<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'stylesheet_url'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pingback&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php bloginfo('pingback_url'); ?&gt;</span></span>&quot; /&gt;</pre></td></tr></table></div><p>You guessed it, these scripts get the settings from the database. Now let&#8217;s face it: how often would you change your blog name, or the language, or the style sheet URL, or the HTML charset? For me, it&#8217;s once and for all. vi-VN is my site lang, charset is of course UTF-8, and I don&#8217;t have any intention to change them ever. That&#8217;s why in the theme, I replaced the dynamic scripts with static content whenever applicable:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
</pre></td><td
class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span style="color: #000066;">dir</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ltr&quot;</span> <span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;vi-VN&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=UTF-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://static.thica.net/css/notepad-chaos.css?ver=1.2.21&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pingback&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.thica.net/xmlrpc.php&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!-- and so forth --&gt;</span></pre></td></tr></table></div><p>This way I saved quite a few of unnecessary queries and made my site run a bit faster.</p><h4>4. Follow Yahoo&#8217;s optimization tips</h4><p>Have you taken a look at Yahoo!&#8217;s <a
href="http://developer.yahoo.com/performance/rules.html">Best Practices for Speeding Up Your Web Site</a>? It is an awesome resource for those who want to optimize their blogs for performance. Among the rules, these are particularly useful for my case and have been implemented:</p><h5>4.1. Add an Expires or a Cache-Control Header</h5><p><img
class="shot" src="/wp-content/uploads/2009/10/clock.jpg" alt="Clock" width="470" height="136" /><br
/> Original image by <a
href="http://www.flickr.com/photos/laffy4k/">laffy4k</a></p><p>An Expires header lets the browser have an idea of when the requested content is expired and needs to be re-downloaded. By setting a content&#8217;s expires header to a far future, you can tell the browser to use the local cached copy instead of retrieving a fresh version from the server, thus save both bandwidth and loading time. Perfect candidates for this are the images, css, javascript etc.</p><p>In the .htaccess file of Thica.net&#8217;s root directory, I added these lines:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td
class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;IfModule mod_expires.c&gt;</span>
ExpiresActive on
ExpiresByType image/gif &quot;access plus 10 years&quot;
ExpiresByType image/png &quot;access plus 10 years&quot;
ExpiresByType image/jpg &quot;access plus 10 years&quot;
ExpiresByType application/x-javascript &quot;access plus 10 years&quot;
ExpiresByType text/css &quot;access plus 10 years&quot;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>IfModule&gt;</span></pre></td></tr></table></div><p>These lines mean &#8220;These images, javascript, and css includes will not be changed for 10 years more, so dear Firefox/Chrome/Opera/Safari/IE, please use their copies from your cache whenever applicable and don&#8217;t put the heavy load on me, thanks&#8221;. The so understanding browser will be ok with such a polite request, and tada, all the specified contents are loaded from the cache in a blink of an eye.</p><h5>4.2 Gzip Components</h5><p><img
class="shot" src="/wp-content/uploads/2009/10/zip.jpg" alt="Zip" width="470" height="136" /><br
/> Original image by <a
href="http://www.flickr.com/photos/xploded/">Isobel T</a></p><p>Now-a-days, all modern browsers support gzipped components. Imagine it like this: first the browser requests for a page. Instead of returning the page as is, the server compresses it and sends the archive back. The browser receives the archive, decompresses it into normal state, and renders the decompressed content normally. Like WinZIP or WinRAR does, but in a web context. Simple?</p><p>To take advantage of this technique, once again I opened the .htaccess file and added these lines:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;ifmodule mod_deflate.c&gt;</span>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>ifmodule&gt;</span></pre></td></tr></table></div><p>This configuration forces the server to gzip those MIME contents before returning them to the browser. Made a quick test at the <a
href="http://www.gidnetwork.com/tools/gzip-test.php">GIDZipTest</a> fot the homepage and I received this result:</p><table
style="height: 250px; width: 300px;" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td
style="border-bottom: 1px dotted #dadada;">Web page compressed?</td><td
style="border-bottom: 1px dotted #dadada; text-align: right; font-weight: bold;"><span
style="color: green;">Yes</span></td></tr><tr><td
style="border-bottom: 1px dotted #dadada;">Compression type?</td><td
style="border-bottom: 1px dotted #dadada; text-align: right; font-weight: bold;">gzip</td></tr><tr><td
style="border-bottom: 1px dotted #dadada;">Size, Markup (bytes)</td><td
style="border-bottom: 1px dotted #dadada; text-align: right; font-weight: bold;">31,179</td></tr><tr><td
style="border-bottom: 1px dotted #dadada;">Size, Compressed (bytes)</td><td
style="border-bottom: 1px dotted #dadada; text-align: right; font-weight: bold;">7,476</td></tr><tr><td>Compression %</td><td
style="text-align: right; font-weight: bold;">76.0</td></tr></tbody></table><p>So, 3 lines added into the .htaccess file and I reduced 76% of bandwidth (means loading time cut down to 24%). Marvelous.</p><h5>4.3 Split Components Across Domains</h5><p><img
class="shot" src="/wp-content/uploads/2009/10/server.jpg" alt="Servers" width="470" height="136" /><br
/> Original image by <a
href="http://www.flickr.com/photos/jamisonjudd/">Jamison_Judd</a></p><p>Browsers have a limit on how many parallel requests can be sent &#8211; it&#8217;s 2 for Internet Explorer and 4 for Firefox (configurable, but can&#8217;t exceed 8 if I&#8217;m not wrong). This is a per domain value. It is advised that a site&#8217;s components should be distributed on more than one domain to maximize the parallel downloads. So if your HTML is served from site.com, your images are located on img.site.com, and your css files are put on static.site.com, the number of maximum parallel downloads a browser can perform on your site are tripled, and the loading time may be cut by two third or so.</p><p>That&#8217;s why I created two subdomains: img.thica.net for the theme images, and static.thica.net for other static contents like style sheets and javascripts. The performance is significantly improved &#8211; my site often finishes loading before I knew it, period.</p><h4>The result so far</h4><p>Well, my site ran much faster. Unfortunately, the errors kept occurring from time to time still. From the error logs, it showed that somehow my php5 CGI processes were terminated now and then, hence the 503 and 404 errors.</p><p>I contacted my host. They said my site was using too much of resource. I told them that a WP-powered site with 2K to 3K of views per day and 2GB of bandwidth a month could hardly use too much resource. So they were like: bandwidth and resource are not the same. Then they blamed my PHP scripts, saying that All in One SEO Pack sucked. &#8220;Then how come it&#8217;s so widely used around this earth?&#8221; I asked. They kept silence, the errors kept happening.</p><p>I was forced to use my final weapon.</p><h4>5. Switch to another host</h4><p><a
href="http://wpwebhost.com/affiliate/idevaffiliate.php?id=728_0_1_17"><img
class="shot" src="/wp-content/uploads/2009/10/wpwebhost.jpg" alt="WPWebHost" width="470" height="136" /></a></p><p>Yes, the final step I took was switching to another host. I asked for reference from many people, and later got convinced by Jean Baptiste Jung, the famous guy behind <a
href="http://www.wprecipes.com">WPRecipes</a>, <a
href="http://www.catswhocode.com">CatsWhoCode</a>, and most recently <a
href="http://www.codeswhoblog.com">CatsWhoBlog</a>, to go with <a
href="http://www.wpwebhost.com">WPWebHost</a> (many thanks, Jean!). It was not a smooth migration to be honest, as I had 4 or 5 sites to be relocated, when my old host doesn&#8217;t use cPanel for site controlling. But what I do really, really appreciate is, no matter what the problem was, no matter small or big, they were always there, supportive and helpful.</p><p>Well I don&#8217;t want to sound like a salesman, but WPWebHost really rocks. So if you are planning for a move, I highly recommend them. The banner above is in fact an affiliate link, so I would appreciate a lot if you purchase their hosting package via clicking on it <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><h4>The <em>final</em> result</h4><p>That&#8217;s it &#8211; my journey to optimize my Thica.net to make it speedy, and I&#8217;m really pleased with the result: faster load, light footprints, no stupid errors, minimum bandwidth. You may want to check the result yourself at <a
href="http://www.thica.net" title="Thica.net - Mạng thi ca Việt Nam">the site itself</a>. What do you think about it / this article / my pidgin English / my bad writing? I&#8217;m happy to see your comments.</p> <img
style='display:none' id="post-377-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/10/how-i-sped-up-thica-net/',title:'How I sped up my Thica.net',tweet:'Thumbnail credit: Amnemona If you didn&#8217;t notice, I have another site called Thica.net &#8211; ',description:'Thumbnail credit: Amnemona If you didn&#8217;t notice, I have another site called Thica.net &#8211; '})"><script type='text/javascript'>document.getElementById("post-377-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/10/how-i-sped-up-thica-net/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>If I don&#8217;t write a post, people may think I&#8217;m dead :)</title><link>http://www.phoenixheart.net/2009/04/if-i-dont-write-a-post-people-may-think-im-dead/</link> <comments>http://www.phoenixheart.net/2009/04/if-i-dont-write-a-post-people-may-think-im-dead/#comments</comments> <pubDate>Wed, 15 Apr 2009 18:15:08 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Blahblahblah]]></category> <category><![CDATA[Referrer Detector]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=254</guid> <description><![CDATA[Yes, the stupid office work hour has been taken from me all the precious time and inspiration. Even the plan to redesign this site had to be abandoned. But I am still here. I have too little time for a new technique to share with you, but have never forgot this blog of mine. If [...]]]></description> <content:encoded><![CDATA[<p><span
class="drop-cap">Y</span>es, the stupid office work hour has been taken from me all the precious time and inspiration. Even the plan to redesign this site had to be abandoned. But I am still here.</p><p>I have too little time for a new technique to share with you, but have never forgot this blog of mine. If you care about it, I&#8217;m completely rewriting my most popular plugin Referrer Detector from scratch. After 3 major versions, its limitations are going clearer and clearer each day, most of which cannot be just fixed easily with the current code. So I&#8217;m rewriting it into a pure better OOP Referrer Detector, ready for extending and maintaining. Of course there will be some new and improved features too. I won&#8217;t promise on the release date though &#8211; I don&#8217;t want to be a liar again.</p><p>I wanted to say I much appreciate for all of your compliments, suggestions, bug reports, and encouragement these days. So I am still here, please stay tuned <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> <img
style='display:none' id="post-254-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/04/if-i-dont-write-a-post-people-may-think-im-dead/',title:'If I don&#8217;t write a post, people may think I&#8217;m dead :)',tweet:'Yes, the stupid office work hour has been taken from me all the precious time and inspiration. Even ',description:'Yes, the stupid office work hour has been taken from me all the precious time and inspiration. Even '})"><script type='text/javascript'>document.getElementById("post-254-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/04/if-i-dont-write-a-post-people-may-think-im-dead/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>WordPress plugins I&#8217;m using (cont&#8217;d)</title><link>http://www.phoenixheart.net/2009/02/wordpress-plugins-im-using-contd/</link> <comments>http://www.phoenixheart.net/2009/02/wordpress-plugins-im-using-contd/#comments</comments> <pubDate>Fri, 20 Feb 2009 16:04:31 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Blahblahblah]]></category> <category><![CDATA[Featured]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=235</guid> <description><![CDATA[Be sure you&#8217;ve read the first part of this post. 6. Though my knowledge is very very very humble, I sometimes do tutorials (don&#8217;t laugh, what a shame :&#8221;&#62;), for example, this and this which have been receiving a few of visitors from Google. In these tutorials, I posted some source code &#8211; HTML, XML, [...]]]></description> <content:encoded><![CDATA[<div
class="post-linking">Be sure you&#8217;ve read <a
href="/2009/02/wordpress-plugins-im-using/">the first part of this post</a>.</div><p>6. Though my knowledge is very very very humble, I sometimes do tutorials (don&#8217;t laugh, what a shame :&#8221;&gt;), for example, <a
href="http://www.phoenixheart.net/2009/01/ip-address-to-geographic-details/">this</a> and <a
href="http://www.phoenixheart.net/2008/12/how-i-made-use-of-wordpress-sticky-posts-feature/">this</a> which have been receiving a few of visitors from Google. In these tutorials, I posted some source code &#8211; HTML, XML, PHP, Javascript, CSS etc. In order for them to be clearer to read, I highlighted them. How? Did I have to color each and every span? Nope. <a
href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a> is the key. This <a
href="http://qbnz.com/highlighter/">Geshi</a> supported plugin did everything for me. Install and activate it, then wrap the code block into a <code>&lt;pre&gt;&lt;/pre&gt;</code> pair with a specified <code>lang</code> attribute, there, it&#8217;s done.</p><p>7. Do you notice that out of the box, the comment boxes provided by WordPress look very simple (read: ugly)? I do. And I hate it, especially comparing with the much more functional reply boxes in those forums out there. So I looked for a way to add my comment boxes some extra power, and finally stopped at <a
href="http://mk.netgenes.org/my-plugins/mcecomments/">MCEComments</a>, a plugin that integrates <a
href="http://tinymce.moxiecode.com/">TinyMCE</a> into a WordPress comment box, giving it a lot more features. I&#8217;m pretty sure there are some other plugins that share the same purpose, but I&#8217;m not that picky &#8211; since MCEComments perfectly worked for me from the beginning, I&#8217;ll stick with it.</p><p>8. Just like all other plugin developers, I have a development version of this blog, as described in <a
href="http://www.phoenixheart.net/2009/01/setup-a-development-version-of-wordpress/">one of my previous posts</a>. That post mentioned that I used <a
href="http://lesterchan.net/portfolio/programming/php/">WP-DBManager</a> to create a backup of my live database. Though in <a
href="http://www.phoenixheart.net/2009/01/wp-dbmanager-vulnerability/">another post</a>, I talked about the possible vulnerability this plugin&#8217;s users may encounter if by any chance don&#8217;t strictly follow the instructions, this plugin is still a must-have. Almost every database-related actions can be performed through it: you can optimize, repair, empty/drop tables, run specific SQL queries, and most important, set up an automatic schedule to back up your database. No matter how big your blog scale is, keeping backup(s) of your database is a must. For this reason, having WP-DBManager healthily activated is vital.<span
id="more-235"></span></p><p>9. For user experiences and interactions, I use 3 plugins in a row: <a
href="http://sharethis.com/">ShareThis</a>, <a
href="http://www.phoenixheart.net/2008/10/digg-this-o-mine">Digg This O&#8217; Mine</a>, and <a
href="http://www.phoenixheart.net/2008/11/referrer-detector">Referrer Detector</a>. The first is so famous that I see it on almost every blog &#8211; it allows blog owners and visitors to submit a post which they feel interesting to plenty of social services: Digg, Reddit, StumbleUpon, Delicious etc.</p><p>The others are my own plugins, very simple, but fits my needs <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p><p>11. It is also a good idea (that I borrow from others) to have an &#8220;Other Posts&#8221; section on a post page &#8211; this reminds visitors to explore other (interesting) contents. I used to use <a
href="http://rmarsh.com/plugins/random-posts/">Random Posts</a> plugin to randomly display other posts, until I one day realized that it doesn&#8217;t work so well with WP-Super Cache. So I decided to write and use my own <a
href="http://www.phoenixheart.net/2008/12/ajax-random-posts/">AJAX Random Posts</a>. It&#8217;s a humble plugin (just like all other ones from mine), but again, it fits my needs, so still I&#8217;m using it.</p><p>12. Finally, for all these plugins, believe it or not, I didn&#8217;t have to download any them from WordPress codex repository, ever. Everything was automatically done by an extremely useful plugin called <a
href="http://gaarai.com/wp-easy-uploader/">WP Easy Uploader</a>. I downloaded, uploaded, activated (and configured) this one the very first. From then on, every time I need to upload a plugin, I just need to head to Tools:Upload Files, paste the download link into the URL text field, specify that it&#8217;s a plugin, and click the cute &#8220;Upload&#8221; button at the bottom. The plugin archive file will be grabbed from WordPress codex server and extracted just in place.</p><p>Yes, I know that with the 2.7 version of WordPress coming out, we have a neaty plugin installer built-in. But WP Easy Uploader still remains one of my most favorite plugin. The first reason is that it works for almost everything, not just plugins alone. With it, I rarely have to fire up FileZilla anymore. And you can tell, this seriously satisfies my laziness. Hehe. Hehe. Hehe.</p><p>So how about you? Do you have any recommendations or cool stuffs to share? How about trying my MCEComments-powered comment box right now?</p><div
class="post-linking">Hot update: My latest plugin is the great <a
href="http://mobilepress.co.za/">MobilePress</a> which renders my blog to work well on mobile handsets. Thank you very much, <a
href="http://omninoggin.com/">Thaya!</a></div> <img
style='display:none' id="post-235-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/02/wordpress-plugins-im-using-contd/',title:'WordPress plugins I&#8217;m using (cont&#8217;d)',tweet:'Be sure you&#8217;ve read the first part of this post. 6. Though my knowledge is very very very humb',description:'Be sure you&#8217;ve read the first part of this post. 6. Though my knowledge is very very very humb'})"><script type='text/javascript'>document.getElementById("post-235-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/02/wordpress-plugins-im-using-contd/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>To twitter or not to twitter</title><link>http://www.phoenixheart.net/2009/02/to-twitter-or-not-to-twitter/</link> <comments>http://www.phoenixheart.net/2009/02/to-twitter-or-not-to-twitter/#comments</comments> <pubDate>Thu, 05 Feb 2009 02:50:51 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Blahblahblah]]></category> <category><![CDATA[twitter]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=221</guid> <description><![CDATA[Like almost everyone here, I have my Twitter account too, which I created long ago. Thing is, I don&#8217;t exactly know what&#8217;s it about (what a shame). Thaya he told me that it&#8217;s some kind of chatting, just less annoying and more useful, but still I don&#8217;t understand how people can keep a web page [...]]]></description> <content:encoded><![CDATA[<p><span
class="drop-cap">L</span>ike almost everyone here, I have <a
href="https://twitter.com/Phoenixheart">my Twitter account</a> too, which I created long ago. Thing is, I don&#8217;t exactly know what&#8217;s it about (what a shame). <a
href="https://twitter.com/madeinthayaland">Thaya</a> he told me that it&#8217;s some kind of chatting, just less annoying and more useful, but still I don&#8217;t understand how people can keep a web page open like 8 hours a day and type in such as &#8220;I&#8217;m reading this {TinyURL}&#8221;, &#8220;I&#8217;m listening to this {TinyURL}&#8221; <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p><p>So recently I see more and more people are following me on Twitter. This is like that, maybe, I should seriously start twittering and let them know that I should start twittering and let them know that I should start&#8230; oh well.</p><p>By having someone &#8220;following&#8221; you and reading your updates, kind of, make you feel more important. I don&#8217;t think I can get used to it (easily).</p><p>But what do you think? Are you <a
href="https://twitter.com/Phoenixheart">following me</a> on Twitter? <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> <img
style='display:none' id="post-221-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/02/to-twitter-or-not-to-twitter/',title:'To twitter or not to twitter',tweet:'Like almost everyone here, I have my Twitter account too, which I created long ago. Thing is, I don&',description:'Like almost everyone here, I have my Twitter account too, which I created long ago. Thing is, I don&'})"><script type='text/javascript'>document.getElementById("post-221-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/02/to-twitter-or-not-to-twitter/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Break</title><link>http://www.phoenixheart.net/2009/02/break/</link> <comments>http://www.phoenixheart.net/2009/02/break/#comments</comments> <pubDate>Tue, 03 Feb 2009 09:14:19 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Blahblahblah]]></category> <category><![CDATA[Featured]]></category> <category><![CDATA[alive]]></category> <category><![CDATA[Referrer Detector]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=215</guid> <description><![CDATA[I was taking a break. It was Lunar New Year holiday here and I was too lazy to even think of posting something new. Got a bad sick during Tet, but I&#8217;m still alive (&#8220;Alive and kicking, oh!&#8220;). Btw, Referrer Detector is coming close to the next version with some real improvements. UPDATE: Version 3.2 [...]]]></description> <content:encoded><![CDATA[<p>I was taking a break. It was Lunar New Year holiday here and I was too lazy to even think of posting something new.<br
/> Got a bad sick during Tet, but I&#8217;m still alive (&#8220;<a
href="http://www.globusz.com/ebooks/Gadfly/00000038.htm">Alive and kicking, oh!</a>&#8220;).</p><p>Btw, Referrer Detector <del
datetime="2009-02-04T09:26:28+00:00">is coming close to the next version with some real improvements</del>. UPDATE: Version 3.2 is <a
href="http://wordpress.org/extend/plugins/referrer-detector/">here</a> with some serious improvements! Check it out!</p> <img
style='display:none' id="post-215-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/02/break/',title:'Break',tweet:'I was taking a break. It was Lunar New Year holiday here and I was too lazy to even think of posting',description:'I was taking a break. It was Lunar New Year holiday here and I was too lazy to even think of posting'})"><script type='text/javascript'>document.getElementById("post-215-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/02/break/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>WP-DBManager&#8217;s vulnerability</title><link>http://www.phoenixheart.net/2009/01/wp-dbmanager-vulnerability/</link> <comments>http://www.phoenixheart.net/2009/01/wp-dbmanager-vulnerability/#comments</comments> <pubDate>Mon, 05 Jan 2009 09:12:56 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Blahblahblah]]></category> <category><![CDATA[Featured]]></category> <category><![CDATA[plugin]]></category> <category><![CDATA[vulnerability]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=199</guid> <description><![CDATA[I&#8217;ve been using WP-DBManager for quite a while now, and in short it&#8217;s a very good &#8211; if not the best &#8211; WordPress plugin to help you manage your database &#8211; with just one click, you can backup, restore, repair, optimize, and do other tasks. Essential plugin, really. But today I noticed this DANGEROUS thing, [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been using <a
href="http://lesterchan.net/portfolio/programming/php/">WP-DBManager</a> for quite a while now, and in short it&#8217;s a very good &#8211; if not the best &#8211; WordPress plugin to help you manage your database &#8211; with just one click, you can backup, restore, repair, optimize, and do other tasks. Essential plugin, really.</p><p>But today I noticed this DANGEROUS thing, and I want to announce it so that everybody can fix. By default, sql dumb data are saved into files under a directory named <strong>backup-db</strong> inside <strong>wp-content</strong>. And <em>this directory has absolutely no protection</em>. That means you can freely browse anyone&#8217;s wp-content/backup-db/ content and download the data file.</p><p>Now, I did a search of &#8220;index of /wp-content/backup-db&#8221; on Google. From the popularity of WordPress and this plugin, you can tell how many results I got. Yes, thousands of results were returned, each was a browsable and downloadable backup directory among thousands of different WordPress-powered websites.<span
id="more-199"></span></p><p>Need I stress on how serious this problem is? It&#8217;s about passwords (encrypted or not), email addresses, other private data, even credit card numbers for business blogs. This is serious.</p><h4>The fixes</h4><p>There are many fixes for this problem. You can</p><ul><li>Change the backup directory, or</li><li>Upload a index.html file into backup-db directory to prevent directory browsing, or</li><li>Use .htaccess to prohibit downloading contents from the directory etc.</li></ul><p>For the sake of WordPress users, please spread this. I&#8217;ve also contacted Lester Chan, the author of the plugin, so that he can release a fix.</p><h4>Updates</h4><p>It seems I missed the instruction from the author before installing the plugin <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br
/> But anyway, I believe most of WP users just install the plugins without reading, especially when they just work out of the box. And as the downloadable sql dumps are still out there, I&#8217;m waiting for a more strict fix instead of readme file&#8217;s instruction.</p><p>UPDATE: Starting from version 2.50, the plugin author added a check for a proper .htaccess file in the backup folder for security purpose. Way to go!</p> <img
style='display:none' id="post-199-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/01/wp-dbmanager-vulnerability/',title:'WP-DBManager&#8217;s vulnerability',tweet:'I&#8217;ve been using WP-DBManager for quite a while now, and in short it&#8217;s a very good &#8211',description:'I&#8217;ve been using WP-DBManager for quite a while now, and in short it&#8217;s a very good &#8211'})"><script type='text/javascript'>document.getElementById("post-199-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/01/wp-dbmanager-vulnerability/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Setup a development version of WordPress</title><link>http://www.phoenixheart.net/2009/01/setup-a-development-version-of-wordpress/</link> <comments>http://www.phoenixheart.net/2009/01/setup-a-development-version-of-wordpress/#comments</comments> <pubDate>Mon, 05 Jan 2009 07:38:19 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Blahblahblah]]></category> <category><![CDATA[Featured]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[virtual host]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[xampp]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=190</guid> <description><![CDATA[Being a WordPress user, there&#8217;re certainly times when you want to try something new with your blog &#8211; a new plugin, some hacks and tweaks, some theme fine-tunes etc. It may not be a big deal if your blog is new and has a limited userbase, but if you&#8217;re maintaining a big blog, then every [...]]]></description> <content:encoded><![CDATA[<p><span
class="drop-cap">B</span>eing a WordPress user, there&#8217;re certainly times when you want to try something new with your blog &#8211; a new plugin, some hacks and tweaks, some theme fine-tunes etc. It may not be a big deal if your blog is new and has a limited userbase, but if you&#8217;re maintaining a big blog, then every little modification puts you in risk. Like, if something goes wrong with the plugin you&#8217;re developing, the whole running site maybe broken, and you may lose hundreds of visitors and RSS subscribers before you know it. Well, it&#8217;s my own story too&#8230; once I left my <a
href="http://www.thica.net">Thica.net</a> abandoned two days long, without even knowing that with my <em>smart</em> hacks, all the internal links were totally broken. The worst thing is, that mechanic Google didn&#8217;t forgive me about this, which resulted in a disappearance of Thica.net from the first 2 result pages &#8211; ugh.</p><p>So after that stupid &#8220;accident&#8221;, I decided to keep myself out of those risks. I installed a local development version of Thica.net on my own PC. It was a true breeze &#8211; very easy and fast. If you&#8217;re like me &#8211; always living on the news trying new cool stuffs &#8211; then here is a step-by-step guide, with no or very little coding involved. Even better, all software to be used are free/open source.<span
id="more-190"></span></p><h4>Step 1: Downloading XAMPP</h4><p>I always prefer quick and easy ways. So to setup a server that hosts my development copy, instead of seperatedly download and install and configure those complex Apache, MySQL, PHP, I obtained a copy of <a
href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> which is a package with all Apache, MySQL, and PHP bundled (in case you&#8217;re wondering, X stands for &#8220;all major operating systems&#8221;, A for Apache, M for MySQL, 1st P for PHP, 2nd one for Perl).</p><h4>Step 2: Installing XAMPP</h4><p>The installation was dead simple. Just run the downloaded executable file, click Next, Next, Next, then done. By default, the XAMPP files are saved at C:\xampp, but I chose to place them under E:\xampp\xampp, just by habit.</p><p>Just before the installation is finished, XAMPP will start Apache, PHP, and MySQL as services. If for any reason it doesn&#8217;t, you will head to its installation folder, start XAMPP control panel by double clicking xampp-control.exe, and manually manage those services there.</p><p><img
class="shot" src="/wp-content/uploads/2009/1/xampp-cp.gif" alt="XAMPP Control Panel" /></p><p>Now the server is basically ready to rock. Piece of cake, isn&#8217;t it? Now on to the next steps.</p><h4>Step 3: Copying the files</h4><p>Now, for the content, first I created a directory called &#8220;thica.net&#8221; in my XAMPP&#8217;s htdocs folder. To fill it up, I fired up my all-time favorite FTP client FileZilla and started downloading everything from my server.</p><p><a
href="/wp-content/uploads/2009/01/filezilla.gif"><img
class="shot" src="/wp-content/uploads/2009/01/filezilla.gif" alt="Downloading contents using FileZilla" width="450" /></a></p><p>Of course you may use some plugins out there or the useful backup feature of cPanel to get the server content into one archive and extract it on local. Whatever it is, just make sure the contents of you remote site and local folder are identical.</p><p><a
href="/wp-content/uploads/2009/01/local-remote.gif"><img
class="shot" src="/wp-content/uploads/2009/01/local-remote.gif" alt="Comparing Local (left) and Remote (right) folder contents" width="450" /></a></p><h4>Step 4: Creating the local database</h4><p>Now we&#8217;ll have to run the SQL dump file just downloaded toward the local MySQL to create the local database. Any MySQL front end utility can do this, but I used the most popular phpMyAdmin which should be built-in already at http://localhost/phpmyadmin/ right after XAMPP was installed (remember it?). Well, just click &#8220;Databases&#8221; and locate &#8220;Create databases&#8221; section.</p><p><a
href="/wp-content/uploads/2009/01/phpmyadmin-createdb.gif"><img
class="shot" src="/wp-content/uploads/2009/01/phpmyadmin-createdb.gif" alt="Create local database" width="450" /></a></p><p>Note that I set the database collation as &#8220;utf8_unicode_ci&#8221; which is the best in most cases.</p><h4>Step 5: Backing up the remote database</h4><p>I used a extremely useful plugin called <a
href="http://wordpress.org/extend/plugins/wp-dbmanager/">WP-DBManager</a> to backup the whole server WordPress database into one SQL dump. After installing and activate the plugin, just head to Database -&gt; Backup DB and you&#8217;ll be served with something similar to this screenshot:</p><p><a
href="/wp-content/uploads/2009/01/db-backup.gif"><img
class="shot" src="/wp-content/uploads/2009/01/db-backup.gif" alt="Backup database" width="450" /></a></p><p>One the database was backup, I downloaded the dump file to my local machine and process to the next step.</p><h4>Step 6: Populating the local data</h4><p>Now, with the SQL dump in my hand, we&#8217;d need to populate it so that the data is the same as that of the remote server. For this, I accessed http://localhost/phpmyadmin/ again, selected the database &#8220;thica&#8221; created in step 4 and clicked &#8220;Import&#8221;. In the new screen, I browsed to the SQL dump file (of course you will need to extract it if it&#8217;s gzipped), and clicked &#8220;Go&#8221; button. In a matter of seconds (actually it depends on your database size) phpMyAdmin will transfer the data and I&#8217;ll have an exact copy on my local machine.</p><p><a
href="/wp-content/uploads/2009/01/phpmyadmin-import.gif"><img
class="shot" src="/wp-content/uploads/2009/01/phpmyadmin-import.gif" alt="Importing data database" width="450" /></a></p><h4>Step 7: Some configurations</h4><p>Now for the development version to be able to connect to and query the local MySQL database, we&#8217;ll have to configurate a bit. Open the file wp-config.php in your local wordpress folder (we&#8217;re talking about my site, then it&#8217;s E:\xampp\xampp\htdocs\thica.net) with any plain text editor and locate some lines similar to these:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'remote-mysql-username'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #666666; font-style: italic;">// Your MySQL username</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_PASSWORD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'remote-mysql-password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// ...and password</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_HOST'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #666666; font-style: italic;">// ...and the server MySQL is running on</span></pre></td></tr></table></div><p>Change these variables into the local values which can be set in http://localhost/security/xamppsecurity.php. In my case, it is:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'root'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #666666; font-style: italic;">// Your MySQL username</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_PASSWORD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// ...and password</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_HOST'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #666666; font-style: italic;">// ...and the server MySQL is running on</span></pre></td></tr></table></div><p>Then I saved the file.</p><h4>Step 8: Creating a virtual host</h4><p>Next I decided to create a virtual host instead of using the dumb and inconvenient http://localhost/thica.net url. It&#8217;s never been that easy with XAMPP <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>First I opened the file httpd-vhosts.conf in E:\xampp\xampp\apache\conf\extra folder with Notepad++ and added these lines at the very bottom:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td
class="code"><pre class="xml" style="font-family:monospace;">NameVirtualHost thica.dev:80
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;VirtualHost</span> thica.dev:80<span style="color: #000000; font-weight: bold;">&gt;</span></span>
ServerName www.thica.dev
ServerAlias thica.dev
DocumentRoot &quot;E:\xampp\xampp\htdocs\thica.net&quot;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div><p>This will instruct Apache to create a virtual host that we can access at the url www.thica.dev, with the content served from E:\xampp\xampp\htdocs\thica.net folder.</p><p>Next I opened the &#8220;host&#8221; file (no extension!) in C:\WINDOWS\system32\drivers\etc and added this line:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
</pre></td><td
class="code"><pre class="xml" style="font-family:monospace;">127.0.0.1	thica.dev www.thica.dev</pre></td></tr></table></div><p>Then at the XAMPP Control Panel, I restarted Apache by stopping and starting it. The virtual host is ready <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><h4>Step 9: Final touches</h4><p>With the files already in place and the database ready to server, I accessed www.thica.dev in my browser. But how strange&#8230; instead of the local development site, I was redirected to http://www.thica.net. It turned out that WordPress had some settings that takes effect in this here:</p><p><a
href="/wp-content/uploads/2009/01/option-siteurl.gif"><img
class="shot" src="/wp-content/uploads/2009/01/option-siteurl.gif" alt="SiteURL Option" width="450" /></a></p><p>and here</p><p><a
href="/wp-content/uploads/2009/01/option-home.gif"><img
class="shot" src="/wp-content/uploads/2009/01/option-home.gif" alt="Home Option" width="450" /></a></p><p>So, using phpMyAdmin, I changed both values into http://www.thica.dev. Now pointing my browser to www.thica.dev works!</p><p>But wait&#8230; I&#8217;m a perfectionist, and I want more. There is a FireFox addon called <a
href="https://addons.mozilla.org/firefox/addon/2409">Server Switcher</a> which helps us switch between the Live and Development versions with just one click. Yes, it may sound small, but it certainly comes in handy. So if you want it perfect, install this little plugin.</p><h4>Step 10: Enjoy</h4><p>Now everything should be in working order. Is there anything else, or am I missing anything here? Please leave your comment <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> <img
style='display:none' id="post-190-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/01/setup-a-development-version-of-wordpress/',title:'Setup a development version of WordPress',tweet:'Being a WordPress user, there&#8217;re certainly times when you want to try something new with your ',description:'Being a WordPress user, there&#8217;re certainly times when you want to try something new with your '})"><script type='text/javascript'>document.getElementById("post-190-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/01/setup-a-development-version-of-wordpress/feed/</wfw:commentRss> <slash:comments>11</slash:comments> </item> <item><title>Top 1000 WordPress plugin authors &#8211; I&#8217;m at the bottom :D</title><link>http://www.phoenixheart.net/2008/12/top-1000-wordpress-plugin-authors-im-at-the-bottom/</link> <comments>http://www.phoenixheart.net/2008/12/top-1000-wordpress-plugin-authors-im-at-the-bottom/#comments</comments> <pubDate>Wed, 31 Dec 2008 09:43:07 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Blahblahblah]]></category> <category><![CDATA[plugin]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=186</guid> <description><![CDATA[White Shadow has recently compiled a list of top 1000 WordPress plugin authors based on number of downloads. There are 2190 authors in total, and I rank at 843th position with 1328 downloads on 3 plugins. Not very impressive right? Nevertheless, I&#8217;ve just taken part in this community for 2 months, so I would consider [...]]]></description> <content:encoded><![CDATA[<p><a
href="">White Shadow</a> has recently compiled a list of <a
href="http://w-shadow.com/blog/2008/12/28/top-10-wordpress-plugin-developers/">top 1000 WordPress plugin authors</a> based on number of downloads. There are 2190 authors in total, and I rank at 843th position with 1328 downloads on 3 plugins. Not very impressive right? <img
src='http://www.phoenixheart.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>Nevertheless, I&#8217;ve just taken part in this community for <a
href="http://www.phoenixheart.net/2008/10/digg-this-o-mine/">2 months</a>, so I would consider this a small success.</p><p>And this is a win-win.</p> <img
style='display:none' id="post-186-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2008/12/top-1000-wordpress-plugin-authors-im-at-the-bottom/',title:'Top 1000 WordPress plugin authors &#8211; I&#8217;m at the bottom :D',tweet:'White Shadow has recently compiled a list of top 1000 WordPress plugin authors based on number of do',description:'White Shadow has recently compiled a list of top 1000 WordPress plugin authors based on number of do'})"><script type='text/javascript'>document.getElementById("post-186-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2008/12/top-1000-wordpress-plugin-authors-im-at-the-bottom/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 2/11 queries in 0.017 seconds using disk

Served from: www.phoenixheart.net @ 2010-09-09 08:07:30 -->