WP-Sweep – You Simply Need To Use It On Your WordPress Install

WP-Sweep - Keep Your WordPress Database Running Smooth

Over the years my WordPress database had become bloated – very bloated. Despite using WP-Optimize to keep the database in check, 12 years of content, many host migrations and export/import cycles had caused my database to balloon to a massive 98.6 MB in size.

Needless to say, this caused more than a few issues when I recently migrated my site to dedicated WordPress hosting and importing the database was a nightmare.

Enter WP-Sweep. Developed by WordPress guru Lester Chan, WP-Sweep gets way more involved than WP-Optimize does, including functionality to remove orphaned and duplicated post meta. Duplicated post meta from years of imports and exports were to blame for most of the bloat on my install.

A couple of sweeps with WP-Sweep and my database was reduced to 12.9 MB.

Needless to say, backup your database before sweeping – just in case.

Distraction Free Blogging? I’d Pay For That!

Distraction Free Blogging

While I applaud the efforts made by the WordPress team to include a distraction free editor, it unfortunately does little (and cannot for technical reasons) to stop the myriad of distractions that occur on my desktop or laptop. The only real way to stop the flood of email notifications, IM’s, phone calls is to disconnect from the internet completely, turn off my phone and write my posts in an offline editor – none of which have feature parity with the WordPress platform.

When I look at my kindle e-reader I see a device perfectly setup for distraction free reading – all you have to do is silence your phone and go into another room, and I find myself wishing for a simple tablet like device that only allowed me write and save drafts to my WordPress site.

I’m thinking a 7 – 8 inch, tablet-like device with a foldout keyboard, can have a cheap low-resolution screen because it serves one purpose only, to push blog posts to my CMS via an API.

I’d buy one in a heart-beat.

They Didn’t Think It Through – Browsing WordPress Mobile Theme Stores

I was looking for inspiration for a mobile site design today, trawling WordPress theme stores, when I noticed a particularly stupid and unhelpful trend.

The image you see below is what I get when I visit the demo for a mobile theme on a mobile browser. Yes, that’s right – you’re looking at the full desktop site with the mobile version embedded in a frame…

I understand that these demos are setup to help people visiting from their desktop, but is it really such a stretch of the imagination to think that someone might want to demo your mobile them on, I don’t know… their mobile device?

Theme Demo Nexus Screengrab

WordPress – Publish Posts But Have Them Hidden Until A Scheduled Time?

I asked this on the WordPress forums but haven’t had any luck yet, so I’m going to ask here in the hopes that one of my wonderful readers will know of a possible solutions:

I’m looking to be able to publish posts so that they are only visible if you know the URL but have them hidden from everywhere (RSS feed, etc..) until a scheduled time when the post becomes visible to everybody.

I’m trying to do this for a number of reasons, including advertisers seeing sponsored posts before they go up, and third party services whos scheduled posts features don’t display properly unless they can scrape the meta data from the post (I’m looking at you Facebook!).

The plugin “WP Hide Post” can achieve the hiding part, but not the “un-hiding on schedule”. Also the plugin hasn’t been updated in nearly 2 years and the authors own website is gone defunct as well.

Any suggestions would be greatly appreciated 🙂

Pay With A Like? Share Before You Can See Content?

I’m always looking for new ways to bring traffic to our network of sites, but the new “Pay With A Like” plugin from WPMU feels socially dishonest to me.

The Pay with a Like plugin lets you leverage the power of social currency in order to give access to content or a download. You know your content is share-worthy, but how do you get those lazy visitors to take a minute to share with their friends? Make them pay with a Like on Facebook!

Content becomes visible after a user pays by sharing your post. And it’s not just for Facebook Likes – users can also pay with a Tweet, a Google +1, or a share on LinkedIn.

The plugin is also very easy to use. It comes with a built-in button to protect specific content within a post through use of shortcodes:

Don’t get me wrong, we’re never above asking people to like us when we run a competition or something, but asking people to share your site or post before they’ve even seen the content, before they even know if it’s share-worthy, well that just flies in the face of what social sharing is about in my opinion.

Also, I wonder if this wouldn’t have the potential to backfire?

When we rolled out changes to our sites recently that had 12 excerpts on the front page instead of 3 full posts, the backlash from readers had us scrambling to change the format because a lot of users just won’t make that extra click see the content. Call it laziness or whatever you want, some folks just won’t do it.


Add Social Share Buttons To The WordPress Post Management Screen

Share Posts Management Screen

One of the things that’s difficult with blogs where you pump out a lot of content is having an overview of how many shares your posts are getting on Facebook, Twitter, StumbleUpon and other networks without visiting each post individually to check out the share buttons.

Sure this can be accomplished via analytics but depending on the analytics platform  you use the results can be anywhere up to 24 hours behind.

Earlier today I knocked up this little piece of code that can either be used as plugin or dropped into your functions.php which will add share buttons in a column on the post management screen so that you can see how your posts are doing and share directly from management screen if you want to.

I’m sure there are more elegant ways to do this, possibly using wp_enque_script but as the script only runs on edit.php and Facebook and other networks have a nasty habit of changing their code without much warning, I thought this would be simpler.

Comments, suggestions and improvements welcome.

add_action( 'admin_head-edit.php', 'add_socialm_head_script' );

function add_socialm_head_script() { ?>

<script type="text/javascript">
(function() {
var li = document.createElement('script'); li.type = 'text/javascript'; li.async = true;
li.src = window.location.protocol + '//platform.stumbleupon.com/1/widgets.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(li, s);

<link href="https://plus.google.com/PUBLISHERID" rel="publisher" /><script type="text/javascript">
window.___gcfg = {lang: 'en'};
{var po = document.createElement("script");
po.type = "text/javascript"; po.async = true;po.src = "https://apis.google.com/js/plusone.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(po, s);

<?php }

if ( !function_exists('AddShareColumn')) {

function AddShareColumn($cols) {
$cols['sharebuttons'] = __('Share');
return $cols;
function AddShareLink($column_name, $post_id) {

if ( 'sharebuttons' == $column_name ) {
echo '<su:badge layout="1" location="'.get_permalink($post_id).'"></su:badge><br />';

echo '//www.facebook.com/plugins/like.php?href='.get_permalink().'&send=false&layout=button_count&width=90&amp;show_faces=false&action=like&colorscheme=light&font&height=21&appId=APPID<br />';

echo '<a href="https://twitter.com/share" class="twitter-share-button"
data-url="'.get_permalink($post_id).'" data-text="'.get_the_title().'"
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js"
;fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script><br />';

echo '<g:plusone size="small" href="'.get_permalink($post_id).'"></g:plusone>';

// for posts
add_filter( 'manage_posts_columns', 'AddShareColumn' );
add_action( 'manage_posts_custom_column', 'AddShareLink', 10, 2 );
// for pages
add_filter( 'manage_pages_columns', 'AddShareColumn' );
add_action( 'manage_pages_custom_column', 'AddShareLink, 10, 2 );

Developer Productivity Tip – Evernote As A Searchable, Portable Code Snippet Repository


One of the coolest things about developing especially when working with an open source product like WordPress, is that if you have a problem the chances are that someone else has already developed a solution for it.

Need a piece of code to prevent YouTube videos from overriding your theme and messing up your content? Somebody has done it. How about preserving the share count on your Twitter buttons after a change of URL? That’s out there too.

If you know how to search for it almost everything you could need is out there, documented and explained by somebody else and ready for you to build upon. No need to re-invent the wheel over and over again. Pretty cool right?

Yes, it is pretty cool if you can actually find what you need amongst the pages and pages of search results, most of which are only vaguely related to what you need or are years out of date. You can spend literally hours looking for that one solution to a problem and when you find it, if your forget to bookmark it or save it you’ll spend hours looking for it again next time you need it.

What if you could have one central repository for all of the code snippets that you come across, complete with images, diagrams and context, that you could access from anywhere?

Using Evernote you could access these snippets from any browser or your cellphone, and they are easily searchable, and can be tagged in ways that make sense to you. Need  to add a function to change post formats for a single category on save? It should be really easy to find if you’ve tagged it appropriately and even if you haven’t Evernotes build in search only has your snippets to wade through instead of the entire internet.

I know Evernote has been around for a long time. I’ve been using it for years but honestly found little use for it, despite actively trying to find use for it, until I started using it to store code snippets that either I have developed or that I’ve found on the web.

Most days someone that I follow on twitter will link to a cool code snippet or function, or I’ll stumble across a cool tip or piece of code that I have no use for right now but may in the future. With a quick click of the Evernote Web clipper (available for IE, Firefox, Chrome and Safari) I can save and tag that code in case I ever actually do need it.

The best part of all this, beyond the time saved  by having this repository of snippets always available to me, is that the whole thing is entirely free. A free Evernote account coupled with some free extensions is all that it takes and I get to save time almost every day, instead of hunting down solutions on Google and in forums that I’ve already saved to cloud.

Is W3 Total Cache Still Supported?

Is W3 Total Cache still in development for WordPress or has it been abandoned?

W3 Total Cache is one of those really cool WordPress plugins that everybody who’s serious about WordPress knows about, and even a lot of people who just have a passing knowledge have at least heard of it. It’s one of the two caching plugins that reign supreme in the world of WordPress and the last few times I’ve presented on WordPress it’s always come up in the Q&A.

I’m in the midst of prototyping a new site and I decided I’d give W3 a spin as opposed to my usual work horse, WP Super Cache, and noted that W3 still is only rated as working with WP 3.21.

There has been no submitted updates in 4 months and people are posting incompatibilities between WP 3.3 (which has been out for 8 days) and the latest version of W3 Total Cache.

I know Frederick Townes, (the guy behind W3) has been relatively quite online recently and he’s a very busy guy, so I’m, wondering if Frederick or anybody else in the know can tell me if W3 Total Cache is still in production?