Custom Software Architect

Does your organization struggle with processes and tasks that are manual, time consuming and ineffective? Let’s talk.

WordPress Trainer

Empower others to build and maintain sites for others through this blog, WordCamps and Ladies Learning Code.

Review of the Smart Podcaster plugin

I recently tried the Smart Podcast Plugin by the infamous Pat Flynn, and wanted to share some thoughts on getting it configured the way I wanted for the Discover #HamOnt Podcast.

Full Multi-Episode Smart Podcaster Player
Full Multi-Episode Smart Podcaster Player
Individual track podcast player
Single track player

There seems to be a bit of a page rendering delay for the full multi-episode player, but I haven’t traced if it’s something else within the Podcaster theme conflicting or the JavaScript from the podcaster player itself.

For single posts, you can add the single podcast player via a short code within the post content.  However, the podcaster theme I’m using already has the URL of the episode MP3 within the post meta, so I figured adding a simple do_shortcode() with the appropriate attributes would allow me to automatically add the player to the top, but it didn’t work.  So I ended up having to call the Single Podcast Player core function directly to get it to work:

/**
* Inject the HTML for an audio player above the content
*/
function podcaster_add_smart_player( $content ) {
    if ( class_exists( 'SPP_Core' ) and is_single() and get_post_meta( get_the_ID(), 'cmb_thst_audio_url', true ) ) {
$podcast_player = SPP_Core::get_instance()->shortcode_smart_track_player(
            array(
                'url' => get_post_meta( get_the_ID(), 'cmb_thst_audio_url', true ),
                'image' => ( wp_get_attachment_image_src( get_post_thumbnail_id(), 'medium' ) ? wp_get_attachment_image_src( get_post_thumbnail_id(), 'medium' )[0] : '' ),
                'title' => trim( substr( get_the_title(), strpos( get_the_title(), ':' ) + 1 ) ),
                'artist' => get_bloginfo( 'name' ),
            )
        );
        $content = $podcast_player . ' ' . $content;
    }
    return $content;
}
add_filter( 'the_content', 'podcaster_add_smart_player', 1 );

I did something similar to inject the latest episode onto the homepage page template.

I’m using the free version, and while I totally get you need to push the upgrade, it’s super annoying that the upgrade messages appear nearly everywhere within the dashboard.  Here it is at the top of editing a post after saving (not one, but two):

Annoying podcaster player messages

And again when trying to add a new plugin, which doesn’t even fit the context:

More annoying messages

And even on the settings page for Gravity Forms, a separate plugin:

More annoying messages

It should be enough to communicate why you should upgrade in the options and when you add the popup when adding the podcast episode shortcode, but to inject it everywhere across the entire WordPress admin is a bit ridiculous.  The quick way I can see to get rid of it is either to upgrade, or adding return true; to the is_paid_version() function (approximately line 1483 of smart-podcast-player/classes/core.php):

/**
* Tells whether this version is the paid or free version
*
* @return true if this is the paid version of the player, false otherwise
*
* @since 1.0.2
*/
public static function is_paid_version() {
    return true;
    // ...
}

Or by setting the ‘spp_license_chk’ transient to true somewhere before is_paid_version() is called. If I wouldn’t have done this, I would have uninstalled the plugin.

All and all a nice, clean user interface and while it’s too soon to tell how much of an uptick the plugin is causing in listens via the website, the clean interface for listening to past episodes and on the individual posts itself is a welcome change from the previous default player included with the podcaster theme.

Paid for Electronic Music Blog Launching

I’m kicking up a blog to discuss some of the issues facing the electronic music industry and music artists in general.  This blog will follow the creation, release and revenue tracking of a song, along with discussions on all the nuances involved from what I’ve learned being a member of the Association of Electronic Music this past year. Chances are it won’t be a popular song by any means, but will mirror many of the questions and struggles artists and labels new and old are facing when trying to navigate the digital music landscape.

Imagine if…

You spend time creating a song, and now you want to put it out there for people to hear.  So you throw it up on Soundcloud and YouTube.  Only a handful of people listen to it, but of those few a DJ hears it and shares it with their audience.  They even mix it in during a live set, and the crowd loves it.

Should you have done something differently?  Perhaps registered with your local performing rights organization first?  Uploaded your track for fingerprinting in case it gets played on a radio station?  Do you have full copyright over the track?  What if someone else plays the song at a live gig, should you be getting anything for that?

Follow along at Paid for Electronic Music!

How to integrate MailChimp into WordPress

This 3 part series will soon be posted on my new WP On The Side site, but I wanted to post them here first.

In these videos you’ll learn how to integrate a MailChimp signup form, customize the look and feel of the signup process, and how to provide a free download to new subscribers.  Enjoy!

Adding a MailChimp Signup to a WordPress Site

Customizing the MailChimp / WordPress Signup Process

Creating a free download offer when someone subscribes to your MailChimp list

Like this tutorial? Be sure to sign up at WP On The Side to know when more videos are available.

Updating plugins in WordPress when hosting with WPEngine

In light of the latest security updates caused by the misuse of add_query_args() and remove_query_args(), there are likely many plugins that will need updating on your WordPress site.  From many client emails when they were auto notified by WPEngine of the recommended updates, I thought I’d quickly show you how you can do the updates yourself.

While you can use these instructions without using WPEngine, you’ll need to make sure you have a backup of your site before proceeding that you can quickly restore if there’s a problem.

1. Login to your WordPress administrator dashboard

Visit http://yoursite.com/wp-admin and login.  If you don’t know your login be sure to obtain it from whoever setup your website, or you can try using the lost password link to reset your password.

WordPress login form

2. Verify plugin updates are available and click Plugins

WordPress Plugin updates available

On the left hand side, verify there are plugin updates available by looking for a red circle beside Plugins with a number in it.  In the above case there are two.  Then click on that Plugins menu item to view the list of plugins you have on your site.

3. Find a plugin that needs updating and click “update now”

Finding a WordPress plugin to update

You’ll notice a plugin that needs updating will have a reddish background, a red bar along the left, and a link to update now.  When you click update, WPEngine will prompt you to take a snapshot backup if you haven’t already:

WPEngine prompting to take a backup on plugin update

Click Yes, take me to my WPEngine Dashboard and login.  You’ll then see a listing of all your backups:

List of WPEngine backup points

Just click Back Up Now to create a new backup point.  Enter a description (ie. “Backup before plugin updates”), and enter your email address to get an email notification once it’s completed.  They’re usually quite fast.

WPEngine create new backup point with email and description

You might want to keep this list of backup points open in case there is an issue with the update, so you can quickly restore if there’s a problem.  Just open a new tab in your web browser and go to yoursite.com/wp-admin again, and click Plugins.

Finally, click update now again on the Plugin that needs an update, click No thanks, I already did this, and the plugin will update and reactivate.  Click Return to Plugins page to go back to the list of Plugins.

Successful WordPress plugin update screen

Be sure to visit your website and click around to make sure all looks well.  If there are any issues with the update, go back to the Backup Points page on my.wpengine.com, put a checkmark beside the backup you created, then click Restore Now.  Your site will be back to how it was, at which point you’ll need to see why the plugin update failed – the person who set up your site or a WordPress developer should be able to help with this.

Restoring from a backup with WPEngine

4. Continue updating all plugins

For future plugins you can click No thanks, I already did this when click update since you have already taken a snapshot.  For each plugin update, go back to the Plugins page and make sure the plugin no longer shows an update now link.  Also, the red number beside Plugins on the left side should go down by one, then disappear once you’ve finished updating all plugins.

 

You’re done!  Be sure to heed recommendations from WPEngine to keep your site secure, and make sure you, your website’s developer, or a service like Maintain or wpcurve are monitoring your plugins for updates on a regular basis.

Why Twitter share is not working with your test server website links

Was trying to wrap my head around why the twitter share URL was not working on the test server, as it would say the tweet is too long even though the url should be shortened by Twitter automatically.  It seemed I had to use wp_get_shortlink() or a bit.ly link rather than the full URL.

Turns out it was due to the URLs being local.wordpress.dev (the default through VVV, a popular local WordPress vagrant script), and Twitter wouldn’t automatically shorten it.

Does not auto shorten with development (.dev) domain
Does not auto shorten with development (.dev) domain
Twitter takes shortened length of URL into account with .com
Twitter takes shortened length of URL into account with .com

 

Not that you should be sharing development URLs anyway, at least now you know it’ll work on a live server.  Unless you have a valid top level domain like .black which Twitter won’t shorten, either.

.black won't get shortened even though it's perfectly valid
.black won’t get shortened even though it’s perfectly valid

WordPress plugins now show active installs instead of downloads

I didn’t see anything come through on make.wordpress.org but now “Active Installs” is shown for plugins in the wordpress.org repository instead of downloads:

Active installs in the WordPress plugin repository

I initially thought this was just because I was logged in but it’s now the default.  You can still see number of downloads by hopping over to the Stats page:

Stats tab showing number of WordPress plugin downloads

I think it was a good move.  Download count says nothing about how many people are actually using the plugin, and wasn’t really a stat you could easily see before without adding your own tracking in.

How does the WPEngine GeoIP service work?

Today WPEngine launched their new GeoIP service, and I was excited to check it out. After doing a presentation on handling Geolocation in WordPress I know it can be a difficult problem to solve at scale, especially with any kind of caching.

The way it works is by having a plugin installed that gives you functions to grab the city, country, and region:

[code lang=”php”]
$geo = WPEngine\GeoIp::instance();
echo "Welcome from {$geo->city()}, {$geo->region()}, {$geo->country()}!";
[/code]

With access to the location in this format, you can start to show specific content or features depending on where the visitor is from.  Someone coming into your store from England?  Show them £ instead of $.  What about Japan?  Default the language to Japanese without asking them.  WPEngine will detect that you’re serving different content for different users, and cache in ‘buckets’ without you having to configure anything.

The service does require a Business level plan or higher, but chances are if you’re serving multiple countries you’d be at that level anyway.

You can view the full FAQ on the new feature.

Discover #HamOnt Podcast

I’m putting together a podcast called the “Discover #HamOnt Podcast,” where I’ll be interviewing a number of groups, businesses and individuals in the #HamOnt area to discover what they’re all about, and why they love it in Hamilton.  I hope those who live, work and play in Hamilton will discover more about the people and businesses around them, along with everyone’s unique perspective on the city.

The podcast page is available at:

discoverhamont.ca

Sign up to be notified when the show launches!