Debug Bar Slow Actions

If a typical WordPress page load takes more than one second, chances are there’s something terribly wrong with your site, a theme or a plugin is probably doing something it shouldn’t. Obviously you don’t have time to review every single line in your codebase, so Debug Bar Slow Actions might help you out.

Debug Bar Slow Actions is an extension for the popular Debug Bar plugin. It adds a new panel with a list of the top 100 slowest actions (and filters) during the current page request.

Debug Bar Slow Actions

It’s fairly lightweight (as opposed to xdebug and other profiling tools), but I wouldn’t recommend running it on a production environment, or at least not for long. It does hook to each and every action and filter (twice!) to time it, though timing is pretty fast and it’s highly unlikely that it’ll ever become a performance bottleneck.

After you’ve found out which action is the slowest, you can easily lookup the callback functions hooked to that action, perhaps using tools like Query Monitor, or a simple var_dump:

add_action( 'init', 'whats_at_init', 9999 );
function whats_at_init() {
	var_dump( $GLOBALS['wp_filter']['init'] );
}

Update: version 0.8.1 and above will show you the number of callbacks hooked to each action, and it’s also possible to expand the callbacks list.

You can get Debug Bar Slow Actions from WordPress.org or GitHub.

Happy profiling!

Publish up to 170% more posts with Color Schemes Roulette for WordPress

You know WordPress 3.8 has arrived, right? It’s got a total of eight new and beautiful color schemes for you to choose from, and another eight (at the time of writing) in an official plugin called Admin Color Schemes, so sixteen total. How do you pick one? Easy.

Meet Color Schemes Roulette — a brand new WordPress plugin, that will randomly change your admin color scheme every time you hit that Publish button. It’s also a great motivator, proven to increase blogging frequency up to 170% right after activation!

WordPress Color Schemes

Yup, this is my way to celebrate the 3.8 release. Although I haven’t contributed much this time, I’m still super excited to see it all come together. Thanks to Matt and the whole team behind 3.8, for making such a beautiful WordPress.

Columns for WordPress

Sometimes you need to split your content into two or more columns, perhaps for a list of features on your front page. Unfortunately the standard WordPress editor does not support that out of the box (yet) so you turn to plugins.

With quite a few options available, it’s not easy to make the right choice, plus, there’s almost always a learning curve involved, especially with shortcodes like:

[fourcol_two_last]

I crafted an experimental columns plugin quite a while ago, which hopefully simplifies the shortcodes to a bare minimum, and makes them look slightly more like HTML. Put as much columns as you want into a column group, and it can figure out the rest:

[column-group]
    [column]This is my first column[/column]
    [column]This is my second column[/column]
[/column-group]

Hopefully this is much easier than memorizing cryptic shortcode names, and even if you end up deactivating the plugin in the future, you can always run a (fairly) simple regex search and replace to “lock yourself out.”

I recently released the plugin for public use. It’s called Columns (duh!) and it’s available at the WordPress.org plugins directory. Give it a spin and let me know what you think!

Double Titles when Sharing on Google+

If you’ve got double titles when sharing your WordPress posts on Google+, it’s probably due to duplicate OpenGraph tags, which might have been caused by the latest update to Jetpack, which added OpenGraph tags in version 2.0. If you’re already running a plugin that outputs the “og:” tags in your document head, you’ll have to disable one or the other.

For example, to have WordPress SEO by Yoast not output the OpenGraph tags, go to SEO – Social and disable Facebook OpenGraph. If you’d like to disable Jetpack’s OpenGraph support, you’ll have to write some code, preferably in a plugin file:

add_filter( 'jetpack_enable_open_graph', '__return_false' );

Other plugins might be different, but you get the idea.

WordPress Plugin Review Discussion

Otto, Brian Krogsgard, Ben Lobaugh, Erick Hitter, Jake Goldman, Kailey Lampert, Shane Pearlman, John Hawkins, Patrick Garman, Ryan Frankel, Andrew Norcross. Google Hangouts seemed to work pretty well!

I don’t have a strong opinion about any of the points they discussed, but I would love to see an option to flag a particular plugin with a security issue, and obviously, write what the issue is, and how it could (or should) be resolved.

Updating Plugins Feels Good

I have updated two plugins I wrote a long time ago, which haven’t been updated in years, and were not fully compatible with the recent versions of WordPress. It felt very good, especially since I managed to rewrite both plugins in only a few hours, and looking at my old code made me realize how much I have learned.

I feel like I should do this more often.