<?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>Nerdaphernalia &#187; efficiency</title>
	<atom:link href="http://striderweb.com/nerdaphernalia/tag/efficiency/feed/" rel="self" type="application/rss+xml" />
	<link>http://striderweb.com/nerdaphernalia</link>
	<description>"It's All Geek To Me"</description>
	<lastBuildDate>Wed, 21 Dec 2011 18:51:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Use Classes in your WordPress plugins to increase code portability and reduce name conflicts</title>
		<link>http://striderweb.com/nerdaphernalia/2008/07/use-classes-in-your-wordpress-plugins/</link>
		<comments>http://striderweb.com/nerdaphernalia/2008/07/use-classes-in-your-wordpress-plugins/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 15:16:21 +0000</pubDate>
		<dc:creator>Stephen R</dc:creator>
				<category><![CDATA[Codecraft]]></category>
		<category><![CDATA[Webcraft]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[efficiency]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=102</guid>
		<description><![CDATA[One of the most powerful features of WordPress is the huge community of developers making plugins that extend the software far beyond what the core application provides. It also allows people to add just what they want to use, rather than having a single bloated homogeneous download. There are drawbacks as well, of course. Any [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most powerful features of WordPress is the huge community of developers making plugins that extend the software far beyond what the core application provides.  It also allows people to add just what they want to use, rather than having a single bloated homogeneous download.  There are drawbacks as well, of course.</p>
<p>Any time a software package opens itself up to third-party additions, there is a potential for mischief.  With WordPress, different plugins can end up stumbling over each other, as each is coded for the core but doesn&#8217;t anticipate other plugins.  You can also have naming conflicts &#8212; when functions or variables in different plugins are given the same name.  This is often avoided by adding the plugin name to the beginning of each and every function, variable, constant, etc.</p>
<p>If you have multiple plugins, you probably have a good bit of code that you reuse in all of them.  If you&#8217;ve been appending the plugin name all along, then any time you update those common functions, you can&#8217;t simply copy the new versions over to the other plugins &#8212; you have to go over them and update the function names and any internal calls from one function to another.<span class="pullquote"><!-- These problems can be avoided by using classes --></span></p>
<p>These problems and others can be avoided by using classes.</p>
<p>By wrapping your plugin&#8217;s functions in a PHP class, you gain a number of advantages.  You can set plugin-wide variables.  You can use common function names and create easily-remembered &#8220;wrapper&#8221; functions that modify the way common WP functions do things.  You can create portable functions that can be copy-pasted into other plugins without any adjustment.</p>
<p>Ready?  Let&#8217;s get started&#8230;(...)<br/>Read the rest of <a href="http://striderweb.com/nerdaphernalia/2008/07/use-classes-in-your-wordpress-plugins/">Use Classes in your WordPress plugins to increase code portability and reduce name conflicts</a> (835 words)</p>
<hr />
© <a href="http://striderweb.com/">Stephen Rider</a> 2008
<p>This article was originally published at <a href="http://striderweb.com/nerdaphernalia">Nerdaphernalia</a>.  <a href="http://planetwordpress.planetozh.com/" rel="nofollow">Planet WordPress</a> is authorized to reproduce WordPress-related entries.  <em>If you're reading this at any other web site, the site owner is stealing copyrighted work.  Please visit the original page:</em></p>

<small><a href="http://striderweb.com/nerdaphernalia/2008/07/use-classes-in-your-wordpress-plugins/">Permalink to Use Classes in your WordPress plugins to increase code portability and reduce name conflicts</a></small>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://striderweb.com/nerdaphernalia/2008/07/use-classes-in-your-wordpress-plugins/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

