
<?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>things with bits - frances d&#039;ath</title>
	<atom:link href="http://thingswithbits.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://thingswithbits.info</link>
	<description></description>
	<lastBuildDate>Tue, 01 Jun 2010 14:59:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>fontographie</title>
		<link>http://thingswithbits.info/2010/06/fontographie/</link>
		<comments>http://thingswithbits.info/2010/06/fontographie/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 14:55:14 +0000</pubDate>
		<dc:creator>frances</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://thingswithbits.info/2010/06/fontographie/</guid>
		<description><![CDATA[Early rising to Kreuzberg and after a time to wake Matthi up in Reichenbergerstr. Breakfast peanutbutter and coffee, talking across queer and politics and Berlin and so to work. My project for the coming months is for Daniel Schlusser, better known as our man in berlin, though he isn&#8217;t. In Berlin, I mean. Theatre director [...]]]></description>
			<content:encoded><![CDATA[<p>Early rising to Kreuzberg and after a time to wake Matthi up in Reichenbergerstr. Breakfast peanutbutter and coffee, talking across queer and politics and Berlin and so to work.</p>
<p>My project for the coming months is for <a onclick="window.open(this.href); return false;" href="http://danielschlusser.com/">Daniel Schlusser</a>, better known as <a onclick="window.open(this.href); return false;" href="http://ourmaninberlin.blogspot.com/">our man in berlin</a>, though he isn&#8217;t. In Berlin, I mean. Theatre director and rather talented to boot, and perhaps other things to write of with him shortly.</p>
<p>A new website. Excitement of jQuery, some ideas for typography. Matthi is a typographer and genius in FontLab and Illustrator, so I ask him how to dismantle a font, remove various bits that make up a letter, all of which have names I don&#8217;t know. I thrill for beautiful typography, and it&#8217;s what I enjoy possibly the most in design, but actual making of fonts is deeply unfamiliar to me. So this is a story of how I learn about fonts.</p>
<p>The two things I wanted to do were convert a font into an outline (not to be confused, I think, with a outline font), and chops bits off. My approach, as Matthi laughed, was very Photoshop. Much messing around ensued, and without his help, I&#8217;d have been doing it for months in my awful untrained way.</p>
<p>So…</p>
<p>Using the serif font, <a onclick="window.open(this.href); return false;" href="http://www.dotcolon.net/font/font.php?id=2">Tenderness from dot colon</a> and opening in <a onclick="window.open(this.href); return false;" href="http://www.fontlab.com/font-editor/fontlab-studio/">FontLab Studio</a>, which to be uncharitable strikes me as an application ported to OSX without much thought towards standard user interface behaviour. Then opening a single letter or glyph in its own window and exporting as .eps. Now for playing.</p>
<p>Opening the .eps file in Illustrator and first hacking away bits (which I haven&#8217;t done in my test glyphs as I was more interested in workflow possibilities), and then turning it into an outline. The process is quite simple, once I learnt it, but I wouldn&#8217;t have stumbled onto it on my own.</p>
<p>Selecting the entire glyph and then setting the fill color to transparent and stroke to black, gives a one pixel outline. Opening the stroke pane and setting the weight to 6 pixels gives it some width. Then the important bit, selecting from the menu &#8211; Object &#8211; Path &#8211; Outline Stroke makes the vector path the width of the new 6 pixel outline. Saving as .eps again finishes the work in Illustrator.</p>
<p>Copy-Paste, back into the glyph in FontLab, aligning with the original, then shift-selecting to select the original before deleting (fixing up the mess, I called it), and saving the results…</p>
<p>First to export as something useful, .ttf, though it seems to not preview properly in FontExplorer… nonetheless! My first attempts at font stuff. (I&#8217;m not sure it will even be used, and there&#8217;s more work to do yet…)</p>
<p><a rel="lightbox" href="http://thingswithbits.info/wordpress/wp-content/uploads/6.4.2010.jpg"><img class="alignnone size-full wp-image-80" title="6.4.2010 small" src="http://thingswithbits.info/wordpress/wp-content/uploads/t-6.4.2010twb.jpg" alt="6.4.2010 small" width="430" height="242" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://thingswithbits.info/2010/06/fontographie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Security (in many small steps)</title>
		<link>http://thingswithbits.info/2010/05/wordpress-security-in-many-small-steps/</link>
		<comments>http://thingswithbits.info/2010/05/wordpress-security-in-many-small-steps/#comments</comments>
		<pubDate>Fri, 14 May 2010 15:56:42 +0000</pubDate>
		<dc:creator>frances</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[robots.txt]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://thingswithbits.info/2010/05/wordpress-security-in-many-small-steps/</guid>
		<description><![CDATA[(This is for people who like reading code, cross-posted at supernaut.info) Earlier this year supernaut got hacked. Many other of my WordPress installs did also, perhaps because they occupy the same shared hosting space. I learnt a lot about website and WordPress security very quickly &#8211; even to the point of inadvertently vanishing all but [...]]]></description>
			<content:encoded><![CDATA[<p>(This is for people who like reading code, cross-posted at <a href="http://supernaut.info/2010/05/wordpress-security-in-many-small-steps/" onclick="window.open(this.href); return false;">supernaut.info</a>)</p>
<p>Earlier this year <a href="http://supernaut.info/2010/01/hacked/" onclick="window.open(this.href); return false;">supernaut got hacked</a>. Many other of my WordPress installs did also, perhaps because they occupy the same shared hosting space. I learnt a lot about website and WordPress security very quickly &#8211; even to the point of inadvertently <a href="http://supernaut.info/2010/04/vanished-again/" onclick="window.open(this.href); return false;">vanishing</a> all but my index page for quite some time. Nothing if not clever, I am.</p>
<p>Because I am doing all my projects in WordPress at the moment, and also seem to have turned quite a few people over to using it also, I thought to document my approach and methods. The first thing I do then, is read. A lot.</p>
<p>I have a subjective and not-too carefully analysed approach to learning, especially when it comes to finding out information on a topic I know nothing about and need to know much quickly. It applies to everything, not simply limited to web design or computer stuff. I search and read and search and read and keep repeating until the same stuff starts to come up over and over again. Then I start to think I might be on the right path. So I might try a few things then. The key here is easiness. Anything requiring more than a few clicks, a few lines of text or modifications is not a reasonable solution.</p>
<p>Things that break this early get thrown away. A plug-in that asks for stupid things, or doesn&#8217;t perform without me rewriting some line in php.ini is not going to stay installed long. I wondered often if this was the wrong approach, but really, basic, effective security should be as simple to understand as a household door key. You shouldn&#8217;t have to build a lathe in order to cut the key yourself.</p>
<p>So, having done some research and playing, I slowly put together something useful. This is a mix of things I&#8217;ve been using for a while, and new things I&#8217;m adding at the moment, in response to pissy annoying php exploits, sql injections and other clever irritations.</p>
<h5>Installing WordPress.</h5>
<p>The first thing to change during an install is the database table prefix wp_. If you&#8217;ve already installed WordPress, it&#8217;s possible to also change this either using a plugin, or by editing wp-config.php and changing the table prefixes in phpMyAdmin.</p>
<p>Once logged in, make a new user with administrator privileges and suitably complex password (OSX Keychain Access has a very good password generator), log in with the new user and delete the user, &#8216;Admin&#8217;.</p>
<p>Now is also a good time to delete the default theme (after uploading your new one of course). As with the user named &#8216;Admin&#8217;, the wp_ table prefix and other defaults, botnet code injection methods look for these defaults as an easy place to start.</p>
<p>To avoid messiness, I think it&#8217;s better to leave installing plugins till last, though because information is sent in the clear unless using SSL or SSH, it&#8217;s probably a good idea to change the password again when it&#8217;s all finished.</p>
<h5>Get rid of install.php</h5>
<p>After your installation is finished, you don&#8217;t need this file, located in wp-admin. Delete it, or change the name, or even better log attempts to access it with this (just change the email address to receive notifications):</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// install.php replacement page: http://perishablepress.com/press/2009/05/05/important-security-fix-for-wordpress/ ?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;HTTP/1.1 503 Service Temporarily Unavailable&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Status 503 Service Temporarily Unavailable&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Retry-After 3600&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 60 minutes ?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;email@domain.tld&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Database Error&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;There is a problem with teh database!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;<br />
&lt;html xml:lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;en&quot;&gt;<br />
&nbsp; &nbsp; &lt;head&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;title&gt;Error Establishing Database Connection&lt;/title&gt;<br />
&nbsp; &nbsp; &lt;/head&gt;<br />
&nbsp; &nbsp; &lt;body&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;h1&gt;Error Establishing Database Connection&lt;/h1&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;We are currently experiencing database issues. Please check back shortly. Thank you.&lt;/p&gt;<br />
&nbsp; &nbsp; &lt;/body&gt;<br />
&lt;/html&gt;</div></td></tr></tbody></table></div>
<h5>Dealing with wp-config</h5>
<p>Every time I open this file and see the database name, user, password and host all in plain text, I get a little queasy. There are several ways to make this less painful, firstly using htaccess, which I&#8217;ll cover later. A quite elegant solution is to put all the sensitive information in a separate php file outside the root web directory, and make a call to that in the wp-config file.</p>
<p>First make a new file, config.php stick it (on Dreamhost) in the /home directory, chmod to 644, and cut-paste the following from the original wp-config.php:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<br />
<span style="color: #666666; font-style: italic;">// ** MySQL settings - You can get this info from your web host ** //</span><br />
<span style="color: #009933; font-style: italic;">/** The name of the database for WordPress */</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_NAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'database-name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009933; font-style: italic;">/** MySQL database username */</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009933; font-style: italic;">/** MySQL database password */</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_PASSWORD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'p@s5w0rD'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009933; font-style: italic;">/** MySQL hostname */</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_HOST'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sqlhost.domainname.tld'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009933; font-style: italic;">/**<br />
&nbsp;* WordPress Database Table prefix.<br />
&nbsp;*<br />
&nbsp;* You can have multiple installations in one database if you give each a unique<br />
&nbsp;* prefix. Only numbers, letters, and underscores please!<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$table_prefix</span> &nbsp;<span style="color: #339933;">=</span> <span style="color: #0000ff;">'prefix_'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009933; font-style: italic;">/** force ssl login and admin - might slow things down */</span><br />
<span style="color: #009933; font-style: italic;">/** on dreamhost must pay for ssl cert, hence not used */</span><br />
<span style="color: #009933; font-style: italic;">/** define('FORCE_SSL_ADMIN', true); */</span><br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>Then in the original file, just put:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/home/path/to/config.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>For those lucky enough to have SSL on their server, using FORCE_SSL_ADMIN is an excellent idea. Changing permissions to 640 also is a good idea.</p>
<p>Adding Unique Authentication Keys takes about 30 seconds, and gives four separate keys to be used with your password. Copy-paste from the <a href="http://api.wordpress.org/secret-key/1.1/" onclick="window.open(this.href); return false;">Secret Key online generator</a>, it will look like this:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'AUTH_KEY'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">' ;+ Xk*Kf:y3e1L?.,r[Hx&lt;m;rV57d&gt;2WL#&lt;#3[ d]!#+$79/pSAF(HrGEAfS`a4'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SECURE_AUTH_KEY'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.k0zMi[@f&amp;)E&gt;~y=ZqO6~IfHS$S SP8d&gt;C]S@:zhxh?H]VtXEpqV?p-OJV*O~3?v'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'LOGGED_IN_KEY'</span><span style="color: #339933;">,</span> &nbsp; <span style="color: #0000ff;">'~:b*7/m+Lx|-irCxYAHQn1t2$sYA+2}+*2c@!_,9/D2-H5cJ_:wJ8X7|-p%W&amp;xGh'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'NONCE_KEY'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'%#T+Y*|N&gt;cq/2m3CRqR}SCM &nbsp;BodKio`&lt;x+?nMAe6,qgU:YiyKgEu,%&lt;er&gt;&gt;qS$V'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h5>Functions.php</h5>
<p>Most themes have a functions.php file which does all sorts of exciting things, writing bits to the theme templates, interacting with WordPress admin interface… A couple of extra lines provide a little obscurity. WordPress puts its version number in the header in wp_generator, and also a link to xml-rpc.php, which for most people is unnecessary &#8211; unless they are using a blogging client like <em>Marsedit</em> &#8211; and a risk. This quickly removes both, as well as hiding information about failed login attempts through the browser:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #666666; font-style: italic;">//security stuff</span><br />
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'login_errors'</span><span style="color: #339933;">,</span><a href="http://www.php.net/create_function"><span style="color: #990000;">create_function</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'$a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;return null;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> removeHeadLinks<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; remove_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rsd_link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; remove_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wlwmanifest_link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'removeHeadLinks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> no_generator<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_generator'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'no_generator'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<h5>htaccess</h5>
<p>.htaccess is a joyous little world unto itself, like finding a hole in your backyard that leads into a vast cave system. mmm spelunking.</p>
<p>Much of my learning about security has revolved around what can be done with htaccess, and in particular <a href="http://perishablepress.com/" onclick="window.open(this.href); return false;">Perishable Press</a> and their <a href="http://perishablepress.com/press/2009/03/16/the-perishable-press-4g-blacklist/" onclick="window.open(this.href); return false;">4G Blacklist</a>. And much of what I do for security takes place here.</p>
<p>Starting with denying access to all to read the htaccess file itself. Then there is the WordPress hook that allows the install to exist in a different directory location to the site url. For those again who have SSL on their server, forcing SSL can be done here for admin and login. Then there are a bunch of protections to stop access to certain important files, install.php, wpconfig.php, and the WordPress readme.html.</p>
<p>Using gzip compression to deliver files and adding content expires information doesn&#8217;t strictly have much to do with security, but really, the difference in load times the former can make to a site, and the general usefulness of expires tags make this one to automatically add.</p>
<p>For those on Dreamhost, the DH-PHP handlers is automatically added when using the site-specific php.ini installer, something I&#8217;ll cover a bit further down.</p>
<p>Hotlinking prevents leechers sucking images and other content off your site, one of the first things I ever learnt how to prevent, when supernaut suddenly had massive bandwidth use as my images turned up in all manner of places.</p>
<p>The no-referrer section is specifically to thwart spammers circumventing your site altogether and trying to inject comment spam directly into the comments php. It&#8217;s also possible to block access to xml-rpc here, and use login passwords via httpasswd for extra security on the login page, both not included here.</p>
<p>Then comes the Perishable Press 4G Blacklist, a cornucopia of amazingness, which I left out for sake of brevity (haha). I have included two lines that need to be commented out in order for the browser-based file manager <a href="http://www.ajaxplorer.info/" onclick="window.open(this.href); return false;">AjaXplorer</a> to function ok.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># === DENY HTACCESS ===<br />
&lt;files .htaccess&gt;<br />
order allow,deny<br />
deny from all<br />
&lt;/files&gt;<br />
# === END DENY HTACCESS ===<br />
<br />
# === BEGIN WORDPRESS ===<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
&lt;/IfModule&gt;<br />
# === END WORDPRESS ===<br />
<br />
# === FORCE SSL ===<br />
#RewriteRule !^/wp-(admin|login|register)(.*) - [C]<br />
# === END FORCE SSL ===<br />
<br />
# === PROTECT install.php ===<br />
&lt;Files install.php&gt;<br />
&nbsp; &nbsp; Order Allow,Deny<br />
&nbsp; &nbsp; Deny from all<br />
&nbsp; &nbsp; Satisfy all<br />
&lt;/Files&gt;<br />
# === END PROTECT install.php ===<br />
<br />
# === PROTECT readme.html<br />
&lt;files readme.html&gt;<br />
&nbsp; &nbsp; Order deny,allow<br />
&nbsp; &nbsp; deny from all<br />
&lt;/files&gt;<br />
# === END PROTECT readme.html<br />
<br />
# === PROTECT wpconfig.php ===<br />
&lt;files wp-config.php&gt;<br />
order allow,deny<br />
deny from all<br />
&lt;/files&gt;<br />
# === PROTECT wpconfig.php ===<br />
<br />
# === DH-PHP handlers ===<br />
AddHandler fastcgi-script fcg fcgi fpl<br />
AddHandler php-fastcgi .php<br />
Action php-fastcgi /cgi-bin/dispatch.fcgi<br />
# === END DH-PHP handlers ===<br />
<br />
# === BEGIN GZIP FILE TYPES BY EXTENSION ===<br />
&lt;Files *.html&gt;<br />
SetOutputFilter DEFLATE<br />
&lt;/Files&gt;<br />
&lt;Files *.css&gt;<br />
SetOutputFilter DEFLATE<br />
&lt;/Files&gt;<br />
&lt;Files *.js&gt;<br />
SetOutputFilter DEFLATE<br />
&lt;/Files&gt;<br />
&lt;Files *.ttf&gt;<br />
SetOutputFilter DEFLATE<br />
&lt;/Files&gt;<br />
# === END GZIP FILE TYPES BY EXTENSION ===<br />
<br />
# === BEGIN CONTENT EXPIRES ===<br />
#set expire dates<br />
&lt;IfModule mod_expires.c&gt;<br />
ExpiresActive on<br />
# 60 seconds * 60 minutes * 24 hours * 7 days<br />
ExpiresDefault A604800<br />
# 60 seconds * 60 minutes * 24 hours<br />
ExpiresByType text/html A86400<br />
&lt;/IfModule&gt;<br />
&lt;FilesMatch &quot;\.(ico|pdf|flv|f4v|m4v|jpg|jpeg|png|gif|swf|js|css|ttf)$&quot;&gt;<br />
# configure ETag<br />
FileETag none<br />
# max-age set to one week as above<br />
Header set Cache-Control &quot;max-age=604800, public, must-revalidate&quot;<br />
# if you use ETags, you should unset Last-Modified<br />
# Header unset Last-Modified<br />
&lt;/FilesMatch&gt;<br />
# === END CONTENT EXPIRES ===<br />
<br />
# &nbsp;=== DISABLE HOTLINKING ===<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine on<br />
RewriteCond %{HTTP_REFERER} !^$<br />
RewriteCond %{REQUEST_FILENAME} -f<br />
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png|ico)$ [NC]<br />
RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?domainname\. [NC]<br />
RewriteRule \.(gif|jpe?g?|png|ico)$ - [F,NC,L]<br />
&lt;/ifModule&gt;<br />
#=== END DISABLE HOTLINKING ===<br />
<br />
# === DENY ACCESS TO NO-REFERRER REQUESTS ===<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteCond %{REQUEST_METHOD} POST<br />
RewriteCond %{REQUEST_URI} .wp-comments-post\. [NC]<br />
RewriteCond %{HTTP_REFERER} !.*domainname\. [OR,NC]<br />
RewriteCond %{HTTP_USER_AGENT} ^$<br />
RewriteRule (.*) - [F,L]<br />
&lt;/IfModule&gt;<br />
# === END DENY ACCESS TO NO-REFERRER REQUESTS ===<br />
<br />
# === PERISHABLE PRESS 4G BLACKLIST ===<br />
<br />
(snip…)<br />
<br />
# QUERY STRING EXPLOITS<br />
&lt;IfModule mod_rewrite.c&gt;<br />
# this line stops ajaxplorer working<br />
RewriteRule ^(.*)$ - [F,L]<br />
&lt;/IfModule&gt;<br />
<br />
# CHARACTER STRINGS<br />
&lt;IfModule mod_alias.c&gt;<br />
&nbsp;# BASIC CHARACTERS<br />
# RedirectMatch 403 \/\/ ajaxplorer again<br />
&lt;/IfModule&gt;</div></td></tr></tbody></table></div>
<h5>robots.txt</h5>
<p>Equally effective, and probably overkill, using robots.txt can grant or forbid access to a slew of places, particularly directories that you don&#8217;t want spidered, as well as any and all WordPress directories, using Disallow: /wp*.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">User-agent: *<br />
Disallow: /cgi-bin<br />
Disallow: /lurking<br />
Disallow: /phpsecinfo<br />
Disallow: /wp-*<br />
Disallow: /tag<br />
Disallow: /author<br />
Disallow: /wget/<br />
Disallow: /httpd/<br />
Disallow: /i/<br />
Disallow: /f/<br />
Disallow: /t/<br />
Disallow: /c/<br />
Disallow: /j/<br />
&nbsp;<br />
User-agent: Mediapartners-Google<br />
Allow: /<br />
&nbsp;<br />
User-agent: Adsbot-Google<br />
Allow: /<br />
&nbsp;<br />
User-agent: Googlebot-Image<br />
Allow: /<br />
&nbsp;<br />
User-agent: Googlebot-Mobile<br />
Allow: /<br />
&nbsp;<br />
User-agent: ia_archiver-web.archive.org<br />
Disallow: /<br />
&nbsp;<br />
Sitemap: http://www.domainname.tld/sitemap.xml</div></td></tr></tbody></table></div>
<h5>php.ini and phpsecinfo</h5>
<p>Getting deeper into the system still and further yet from WordPress, modifying php.ini, the file that sets up what php can do is another essential. Dreamhost doesn&#8217;t make it easy to edit the php.ini, but fortunately there&#8217;s <a href="http://sxi.sabrextreme.com/phpini" onclick="window.open(this.href); return false;">a script which installs it locally</a>. More excitement ahead.</p>
<p>As with htaccess, much can be done in php.ini to prevent messiness. The following seem to work rather well. I&#8217;ll leave this uncommented upon except to say AjaXplorer needs fopen to be on, and shall devote a future post to elaborating on php.ini security.</p>
<div class="codecolorer-container ini default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="ini codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000099;">open_basedir</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> /home/site/folder:/home/site/tmp/folder</span><br />
<span style="color: #000099;">disable_functions</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> exec,passthru,system,proc_open,popen,curl_multi_exec,parse_ni_file,show_source</span><br />
<span style="color: #000099;">expose_php</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> Off</span><br />
<span style="color: #000099;">error_reporting</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> E_ALL &amp; ~E_NOTICE</span><br />
<span style="color: #000099;">register_globals</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> Off</span><br />
<br />
<span style="color: #666666; font-style: italic;">; Whether to allow HTTP file uploads.</span><br />
<span style="color: #000099;">file_uploads</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> On</span><br />
<span style="color: #000099;">upload_tmp_dir</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> /home/site/folder/tmp/php</span><br />
<span style="color: #666666; font-style: italic;">; Maximum allowed size for uploaded files.</span><br />
<span style="color: #000099;">upload_max_filesize</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 200M</span><br />
<br />
<span style="color: #666666; font-style: italic;">; Whether to allow the treatment of URLs (like http:// or ftp://) as files.</span><br />
<span style="color: #000099;">allow_url_fopen</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> On</span><br />
<br />
<span style="color: #666666; font-style: italic;">; Whether to allow include/require to open URLs (like http:// or ftp://) as files.</span><br />
<span style="color: #000099;">allow_url_include</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> Off</span></div></td></tr></tbody></table></div>
<p>In addition to editing php.ini, and making sure there isn&#8217;t a file lying around called info.php with phpinfo() inside, <a href="http://phpsec.org/projects/phpsecinfo/index.html" onclick="window.open(this.href); return false;">phpSecInfo</a> is an invaluable tool for assaying the security of your website, the results from which can be directly used to edit php.ini.</p>
<h5>FTP, or rather SFTP.</h5>
<p>As with passwords being sent in the clear, so too is FTP on its own not so great. Dreamhost allows for shell plus SFTP access with FTP disabled, which is both sensible for using desktop FTP clients (such as the amazing <a href="http://www.panic.com/transmit/" onclick="window.open(this.href); return false;">Transmit</a>), and for searching out code injections. Time to open Terminal.</p>
<p>Commandline access is essential for a number of reasons, and instead of using the username/password combination, create passwordless login using private keys.</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">//</span>Generate a RSA private key<br />
<br />
<span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-t</span> rsa<br />
<br />
<span style="color: #000000; font-weight: bold;">//</span> copy the key to your website<br />
<br />
<span style="color: #c20cb9; font-weight: bold;">scp</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub user<span style="color: #000000; font-weight: bold;">@</span>domainname.tld:~<span style="color: #000000; font-weight: bold;">/</span><br />
<br />
<span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> into your website<br />
<span style="color: #c20cb9; font-weight: bold;">ssh</span> user<span style="color: #000000; font-weight: bold;">@</span>domainname.tld<br />
<br />
<span style="color: #000000; font-weight: bold;">//</span>Make a new folder, .ssh and copy the key to the authorized_keys <span style="color: #c20cb9; font-weight: bold;">file</span>, <span style="color: #000000; font-weight: bold;">then</span> delete the key<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> .ssh<br />
<span style="color: #c20cb9; font-weight: bold;">cat</span> id_rsa.pub <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> .ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> id_rsa.pub<br />
<br />
<span style="color: #000000; font-weight: bold;">//</span>Set all permissions<br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> go-w ~<br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys</div></td></tr></tbody></table></div>
<p>Why might this all be useful? Going back to when I was hacked earlier this year, I could have gone though all the files on all my sites looking for base64 code, instead I opened Terminal, SSH&#8217;ed in and sent this command:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.php&quot;</span> <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;base64&quot;</span> <span style="color: #ff0000;">'{}'</span> \; <span style="color: #660033;">-print</span></div></td></tr></tbody></table></div>
<p>Which searches through all files with the extension .php for the string base64 and dumps the results on screen. I found every instance of the hack in a matter of seconds.</p>
<h5>Plugins for security.</h5>
<p>Leaving aside all that code now…</p>
<p>WordPress is amazing because of its plugins and the community around its development. The problem though, for any plugin is twofold. Which one does the task you want the best (while integrating with the rest of your setup), and is updated frequently enough to not become a liability?</p>
<p>After the initial hack, I had many installed, which I then uninstalled because of small irritations and annoyances. After changing all my passwords to 16+ characters, including as many of type !@£$%^&#038;_ as allowable, <a href="http://wordpress.org/extend/plugins/wordpress-file-monitor/" onclick="window.open(this.href); return false;">WordPress File Monitor</a> has become an installation standard.</p>
<p>Rather than provide security, it lets you know when any modifications to files and folders have occurred, and in which. Notification via email and/or Dashboard alert, alterable scan intervals and directory path exclusions for me make this indispensable. When a new exploit emerges, instead of panicking and manually scanning all my installs for changes (which I do anyway out of nervous boredom), I can be fairly secure they will show up here. Of course, the idea is not to get hacked in the first place.</p>
<p>I&#8217;ve read a lot of good things about <a href="http://wordpress.org/extend/plugins/askapache-password-protect/" onclick="window.open(this.href); return false;">AskApache Password Protect</a>, but I&#8217;ve never got it working, despite adding all the .htaccess files and even chmod up to 666. I would at least play with it otherwise, but for now don&#8217;t want to spend the time on it.</p>
<p>In general though (and said with a caveat that I don&#8217;t really know WordPress very well), much or all security that can be done with plugins can be done in other ways &#8211; .htaccess, robots.txt. php.ini, wp-config, sql changes and so on. Also, so many of the plugins haven&#8217;t been updated recently, which for me is worse than no protection due to the false sense of security.</p>
<p>During the course of the last two days, while I went through all the security stuff I could find, websites, pdfs, my own archives, I came across a couple of other plugins which I think are useful.</p>
<p><a href="http://moggy.laceous.com/2009/09/05/semisecure-login-reimagined-v3/" onclick="window.open(this.href); return false;">Semi Secure Login Reimagined</a> provides about as good public and secret key encryption for passwords as possible if you don&#8217;t have access to SSL. </p>
<p><a href="http://wordpress.org/extend/plugins/wp-security-scan/" onclick="window.open(this.href); return false;">WP Security Scan</a> I found useful for a post-install check to make sure all the settings were as minimally tight as could be. In the interests of not having hundreds of plugins, I uninstalled it after.</p>
<p><a href="http://alexking.org/projects/wordpress" onclick="window.open(this.href); return false;">404 Notifier</a> does just that, though I suspect getting off my ass and reading the logs (or ssh and then grepping them for 404s) would be a better idea.</p>
<h5>Sources</h5>
<p>Much of my information for this comes from a few places.</p>
<p>The <a href="http://codex.wordpress.org/Hardening_WordPress" onclick="window.open(this.href); return false;">WordPress Codex</a> itself is a good place to start, and the Plugin directory also worth spending time in.<br />
<a href="http://perishablepress.com/" onclick="window.open(this.href); return false;">Perishable Press</a> is invaluable, and not just for security.<br />
<a href="http://digwp.com/" onclick="window.open(this.href); return false;">Digging into WordPress</a>, both the website and the book are the fundamental step-by-step guide for all things security and WordPress.<br />
The WordPress community, across many blogs, forums, books, comments and bits and pieces.</p>
<p>Oh, and while this applies also to WordPress 2.9.x, I&#8217;m currently running the 3.0 beta on <a href="http://thingswithbits.info/" onclick="window.open(this.href); return false;">thingswithbits.info</a> where I tested all this. (hopefully this all doesn&#8217;t add to confusion.)</p>
]]></content:encoded>
			<wfw:commentRss>http://thingswithbits.info/2010/05/wordpress-security-in-many-small-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shifting Daniel Jaber into WordPress</title>
		<link>http://thingswithbits.info/2010/04/shifting-daniel-jaber-into-wordpress/</link>
		<comments>http://thingswithbits.info/2010/04/shifting-daniel-jaber-into-wordpress/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 18:43:49 +0000</pubDate>
		<dc:creator>frances</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://thingswithbits.info/2010/04/shifting-daniel-jaber-into-wordpress/</guid>
		<description><![CDATA[Daniel Jaber is the second choreographer and dancer I&#8217;ve done a website for. Coming from Dasniya Sommer, I was intent on messing around with jQuery again, and finding something distinctive to build his site around. The initial site, as with Dasniya, was hand-coded, relying on jQueryTools, which I discovered through Flowplayer for much of the [...]]]></description>
			<content:encoded><![CDATA[<p>Daniel Jaber is the second choreographer and dancer I&#8217;ve done a website for. Coming from <a onclick="window.open(this.href); return false;" href="http://dasniyasommer.de">Dasniya Sommer</a>, I was intent on messing around with <a onclick="window.open(this.href); return false;" href="http://jquery.com/">jQuery</a> again, and finding something distinctive to build his site around. The initial site, as with Dasniya, was hand-coded, relying on <a onclick="window.open(this.href); return false;" href="http://flowplayer.org/tools/index.html">jQueryTools</a>, which I discovered through <a onclick="window.open(this.href); return false;" href="http://flowplayer.org/">Flowplayer</a> for much of the interactivity.</p>
<p>Two big problems emerged. Firstly was the pain of updating static HTML. Even though I write my blog posts in this way, and have no difficulty screening out code from in front of my eyes, this way of managing a site is painful. The second big problem was the conflicts between how the content on the page was loaded and both video and images. The plan had always been to put the site into <a onclick="window.open(this.href); return false;" href="http://wordpress.org/">WordPress</a>, and so I did.</p>
<p>The idea for using Daniel as his own background image was a fairly inevitable one, remembering when I first saw him, all piercings, blue mohawk, tattoos. I first tried <a onclick="window.open(this.href); return false;" href="http://buildinternet.com/2009/02/supersized-full-screen-backgroundslideshow-jquery-plugin/">supersized</a> for this, but found it slightly heavy for just a single image. Lucky then <a onclick="window.open(this.href); return false;" href="http://css-tricks.com/perfect-full-page-background-image/">CSS-Tricks</a> had the perfect, all-css answer, which has become one of my favourite bits of code, being fond as I am of huge background images.</p>
<p>First though, I had an idea for the menu, coming from jQueryTools&#8217; <a onclick="window.open(this.href); return false;" href="http://flowplayer.org/tools/demos/tabs/accordion.html">accordion tabs</a>, with much eviscerating of CSS and some slowing down of the slide effect. This though, I could never get to work in WordPress. Much messing around in jQuery, dynamically adding classes and divs and removing them from elsewhere, I could even get it to work using an identical sidebar HTML structure to WordPress, but when I tried to use it in WordPress, weirdness ensued. I really wanted to use this though, because it&#8217;s the only accordion I&#8217;d seen with different times for the sliding effect.</p>
<p>But WordPress has almost everything, and I fell upon <a onclick="window.open(this.href); return false;" href="http://bruzed.com/accordion-menu/">jQuery Accordion Menu for Wordpress</a>, which has very similar code, taking a couple of hours at the most to get the CSS right and working rather nice.</p>
<p>Of course when I added the page crossfade eyecandy, it broke again. My fault for using redirectPage.</p>
<p><a onclick="window.open(this.href); return false;" href="http://supernaut.info">supernaut</a> still uses the <a onclick="window.open(this.href); return false;" href="http://wiki.novemberborn.net/sifr/">Flash-based sIFR method</a> for using nice fonts, but the last couple of sites I&#8217;ve been rather enjoying the combination of open-source fonts and <a onclick="window.open(this.href); return false;" href="http://www.alistapart.com/articles/cssatten">@font-face</a>. Not one of those beautiful new CSS3 adventure like opacity or rounded corners, even Internet Explorer 5 supported this, and lately with a deluge of options for pretty typography, it has become increasingly popular. And far easier to implement that sIFR also. Oh, the title font is <a onclick="window.open(this.href); return false;" href="http://www.ms-studio.com/FontSales/anonymouspro.html">Anonymous Pro</a>, which I think is one of the most elegant monospace fonts around (also important that is has Unicode-based character set, important for things like ü and ß).</p>
<p>Being dance, video was always going to be lurking. I wrote about my fun with <a onclick="window.open(this.href); return false;" href="http://thingswithbits.info/wordpress/?p=7">Flowplayer and WordPress</a> earlier, and still finishing this, with bandwidth check, pseudostreaming and the inevitable full-screen option shuffling this way. I&#8217;d rather be doing this all in HTML5 though, and shall come up with a graceful degradation from that to this in my next project.</p>
<p>A bunch of small plugins helped me along the way also. <a onclick="window.open(this.href); return false;" href="http://dd32.id.au/wordpress-plugins/add-from-server/">Add From Server</a> let me add video to the WordPress Media Libary after I&#8217;d uploaded via FTP &#8211; perfect for large file sizes, and <a onclick="window.open(this.href); return false;" href="http://chrismeller.com/2007/07/modifying-allowed-upload-types-in-wordpress">modifying allowable upload file types</a> meant I could get the f4v there also.</p>
<p><a onclick="window.open(this.href); return false;" href="http://joelstarnes.co.uk/pagemash/">pageMash</a> made structuring the site and reordering projects as they move from &#8216;soon&#8217; to &#8216;now&#8217; to &#8216;then&#8217; so much nicer than blah-ing around editing the pages themselves, and <a onclick="window.open(this.href); return false;" href="http://www.zehnet.de/">PHP Execution</a> made it possible to do the Flowplayer video cludge.</p>
<p>Elsewhere, <a onclick="window.open(this.href); return false;" href="http://www.23systems.net/plugins/lightbox-plus/">Lightbox Plus</a> for a not-overpowering image gallery, though I am still working on this. <a onclick="window.open(this.href); return false;" href="http://www.poradnik-webmastera.com/projekty/db_cache_reloaded/">DB Cache Reloaded</a> and <a onclick="window.open(this.href); return false;" href="http://www.satollo.net/plugins/hyper-cache">Hyper Cache</a> for the necessary site caching, as long as I don&#8217;t forget to disable them when I&#8217;m busy working. <a onclick="window.open(this.href); return false;" href="http://www.weaselhat.com/phpenkoder/">PHPEnkoder</a>, based on my favourite Hivelogic anti-spam email encoder. And <a onclick="window.open(this.href); return false;" href="http://hivelogic.com/enkoder">WordPress File Monitor</a>, which is about the most useful anti-hacking plugins I&#8217;ve found.</p>
<p>Oh, and <a onclick="window.open(this.href); return false;" href="http://www.onextrapixel.com/2010/02/23/how-to-use-jquery-to-make-slick-page-transitions/">page crossfade</a>! I know it&#8217;s a bit Flash 2001, but I really did want to recreate the page fade-out/-in from the original site. (Not so good if JavaScript is turned off though.)</p>
<p><a class="images" title="Daniel Jaber Website" rel="lightbox" href="http://thingswithbits.info/wordpress/wp-content/uploads/daniel-jaber.jpg"><img class="alignnone size-full wp-image-30" title="Daniel Jaber Website small" src="http://thingswithbits.info/wordpress/wp-content/uploads/t-daniel-jaber.jpg" alt="Daniel Jaber Website small" width="430" height="242" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://thingswithbits.info/2010/04/shifting-daniel-jaber-into-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customised Flowplayer in Wordpress</title>
		<link>http://thingswithbits.info/2010/04/customised-flowplayer-in-wordpress/</link>
		<comments>http://thingswithbits.info/2010/04/customised-flowplayer-in-wordpress/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 23:23:45 +0000</pubDate>
		<dc:creator>frances</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://thingswithbits.info/wordpress/?p=7</guid>
		<description><![CDATA[Last year while working on dasniyasommer.de and dealing with presenting video in an attractive way with much backend flexibility, I found Flowplayer. It&#8217;s remained my favourite video player, though with doing all my projects at the moment in WordPress, I went through a struggle the last days with it. On another project I did recently, [...]]]></description>
			<content:encoded><![CDATA[<p>Last year while working on <a href="http://dasniyasommer.de">dasniyasommer.de</a> and dealing with presenting video in an attractive way with much backend flexibility, I found <a href="http://flowplayer.org/">Flowplayer</a>. It&#8217;s remained my favourite video player, though with doing all my projects at the moment in WordPress, I went through a struggle the last days with it.</p>
<p>On another project I did recently, <a onclick="window.open(this.href); return false;" href="http://bedrohtevoelker.de/">bedrohtevoelker.de</a> (a simple transfer into Wordpress using a template to make updating content easier), I used <a onclick="window.open(this.href); return false;" href="http://foliovision.com/seo-tools/wordpress/plugins/fv-wordpress-flowplayer">FV Wordpress Flowplayer</a>, but like all the plugins, and all the other players I&#8217;ve seen, there was little or no possibility to customise the controller or other background aspect.</p>
<p>I&#8217;ve been working on bringing <a onclick="window.open(this.href); return false;" href="http://danieljaber.com">Daniel Jaber&#8217;s website</a> into Wordpress in the last week. The original site, hand-coded falls apart in three quite important areas. Firstly, being html it&#8217;s a pain to update. Secondly, the combination of site structure and function make it a pain to get video and images to work properly, and thirdly, it breaks in the standard browser that things break in.</p>
<p>I thought I&#8217;d begin by first uploading all the text content, using <a onclick="window.open(this.href); return false;" href="http://www.blueprintcss.org/">Blueprint CSS</a> again, which I&#8217;m customising more and more with each project, formatting this, and the general site structure and layout, deal with the image overlays, and then move onto the accordion menu and perhaps AJAX-ing the page loading after I&#8217;d done the video. The last couple of days have been video.</p>
<p>Much searching and trialling of plugins led me to think it was not going to be easy to recreate the video player as I&#8217;d coded it using this approach, so I started to look for both another workable option, and a fallback (ugh) in case there wasn&#8217;t.</p>
<p>My first serious approach was <a onclick="window.open(this.href); return false;" href="http://brightsky.ie/manually-adding-flowplayer-to-a-wordpress-theme/">Manually Adding Flowplayer to a Wordpress Theme</a>, a step in the right direction, but not so manageable also. So then I started thinking, well it&#8217;s just a clump of Javascript with some specific HTML on the end, why can&#8217;t I just paste that into the HTML editor in Wordpress? Because when you do things like that, Wordpress breaks them. My next idea was, well, is there anyway to not-break them? Somehow my feeble brain stumbled back towards inserting PHP into a post.</p>
<p>Hallo <a onclick="window.open(this.href); return false;" href="http://www.zehnet.de/2009/02/25/wordpress-php-execution-plugin/">Wordpress PHP Execution Plugin</a>. Though I did try the highly downloaded <a onclick="window.open(this.href); return false;" href="http://bluesome.net/post/2005/08/18/50/">Exec-PHP</a> first, it only allows pages to be written in HTML mode, not so good for people who just want to upload content. PHP Execution semi-allows this. in Visual mode, the PHP sits behind an image, so doesn&#8217;t get converted into junk. The semi-part is that if you edit a page in Visual mode, it breaks, but there is a cludge-ish workaround.</p>
<p>I started first by following the original article, adding the Flowplayer code to my page template, to make sure it worked and where it broke, then transferring it into a test-page and seeing the same. In the end, very little went askew. The plugin handles indented code formatting without letting Wordpress stick a p or br tag between every new line, and respecting for the most part spaces as spaces, and the occasional addition of \ escapes was all the extra I added.</p>
<p>The only place it really gets affected is a matter of styling, where any line breaks between divs and other html markup, i.e. the last lines which create the player and controller have a br added between. Running all these lines into one fixed that, and the css I used in the original layout largely carried across to the new site &#8211; though I cleaned it up a little and took advantage of some CSS3 rounded corners.</p>
<p>Once this was all done, I decided to add a little pleasure for Daniel while editing a project page. The standard PHP Execution plugin covers the code in a small purple-ish &#8216;PHP&#8217; graphic. I thought it&#8217;d be nicer, as the idea is for him to do everything besides the video in visual mode, to replace that graphic with a corresponding one representing the splash image for the player. A couple of minutes in Photoshop and then changing a couple of lines in the plugin&#8217;s css and happiness ensued.</p>
<p>What&#8217;s left to do then is get this working with multiple players on the same page and add in some of the other good features such as bandwidth streaming. With all of Flowplayer contained in the JavaScript or in a couple of lines of html and only making calls to either the player&#8217;s JavaScript or .swf files, this method seems to be the best I&#8217;ve come across that allows for both the abilities of the player and the simplicity of Wordpress to work together. The only place it seems to break is if you edit the page in visual mode, but at least visual mode isn&#8217;t ruled out entirely, and copy-pasting the player code with edits for the correct file paths in html mode as a last step is an acceptable-ish compromise.</p>
<p>Oh and the code below, using the <a onclick="window.open(this.href); return false;" href="http://kpumuk.info/projects/wordpress-plugins/codecolorer/">CodeColorer Plugin</a>, which works fine from ecto also.</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div id=&quot;video&quot;&gt;<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
window.onload = function () {<br />
$(function() {<br />
&nbsp; &nbsp; $f(&quot;player&quot;, &quot;/path/to/flowplayer-3.1.5.swf&quot;, {<br />
&nbsp; &nbsp; &nbsp; &nbsp; play: null,<br />
&nbsp; &nbsp; &nbsp; &nbsp; clip: {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; baseUrl: \'http://danieljaber.com\'<br />
&nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; playlist: [<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url: \'/path/to/video.f4v\',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; title: \'a title\',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subTitle: \'a sub-title, ...\',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time: \'3:07\'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; ],<br />
&nbsp; &nbsp; &nbsp; &nbsp; plugins: &nbsp;{<br />
&nbsp; &nbsp; &nbsp; &nbsp; controls: null, &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; canvas: {<br />
&nbsp; &nbsp; &nbsp; &nbsp; backgroundGradient: \'none\',<br />
&nbsp; &nbsp; &nbsp; &nbsp; backgroundColor: \'#000000\',<br />
&nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; }).controls(&quot;appleControls&quot;);<br />
});<br />
};<br />
&lt;/script&gt;<br />
&lt;a class=&quot;player plain&quot; id=&quot;player&quot;&gt;&lt;img src=&quot;/path/to/splash-image.jpg&quot; alt=&quot;splash image&quot; /&gt;&lt;/a&gt;&lt;div id=&quot;appleControls&quot; class=&quot;controls&quot;&gt;&lt;/div&gt;<br />
&lt;/div&gt;'</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p><a class="images" title="Flowplayer &amp; PHP &amp; Wordpress admin" rel="lightbox" href="http://thingswithbits.info/wordpress/wp-content/uploads/flowplayer-php-wordpress-admin.jpg"><img class="alignnone size-full wp-image-12" title="flowplayer php wordpress admin small" src="http://thingswithbits.info/wordpress/wp-content/uploads/t-flowplayer-php-wordpress-admin.jpg" alt="flowplayer php wordpress admin small" width="430" height="242" /></a></p>
<p><a class="images" rel="lightbox" href="http://thingswithbits.info/wordpress/wp-content/uploads/flowplayer-php-wordpress-admin.jpg"></a><a class="images" title="Flowplayer &amp; PHP &amp; Wordpress admin" rel="lightbox" href="http://thingswithbits.info/wordpress/wp-content/uploads/flowplayer-php-wordpress-site.jpg"><img class="alignnone size-full wp-image-13" title="flowplayer php wordpress site small" src="http://thingswithbits.info/wordpress/wp-content/uploads/t-flowplayer-php-wordpress-site.jpg" alt="flowplayer php wordpress site small" width="430" height="242" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://thingswithbits.info/2010/04/customised-flowplayer-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
