<?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>Aliso the Geek&#187; Best Practices</title>
	<atom:link href="http://alisothegeek.com/category/best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://alisothegeek.com</link>
	<description>A coder in love with WordPress</description>
	<lastBuildDate>Thu, 12 Aug 2010 03:47:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The switch to Dvorak</title>
		<link>http://alisothegeek.com/2010/04/the-switch-to-dvorak/</link>
		<comments>http://alisothegeek.com/2010/04/the-switch-to-dvorak/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 03:07:47 +0000</pubDate>
		<dc:creator>abarrett</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Dvorak]]></category>
		<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://alisothegeek.com/?p=756</guid>
		<description><![CDATA[When I got my first stick shift, we (my family) had to sell my automatic to afford it. My only option for driving, then, was the new stick shift I hadn’t learned yet. I sucked at it at first, but I quickly got a lot better. It’s like learning a foreign language by living in a foreign country. And so begin my adventures in learning Dvorak. <a href="http://alisothegeek.com/2010/04/the-switch-to-dvorak/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://alisothegeek.com/wp-content/uploads/2010/04/keys.jpg"><img class="alignleft size-medium wp-image-757" title="keyboard" src="http://alisothegeek.com/wp-content/uploads/2010/04/keys-250x187.jpg" alt="" width="250" height="187" /></a>When I got my first stick shift, we (my family) had to sell my automatic to afford it. My only option for driving, then, was the new stick shift I hadn&#8217;t learned yet. I sucked at it at first, but I quickly got a lot better. It&#8217;s like learning a foreign language by living in a foreign country. And so begin my adventures in learning Dvorak.</p>
<p>The chain of events leading to my decision to become even geekier started with one of my favorite pasttimes: aimlessly surfing the web. I came upon <a title="Shaun Chapman's blog" href="http://shaunchapmanblog.com/post/320143721/a-better-way-to-type">this blog post</a> that talked about the Dvorak keyboard layout being a much faster &amp; more efficient way to type. Well, I like efficiency, so the next logical step was (of course) to drop all plans for the night and learn it. I followed his link to <a href="http://www.dvzine.org/">DVzine.org</a> and printed out their <a href="http://www.dvzine.org/zine/index.html">comic about the history of keyboard layouts</a>, and if there was any convincing left to be done, that did it.</p>
<p>Next I decided to pop the keys off my keyboard and rearrange them, which turned out to be a bad idea, because I <abbr title="rendered it inoperable">bricked my keyboard</abbr> in the process. (I&#8217;m typing this on a spare.)</p>
<p>Anyway, a couple of typing tutorials later, I got bored, so here I am. I&#8217;ve been typing this entire post in Dvorak, and I&#8217;m cruising along at a whopping 10 words per minute. But just like being forced into driving a manual transmission by losing my automatic, I know that this is the quickest way to learn it. Wish me luck!</p>
<p>Oh, and if you do decide to follow in my footsteps, don&#8217;t brick your keyboard!</p>
<p><em>Update: The hardest part of this is definitely keyboard shortcuts. I never realized how much I looked at the keyboard for those.</em></p>
<p><em><a href="http://alisothegeek.com/wp-content/uploads/2010/04/Picture-7.png"><img class="aligncenter size-full wp-image-764" title="Dvorak options in Mac System Preferences" src="http://alisothegeek.com/wp-content/uploads/2010/04/Picture-7.png" alt="" width="377" height="69" /></a>Another update: Keyboard shortcuts can be saved! There&#8217;s a second Dvorak option in Mac OS 10.5 (it&#8217;s one of four options in 10.6) called </em>Dvorak – Qwerty <em>that converts the keyboard to Qwerty when the command key is held down. I will probably try to get used to the keyboard shortcuts in Dvorak eventually, but in the meantime, I won&#8217;t accidentally quit an application when trying to cut and paste. Hooray!</em></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://alisothegeek.com/2010/04/the-switch-to-dvorak/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=The+switch+to+Dvorak+-+http://b2l.me/agqxce&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://alisothegeek.com/2010/04/the-switch-to-dvorak/&amp;t=The+switch+to+Dvorak" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://alisothegeek.com/2010/04/the-switch-to-dvorak/&amp;title=The+switch+to+Dvorak" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://alisothegeek.com/2010/04/the-switch-to-dvorak/&amp;title=The+switch+to+Dvorak" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://alisothegeek.com/2010/04/the-switch-to-dvorak/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://alisothegeek.com/2010/04/the-switch-to-dvorak/&amp;title=The+switch+to+Dvorak" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://alisothegeek.com/2010/04/the-switch-to-dvorak/&amp;title=The+switch+to+Dvorak" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://alisothegeek.com/2010/04/the-switch-to-dvorak/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://alisothegeek.com/2010/04/the-switch-to-dvorak/&amp;title=The+switch+to+Dvorak&amp;summary=When%20I%20got%20my%20first%20stick%20shift%2C%20we%20%28my%20family%29%20had%20to%20sell%20my%20automatic%20to%20afford%20it.%20My%20only%20option%20for%20driving%2C%20then%2C%20was%20the%20new%20stick%20shift%20I%20hadn%E2%80%99t%20learned%20yet.%20I%20sucked%20at%20it%20at%20first%2C%20but%20I%20quickly%20got%20a%20lot%20better.%20It%E2%80%99s%20like%20learning%20a%20foreign%20language%20by%20living%20in%20a%20foreign%20country.%20And%20so%20begin%20my%20adventures%20in%20learning%20Dvorak.&amp;source=Aliso the Geek" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://alisothegeek.com/2010/04/the-switch-to-dvorak/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>10 great resources for WordPress developers</title>
		<link>http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/</link>
		<comments>http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 23:05:35 +0000</pubDate>
		<dc:creator>abarrett</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://alisothegeek.com/?p=612</guid>
		<description><![CDATA[In the spirit of learning new WordPress development techniques, I thought I'd share the ten resources I use the most. These cover a lot of best practices that are a great baseline for solid plugin &#38; theme development. Here they are, in no particular order. <a href="http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have recently (in the past few months) purchased a few excellent books on WordPress, WordPress development, and web development in general. I must say that after reading these, I am a little embarrassed at some of the code I&#8217;ve put out there in older plugins and themes.</p>
<p>I recently had the privilege of rebuilding the website for <a title="Visit MVAP" href="http://www.votersforanimals.org/">Minnesota Voters for Animal Protection</a>, and developing the site in WordPress opened my eyes to a lot of tricks, shortcuts, and standards that I hadn&#8217;t used before.</p>
<p>In the spirit of learning new WordPress development techniques, I thought I&#8217;d share the ten resources I use the most. These cover a lot of best practices that are a great baseline for solid plugin &amp; theme development. Here they are, in no particular order:</p>
<h3>1. <a href="http://codex.wordpress.org/Template_Tags">WordPress Template Tags</a></h3>
<p>This might be the most-clicked bookmark on my computer. It&#8217;s such a fantastic, quick reference to look up the arguments/syntax/existence of almost any WordPress function.</p>
<h3>2. <a href="http://codex.wordpress.org/WordPress_Coding_Standards">WordPress Coding Standards</a></h3>
<p>I feel lucky that my coding style matches that of the WordPress team almost completely; I had very few adjustments to make. Developing for WordPress in their coding style makes your code easier for others to read and modify later (if you&#8217;re making open-source stuff). Also, if your style is all over the place, this will help you achieve consistency.</p>
<h3>3. <a href="http://codex.wordpress.org/Plugin_Resources">Plugin Resources (from the WordPress Codex)</a></h3>
<p>I keep this bookmarked because it links to the pages in the codex I refer to the most. The list of filters &amp; hooks, and examples of their syntax, is especially helpful for me.</p>
<h3>4. <a href="http://www.prelovac.com/vladimir/best-practice-for-adding-javascript-code-to-wordpress-plugin">Best practice for adding JavaScript code to WordPress plugins</a></h3>
<p>This is the most concise and easy-to-follow guide on this topic that I&#8217;ve seen.</p>
<h3>5. <a href="http://www.smashingmagazine.com/2009/11/25/advanced-power-tips-for-wordpress-template-developers/">Advanced Power Tips for WordPress Template Developers</a></h3>
<p>Smashing Magazine is a fantastic place for finding useful, plug-and-play code snippets that might change the way you develop forever.</p>
<h3>6. <a href="http://www.smashingmagazine.com/2009/12/14/advanced-power-tips-for-wordpress-template-developers-reloaded/">Advanced Power Tips for WordPress Template Developers: Reloaded</a></h3>
<p>More great stuff from Smashing Magazine, this time focusing mostly on the admin area.</p>
<h3>7. <a href="http://www.smashingmagazine.com/tag/wordpress/">Posts tagged &#8220;WordPress&#8221; on Smashing Magazine</a></h3>
<p>I wanted to list a lot of these posts, but then my entire list would have been Smashing Magazine articles! Here&#8217;s their list of WordPress posts.</p>
<h3>8. <a href="http://www.wprecipes.com/">WpRecipes.com</a></h3>
<p>Like Smashing Magazine, there are a lot of code snippets here that work very well for specific things.</p>
<h3>9. <a href="http://digwp.com/">Digging into WordPress</a></h3>
<p>This website is a great resource for unlocking more advanced, CMS-like functionality in WordPress. Their book is one of those I mentioned at the beginning of my post.</p>
<h3>10. <a href="http://google.com/">Google</a></h3>
<p>This might be how I learned 99% of what I know about WordPress development, whether directly or indirectly. You&#8217;d be surprised at how quickly you can find what you need by searching for a function name or throwing &#8220;wordpress&#8221; in front of your keywords.</p>
<p>Refer back to these sites often! The blogs update frequently, and the codex entries are great standards to keep bookmarked in your browser.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=10+great+resources+for+WordPress+developers+-+http://b2l.me/ags4q5&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/&amp;t=10+great+resources+for+WordPress+developers" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/&amp;title=10+great+resources+for+WordPress+developers" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/&amp;title=10+great+resources+for+WordPress+developers" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/&amp;title=10+great+resources+for+WordPress+developers" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/&amp;title=10+great+resources+for+WordPress+developers" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/&amp;title=10+great+resources+for+WordPress+developers&amp;summary=In%20the%20spirit%20of%20learning%20new%20WordPress%20development%20techniques%2C%20I%20thought%20I%27d%20share%20the%20ten%20resources%20I%20use%20the%20most.%20These%20cover%20a%20lot%20of%20best%20practices%20that%20are%20a%20great%20baseline%20for%20solid%20plugin%20%26amp%3B%20theme%20development.%20Here%20they%20are%2C%20in%20no%20particular%20order.&amp;source=Aliso the Geek" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://alisothegeek.com/2010/02/10-great-wordpress-developer-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make a great print stylesheet</title>
		<link>http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/</link>
		<comments>http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 22:58:00 +0000</pubDate>
		<dc:creator>abarrett</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[blog design]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[stylesheet]]></category>

		<guid isPermaLink="false">http://alisothegeek.com/?p=521</guid>
		<description><![CDATA[For any website with a sidebar or a background image, print stylesheets are essential. Using “File » Print” is so much more intuitive for users than searching for a “Print this page” button on a website, and creating print-friendly versions of all your pages is a tedious, time-consuming task (especially if you have a blog). A print stylesheet is an elegant alternative. <a href="http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://alisothegeek.com/wp-content/uploads/2010/01/Screen-shot-2010-01-22-at-10.52.43-PM.png"><img class="alignleft size-medium wp-image-522" title="Printed page 1 of my blog" src="http://alisothegeek.com/wp-content/uploads/2010/01/Screen-shot-2010-01-22-at-10.52.43-PM-231x300.png" alt="" width="185" height="240" /></a>I just finished making a new print stylesheet for AlisotheGeek.com. For any website with a sidebar or a background image, print stylesheets are essential. Using &#8220;File » Print&#8221; is so much more intuitive for users than searching for a &#8220;Print this page&#8221; button on a website, and creating print-friendly versions of all your pages is a tedious, time-consuming task (especially if you have a blog). A print stylesheet is an elegant alternative.</p>
<h3>Set up a print stylesheet</h3>
<p>For those who don&#8217;t know how to make a print-specific stylesheet, it just takes the addition of one attribute to your CSS links in the <code>&lt;head&gt;</code> section of your site:</p>
<pre><code>&lt;link rel="stylesheet" href="style.css" type="text/css" media="screen, projection" /&gt;
&lt;link rel="stylesheet" href="print.css" type="text/css" media="print" /&gt;</code></pre>
<p>The &#8220;media&#8221; attribute tells the browser to pay attention to stylesheets only in those situations. Add &#8216;media=&#8221;print&#8221;&#8216; to your stylesheet link for a print stylesheet. If the &#8220;media&#8221; attribute is left out, that stylesheet is called in all display situations, including print.</p>
<h3>Hide unnecessary information with <code>display: none</code></h3>
<p>In the case of my website, I decided to hide things like the sidebar, the email subscription form, and the social media/bookmarking links at the end of each post. Do this with a simple <code>display: none;</code> at the top of your stylesheet. The user isn&#8217;t trying to print out your sidebar; they&#8217;re trying to print the article they just read.</p>
<h3>Add back any global styles to make your printed page match your website</h3>
<p>This step is only necessary if you left your main stylesheet out of the mix for printed pages. You will probably want your fonts to be the same on paper as they are on a screen, so make sure to re-insert those styles in your print stylesheet. The same goes for classes that apply global formatting to elements, such as floating images left or right.</p>
<h3>Add extra information to your website to display only in printed pages</h3>
<p>On my website, you&#8217;ll notice that the only thing in the footer is the copyright statement. When it&#8217;s printed, the URL &#8220;alisothegeek.com&#8221; appears in the right side of the footer. This is something I added in my footer (you can see it in the source code) and I set it to hide in my main stylesheet, but not my print stylesheet. Things like this can give a little extra clarity to users who print an article and later forget where it came from.</p>
<p>Also, the header on my site is one giant background image, with no text. Many modern browsers automatically turn off background images when they print pages, in order to save ink or toner. For the benefit of a user printing my site (and for the benefit of screen readers &amp; search engines) I do have text in the header of my site, and CSS is hiding it on the screen. This way, it shows up on printed pages but not in the browser. I also added my logo next to that text using an &lt;img&gt; tag so it would still print.</p>
<h3>Make hyperlinks useful on a printed page</h3>
<p><a href="http://alisothegeek.com/wp-content/uploads/2010/01/Screen-shot-2010-01-22-at-10.53.32-PM.png"><img class="aligncenter size-large wp-image-538" title="Hyperlink URLs in a print stylesheet" src="http://alisothegeek.com/wp-content/uploads/2010/01/Screen-shot-2010-01-22-at-10.53.32-PM-1024x116.png" alt="" width="540" height="61" /></a></p>
<p>Printing out a hyperlink is just like printing out text that&#8217;s underlined. It means no more to the reader than regular formatted text. To keep hyperlinks useful on a printed page, I added this code to my CSS (taken and modified from <a href="http://www.alistapart.com/articles/goingtoprint/">this article at A List Apart</a>):</p>
<pre><code>.entry a:after {
     content: " [" attr(href) "]";
     font-size: 80%;
     font-weight: normal;
}</code></pre>
<p>This adds the URL after each hyperlink in my post&#8217;s content (which is <code>div class="entry"</code>) in slightly smaller font surrounded by square brackets. This way, a printed article still retains the benefits of its hyperlinks.</p>
<h3>Make final touches to keep it looking classy</h3>
<p>Take some time and print out some test pages. Make formatting tweaks as necessary to make sure you didn&#8217;t miss anything from your main stylesheet that you want to keep in printed form. Add padding or margin where it will help things look nicer. For many websites, a printed page is a lot wider than the main content area is on the screen, so take that into consideration as well.</p>
<p>I hope this post helps some website builders out there with print stylesheet creation. It&#8217;s something that is often overlooked in website design, but something users really appreciate when it&#8217;s done right. Happy coding!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+make+a+great+print+stylesheet+-+http://b2l.me/agtp26&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/&amp;t=How+to+make+a+great+print+stylesheet" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/&amp;title=How+to+make+a+great+print+stylesheet" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/&amp;title=How+to+make+a+great+print+stylesheet" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/&amp;title=How+to+make+a+great+print+stylesheet" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/&amp;title=How+to+make+a+great+print+stylesheet" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/&amp;title=How+to+make+a+great+print+stylesheet&amp;summary=For%20any%20website%20with%20a%20sidebar%20or%20a%20background%20image%2C%20print%20stylesheets%20are%20essential.%20Using%20%E2%80%9CFile%20%C2%BB%20Print%E2%80%9D%20is%20so%20much%20more%20intuitive%20for%20users%20than%20searching%20for%20a%20%E2%80%9CPrint%20this%20page%E2%80%9D%20button%20on%20a%20website%2C%20and%20creating%20print-friendly%20versions%20of%20all%20your%20pages%20is%20a%20tedious%2C%20time-consuming%20task%20%28especially%20if%20you%20have%20a%20blog%29.%20A%20print%20stylesheet%20is%20an%20elegant%20alternative.&amp;source=Aliso the Geek" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://alisothegeek.com/2010/01/how-to-make-a-great-print-stylesheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 tips on writing WordPress plugins &quot;the right way&quot;</title>
		<link>http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/</link>
		<comments>http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 04:31:40 +0000</pubDate>
		<dc:creator>abarrett</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[wpdb]]></category>
		<category><![CDATA[wp_enqueue_script]]></category>

		<guid isPermaLink="false">http://alisothegeek.com/?p=511</guid>
		<description><![CDATA[Just like many fellow programmers out there, when I first started publishing my own code for the world to see and use, it wasn’t the greatest. I didn’t fully understand the WordPress API and all the tools it had to offer. I have since learned a lot about how to write WordPress plugins “the right way”—the most efficient, clean, and safe way, that is. WordPress has functions, classes, and hooks that work right out of the box to make plugins easier to code and less risky to use. Here are a few of my favorite tips. <a href="http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just like many fellow programmers out there, when I first started publishing my own code for the world to see and use, it wasn&#8217;t the greatest. I didn&#8217;t fully understand the WordPress API and all the tools it had to offer. I have since learned a lot about how to write WordPress plugins &#8220;the right way&#8221;—the most efficient, clean, and safe way, that is. WordPress has functions, classes, and hooks that work right out of the box to make plugins easier to code and less risky to use. Here are a few of my favorite tips.</p>
<h3>1. Use the <a href="http://codex.wordpress.org/Function_Reference/wpdb_Class">$wpdb object</a> for all database queries</h3>
<p>If you only read and follow one of these tips, make it this one. Setting up database connections with mysql_connect over and over again is a waste of code. If you&#8217;re in anything other than a standalone processing script, $wpdb is ready to go with just one line of code:</p>
<pre><code>global $wpdb;</code></pre>
<p>(If you are using a standalone script for something, just include two files to make $wpdb work: wp-load.php and wp-includes/wp-db.php.)</p>
<p>There are different functions for the $wpdb class to make different kinds of database queries (see <a href="http://codex.wordpress.org/Function_Reference/wpdb_Class">the WordPress codex page</a> for details on them all).</p>
<p>On average, I find that using $wpdb saves two to three lines of code for each time I make any sort of database query. For example, this:</p>
<pre><code>$name = mysql_real_escape_string($name);
$result = mysql_query("INSERT INTO $myplugin-&gt;categories_table (name) VALUES ('$name')");
if (!$result)
    die("Could not insert into database. ".mysql_error());</code></pre>
<p>turns into this:</p>
<pre><code>$wpdb-&gt;insert($myplugin-&gt;categories_table, array('name' =&gt; $name), array('%s'));</code></pre>
<p>One of the most important reasons to use $wpdb instead of mysql_query is that it automatically protects the database from MySQL injection attacks. <a href="http://codex.wordpress.org/Function_Reference/wpdb_Class#Protect_Queries_Against_SQL_Injection_Attacks">More details about that are on the codex page as well.</a></p>
<h3>2. Call jQuery using wp_enqueue_script</h3>
<p>One of the most frustrating things I&#8217;ve seen responsible for my WordPress plugins not working is that other plugins are calling jQuery the wrong way:</p>
<pre><code>&lt;script src="../../../wp-includes/js/jquery/jquery.js" type="text/javascript"&gt;&lt;/script&gt;</code></pre>
<p>WordPress has its own way of handling calls to jQuery (and other common Javascript libraries). It&#8217;s called wp_enqueue_script. This is how WordPress would have you call jQuery in a plugin:</p>
<pre><code>wp_enqueue_script('jquery');</code></pre>
<p>So if WordPress itself needs to load jQuery, or an additional plugin calls it in this way, then it&#8217;s only loaded once, and it&#8217;s loaded in no-conflict mode. This means that there won&#8217;t be two jQuery scripts of different versions competing for attention. And if you prefer an external reference to jQuery (such as the one from Google Code), <a href="http://www.ericmmartin.com/5-tips-for-using-jquery-with-wordpress/">there is a method for doing that in a WordPress-friendly way, too (see step 2 on this linked page).</a></p>
<h3>3. Use unique class &amp; function names</h3>
<p>If you have a function in your plugin called &#8220;load()&#8221;, then what happens if another plugin is activated on a user&#8217;s blog that uses a function called &#8220;load()&#8221;? Well, crap explosions happen. Plugins break. Solving this problem is easy: name all your functions something unique to your plugin. My personal method is to come up with a two- or three-letter representation of my plugin (like &#8220;sm&#8221; for SimpleMap) and use that as a prefix to all my function names. For example:</p>
<pre><code>sm_display_map()</code></pre>
<p>Easy as pie.</p>
<h3>4. Prep all text for localization from the get-go</h3>
<p>Even if you don&#8217;t include any translation files with your plugin, someone out there might want to write one for you (or for themselves). It&#8217;s pretty tedious to go back through your existing code and prep the text for translation, so make it a habit right away. First, you have to pick a key for your plugin&#8217;s translation files (this is usually just the plugin name or slug). Then you have to surround any text that gets displayed to the user with the following code:</p>
<pre><code>__('This is the text to be translated.', 'PluginKeyHere');</code></pre>
<p><em>Note: &#8216;PluginKeyHere&#8217; would be the key you picked. For example, in SimpleMap this is &#8216;SimpleMap&#8217;.</em></p>
<p>The double underscore at the beginning will return the translated string to PHP. If you want to echo the string, instead of adding echo before the double underscore, you can use this shorthand:</p>
<pre><code>_e('This is the text to be translated.', 'PluginKeyHere');</code></pre>
<p>More details on localizing your plugin can be found in <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers">the WordPress codex.</a></p>
<h3>5. Write a good README file</h3>
<p>This is something I highly recommend. When I&#8217;m searching for a plugin to install, an inadequate or poorly written README file will often make me go back to my search results and keep looking. Writing a good README file shows that you care about the people using your plugin. If you treat it like it&#8217;s just a step WordPress forces you to take to submit a plugin to the repository, it&#8217;s going to make you look like an ass, and users won&#8217;t want to try your plugin at all.</p>
<p>To top it off, Mark Jaquith has recently released a plugin that makes good use of your README files on your own blog. It&#8217;s called <a href="http://txfx.net/wordpress-plugins/i-make-plugins/">I Make Plugins</a>, and it automatically populates pages on your blog to promote the plugins you&#8217;ve created. You can <a href="http://alisothegeek.com/wordpress-plugins/">see it in action here on Aliso the Geek</a>.</p>
<p>Well, that&#8217;s all for now. More tips are sure to come in the future! If you have any suggestions, please leave a comment and share them!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=5+tips+on+writing+WordPress+plugins+%26quot%3Bthe+right+way%26quot%3B+-+http://b2l.me/agtsj6&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/&amp;t=5+tips+on+writing+WordPress+plugins+%26quot%3Bthe+right+way%26quot%3B" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/&amp;title=5+tips+on+writing+WordPress+plugins+%26quot%3Bthe+right+way%26quot%3B" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/&amp;title=5+tips+on+writing+WordPress+plugins+%26quot%3Bthe+right+way%26quot%3B" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/&amp;title=5+tips+on+writing+WordPress+plugins+%26quot%3Bthe+right+way%26quot%3B" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/&amp;title=5+tips+on+writing+WordPress+plugins+%26quot%3Bthe+right+way%26quot%3B" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/&amp;title=5+tips+on+writing+WordPress+plugins+%26quot%3Bthe+right+way%26quot%3B&amp;summary=Just%20like%20many%20fellow%20programmers%20out%20there%2C%20when%20I%20first%20started%20publishing%20my%20own%20code%20for%20the%20world%20to%20see%20and%20use%2C%20it%20wasn%E2%80%99t%20the%20greatest.%20I%20didn%E2%80%99t%20fully%20understand%20the%20WordPress%20API%20and%20all%20the%20tools%20it%20had%20to%20offer.%20I%20have%20since%20learned%20a%20lot%20about%20how%20to%20write%20WordPress%20plugins%20%E2%80%9Cthe%20right%20way%E2%80%9D%E2%80%94the%20most%20efficient%2C%20clean%2C%20and%20safe%20way%2C%20that%20is.%20WordPress%20has%20functions%2C%20classes%2C%20and%20hooks%20that%20work%20right%20out%20of%20the%20box%20to%20make%20plugins%20easier%20to%20code%20and%20less%20risky%20to%20use.%20Here%20are%20a%20few%20of%20my%20favorite%20tips.&amp;source=Aliso the Geek" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://alisothegeek.com/2010/01/tips-on-writing-wordpress-plugins-the-right-way/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A rambling train of thought on SimpleMap categories &amp; tags</title>
		<link>http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/</link>
		<comments>http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 21:20:49 +0000</pubDate>
		<dc:creator>abarrett</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[SimpleMap]]></category>

		<guid isPermaLink="false">http://alisothegeek.com/?p=418</guid>
		<description><![CDATA[This is an excerpt from an email I was writing to a SimpleMap user. I was going to ask their opinion on whether to add a Tags field to locations, but I ended up not needing any convincing. Expect a &#8230; <a href="http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is an excerpt from an email I was writing to a SimpleMap user. I was going to ask their opinion on whether to add a Tags field to locations, but I ended up not needing any convincing. Expect a Tags field in 1.2! In the meantime, here&#8217;s some insight into how my brain works when I develop.</p>
<p>&#8212;</p>
<p>I was going to change the way Categories work a little. Right now the category name is actually what&#8217;s inserted into the database record for a location. In the categories table, each category has an ID number, and I was going to link to that from the locations database instead. That way, when you change the name of a category, it will be changed across all the locations in that category. I could also let the user reassign those locations to a different category automatically.</p>
<p>This would make matching the category in a search a little more painful to code. It also still limits each location to one category.</p>
<p>My mission with SimpleMap is to keep it really simple&#8230; like I&#8217;ve said in a blog post or two, I won&#8217;t be adding any major features for a while after I release 1.2, because I want to make this plugin as streamlined as possible before it gets any bigger.</p>
<p>Would adding a Tags field, like you mentioned in your email, be a little too busy? I like that it would allow another search dimension, and that it would be unrestrained as to what you type in it (multiple tags, huge phrases, numbers, wouldn&#8217;t matter). My only concern is making things too complicated.</p>
<p>Then again, WordPress uses both categories and tags for posts, and people using this plugin already use WordPress. So I think I&#8217;ve answered my own question.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=A+rambling+train+of+thought+on+SimpleMap+categories+%26amp%3B+tags+-+http://b2l.me/agr8x2&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/&amp;t=A+rambling+train+of+thought+on+SimpleMap+categories+%26amp%3B+tags" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/&amp;title=A+rambling+train+of+thought+on+SimpleMap+categories+%26amp%3B+tags" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/&amp;title=A+rambling+train+of+thought+on+SimpleMap+categories+%26amp%3B+tags" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/&amp;title=A+rambling+train+of+thought+on+SimpleMap+categories+%26amp%3B+tags" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/&amp;title=A+rambling+train+of+thought+on+SimpleMap+categories+%26amp%3B+tags" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/&amp;title=A+rambling+train+of+thought+on+SimpleMap+categories+%26amp%3B+tags&amp;summary=This%20is%20an%20excerpt%20from%20an%20email%20I%20was%20writing%20to%20a%20SimpleMap%20user.%20I%20was%20going%20to%20ask%20their%20opinion%20on%20whether%20to%20add%20a%20Tags%20field%20to%20locations%2C%20but%20I%20ended%20up%20not%20needing%20any%20convincing.%20Expect%20a%20Tags%20field%20in%201.2%21%20In%20the%20meantime%2C%20here%27s%20some%20insight%20into%20how%20my%20brain%20works%20when%20I%20develop.%0A%0A---%0A%0A&amp;source=Aliso the Geek" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://alisothegeek.com/2009/09/a-rambling-train-of-thought-on-simplemap-categories-tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How NOT to make a WordPress plugin</title>
		<link>http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/</link>
		<comments>http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 01:48:52 +0000</pubDate>
		<dc:creator>abarrett</dc:creator>
				<category><![CDATA[Best Practices]]></category>

		<guid isPermaLink="false">http://alisothegeek.com/?p=234</guid>
		<description><![CDATA[At Brave New Media, we&#8217;re working on an intranet-style site for one of our big clients. We&#8217;re using a combination of WordPress and a custom web-based file management software to build it. The Sales department of this company is divided &#8230; <a href="http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/26325011@N00/490423135"><img class="alignleft" style="margin-left: 5px;margin-right: 5px;border: 0px initial initial" title="HTML CAN NOT DO THAT!!!1!!" src="http://farm1.static.flickr.com/221/490423135_a7e8e7b8fa_m.jpg" border="0" alt="HTML CAN NOT DO THAT!!!1!!" hspace="5" width="202" height="240" /></a>At <a title="Brave New Media" href="http://www.bravenewmedia.net/">Brave New Media</a>, we&#8217;re working on an intranet-style site for one of our big clients. We&#8217;re using a combination of WordPress and a custom web-based file management software to build it. The Sales department of this company is divided up into a number of teams, and the user accounts in WordPress needed to have different security levels based on which team the employees belong to. Enter the UserGroups plugin, which I will probably never release to the public. Here&#8217;s why.</p>
<p>It started out pretty simply: we only needed a few different security levels, because a lot of the teams could share the same level of access to the site&#8217;s content. I made a simple(-ish) plugin that added an extra table to the WordPress install and defined a number of groups (an unlimited number, technically, but we only needed five to start). In the interface, you could choose which WordPress roles each group was equivalent to, and which other groups each one could share access with. For example, the Admin group would include the access levels of the Basic AND Executive groups, while the Executive group would share Basic&#8217;s access but NOT Admin, and Basic didn&#8217;t share anyone&#8217;s access. I even figured out how to add a drop-down menu to the user add &amp; edit forms to choose a group for each user. Everything was as it should be in a plugin: dependent only on the files in the plugin folder.</p>
<p>Since then, UserGroups has ballooned into a monster of epic proportions that now prevents any automatic upgrading of WordPress. Why? Because I had to edit the core WordPress files to make things work in a hurry. The true scope of the project wasn&#8217;t clearly defined at the start, so addition after addition came to the list of requirements, and complications popped up in every function I had written in my tiny little plugin. Now the WordPress install has four extra tables, and only the original extra one is even created or destroyed by the plugin install. The core files in the wp-admin folder are altered to insert even more options into the user add &amp; edit forms. There are not only groups now, but also teams, which do not affect security level but still need to be distinguished. There are sub-groups within the groups. It&#8217;s all functional, but it&#8217;s a complete mess that is in no way compartmentalized. On top of all this, it&#8217;s still not complete yet.</p>
<p>The moral of the story? <em><span style="color: #ccffff">Have a very clear picture of what the end result needs to be</span></em> before you even start a plugin (or any other project of any kind, really). This could have been a really cool plugin to release as a freebie, and now it&#8217;s going to be too much work to dig it out of the piles of trashy code it&#8217;s buried in.</p>
<p>This is a pretty short post, but the single piece of information in it is something I consider very valuable knowledge. Everyone has been through it, but I wanted to remind everyone of how frustrating it is and how easily it can be avoided.</p>
<p>Hopefully, the next time a project like this comes along, this little programmer will remember to talk directly to the client about what actually needs to be built before she starts building it&#8230;</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+NOT+to+make+a+WordPress+plugin+-+http://b2l.me/agrrft&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/&amp;t=How+NOT+to+make+a+WordPress+plugin" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/&amp;title=How+NOT+to+make+a+WordPress+plugin" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/&amp;title=How+NOT+to+make+a+WordPress+plugin" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/&amp;title=How+NOT+to+make+a+WordPress+plugin" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/&amp;title=How+NOT+to+make+a+WordPress+plugin" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/&amp;title=How+NOT+to+make+a+WordPress+plugin&amp;summary=At%20Brave%20New%20Media%2C%20we%27re%20working%20on%20an%20intranet-style%20site%20for%20one%20of%20our%20big%20clients.%20We%27re%20using%20a%20combination%20of%20WordPress%20and%20a%20custom%20web-based%20file%20management%20software%20to%20build%20it.%20The%20Sales%20department%20of%20this%20company%20is%20divided%20up%20into%20a%20number%20of%20teams%2C%20and%20the%20user%20accounts%20in%20WordPress%20ne&amp;source=Aliso the Geek" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://alisothegeek.com/2009/08/how-not-to-make-a-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
