<?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>Sterling Hamilton</title>
		<atom:link href="http://sterlinghamilton.com/feed/" rel="self" type="application/rss+xml" />
		<link>http://sterlinghamilton.com</link>
		<description>Avid Student of Code - Reno, NV</description>
		<lastBuildDate>Mon, 07 Nov 2011 23:16:00 +0000</lastBuildDate>
		<language>en</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
		<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
			<title>Mobile Detection and Redirection using the HandSetDetection API</title>
			<link>http://sterlinghamilton.com/2011/09/28/mobile-detection-and-redirection-using-the-handsetdetection-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-detection-and-redirection-using-the-handsetdetection-api</link>
			<comments>http://sterlinghamilton.com/2011/09/28/mobile-detection-and-redirection-using-the-handsetdetection-api/#comments</comments>
			<pubDate>Wed, 28 Sep 2011 22:23:08 +0000</pubDate>
			<dc:creator>Sterling Hamilton</dc:creator>
			<category><![CDATA[WordPress]]></category>
			<category><![CDATA[javascript]]></category>
			<category><![CDATA[mobile]]></category>
			<category><![CDATA[wordpress]]></category>
			<guid isPermaLink="false">http://sterlinghamilton.com/?p=1011</guid>
			<description><![CDATA[Me and the boys at DealerTrend have been trying to provide a scalable solution for mobile sites to our clients. We&#8217;d experimented with the many plugins available in the WordPress repository and most of them made the following mistakes. Do &#8230; <a href="http://sterlinghamilton.com/2011/09/28/mobile-detection-and-redirection-using-the-handsetdetection-api/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Me and the boys at <a title="DealerTrend, Inc" href="http://www.dealertrend.com" target="_blank">DealerTrend</a> have been trying to provide a scalable solution for mobile sites to our clients. We&#8217;d experimented with the many plugins available in the <a title="WordPress!" href="http://wordpress.org" target="_blank">WordPress</a> repository and most of them made the following mistakes.</p><ul><li>Do all the running all the logic server side, which means caching is no longer possible via a proxy server.</li><li>Rendering the new content under the same domain. In essence restructuring an entire sites markup and outputting the new content. This could be seen as&nbsp;duplication&nbsp;within the same product.</li><li>Use static formulas for user agent detection.</li></ul><p>Let&#8217;s take a look at the reasons I think these are mistakes.</p><p>First, running the logic on the server side produces an outcome&#8230;if that outcome is cached then someone else will see that outcome even if it doesn&#8217;t fit their situation. This means you can&#8217;t cache from an external server, it has to be done at the object level within WordPress. Which may not be ideal given that WordPress is using MySQL and in some cases, Apache which can only handle a (relatively) small load.<p><span id="more-1011"></span></p><p><strong>For high traffic sites, caching is a must.</strong></p><p>Rendering a completely new layout for a specific use case and not changing the location seems like a horrible idea. Consider every domain a product, self contained with a primary subject. If you change the product on the fly without letting search engines know that the context has changed you will no doubt be shooting yourself in the foot. It&#8217;s best to use a subdomain, subfolder or some&nbsp;identifier&nbsp;to declare &#8220;Yo dawg, we&#8217;re showing the mobile view.&#8221;</p><p>You wouldn&#8217;t show your site mydomain.com with one layout and then if google reader hits it, completely change how it displays right? If you said &#8220;Yeah, why not?&#8221;, then slap yourself. You should redirect them to an RSS feed or a path that&#8217;s dedicated to handling that rendered view.</p><p><strong><br />Context matters and so does location.<br /></strong></p><p>Lastly, many people use bloated static regular expressions for determining whether or not the UserAgent of the browser is, in fact, mobile. Which means, as new mobile devices hit the market OR as users of those mobile devices install new browsers, the owner of the plugin will need to&nbsp;continuously&nbsp;send out updates to his previous formula in order to keep up.</p><p>That&#8217;s AWESOME! That&#8217;s like every time someone updates their status on Facebook, an employee has to go in and manually add the new status to each of their friends page! If they don&#8217;t have time to do it, the user can just suck it up!</p><p><strong><br />Constantly evolving data should not be encapsulated within a plugin. It should be a service.<br /></strong></p><p>So what did we do? Well we did some digging and found the guys over at <a href="http://www.handsetdetection.com" target="_blank">www.handsetdetection.com<br /></a></p><p>We did the trial, liked what we saw and started playing with it.</p><p>We decided to host a server dedicated to rendering mobile views and just send mobile users to that server whilst providing them a way to get back to the main site.</p><p>Here&#8217;s some Javascript that I wrote up to do that:</p><pre class="syntax javascript">(function () {'use strict'; var head, script, siteid, domain, internal, mobilesite; siteid = 123456; domain = new RegExp('mydomain.com', 'i'); mobilesite = 'http://m.mydomain.com'; head = document.getElementsByTagName('head')[0]; script = document.createElement('script'); internal = document.referrer.search(domain); script.type = 'text/javascript'; script.src = 'http://api.handsetdetection.com/sites/js/' + siteid + '.js'; if (internal === -1) {head.appendChild(script); }script.onload = function () {if (HandsetDetection.ismobile === true) {document.location = mobilesite; }}; }());</pre><p>So basically what this does is after putting in the main sites url, the mobile url and the ID for the mobile detection script, it checks if the user is coming from an internal page (it treats the mobile view as an internal page) and if they are, it doesn&#8217;t try to redirect them to the mobile view. But if they come directly to the site or from a search engine, or other, it will shoot them over to mobile. Then at the bottom of the mobile view they can click the View Full Site link to get back to the main domain.</p><p>In order to not bloat our API requests, because there is a quota, we decided to only load the Javascript file if it was needed. So the script sees that it will need the Javascript file and appends it to the sites head element. Then after the external script is loaded, it runs through and if the site is mobile it redirects.</p><p>It was short, sweet and simple &#8211; a bit of fun.</p><p>Here&#8217;s a link to the gist if you need something to play with:&nbsp;<a href="https://gist.github.com/1245942" target="_blank">https://gist.github.com/1245942</a></p>]]></content:encoded>
				<wfw:commentRss>http://sterlinghamilton.com/2011/09/28/mobile-detection-and-redirection-using-the-handsetdetection-api/feed/</wfw:commentRss>
				<slash:comments>0</slash:comments>
			</item>
			<item>
				<title>CSS3 Flexible Box Layout Explained by Richard Shepherd</title>
				<link>http://sterlinghamilton.com/2011/09/19/css3-flexible-box-layout-explained-by-richard-shepherd/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css3-flexible-box-layout-explained-by-richard-shepherd</link>
				<comments>http://sterlinghamilton.com/2011/09/19/css3-flexible-box-layout-explained-by-richard-shepherd/#comments</comments>
				<pubDate>Mon, 19 Sep 2011 20:00:35 +0000</pubDate>
				<dc:creator>Sterling Hamilton</dc:creator>
				<category><![CDATA[WordPress]]></category>
				<category><![CDATA[aggregated]]></category>
				<category><![CDATA[css]]></category>
				<category><![CDATA[smashing magazine]]></category>
				<guid isPermaLink="false">http://sterlinghamilton.com/?p=1002</guid>
				<description><![CDATA[The folks over at Smashing Magazine put out quite a bit of quality content. Today I decided to get back into the flow of reading at least an article a day. They posted an article from Richard Shepherd covering the &#8230; <a href="http://sterlinghamilton.com/2011/09/19/css3-flexible-box-layout-explained-by-richard-shepherd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div><a href="http://www.smashingmagazine.com" title="Smashing Magazine" target="_blank"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/09/smashingmagazine.gif" alt="" title="smashingmagazine" width="204" height="65" class="alignleft size-full wp-image-1006" /></a></div><p>The folks over at <a href="http://www.smashingmagazine.com" title="Smashing Magazine" target="_blank">Smashing Magazine</a> put out quite a bit of quality content.</p><p>Today I decided to get back into the flow of reading at least an article a day. They posted an article from <a href="http://coding.smashingmagazine.com/author/richard-shepherd/" title="Richard Shepherd @ Smashing Magazine" target="_blank">Richard Shepherd</a> covering the CSS3 Flexible Box concept. A worthwhile read, and as I was doing such it occurred to me I should start posting some of the worthwhile reads and sending users who are interested in learning over to their site <img src='http://sterlinghamilton.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p><blockquote cite="http://coding.smashingmagazine.com/2011/09/19/css3-flexible-box-layout-explained/"><p>The flexible box layout module?—?or “flexbox,” to use its popular nickname?—?is an interesting part of the W3C Working Draft. The flexbox specification is still a draft and subject to change, so keep your eyes on the W3C, but it is part of a new arsenal of properties that will revolutionize how we lay out pages. At least it will be when cross-browser support catches up.</p><p>In the meantime, we can experiment with flexbox and even use it on production websites where fallbacks will still render the page correctly. It may be a little while until we consider it as mainstream as, say, border-radius, but our job is to investigate new technologies and use them where possible. That said, when it comes to something as fundamental as page layout, we need to tread carefully.</p><p><cite><a href="http://coding.smashingmagazine.com/2011/09/19/css3-flexible-box-layout-explained/" title="CSS3 Flexible Box Layout Explained by Richard Shepherd" target="_blank">CSS3 Flexible Box Layout Explained by Richard Shepherd</a></cite></p></blockquote><p>Catch the rest of the article <a href="http://coding.smashingmagazine.com/2011/09/19/css3-flexible-box-layout-explained/" target="_blank" title="CSS3 Flexible Box Layout Explained by Richard Shepherd">here</a>!</p>]]></content:encoded>
				<wfw:commentRss>http://sterlinghamilton.com/2011/09/19/css3-flexible-box-layout-explained-by-richard-shepherd/feed/</wfw:commentRss>
				<slash:comments>0</slash:comments>
			</item>
			<item>
				<title>Slides from the August Reno WordPress Meetup!</title>
				<link>http://sterlinghamilton.com/2011/08/03/slides-from-the-august-reno-wordpress-meetup/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=slides-from-the-august-reno-wordpress-meetup</link>
				<comments>http://sterlinghamilton.com/2011/08/03/slides-from-the-august-reno-wordpress-meetup/#comments</comments>
				<pubDate>Wed, 03 Aug 2011 16:12:52 +0000</pubDate>
				<dc:creator>Sterling Hamilton</dc:creator>
				<category><![CDATA[WordPress]]></category>
				<category><![CDATA[meetup]]></category>
				<category><![CDATA[reno]]></category>
				<category><![CDATA[slideshare]]></category>
				<category><![CDATA[wordpress]]></category>
				<guid isPermaLink="false">http://sterlinghamilton.com/?p=979</guid>
				<description><![CDATA[What&#8217;s new and nerdy in WordPress 3.2.x! Reno WordPress Meetup: Gershwin View more presentations from Sterling Hamilton]]></description>
				<content:encoded><![CDATA[<p>What&#8217;s new and nerdy in WordPress 3.2.x!</p><div style="width:425px; margin:auto;" id="__ss_8757856"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/misterplanck/reno-wordpress-meetup-gershwin" title="Reno WordPress Meetup: Gershwin" target="_blank">Reno WordPress Meetup: Gershwin</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8757856" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/misterplanck" target="_blank">Sterling Hamilton</a> </div></p></div>]]></content:encoded>
			<wfw:commentRss>http://sterlinghamilton.com/2011/08/03/slides-from-the-august-reno-wordpress-meetup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		</item>
		<item>
			<title>Plugin Review: Raw HTML Snippets</title>
			<link>http://sterlinghamilton.com/2011/07/25/plugin-review-raw-html-snippets/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=plugin-review-raw-html-snippets</link>
			<comments>http://sterlinghamilton.com/2011/07/25/plugin-review-raw-html-snippets/#comments</comments>
			<pubDate>Mon, 25 Jul 2011 16:11:32 +0000</pubDate>
			<dc:creator>Sterling Hamilton</dc:creator>
			<category><![CDATA[WordPress]]></category>
			<category><![CDATA[plugin]]></category>
			<category><![CDATA[review]]></category>
			<category><![CDATA[wordpress]]></category>
			<guid isPermaLink="false">http://sterlinghamilton.com/?p=952</guid>
			<description><![CDATA[Like the Goddamn Batman, my services are required yet again. It&#8217;s plugin judgment day! Sometimes users need to use HTML/CSS/Javascript in pages or posts. While this is no doubt going to produce quality worse than the anything containing Kyra Sedgwick &#8230; <a href="http://sterlinghamilton.com/2011/07/25/plugin-review-raw-html-snippets/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-954" title="The Goddamn Batman" src="http://sterlinghamilton.com/wp-content/uploads/2011/07/GoddamnBatman.jpg" alt="" width="400" height="262" /></p><p>Like the <a href="http://twitter.com/#!/god_damn_batman" title="Twitter Profile for The Goddamn Batman" target="_blank">Goddamn Batman</a>, my services are required yet again.</p><p>It&#8217;s plugin judgment day!</p><p>Sometimes users need to use HTML/CSS/Javascript in pages or posts. While this is no doubt going to produce quality worse than the anything containing Kyra Sedgwick (seriously this will RUIN your acting career), sometimes people need to do what they need to do.</p><p><span id="more-952"></span></p><p><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/bat-signal-300x202.jpg" alt="" title="Bat Signal" width="300" height="202" class="aligncenter size-medium wp-image-953" /></p><p>The plugin in the <span title="YOU SEE WHAT I DID THERE?! lulz I'm a genius." style="border-bottom: 1px dotted #ba0000;">spotlight today</span>: <a href="http://wordpress.org/extend/plugins/raw-html-snippets/" title="Raw HTML Snippets" target="">Raw HTML Snippets</a></p><p>What does this slice of evil do?</p><blockquote cite="http://wordpress.org/extend/plugins/raw-html-snippets/"><p>Create a library of raw HTML snippets that you can easily insert into any page/post content using a shortcode:</p><p>[raw_html_snippet id="my-snippet"]</p><p>Snippets consist of a unique ID (e.g. &#8220;my-snippet&#8221;) and raw HTML code. This plugin was written to stop using hacks that override WordPress&#8217; core content filters and affect shortcode output.</p><p>This plugin will NOT taint your content or the output of other shortcodes. If you delete a snippet, any existing shortcodes with that snipet&#8217;s ID will output an empty string.</p><p>Remember, this allows you to output raw HTML. Use at your own risk. It will not check for malicious HTML/CSS/Javascript!<br /><cite><a href="http://wordpress.org/extend/plugins/raw-html-snippets/" title="Raw HTML Snippets" target="">Raw HTML Snippets</a></cite></p></blockquote><p>Please note that warning at the bottom. It&#8217;s important and the author is doing you a favor by reminding you of this fact.</p><h1 id="the-review" title="The Review">The Review</h1><h2 id="the-walkthrough">The Walkthrough</h2><p>This plugin is pretty new, created on the 11th of May of this year, so as of this post, only a few months old.</p><p>No reported problems, just feature requests &#8211; so it&#8217;s hard to gauge if it&#8217;s actively maintained or if it&#8217;s already collecting dust.</p><p>No activation errors.</p><p>Settings page at: /wp-admin/options-general.php?page=raw-html-snippets</p><div id="attachment_966" class="wp-caption aligncenter" style="width: 310px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/07/raw-html-snippets-options.png" target="_blank"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/raw-html-snippets-options-300x187.png" alt="" title="Raw HTML Snippets: Options Page" width="300" height="187" class="size-medium wp-image-966" /></a><p class="wp-caption-text">Options Page</p></div><p>To use this plugin:</p><ul><li>Go to the settings and add a snippet. There&#8217;s a handy dandy &#8220;Add a New Raw HTML Snippet&#8221; button.</li><li>After you are done, go back to that settings page and it will give you the shortcode you need to use.</li><li>Find a page or post and just inject the shortcode into the post where ever you want to.</li></ul><p>I tried the following:</p><pre class="syntax html">&lt;div style=&quot;font-weight:bold; color:red;&quot;&gt; OMGWTFBBQ! &lt;/div&gt; &lt;script type=&quot;text/javascript&quot;&gt; alert('all your base are belong to us'); &lt;/script&gt;</pre><div id="attachment_967" class="wp-caption aligncenter" style="width: 310px"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/NareU-300x206.jpg" alt="" title="Racoon: EXCELLENT" width="300" height="206" class="size-medium wp-image-967" /><p class="wp-caption-text">It works!</p></div><h2 id="the-basics" title="The Basics">The Basics</h2><ul><li><span style="color: green;">+1 Point</span>: The author appears to be actively supporting the plugin, as far as I can tell.</li><li><span style="color: green;">+1 Point</span>: There were no notices/warnings produced from the plugin.</li><li><span style="color: green;">+1 Point</span>: Does what it said it would do.</li><li><span style="color: green;">+1 Point</span>: Appears to be as well documented.</li></ul><h2 id="the-code" title="The Code">The Code</h2><ul><li><span style="color: red;">-1 Point</span>: Going to dock it on this, even though it&#8217;s a VERY small plugin (240 lines) -> Uses prefixed functions instead of objects. But it is a <a title="In WordPress, prefix everything by Andrew Nacin" href="http://andrewnacin.com/2010/05/11/in-wordpress-prefix-everything/" target="_blank">documented practice</a>.<br /><blockquote cite="http://andrewnacin.com/2010/05/11/in-wordpress-prefix-everything/"><p>Clearly, the class method is very clean. You can name methods after hooks and action verbs, working within that namespace as if it is a blank slate (because it is). Classes are very helpful in WordPress plugins even if you are not using object-oriented concepts.</p><p>At one plugin competition <em><strong>…</strong></em> multiple plugins by the same author could not even be run on the same blog, since they conflicted with each other. Don’t do that. If you have the same function in two different plugins, consider wrapping both in a function_exists check, that way both plugins can use whichever is defined first. Some do that with every function or class they define, just as a precaution. Fatal core errors from redefinition of functions will take a blog down real quick.</p><p><cite><a title="Andrew Nacin" href="http://andrewnacin.com/" target="_blank">Andrew Nacin</a></cite></p></blockquote></li><li><span style="color: green;">+1 Point</span>: Conforms to the WordPress coding standards for formatting: <a title="WordPress Coding Standards: Indentation" href="http://codex.wordpress.org/WordPress_Coding_Standards#Indentation" target="_blank">WordPress Coding Standards: Indentation</a></li><li><span style="color: green;">+1 Point</span>: Code quality seems to be decent (aside from prefixed functions) and is easy to follow.</li><li><span style="color: grey;">+/-1 Point</span>: The code is trusting all user input. The author DID warn you. So if your site get&#8217;s infiltrated like some <a href="http://www.shacknews.com/article/57098/breaking-eve-online-goonfleet-espionage" title="EvE Online: Goonfleet Espionage" target="_blank">epic nerdy espionage</a>, that&#8217;s YOUR FAULT!</li><li><span style="color: green;">+1 Point</span>: No deprecated calls were made!</li></ul><h2 id="the-results" style="clear: none;" title="The Results">The Results</h2><p><strong style="color: green;">Passed!</strong></p><ul><li>The Basics: +4 Points</li><li>The Code: +3 Points</li></ul><p><strong>Total: <em>+7 Points</em></strong></p><p>I love high scoring plugins!</p><p>This one is simple, does it&#8217;s job of making your site customizable and insecure. Which is what we wanted!</p><p>If you need to use a plugin to do such a thing, I recommend this one. If you&#8217;re going to be evil, at least do it well <img src='http://sterlinghamilton.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p><blockquote cite="/2011/06/14/plugin-review-list-category-posts/"><p>With respects to the author and the WordPress community, these are my opinions and my thoughts &#8211; in no way is the review a personal matter &#8211; never take it personally. I also have and do make mistakes when it comes to the readability of code and security, but that&#8217;s why we use version control, refactor and so on.</p><p><cite><a title="Plugin Review: List category posts by Sterling Hamilton" href="http://sterlinghamilton.com/2011/06/14/plugin-review-list-category-posts/">Sterling Hamilton</a></cite></p></blockquote>]]></content:encoded>
			<wfw:commentRss>http://sterlinghamilton.com/2011/07/25/plugin-review-raw-html-snippets/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		</item>
		<item>
			<title>Plugin Review: Members</title>
			<link>http://sterlinghamilton.com/2011/07/06/plugin-review-members/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=plugin-review-members</link>
			<comments>http://sterlinghamilton.com/2011/07/06/plugin-review-members/#comments</comments>
			<pubDate>Wed, 06 Jul 2011 17:59:16 +0000</pubDate>
			<dc:creator>Sterling Hamilton</dc:creator>
			<category><![CDATA[WordPress]]></category>
			<category><![CDATA[plugin]]></category>
			<category><![CDATA[review]]></category>
			<category><![CDATA[wordpress]]></category>
			<guid isPermaLink="false">http://sterlinghamilton.com/?p=899</guid>
			<description><![CDATA[Another day, another WordPress plugin review! Today I&#8217;ll be reviewing the Members plugin. Description: Members is a plugin that extends your control over your blog. It&#8217;s a user, role, and content management plugin that was created to make WordPress a &#8230; <a href="http://sterlinghamilton.com/2011/07/06/plugin-review-members/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Another day, another WordPress plugin review!</p><p>Today I&#8217;ll be reviewing the <a href="http://wordpress.org/extend/plugins/members/" title="Members" target="_blank">Members</a> plugin.</p><p>Description:</p><blockquote cite="http://wordpress.org/extend/plugins/members/"><p>Members is a plugin that extends your control over your blog. It&#8217;s a user, role, and content management plugin that was created to make WordPress a more powerful CMS.</p><p>The foundation of the plugin is its extensive role and capability management system. This is the backbone of all the current features and planned future features.</p><p><cite><a href="http://wordpress.org/extend/plugins/members/" title="Members" target="_blank">Members</a></cite></p></blockquote><p>Let&#8217;s get this show on the road!</p><p><span id="more-899"></span></p><h1 id="the-review" title="The Review">The Review</h1><h2 id="the-walkthrough">The Walkthrough</h2><p>Actively maintained &#8211; so that&#8217;s cool: <strong>Last Updated: 2011-6-13</strong></p><p>No activation errors.</p><p>Settings page at: /wp-admin/options-general.php?page=members-settings</p><div id="attachment_923" class="wp-caption aligncenter" style="width: 310px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/07/members-screen-shot-settings.png" target="_blank"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/members-screen-shot-settings-300x187.png" alt="WordPress Plugin: Members - Settings Page" title="WordPress Plugin: Members - Settings Page" width="300" height="187" class="size-medium wp-image-923" /></a><p class="wp-caption-text">Settings Page</p></div><p>&#8220;Your roles and capabilities will not revert back to their earlier settings after deactivating or uninstalling this plugin, so use this feature wisely.&#8221; -> But it&#8217;s enabled by default? WTF?</p><p>To use this plugin:</p><ul><li>Go to WordPress&#8217; default post: /wp-admin/post.php?post=2&#038;action=edit</li><li>Set the restrict checkbox to &#8216;Administrator&#8217; then click update.</li><li>Create new user as subscriber &#8211; login as that new user.</li><li>Try to go to page: http://subdomain.wordpress.local/?page_id=2</li></ul><p>We get: Sorry, but you do not have permission to view this content.</p><p>Logout and see if the public can view it: Nope.</p><p>Log back in as administrator and we can see the page!</p><div id="attachment_922" class="wp-caption aligncenter" style="width: 310px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/07/members-screen-shot-1.png" target="_blank"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/members-screen-shot-1-300x187.png" alt="WordPress Plugin: Members - Screenshot 1" title="WordPress Plugin: Members - Screenshot 1" width="300" height="187" class="size-medium wp-image-922" /></a><p class="wp-caption-text">Restricted Page!</p></div><p>Success! It works!</p><p>You can add roles!</p><div id="attachment_926" class="wp-caption aligncenter" style="width: 310px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/07/members-screen-shot-roles.png" target="_blank"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/members-screen-shot-roles-300x187.png" alt="Wordpress Plugin: Members - Roles" title="Wordpress Plugin: Members - Roles" width="300" height="187" class="size-medium wp-image-926" /></a><p class="wp-caption-text">Wordpress Plugin: Members - Roles</p></div><p>Things that you may not think you are able to restrict:</p><ul><li>Media Uploads</li><li>Links</li><li>Comments</li><li>Themes</li><li>Plugins</li><li>Widgets</li><li>Categories</li><li>Tags</li><li>Administrator Screens</li></ul><p>Things you can restrict specifically:</p><ul><li>Pages</li><li>Posts</li></ul><p>How to restrict most of those things you thought you couldn&#8217;t:</p><ul><li>Role Capabilities: which may or may not allow you to restrict most of the items listed above.</li></ul><div id="attachment_925" class="wp-caption aligncenter" style="width: 310px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/07/members-screen-shot-add-roles.png" target="_blank"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/members-screen-shot-add-roles-300x187.png" alt="WordPress Plugin: Members - Add Roles" title="WordPress Plugin: Members - Add Roles" width="300" height="187" class="size-medium wp-image-925" /></a><p class="wp-caption-text">I really hate that there are 50 checkboxes and the only way to go through them is to select them one by one. It would be cool to either clone off a previous role or have a select all button. Just something to save time. Not worth losing a point over.</p></div><p>Users cannot belong to multiple roles.</p><p>Changing the roles took a second or two to find:</p><div id="attachment_924" class="wp-caption aligncenter" style="width: 310px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/07/members-screen-shot-change-roles.png" target="_blank"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/members-screen-shot-change-roles-300x187.png" alt="WordPress Plugin: Members - Change Roles" title="WordPress Plugin: Members - Change Roles" width="300" height="187" class="size-medium wp-image-924" /></a><p class="wp-caption-text">Change Roles</p></div><p>Based on the comment &#8220;Your roles and capabilities will not revert back&#8221; it seems like that when the plugin is deactivated&#8230;it litters the database.</p><p>I&#8217;ll check that out&#8230; yep it litters the database and doesn&#8217;t clean up after itself! FOR SHAME!</p><p><img src="http://sterlinghamilton.com/wp-content/uploads/2011/06/disapproval.jpg" alt="Look of Dissaproval :ಠ_ಠ" title="Look of Dissaproval :ಠ_ಠ" width="100" height="64" class="aligncenter" style="border:0;" /></p><p>The functionality of everything goes back to being public &#8211; but the data is not as it was. My recommendation to the author is that if your plugin changes data and it&#8217;s easy to undo that (which in this case it is) then you should clean up after yourself when being removed.</p><p>No blatant errors:</p><pre class="syntax bash">$ find . -name '*.php' -exec php -l {} \; No syntax errors detected in ./admin/admin.php No syntax errors detected in ./admin/meta-box-plugin-settings.php No syntax errors detected in ./admin/meta-box-post-content-permissions.php No syntax errors detected in ./admin/role-edit.php No syntax errors detected in ./admin/role-new.php No syntax errors detected in ./admin/roles-list-table.php No syntax errors detected in ./admin/roles.php No syntax errors detected in ./admin/settings.php No syntax errors detected in ./includes/admin-bar.php No syntax errors detected in ./includes/capabilities.php No syntax errors detected in ./includes/comments.php No syntax errors detected in ./includes/content-permissions.php No syntax errors detected in ./includes/deprecated.php No syntax errors detected in ./includes/functions.php No syntax errors detected in ./includes/private-site.php No syntax errors detected in ./includes/shortcodes.php No syntax errors detected in ./includes/template.php No syntax errors detected in ./includes/update.php No syntax errors detected in ./includes/widget-login-form.php No syntax errors detected in ./includes/widget-users.php No syntax errors detected in ./includes/widgets.php No syntax errors detected in ./members.php</pre><h2 id="the-basics" title="The Basics">The Basics</h2><ul><li><span style="color: green;">+1 Point</span>: The author appears to be actively supporting the plugin.</li><li><span style="color: green;">+1 Point</span>: There were no notices/warnings produced from the plugin.</li><li><span style="color: green;">+1 Point</span>: Does what it said it would do.</li><li><span style="color: green;">+1 Point</span>: Appears to be as well documented as it needs to be.</li></ul><h2 id="the-code" title="The Code">The Code</h2><ul><li><span style="color:red;">-1 Point</span>: Uses prefixed functions instead of objects. Also does not check to see if functions exist. This make it easier to have bad interactions with other plugins. I do not recommend it &#8211; especially in this case where the prefix is &#8216;member&#8217;. But it is a <a href="http://andrewnacin.com/2010/05/11/in-wordpress-prefix-everything/" title="In WordPress, prefix everything by Andrew Nacin" target="_blank">documented practice</a>.<br /><blockquote cite="http://andrewnacin.com/2010/05/11/in-wordpress-prefix-everything/"><p>Clearly, the class method is very clean. You can name methods after hooks and action verbs, working within that namespace as if it is a blank slate (because it is). Classes are very helpful in WordPress plugins even if you are not using object-oriented concepts.</p><p>At one plugin competition <em><strong>&hellip;</strong></em> multiple plugins by the same author could not even be run on the same blog, since they conflicted with each other. Don’t do that. If you have the same function in two different plugins, consider wrapping both in a function_exists check, that way both plugins can use whichever is defined first. Some do that with every function or class they define, just as a precaution. Fatal core errors from redefinition of functions will take a blog down real quick.</p><p><cite><a href="http://andrewnacin.com/" target="_blank" title="Andrew Nacin">Andrew Nacin</a></cite></p></blockquote></li><li><span style="color:green;">+1 Point</span>: Conforms to the WordPress coding standards for formatting: <a href="http://codex.wordpress.org/WordPress_Coding_Standards#Indentation" title="WordPress Coding Standards: Indentation" target="_blank">WordPress Coding Standards: Indentation</a></li><li><span style="color:green;">+1 Point</span>: Code quality seems to be decent (aside from prefixed functions) and is easy to follow.</li><li><span style="color: red;">-1 Point</span>: The code is trusting all user input. It&#8217;s not making any attempts to sanitize the data. Never trust the user (yes &#8211; even in the administration area): <a title="Andrew Nacin: WordCamp Seattle" href="http://andrewnacin.com/2011/04/16/wordcamp-seattle/" target="_blank">Andrew Nacin: WordCamp Seattle</a></li><li><span style="color: green;">+1 Point</span>: No deprecated calls were made!</li><li><span style="color: red;">-1 Point</span>: The plugin litters the database. EVILLL!!!</li></ul><h2 id="the-results" style="clear: none;" title="The Results">The Results</h2><p><strong style="color: green;">Passed!</strong></p><ul><li>The Basics: +4 Points</li><li>The Code: +1 Points</li></ul><p><strong>Total: <em>+5 Points</em></strong></p><p>The plugin adds some basic functionality to sites that need more than the built in role capability from WordPress.</p><p>It does do some dirty thing like the prefixed function names and database littering. But other than that it seems pretty solid.</p><p>Check it out and let me know if you find anything worth mentioning!</p><blockquote cite="/2011/06/14/plugin-review-list-category-posts/"><p>With respects to the author and the WordPress community, these are my opinions and my thoughts &#8211; in no way is the review a personal matter &#8211; never take it personally. I also have and do make mistakes when it comes to the readability of code and security, but that&#8217;s why we use version control, refactor and so on.</p><p><cite><a title="Plugin Review: List category posts by Sterling Hamilton" href="http://sterlinghamilton.com/2011/06/14/plugin-review-list-category-posts/">Sterling Hamilton</a></cite></p></blockquote>]]></content:encoded>
			<wfw:commentRss>http://sterlinghamilton.com/2011/07/06/plugin-review-members/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		</item>
		<item>
			<title>Updating all Git Repositories with Ruby</title>
			<link>http://sterlinghamilton.com/2011/07/05/updating-all-git-repositories-with-ruby/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=updating-all-git-repositories-with-ruby</link>
			<comments>http://sterlinghamilton.com/2011/07/05/updating-all-git-repositories-with-ruby/#comments</comments>
			<pubDate>Wed, 06 Jul 2011 06:48:21 +0000</pubDate>
			<dc:creator>Sterling Hamilton</dc:creator>
			<category><![CDATA[WordPress]]></category>
			<category><![CDATA[git]]></category>
			<category><![CDATA[ruby]]></category>
			<category><![CDATA[script]]></category>
			<category><![CDATA[tutorial]]></category>
			<guid isPermaLink="false">http://sterlinghamilton.com/?p=902</guid>
			<description><![CDATA[Today I decided to update an old script that I had been using. Time to bring on the Ruby goodness! Note: I updated the repository with the latest stuff. It makes some assumptions. It has a hard coded default remote &#8230; <a href="http://sterlinghamilton.com/2011/07/05/updating-all-git-repositories-with-ruby/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/ruby-logo.jpg" alt="Ruby Logo" title="Ruby Logo" width="200" height="200" class="alignleft" style="border:0;" /></p><p>Today I decided to update an <a href="http://sterlinghamilton.com/2010/12/24/bash-script-update-all-local-git-repositories/" title="Bash Script: Update all local Git Repositories">old script</a> that I had been using.</p><p>Time to bring on the Ruby goodness!</p><p>Note: I updated the <a href="https://github.com/grok/script-update-repositories" title="GitHub: Grok's Repository for Scripting Repository Updates" target="_blank">repository</a> with the latest stuff.</p><p>It makes some assumptions. It has a hard coded default remote name of &#8220;origin&#8221; since that seems to be the most common. It also assumes that you want to pull all branches.</p><p>If any of these things are not true, feel free to alter the script to fit your needs.</p><p>Here&#8217;s what it ends up looking like:</p><div id="attachment_917" class="wp-caption aligncenter" style="width: 191px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/07/Screen-shot-2011-07-05-at-11.53.44-PM.png"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/Screen-shot-2011-07-05-at-11.53.44-PM-181x300.png" alt="Repository Updating Ruby Script" title="Repository Updating Ruby Script" width="181" height="300" class="size-medium wp-image-917" /></a><p class="wp-caption-text">Repository Updating Ruby Script</p></div><p><span id="more-902"></span></p><p>Here&#8217;s the code:</p><pre class="syntax ruby">#!/usr/bin/env ruby require 'rubygems' require 'colored' require 'fileutils' old_pwd = `pwd` default_remote = 'origin' $highlight = '# '.magenta_on_black def do_pull( repository = nil )if repository.nil? target = 'Pulling: '.cyan.bold + `git remote -v | grep fetch`.white_on_black.bold puts target.sub( &quot;\t&quot; , ' -&gt; ' ).sub( '(fetch)' , '' ).strip puts $highlight + `git pull` + &quot;\n&quot; else target = 'Pulling: '.cyan.bold + `git remote -v | grep #{repository} | grep fetch`.white_on_black.bold puts target.sub( &quot;\t&quot; , ' -&gt; ' ).sub( '(fetch)' , '' ).strip puts $highlight + `git pull #{repository}` + &quot;\n&quot; end end ARGV.each do|path| puts $highlight + &quot;Checking given path.,,&quot;.white_on_black if File.directory?( path )puts $highlight + '[ SUCCESS ]'.green_on_black + ' ' + path.bold.white_on_black + &quot;\n\n&quot; FileUtils.cd path `find . -maxdepth 1 -mindepth 1 -type d`.each do |repository| repository = path.to_s.strip + repository.to_s.strip repository = repository.gsub( /.*\// , '' ).strip puts $highlight + &quot;Checking: #{repository}&quot;.white_on_black FileUtils.cd repository remotes = `git remote` if remotes.include? default_remote do_pull default_remote else case remotes.to_a.count when 1do_pull when 0puts '[ FAIL ] '.red_on_black.bold + &quot;Unable to locate any remote branches.\n&quot;.white_on_black.bold else puts &quot;Default Remote \&quot;#{default_remote}\&quot; not detected. Too many alternative remotes to pull automatically.\n&quot;.white_on_black.bold end end FileUtils.cd old_pwd.strip end puts $highlight + &quot;Do work son!\n&quot;.green.bold else puts '[ FAIL ] '.red_on_black.bold + &quot;You must include a path containing repositories! #{path}&quot;.white_on_black.bold end end</pre><p>It may not be as efficient or as clever as it should be, but it does work.</p><p>Please let me know if you see any room for improvement!</p>]]></content:encoded>
			<wfw:commentRss>http://sterlinghamilton.com/2011/07/05/updating-all-git-repositories-with-ruby/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		</item>
		<item>
			<title>WordPress 3.2 now available</title>
			<link>http://sterlinghamilton.com/2011/07/05/wordpress-3-2-now-available/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wordpress-3-2-now-available</link>
			<comments>http://sterlinghamilton.com/2011/07/05/wordpress-3-2-now-available/#comments</comments>
			<pubDate>Tue, 05 Jul 2011 23:35:46 +0000</pubDate>
			<dc:creator>Sterling Hamilton</dc:creator>
			<category><![CDATA[WordPress]]></category>
			<category><![CDATA[mysql]]></category>
			<category><![CDATA[php]]></category>
			<category><![CDATA[update]]></category>
			<category><![CDATA[wordpress]]></category>
			<guid isPermaLink="false">http://sterlinghamilton.com/?p=896</guid>
			<description><![CDATA[A while ago I posted an article stating that WordPress was going to stop supporting PHP 4 and MySQL 4. As of July 4th, that statement has come to fruition. Under the hood there have been a number of improvements, &#8230; <a href="http://sterlinghamilton.com/2011/07/05/wordpress-3-2-now-available/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A while ago I posted an article stating that <a href="http://sterlinghamilton.com/2010/12/23/wordpress-to-stop-supporting-php-4-and-mysql-4/" title="WordPress to Stop Supporting PHP 4 and MySQL 4!">WordPress was going to stop supporting PHP 4 and MySQL 4</a>. As of July 4th, <a href="http://wordpress.org/news/2011/07/gershwin/" title="WordPress 3.2 now available" target="_blank">that statement has come to fruition</a>.</p><blockquote cite="http://wordpress.org/news/2011/07/gershwin/"><p>Under the hood there have been a number of improvements, not the least of which is the streamlining enabled by our previously announced plan of retiring support for PHP4, older versions of MySQL, and legacy browsers like IE6, which allows us to take advantage of more features enabled by new technologies.</p><p><cite><a href="http://wordpress.org/news/2011/07/gershwin/" title="WordPress 3.2 now available" target="_blank">Matt Mullenweg</a></cite></p></blockquote><p>Aside from those major anouncements, I&#8217;ve been actively using WordPress 3.2 for weeks now and it&#8217;s awesome. I like the UI enhancements as well as the new distraction-free writing mode.</p><p>Here&#8217;s a glimps into some of the latest and greatest from the WordPress dev team.</p><blockquote cite="http://wordpress.org/news/2011/07/gershwin/"><p>The focus for this release was making WordPress faster and lighter. The first thing you’ll notice when you log in to 3.2 is a refreshed dashboard design that tightens the typography, design, and code behind the admin. (Rhapsody in Grey?) If you’re starting a new blog, you’ll also appreciate the fully HTML5 new Twenty Eleven theme, fulfilling our plan to replace the default theme every year. Start writing your first post in our redesigned post editor and venture to the full-screen button in the editing toolbar to enter the new distraction-free writing or zen mode, my personal favorite feature of the release. All of the widgets, menus, buttons, and interface elements fade away to allow you to compose and edit your thoughts in a completely clean environment conducive to writing, but when your mouse strays to the top of the screen your most-used shortcuts are right there where you need them. (I like to press F11 to take my browser full-screen, getting rid of even the OS chrome.)</p><p><cite><a href="http://wordpress.org/news/2011/07/gershwin/" title="WordPress 3.2 now available" target="_blank">Matt Mullenweg</a></cite></p></blockquote><p>Head on over to <a href="http://wordpress.org/news/2011/07/gershwin/" title="WordPress 3.2 now available" target="_blank">wordpress.org</a> to see the full article.</p>]]></content:encoded>
			<wfw:commentRss>http://sterlinghamilton.com/2011/07/05/wordpress-3-2-now-available/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		</item>
		<item>
			<title>Adding colored output to your Ruby Script</title>
			<link>http://sterlinghamilton.com/2011/07/05/adding-colored-output-to-your-ruby-script/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-colored-output-to-your-ruby-script</link>
			<comments>http://sterlinghamilton.com/2011/07/05/adding-colored-output-to-your-ruby-script/#comments</comments>
			<pubDate>Tue, 05 Jul 2011 23:11:07 +0000</pubDate>
			<dc:creator>Sterling Hamilton</dc:creator>
			<category><![CDATA[WordPress]]></category>
			<category><![CDATA[ruby]]></category>
			<category><![CDATA[script]]></category>
			<category><![CDATA[tutorial]]></category>
			<guid isPermaLink="false">http://sterlinghamilton.com/?p=888</guid>
			<description><![CDATA[I wrote an older article about how to use colored output inside of a bash script and I figured it might be time to move from bash to ruby. The code is much smaller and concise, I pulled the original &#8230; <a href="http://sterlinghamilton.com/2011/07/05/adding-colored-output-to-your-ruby-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wrote an older article about how to use <a href="http://sterlinghamilton.com/2010/12/23/unix-shell-adding-color-to-your-bash-script/" title="Unix Shell: Adding color to your Bash Script!">colored output inside of a bash script</a> and I figured it might be time to move from bash to ruby.</p><p>The code is much smaller and concise, I pulled the original source form <a href="http://stackoverflow.com/questions/2070010/how-to-output-my-ruby-commandline-text-in-different-colours#answer-2070405" title="command line - How to output my ruby commandline text in different colours - Stack Overflow" target="_blank">stackoverflow</a>:</p><pre class="syntax ruby">#!/usr/bin/ruby def colorize(text, color_code) &quot;\e[#{color_code}m#{text}\e[0m&quot; end def red(text); colorize(text, 31); end def green(text); colorize(text, 32); end # Actual example puts 'Importing categories [ ' + green('DONE') + ' ]' puts 'Importing tags [' + red('FAILED') + ']'</pre><p>But this is a bit primitive.</p><p>Alternatively you can use this gem, which is much cleaner and in my opinion, more ruby-ish.</p><pre class="syntax ruby">#!/usr/bin/ruby require 'rubygems' require 'colored' puts &quot;This is some red text: &quot; + &quot;OMG it's SO RED!&quot;.red</pre><div id="attachment_893" class="wp-caption aligncenter" style="width: 310px"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/07/Screen-shot-2011-07-05-at-4.25.10-PM-300x157.png" alt="Ruby Consol Script: Colored Gem" title="Ruby Consol Script: Colored Gem" width="300" height="157" class="size-medium wp-image-893" /><p class="wp-caption-text">Example output using the Colored Gem</p></div><p>For more information on the <a href="http://rubygems.org/gems/colored" target="_blank" title="colored | RubyGems.org | your community gem host">Colored Gem</a>, see <a href="http://rubydoc.info/gems/colored/1.2/frames" target="_blank" title="File: README">its documentation</a>. You can also view their <a href="https://github.com/defunkt/colored" title="defunkt/colored - GitHub" target="_blank">repository</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://sterlinghamilton.com/2011/07/05/adding-colored-output-to-your-ruby-script/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		</item>
		<item>
			<title>Plugin Review: Iframe Embedder</title>
			<link>http://sterlinghamilton.com/2011/06/29/plugin-review-iframe-embedder/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=plugin-review-iframe-embedder</link>
			<comments>http://sterlinghamilton.com/2011/06/29/plugin-review-iframe-embedder/#comments</comments>
			<pubDate>Wed, 29 Jun 2011 23:46:15 +0000</pubDate>
			<dc:creator>Sterling Hamilton</dc:creator>
			<category><![CDATA[WordPress]]></category>
			<category><![CDATA[plugin]]></category>
			<category><![CDATA[review]]></category>
			<category><![CDATA[wordpress]]></category>
			<guid isPermaLink="false">http://sterlinghamilton.com/?p=865</guid>
			<description><![CDATA[Prefatory Like a sweet twitching energy drink induced digital coma, I&#8217;ve been trippin balls the entire day with the plugin reviews! I have had a few requests today &#8211; so this will probably be the last &#8211; then &#8230; MOAR &#8230; <a href="http://sterlinghamilton.com/2011/06/29/plugin-review-iframe-embedder/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://sterlinghamilton.com/wp-content/uploads/2011/06/moar_23-300x214.jpg" alt="MOAR!!!1!" title="MOAR!!!1!" width="300" height="214" class="alignleft size-medium wp-image-866" /></p><h1 id="prefatory" style="clear: none;" title="Prefatory">Prefatory</h1><p>Like a sweet twitching energy drink induced digital coma, I&#8217;ve been trippin balls the entire day with the plugin reviews!</p><p>I have had a few requests today &#8211; so this will probably be the last &#8211; then &hellip; MOAR CODING!</p><p>Now I&#8217;m reviewing <a href="http://wordpress.org/extend/plugins/iframe-embedder/" title="Iframe Embedder" target="_blank">Iframe Embedder</a>!</p><p>Developer Note: I hate iFrames with a <strong style="color:red;">BURNING</strong> passion. Sometimes they are needed, but when all parties involved have done things properly &#8211; this is not the case.</p><blockquote cite="http://wordpress.org/extend/plugins/iframe-embedder/"><p>Iframe Embedder lets you embed an iframe in a post by typing [iframe http://server/page.htm 100% 200px]</p><p>You can use % or px as units for width and height. If you omit unit- it will default to px. You cannot omit width and height values. You can use relative paths.</p><p><cite><a href="http://wordpress.org/extend/plugins/iframe-embedder/" title="Iframe Embedder" target="_blank">Iframe Embedder</a></cite></p></blockquote><p><span id="more-865"></span></p><h1 id="the-review" title="The Review">The Review</h1><h2 id="the-walkthrough">The Walkthrough</h2><p>It turns the plugin on or it gets the hose again!</p><p>No errors, no warnings and no deprecated calls. Yet another &#8220;oh so fine&#8221; plugin.</p><div id="attachment_869" class="wp-caption aligncenter" style="width: 310px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/06/iframe-embedder-screenshot-1.png" target="_blank"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/06/iframe-embedder-screenshot-1-300x213.png" alt="Iframe Embedder Screenshot 1" title="iframe-embedder-screenshot-1" width="300" height="213" class="size-medium wp-image-869" /></a><p class="wp-caption-text">The options page is very simple. So let&#039;s move on to using the plugin.</p></div><pre class="syntax html">[iframe http://google.com 800px 200px]</pre><p>I hate attributes without context. I&#8217;d prefer this:</p><pre class="syntax html">[iframe src=&quot;http://google.com&quot; width=&quot;800px&quot; height=&quot;200px&quot;]</pre><p>But, that is just a preference and they won&#8217;t lose points for it!</p><div id="attachment_872" class="wp-caption aligncenter" style="width: 310px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/06/iframe-embedder-screenshot-2.png" target="_blank"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/06/iframe-embedder-screenshot-2-300x247.png" alt="Iframe Embedder Screenshot 2" title="iframe-embedder-screenshot-2" width="300" height="247" class="size-medium wp-image-872" /></a><p class="wp-caption-text">Yay it works!</p></div><p>That&#8217;s all to the plugin!</p><p>Check the code!</p><pre>find . -name '*.php' -exec php -l {} \; No syntax errors detected in ./embedder.php</pre><p>No blatant errors.</p><p>The code itself is prefixed functions, sloppy and hard to read.</p><h2 id="the-basics" title="The Basics">The Basics</h2><ul><li><span style="color: red;">-1 Point</span>: The author does not seem to be actively supporting the plugin.</li><li><span style="color: green;">+1 Point</span>: There were no notices/warnings produced from the plugin.</li><li><span style="color: green;">+1 Point</span>: Does what it said it would do.</li><li><span style="color: green;">+1 Point</span>: Appears to be as well documented as it needs to be.</li></ul><h2 id="the-code" title="The Code">The Code</h2><ul><li><span style="color:red;">-1 Point</span>: Uses prefixed functions instead of objects. Also does not check to see if functions exist. This make it easier to have bad interactions with other plugins. I do not recommend it. But it is a <a href="http://andrewnacin.com/2010/05/11/in-wordpress-prefix-everything/" title="In WordPress, prefix everything by Andrew Nacin" target="_blank">documented practice</a>.<br /><blockquote cite="http://andrewnacin.com/2010/05/11/in-wordpress-prefix-everything/"><p>Clearly, the class method is very clean. You can name methods after hooks and action verbs, working within that namespace as if it is a blank slate (because it is). Classes are very helpful in WordPress plugins even if you are not using object-oriented concepts.</p><p>At one plugin competition <em><strong>&hellip;</strong></em> multiple plugins by the same author could not even be run on the same blog, since they conflicted with each other. Don’t do that. If you have the same function in two different plugins, consider wrapping both in a function_exists check, that way both plugins can use whichever is defined first. Some do that with every function or class they define, just as a precaution. Fatal core errors from redefinition of functions will take a blog down real quick.</p><p><cite><a href="http://andrewnacin.com/" target="_blank" title="Andrew Nacin">Andrew Nacin</a></cite></p></blockquote></li><li><span style="color:red;">-1 Point</span>: Does not conform to the WordPress coding standards for formatting: <a href="http://codex.wordpress.org/WordPress_Coding_Standards#Indentation" title="WordPress Coding Standards: Indentation" target="_blank">WordPress Coding Standards: Indentation</a></li><li><span style="color:red;">-1 Point</span>: Code quality is lacking. It&#8217;s messy and hard to follow. Unnecessarily. It&#8217;s very &#8220;scripty&#8221;.</li><li><span style="color: red;">-1 Point</span>: The code is trusting all user input. It&#8217;s not making any attempts to sanitize the data. Never trust the user (yes &#8211; even in the administration area): <a title="Andrew Nacin: WordCamp Seattle" href="http://andrewnacin.com/2011/04/16/wordcamp-seattle/" target="_blank">Andrew Nacin: WordCamp Seattle</a></li><li><span style="color: green;">+1 Point</span>: No deprecated calls were made!</li></ul><h2 id="the-results" style="clear: none;" title="The Results">The Results</h2><p><strong style="color: red;">Failed!</strong></p><ul><li>The Basics: +2 Points</li><li>The Code: -3 Points</li></ul><p><strong>Total: <em>-1 Points</em></strong></p><p>An old plugin encouraging evil. EEEEEVVVIIIILLLL!!!</p><p>My personal prejudices aside, the plugin does what it says to do without making PHP or WordPress barf. The code on the other hand and having to deal with iFrames did not save me from such a fate though. If you absolutely need iFrame, you could use this plugin.</p><p>But I strongly recommend looking into ways around it. Injecting 3rd party/external content into posts/pages is a HUGE security whole and a bad practice in general. It hurts usability and impacts how search engines crawl your sight in a negative way.</p><blockquote cite="/2011/06/14/plugin-review-list-category-posts/"><p>With respects to the author and the WordPress community, these are my opinions and my thoughts &#8211; in no way is the review a personal matter &#8211; never take it personally. I also have and do make mistakes when it comes to the readability of code and security, but that&#8217;s why we use version control, refactor and so on.</p><p><cite><a title="Plugin Review: List category posts by Sterling Hamilton" href="http://sterlinghamilton.com/2011/06/14/plugin-review-list-category-posts/">Sterling Hamilton</a></cite></p></blockquote>]]></content:encoded>
			<wfw:commentRss>http://sterlinghamilton.com/2011/06/29/plugin-review-iframe-embedder/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		</item>
		<item>
			<title>Plugin Review: MapPress Easy Google Maps</title>
			<link>http://sterlinghamilton.com/2011/06/29/plugin-review-mappress-easy-google-maps/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=plugin-review-mappress-easy-google-maps</link>
			<comments>http://sterlinghamilton.com/2011/06/29/plugin-review-mappress-easy-google-maps/#comments</comments>
			<pubDate>Wed, 29 Jun 2011 21:52:37 +0000</pubDate>
			<dc:creator>Sterling Hamilton</dc:creator>
			<category><![CDATA[WordPress]]></category>
			<category><![CDATA[php]]></category>
			<category><![CDATA[plugin]]></category>
			<category><![CDATA[review]]></category>
			<category><![CDATA[wordpress]]></category>
			<guid isPermaLink="false">http://sterlinghamilton.com/?p=820</guid>
			<description><![CDATA[Prefatory This one will be pretty quick. The plugin author(s) did a great job on this one. I&#8217;m reviewing MapPress Easy Google Maps What is it? MapPress adds an interactive map to the wordpress editing screens. When editing a post &#8230; <a href="http://sterlinghamilton.com/2011/06/29/plugin-review-mappress-easy-google-maps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1 id="prefatory" style="clear: none;" title="Prefatory">Prefatory</h1><p>This one will be pretty quick. The plugin author(s) did a great job on this one.</p><p>I&#8217;m reviewing <a href="http://wordpress.org/extend/plugins/mappress-google-maps-for-wordpress/" title="MapPress Easy Google Maps" target="_blank">MapPress Easy Google Maps</a></p><p>What is it?</p><blockquote cite="http://wordpress.org/extend/plugins/mappress-google-maps-for-wordpress/"><p>MapPress adds an interactive map to the wordpress editing screens. When editing a post or page just enter any addresses you&#8217;d like to map.</p><p>The plugin will automatically insert a great-looking interactive map into your blog. Your readers can get directions right in your blog and you can even create custom HTML for the map markers (including pictures, links, etc.)!</p><p><cite><a href="http://wordpress.org/extend/plugins/mappress-google-maps-for-wordpress/" title="MapPress Easy Google Maps" target="_blank">MapPress Easy Google Maps</a></cite></p></blockquote><p><img src="http://sterlinghamilton.com/wp-content/uploads/2011/06/mappress-screenshot-1-300x259.png" alt="MapPress Screenshot 1" title="MapPress Screenshot 1" width="300" height="259" class="aligncenter size-medium wp-image-857" /></p><p><span id="more-820"></span></p><h1 id="the-review" title="The Review">The Review</h1><h2 id="the-walkthrough">The Walkthrough</h2><p>Once activated no error or warnings. No deprecated calls.</p><p>Go to settings page. There&#8217;s documentation! C0o0o0o0l. Upon looking at the documentation it is a little confusing.</p><p>Here&#8217;s the steps they have posted on how to use their plugin:</p><blockquote cite="http://wphostreviews.com/mappress/mappress-documentation-144"><p>MapPress is easy to use. Basically, the steps are:</p><ol><li>Edit the post or page and create a map</li><li>Add markers to your map</li><li>Optionally add the MapPress shortcode</li><li>Publish your post</li></ol><p><cite><a href="http://wphostreviews.com/mappress/mappress-documentation-144" title="MapPress Documentation" target="_blank">MapPress Documentation</a></cite></p></blockquote><p>Then it explains how to make a map.</p><p>Here&#8217;s what I ended up doing.</p><div id="attachment_855" class="wp-caption aligncenter" style="width: 310px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/06/mappress-screenshot-2.png"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/06/mappress-screenshot-2-300x211.png" alt="MapPress Screenshot 2" title="mappress-screenshot-2" width="300" height="211" class="size-medium wp-image-855" /></a><p class="wp-caption-text">MapPress Screenshot 2: Click to View Larger</p></div><ul><li>Grab a page or post.</li><li>Below the content area there&#8217;s a new section called &#8220;MapPress&#8221;.</li><li>Click New Map.</li><li>Type in a location.</li><li>Hit &#8220;Add&#8221;.</li><li>Type in a title and some dimensions and hit &#8220;Save&#8221;.</li><li>Then you can mouse over the newly saved map name and then click &#8220;insert into post&#8221; when it shows up.</li></ul><div id="attachment_856" class="wp-caption aligncenter" style="width: 310px"><a href="http://sterlinghamilton.com/wp-content/uploads/2011/06/mappress-screenshot-3.png"><img src="http://sterlinghamilton.com/wp-content/uploads/2011/06/mappress-screenshot-3-300x177.png" alt="MapPress Screenshot 3" title="MapPress Screenshot 3" width="300" height="177" class="size-medium wp-image-856" /></a><p class="wp-caption-text">MapPress Screenshot 3: Click to View Larger</p></div><p>Pretty good usability. But the options page stink! Poor layout <img src='http://sterlinghamilton.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p><p>It shows up on the page, it&#8217;s fast and it works!</p><p>Let&#8217;s check the code!</p><p>Objects! Yay!</p><p>Not syntax errors! Yay!</p><pre class="syntax bash">find . -name '*.php' -exec php -l {} \; No syntax errors detected in ./mappress.php No syntax errors detected in ./mappress_api.php No syntax errors detected in ./mappress_updater.php</pre><p>Included a core file, which I am very against &#8211; but it might be needed to accomplish what they need to.</p><pre class="syntax bash">./mappress.php:801: include_once(ABSPATH . WPINC . '/feed.php');</pre><h2 id="the-basics" title="The Basics">The Basics</h2><ul><li><span style="color: green;">+1 Point</span>: The author appears to still be actively supporting the plugin.</li><li><span style="color: green;">+1 Point</span>: There were no notices/warnings produced from the plugin.</li><li><span style="color: green;">+1 Point</span>: Does what it said it would do.</li><li><span style="color: green;">+1 Point</span>: Appears to be well documented, though a bit confusing in some areas, and it has an active support community.</li></ul><h2 id="the-code" title="The Code">The Code</h2><ul><li><span style="color: green;">+1 Point</span>: Uses classes! Yay!</li><li><span style="color: green;">+1 Point</span>: Conforms to the WordPress coding standards.</li><li><span style="color: green;">+1 Point</span>: Code quality is decent in most places and easy to read.</li><li><span style="color: red;">-1 Point</span>: The code is trusting all user input. It&#8217;s not making any attempts to sanitize the data. Never trust the user (yes &#8211; even in the administration area): <a title="Andrew Nacin: WordCamp Seattle" href="http://andrewnacin.com/2011/04/16/wordcamp-seattle/" target="_blank">Andrew Nacin: WordCamp Seattle</a></li><li><span style="color: green;">+1 Point</span>: No deprecated calls were made!</li></ul><h2 id="the-results" style="clear: none;" title="The Results">The Results</h2><p><strong style="color: green;">Passed!</strong></p><ul><li>The Basics: +4 Points</li><li>The Code: +3 Points</li></ul><p><strong>Total: <em>+7 Points</em></strong></p><p>A high score! Props to the developers. It looks like a good plugin that will only get better with time.</p><p>I recommend you check it out and if you get confused by the documentation or find a problem with the plugin, please let me know!</p><p>I got through a whole post without throwing a picture your way? <strong>WTF?</strong></p><p>Here&#8217;s a kitten:</p><p><img src="http://placekitten.com/500/200" title="Random Kitteh!" alt="Random Kitteh!" class="aligncenter size-medium wp-image-688" /></p><blockquote cite="/2011/06/14/plugin-review-list-category-posts/"><p>With respects to the author and the WordPress community, these are my opinions and my thoughts &#8211; in no way is the review a personal matter &#8211; never take it personally. I also have and do make mistakes when it comes to the readability of code and security, but that&#8217;s why we use version control, refactor and so on.</p><p><cite><a title="Plugin Review: List category posts by Sterling Hamilton" href="http://sterlinghamilton.com/2011/06/14/plugin-review-list-category-posts/">Sterling Hamilton</a></cite></p></blockquote>]]></content:encoded>
			<wfw:commentRss>http://sterlinghamilton.com/2011/06/29/plugin-review-mappress-easy-google-maps/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
