<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>MettaProgramming &#187; WordPress</title>
	<atom:link href="http://mettadore.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://mettadore.com</link>
	<description>Thoughts on Software and Technology</description>
	<lastBuildDate>Mon, 09 Apr 2012 19:11:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Introducing The Rant-o-Meter WordPress plugin</title>
		<link>http://mettadore.com/wordpress/introducing-the-rant-o-meter-wordpress-plugin/</link>
		<comments>http://mettadore.com/wordpress/introducing-the-rant-o-meter-wordpress-plugin/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 01:27:10 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=720</guid>
		<description><![CDATA[This morning I wrote a bit of a rant about the Verified by Visa password limitations and an issue came up that has come up for me before. How to quickly, but comically, let someone know what they are getting into when they come to a post on my blog? Like some kind of &#8220;Rant [...]]]></description>
			<content:encoded><![CDATA[<p>This morning I wrote a bit of <a href="http://mettadore.com/analysis/stupid-security-verified-by-visa/">a rant</a> about the Verified by Visa password limitations and an issue came up that has come up for me before. How to quickly, but comically, let someone know what they are getting into when they come to a post on my blog? Like some kind of &#8220;Rant indicator&#8221; to make them aware of what my mood is?</p>
<p>[rant-o-meter mood="Happy" align="right"] I&#8217;ve thought about making one for a while, and just never get around to it. So, today I decided to take advantage of the <a href="http://code.google.com/apis/chart/">Google Chart Tools</a> and create a quick and dirty WordPress plugin called <a href="https://github.com/johnmetta/rant-o-meter">Rant-o-Meter</a>.</p>
<p>Rant-o-Meter simply takes the shortcode <span style="font-family: andale mono,times">rant-o-meter</span> and replaces it with a Google-o-Meter.<sup><a href="http://mettadore.com/wordpress/introducing-the-rant-o-meter-wordpress-plugin/#footnote_0_720" id="identifier_0_720" class="footnote-link footnote-identifier-link" title="It&amp;#8217;s really something of a &amp;#8220;Google-o-Meter&amp;#8221; plugin rather than a specific Rant-o-Meter, but that doesn&amp;#8217;t matter to me so much.">1</a></sup></p>
<pre>[rant–o–meter]

[rant–o–meter level=80 mood="Pissed off" align="left"]
</pre>
<p>It has a variety of options for formatting the resulting Google-o-Meter, such as the level of rant-i-ness, the mood, the top and bottom of your rant-i-ness scale<sup><a href="http://mettadore.com/wordpress/introducing-the-rant-o-meter-wordpress-plugin/#footnote_1_720" id="identifier_1_720" class="footnote-link footnote-identifier-link" title="I chose &amp;#8220;Buffalo&amp;#8221; and &amp;#8220;Hood River&amp;#8221; as the defaults because that&amp;#8217;s sort of my &amp;#8220;Rant-level baseline indicator&amp;#8221;">2</a></sup>.</p>
<p>The full list of options is available on The <a href="https://github.com/johnmetta/rant-o-meter">Rant-o-Meter Github site</a>, so I won&#8217;t go into them here. I will say that this whole thing comprised about 45 minutes of work, so I know that there are various ways that it could be improved. I haven&#8217;t bothered to list it in the WordPress plugin directory because of that. Eventually, I may do that, but for now, it&#8217;s just a gimmick.</p>
<ol class="footnotes"><li id="footnote_0_720" class="footnote">It&#8217;s really something of a &#8220;Google-o-Meter&#8221; plugin rather than a specific Rant-o-Meter, but that doesn&#8217;t matter to me so much.</li><li id="footnote_1_720" class="footnote">I chose &#8220;Buffalo&#8221; and &#8220;Hood River&#8221; as the defaults because that&#8217;s sort of my &#8220;Rant-level baseline indicator&#8221;</li></ol>]]></content:encoded>
			<wfw:commentRss>http://mettadore.com/wordpress/introducing-the-rant-o-meter-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wildcard Subdomains with A Small Orange</title>
		<link>http://mettadore.com/wordpress/wildcard-subdomains-with-a-small-orange/</link>
		<comments>http://mettadore.com/wordpress/wildcard-subdomains-with-a-small-orange/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 15:58:15 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[A Small Orange]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[subdomain]]></category>
		<category><![CDATA[wildcard subdomains]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=601</guid>
		<description><![CDATA[Real quick post to add to the Googleverse about setting up a wildcard subdomain with A Small Orange, which I recently tried to do and couldn&#8217;t figure out right away. If you, as the documentation and the support ticket staff both told me, go to the Advanced DNS Editor to enter a wildcard DNS record, [...]]]></description>
			<content:encoded><![CDATA[<p>Real quick post to add to the Googleverse about setting up a wildcard subdomain with <a href="http://www.asmallorange.com/">A Small Orange</a>, which I recently tried to do and couldn&#8217;t figure out right away.</p>
<div id="attachment_602" class="wp-caption alignright" style="width: 310px"><a href="http://mettadore.com/files/2010/09/Screen-shot-2010-09-24-at-8.46.35-AM.png"><img class="size-medium wp-image-602" src="http://mettadore.com/files/2010/09/Screen-shot-2010-09-24-at-8.46.35-AM-300x119.png" alt="" width="300" height="119" /></a><p class="wp-caption-text">Validation error using the CPanel Advanced DNS editor</p></div>
<p>If you, as the documentation and the support ticket staff both told me, go to the Advanced DNS Editor to enter a wildcard DNS record, you get an error. As you can see in the image, the validation states that the</p>
<blockquote><p><strong>Name must be a domain with an optional period at the end.</strong></p></blockquote>
<p>Of course, this is probably a CPanel issue, and not the fault of the good people at A Small Orange. It&#8217;s obvious their JavaScript validation doesn&#8217;t account for a single asterisk<sup><a href="http://mettadore.com/wordpress/wildcard-subdomains-with-a-small-orange/#footnote_0_601" id="identifier_0_601" class="footnote-link footnote-identifier-link" title="I&amp;#8217;m looking at their bug system now">1</a></sup> Still, it causes problems because we are told to use this panel.</p>
<p>Maybe it&#8217;s something I was doing wrong, but I got it to work by actually <strong>going to the Subdomains panel instead</strong>. There&#8217;s no such validation when you add a single subdomain with the name &#8220;*&#8221; (without quotes, obviously) and point it directly at /public_html/. After you do that, you can actually head back to the Advanced DNS editor and see that your new wildcard DNS record is actually registered.</p>
<p>Hope this helps someone.</p>
<ol class="footnotes"><li id="footnote_0_601" class="footnote">I&#8217;m looking at their bug system now</li></ol>]]></content:encoded>
			<wfw:commentRss>http://mettadore.com/wordpress/wildcard-subdomains-with-a-small-orange/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A quick intro to Github for WordPressers</title>
		<link>http://mettadore.com/wordpress/a-quick-intro-to-github-for-wordpressers/</link>
		<comments>http://mettadore.com/wordpress/a-quick-intro-to-github-for-wordpressers/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 01:47:51 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[source control]]></category>
		<category><![CDATA[WordCamp]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=551</guid>
		<description><![CDATA[Yesterday, I was honored to speak at WordCamp Portland about using Source Control systems with WordPress. The talk was meant as little more than a 10,000 ft view of some of the reasons you might want to consider using source control, and some of the possibilities that it presents. As always, the 10,000 foot view [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I was honored to speak at WordCamp Portland about using Source Control systems with WordPress. The talk was meant as little more than a 10,000 ft view of some of the reasons you might want to consider using source control, and some of the possibilities that it presents. As always, the 10,000 foot view is good for a comic introduction to something, but not for any real understanding. Thus, I wanted to write a series of posts detailing the whys and hows of source control in WordPress- written for people who don&#8217;t know anything about Source Control.</p>
<p>Firstly, let me say this: I&#8217;m not making a statement on Git vs. Subversion vs. Source Safe vs. CVS vs. the weird text-based logging system you developed 10 years ago and haven&#8217;t ever changed. I&#8217;m making a statement about using source control period, and using Git as an example because that&#8217;s what I use.<sup><a href="http://mettadore.com/wordpress/a-quick-intro-to-github-for-wordpressers/#footnote_0_551" id="identifier_0_551" class="footnote-link footnote-identifier-link" title="Flame war: The un-winnable situation in which everything I do is amazing and everything you do sucks. I don&amp;#8217;t care what source control system you use- and think that it&amp;#8217;s a bad idea to use Git if another one is better suited to your needs. Still, if you&amp;#8217;re not using any system, you may as well choose Git because then this article will be easier to follow. Yes, I could give examples in Subversion and Mercurial, but this is not a book, it&amp;#8217;s a blog post.">1</a></sup></p>
<h3>The Whys of Source Control</h3>
<p>Why? Because you&#8217;re going to wish you had in about 3… 2…</p>
<p>Seriously, things happen, you break stuff, you need to look at an older version, you want to try something and are not sure whether it&#8217;s going to break, you want to share your code with others, or take advantage of the code of others, you want to share code with yourself, etc. Source control is part of a broader development strategy that is valid whether you are a serious programmer or just modifying themes for yourself or clients. There are dozens of reasons why source control is A Good Thing™.</p>
<p>The main one is that catastrophe is <em>going</em> to happen, and it&#8217;s going to happen in 3… 2…</p>
<h3>Source Control for Smarties</h3>
<p>Enough of the whys. Let&#8217;s get to some hows.</p>
<p>I won&#8217;t insult you by telling you this is Source Control for Dummies, but I don&#8217;t want you thinking that you can&#8217;t learn how to use it if you don&#8217;t want to. Like anything, it takes some getting used to.<sup><a href="http://mettadore.com/wordpress/a-quick-intro-to-github-for-wordpressers/#footnote_1_551" id="identifier_1_551" class="footnote-link footnote-identifier-link" title="Also, sometimes it seems like setting something up and learning how to use it is more trouble than just dealing with the problem when it comes up all the time. Only you can make that decision, but I guarantee that the amount of time you spend learning this will offset the amount of time you spend working (and recovering from failure) if you don&amp;#8217;t.">2</a></sup></p>
<h3>Git vs. Github</h3>
<p>Right off the bat let&#8217;s clear up <a href="http://git-scm.com/">Git</a> vs. <a href="http://github.com">Github</a>.</p>
<ul>
<li><strong>Git</strong> is source control management software (the way that WordPress.org is <em>blogging</em> software)</li>
<li><strong>Github</strong> hosts Git repositories (the way that <a href="http://wordpress.com">WordPress.com</a> hosts blogs)</li>
<li><strong>Git</strong> is software that allows you to track the changes that you make to individual files</li>
<li><strong>Github</strong> is a company providing a nice looking website to help do that, well as other neat things</li>
</ul>
<p>If you haven&#8217;t already done it, go to Github right now and sign up for an account. It&#8217;s free, they are full of awesome sauce, and you can then fork some of the examples I&#8217;m going to give you.</p>
<p>Oh, and you will want to install Git too.</p>
<h3>The Fast Install Guide</h3>
<ul>
<li>If you&#8217;re on a Mac, use Homebrew (i.e. &#8220;brew install git&#8221;)</li>
<li>If you&#8217;re on Linux, use the package manager (e.g. &#8220;apt-get install git&#8221;)</li>
<li>If you&#8217;re on Windows, buy a Mac (i.e. &#8220;ba dum CHING!&#8221;)</li>
</ul>
<p>Okay, seriously, Here are the Github help pages for installing Git on <a href="http://help.github.com/win-git-installation/">Windows</a>, <a href="//help.github.com/linux-git-installation/">Linux</a> and <a href="http://help.github.com/mac-git-installation/">Mac</a>. It&#8217;s really beyond the scope of this post to detail exactly how that&#8217;s done. If enough people get lost, I&#8217;ll write a detailed post on just that. For now here are some guidelines:</p>
<ol>
<li>Install Git</li>
<li>Create an SSH key
<ol>
<li>Go to a terminal window and type &#8220;ssh-keygen&#8221;</li>
<li>In Windows, don&#8217;t use the normal &#8220;Command&#8221; window, use Start-&gt;Programs-&gt;Git-&gt;Git Bash and type that. If you installed Git using the directions above, it should work.</li>
</ol>
</li>
<li>Create your Github account if you haven&#8217;t, then go ahead and set your username and email on your local system according to <a href="http://help.github.com/git-email-settings/">these instructions</a>.</li>
<li>
<div id="attachment_557" class="wp-caption alignright" style="width: 310px"><a href="http://mettadore.com/files/2010/09/Screen-shot-2010-09-20-at-3.30.10-PM.png"><img class="size-medium wp-image-557" src="http://mettadore.com/files/2010/09/Screen-shot-2010-09-20-at-3.30.10-PM-300x62.png" alt="" width="300" height="62" /></a><p class="wp-caption-text">Sample SSH key public file</p></div>
<p>Copy the SSH public key</p>
<ol>
<li>Copy the contents of the file ~/.ssh/id_rsa.pub (or id_dsa.pub) to the clipboard</li>
<li>In Windows, this file is in C:Documents and Settings{User Name}.ssh</li>
<li>This file&#8217;s contents look something like the file to the right</li>
<li><strong>Important!</strong> Don&#8217;t copy the id_rsa file, copy the id_rsa.pub file (the .pub ending means it&#8217;s a public file- never ever give out the other one)</li>
</ol>
</li>
<li>Go your <a href="https://github.com/account#ssh_bucket">SSH key settings</a> in Github and paste the public key</li>
</ol>
<p>Now you have Git installed, and have a Github account that you can access directly from your computer.</p>
<h3>Fork it!!</h3>
<p>Okay, now that we&#8217;re all set up with our source control system, let&#8217;s take a really quick tour. As a note: I&#8217;m going to do this with the command line, not with any graphical system. I&#8217;m doing this both because it&#8217;s how I do it, and because it will help illustrate what the commands actually do. Feel free to get a graphical Git program if you&#8217;d like, the commands should be the same.</p>
<p>First, we&#8217;re going to give you a functional repository, so go to my <a href="http://github.com/mettadore/twentyten">Github repository of the WordPress TwentyTen theme</a>. In the upper right, under the User/Account/etc menu and under the Search menu are some buttons, hit the one that says &#8220;Fork.&#8221; Now, head over to my <a href="http://github.com/mettadore/thirtyten">thirty ten repository</a> and fork that. <a href="http://aaron.jorb.in/blog/2010/04/introducing-thirty-ten/">Thirty Ten</a> is the child theme developed by <a href="http://aaron.jorb.in/">Aaron Jorbin</a> and he graciously offered the code as well as an <a href="http://aaron.jorb.in/blog/2010/04/introducing-thirty-ten/">excellent blog post</a> describing its development. I&#8217;m going to use Aaron&#8217;s child theme a lot in this series.</p>
<div id="attachment_560" class="wp-caption alignright" style="width: 310px"><a href="http://mettadore.com/files/2010/09/Screen-shot-2010-09-20-at-5.18.38-PM.png"><img class="size-medium wp-image-560 " src="http://mettadore.com/files/2010/09/Screen-shot-2010-09-20-at-5.18.38-PM-300x126.png" alt="" width="300" height="126" /></a><p class="wp-caption-text">Snapshot of a repository on Github</p></div>
<p>What forking does is copy the repository to your account, but does so in such a way that it &#8220;knows&#8221; that it came from somewhere else. That way if I change my repository, you can pull the changes, and if you change yours, I can pull those changes if I want. Head over to your account and look at the Thirty Ten repository now. You&#8217;ll notice that it shows a list of files and directories showing a message next to each of them. You&#8217;ll also see that I am the user listed at the top. That means that I was the last person to &#8220;commit&#8221; my changes. Committing means making changes to files and telling Git that you want those changes, well, committed to the repository. Lastly, scroll to the bottom of the page and notice that Github is telling us that we have no README file. If there was a README file in this directory, the contents of that file would be displayed here.</p>
<p>Now, go to a command line and type:</p>
<pre>$ mkdir themes
$ cd themes
$ git clone git@github.com:USERNAME/twentyten.git
$ git clone git@github.com:USERNAME/thirtyten.git</pre>
<p>These commands make a &#8220;themes&#8221; directory on your local system, and then inside that theme directory they <em>clone</em> the TwentyTen and ThirtyTen. Cloning means making a copy of the repository that&#8217;s on Github (Replace USERNAME with your Github username, obviously). Now, all of the files that are in the Thirty Ten repository on Github are also on your local system. You have two identical copies of the Thirty Ten repository.</p>
<h3>Modifying code in a repository</h3>
<p>Now let&#8217;s go into the Thirty Ten repository and make a small change by creating a README file (feel free to do this using a graphical file manager and/or text editor):</p>
<pre>$ cd thirtyten
$ echo "This is a child theme based on TwentyTen, the default WordPress 3.x theme." &gt; README</pre>
<p>That creates the file README and puts some basic text in it. Next, we&#8217;re going to play with some Git commands. Type the command <span style="font-family: terminal,monaco">git status</span> and you&#8217;ll see:</p>
<pre>$ git status

# On branch master
# Untracked files:
#   (use "git add ..." to include in what will be committed)
#
#	README
nothing added to commit but untracked files present (use "git add" to track)</pre>
<p>This is telling us that you have one &#8220;untracked&#8221; file- a file that you haven&#8217;t told Git about. We&#8217;re going to &#8220;add&#8221; that file to our repository:</p>
<pre>$ git add README</pre>
<p>This command tells Git to add the file README to the repository. As a shortcut, if you have all files and want to add them all, you can use something like:</p>
<pre>$ git add .</pre>
<p>The dot tells Git to add &#8220;the current directory.&#8221; Since README is the only file that hasn&#8217;t already been added, it&#8217;ll only add that file. Let&#8217;s look at the status again:</p>
<pre>$ git status

# On branch master
# Changes to be committed:
#   (use "git reset HEAD ..." to unstage)
#
#	new file:   README
#</pre>
<p>Notice that &#8220;Untracked files&#8221; became &#8220;Changes to be committed.&#8221; This is the only thing we&#8217;re doing right now, so we&#8217;re going to commit this change (i.e. tell Git that you&#8217;re sure, and want this change save, tracked, and logged.)</p>
<pre>$ git commit -m "Add a readme file"</pre>
<p>The &#8220;-m&#8221; switch tells Git that we want to add a message on the commandline, instead of adding it separately. Now our changes are committed to our repository and logged and we can make more changes:</p>
<pre>$ git status
# On branch master
nothing to commit (working directory clean)</pre>
<p>Let&#8217;s go and make another change. Let&#8217;s add a special css file that we can play around with later. We&#8217;ll go ahead and add this directly to the repo.</p>
<pre>$ touch special.css
$ git add special.css
$ git commit -m "Add a blank special.css file to play with"</pre>
<p>Now we have two changes committed to our repository. They are saved, tracked, and logged. But our laptop might be stolen, so let&#8217;s &#8220;push&#8221; them to a &#8220;remote&#8221; repository for safe keeping. A remote repository is a mirror of the repository you&#8217;re using. The repository on Github is a remote repository with the name &#8220;origin.&#8221;</p>
<pre>$ git remote
origin</pre>
<p>Pushing means &#8220;Take the changes that have been committed to this repository and commit those same changes to a remote repository.&#8221; Since you only have one remote repository, you don&#8217;t even have to tell it which one:</p>
<pre>$ git push</pre>
<p>will push the changes to Github. Now go ahead and browse to your Thirty Ten repository on Github and look at it. You&#8217;ll notice that the user is now listed as you, with your last commit message. Scrolling down to the file list, you&#8217;ll see that your commit messages are listed next to the files that you changed.</p>
<h3>Coda</h3>
<p>There it is, the bare minimum you need to get started with Github, and some sample repositories to boot. In the next post, we&#8217;ll create a child theme from scratch, and use the great FTP software Filezilla to copy our changes to our WordPress server after we check them into source control.</p>
<ol class="footnotes"><li id="footnote_0_551" class="footnote">Flame war: The un-winnable situation in which everything I do is amazing and everything you do sucks. I don&#8217;t care what source control system you use- and think that it&#8217;s a bad idea to use Git if another one is better suited to your needs. Still, if you&#8217;re not using <em>any</em> system, you may as well choose Git because then this article will be easier to follow. Yes, I could give examples in Subversion and Mercurial, but this is not a book, it&#8217;s a blog post.</li><li id="footnote_1_551" class="footnote">Also, sometimes it seems like setting something up and learning how to use it is more trouble than just dealing with the problem when it comes up all the time. Only you can make that decision, but I guarantee that the amount of time you spend learning this will offset the amount of time you spend working (and recovering from failure) if you don&#8217;t.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://mettadore.com/wordpress/a-quick-intro-to-github-for-wordpressers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordCampPDX in 0… 15… 30…</title>
		<link>http://mettadore.com/wordpress/wordcamppdx-in-0%e2%80%a6-15%e2%80%a6-30%e2%80%a6/</link>
		<comments>http://mettadore.com/wordpress/wordcamppdx-in-0%e2%80%a6-15%e2%80%a6-30%e2%80%a6/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 00:37:11 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=488</guid>
		<description><![CDATA[Today, I created an outline, but more on that later. Right now, I want to talk about WordPress. I love WordPress. WordPress is a dream come true. It&#8217;s a great writer&#8217;s platform, it&#8217;s a great programmer&#8217;s platform, it&#8217;s a great tinker&#8217;s platform… It&#8217;s also a total and complete pain in the ass. Like many great [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I created an outline, but more on that later. Right now, I want to talk about WordPress.</p>
<p>I love WordPress.</p>
<p>WordPress is a dream come true. It&#8217;s a great writer&#8217;s platform, it&#8217;s a great programmer&#8217;s platform, it&#8217;s a great tinker&#8217;s platform…</p>
<p>It&#8217;s also a total and complete pain in the ass.</p>
<p>Like many great things, it&#8217;s virtually perfect. And, like many great things, it can be finicky, sometimes contemptible, and often frustrating as hell.</p>
<p>Why?</p>
<p>Because it attracts tinkerers, and tinkerers break things, and breaking things is frustrating.</p>
<p>Honestly, not all the frustration that people have with WordPress is the WordPress team&#8217;s fault. It&#8217;s the fault of the <em>system</em>. It&#8217;s a function of a system and philosophy that allows people to have as many options as they can.</p>
<p>That&#8217;s a problem.</p>
<p>WordPress is almost infinitely customizable, totally hackable and utterly configurable. That&#8217;s the beauty and the curse. Whenever something has that many buttons to press and levers to pull, something is <em>always</em> going to break… eventually</p>
<h3>I&#8217;m Speaking at WordCamp Portland</h3>
<p>This year, I have been honored by being invited to speak at <a href="http://www.wordcampportland.org/">WordCampPDX</a>. Actually, &#8220;honored&#8221; is a bit of an understatement. I&#8217;m overjoyed. Getting up in a room full of people who love WordPress in order to talk about WordPress is pretty damn exciting. It might even be the most exciting speaking engagement I&#8217;ve ever had, and I&#8217;ve spoken a <em>lot</em>.</p>
<p>What will I talk about?</p>
<p>Well, there&#8217;s that whole &#8220;double-edged&#8221; sword aspect of WordPress that I&#8217;ve just been describing. How you can do anything you want to with it, but how that means that it will <em>always</em> break. That&#8217;s really the most interesting thing to me. But, that&#8217;s just a description of a problem. That&#8217;s a complaint.</p>
<p>So, I&#8217;m talking about a solution.</p>
<h3>WordPress &amp; Source Control</h3>
<p><a href="http://en.wikipedia.org/wiki/Source_Code_Management">Source control management</a> (SCM) is a concept that is as natural as breathing to most developers. But it&#8217;s not something that WordPress users often think of.<sup><a href="http://mettadore.com/wordpress/wordcamppdx-in-0%e2%80%a6-15%e2%80%a6-30%e2%80%a6/#footnote_0_488" id="identifier_0_488" class="footnote-link footnote-identifier-link" title="despite the fact that there is a revision control system built into the WordPress editor">1</a></sup> Hovever, anyone who has ever modified a theme, fiddled with a plugin, or wanted to change the way WordPress works for them in any way could find it valuable.</p>
<p>It&#8217;s strange to me that more WordPress users don&#8217;t actually use an SCM system, but then again, I&#8217;m a programmer. SCM may be as natural as <em>breathing</em> to a developer, but it&#8217;s about as natural as breathing <em>underwater</em> to a non-programmer.</p>
<p>But it doesn&#8217;t have to be like breathing underwater.</p>
<p>So I&#8217;m speaking on ways to integrate Source Control and WordPress, to make your life easier and make it much safer to play around and tinker. Hopefully, after my talk, even non-programmers who want to tinker in the WordPress code will feel confident that they won&#8217;t break things.</p>
<p>Or, rather, that they <em>will</em> break things, but that breaking things is <em>okay</em> and a good way to learn&#8211; assuming you can fix them.</p>
<h3>Getting Excited</h3>
<p>Today I created an outline.</p>
<p>It&#8217;s day zero of the first of my three WordPressPDX countdown timers. Today was &#8220;outline&#8221; day.</p>
<p>15 days from now is &#8220;Presentation&#8221; day- the day I need to be done with my presentation (so that I have enough time to test it, tweak it, and maybe break it)</p>
<p>30 days from now is WordCampPDX!</p>
<p>Today I created an outline, and it&#8217;s a pretty good one. We&#8217;ll look at messing about with WordPress themes and plugins, we&#8217;ll create <a href="http://github.com">Github</a> repositories, and we&#8217;ll break things.</p>
<p>We&#8217;ll even&#8211; <em>crazy thought</em>&#8211; <a href="http://twitter.com/gchaix/status/18642674660">hack the WordPress core</a>!!</p>
<p>But it&#8217;ll all be okay, because we&#8217;ll have a safety net.</p>
<p>You don&#8217;t need to know PHP, you don&#8217;t need to know about source control. All you need is the desire to fiddle with stuff and see if it breaks.</p>
<p>And you need a love of WordPress, but if you&#8217;re coming to WordCampPDX, you already have that base covered.</p>
<p><strong>Yay for WordCampPDX!!</strong></p>
<ol class="footnotes"><li id="footnote_0_488" class="footnote">despite the fact that there is a revision control system built into the WordPress editor</li></ol>]]></content:encoded>
			<wfw:commentRss>http://mettadore.com/wordpress/wordcamppdx-in-0%e2%80%a6-15%e2%80%a6-30%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Sociable More… Sociable</title>
		<link>http://mettadore.com/wordpress/making-sociable-more%e2%80%a6-sociable/</link>
		<comments>http://mettadore.com/wordpress/making-sociable-more%e2%80%a6-sociable/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 00:54:34 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[sociable]]></category>
		<category><![CDATA[taglines]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=6</guid>
		<description><![CDATA[This post is from Positively Glorious!, just to give us a start. I&#8217;ve been using the Sociable WordPress plugin for a while now. It&#8217;s a plugin that gives instant links to various social media sites, to help you spread your bloggy goodness around the world. One thing that I love about this plugin is the [...]]]></description>
			<content:encoded><![CDATA[<p>This post is from <a href="http://positivelyglorious.com">Positively Glorious!</a>, just to give us a start.<br />
I&#8217;ve been using the <a href="http://blogplay.com/sociable-for-wordpress/">Sociable WordPress plugin</a> for a while now. It&#8217;s a plugin that gives instant links to various social media sites, to help you spread your bloggy goodness around the world. One thing that I love about this plugin is the fact that it shows a tagline before the list of links (just look to the end of this post for what I&#8217;m talking about).</p>
<p>For me, this tagline has become something of a… well… tagline. Many people use the default &#8220;Share and enjoy&#8221; tagline.<sup><a href="http://mettadore.com/wordpress/making-sociable-more%e2%80%a6-sociable/#footnote_0_6" id="identifier_0_6" class="footnote-link footnote-identifier-link" title="which is something I&amp;#8217;d expect to hear from a space ship&amp;#8217;s computer that&amp;#8217;s trying to recreate tea, not something I want on my blog.">1</a></sup> This is probably because most people see the tagline as an introduction to the &#8220;link to social media&#8221; function of Sociable. Me? I actually like the semi-Shakespearian &#8220;ending of a chapter&#8221; feeling that the tagline gives. It&#8217;s like a way to tell the reader that we&#8217;re at the end of this post, this thought, this… chapter.<span id="more-6"></span></p>
<p>When I started using Sociable, I periodically changed the tagline from &#8220;Whaddaya think, sirs?&#8221; to &#8220;Push the button, Frank.&#8221; and back again. These are two good &#8220;ending taglines&#8221; from that greatest of all shows: <a href="http://en.wikipedia.org/wiki/Mystery_Science_Theater_3000">Mystery Science Theater 3000</a>. Eventually, I got sick of the tagline being the same thing for all posts, and of having to manually change the tagline. So, I thought I&#8217;d hack the plugin source to allow for random taglines.</p>
<h3>Random Taglines Rule!</h3>
<div id="attachment_1960" class="wp-caption alignleft" style="width: 310px"><a href="http://positivelyglorious.com/files/2009/12/Screen-shot-2009-12-24-at-10.14.23-PM.png"><img class="size-medium wp-image-1960 " src="http://positivelyglorious.com/files/2009/12/Screen-shot-2009-12-24-at-10.14.23-PM-300x90.png" alt="Sociable-random's admin page" width="300" height="90" /></a><p class="wp-caption-text">Sociable-random&#039;s admin page</p></div>
<p>Thus, I give you the <a href="http://github.com/mettadore/sociable-random">sociable-random</a> plugin. It&#8217;s exactly the same as the sociable plugin, except that it allows for multiple taglines and it automatically uses the &lt;strong&gt; tag for those taglines.</p>
<p>At the bottom of this post, you see a tag that has been randomly chosen from about 7 MST3K quotes. You also see the way I formatted the tagline to separate it a bit from the post, while still connecting it to the sociable links. The CSS for this is:</p>
<pre>.sociable_tagline {
            padding-bottom: 5px;
            margin-bottom: 3px;
            margin-top: 5px;
            line-height: 1.5em;
}
.sociable_tagline strong {
           border-top: #444 1px solid;
}</pre>
<h3>Download</h3>
<p>Download sociable-random from its <a href="http://github.com/mettadore/sociable-random/archives/master">archives link on Github</a>. Feel free to let me know what you think, and if something&#8217;s broken, either fire a message along on of the various channels you see on the right edge of your screen, or using the <a href="http://github.com/mettadore/sociable-random/issues">Github Issues page</a>.</p>
<ol class="footnotes"><li id="footnote_0_6" class="footnote">which is something I&#8217;d expect to hear from a space ship&#8217;s computer that&#8217;s trying to recreate tea, not something I want on my blog.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://mettadore.com/wordpress/making-sociable-more%e2%80%a6-sociable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reactivating Theme and Plugin Editors in WordPressMU</title>
		<link>http://mettadore.com/analysis/reactivating-theme-and-plugin-editors-in-wordpressmu/</link>
		<comments>http://mettadore.com/analysis/reactivating-theme-and-plugin-editors-in-wordpressmu/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 19:45:06 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Miscellany]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Software & Media]]></category>

		<guid isPermaLink="false">http://john.jmetta.com/?p=1770</guid>
		<description><![CDATA[This entry is part of a series, Migrating to WordPressµ&#187; It&#8217;s like camping with a Therm-a-Rest. They tell you not [...] ]]></description>
			<content:encoded><![CDATA[<div class="hackadelic-series-info on-frontpage">This entry is part of a series,  <a href=";" title="click to expand/collapse slider Migrating to WordPressµ">Migrating to WordPressµ&raquo;</a> <span class="hackadelic-sliderPanel concealed"></span></div>
<div class="tweetmeme_button" style="float: right;margin-left: 10px">
			<a href="http://api.tweetmeme.com/share?url=http://positivelyglorious.com/software-media/reactivating-theme-and-plugin-editors-in-wordpressmu/"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http://positivelyglorious.com/software-media/reactivating-theme-and-plugin-editors-in-wordpressmu/&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>It&#8217;s like camping with a <a href="http://cascadedesigns.com/Therm-A-Rest">Therm-a-Rest</a>. They tell you not to blow into it. They say it&#8217;s important to just let it sit and it will self-inflate. Don&#8217;t blow it up. That&#8217;s bad.</p>
<p>But everyone does it.</p>
<p>It&#8217;s the same with the <a href="http://wordpress.org">WordPress</a> core. They say &#8220;Don&#8217;t hack core,&#8221; but everyone does it.<span></span></p>
<p>Well, almost everyone.</p>
<p>Actually, maybe just one or two of us.</p>
<p>Anyway, I&#8217;d <em>never</em> hack the WordPress core if I were working on something for someone else. I&#8217;ve had to clean up that mess after an update to the WordPress software completely wrecked the website (I wanted to kill that person). </p>
<p>I am a little bit more likely to hack the core code on my <em>personal</em> site, however. Just as I&#8217;m allowed to do anything I want to my house, but would probably bitch-slap someone if they came over and started drilling random holes in the walls.</p>
<p>It&#8217;s mine, I&#8217;ll accept responsibility for screwing it up. I&#8217;m alright making that choice.</p>
<p>So, recently, I moved to a <a href="http://mu.wordpress.org">WordPressµ</a> installation at <a href="http://jmetta.com">The MettaSite</a>, and placed Positively Glorious! and a few other gems under it&#8217;s control. It&#8217;s been great so far, but I missed the ability to edit my theme and individual plugins from within the dashboard. For most installations of WordPressµ, disabling this ability is A Good Thing™, because modifying a theme is pretty dangerous if more than one person has access to that theme. It&#8217;ll work on one site, but break on others. That&#8217;s bad.</p>
<p>But at The MettaSite, there&#8217;s just me, and at most 2 or 3 other people that I might host sites for. In this case, it&#8217;s easy enough for me to activate a theme on one blog only. It&#8217;s a very small, controlled space, so the problems of theme modification are virtually nil.</p>
<p>So, I decided to reactivate my theme and plugin editors in WordPressµ, which involves hacking the core. This is problematic because there are updates to the core code, and every update breaks any hacks you have (as well it should). I might take some time to figure out how to add this functionality to the backend more cleanly and submit an options patch, but until then, I needed a quick reminder about how to fix it&#8211; because WordPress will update, and I won&#8217;t be able to edit because I was stupid and hacked the core.</p>
<h3>The Instructions</h3>
<p>It&#8217;s pretty simple, actually. In WPMU V.2.8.x, look in the file <strong>wp-admin/includes/mu.php</strong> and around line 539 find the function wpmu_menu() in it, you&#8217;ll find an if statement:</p>
<div class="wp_syntax">
<table>
<tr>
<td class="line_numbers">
<pre>552
553
554
555
556
557
</pre>
</td>
<td class="code">
<pre style="font-family:monospace">…
    <span style="color: #b1b100">if</span><span style="color: #009900">&#040;</span> <span style="color: #339933">!</span>is_site_admin<span style="color: #009900">&#040;</span><span style="color: #009900">&#041;</span> <span style="color: #009900">&#041;</span>
        <span style="color: #990000">unset</span><span style="color: #009900">&#040;</span> <span style="color: #000088">$submenu</span><span style="color: #009900">&#091;</span><span style="color: #0000ff">'plugins.php'</span><span style="color: #009900">&#093;</span><span style="color: #009900">&#091;</span><span style="color: #cc66cc">10</span><span style="color: #009900">&#093;</span> <span style="color: #009900">&#041;</span><span style="color: #339933">;</span> <span style="color: #666666;font-style: italic">// always remove the plugin installer for regular users</span>
    <span style="color: #990000">unset</span><span style="color: #009900">&#040;</span> <span style="color: #000088">$submenu</span><span style="color: #009900">&#091;</span><span style="color: #0000ff">'plugins.php'</span><span style="color: #009900">&#093;</span><span style="color: #009900">&#091;</span><span style="color: #cc66cc">15</span><span style="color: #009900">&#093;</span> <span style="color: #009900">&#041;</span><span style="color: #339933">;</span> <span style="color: #666666;font-style: italic">// always remove the plugin editor</span>
    <span style="color: #990000">unset</span><span style="color: #009900">&#040;</span> <span style="color: #000088">$submenu</span><span style="color: #009900">&#091;</span><span style="color: #0000ff">'themes.php'</span><span style="color: #009900">&#093;</span><span style="color: #009900">&#091;</span><span style="color: #cc66cc">10</span><span style="color: #009900">&#093;</span> <span style="color: #009900">&#041;</span><span style="color: #339933">;</span> <span style="color: #666666;font-style: italic">// always remove the themes editor</span>
…</pre>
</td>
</tr>
</table>
</div>
<p>Change this so that all three of these unset() statements are contained in the if statement. What we&#8217;re doing is turning off those editors <em>only</em> if the user is not a site administrator in the database, rather than always.</p>
<div class="wp_syntax">
<table>
<tr>
<td class="line_numbers">
<pre>552
553
554
555
556
557
558
559
560
</pre>
</td>
<td class="code">
<pre style="font-family:monospace"><span style="color: #000000;font-weight: bold">function</span> wpmu_menu<span style="color: #009900">&#040;</span><span style="color: #009900">&#041;</span> <span style="color: #009900">&#123;</span>
    <span style="color: #000000;font-weight: bold">global</span> <span style="color: #000088">$menu</span><span style="color: #339933">,</span> <span style="color: #000088">$submenu</span><span style="color: #339933">,</span> <span style="color: #000088">$current_user</span><span style="color: #339933">;</span>
…
    <span style="color: #b1b100">if</span><span style="color: #009900">&#040;</span> <span style="color: #339933">!</span>is_site_admin<span style="color: #009900">&#040;</span><span style="color: #009900">&#041;</span> <span style="color: #009900">&#041;</span> <span style="color: #009900">&#123;</span>
        <span style="color: #990000">unset</span><span style="color: #009900">&#040;</span> <span style="color: #000088">$submenu</span><span style="color: #009900">&#091;</span><span style="color: #0000ff">'plugins.php'</span><span style="color: #009900">&#093;</span><span style="color: #009900">&#091;</span><span style="color: #cc66cc">10</span><span style="color: #009900">&#093;</span> <span style="color: #009900">&#041;</span><span style="color: #339933">;</span> <span style="color: #666666;font-style: italic">// always remove the plugin installer for regular users</span>
        <span style="color: #990000">unset</span><span style="color: #009900">&#040;</span> <span style="color: #000088">$submenu</span><span style="color: #009900">&#091;</span><span style="color: #0000ff">'plugins.php'</span><span style="color: #009900">&#093;</span><span style="color: #009900">&#091;</span><span style="color: #cc66cc">15</span><span style="color: #009900">&#093;</span> <span style="color: #009900">&#041;</span><span style="color: #339933">;</span> <span style="color: #666666;font-style: italic">// always remove the plugin editor</span>
        <span style="color: #990000">unset</span><span style="color: #009900">&#040;</span> <span style="color: #000088">$submenu</span><span style="color: #009900">&#091;</span><span style="color: #0000ff">'themes.php'</span><span style="color: #009900">&#093;</span><span style="color: #009900">&#091;</span><span style="color: #cc66cc">10</span><span style="color: #009900">&#093;</span> <span style="color: #009900">&#041;</span><span style="color: #339933">;</span> <span style="color: #666666;font-style: italic">// always remove the themes editor</span>
    <span style="color: #009900">&#125;</span>
…</pre>
</td>
</tr>
</table>
</div>
<p>Next, scroll down to And around Line 1116 or so to find function disable_some_pages():</p>
<div class="wp_syntax">
<table>
<tr>
<td class="line_numbers">
<pre>1126
1127
1128
1129
1130
1131
1132
1133
</pre>
</td>
<td class="code">
<pre style="font-family:monospace">…
    <span style="color: #000088">$pages</span> <span style="color: #339933">=</span> <span style="color: #990000">array</span><span style="color: #009900">&#040;</span> <span style="color: #0000ff">'theme-editor.php'</span><span style="color: #339933">,</span> <span style="color: #0000ff">'plugin-editor.php'</span> <span style="color: #009900">&#041;</span><span style="color: #339933">;</span>
    <span style="color: #b1b100">foreach</span><span style="color: #009900">&#040;</span> <span style="color: #000088">$pages</span> <span style="color: #b1b100">as</span> <span style="color: #000088">$page</span> <span style="color: #009900">&#041;</span> <span style="color: #009900">&#123;</span>
        <span style="color: #b1b100">if</span> <span style="color: #009900">&#040;</span> <span style="color: #990000">strpos</span><span style="color: #009900">&#040;</span> <span style="color: #000088">$_SERVER</span><span style="color: #009900">&#091;</span><span style="color: #0000ff">'PHP_SELF'</span><span style="color: #009900">&#093;</span><span style="color: #339933">,</span> <span style="color: #000088">$page</span> <span style="color: #009900">&#041;</span> <span style="color: #009900">&#041;</span> <span style="color: #009900">&#123;</span>
            wp_die<span style="color: #009900">&#040;</span> __<span style="color: #009900">&#040;</span><span style="color: #0000ff">'Page disabled by the administrator'</span><span style="color: #009900">&#041;</span> <span style="color: #009900">&#041;</span><span style="color: #339933">;</span>
        <span style="color: #009900">&#125;</span>
    <span style="color: #009900">&#125;</span>
…</pre>
</td>
</tr>
</table>
</div>
<p>Change that if statement to this:</p>
<div class="wp_syntax">
<table>
<tr>
<td class="line_numbers">
<pre>1126
1127
1128
1129
1130
1131
1132
1133
</pre>
</td>
<td class="code">
<pre style="font-family:monospace">…
    <span style="color: #000088">$pages</span> <span style="color: #339933">=</span> <span style="color: #990000">array</span><span style="color: #009900">&#040;</span> <span style="color: #0000ff">'theme-editor.php'</span><span style="color: #339933">,</span> <span style="color: #0000ff">'plugin-editor.php'</span> <span style="color: #009900">&#041;</span><span style="color: #339933">;</span>
    <span style="color: #b1b100">foreach</span><span style="color: #009900">&#040;</span> <span style="color: #000088">$pages</span> <span style="color: #b1b100">as</span> <span style="color: #000088">$page</span> <span style="color: #009900">&#041;</span> <span style="color: #009900">&#123;</span>
        <span style="color: #b1b100">if</span> <span style="color: #009900">&#040;</span> <span style="color: #990000">strpos</span><span style="color: #009900">&#040;</span> <span style="color: #000088">$_SERVER</span><span style="color: #009900">&#091;</span><span style="color: #0000ff">'PHP_SELF'</span><span style="color: #009900">&#093;</span><span style="color: #339933">,</span> <span style="color: #000088">$page</span> <span style="color: #009900">&#041;</span> <span style="color: #339933">&amp;</span>amp<span style="color: #339933">;&amp;</span>amp<span style="color: #339933">;</span> <span style="color: #339933">!</span>is_site_admin<span style="color: #009900">&#040;</span><span style="color: #009900">&#041;</span> <span style="color: #009900">&#041;</span> <span style="color: #009900">&#123;</span>
            wp_die<span style="color: #009900">&#040;</span> __<span style="color: #009900">&#040;</span><span style="color: #0000ff">'Page disabled by the administrator'</span><span style="color: #009900">&#041;</span> <span style="color: #009900">&#041;</span><span style="color: #339933">;</span>
        <span style="color: #009900">&#125;</span>
    <span style="color: #009900">&#125;</span>
…</pre>
</td>
</tr>
</table>
</div>
<p>Again, what we&#8217;re doing is changing from a policy of disabling the editor pages <em>always</em>, to only disabling them if the current user is not a site admin.</p>
<h3>Coda</h3>
<p>That should do it. Once you make these two changes (test them out, of course) you should be able to use the built-in editors for both themes and plugins. Of course, what we&#8217;d all rather have is a better system for editing them, but unless you want to set up your IDE of choice with an FTP link, or maybe even a continuous integration server, this is a pretty good choice.</p>
<p>Have fun, <a href="http://morganpdx.com">Morgan</a> <img src='http://positivelyglorious.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://positivelyglorious.com/?ak_action=api_record_view&amp;id=1770&amp;type=feed" alt="" />
<div class="concealed">Entries in this series:
<ol>
<li><a href="http://positivelyglorious.com/software-media/migrating-wordpress-blog-to-wordpressmu/">Migrating From WordPress to WordPressMU (without wildcard subdomains)</a></li>
<li><a href="http://positivelyglorious.com/software-media/migrating-from-wordpress-to-wordpressmu-part-ii/">Migrating from WordPress to WordPressMU, Part II</a></li>
<li>Reactivating Theme and Plugin Editors in WordPressMU</li>
</ol>
<p><span style="margin-top: 3px;font-size: 7px"><a href="http://hackadelic.com/solutions/wordpress/sliding-notes" title="Powered by Hackadelic Sliding Notes 1.6.4">Powered by Hackadelic Sliding Notes 1.6.4</a></span></div>
<p><img src="http://feeds.feedburner.com/~r/PositivelyGlorious-software-media/~4/N8rjgtz6C8k" height="1" width="1" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mettadore.com/analysis/reactivating-theme-and-plugin-editors-in-wordpressmu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

