A WordPress plugin to integrate PeerTube videos with shortcodes. Displays videos, channels, search and custom metadata including send responsibility.
Original German Repository: https://github.com/yarkolife/wp-peertube-plugin
- 4 shortcodes for different video views
- Intelligent caching for optimal performance
- Responsive Design for all screen sizes
- Custom metadata from PeerTube plugins
- Search with pagination
- Configurable backend with settings page
- German translation included
- WordPress 6.0 or higher
- PHP 7.4 or higher
- PeerTube instance (API access)
- Download the ZIP file.
- Go to
Plugins > Install > Upload Plugin - Select the ZIP file
- Click βInstall Nowβ
- Activate the plugin
cd wp-content/plugins/
git clone https://github.com/stevespaw/wp-peertube-plugin.git peertube-video-manager- Upload the plugin files to
/wp-content/plugins/peertube-video-manager/ - Activate the plugin from the 'Plugins' menu in WordPress
Once activated, go to Settings > PeerTube Videos:
- PeerTube instance URL: The URL of your PeerTube instance (e.g.
https://video.media.com) - Standard Channels: List of channel handles (one per line)
- Cache Times: How long data is cached
- Videos per page: Default number of videos displayed
Displays the latest videos of the instance.
Attributes:
count(optional, default: 8) - number of videoshost_only(optional, default: "true") - Local videos only
Examples:
[pt-last-videos]
[pt-last-videos count="12"]
[pt-last-videos count="6" host_only="false"]
Displays the latest video from each channel.
Attributes:
channels(optional) - Comma separated list of channel handles
Examples:
[pt-latest-per-channel]
[pt-latest-per-channel channels="my_channel,joe_channel,okmq"]
If no channels attribute is specified, the plugin will use the default channels from the settings.
Shows videos from a specific channel.
Attributes:
channel(required) - Channel handlecount(optional, default: 6) - number of videos
Examples:
[pt-channel-videos channel="okmq"]
[pt-channel-videos channel="my_channel" count="10"]
Displays a single video with all details.
Attributes:
id- Video UUID or shortUUIDnumber- video number (from plugin data)
Examples:
[pt-video id="xc86cB87iZXsgCofjHVcYJ"]
[pt-video number="12345"]
Note: Either id or number must be specified.
Displays a search form.
Attributes:
placeholder(optional) - placeholder textaction(optional) - Destination URL for search results
Examples:
[pt-search]
[pt-search placeholder="Search videos..."]
[pt-search action="/search results/"]
Displays search results with pagination.
Attributes:
per_page(optional, default: 12) - Videos per page
Examples:
[pt-search-results]
[pt-search-results per_page="20"]
The following information is displayed for each video:
- Thumbnail - Video thumbnail
- Title - Video name
- Length - Duration of the video (β±)
- Category - Video Category (π·)
- Publication Date - Relative Date (π )
- Views - Number of views (π)
- Sending Responsibility - From PeerTube plugin (π€)
- Video Number - From PeerTube plugin (π’)
- Tags - Up to 5 tags per video
The plugin uses WordPress Transients for caching:
- Video Lists: 5 minutes (configurable)
- Configuration: 24 hours (configurable)
- Individual Videos: 10 minutes
- Search results: 2 minutes
To clear the cache, go to Settings > PeerTube Videos and click Clear Cache.
- Respects PeerTube API rate limits (50 requests/10 seconds)
- Intelligent caching reduces API calls
- Lazy loading for images
- Responsive CSS grid for optimal display
You can override the styles by adding your own CSS rules in your theme:
/* Example: Adjust video cards */
.pt-video-card {
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}Copy the template files from templates/ into your theme directory:
your-theme/peertube-video-manager/video-card.php
your-theme/peertube-video-manager/video-detail.php
your-theme/peertube-video-manager/search-form.php
- Check the PeerTube URL in Settings
- Click on βTest connectionβ
- Clear the cache
- Check the browser console for errors
Clear the cache via Settings > PeerTube Videos > Clear Cache.
Make sure the PeerTube URL is correct and the videos are publicly accessible.
- Reduce the number of videos per page
- Increase cache time
- Check the connection to the PeerTube instance
peertube video manager/
βββ peertube-video-manager.php # Main file
βββ includes/ # Core classes
βββ shortcodes/ # Shortcode classes
βββ templates/ # Template files
βββ assets/ # CSS & JS
βββ languages/ # Translations
The plugin offers various hooks for developers:
// Filter video data before rendering
add_filter('pt_vm_video_data', function($video) {
// Modify video data
return $video;
});
// Action after clearing the cache
add_action('pt_vm_cache_cleared', function() {
// Do something
});- First release
- 4 shortcodes implemented
- Caching system
- Admin settings page
- German translation
If you have any questions or problems:
- Check the Documentation
- Enable WP_DEBUG for detailed errors
- Create an Issue on GitHub
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
GPL v2 or higher
Designed to integrate PeerTube videos into WordPress. Supports custom plugin data from peertube-plugin-okas-dev.
The plugin uses the following PeerTube API endpoints:
GET /api/v1/videos- List of all videosGET /api/v1/videos/{id}- Single videoGET /api/v1/video-channels/{handle}/videos- Channel videosGET /api/v1/search/videos- Video searchGET /api/v1/config- Instance configuration
- All user input is sanitized
- Expenses are escaped
- Nonces for AJAX requests
- Capability checks for admin functions
- CORS compliant API requests
- Chrome/Edge (Chromium) β
- Firefox β
- Safari β
- Mobile browsers β
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a pull request
Developed with β€οΈ for the PeerTube community