<?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>Mike Van WinkleList your MySQL Tables According to Size or Row Count | Mike Van Winkle</title>
	<atom:link href="http://mikevanwinkle.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mikevanwinkle.com</link>
	<description>Wordpress/PHP Developer</description>
	<lastBuildDate>Fri, 10 May 2013 16:36:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>List your MySQL Tables According to Size or Row Count</title>
		<link>http://mikevanwinkle.com/wordpress/list-your-mysql-tables-according-to-size-or-row-count/</link>
		<comments>http://mikevanwinkle.com/wordpress/list-your-mysql-tables-according-to-size-or-row-count/#comments</comments>
		<pubDate>Fri, 22 Feb 2013 17:07:50 +0000</pubDate>
		<dc:creator>Mike Van Winkle</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[queries]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://mikevanwinkle.com/?p=1684</guid>
		<description><![CDATA[If you&#8217;ve ever been debugging a large Multisite installation that&#8217;s having MySQL memory issues you know how maddening it can be. Sometimes you can turn on slow logging and find the source of the issue. But sometimes it&#8217;s not just about slow queries, it&#8217;s about the shear size of the tables and the number of [...]]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;ve ever been debugging a large Multisite installation that&#8217;s having MySQL memory issues you know how maddening it can be. Sometimes you can turn on <a href="http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html" title="MySQL Slow Log">slow logging</a> and find the source of the issue. But sometimes it&#8217;s not just about slow queries, it&#8217;s about the shear size of the tables and the number of queries being run against them. One trick is to generate a list of all the tables on the site and sort them by size. This will help you narrow down trouble spots. </p>
<pre class="brush:php">
USE INFORMATION_SCHEMA; 
SELECT table_name,table_rows,data_length FROM TABLES where table_schema = 'DBNAME' AND table_rows > 0 ORDER BY data_length DESC LIMIT 0,50;
</pre>
<p>This will produce a list like the following (see below). You can adjust the sort order and limit based on your needs. This query isn&#8217;t all that helpful in cases of small installs. But in an installation with 500+ tables it can help you narrow down the issue quickly. <strong>WARNING:</strong> this query can take a long time to run depending on the number of databases on your server and the number of tables in the Dbs.</p>
<pre>
table_name	table_rows	data_length
wp_options	125	65536
wp_blogs	1	16384
wp_sitemeta	25	16384
wp_site	1	16384
wp_posts	3	16384
wp_postmeta	1	16384
wp_users	2	16384
wp_comments	1	16384
wp_usermeta	31	16384
wp_links	7	560
wp_term_relationships	8	168
wp_term_taxonomy	2	84
wp_terms	2	72
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mikevanwinkle.com/wordpress/list-your-mysql-tables-according-to-size-or-row-count/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regex to Match Opening Slash</title>
		<link>http://mikevanwinkle.com/development-2/regex-to-match-opening-slash/</link>
		<comments>http://mikevanwinkle.com/development-2/regex-to-match-opening-slash/#comments</comments>
		<pubDate>Tue, 25 Dec 2012 01:44:36 +0000</pubDate>
		<dc:creator>Mike Van Winkle</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://mikevanwinkle.com/?p=1640</guid>
		<description><![CDATA[Just in case anyone needs a regex that tells you that a string does NOT have an slash at the beginning, here you go. This is useful for handling paths defined by users and you want to check whether it is a relative or absolute path. preg_match("#^(?!\/).*#", $string);]]></description>
				<content:encoded><![CDATA[<p>Just in case anyone needs a regex that tells you that a string does NOT have an slash at the beginning, here you go. This is useful for handling paths defined by users and you want to check whether it is a relative or absolute path. </p>
<pre class="brush:php">
  preg_match("#^(?!\/).*#", $string);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mikevanwinkle.com/development-2/regex-to-match-opening-slash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Giving WooCommerce a Try</title>
		<link>http://mikevanwinkle.com/news/giving-woocommerce-a-try/</link>
		<comments>http://mikevanwinkle.com/news/giving-woocommerce-a-try/#comments</comments>
		<pubDate>Tue, 11 Dec 2012 18:26:24 +0000</pubDate>
		<dc:creator>Mike Van Winkle</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://mikevanwinkle.com/?p=1623</guid>
		<description><![CDATA[Just a quick announcement. I&#8217;m now using WooCommerce for my eCommerce so please let me know if you have an issue. I was using Cart66 but it makes use of sessions, which are disallowed by WPEngine for both security and performance reasons. my WooCommerce setup looks ugly at the moment because I haven&#8217;t had time [...]]]></description>
				<content:encoded><![CDATA[<p>Just a quick announcement. I&#8217;m now using WooCommerce for my eCommerce so please let me know if you have an issue. I was using Cart66 but it makes use of sessions, which are disallowed by WPEngine for both security and performance reasons. my WooCommerce setup looks ugly at the moment because I haven&#8217;t had time to work on the styles yet, so bear with me.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikevanwinkle.com/news/giving-woocommerce-a-try/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simplr Registration Form Plus v2.1.9</title>
		<link>http://mikevanwinkle.com/wordpress/simplr-registration-form-plus-v2-1-9/</link>
		<comments>http://mikevanwinkle.com/wordpress/simplr-registration-form-plus-v2-1-9/#comments</comments>
		<pubDate>Mon, 08 Oct 2012 15:12:28 +0000</pubDate>
		<dc:creator>Mike Van Winkle</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://mikevanwinkle.com/?p=1598</guid>
		<description><![CDATA[Simplr Registration Form Plus I just pushed Simplr Registration Form Plus 2.1.9 &#8230; lots of behind the scenes updates and code fixes. Primary visual enhance is the UI for the TinyMCE shortcode button. You know longer have to type in the custom fields. You can know just check the boxes then drag and drop to [...]]]></description>
				<content:encoded><![CDATA[<p><a title="Simple WordPress Registration Form" href="http://www.mikevanwinkle.com/simplr-registration-form-plus" target="_blank">Simplr Registration Form Plus</a></p>
<p>I just pushed Simplr Registration Form Plus 2.1.9 &#8230; lots of behind the scenes updates and code fixes. Primary visual enhance is the UI for the TinyMCE shortcode button. You know longer have to type in the custom fields. You can know just check the boxes then drag and drop to reorder.</p>
<p><a href="http://mikevanwinkle.com/wp-content/uploads/2012/10/Screen-shot-2012-10-08-at-8.10.25-AM.png"><img class="size-medium wp-image-1599 alignnone" title="Screen shot 2012-10-08 at 8.10.25 AM" src="http://mikevanwinkle.com/wp-content/uploads/2012/10/Screen-shot-2012-10-08-at-8.10.25-AM-300x87.png" alt="" width="300" height="87" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://mikevanwinkle.com/wordpress/simplr-registration-form-plus-v2-1-9/feed/</wfw:commentRss>
		<slash:comments>98</slash:comments>
		</item>
		<item>
		<title>Function: get_template_part_cached()</title>
		<link>http://mikevanwinkle.com/wordpress/caching/function-get_template_part_cached/</link>
		<comments>http://mikevanwinkle.com/wordpress/caching/function-get_template_part_cached/#comments</comments>
		<pubDate>Sat, 25 Aug 2012 20:47:49 +0000</pubDate>
		<dc:creator>Mike Van Winkle</dc:creator>
				<category><![CDATA[Caching]]></category>

		<guid isPermaLink="false">http://mikevanwinkle.com/?p=1315</guid>
		<description><![CDATA[In my WordCamp Chicago presentation I had an bunk version of this function. Here&#8217;s a better version. Though we could probably still improve even this: function get_template_part_cached($slug, $name, $key, $group = 'posts', $ttl = 3600) { if( !$output = wp_cache_get($key, $group)) { ob_start(); get_template_part($slug,$name); $output = ob_get_contents(); ob_end_clean(); wp_cache_set( $key, $output, $group, $ttl ); } [...]]]></description>
				<content:encoded><![CDATA[<p>In my <a href="http://2012.chicago.wordcamp.org/">WordCamp Chicago presentation</a> I had an bunk version of this function. Here&#8217;s a better version. Though we could probably still improve even this:</p>
<pre class="brush:php">
function get_template_part_cached($slug, $name, $key, $group = 'posts', $ttl = 3600) {
	if( !$output = wp_cache_get($key, $group)) {
		ob_start();
			get_template_part($slug,$name);
		$output = ob_get_contents();
		ob_end_clean();
		wp_cache_set( $key, $output, $group, $ttl );
	}
	echo $output;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mikevanwinkle.com/wordpress/caching/function-get_template_part_cached/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slide Deck From WordCamp Chicago</title>
		<link>http://mikevanwinkle.com/wordpress/slide-deck-from-wordcamp-chicago/</link>
		<comments>http://mikevanwinkle.com/wordpress/slide-deck-from-wordcamp-chicago/#comments</comments>
		<pubDate>Sat, 25 Aug 2012 20:38:44 +0000</pubDate>
		<dc:creator>Mike Van Winkle</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://mikevanwinkle.com/?p=1313</guid>
		<description><![CDATA[Thanks everyone for coming to my presentation at WordCamp Chicago. The organizers did a great job putting everything together. Here&#8217;s my slide deck. WordCamp Chicago Slides]]></description>
				<content:encoded><![CDATA[<p>Thanks everyone for coming to my presentation at WordCamp Chicago. The organizers did a great job putting everything together. Here&#8217;s my slide deck.</p>
<p><a href="http://mikevanwinkle.com/wp-content/uploads/2012/08/WCChicago.pptx">WordCamp Chicago Slides</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mikevanwinkle.com/wordpress/slide-deck-from-wordcamp-chicago/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thesis Cache(r) Beta &#8211; 2012-07-31</title>
		<link>http://mikevanwinkle.com/wordpress/thesis-cacher-beta-2012-07-31/</link>
		<comments>http://mikevanwinkle.com/wordpress/thesis-cacher-beta-2012-07-31/#comments</comments>
		<pubDate>Tue, 31 Jul 2012 21:39:38 +0000</pubDate>
		<dc:creator>Mike Van Winkle</dc:creator>
				<category><![CDATA[Caching]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://mikevanwinkle.com/?p=1302</guid>
		<description><![CDATA[Through my work at WPEngine I&#8217;ve found that using the Thesis Theme can occasionally lead to some performance issues on higher-traffic sites. Nothing spectacular, there are a ton of themes out there that have some issues scaling. Thesis is not special. But what occurred to me about Thesis, is that it really should be one of the [...]]]></description>
				<content:encoded><![CDATA[<p>Through my work at <a title="High Performance WordPress" href="www.wpengine.com" target="_blank">WPEngine</a> I&#8217;ve found that using the <a href="http://diythemes.com/" target="_blank">Thesis Theme</a> can occasionally lead to some performance issues on higher-traffic sites. Nothing spectacular, there are a ton of themes out there that have some issues scaling. Thesis is not special.</p>
<p>But what occurred to me about Thesis, is that it really should be one of the more performant themes out there.  The logic of the theme is organized hierarchically. Thesis passes all html output through <code>thesis_html_framework()</code> which means it is very easy to grab it and cache it, thus adding an additional layer of caching using the WordPress Object Cache.</p>
<a href="/downloads/thesis-cacher.zip" id="cool-button">Download it!</a>
<p>Why would you need this if you are already using <a href="http://wordpress.org/extend/plugins/w3-total-cache/" target="_blank">W3TC</a> or using a hosting company like <a title="High Performance WordPress Hosting" href="http://www.wpengine.com" target="_blank">WPEngine</a>. Both give you various tools for page caching &#8230; why use another?</p>
<p>Well, first this plugin is not about replacing your existing caching, but instead making sure that you have adequate caching at the theme level. Even with system level caching there are going to be times where the cache is not served &#8230; either because a user is logged in, or because you are getting a lot of traffic and the cache is just missing, or because the cache was purposefully cleared.</p>
<p><strong>ThesisCache(r)</strong> just gives you another layer to prevent consuming MySQL/PHP memory if you don&#8217;t have too. It gives you page-by-page,post-by-post control over whether to cache a post (or any post type). You can choose to NOT cache a page &#8230; or you can even choose to NOT cache the sidebars even though you want to cache the rest.</p>
<p><a href="http://mikevanwinkle.com/wp-content/uploads/2012/07/Screen-shot-2012-07-31-at-2.32.43-PM.png"><img class="alignright size-medium wp-image-1303" title="ThesisCache(r)" src="http://mikevanwinkle.com/wp-content/uploads/2012/07/Screen-shot-2012-07-31-at-2.32.43-PM-283x300.png" alt="" width="283" height="300" /></a></p>
<p>If you are not currently using ANY object caching no worries, <strong>ThesisCache(r)</strong> will set up a file-based object cache for you. If you are using an object cache, it will simply leverage what already use.</p>
<p><strong>ThesisCache(r)</strong> isn&#8217;t in the Plugin Repo yet so here&#8217;s the download link. Please report any issues you have in the comments below. I&#8217;ll try to deal with them when I can.</p>
<a href="/downloads/thesis-cacher.zip" id="cool-button">Download it!</a>
]]></content:encoded>
			<wfw:commentRss>http://mikevanwinkle.com/wordpress/thesis-cacher-beta-2012-07-31/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Wee Bit of Downtime</title>
		<link>http://mikevanwinkle.com/life-2/a-wee-bit-of-downtime/</link>
		<comments>http://mikevanwinkle.com/life-2/a-wee-bit-of-downtime/#comments</comments>
		<pubDate>Thu, 26 Jul 2012 16:22:27 +0000</pubDate>
		<dc:creator>Mike Van Winkle</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://mikevanwinkle.com/?p=1301</guid>
		<description><![CDATA[Sorry folks, we had a wee bit of down last night due t0 my own stupidity but now we&#8217;re back up and running. Back to working too much and blogging to little. As most of you know I&#8217;ve taken a position at WPEngine and they&#8217;re working me like mad, but I&#8217;m learning all sorts of new [...]]]></description>
				<content:encoded><![CDATA[<p>Sorry folks, we had a wee bit of down last night due t0 my own stupidity but now we&#8217;re back up and running. Back to working too much and blogging to little. As most of you know I&#8217;ve taken a position at <a title="WPEngine" href="http://www.wpengine.com">WPEngine</a> and they&#8217;re working me like mad, but I&#8217;m learning all sorts of new cool crap to bring to my projects so &#8230; woo hoo!</p>
]]></content:encoded>
			<wfw:commentRss>http://mikevanwinkle.com/life-2/a-wee-bit-of-downtime/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hiking in Annadel State Park</title>
		<link>http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/</link>
		<comments>http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/#comments</comments>
		<pubDate>Tue, 05 Jun 2012 16:27:23 +0000</pubDate>
		<dc:creator>Mike Van Winkle</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[hiking]]></category>
		<category><![CDATA[hobbies]]></category>
		<category><![CDATA[outdoors]]></category>

		<guid isPermaLink="false">http://www.mikevanwinkle.com/?p=1283</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><span id="more-1283"></span>
<a href='http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/attachment/img_0424/' title='IMG_0424'><img width="150" height="150" src="http://mikevanwinkle.com/wp-content/uploads/2012/06/IMG_0424-150x150.jpg" class="attachment-thumbnail" alt="IMG_0424" /></a>
<a href='http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/attachment/img_0425/' title='IMG_0425'><img width="150" height="150" src="http://mikevanwinkle.com/wp-content/uploads/2012/06/IMG_0425-150x150.jpg" class="attachment-thumbnail" alt="IMG_0425" /></a>
<a href='http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/attachment/img_0426/' title='IMG_0426'><img width="150" height="150" src="http://mikevanwinkle.com/wp-content/uploads/2012/06/IMG_0426-150x150.jpg" class="attachment-thumbnail" alt="IMG_0426" /></a>
<a href='http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/attachment/img_0427/' title='IMG_0427'><img width="150" height="150" src="http://mikevanwinkle.com/wp-content/uploads/2012/06/IMG_0427-150x150.jpg" class="attachment-thumbnail" alt="IMG_0427" /></a>
<a href='http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/attachment/img_0428/' title='IMG_0428'><img width="150" height="150" src="http://mikevanwinkle.com/wp-content/uploads/2012/06/IMG_0428-150x150.jpg" class="attachment-thumbnail" alt="IMG_0428" /></a>
<a href='http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/attachment/img_0429/' title='IMG_0429'><img width="150" height="150" src="http://mikevanwinkle.com/wp-content/uploads/2012/06/IMG_0429-150x150.jpg" class="attachment-thumbnail" alt="IMG_0429" /></a>
<a href='http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/attachment/img_0430/' title='IMG_0430'><img width="150" height="150" src="http://mikevanwinkle.com/wp-content/uploads/2012/06/IMG_0430-150x150.jpg" class="attachment-thumbnail" alt="IMG_0430" /></a>
<a href='http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/attachment/img_0431/' title='IMG_0431'><img width="150" height="150" src="http://mikevanwinkle.com/wp-content/uploads/2012/06/IMG_0431-150x150.jpg" class="attachment-thumbnail" alt="IMG_0431" /></a>
<a href='http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/attachment/img_0432/' title='IMG_0432'><img width="150" height="150" src="http://mikevanwinkle.com/wp-content/uploads/2012/06/IMG_0432-150x150.jpg" class="attachment-thumbnail" alt="IMG_0432" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://mikevanwinkle.com/life-2/hiking-in-annadel-state-park/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Hack: Reorder the Admin Menu</title>
		<link>http://mikevanwinkle.com/wordpress/wordpress-hack-reorder-the-admin-menu/</link>
		<comments>http://mikevanwinkle.com/wordpress/wordpress-hack-reorder-the-admin-menu/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 21:26:20 +0000</pubDate>
		<dc:creator>Mike Van Winkle</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[admin_menu]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.mikevanwinkle.com/?p=1270</guid>
		<description><![CDATA[For many small business clients pages wind up being the most important WordPress post type. Many of them don&#8217;t even want a blog, just a nice looking site where they can update the content periodically, i.e. the contact page, the services page etc. So for these clients it&#8217;s often a little confusing to have &#8220;Posts&#8221; [...]]]></description>
				<content:encoded><![CDATA[<p>For many small business clients pages wind up being the most important WordPress post type. Many of them don&#8217;t even want a blog, just a nice looking site where they can update the content periodically, i.e. the contact page, the services page etc. </p>
<p>So for these clients it&#8217;s often a little confusing to have &#8220;Posts&#8221; at the top of the nav menu. Here&#8217;s how you would reorder to the nav to put pages on top. </p>
<p>First turn on the custom ordering option: </p>
<pre class="brush:php">
add_filter('custom_menu_order','__return_true');
</pre>
<p>Then create a function to filter the menu order array. In the function below we&#8217;re using array_splice to cut out the menu starting at position 2 because the &#8220;posts&#8221; menu item is #3 by default. How did I know that? Just add print_r($menu) and you&#8217;ll get a dump of the menu order.  After splicing the array, we iterate over the old menu array, the part we extracted ($old), using a foreach loop adding the old menu items back in. </p>
<pre class="brush:php">
function mc_menu_order($menu) {
// more on array_splice here: http://php.net/manual/en/function.array-splice.php
	$old = array_splice($menu,2,count($menu),array('2'=>'edit.php?post_type=page'));
	$keys = array_flip($menu);
	foreach($old as $item) {
		if(!array_key_exists($item,$keys)) {
			$menu[] = $item;
		}
	}
	unset($old);
	unset($keys);
	return $menu;
}
</pre>
<p>Then just add the api call to insert that function: </p>
<pre class="brush:php">
add_filter('menu_order','mc_menu_order');
</pre>
<p>Here it is all together:</p>
<pre class="brush:php">
//menu reorder
add_filter('custom_menu_order','__return_true');
add_filter('menu_order','mc_menu_order');
function mc_menu_order($menu) {
	$old = array_splice($menu,2,count($menu),array('2'=>'edit.php?post_type=page'));
	$keys = array_flip($menu);
	foreach($old as $item) {
		if(!array_key_exists($item,$keys)) {
			$menu[] = $item;
		}
	}
	unset($old);
	unset($keys);
	return $menu;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mikevanwinkle.com/wordpress/wordpress-hack-reorder-the-admin-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
