<?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; wordpress</title> <atom:link href="http://www.phoenixheart.net/tag/wordpress/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>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>Here we go &#8211; CDN Rewrites</title><link>http://www.phoenixheart.net/2009/09/here-we-go-cdn-rewrites/</link> <comments>http://www.phoenixheart.net/2009/09/here-we-go-cdn-rewrites/#comments</comments> <pubDate>Thu, 24 Sep 2009 10:15:34 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Featured]]></category> <category><![CDATA[Freebies]]></category> <category><![CDATA[Server stuffs]]></category> <category><![CDATA[cdn-rewrites]]></category> <category><![CDATA[plugin]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=325</guid> <description><![CDATA[Right after Free CDN was released, I got a request to enhance the plugin to support commercial Content Delivery Networks &#8211; you know, those big guys like Akamai, Limelight, EdgeCast, Velocix etc. The implementation is not too complicated: specify an origin host, and rewrite it into a destination host. That origin is of course usually [...]]]></description> <content:encoded><![CDATA[<p>Right after Free CDN was released, I got a request to enhance the plugin to support commercial Content Delivery Networks &#8211; you know, those big guys like Akamai, Limelight, EdgeCast, Velocix etc. The implementation is not too complicated: specify an origin host, and rewrite it into a destination host. That origin is of course usually http://www.a-busy-site.com, and the destination is something a <a
href="http://www.valuecdn.com" class="qc">Content Delivery Network</a> would provide you with: http://static.a-busy-site.com, or http://images.a-busy-site.com, or http://a-static-host.com etc. This way, all static contents will be served from that CDN host.</p><p>So, instead of developing the enhancement as a new feature for Free CDN, I decided to create a new plugin called CDN Rewrites. <span
id="more-325"></span>The implementation was not really a breeze, but in the end it worked rather smoothly.</p><p>I would like to thank <a
href="http://www.ezsite.us/">Mike Colburn</a> for the idea and being so kind enough to help me with all the documents and testing. Without him this plugin would never see the light.</p><p>Head <a
href="/wp-plugins/cdn-rewrites/">here for the plugin&#8217;s official page</a>.</p> <img
style='display:none' id="post-325-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/09/here-we-go-cdn-rewrites/',title:'Here we go &#8211; CDN Rewrites',tweet:'Right after Free CDN was released, I got a request to enhance the plugin to support commercial Conte',description:'Right after Free CDN was released, I got a request to enhance the plugin to support commercial Conte'})"><script type='text/javascript'>document.getElementById("post-325-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/09/here-we-go-cdn-rewrites/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>First version of Free CDN WP plugin released!</title><link>http://www.phoenixheart.net/2009/09/free-cdn-first-version-released/</link> <comments>http://www.phoenixheart.net/2009/09/free-cdn-first-version-released/#comments</comments> <pubDate>Sun, 13 Sep 2009 17:03:10 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Featured]]></category> <category><![CDATA[Freebies]]></category> <category><![CDATA[Server stuffs]]></category> <category><![CDATA[free CDN]]></category> <category><![CDATA[plugin]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=314</guid> <description><![CDATA[Office life has its advantages and disadvantages. On one hand, it keeps me so exhausted and leaves me so little free time for other hobbies &#8211; I&#8217;m talking about my books, my December Flower guitar self-training, my photographic stuffs etc. On the other hand, it does improve my knowledge and skills with all those working [...]]]></description> <content:encoded><![CDATA[<p>Office life has its advantages and disadvantages. On one hand, it keeps me so exhausted and leaves me so little free time for other hobbies &#8211; I&#8217;m talking about my books, my <a
href="http://www.youtube.com/watch?v=sLPXAcAsLgo">December Flower</a> guitar self-training, my photographic stuffs etc. On the other hand, it does improve my knowledge and skills with all those working requirements.</p><p>I&#8217;m rather lucky to be working as an R&amp;D guy in my current company, thus got a (legal) chance to (legally) spare a lot of time for (sometimes illegal) new and cool stuffs. Among them is <abbr
title="Content Delivery Network">CDN</abbr>, a solution to distribute (mostly static) contents across a network and let end-user access their copies from the cloud instead of the central server itself, thus reduces bottle neck problems during peak hours. To enterprise websites like those of Microsoft, Yahoo, Amazon, eBay etc., this is vital, as the number of concurrent visitors and downloads very frequently exceeds millions. Some of them build their own CDN, when the others rather hire third party services to handle the load to save time and money. Most well known among these 3rd services are properly <a
href="http://www.akamai.com">Akamai</a> and <a
href="http://www.limelightnetworks.com/">Limelight</a>, though there is a vast of them, naturally. For instance, Windows 7 downloads (~2GB each!) were served through Akamai network, when the live internet broadcast of Barrack Obama&#8217;s inaugural speech was done with help from Limelight.<span
id="more-314"></span></p><p>CDN&#8217;s are great as they save websites from heavy loads thus reduces bandwidth and shorten that number on the webmasters&#8217; monthly bills. So why aren&#8217;t they used so popularly? Well, because in general they are expensive, as you can tell. Depending on each CDN&#8217;s price table and the data size, the cost of using a CDN may range from thousands a month, which is unaffordable for like 98% of our blog owners despite of being just a peanut to Yahoo and Microsoft. So unless he is earning millions from selling Photoshop brushes or Google ads on his personal blog, a blog owner would close his eyes and wait for that Digg wave to calm down instead of (dare) using a CDN and survive the typhoon. So the rich keep getting richer and the poor keep remaining poor, life is bitter huh?</p><p>Not really (whoo hoo!). Akamai and Limelight are big, but they are not the only. Aside of those commerical CDN&#8217;s, there are some free ones, like <a
href="http://www.coralcdn.org/">Coral</a>, which provide us with free CDN &#8211; means free bandwidth. Coral CDN uses peer-to-peer technology in its CDN architecture, thus eliminates the need of maintaining a system of expensive server clusters while still offering an CDN solution with acceptable speed and stability. Long story shot, we small blog owners can also have CDN (on pair with Microsoft, yay!).</p><p>It&#8217;s dead simple to get a content (being any of types, but most commonly static contents like images, video clips, music tracks, css, java scripts) served thought Coral. All you have to do is appending <em
style="color:#f00; font-weight:bold">.nyud.net</em> to the host name of that content&#8217;s URL and call it done. Try it <a
href="http://www.phoenixheart.net.nyud.net">here</a>, <a
href="http://www.thica.net.nyud.net">here</a>, and <a
href="http://www.digg.com.nyud.net">here</a> to see it yourself. The first time requested, the content is retrieved from the original server and cached on Coral&#8217;s distributed servers. From the second request on, visitors will get a copy of that content from Coral. If the content weights 100KB in size, you&#8217;ve just saved 100KB bandwidth. If you have 1000 requests, it&#8217;s 100MB of bandwidth saved. Piece of cake.</p><p>So I was very excited getting to know about Coral and free P2P CDN&#8217;s. Then I told myself: ok, it&#8217;s time for another WordPress plugin &#8211; a &#8220;Free CDN&#8221; one which will rewrite all static URLs (being images, css, js etc.) to take advantage of Coral. Easier said than done, but nonetheless, I managed to get it done (thank you very much <a
href="http://omninoggin.com/">Thaya</a>, for the great help on how to capture the whole WordPress HTML stream). Today is the day <a
href="/wp-plugins/free-cdn/">Free CDN WordPress plugin</a> is born, cheers! The concept behind this plugin is simple: it looks for static contents inside a WordPress page and rewrites them into Coral-ready format. For example, <em>http://www.yourblog.com/wp-contents/themes/one-room/images/sprites.png</em> will be rewritten into <em>http://www.yourblog.com<strong>.nyud.net</strong>/wp-contents/themes/one-room/images/sprites.png</em> and gets handled by Coral network.</p><p>If your blog is rather small and you don&#8217;t have to worry about bandwidth fee / peak times, then it may be not worth your time to lay an eye on this plugin. But if you have a big enough blog with tens of thousands of views a day, and the bandwidth fee is giving you some good nightmare, and the bottle necks are causing you some headaches, then why not <a
href="/wp-plugins/free-cdn/">give Free CDN a try</a>?</p> <img
style='display:none' id="post-314-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/09/free-cdn-first-version-released/',title:'First version of Free CDN WP plugin released!',tweet:'Office life has its advantages and disadvantages. On one hand, it keeps me so exhausted and leaves m',description:'Office life has its advantages and disadvantages. On one hand, it keeps me so exhausted and leaves m'})"><script type='text/javascript'>document.getElementById("post-314-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/09/free-cdn-first-version-released/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>Referrer Detector 4.0 is out!</title><link>http://www.phoenixheart.net/2009/05/referrer-detector-4-is-out/</link> <comments>http://www.phoenixheart.net/2009/05/referrer-detector-4-is-out/#comments</comments> <pubDate>Tue, 12 May 2009 16:51:48 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Featured]]></category> <category><![CDATA[Freebies]]></category> <category><![CDATA[plugin]]></category> <category><![CDATA[Referrer Detector]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=290</guid> <description><![CDATA[Finally I&#8217;ve made it! Referrer Detector version 4.0 is now out! I decided to mark this as a major version increment because of these reasons: The code has been COMPLETELY re-written from scratch. As of the previous versions, it was one big file that handled everything from admin to front-end control. Needless to say how [...]]]></description> <content:encoded><![CDATA[<p>Finally I&#8217;ve made it! Referrer Detector version 4.0 is now out! I decided to mark this as a major version increment because of these reasons:</p><ol><li>The code has been COMPLETELY re-written from scratch. As of the previous versions, it was one big file that handled everything from admin to front-end control. Needless to say how inconvenient this approach had become when bug fixes and new features were added&#8230; too bad that I have decided to throw all away and build a brand new <abbr
title="Object Oriented Programming">OOP</abbr> Referrer Detector. Well, it was a looong and tough way, but I&#8217;ve never looked back!</li><li>The data are now in (ahem) database. I was thinking (and convincing myself) that a JavaScript file is faster, as it reduces the number of database requests. But with time, it becomes too bloat and too hard for me to track bugs as well as to add improvements. So I told myself: hell with this sacrifice, I better obey the power of MySQL.</li><li>The biggest new feature that I&#8217;m really excited of is the ability to add <em>localized messages</em>. In the past, your users were welcomed the the same (English) greetings regardless of which country they were from. Now you can specify a localized message for those from Vietnam, another for Brazilians, Portuguese, and so on. The plugin will try to detect users&#8217; country and decide which message to show. Isn&#8217;t it cool?</li><li>The second new feature is the ability to backup and restore stuffs, including entries, excluded URLs, and options. For restoring, in order to keep the administration panel AJAX&#8217;ed, I go with <a
href="http://www.uploadify.com/">Uploadify</a>, a wonderful jQuery file upload plugin. This plugin uses a bit of Flash, but no worries, it will still works if your browser has no Flash player installed.</li><li>For the Stats panel, there were two problems that caused me much of headache. One is Google TLDs which are hundreds in number thus totally ruined the chart. The other is the chart itself: PHP/SWF Charts library is too darn heavy and often broke my SVN commits. So I wrote some code to group those annoying TLDs into one group, and use <a
href="http://code.google.com/apis/chart/">Google Chart</a> instead.</li><li>In the admin panel, I added a &#8220;Support this plugin!&#8221; tab. Just a bit about myself, like &#8220;Follow me on Twitter&#8221;. Hope you aren&#8217;t pissed of with this change.</li></ol><p>As usual, the plugin is downloadable at <a
href="http://wordpress.org/extend/plugins/referrer-detector/">WordPress Codex</a>. Your comments are always welcome here and in the <a
href="/wp-plugins/referrer-detector/">plugin page</a>. Let me know if you&#8217;re happy with the new version, or about the bugs you encounter!</p> <img
style='display:none' id="post-290-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2009/05/referrer-detector-4-is-out/',title:'Referrer Detector 4.0 is out!',tweet:'Finally I&#8217;ve made it! Referrer Detector version 4.0 is now out! I decided to mark this as a ma',description:'Finally I&#8217;ve made it! Referrer Detector version 4.0 is now out! I decided to mark this as a ma'})"><script type='text/javascript'>document.getElementById("post-290-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/05/referrer-detector-4-is-out/feed/</wfw:commentRss> <slash:comments>6</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>WordPress plugins I&#8217;m using</title><link>http://www.phoenixheart.net/2009/02/wordpress-plugins-im-using/</link> <comments>http://www.phoenixheart.net/2009/02/wordpress-plugins-im-using/#comments</comments> <pubDate>Mon, 16 Feb 2009 08:31:49 +0000</pubDate> <dc:creator>phoenix.heart</dc:creator> <category><![CDATA[Featured]]></category> <category><![CDATA[Freebies]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://www.phoenixheart.net/?p=232</guid> <description><![CDATA[Just in case you don&#8217;t know &#8211; I&#8217;m pretty sure you do though &#8211; a WordPress-powered website is very limited in any terms without plugins. Or you can tell, a WordPress site that doesn&#8217;t use any plugin is just useless. Plugins bring your site uncountable and invaluable enhancements. Well, enough of babbling. What I wanted [...]]]></description> <content:encoded><![CDATA[<p><span
class="drop-cap">J</span>ust in case you don&#8217;t know &#8211; I&#8217;m pretty sure you do though &#8211; a WordPress-powered website is very limited in any terms without plugins. Or you can tell, a WordPress site that doesn&#8217;t use any plugin is just useless. Plugins bring your site uncountable and invaluable enhancements.</p><p>Well, enough of babbling. What I wanted to say is, today I&#8217;m going to write down here list of plugins I&#8217;m currently using on <strong>this</strong> site. For what, you ask? To show off, of course. Or &#8211; I prefer this &#8211; to share something that may be useful sometimes.</p><p>So in no particular order, here they come.</p><p>1. I use <a
href="http://wordpress.org/extend/plugins/stats/">WordPress.com Stats</a> to have a in-details view on my blog. Five or ten times a day, I click &#8220;Blog Stats&#8221; link in the admin panel to get an idea on the traffic, incoming/ongoing links, search terms etc. All these data are essential if I want to build up a high quality site.</p><p>2. To save a lot of clicks and keep the admin menu bar tidy, <a
href="http://planetozh.com/blog/my-projects/wordpress-admin-menu-drop-down-css/">Ozh&#8217; Admin Drop Down Menu</a> is my plugin of choice. Agree, the new menu system in WordPress 2.7 is a good improvement, but it&#8217;s still nowhere near Ozh&#8217;s version. Write a new post, customize the theme, add a new plugin, change some settings&#8230; almost all the commands are now just one-click away from me. Huge productivity, I&#8217;d say.<span
id="more-232"></span></p><p>3. When it comes to <abbr
title="Search Engine Optimization">SEO</abbr>, <a
href="http://semperfiwebdesign.com/">All in One SEO Pack</a> definitely suits my needs. I didn&#8217;t need to do anything, just installed it and all the keywords, titles, descriptions were there beautifully. Sure, there are plenty more than just than for SEO (like the incoming links) but that should be basically enough for a good start. So if you&#8217;re coming from Google, this plugin deserves some credits.</p><p>4. And some other credits should go to <a
href="http://www.arnebrachhold.de/redir/sitemap-home/">Google XML Sitemaps</a>. This plugin automatically generates a XML-Sitemap compliant site map for me every time I add/edit/remove my posts and pages, so that MSN, Yahoo, Ask, and Google bots can easily browse (and index) my site. I don&#8217;t even want to imagine just how long and boring it would be if I had to manually modify my site map after there was a change in the architecture, so this plugin is a must-have.</p><p>5. I&#8217;m not a good writer. Especially when English is not my mother language. And my articles are boring. So I guess that&#8217;s why I&#8217;m not receiving many comments from my readers. From those darn spammers however, well, there&#8217;s a bunch of spams almost every day. But you don&#8217;t see any of them, right? It&#8217;s totally thanks to the <a
href="http://akismet.com/">Askimet</a> spam fighter. I installed it from the beginning of this blog, and since then there is 0 missed, around ten false positives on over 500 spamming comments got caught. Impressive, huh?</p><p><em>(to be continued)</em></p> <img
style='display:none' id="post-232-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/',title:'WordPress plugins I&#8217;m using',tweet:'Just in case you don&#8217;t know &#8211; I&#8217;m pretty sure you do though &#8211; a WordPress-po',description:'Just in case you don&#8217;t know &#8211; I&#8217;m pretty sure you do though &#8211; a WordPress-po'})"><script type='text/javascript'>document.getElementById("post-232-blankimage").onload();</script>]]></content:encoded> <wfw:commentRss>http://www.phoenixheart.net/2009/02/wordpress-plugins-im-using/feed/</wfw:commentRss> <slash:comments>4</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 1/11 queries in 0.018 seconds using disk

Served from: www.phoenixheart.net @ 2010-09-09 08:29:58 -->