<?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>Hugh Lashbrooke</title>
	<atom:link href="http://www.hughlashbrooke.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hughlashbrooke.com</link>
	<description>PHP, HTML, CSS &#38; WordPress developer at WooThemes</description>
	<lastBuildDate>Fri, 18 May 2012 09:56:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Make your WordPress content editor use HTML by default</title>
		<link>http://www.hughlashbrooke.com/make-your-wordpress-content-editor-use-html-by-default/</link>
		<comments>http://www.hughlashbrooke.com/make-your-wordpress-content-editor-use-html-by-default/#comments</comments>
		<pubDate>Thu, 17 May 2012 11:09:32 +0000</pubDate>
		<dc:creator>Hugh Lashbrooke</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://www.hughlashbrooke.com/?p=1166</guid>
		<description><![CDATA[A quick line of code to ensure that your WordPress content editor will always land on the HTML tab by default. This will ensure that your HTML tags &#038; attributes are never stripped automatically.]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.hughlashbrooke.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>The WordPress content editor will always show you the &#8216;Visual&#8217; tab by default. If you are one of the many people who have problems with the visual editor stripping out your HTML tags or attributes, this can quickly get very annoying &#8211; every time you load a post to make changes, it lands on the Visual tab and has all your nice HTML removed.</p>
<p>Here&#8217;s a simple line of code that you can add to your theme&#8217;s functions.php file to ensure that it always lands on the HTML tab by default (you will still have the option of switching to the Visual tab of course):</p>
<p><pre class="brush: php">add_filter( 'wp_default_editor', create_function('', 'return &quot;html&quot;;') );</pre></p>
<div class="betterrelated"><p><strong>Some similar content that you may be interested in:</strong></p>
<ol><li> <a href="http://www.hughlashbrooke.com/creating-shortcodes-in-wordpress/" title="Permanent link to Creating shortcodes in WordPress">Creating shortcodes in WordPress</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/front-end-wordpress-developer-interview-test/" title="Permanent link to Front-end &#038; WordPress developer interview test">Front-end &#038; WordPress developer interview test</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/wordpress-plugins-that-i-always-use/" title="Permanent link to WordPress plugins that I always use">WordPress plugins that I always use</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/monitor-wordpress-activity-including-hack-attempts/" title="Permanent link to Monitor WordPress activity (including hack attempts)">Monitor WordPress activity (including hack attempts)</a>  </li>
</ol></div><p>This post is originally written by <a href="http://www.hughlashbrooke.com/">Hugh Lashbrooke</a> &copy; 2012. All Rights Reserved</p>]]></content:encoded>
			<wfw:commentRss>http://www.hughlashbrooke.com/make-your-wordpress-content-editor-use-html-by-default/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a (free-ish) custom URL shortener</title>
		<link>http://www.hughlashbrooke.com/create-a-free-ish-custom-url-shortener/</link>
		<comments>http://www.hughlashbrooke.com/create-a-free-ish-custom-url-shortener/#comments</comments>
		<pubDate>Thu, 03 May 2012 13:39:54 +0000</pubDate>
		<dc:creator>Hugh Lashbrooke</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[YOURLS]]></category>

		<guid isPermaLink="false">http://www.hughlashbrooke.com/?p=1088</guid>
		<description><![CDATA[I, like many other people, recently created my own URL shortener that I use for links to pages on my website as well as sharing any other links I find. It was actually surprisingly easy to get setup thanks to a handy service called YOURLS, so I thought I would share the process here.]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.hughlashbrooke.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>I, like many other people, recently created my own URL shortener that I use for links to pages on my website as well as sharing any other links I find. It was actually surprisingly easy to get setup thanks to a handy service called <a title="YOURLS" href="http://yourls.org/" target="_blank">YOURLS</a>, so I thought I would share the process here. There a number of reasons for setting up your own URL shortener, but in my case it came down to two things: tracking click stats and looking cool. Sure, after reading this post you will know how to create a URL shortener that you can even open to the public, but let&#8217;s be honest &#8211; the main reason for wanting to do this is for the geek-cred.</p>
<p>So here is a basic step-by-step on how to set up a URL shortener for yourself and potentially for public use too.</p>
<h4>Get a short domain</h4>
<p>The first step of course, is to register a short domain (hlash.me in my case). This is easy enough to get and can be done through any number of service providers. You will need to register a domain with hosting attached that has PHP activated on the server. You also need a MySQL database, but in my case I&#8217;m using this sites database so that wasn&#8217;t an issue for me. The domain registration and hosting is the only cost involved in the whole process.</p>
<h4>Download and install YOURLS</h4>
<p>Go to <a title="YOURLS" href="http://yourls.org/" target="_blank">the YOURLS website</a> and download the package. Once you have it, the only code you need to edit is includes/config.php &#8211; just setup the environment variable as required (this is very similar to setting up your a WordPress config file and is really straight forward to do). Once you have your code configured correctly simply upload the files to the root of your new domain and go to domain.com/admin/install.php &#8211; this will setup the necessary database files, YOURLS folders and .htaccess entries. From then on you just need to go to domain.com/admin to to administer your URL shortening service. You can use this dashboard to manually add URLs to shorten or to add a bookmarklet that lets you instantly shorten the URL of whatever page you are on at the time.</p>
<p>If you would like this service to be made public you can specify that in the config file. You can also use this dashboard to track the stats of your links to see when and how often they are clicked &#8211; gethering stats like this is obviously very valuable.</p>
<h4>Integrate YOURLS with WordPress</h4>
<p>This obviously only applies to people who have a WordPress site that they would like to integrate with YOURLS in order to have all their post URL automatically shortened and (optionally) posted to Twitter. All you need to do is to download the <a title="YOURLS (WordPress to Twitter) plugin" href="http://planetozh.com/blog/my-projects/yourls-wordpress-to-twitter-a-short-url-plugin/" target="_blank">YOURLS (WordPress to Twitter) plugin</a> and go through the simple configuration process to get everything sorted. The guide on the plugin page is more than sufficient for getting yourself setup, so I don&#8217;t think I need to repeat everything here. In the end your posts will automatically be supplied with a shortened URL and, if you like, they can be posted directly to Twitter.</p>
<p>So that&#8217;s it &#8211; easy, right?</p>
<div class="betterrelated"><p><strong>Some similar content that you may be interested in:</strong></p>
<ol><li> <a href="http://www.hughlashbrooke.com/experiment-streamlining-my-online-content-using-ifttt-tumblr/" title="Permanent link to Experiment: Streamlining my online content using ifttt &#038; tumblr">Experiment: Streamlining my online content using ifttt &#038; tumblr</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/wordpress-plugins-that-i-always-use/" title="Permanent link to WordPress plugins that I always use">WordPress plugins that I always use</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/using-nutch-and-solr-to-crawl-and-index-the-web/" title="Permanent link to Using Nutch and Solr to crawl and index the web">Using Nutch and Solr to crawl and index the web</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/code-snippet-a-custom-twitter-feed-for-your-website/" title="Permanent link to Code Snippet: A custom Twitter feed for your website">Code Snippet: A custom Twitter feed for your website</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/monitor-wordpress-activity-including-hack-attempts/" title="Permanent link to Monitor WordPress activity (including hack attempts)">Monitor WordPress activity (including hack attempts)</a>  </li>
</ol></div><p>This post is originally written by <a href="http://www.hughlashbrooke.com/">Hugh Lashbrooke</a> &copy; 2012. All Rights Reserved</p>]]></content:encoded>
			<wfw:commentRss>http://www.hughlashbrooke.com/create-a-free-ish-custom-url-shortener/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simplest way to generate a random password in PHP</title>
		<link>http://www.hughlashbrooke.com/simplest-way-to-generate-a-random-password-in-php/</link>
		<comments>http://www.hughlashbrooke.com/simplest-way-to-generate-a-random-password-in-php/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 09:47:28 +0000</pubDate>
		<dc:creator>Hugh Lashbrooke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Passwords]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://www.hughlashbrooke.com/?p=1060</guid>
		<description><![CDATA[When creating web apps, there's often a need to generate a random password for your users. There are a number of ways to do this, but in needing to do this recently I came up with this very simple function that will generate a password (or other random string) of whatever length you wish.]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.hughlashbrooke.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>When creating web apps, there&#8217;s often a need to generate a random password for your users. There are a number of ways to do this, but in needing to do it recently I came up with this very simple function that will generate a password (or other random string) of whatever length you wish. It uses PHP&#8217;s handy <code><a title="PHP: str_shuffle()" href="http://php.net/manual/en/function.str-shuffle.php" target="_blank">str_shuffle()</a></code> function:</p>
<p><pre class="brush: php">function random_password($length = 8) {
    $chars = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&amp;*()_-=+;:,.?&quot;;
    $password = substr(str_shuffle($chars), 0, $length);
    return $password;
}</pre></p>
<p>The function can then be called using the length of the desired string as the only (optional) parameter:</p>
<p><pre class="brush: php">$password = random_password(8);</pre></p>
<p>The only shortcoming of this method will come in when you want to generate a password that is longer than <code>$chars</code>, but this is rather unlikely I would think. Also, the fact that it will only ever use each character a maximum of one time means that it is more susceptible to a brute force attack (whether that&#8217;s a problem or not depends on how paranoid you are&#8230;).</p>
<div class="betterrelated"><p><strong>Some similar content that you may be interested in:</strong></p>
<ol><li> <a href="http://www.hughlashbrooke.com/loop-through-each-character-in-a-string-in-php/" title="Permanent link to Loop through each character in a string in PHP">Loop through each character in a string in PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/parsing-urls-in-php/" title="Permanent link to Parsing URLs in PHP">Parsing URLs in PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/php-101-sending-html-emails-with-php/" title="Permanent link to PHP 101: Sending HTML emails with PHP">PHP 101: Sending HTML emails with PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/code-snippet-a-custom-twitter-feed-for-your-website/" title="Permanent link to Code Snippet: A custom Twitter feed for your website">Code Snippet: A custom Twitter feed for your website</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/creating-shortcodes-in-wordpress/" title="Permanent link to Creating shortcodes in WordPress">Creating shortcodes in WordPress</a>  </li>
</ol></div><p>This post is originally written by <a href="http://www.hughlashbrooke.com/">Hugh Lashbrooke</a> &copy; 2012. All Rights Reserved</p>]]></content:encoded>
			<wfw:commentRss>http://www.hughlashbrooke.com/simplest-way-to-generate-a-random-password-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Experiment: Streamlining my online content using ifttt &amp; tumblr</title>
		<link>http://www.hughlashbrooke.com/experiment-streamlining-my-online-content-using-ifttt-tumblr/</link>
		<comments>http://www.hughlashbrooke.com/experiment-streamlining-my-online-content-using-ifttt-tumblr/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 08:12:18 +0000</pubDate>
		<dc:creator>Hugh Lashbrooke</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[ifttt]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[tumblr]]></category>

		<guid isPermaLink="false">http://www.hughlashbrooke.com/?p=920</guid>
		<description><![CDATA[Near the end of 2010 a great little tool was launched called ifttt - the genius abbreviation of 'if this then that'. It's purpose is to connect together all the different online services it can or, as they put it, 'put the internet to work for you'. I managed to get a beta invite to use the service shortly after it launched and since then I have been using it to make my life that much easier.]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.hughlashbrooke.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>Near the end of 2010 a great little tool was launched called <a title="ifttt" href="http://ifttt.com/" target="_blank">ifttt</a> &#8211; the clever abbreviation of &#8216;if this then that&#8217;. Its purpose is to connect together all the different online services it can or, as they phrase it, &#8216;<a title="About ifttt" href="http://ifttt.com/wtf" target="_blank">put the internet to work for you</a>&#8216;. I managed to get a beta invite to use the service shortly after it launched and since then I have been constantly using it to make my life that much easier.</p>
<p>I started with using a simple task that would send any of my blog posts to Twitter &amp; Facebook. A short while later I discovered that I can see weather forecasts using the tool, so now, whenever it is going to rain the following day, I receive an SMS with a link to more details about the next day&#8217;s weather (how rad is that?). If you have a quick browse around the available channels on the site you will start to realise just how much ifttt actually does. It also makes you realise that the internet which we use today is so fragmented with so many different services that it&#8217;s actually becoming very cumbersome to keep up with everything. ifttt seeks to change that and gives you the ability to manage the many varied aspects of your online life in one place.</p>
<h4>Background</h4>
<p>Recently, I came to the realisation that I use quite a few different online services to generate content. There&#8217;s this website, Facebook, <a title="@hlashbrooke on Twitter" href="http://twitter.com/hlashbrooke" target="_blank">Twitter</a>, <a title="Hugh Lashbrooke on Google+" href="http://plus.google.com/101338957982052299536" target="_blank">Google+</a>, <a title="Hugh Lashbrooke on LinkedIn" href="http://www.linkedin.com/in/hlashbrooke" target="_blank">LinkedIn</a>, <a title="Hugh Lashbrooke on Stack Overflow" href="http://stackoverflow.com/users/807956/hugh-lashbrooke" target="_blank">Stack Overflow</a> as well as services like Google Reader and YouTube where I can simply like or +1 items that are then automatically shared with my network. I&#8217;m also reasonably confident that I use less online services than the majority of other people in my industry. I&#8217;ve never really used Posterous, tumblr, Pinterest, Digg, Delicious, reddit or any other of the host of content sharing services out there. If someone were to use even a fraction of them they will quickly find that their online life is incredibly scattered and difficult to keep together in one place.</p>
<h4>Goal</h4>
<p><a href="http://www.hughlashbrooke.com/wp-content/uploads/2012/03/tumblr.png"><img class="alignleft size-full wp-image-993" style="margin-left: 0; margin-right: 10px;" title="tumblr" src="http://www.hughlashbrooke.com/wp-content/uploads/2012/03/tumblr.png" alt="" width="206" height="54" /></a>In order to remedy this, I decided to see how effective it would be to use ifttt (which is free by the way) and tumblr (also free) to create a single site where all my online content (as well as content that I have enjoyed reading/watching) can be viewed. The end result is available here: <a title="Hugh Lashbrooke on tumblr" href="http://hlashbrooke.tumblr.com/" target="_blank">http://hlashbrooke.tumblr.com/</a>. In short, I used the various ifttt channels to send all my WordPress posts, Facebook links, tweets, favourited tweets, Instagram photos, Disqus comments, Stack Overflow questions &amp; answers, starred Reader items, liked tumblr posts, favourited YouTube videos and loved Last.fm tracks to my tumblr page automatically. Since I set up my tumblr account and all the ifttt triggers I haven&#8217;t needed to login to tumblr again &#8211; it all just happens with no further input from me. The goal of this project is to make sure my usual online activity stayed exactly the same, only now it&#8217;s being recorded on a single page.</p>
<h4>Outcome</h4>
<p>I&#8217;ve had the tumblr site going for a little while now and I think it&#8217;s proving to be quite effective. I can essentially see all my public online activity in one place. There are still quite a few sites that ifttt doesn&#8217;t yet have channels for, but they will come with time. Most of these sites, however, have RSS feeds that ifttt can handle easily. I took the approach that the source of the content is irrelevant &#8211; so, for example, any links that I send to the tumblr page are not openly stated as Facebook, etc. links, instead they&#8217;re just supplied as content. What this has resulted in is a single page where all the content I create, enjoy or share is stripped of its original context and displayed as is. Ultimately, it has become a rather handy and robust content aggregation tool for me. After having it running for a couple of years I reckon it will become an interesting view of my online life.</p>
<div class="betterrelated"><p><strong>Some similar content that you may be interested in:</strong></p>
<ol><li> <a href="http://www.hughlashbrooke.com/wordpress-plugins-that-i-always-use/" title="Permanent link to WordPress plugins that I always use">WordPress plugins that I always use</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/create-a-free-ish-custom-url-shortener/" title="Permanent link to Create a (free-ish) custom URL shortener">Create a (free-ish) custom URL shortener</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/code-snippet-a-custom-twitter-feed-for-your-website/" title="Permanent link to Code Snippet: A custom Twitter feed for your website">Code Snippet: A custom Twitter feed for your website</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/how-googles-2-step-verification-process-works/" title="Permanent link to How Google&#8217;s 2-step verification process works">How Google&#8217;s 2-step verification process works</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/my-top-free-recommended-android-apps/" title="Permanent link to My top (free) recommended Android apps">My top (free) recommended Android apps</a>  </li>
</ol></div><p>This post is originally written by <a href="http://www.hughlashbrooke.com/">Hugh Lashbrooke</a> &copy; 2012. All Rights Reserved</p>]]></content:encoded>
			<wfw:commentRss>http://www.hughlashbrooke.com/experiment-streamlining-my-online-content-using-ifttt-tumblr/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Front-end &amp; WordPress developer interview test</title>
		<link>http://www.hughlashbrooke.com/front-end-wordpress-developer-interview-test/</link>
		<comments>http://www.hughlashbrooke.com/front-end-wordpress-developer-interview-test/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 11:18:58 +0000</pubDate>
		<dc:creator>Hugh Lashbrooke</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hughlashbrooke.com/?p=967</guid>
		<description><![CDATA[I recently had to create an interview test for a developer who has good skill in PHP, but is not so experienced when it comes to front-end coding. On the front-end side of things, the job they were interviewing for required decent HTML &#038; CSS knowledge. With that in mind I created a little test to evaluate their skills - I'm posting it here for anyone else who needs something similar.
]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.hughlashbrooke.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>I recently had to create an interview test for a developer who has good skill in PHP, but is not so experienced when it comes to front-end coding. On the front-end side of things, the job they were interviewing for required decent HTML &amp; CSS knowledge. They also were required to have a decent working knowledge of WordPress. With that in mind I created a little test to evaluate their skills &#8211; I&#8217;m posting it here for anyone else who needs something similar.</p>
<p>I gave the developer the image on the right (click to enlarge) and asked them to do two things:</p>
<p style="text-align: center;">
<div class="shortcode-orderedlist decimal"></p>
<ol>
<li>Code it up as a web page using whatever techniques they like.</li>
<li>Code it up as an email optimised for as many of the common email clients as possible.</li>
</ol>
<p></div>

<p>While the page looks simple enough, the way it is coded will tell you a lot about the techniques that the developer would normally use. Coding the email version of the page will also test how versatile they are and, in the case of the job I wrote this test for, is a necessary part of the job.</p>
<p>On top of that I also gave them one other task that would test their WordPress skill. It&#8217;s a fairly simple one that most WordPress devs will be able to, but it will effectively show the individual&#8217;s dev style in the WordPress environment. The question was simple:</p>
<div class="shortcode-unorderedlist green-dot"></p>
<ul>
<li>Write a widget for a WordPress site that will contain links to the site owner&#8217;s Facebook, Twitter and LinkedIn profiles. The user must be allowed to specify their usernames for those sites when adding the widget in the WordPress back-end. The front-end design of the widget is not important.</li>
</ul>
<p></div>

<p>I&#8217;m sure there are plenty of other questions that could be asked, but that struck me as a decent enough one for the situation. If you have any other questions that you think would be helpful to ask, then please post them in the comments below.</p>
<div class="betterrelated"><p><strong>Some similar content that you may be interested in:</strong></p>
<ol><li> <a href="http://www.hughlashbrooke.com/make-your-wordpress-content-editor-use-html-by-default/" title="Permanent link to Make your WordPress content editor use HTML by default">Make your WordPress content editor use HTML by default</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/creating-shortcodes-in-wordpress/" title="Permanent link to Creating shortcodes in WordPress">Creating shortcodes in WordPress</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/hiding-elements-using-css/" title="Permanent link to Hiding elements using CSS">Hiding elements using CSS</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/understanding-css-positioning/" title="Permanent link to Understanding CSS positioning">Understanding CSS positioning</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/wordpress-plugins-that-i-always-use/" title="Permanent link to WordPress plugins that I always use">WordPress plugins that I always use</a>  </li>
</ol></div><p>This post is originally written by <a href="http://www.hughlashbrooke.com/">Hugh Lashbrooke</a> &copy; 2012. All Rights Reserved</p>]]></content:encoded>
			<wfw:commentRss>http://www.hughlashbrooke.com/front-end-wordpress-developer-interview-test/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating shortcodes in WordPress</title>
		<link>http://www.hughlashbrooke.com/creating-shortcodes-in-wordpress/</link>
		<comments>http://www.hughlashbrooke.com/creating-shortcodes-in-wordpress/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 07:15:18 +0000</pubDate>
		<dc:creator>Hugh Lashbrooke</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://www.hughlashbrooke.com/?p=933</guid>
		<description><![CDATA[WordPress shortcodes are a handy way to add standardised or dynamic content to any post or page. Once you have used them for a bit you will start to realise just how powerful they really are. Here is a guide on how to create shortcodes that you (or your clients) can use.]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.hughlashbrooke.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>WordPress <a title="WordPress shortcodes" href="http://codex.wordpress.org/Shortcode" target="_blank">shortcodes </a>are a handy way to add standardised or dynamic content to any post or page. Once you have used them for a bit you will start to realise just how powerful they really are. Here is a guide on how to create shortcodes that you (or your clients) can use.</p>
<p>Inserting a shortcode is simply a matter of adding text like this: [shortcode_name] to any post or page content. It will then be replaced by the content that you have specified when setting up the shortcode. You can also add parameters and content to your shortcodes in order to make them slightly more dynamic. To set up a basic shortcode, place this in your theme&#8217;s functions.php file:</p>
<p><pre class="brush: php">function shortcode_function($params){
    return &quot;Shortcode content&quot;;
}
add_shortcode( 'shortcode_name', 'shortcode_function' );</pre></p>
<p>Now if you place this shortcode: [shortcode_name] anywhere your post content it will display as &#8220;Shortcode content&#8221;. As you can see you can do any processing you like inside <code>shortcode_function()</code>, so the content can be entirely dynamic. You will also notice the <code>$params</code> variable in the above code &#8211; this is where any shortcode parameters are stored. Take the following code, for example:</p>
<p><pre class="brush: php">function shortcode_function($params){
    //Extract parameters and supply default values
    extract( shortcode_atts( array(
        'param1' =&gt; 'this',
        'param2' =&gt; 'that',
    ), $params ) );
    
    //The parameters are now stored as variables
    return &quot;First parameter = &quot;.$param1.&quot; | Second parameter = &quot;.$param2;
}
add_shortcode( 'shortcode_name', 'shortcode_function' );</pre></p>
<p>Usage for this shortcode, with the parameters, would look like this: [shortcode_name param1="value1" param2="value2"]. This would display as: &#8220;First parameter = value1 | Second parameter = value2&#8243;. If you do not specify a value for a parameter that the shortcode function contains then the default value from the function will be used. Also, if you specify a parameter in your shortcode that the function does not contain then it will be ignored.</p>
<p>There is one final thing that is also very useful to know and that is how to supply content (as opposed to single parameters) to a shortcode. To do this you must use the shortcode like an HTML tag: [shortcode_name]Content of shortcode[/shortcode_name]. The content can by any amount of HTML or text that you like and when it is passed to the shortcode function it is stored in the function&#8217;s second parameter. So if you used the shortcode example I just gave, you would process it like this:</p>
<p><pre class="brush: php">function shortcode_function($params, $content = null){
    return &quot;&lt;div id='shortcode_content'&gt;&quot;.$content .&quot;&lt;/div&gt;&quot;;
}
add_shortcode( 'shortcode_name', 'shortcode_function' );</pre></p>
<p>As a side note it would be helpful to point out that when processing the content, you should always use <code>is_null()</code> to check if the variable contains any data &#8211; this will avoid basic processing errors.</p>
<p>To get the most out of your shortcodes you can include both content and parameters. All you need to do is merge the examples given here.</p>
<div class="betterrelated"><p><strong>Some similar content that you may be interested in:</strong></p>
<ol><li> <a href="http://www.hughlashbrooke.com/code-snippet-a-custom-twitter-feed-for-your-website/" title="Permanent link to Code Snippet: A custom Twitter feed for your website">Code Snippet: A custom Twitter feed for your website</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/make-your-wordpress-content-editor-use-html-by-default/" title="Permanent link to Make your WordPress content editor use HTML by default">Make your WordPress content editor use HTML by default</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/php-101-sending-html-emails-with-php/" title="Permanent link to PHP 101: Sending HTML emails with PHP">PHP 101: Sending HTML emails with PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/parsing-urls-in-php/" title="Permanent link to Parsing URLs in PHP">Parsing URLs in PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/wordpress-plugins-that-i-always-use/" title="Permanent link to WordPress plugins that I always use">WordPress plugins that I always use</a>  </li>
</ol></div><p>This post is originally written by <a href="http://www.hughlashbrooke.com/">Hugh Lashbrooke</a> &copy; 2012. All Rights Reserved</p>]]></content:encoded>
			<wfw:commentRss>http://www.hughlashbrooke.com/creating-shortcodes-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress plugins that I always use</title>
		<link>http://www.hughlashbrooke.com/wordpress-plugins-that-i-always-use/</link>
		<comments>http://www.hughlashbrooke.com/wordpress-plugins-that-i-always-use/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 07:49:41 +0000</pubDate>
		<dc:creator>Hugh Lashbrooke</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[WooThemes]]></category>

		<guid isPermaLink="false">http://www.hughlashbrooke.com/?p=856</guid>
		<description><![CDATA[In order to save time when developing a new WordPress site, I have a set of plugins that I will use almost every time. They range form spam blockers to productivity enhancers and are useful on most types of websites. There are a few that I only use in specific situations and are not as globally relevant, but they fill a need perfectly.]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.hughlashbrooke.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>In order to save time when developing a new WordPress site, I have a set of plugins that I will use almost every time. They range form spam blockers to productivity enhancers and are useful on most types of websites. There are a few that I only use in specific situations and are not as globally relevant, but they fill a need perfectly. So, without further ado, here is my  standard WordPress plugin stack:</p>
<h4>Akismet</h4>
<p><a title="Akismet" href="http://wordpress.org/extend/plugins/akismet/" target="_blank">Details in WordPress Plugin Directory</a></p>
<p>Easily the best spam comment blocker and it comes with every new WordPress installation. There&#8217;s no reason not to use this plugin to be honest as it will save you countless hours of sorting through spam comments.</p>
<h4>BWP Google XML Sitemaps</h4>
<p><a title="BWP Google XML Sitemaps" href="http://wordpress.org/extend/plugins/bwp-google-xml-sitemaps/" target="_blank">Details in WordPress Plugin Directory</a></p>
<p>Every site needs an XML sitemap &#8211; it&#8217;s essential if you actually want search engines to find your website. There are many WordPress plugins that generate the necessary sitemap for you, but in my experience there are none better than the BWP plugin. With very little setup on your part, it will generate deep sitemaps for each section of your site and provide rich data to the major search engines. This is another plugin that you really can&#8217;t do without.</p>
<h4>Digg Digg</h4>
<p><a title="Digg Digg" href="http://wordpress.org/extend/plugins/digg-digg/" target="_blank">Details in WordPress Plugin Directory</a></p>
<p>Another requirement for any site is some kind of social sharing functionality. Digg Digg offers the most versatile and feature-rich options in this regard, so I install it on pretty much every site I build.</p>
<h4>ThreeWP Activity Monitor</h4>
<p><a title="ThreeWP Activity Monitor" href="http://wordpress.org/extend/plugins/threewp-activity-monitor/" target="_blank">Details in WordPress Plugin Directory</a></p>
<p>I&#8217;ve already posted about this plugin (link), so I don&#8217;t think I need to say much more. It&#8217;s a quick install that will help you a whole lot in the long run &#8211; especially when debugging problems cause by clients.</p>
<h4>CryptX</h4>
<p><a title="CryptX" href="http://wordpress.org/extend/plugins/cryptx/" target="_blank">Details in WordPress Plugin Directory</a></p>
<p>CryptX is a simple plugin that encrypts any email links in any content of your site. This means that you can safely put email addresses in post or page content and not have to worry about spammers getting hold of it. The plugin offers a few options for how to display the encrypted email address, so you just pick your favourite method and go with it. It also automatically creates mailto links from any email address, so it saves you the trouble of doing that yourself.</p>
<h4>All in One SEO Pack</h4>
<p><a title="All in One SEO Pack" href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/" target="_blank">Details in WordPress Plugin Directory</a></p>
<p>If you use a theme from WooThemes (and a number of other theme providers too) then you will have your SEO needs taken care of. If not, then this is easily the best plugin to use. It creates all your SEO meta data for you with customisable options for where it pulls the data from (content, tags, etc.).</p>
<h4>WP-PageNavi</h4>
<p><a title="WP-PageNavi" href="http://wordpress.org/extend/plugins/wp-pagenavi/" target="_blank">Details in WordPress Plugin Directory</a></p>
<p>Once again, this comes built in to some themes. If it does not, however, then it is a worthwhile plugin to get. WP-PageNavi simply replaces the &#8216;Older/Newer Posts&#8217; links with numbered pagination that you can style and customise however you like. A must have for blogs with more than a page or two of content.</p>
<h4>SlideDeck</h4>
<p><a title="SlideDeck" href="http://wordpress.org/extend/plugins/slidedeck-lite-for-wordpress/" target="_blank">Details in WordPress Plugin Directory</a></p>
<p>My go-to image slider plugin. I was lucky enough to win a lifetime copy of the Pro verison of the plugin, but there is a slightly more limited free version available too. Basically, SlideDeck creates a flexible slider that you can use to display anything you like &#8211; from static content, to dynamic post data from any of your custom post types or even an RSS feed. I have used it <a title="Phillip Crous Photography" href="http://www.hughlashbrooke.com/portfolio-item/phillip-crous-photography/">here</a> and <a title="SA Children’s Home" href="http://www.hughlashbrooke.com/portfolio-item/sa-childrens-home/">here</a>.</p>
<div class="betterrelated"><p><strong>Some similar content that you may be interested in:</strong></p>
<ol><li> <a href="http://www.hughlashbrooke.com/monitor-wordpress-activity-including-hack-attempts/" title="Permanent link to Monitor WordPress activity (including hack attempts)">Monitor WordPress activity (including hack attempts)</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/create-a-free-ish-custom-url-shortener/" title="Permanent link to Create a (free-ish) custom URL shortener">Create a (free-ish) custom URL shortener</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/experiment-streamlining-my-online-content-using-ifttt-tumblr/" title="Permanent link to Experiment: Streamlining my online content using ifttt &#038; tumblr">Experiment: Streamlining my online content using ifttt &#038; tumblr</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/creating-shortcodes-in-wordpress/" title="Permanent link to Creating shortcodes in WordPress">Creating shortcodes in WordPress</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/code-snippet-a-custom-twitter-feed-for-your-website/" title="Permanent link to Code Snippet: A custom Twitter feed for your website">Code Snippet: A custom Twitter feed for your website</a>  </li>
</ol></div><p>This post is originally written by <a href="http://www.hughlashbrooke.com/">Hugh Lashbrooke</a> &copy; 2012. All Rights Reserved</p>]]></content:encoded>
			<wfw:commentRss>http://www.hughlashbrooke.com/wordpress-plugins-that-i-always-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loop through each character in a string in PHP</title>
		<link>http://www.hughlashbrooke.com/loop-through-each-character-in-a-string-in-php/</link>
		<comments>http://www.hughlashbrooke.com/loop-through-each-character-in-a-string-in-php/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 06:57:12 +0000</pubDate>
		<dc:creator>Hugh Lashbrooke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://www.hughlashbrooke.com/?p=884</guid>
		<description><![CDATA[The other day I was working on a project that required me to extract a numeric ID from the current page's URL. The problem was that the ID could either be at the end of the URL string or in the middle, depending if there were any parameters added on or not. Here is how I worked around the problem by looping through each character of the string.]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.hughlashbrooke.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>The other day I was working on a project that required me to extract a numeric ID from the current page&#8217;s URL. The problem was that the ID could either be at the end of the URL string or in the middle, depending if there were any parameters added on or not. Here is how I worked around the problem by looping through each character of the string.</p>
<p>Because the first part of the URL was formatted normally I could use a combination of <code>strpos()</code> and <code>substr()</code> to find the part of the string that contained the ID as well as all the characters that followed it (I could have used regex here, but I prefer to avoid using it if I can help it). This still left me with the problem of getting the ID out of that string, as the actual number could be any length. Luckily for me, the ID was immediately followed by a non-numeric character, so I came up with a solution where I could loop through each character in the string and use each one for the required ID, but stop the loop when I hit the first character that was not a number. In the interest of sharing some useful code, here is the simple snippet that I used to loop through the string:</p>
<p><pre class="brush: php">$str = &quot;String to loop through&quot;
$strlen = strlen($str);
for($i = 0; $i &lt;= $strlen; $i++) {
    $char = substr($str, $i, 1);
    //$char contains the current character, so do your processing here
}</pre></p>
<p>Once I had the loop set up I simply added an <code>is_ numeric()</code> check and inserted a <code>break</code> command the first time the check returned false &#8211; here is my use case:</p>
<p><pre class="brush: php">$str = &quot;123?param=value&quot;
$strlen = strlen($str);
$id = &quot;&quot;;
for($i = 0; $i &lt;= $strlen; $i++) {
    $char = substr($str, $i, 1);
    if(!is_numeric($char)) { break; }
    $id .= $char;
}
//$id now contains the ID I need, in this case: 123</pre></p>
<div class="betterrelated"><p><strong>Some similar content that you may be interested in:</strong></p>
<ol><li> <a href="http://www.hughlashbrooke.com/simplest-way-to-generate-a-random-password-in-php/" title="Permanent link to Simplest way to generate a random password in PHP">Simplest way to generate a random password in PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/parsing-urls-in-php/" title="Permanent link to Parsing URLs in PHP">Parsing URLs in PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/php-101-sending-html-emails-with-php/" title="Permanent link to PHP 101: Sending HTML emails with PHP">PHP 101: Sending HTML emails with PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/creating-shortcodes-in-wordpress/" title="Permanent link to Creating shortcodes in WordPress">Creating shortcodes in WordPress</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/code-snippet-a-custom-twitter-feed-for-your-website/" title="Permanent link to Code Snippet: A custom Twitter feed for your website">Code Snippet: A custom Twitter feed for your website</a>  </li>
</ol></div><p>This post is originally written by <a href="http://www.hughlashbrooke.com/">Hugh Lashbrooke</a> &copy; 2012. All Rights Reserved</p>]]></content:encoded>
			<wfw:commentRss>http://www.hughlashbrooke.com/loop-through-each-character-in-a-string-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 101: Sending HTML emails with PHP</title>
		<link>http://www.hughlashbrooke.com/php-101-sending-html-emails-with-php/</link>
		<comments>http://www.hughlashbrooke.com/php-101-sending-html-emails-with-php/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 11:20:28 +0000</pubDate>
		<dc:creator>Hugh Lashbrooke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[PHP 101]]></category>

		<guid isPermaLink="false">http://www.hughlashbrooke.com/?p=865</guid>
		<description><![CDATA[Whether you are creating a basic website or setting up a feature-rich online store, you are more than likely going to need to send an email or two from your PHP application. There are essentially two main methods for doing this and here they are explained for your reading pleasure.]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.hughlashbrooke.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>Whether you are creating a basic website or setting up a feature-rich online store, you are more than likely going to need to send an email or two from your PHP application. There are essentially two main methods for doing this:</p>
<div class="shortcode-orderedlist decimal"></p>
<ol>
<li>PHP&#8217;s built in <code>mail()</code> function.</li>
<li>The popular PHPMailer class.</li>
</ol>
<p></div>

<h4>PHP&#8217;s <code>mail()</code> function</h4>
<p>The first method does not require any additional PHP classes and uses the simple <a title="PHP: mail" href="http://php.net/manual/en/function.mail.php" target="_blank"><code>mail()</code></a> function that comes built into PHP. You can send either plain text emails or HTML emails (but not both) and the parameters for the function are:</p>
<div class="shortcode-orderedlist decimal"></p>
<ol>
<li><code>$to</code>: The email address that you are sending the email to as a plain text string. Multiple email addresses must be separated by commas.</li>
<li><code>$subject</code>: The subject line of the email as a plain text string.</li>
<li><code>$message</code>: The body of the email. This can be plain text or HTML &#8211; the function will accept either one. When using plain text all lines must end in &#8220;\n&#8221;. You must also make sure you keep each line to 70 characters or less.</li>
<li><code>$additional_headers</code> (optional): This optional parameter can include all your email headers (from address, reply to address, CC address, etc.) and must be a plain text string formatted appropriately.</li>
<li><code>$additional_parameters</code> (optional): You can use this optional parameter to pass command line flags to the server, but to be honest you will hardly ever have to use it so there&#8217;s no need to go into it here.</li>
</ol>
<p></div>

<p>Example usage:</p>
<p><pre class="brush: php">$to = &quot;spam_receiver@gmail.com&quot;;
$subject = &quot;Win an iPad 2!&quot;;
$message = &quot;Forward this email to all of your friends to win an iPad 2!&quot;;
$additional_headers = &quot;From:spambot@evilcorporate.com&quot;;

mail($to, $subject, $message, $additional_headers);</pre></p>
<p>The function will return true if the email was sent or false on failure. It&#8217;s important to note that just because the function returns true, it does not mean that the receiver necessarily received the email &#8211; all it means is that the server was able to process the request and dispatch the mail.</p>
<h4>The PHPMailer class</h4>
<p>This method may seem slightly more complicated, but it is actually far simpler in the end. It is also a lot more versatile than using the first method. The first step is to download the PHPMail class (<a title="PHPMailer download" href="http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list" target="_blank">link</a>) then you simply need to place the class.phpmailer.php file into whatever directory you see fit and include it in the file in which you will be processing your email, call the appropriate class and the add your email details using the handy functions and variables supplied by the class. Here is a common use scenario, but I advise you to look through the <a href="http://code.google.com/a/apache-extras.org/p/phpmailer/wiki/PHPMailer?tm=6" title="PHPMailer documentation" target="_blank">class documentation</a> to see what other features you can use.</p>
<p><pre class="brush: php">require_once('class.phpmailer.php');
$mail = new PHPMailer();

//You can add as many email address as you like using AddAddress(), AddCC() or AddBCC()
$mail-&gt;AddAddress('user@domain.com', 'User Name');
$mail-&gt;AddAddress('anotheruser@domain.com', 'User Name');
$mail-&gt;AddCC('relateduser@domain.com', 'User Name');
$mail-&gt;AddBCC('secretuser@domain.com', 'User Name');

$mail-&gt;SetFrom('source@domain.com', 'From Name');

$mail-&gt;Subject = &quot;Email subject line&quot;;

//Use the AltBody variable for the non-HTML version of the email
$mail-&gt;AltBody = &quot;To view this message, please use an HTML compatible email viewer.&quot;;

// Use MsgHTML() for the HTML email body
$mail-&gt;MsgHTML(&quot;&lt;p&gt;Hello world!&lt;/p&gt;&quot;);

//Send the email
$mail-&gt;Send();</pre></p>
<p>Once again, the Send() function here will return true on success or false on failure with the same caveat that I mentioned above.</p>
<p>The second option is clearly more versatile and actually really easy to use. If you are sending out emails on a large scale or are send mails to clients, I would recommend using PHPMailer because you will more functionality available to you and it is far more flexible. the <code>mail()</code> function I find handy for simple contact forms where the receiving user doesn&#8217;t care too much what the mail looks like.</p>
<div class="betterrelated"><p><strong>Some similar content that you may be interested in:</strong></p>
<ol><li> <a href="http://www.hughlashbrooke.com/parsing-urls-in-php/" title="Permanent link to Parsing URLs in PHP">Parsing URLs in PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/simplest-way-to-generate-a-random-password-in-php/" title="Permanent link to Simplest way to generate a random password in PHP">Simplest way to generate a random password in PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/creating-shortcodes-in-wordpress/" title="Permanent link to Creating shortcodes in WordPress">Creating shortcodes in WordPress</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/code-snippet-a-custom-twitter-feed-for-your-website/" title="Permanent link to Code Snippet: A custom Twitter feed for your website">Code Snippet: A custom Twitter feed for your website</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/php-101-connecting-to-a-mysql-database/" title="Permanent link to PHP 101: Connecting to a MySQL database">PHP 101: Connecting to a MySQL database</a>  </li>
</ol></div><p>This post is originally written by <a href="http://www.hughlashbrooke.com/">Hugh Lashbrooke</a> &copy; 2012. All Rights Reserved</p>]]></content:encoded>
			<wfw:commentRss>http://www.hughlashbrooke.com/php-101-sending-html-emails-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to track if companies are selling your email address</title>
		<link>http://www.hughlashbrooke.com/how-to-track-if-companies-are-selling-your-email-address/</link>
		<comments>http://www.hughlashbrooke.com/how-to-track-if-companies-are-selling-your-email-address/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 13:23:55 +0000</pubDate>
		<dc:creator>Hugh Lashbrooke</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.hughlashbrooke.com/?p=564</guid>
		<description><![CDATA[I recently learned a handy little trick for tracking what companies do with your email address when you sign up for their newsletters, or enter a competition, or they find some other way to sucker you in to giving them your personal information. The only requirement for being able to do this is to have your own domain.]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.hughlashbrooke.com/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>I recently learned a handy little trick for tracking what companies do with your email address when you sign up for their newsletters, or enter a competition, or they find some other way to sucker you in to giving them your personal information. The only requirement for being able to do this is to have your own domain.</p>
<p>I learnt about this tracking method from reading <a title="Lazygamer blog post" href="http://www.lazygamer.net/general-news/is-bioware-sellingleaking-email-addresses/" target="_blank">this blog post</a> on Lazygamer and it&#8217;s so simple and makes so much sense that I started using it immediately. Basically, any web server will have a &#8216;catch-all&#8217; email address &#8211; what this means is that you can set any of your existing email address to receive emails that are sent to any other non-existent addresses. So, if you send an email to ajeyrg@hughlashbrooke.com then I will receive it at my selected catch-all address (I will, of course, immediately block any future emails that are sent to that address).</p>
<p>Practically speaking, how this would work as a form of tracking your email addresses would be for you to sign up for a newsletter using a non-existent email address. For example, if you sign up for a newsletter on the website of Company X just use the email address companyx@yourdomain.com. Emails to this address will be received at your catch-all address and Company X will be none the wiser. Now, a few weeks later you suddenly receive a spam email sent to companyx@yourdomain.com that comes from Company Y &#8211; this obviously means that Company X is being underhanded and giving out your email address to whoever they please. With this knowledge (and a few screenshots of the offending email) in hand you can now take to Twitter and decry the services of both Companies X &amp; Y safe in the knowledge that you are entirely justified in your rants. Who knows, maybe one of the companies will apologies to you and sent you free stuff to say sorry.</p>
<p>An alternative would be to use the Gmail &#8216;+&#8217; trick just add &#8216;+sometext&#8217; to your Gmail username and you will receive all the emails at your normal Gmail address &#8211; however some website don&#8217;t allow you to enter email address with the + in it for this very reason.</p>
<div class="betterrelated"><p><strong>Some similar content that you may be interested in:</strong></p>
<ol><li> <a href="http://www.hughlashbrooke.com/php-101-sending-html-emails-with-php/" title="Permanent link to PHP 101: Sending HTML emails with PHP">PHP 101: Sending HTML emails with PHP</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/wordpress-plugins-that-i-always-use/" title="Permanent link to WordPress plugins that I always use">WordPress plugins that I always use</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/front-end-wordpress-developer-interview-test/" title="Permanent link to Front-end &#038; WordPress developer interview test">Front-end &#038; WordPress developer interview test</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/how-googles-2-step-verification-process-works/" title="Permanent link to How Google&#8217;s 2-step verification process works">How Google&#8217;s 2-step verification process works</a>  </li>
<li> <a href="http://www.hughlashbrooke.com/monitor-wordpress-activity-including-hack-attempts/" title="Permanent link to Monitor WordPress activity (including hack attempts)">Monitor WordPress activity (including hack attempts)</a>  </li>
</ol></div><p>This post is originally written by <a href="http://www.hughlashbrooke.com/">Hugh Lashbrooke</a> &copy; 2012. All Rights Reserved</p>]]></content:encoded>
			<wfw:commentRss>http://www.hughlashbrooke.com/how-to-track-if-companies-are-selling-your-email-address/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

