A streamlined, lightweight MP3 player for WordPress with clean design and easy shortcode integration.
Version: 1.0.1
Author: David Armitage - Ambient Technology
License: Apache License 2.0
Website: https://ambient.technology
The MP3 Playback Plugin provides a simple, elegant solution for embedding audio players in WordPress posts and pages. Built with modern web standards and optimized for performance, this plugin offers a clean, minimal interface that integrates seamlessly with any WordPress theme.
- Clean, Minimal Design - 70% width, centered player with no unnecessary elements
- Easy Shortcode Integration - Simple
[mp3_player id="123"]syntax - WordPress Media Library Integration - Upload and select audio files directly
- Custom Post Type - Dedicated "MP3 Players" section in admin
- Responsive Design - Works on all devices and screen sizes
- Accessibility Support - ARIA labels and keyboard navigation
- No External Dependencies - Lightweight and fast
- Theme Compatibility - Built-in CSS fixes for maximum compatibility
- WordPress 5.0 or higher
- PHP 7.4 or higher
- Modern web browser with HTML5 audio support
- Download the plugin ZIP file
- Go to Plugins → Add New in your WordPress admin
- Click "Upload Plugin"
- Choose the ZIP file and click "Install Now"
- Click "Activate Plugin"
- Extract the plugin files
- Upload the
mp3-playback-pluginfolder to/wp-content/plugins/ - Go to Plugins → Installed Plugins
- Find "MP3 Playback Plugin" and click "Activate"
- Go to MP3 Players → Add New in your WordPress admin
- Give your player a title (e.g., "Episode 1 - Introduction")
- In the MP3 Player Settings section:
- Click "Select Audio File" to choose an MP3 from your media library
- Configure player options (Autoplay, Loop, Show Controls)
- Publish the player
- Copy the generated shortcode from the Shortcode sidebar
[mp3_player id="123"]
[mp3_player id="123" autoplay="1" loop="1" controls="1" width="80%" height="50px"]
[mp3_player file="https://example.com/audio.mp3"]
| Parameter | Type | Default | Description |
|---|---|---|---|
id |
integer | - | MP3 Player post ID |
file |
string | - | Direct audio file URL |
autoplay |
string | - | Enable autoplay (1/0) |
loop |
string | - | Enable loop (1/0) |
controls |
string | 1 | Show controls (1/0) |
width |
string | 70% | Player width |
height |
string | auto | Player height |
The plugin adds a dedicated "MP3 Players" menu item to your WordPress admin with:
- List View - See all players with shortcodes and file information
- Add New - Create new MP3 players
- Bulk Actions - Manage multiple players at once
Each MP3 player can be configured with:
- Audio File - Select from WordPress media library
- Autoplay - Start playing automatically when page loads
- Loop - Repeat audio when finished
- Show Controls - Display native browser controls
Every player automatically generates a shortcode that can be:
- Copied with one click
- Used in any post or page
- Customized with additional parameters
The plugin includes built-in CSS for theme compatibility. To customize further, add CSS to your theme:
/* Custom player styling */
.mp3-player-container {
background: #f8f9fa;
padding: 20px;
border-radius: 8px;
}
.mp3-player-audio {
width: 100% !important;
height: 50px !important;
}The plugin includes JavaScript for enhanced functionality. Custom scripts can be added to your theme:
// Custom audio player events
document.addEventListener('DOMContentLoaded', function() {
const audioPlayers = document.querySelectorAll('.mp3-player-audio');
audioPlayers.forEach(function(player) {
player.addEventListener('play', function() {
console.log('Audio started playing');
});
});
});mp3-playback-plugin/
├── mp3-playback-plugin.php # Main plugin file
├── README.md # This file
├── LICENSE # Apache 2.0 License
├── assets/ # Plugin images and graphics
│ ├── icon.svg # Plugin icon (SVG)
│ ├── banner-description.txt # Banner image specifications
│ └── screenshot-description.txt # Screenshot specifications
├── includes/
│ ├── class-admin.php # Admin functionality
│ ├── class-shortcode.php # Shortcode handling
│ ├── class-public.php # Frontend functionality
│ └── class-media-integration.php # Media library integration
├── admin/
│ └── js/
│ └── admin.js # Admin JavaScript
└── public/
└── js/
└── player.js # Frontend JavaScript
mp3_player_before_render- Fired before player HTML is generatedmp3_player_after_render- Fired after player HTML is generatedmp3_player_audio_loaded- Fired when audio file is loaded
mp3_player_default_settings- Modify default player settingsmp3_player_shortcode_output- Modify shortcode HTML outputmp3_player_audio_attributes- Modify audio element attributes
// Add custom CSS to player
add_action('mp3_player_after_render', function($player_id, $html) {
echo '<style>.mp3-player-container { border: 2px solid #007cba; }</style>';
}, 10, 2);
// Modify default settings
add_filter('mp3_player_default_settings', function($settings) {
$settings['width'] = '80%';
return $settings;
});Player not visible:
- Check if your theme has CSS conflicts
- Verify the audio file URL is accessible
- Try refreshing the page
Audio doesn't play:
- Check browser console for errors
- Verify audio file format (MP3 recommended)
- Test audio file URL directly in browser
Shortcode not working:
- Verify the player ID exists
- Check if the player has an audio file selected
- Ensure the shortcode syntax is correct
For administrators, the plugin includes debug information when needed. Check the browser console for any JavaScript errors.
- Lightweight - No external dependencies
- Optimized CSS - Minimal, efficient styles
- Lazy Loading - Scripts only load when needed
- Caching Friendly - Compatible with caching plugins
- Nonce Verification - All admin actions are secured
- Input Sanitization - All user inputs are sanitized
- Capability Checks - Proper WordPress permissions
- XSS Protection - Output is properly escaped
- Initial release
- Basic MP3 player functionality
- WordPress media library integration
- Shortcode support
- Admin interface
- Responsive design
- Theme compatibility fixes
For support, feature requests, or bug reports:
- Website: https://ambient.technology
- Author: David Armitage
- Company: Ambient Technology
This plugin is licensed under the Apache License 2.0. See the LICENSE file for details.
- Commercial Use - Allowed
- Modification - Allowed
- Distribution - Allowed
- Patent Use - Allowed
- Private Use - Allowed
Limitations:
- Liability - No warranty provided
- Trademark Use - Not allowed
- Developer: David Armitage
- Company: Ambient Technology
- Website: https://ambient.technology
- License: Apache License 2.0
Made with ❤️ by Ambient Technology