Logging Post Status Transitions in WordPress

Last week an interesting issue came up for a client. Somehow a few posts were moved from Published to Draft. Unfortunately, post status isn’t stored in revisions so it’s unlikely we’ll ever know who or how it happened. Luckily there’s a simple solution I found to log all post status transitions in post meta:

add_action( 'transition_post_status', 'log_post_transition', 10, 3 );
function log_post_transition( $new_status, $old_status, $post ) {
	if ( 'post' === $post->post_type ) {
		$current_user = wp_get_current_user();
		add_post_meta( $post->ID, '_post_status_log', sprintf( '%s %d, %s->%s', current_time( 'mysql' ), $current_user->ID, $old_status, $new_status ), false );
	}
}

SUSINO Travel Bag

On March 25th I ordered a “Free Shipping SUSINO New Men’s Travel Bag For Storaging Electronic Parts Cosmetic Bag Casual Outdoor Storage Bag” from AliExpress.  It was on sale for $6.75, normally $18.24.

2016-04-04 14.37.01To be honest, I wasn’t getting my hopes up about quality.  Luckily, I was wrong.  Already, I’m enjoying this bag.  It’s taken all of the loose and under-fitting items that used to live loosely in the dark depths of my messenger bag and has given them a home.

Glancing at the pictures on my phone while ordering, I had assumed that the layout was a cross pattern of elastic, similar to the Grid-It! organizers.  It was not.  That’s fine though, because it works well with what it has.  I was very happy with all that I could fit inside.  I even had enough room left to fit in a couple new items. Read More »

Renewing Let’s Encrypt SSL on SABnzbd+

Having a secure way to manage your usenet downloads of the hit movie Big Buck Bunny with SABnzbd+ is great, but one problem/feature of Let’s Encrypt is that the SSL certificates expire only after three months, requiring plenty of renewals.  Luckily this can be easily scripted and forgotten.

The primary part of renewing the SSL certificates will be handled by a modified version of Erika Heidi‘s le-renew.sh script.  Erika’s script does a few things we don’t need, such as restarting Apache, so I forked it on GitHub and made a few changes.
Read More »