<?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>GrenadePod &#187; php</title>
	<atom:link href="http://www.grenadepod.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.grenadepod.com</link>
	<description>Dispersing the Seeds</description>
	<lastBuildDate>Mon, 22 Feb 2010 20:30:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Use SSH to upgrade WordPress plugins automatically</title>
		<link>http://www.grenadepod.com/2009/11/23/use-ssh-to-upgrade-wordpress-plugins-automatically/</link>
		<comments>http://www.grenadepod.com/2009/11/23/use-ssh-to-upgrade-wordpress-plugins-automatically/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 12:23:46 +0000</pubDate>
		<dc:creator>pulegium</dc:creator>
				<category><![CDATA[IT Technology]]></category>
		<category><![CDATA[Publishing]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.grenadepod.com/?p=479</guid>
		<description><![CDATA[Here&#8217;s a quick summary on how to enable WordPress updates using SSH. For one or the other reason default FTP/SFTP method didn&#8217;t work for me, so I tried this, which seems to be working fine. Build and install SSH2 libraries Depending on your linux distribution you might need to use different method. On my Debian, [...]


Related posts:<ol><li><a href='http://www.grenadepod.com/2009/11/21/securing-wordpress/' rel='bookmark' title='Permanent Link: Securing WordPress'>Securing WordPress</a></li>
<li><a href='http://www.grenadepod.com/2009/12/26/building-python-2-6-4-rpm-for-centos-5-4/' rel='bookmark' title='Permanent Link: Building python 2.6.4 RPM for CentOS 5.4'>Building python 2.6.4 RPM for CentOS 5.4</a></li>
<li><a href='http://www.grenadepod.com/2009/12/03/building-and-running-google-chrome-os-on-virtualbox/' rel='bookmark' title='Permanent Link: Building and running Google Chrome OS on VirtualBox'>Building and running Google Chrome OS on VirtualBox</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p id="top" />Here&#8217;s a quick summary on how to enable WordPress updates using SSH. For one or the other reason default FTP/SFTP method didn&#8217;t work for me, so I tried this, which seems to be working fine.</p>
<h3>Build and install SSH2 libraries</h3>
<p>Depending on your linux distribution you might need to use different method. On my Debian, I had to use the following to install:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">#  wget http://downloads.sourceforge.net/project/libssh2/libssh2-1.2.1.tar.gz?use_mirror=kent
#  tar zxf libssh2-1.2.1.tar.gz
#  cd libssh2-1.2.1
#  ./configure
#  make
#  make install</pre></div></div>

<p>What&#8217;s important here is that I had to build libssh2 from sources manually. However I hate doing this, it was apparently the only way. Aptitude was only offering me an older (0.12) version of the library, which failed to build PHP ssh2 extension.</p>
<h3>Build and install PHP SSH2 extension</h3>
<p>Now again, for some reason simple command failed to work for me&#8230; So I had to specify beta channel to install PHP SSH2 extension. Fear not though, just try this</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">#  pecl install ssh2</pre></div></div>

<p>And if it doesn&#8217;t work, then do this</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">#  pecl install channel://pecl.php.net/ssh2-0.11.0</pre></div></div>

<p>Simple, isn&#8217;t it?</p>
<h3>Generate SSH public and private keys</h3>
<p>You need to generate both public and private keys that are going to be used to connect to your server (even if it is the same server your connecting from!). Go to your home directory:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ cd .ssh
$ ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
fe:3b:5d:94:53:1e:d3:9f:87:45:73:ab:8d:9f:d7:cc user@server
$ cp id_rsa.pub authorized_keys</pre></div></div>

<p>Private key is used to decrypt the data, whereas public key is used by the remote host to encrypt the data. You also need to create authorized_keys file, so that server knows your key is trusted and allows you to login without using actual user account password.</p>
<p>There is one annoying bit though. Apache user needs to be able to read both private and public keys. Normally they are kept secure in user&#8217;s .ssh/ directory, which is readable by user only, and allowing all to see it, is not a particularly good idea. So I had to copy both files to /etc/wordpress/ and make them readable to www-data group:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">#  cd /etc
#  mkdir wordpress
#  cp /home/user/.ssh/id_rsa* wordpress/
#  chgrp www-data wordpress/*
#  chmod 640 wordpress/*</pre></div></div>

<h3>Configure WordPress to use public keys automatically</h3>
<p>Add the following lines to your wp-config.php file, so you&#8217;re not asked any passwords or server names during the upgrade:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FTP_PUBKEY'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/etc/wordpress/id_rsa.pub'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FTP_PRIKEY'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/etc/wordpress/id_rsa'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FTP_USER'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'user'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FTP_PASS'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FTP_HOST'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'localhost:22'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>



<p>Related posts:<ol><li><a href='http://www.grenadepod.com/2009/11/21/securing-wordpress/' rel='bookmark' title='Permanent Link: Securing WordPress'>Securing WordPress</a></li>
<li><a href='http://www.grenadepod.com/2009/12/26/building-python-2-6-4-rpm-for-centos-5-4/' rel='bookmark' title='Permanent Link: Building python 2.6.4 RPM for CentOS 5.4'>Building python 2.6.4 RPM for CentOS 5.4</a></li>
<li><a href='http://www.grenadepod.com/2009/12/03/building-and-running-google-chrome-os-on-virtualbox/' rel='bookmark' title='Permanent Link: Building and running Google Chrome OS on VirtualBox'>Building and running Google Chrome OS on VirtualBox</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.grenadepod.com/2009/11/23/use-ssh-to-upgrade-wordpress-plugins-automatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing my first WordPress plugin</title>
		<link>http://www.grenadepod.com/2009/11/18/developing-my-first-wordpress-plugin/</link>
		<comments>http://www.grenadepod.com/2009/11/18/developing-my-first-wordpress-plugin/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 14:28:54 +0000</pubDate>
		<dc:creator>pulegium</dc:creator>
				<category><![CDATA[IT Technology]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.grenadepod.com/?p=435</guid>
		<description><![CDATA[It&#8217;s only couple of weeks that I&#8217;m using WordPress (actively!) and it&#8217;s been quite some time I last used PHP. There was a time when I was really comfortable with PHP, but that&#8217;s been oh so long ago. I&#8217;m all in Python nowadays. No stupid endless  curly brackets, or semicolons and the nice indentation is [...]


Related posts:<ol><li><a href='http://www.grenadepod.com/2009/11/21/securing-wordpress/' rel='bookmark' title='Permanent Link: Securing WordPress'>Securing WordPress</a></li>
<li><a href='http://www.grenadepod.com/2009/11/06/essential-wordpress-plugins/' rel='bookmark' title='Permanent Link: Essential WordPress plugins'>Essential WordPress plugins</a></li>
<li><a href='http://www.grenadepod.com/2009/11/23/use-ssh-to-upgrade-wordpress-plugins-automatically/' rel='bookmark' title='Permanent Link: Use SSH to upgrade WordPress plugins automatically'>Use SSH to upgrade WordPress plugins automatically</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p id="top" />It&#8217;s only couple of weeks that I&#8217;m using WordPress (actively!) and it&#8217;s been quite some time I last used PHP. There was a time when I was really comfortable with PHP, but that&#8217;s been oh so long ago. I&#8217;m all in Python nowadays. No stupid endless  curly brackets, or semicolons and the nice indentation is enforced&#8230; Ok, ok, it&#8217;s just me ranting, because I spent nearly 30 mins trying to figure out what&#8217;s wrong with my code. It appeared to be a missing $ in front of my variable name. How lame could that be?&#8230;</p>
<p>Right, back to business. So I decided to write a WordPress plugin. There were few reasons I wanted to do that:</p>
<ul>
<li>See how difficult it is and what WordPress looks like under the hood</li>
<li>Since I&#8217;m using WP, which is a PHP shop I needed to remind myself how PHP looks like</li>
<li>Get some more publicity and bump up the Google rating (that&#8217;ll never hurt, will it?)</li>
</ul>
<p>So, I remembered seeing this neat trick of reversing, or flipping over text by replacing regular ASCII latin characters with Unicode ones that resemble a mirror image of the original ones. There are numerous websites out there on the wild internets that would swallow your piece of texts and then spit out same text, but flipped over.</p>
 p&#x01DDs&#x0279&#x01DD&#x028C&#x01DD&#x0279 u&#x01DD&#x01DDq s&#x0250&#x0265 &#x0287&#x0131 &#x0279&#x01DD&#x0287&#x025F&#x0250 &#x01DD&#x029E&#x0131&#x0283 &#x029Eoo&#x0283 p&#x0283no&#x028D &#x0287x&#x01DD&#x0287 &#x01DD&#x0265&#x0287 &#x028Do&#x0265 s&#x0131 &#x01DD&#x0279&#x01DDH
<p>As you can see it is still text information, no magic with images or anything like that. You can select, copy-paste, etc.</p>
<p>So, I thought, right, let&#8217;s see if there was someone smart who has created a plugin for WordPress that would do this. Not that I&#8217;m a big fan of flipped over text, but just to make sure that I&#8217;m not reinventing the wheel. At the end of the day, what&#8217;s the point in creating something that&#8217;s already been build. If such plugin existed, I would have had to think of something else. Lucky for me, no one has yet created anything like it.</p>
<p>So, simple idea, just what I need to warm up.</p>
<p>First things first, go and read <a href="http://codex.wordpress.org/Writing_a_Plugin" target="_blank">official manual</a> from WordPress about how to develop plugins. It&#8217;s a really good manual, and everyone developing a plugin must read it. Or read it if you feel you need more details in following my manual&#8230; <img src='http://www.grenadepod.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>All plugins go into /wp-content/plugins/ directory in your WordPress installation. Each plugin has it&#8217;s own directory, but this isn&#8217;t a strict requirement, but if you&#8217;re not creating a directory for your plugin, it must be just a single PHP file. I&#8217;d advise to create a directory for your plugin.</p>
<p>Right, this is how I saw me implementing this: user types in any text in the post (or page, or comment, or even excerpt) and encloses any text he/she wants to flip over in my new (made up) tags, just like that:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&amp;lt;upsidedown&amp;gt;your text&amp;lt;/upsidedown&amp;gt;</pre></div></div>

<p>Because WordPress does some clever validation of the text and only certain tags are allowed, I had to include this code in my plugin to declare my new tags as valid ones:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>CUSTOM_TAGS<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// allow new tag in the posts</span>
    <span style="color: #000088;">$allowedposttags</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'upsidedown'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// ... and also in the comments</span>
    <span style="color: #000088;">$allowedtags</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'upsidedown'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Next thing is to register new filter function with WordPress. Hold on, what is this filter function? Filter function is a function that WordPress calls and passes contents of the post to it. Filter function can do anything it likes to the text and then spits is back to WordPress engine. WordPress will then pass the result to another filter, and so on and on until there are no more filter registered. Each filter get a priority flag assigned, and those with priority 0 will get executed before those that have priority 10. By default each filter gets priority 6 assigned to them.</p>
<p>Right, going back to my filters, let&#8217;s register them:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'flip_text_upside_down_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'flip_text_upside_down_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'flip_text_upside_down_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>As you can see, I register my filter with three types of content: post (or page), excerpt and comment.</p>
<p>Next thing is to define the filter function:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> flip_text_upside_down_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">preg_replace_callback</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'/\s*&amp;lt;upsidedown&amp;gt;(.*)&amp;lt;\/upsidedown&amp;gt;/siU'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'convert_to_upsidedown_unicode'</span><span style="color: #339933;">,</span>
        <span style="color: #000088;">$content</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>WordPress is going to call it with a parameter that contains content text in it. I pass the contents to PHP function preg_replace_callback, which matches the regular expression (any text in between my tags) and calls another function with the contents of the regular expression match (hope that makes sense to you, if not, read the sentence again, repeat until you got it&#8230; <img src='http://www.grenadepod.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).<br />
Finally, a function that actually does the conversion. Which is pretty simple &#8211; go through all characters and replace them with matching Unicode chars from the table. I&#8217;m not including the whole table here, you can download source code from WordPress plugins directory (in fact, if you install the plugin &#8211; you&#8217;ll have the sourcecode in your plugins/ directory):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> convert_to_upsidedown_unicode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$match</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// conversion table</span>
    <span style="color: #000088;">$flipTable</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
<span style="color: #339933;">...</span>
    <span style="color: #009900;">&#41;</span>
    <span style="color: #000088;">$origStr</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strrev</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$match</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$newStr</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">' '</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$origStr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$origStr</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> <span style="color: #000088;">$flipTable</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$newStr</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$flipTable</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$newStr</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$ch</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$newStr</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This is it. Well, ok nearly it. You still need to do the boring bit, ie put a formal header so WP recognises your plugin code (put this, replacing what&#8217;s necessary accordingly):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
Plugin Name: Upside Down Text
Plugin URI: http://www.grenadepod.com/projects/upside-down-text-plugin-for-wordpress/
Description: This plugin allows to &quot;flip&quot; any section of text upside down
Version: 1.1.0
Author: Grenadepod
Author URI: http://www.grenadepod.com
*/</span></pre></div></div>

<p>Now you can activate the plugin from your WP admin console, and start typing text that everyone struggles to read.</p>
<p>Sooner or later you&#8217;ll notice that the implementation is not ideal. When you switch over to visual editor (which I use most of the time) and then back to HTML editor, all &#8220;new&#8221; tags are gone. This is because the editor does not know about them and so it removes them. Solution was to type in text in Visual (if you prefer to use it) then switch to HTML and place tags where needed. Save without switching back, and publish.</p>
<p>This wasn&#8217;t really nice, and I wasn&#8217;t going to get lots of users with this approach. Some nice soul on WordPress forum suggested to have a look at <a href="http://codex.wordpress.org/Shortcode_API" target="_blank">Shortcode API</a>. This API allows plugin to register shortcode that looks like: [somethinghere]content[/somethinghere], and passes all content back to your function. And this would be immune to switching between editors issue.</p>
<p>So I decided to make a second release of the plugin, where shortcodes are supported alongside with tags. And in fact using shortcodes not only allows me to type them in directly in the Visual editor, but also coding is simpler, I don&#8217;t need to do any regexp magic.</p>
<p>Register my new shortcode:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upsidedown'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'flip_text_upside_down_shortcode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And define what function to call:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> flip_text_upside_down_shortcode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$atts</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> convert_to_upsidedown_unicode<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>As you can see, I&#8217;m reusing same character conversion function, so the changes were minimal.</p>
<p>All seems to be working quite fine, at the end of the day, what can go wrong with only few lines of code?&#8230;</p>


<p>Related posts:<ol><li><a href='http://www.grenadepod.com/2009/11/21/securing-wordpress/' rel='bookmark' title='Permanent Link: Securing WordPress'>Securing WordPress</a></li>
<li><a href='http://www.grenadepod.com/2009/11/06/essential-wordpress-plugins/' rel='bookmark' title='Permanent Link: Essential WordPress plugins'>Essential WordPress plugins</a></li>
<li><a href='http://www.grenadepod.com/2009/11/23/use-ssh-to-upgrade-wordpress-plugins-automatically/' rel='bookmark' title='Permanent Link: Use SSH to upgrade WordPress plugins automatically'>Use SSH to upgrade WordPress plugins automatically</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.grenadepod.com/2009/11/18/developing-my-first-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
