I’ve recommended the WPAudio plugin for placing easily playable and downloadable audio files on your WordPress site. But with the release of WordPress 3.2 in 2011, the plugin stopped working on many sites (including mine).
In this post, I’ll show you how to get this plugin working again.
Fair warning: This fix involves directly editing the plugin’s source code. I’ve provided all the necessary code so you can just copy and paste. This has worked on all the sites I’ve tried it on, but it’s possible that it won’t work for you — you might have a different hosting setup or a plugin conflict that I haven’t run across.
But even if this fix doesn’t take, really, the worst that can happen is that your copy of the WPAudio plugin still won’t work. What I mean is, a copy-paste mistake isn’t going to break your entire site or erase your database or anything disastrous like that.
Why you might not want to fix this plugin at all
I chose to research the fix because I like to know how things work, I’ve got a hardcore DIY streak, and I’m stubborn — I like the way WPAudio looks and works and I just don’t want to switch, doggone it.
However, I fully realize that I might be in a tiny minority here and thatÂ you might decide that it’s just easier and simpler to switch to a different audio playerÂ on your WordPress site. And that is totally OK (I’m actually researching some WPAudio alternatives and will post about those later this week).
One big reason to switch to a different plugin is that WPAudio’s author is no longer supporting it or releasing new versions. WordPress will continue to change and improve, and it’s very possible that future versions of WordPress will break this plugin again. So this code fix is a bit like wrapping a frayed wire with electrical tape — a temporary measure that’s fine for now but not built to last.
Still here? On with the tinkering!
Step 1: Download these two text files. You’ll need to copy and paste their contents later in these instructions. Right-click (on a PC) or CTRL-click (on a Mac) the filename, and choose “Save Link As” or the closest equivalent.
Step 2. Open the files in a text editor (Notepad, TextEdit, or the like). Because they have the .txt suffix, they may automatically open with the right application if you simply double-click them.
Step 3. In your WordPress dashboard, go to Plugins –> Editor.Â
Step 4. Choose “WPaudio” in the drop-down list at the top right corner of your Plugin Editor screen. When you first arrive at this screen, it will show the first plugin in alphabetical order (often Akismet). After you select WPaudio, click the “Select” button next to the drop-down menu and you will then see a list of that plugin’s source files.
Step 5. In this list, click the link labeled “wpaudio-mp3-player/wpaudio.js” to display the contents of that file in the editing pane. It should begin with these lines:
/* * WPaudio v3.1 (http://wpaudio.com) * by Todd Iceton (firstname.lastname@example.org) * * Converts an mp3 link to a simple player styled by HTML & CSS, powered by HTML5 with SoundManager2 Flash fallback
Step 6. Copy the entire contents of the first text file you downloaded — the one called wpaudio.js.txt — and replace the entire contents of the wpaudio.js file onscreen with your copied text. You want to completely overwrite the file contents, so in the WordPress Editor screen you can either Select All and Paste, or Select All and Delete before Pasting.
Step 7. Click the blue “Update File” button at the bottom of your screen. You should see a success message appear at the top of your screen that reads “File updated successfully.”
Step 8. Repeat steps 5, 6, and 7 with the file named wpaudio.min.js. You’ve just replaced the entire contents of two of the plugin’s source files, and saved your changes. Your site is still there, right? No smoke coming out of your hard drive? Good! On to the final step:
Step 9. Go to Settings –> WPaudio, and click the blue “Save Changes” button at the bottom of the screen. It’s a good idea to check the settings to make sure they’re correct, but go ahead and click the blue button even if you don’t make any changes. This is similar to refreshing a web page to get the latest version — you want your copy of the plugin to read the new code you added.
Now go test one of your audio files on your site. Fingers crossed that it plays the way it is supposed to! And if not, stay tuned for my upcoming post on audio player alternatives (you can subscribe to get updates in your inbox or grab the RSS feed to get it in your reader). And feel free to leave a comment if you have a favorite WordPress audio plugin, too!
It’s important to note that I didn’t do this coding work on my own. All the code fixes came from helpful users on the WordPress.org support forum; I’m merely trying to let more people know about these fixes, and maybe make them a bit less scary to implement. Here are the original posts describing the code changes:
- WordPress.org support forum post with code fixes from forum user rahul286
- WordPress.org support forum post with code fixes from forum user waffl
- WordPress.org support forum post with code fixes from forum user Ursula (aka WP Gal)