<?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; PHP</title>
	<atom:link href="http://striderweb.com/nerdaphernalia/tag/php/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.2</generator>
		<item>
		<title>How to Close a WordPress Site</title>
		<link>http://striderweb.com/nerdaphernalia/2011/05/how-to-close-a-wordpress-site/</link>
		<comments>http://striderweb.com/nerdaphernalia/2011/05/how-to-close-a-wordpress-site/#comments</comments>
		<pubDate>Wed, 18 May 2011 20:10:54 +0000</pubDate>
		<dc:creator>Stephen R</dc:creator>
				<category><![CDATA['Nuff  said]]></category>
		<category><![CDATA[Webcraft]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=272</guid>
		<description><![CDATA[I recently was asked to close down a site I had put up using WordPress. I didn&#8217;t want to just delete the whole thing, as I figured somebody might want it put back up in the future. There are several easy ways to do this, but I think I&#8217;ve found the best. My first impulse [...]]]></description>
			<content:encoded><![CDATA[<p>I recently was asked to close down a site I had put up using WordPress.  I didn&#8217;t want to just delete the whole thing, as I figured somebody might want it put back up in the future.  There are several easy ways to do this, but I think I&#8217;ve found the best.</p>
<p>My first impulse was to add an <code>exit;</code> line to index.php.  The problem there is that it doesn&#8217;t close off the wp-admin section.  I could comment out the database password in config, but that leaves a &#8220;Could not connect to database&#8221; message.  I wanted every aspect of the site gone.  Then it struck me:  One file that absolutely every single call to WordPress must pass through is <code>wp-config.php</code>.</p>
<p>So if you want to &#8220;disappear&#8221; a WordPress site quickly and easily, just open up <code>wp-config.php</code> and add the following right after the opening PHP tag:</p>
<p><code>exit;</code></p>
<p>If you want to put up some kind of &#8220;goodbye&#8221; message in HTML, you can do something like this at the top of that file:</p>
<pre><code>&lt;?php
?&gt;&lt;!DOCTYPE html&gt;
&lt;html&gt;&lt;body&gt;&lt;p&gt;This site is closed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
&lt;?php
exit;

...</code></pre>
<p>Even more briefly, of course, you could stick a short message inside a <code>die()</code> statement.  The HTML gives you a bit more flexibility though.</p>
<p>Hope somebody finds this useful. <img src='http://striderweb.com/nerdaphernalia/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<hr />
© <a href="http://striderweb.com/">Stephen Rider</a> 2011
<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/2011/05/how-to-close-a-wordpress-site/">Permalink to How to Close a WordPress Site</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/2011/05/how-to-close-a-wordpress-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search Everywhere in MySQL</title>
		<link>http://striderweb.com/nerdaphernalia/2010/05/search-everywhere-in-mysql/</link>
		<comments>http://striderweb.com/nerdaphernalia/2010/05/search-everywhere-in-mysql/#comments</comments>
		<pubDate>Mon, 17 May 2010 16:04:35 +0000</pubDate>
		<dc:creator>Stephen R</dc:creator>
				<category><![CDATA['Nuff  said]]></category>
		<category><![CDATA[Gadgets and Gewgaws]]></category>
		<category><![CDATA[On the Front Lines]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/2010/05/search-everywhere-in-mysql/</guid>
		<description><![CDATA[In recent months I&#8217;ve been tasked with taking over management of a web site programmed by somebody else. They used Drupal, with which I&#8217;m not familiar, and so a big part of the job is simply figuring out how that system works. In many cases I&#8217;ve wanted to search the entire database for a particular [...]]]></description>
			<content:encoded><![CDATA[<p>In recent months I&#8217;ve been tasked with taking over management of a web site programmed by somebody else.  They used Drupal, with which I&#8217;m not familiar, and so a big part of the job is simply figuring out how that system works.  In many cases I&#8217;ve wanted to search the entire database for a particular string of text, in order simply to find out where certain data is stored in the database.</p>
<p>I hunted over the web looking for a way to search an entire MySQL database &#8212; all tables, all fields &#8212; for text.  For the most part I find forums with answers such as &#8220;Well, you set up your database wrong&#8221;.  These kinds of responses remind me of the sequence in the movie &#8220;Funny Farm&#8221; where the truck driver is trying to find the town of Redbud.  In short:</p>
<p>&#8220;Hey Mac, how do you get to Redbud?&#8221;</p>
<p>&#8220;If I wanted to go to Redbud, I wouldn&#8217;t start from here.&#8221;</p>
<p>Nonsensical and useless.  If you&#8217;re here now, then this is where you&#8217;re starting from; telling me to start from somewhere else is simply a non-answer.  <span class="pullquote">Funny in a movie, but frustrating in real life</span>.</p>
<p>Today I came across a most excellent script, the <a href="http://sewmyheadon.com/2009/mysql-search-replace-tool/">MySQL Database Search &#038; Replace Tool</a>.  It&#8217;s a PHP page that you can drop into a web site and call from your browser.  It will search the entire database for a string of text &#8212; exactly what I needed.</p>
<p>In a quick test run it threw out a couple errors but then gave me useful results; so it&#8217;s not entirely polished, but quite functional and useful.  Kudos to <a href="http://www.mgdigital.co.uk/">Mark Jackson</a> and <a href="http://sewmyheadon.com">Eric Amundson</a> for releasing this great tool!</p>
<hr />
© <a href="http://striderweb.com/">Stephen Rider</a> 2010
<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/2010/05/search-everywhere-in-mysql/">Permalink to Search Everywhere in MySQL</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/2010/05/search-everywhere-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual Multiblog &#8212; how to use unique headers on blogs running the same theme</title>
		<link>http://striderweb.com/nerdaphernalia/2008/08/vmb-unique-headers-on-blogs-running-the-same-theme/</link>
		<comments>http://striderweb.com/nerdaphernalia/2008/08/vmb-unique-headers-on-blogs-running-the-same-theme/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 15:58:01 +0000</pubDate>
		<dc:creator>Stephen R</dc:creator>
				<category><![CDATA[Codecraft]]></category>
		<category><![CDATA[Webcraft]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[customization]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[Virtual Multiblog]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=182</guid>
		<description><![CDATA[One of the most common questions I get regarding the Virtual Multiblog system for WordPress comes from people wanting to have multiple blogs running on the same theme, but with a different header for each blog. It can be done, and it&#8217;s fairly easy to do. Once you have it set up, you could use [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most common questions I get regarding the <a href="http://striderweb.com/nerdaphernalia/features/virtual-multiblog/">Virtual Multiblog</a> system for WordPress comes from people wanting to have multiple blogs running on the same theme, but with a different header for each blog.  It can be done, and it&#8217;s fairly easy to do.  Once you have it set up, you could use it to call <em>any</em> distinct file on a per-blog basis &#8212; a different CSS file, or a different footer perhaps.</p>
<p>I&#8217;ve never been too active about showing this to people, because the function required to do it is not one I consider completely stable &#8212; I din&#8217;t want to show people how to do it only to have it break the next time I update the VMB system.  In response to the requests, however, I am adding a function to the upcoming release (currently in private beta).  You can have that ability right now, in a way that should not cause problems with later updates &#8212; just add a short function to your existing vmb-functions.php file.<br />
(...)<br/>Read the rest of <a href="http://striderweb.com/nerdaphernalia/2008/08/vmb-unique-headers-on-blogs-running-the-same-theme/">Virtual Multiblog &#8212; how to use unique headers on blogs running the same theme</a> (293 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/08/vmb-unique-headers-on-blogs-running-the-same-theme/">Permalink to Virtual Multiblog &#8212; how to use unique headers on blogs running the same theme</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/08/vmb-unique-headers-on-blogs-running-the-same-theme/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<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>7</slash:comments>
		</item>
		<item>
		<title>Consolidate Options with Arrays in your WordPress Plugins</title>
		<link>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/</link>
		<comments>http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 22:24:15 +0000</pubDate>
		<dc:creator>Stephen R</dc:creator>
				<category><![CDATA[Codecraft]]></category>
		<category><![CDATA[Webcraft]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[elegant design]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=78</guid>
		<description><![CDATA[If you&#8217;ve ever written a plugin for WordPress you&#8217;ve probably dealt with giving the end user options. Unless you&#8217;ve taken the low road and forced the user to directly edit the plugin file, &#8220;options&#8221; means a Settings screen in the WordPress admin, and most likely you are storing those options in the blog&#8217;s wp-options table. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever written a plugin for WordPress you&#8217;ve probably dealt with giving the end user options.  Unless you&#8217;ve taken the low road and forced the user to directly edit the plugin file, &#8220;options&#8221; means a Settings screen in the WordPress admin, and most likely you are storing those options in the blog&#8217;s <code>wp-options</code> table.  Over time, bloggers using various plugins can end up with hundreds of <a href="#fnote78_1" class="fnotelink">extraneous records in their options table<sup>*</sup></a>.  If they ever stop using a plugin, or if they ever want to manually clear out options, this job can be made difficult by all the clutter, and the problem is made far worse when plugin authors add a new record for each separate setting in a plugin.  Beyond the mess, plugins written this way generally make many more calls to the database than they need to, which adds unnecessary burden on the server.</p>
<p>I have seen and used plugins that added anywhere from ten to thirty new records to the options table, and a correspondent of mine reports that he has encountered a plugin that, upon activation, adds <span class="pullquote"><!-- A whopping 140 new records.... Egad! -->a whopping <em>140</em> new records to <code>wp_options</code>.   Egad!</span>  There has to be a better way!</p>
<p>There <em>is</em> a better way.  With a few simple changes to your code, plugin authors can put all the various settings into an array, and enter that array as a single record in the options table.  This article will show you how.</p>
<p>On this site I use a plugin called ShrinkyLink.  It performs the straightforward but useful function of shortening long URLs to a specified length, or replacing the link text entirely with a specified string.  It was created by Andrew Rader, but as far as I can tell his web site no longer exists. For the purposes of this article, it has a number of good qualities:</p>
<ul>
<li>It inserts 10 separate records into the WordPress options table</li>
<li>It is not likely to see further updates from the original author</li>
<li>It is useful and thus worthy of updating</li>
<li>The original author was kind enough to release it under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GPL2 license</a></li>
</ul>
<p>The last version of ShrinkyLink was 0.2, released in 2006.  Today we&#8217;re going to begin the rehabilitation of this plugin and create a version 0.3 that stores all its settings in a single array.</p>
<p>I&#8217;m going to split this into multiple sections:</p>
<ol>
<li>How to set and retrieve settings using arrays</li>
<li>Upgrading your plugin&#8217;s Admin Screen form to use an array</li>
<li>Upgrading existing settings from multiple records to a single array</li>
</ol>
<p>Let&#8217;s get to it.</p>
<p>(...)<br/>Read the rest of <a href="http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/">Consolidate Options with Arrays in your WordPress Plugins</a> (1,731 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/consolidate-options-with-arrays/">Permalink to Consolidate Options with Arrays in your WordPress Plugins</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/consolidate-options-with-arrays/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Give your WordPress plugin credit without cluttering the GUI</title>
		<link>http://striderweb.com/nerdaphernalia/2008/06/give-your-wordpress-plugin-credit/</link>
		<comments>http://striderweb.com/nerdaphernalia/2008/06/give-your-wordpress-plugin-credit/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 13:34:03 +0000</pubDate>
		<dc:creator>Stephen R</dc:creator>
				<category><![CDATA[GUI Goodness]]></category>
		<category><![CDATA[Webcraft]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=73</guid>
		<description><![CDATA[In a previous post I discussed the idea of locating your plugin&#8217;s Settings screen where it made sense within the Admin menus &#8212; giving an example of my own pull-quotes plugin&#8217;s Settings going under the Design menu. I briefly touched on a further aspect of this, when I suggested that authors not make their plugins [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="/nerdaphernalia/2008/06/on-plugin-design/">previous post</a> I discussed the idea of locating your plugin&#8217;s Settings screen where it made sense within the Admin menus &#8212; giving an example of my own pull-quotes plugin&#8217;s Settings going under the Design menu.  I briefly touched on a further aspect of this, when I suggested that authors not make their plugins scream &#8220;This is a plugin!&#8221;</p>
<p><img src="/wp-content/docs/nerd/images/holiday_inn_sign.jpg" alt="A massive neon Holiday Inn sign" title="Ah, the 70s..." style="float: right;" />I&#8217;m sure a lot of people reading that first thought &#8220;But wait!  I put a lot of time into my plugin &#8212; I <em>want</em> people to know that it&#8217;s a plugin!&#8221;  So we end up with an admin screen titled <strong>John&#8217;s Comment Filter Plugin 3.2</strong> or worse, a &#8220;<a href="http://en.wikipedia.org/wiki/Mystery_meat_navigation">mystery meat</a>&#8221; menu item that <a href="#fnote73_1" class="fnotelink">doesn&#8217;t identify what the plugin does at all<sup>1</sup></a>!  That first example is somewhat like having a store with a giant flashing neon sign up front &#8212; it certainly gets the information across, but it&#8217;s not all that attractive, and very obtrusive on the surrounding landscape.</p>
<p>I admit that we&#8217;re riding a line here &#8212; we all want credit for our hard work; but awkward plugin integration, spread out over multiple plugins, can end up making WordPress itself look awfully kludgy.  <span class="pullquote pqLeft"><!-- Our plugins deserve better -->Our blogs, and our plugins, deserve better than that!</span></p>
<p>So, we&#8217;re looking for a way to give credit where credit is due, while maintaining a clean integrated interface that looks as though it were a part of WordPress from the beginning.  First, name the menu item for what the screen is for, not what the plugin is called.  Ditto the page &lt;title&gt; and header.  By way of example, my pull-quotes plugin is called &#8220;JavaScript Pull-Quotes&#8221;, but the Admin screen is under Design -&gt; Pull-Quotes, and the page title and header read &#8220;Pull-Quote Settings&#8221;.  The menu item and page header do <em>not</em> have to match the name of the plugin!</p>
<p>Okay, so&#8230; what if you still want to show the plugin name, and maybe have a link back to the plugin&#8217;s homepage?  Simply allow your eyes to drift downward to the bottom of the admin screen&#8230;</p>
<p><img src="/wp-content/docs/nerd/images/discreet_plugin_attribution.png" height="146" width="469" alt="screenshot" title="" /></p>
<p>There&#8217;s the name of the plugin, the version number, and a link back to the home page; but it&#8217;s discreet and unobtrusive &#8212; it looks as though it belongs there.  The information is there if you&#8217;re interested, but it doesn&#8217;t get in your way if you&#8217;re not; giving us a good balance between giving credit and keeping the GUI clean.  Of course, if enough plugin authors start doing it on all their plugins, people will come to expect that bit of extra info, and that little slice of screen real estate will be as good as gold.</p>
<p>Here&#8217;s how I do it:</p>
<ul>
<li>Within the function that creates the content of the Admin page itself, put the following line (probably best at the very beginning or very end of the function):
<pre><code>add_action( 'in_admin_footer', 'myplugin_admin_footer' );</code>
</pre>
<p>This attaches a function to the page footer that will insert our attribution text.
</li>
<li>Then of course we have to add the footer function itself:
<pre><code>function myplugin_admin_footer() {
	$plugin_data = get_plugin_data( __FILE__ );
	printf('%1$s plugin | Version %2$s&lt;br /&gt;', $plugin_data['Title'], $plugin_data['Version']);
}</code>
</pre>
</li>
</ul>
<p>That&#8217;s pretty straightforward &#8212; all we&#8217;re doing is outputting a line of HTML &#8212; but I should point out a couple of things.  <del datetime="2008-07-02T04:35:59+00:00" title="Removed -- see update note at bottom of article">First, we&#8217;re wrapping it in an <code>if()</code> and checking against <code>$_SERVER['REQUEST_URI']</code> because we don&#8217;t want our plugin&#8217;s attribution showing up on every page.  (Of course, you&#8217;ll have to change the URL string in that <code>if()</code> so it&#8217;s right for your particular page.)</del>  You can use <code>in_admin_footer</code> to insert anything you like, of course, but in the interests of creating something resembling a standard, I hope you consider sticking to the format I give above.  (One alternate that comes to mind, however, is that some people might prefer to use something like &#8220;Comments Filter Plugin | Version 3.2 | By John Smith&#8221;.  Go for it. <img src='http://striderweb.com/nerdaphernalia/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )  I definitely recommend the <code >&lt;br /&gt;</code> at the end of the text you&#8217;re inserting &#8212; otherwise it will be clumped on the same line as the existing text, which will look cluttered and will diminish your own plugin&#8217;s attribution.</p>
<p>We&#8217;ve just torn down the ugly neon sign, and replaced it with an engraved brass plaque next to the door.  Not too bad, that.  In the longer run, this is something that might be nice to roll into core WordPress code, which would <em>really</em> make it a consistent standard.  Until then, it&#8217;s quite easy to give your own plugins credit in a way that cleanly and elegantly integrates with WordPress.</p>
<p class="update">[Update: Ozh improved upon my code a bit by moving the <code>add_action()</code> into the function that creates the Admin page itself.  It simplified things quite nicely, and the code above has been adjusted accordingly.]</p>
<p class="update">[There are updates to this topic <a href="http://striderweb.com/nerdaphernalia/2008/07/wordpress-plugin-attribution-footer-update/">here</a> and <a href="http://striderweb.com/nerdaphernalia/2008/07/on-attribution-and-plugin-priorities-in-wordpress/">here</a>.]</p>
<p class="note">Previously: <a href="/nerdaphernalia/2008/06/wp-use-action-links/">Use Action Links to direct users straight to your WordPress plugin&#8217;s admin page</a></p>
<p class="note">Coming next: <a href="/nerdaphernalia/2008/07/consolidate-options-with-arrays/">Consolidating your plugin&#8217;s settings so you don&#8217;t clutter up users&#8217; <code>wp_options</code> tables</a></p>
<div class="fnote" id="fnote73_1">1: I didn&#8217;t originally intend to name names, but a good example jumped out at me recently.  Under the &#8220;Manage&#8221; menu I have an item called &#8220;<a href="http://joelstarnes.co.uk/pagemash/">pageMash</a>&#8220;.  Quick (no peeking!) &#8212; what does it do???  It&#8217;s an <em>amazing</em> plugin, by the way, just poorly integrated in the menus.</div>
<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/06/give-your-wordpress-plugin-credit/">Permalink to Give your WordPress plugin credit without cluttering the GUI</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/06/give-your-wordpress-plugin-credit/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Use Action Links to direct users straight to your WordPress plugin&#8217;s admin page</title>
		<link>http://striderweb.com/nerdaphernalia/2008/06/wp-use-action-links/</link>
		<comments>http://striderweb.com/nerdaphernalia/2008/06/wp-use-action-links/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 14:30:12 +0000</pubDate>
		<dc:creator>Stephen R</dc:creator>
				<category><![CDATA[GUI Goodness]]></category>
		<category><![CDATA[Webcraft]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=72</guid>
		<description><![CDATA[I&#8217;ve recently come across repeated discussions (especially on the wp-hackers mailing list) debating where plugin authors should place their custom admin pages. I discussed that question directly in my previous post, and basically stated that the plugin&#8217;s admin page can go any number of places, depending on what the plugin does. Some people disagree with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently come across repeated discussions (especially on the <a href="http://lists.automattic.com/mailman/listinfo/wp-hackers">wp-hackers mailing list</a>) debating where plugin authors should place their custom admin pages.  I discussed that question directly in my <a href="/nerdaphernalia/2008/06/on-plugin-design/" title="Nerdaphernalia: On Plugin Design and Integration">previous post</a>, and basically stated that the plugin&#8217;s admin page can go any number of places, depending on what the plugin does.  Some people disagree with this argument, saying that <strong>all</strong> plugin admin screens should go under one menu &#8212; usually &#8220;Settings&#8221; or &#8220;Plugins&#8221;, depending on whom you ask.</p>
<p><span class="pullquote">While I disagree, they do raise one good point</span>:  many end users will have trouble finding your admin page because they have come to expect such pages to all be dumped under Settings.  Many plugin authors solve this by hard coding a link into the plugin Description, but this really isn&#8217;t the right place for that, and it can create inappropriate clutter in <a class="fnotelink" href="#fnote72_1">certain situations<sup>1</sup></a>.  There is a better way.</p>
<p>WordPress 2.5 makes it fairly easy for plugin authors to add &#8220;action&#8221; links to the Plugin Management screen, like so:</p>
<p><img src="/wp-content/docs/nerd/images/plugin_action_link.gif" alt='Screen shot of a "Settings" link next to the normal plugin "Deactivate" link' title="" height="68" width="488" /><br />
(...)<br/>Read the rest of <a href="http://striderweb.com/nerdaphernalia/2008/06/wp-use-action-links/">Use Action Links to direct users straight to your WordPress plugin&#8217;s admin page</a> (522 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/06/wp-use-action-links/">Permalink to Use Action Links to direct users straight to your WordPress plugin&#8217;s admin page</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/06/wp-use-action-links/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Virtual Multiblog v2.3 for WordPress</title>
		<link>http://striderweb.com/nerdaphernalia/2008/06/virtual-multiblog-v23-for-wordpress/</link>
		<comments>http://striderweb.com/nerdaphernalia/2008/06/virtual-multiblog-v23-for-wordpress/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 14:50:24 +0000</pubDate>
		<dc:creator>Stephen R</dc:creator>
				<category><![CDATA[Webcraft]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[multiblog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://striderweb.com/nerdaphernalia/?p=70</guid>
		<description><![CDATA[I&#8217;ve released a new version of the Virtual Multiblog system for WordPress. Version 2.3 is mostly under-the-hood improvements, but it might fix some of the issues people have. Additionally, I&#8217;ve made a few updates so it fits more seamlessly within the WordPress 2.5 Admin section. I&#8217;ve also managed to abstract the optional Multiblog Support plugin [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve released a new version of the Virtual Multiblog system for WordPress.</p>
<p>Version 2.3 is mostly under-the-hood improvements, but it might fix some of the issues people have.  Additionally, I&#8217;ve made a few updates so it fits more seamlessly within the WordPress 2.5 Admin section.</p>
<p>I&#8217;ve also managed to abstract the optional Multiblog Support plugin to such a point that after this update you may never have to update it again!  All plugin functions are now within the <code>/multiblog/</code> folder, so changes down the road will happen within the main VMB system files instead of the separate plugin file.</p>
<p><a href="/nerdaphernalia/features/virtual-multiblogvirtual-multiblog/">Go get it</a>, and Enjoy!  <img src='http://striderweb.com/nerdaphernalia/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </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/06/virtual-multiblog-v23-for-wordpress/">Permalink to Virtual Multiblog v2.3 for WordPress</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/06/virtual-multiblog-v23-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

