Title: BarkingLlama Roulette
Author: grandllama
Published: <strong>March 16, 2026</strong>
Last modified: March 16, 2026

---

Search plugins

![](https://ps.w.org/barkingllama-roulette/assets/banner-772x250.png?rev=3483949)

![](https://ps.w.org/barkingllama-roulette/assets/icon.svg?rev=3483949)

# BarkingLlama Roulette

 By [grandllama](https://profiles.wordpress.org/grandllama/)

[Download](https://downloads.wordpress.org/plugin/barkingllama-roulette.1.0.4.zip)

 * [Details](https://test.wordpress.org/plugins/barkingllama-roulette/#description)
 * [Reviews](https://test.wordpress.org/plugins/barkingllama-roulette/#reviews)
 *  [Installation](https://test.wordpress.org/plugins/barkingllama-roulette/#installation)
 * [Development](https://test.wordpress.org/plugins/barkingllama-roulette/#developers)

 [Support](https://wordpress.org/support/plugin/barkingllama-roulette/)

## Description

BarkingLlama Roulette adds a simple shortcode and REST endpoint that selects a random
YouTube video from a configured playlist and embeds it on your site.

Perfect for motivational cards as Shorts, “daily randomness” pages, or any curated
playlist you want to keep fresh.

Features:
 * Shortcode: [llama_roulette] * REST endpoint: /wp-json/llama-roulette/
v1/random * Playlist caching via transients to reduce YouTube API calls * Optional
Privacy Enhanced Mode (youtube-nocookie embeds) * “Start Muted” setting for reliable
autoplay

### External services

This plugin uses the YouTube Data API v3 (Google) to retrieve videos from the configured
YouTube playlist so it can select and display a random video.

What data is sent and when:
 * The configured playlist ID (or playlist ID parsed
from a provided playlist URL) is sent when the plugin requests playlist items. *
The configured YouTube API key is sent with those API requests for authentication.*
These requests occur when cached playlist data is missing or expired, or when playlist
data must be refreshed.

Service provider:
 * Google / YouTube Data API v3

Terms of Service and Privacy Policy:
 * Google API Services Terms of Service: https://
developers.google.com/terms/ * YouTube API Services Terms of Service: https://developers.
google.com/youtube/terms/api-services-terms-of-service * Google Privacy Policy: 
https://policies.google.com/privacy

### Shortcode

Basic:
 [llama_roulette]

Available attributes:
 * `button_label` – Custom label for the trigger button (e.
g., `button_label="Try Luck"`). * `playlist` – Optional YouTube Playlist ID or URL
to override the global setting. * `autoplay` – Set to `1` to auto-load/play, `0`
to wait for click. * `muted` – Set to `1` to start muted, `0` for sound (Note: browsers
block unmuted autoplay). * `show_title` – Set to `1` to show the video title below
the player, `0` to hide. * `align` – `left`, `center`, or `right`. * `max_width`–
Any CSS width value (e.g., `max_width="800px"`). * `aspect_ratio` – CSS aspect-ratio(
e.g., `16/9`, `4/3`). * `class` – Append custom CSS classes.

Example:
 [llama_roulette playlist=”PLxxxx” button_label=”Spin!” autoplay=”1″ muted
=”1″ show_title=”1″]

### REST API

GET /wp-json/llama-roulette/v1/random

Optional query param:
 * playlist (Playlist ID or URL) to override the configured
playlist for that request

Example:
 GET /wp-json/llama-roulette/v1/random?playlist=PLabc123

### License

This plugin is licensed under the GPLv2 or later.

## Screenshots

 * [[
 * Settings page (playlist, API key, cache, privacy, display settings)
 * [[
 * Front-end embed with “Spin again” button and video title

## Installation

 1. Upload the plugin folder to /wp-content/plugins/ or install via the Plugins screen.
 2. Activate the plugin.
 3. Go to Settings  BarkingLlama Roulette.
 4. Enter:
 5.  * Playlist URL or ID
     * YouTube API Key
 6. Add the shortcode [llama_roulette] to any post or page.

## FAQ

### Do I need a YouTube API key?

Yes for v1. BarkingLlama Roulette uses the YouTube Data API to fetch playlist items.
The plugin caches results to reduce quota usage.

### How do I find my Playlist ID?

If your playlist URL looks like:
  …the playlist ID is the value after “list=”.

### Does it work on mobile?

Yes. It uses a standard YouTube embed iframe.

### How do I use Privacy Enhanced Mode?

Enable “Privacy Enhanced Mode” in Settings  BarkingLlama Roulette to embed using
youtube-nocookie.com.

### Why does autoplay not work with sound?

Modern browsers block videos from autoplaying with sound on initial load unless 
a user has interacted with the page first. For reliable autoplay, enable the “Default
Muted” setting.

### How do I get a YouTube Data API key?

BarkingLlama Roulette uses the YouTube Data API to retrieve videos from your playlist.
Google requires an API key for this.

Follow these steps:

 1.  Go to the Google Cloud Console:
      https://console.cloud.google.com/
 2.  Sign in with the Google account that owns (or can access) the YouTube playlist.
 3.  Create a new project:
 4.   * Click the project dropdown at the top
      * Click “New Project”
      * Give it any name (for example: “BarkingLlama Roulette”)
      * Click Create
 5.  Enable the YouTube Data API:
 6.   * With your project selected, go to:
         APIs & Services  Library
      * Search for “YouTube Data API v3”
      * Click it, then click “Enable”
 7.  Create an API key:
 8.   * Go to:
         APIs & Services  Credentials
      * Click “Create Credentials”
      * Choose “API key”
      * Copy the generated key
 9.  (Optional but recommended) Restrict the API key:
 10.  * In the Credentials screen, click your new API key
      * Under “API restrictions”, select “Restrict key”
      * Choose “YouTube Data API v3”
      * Save changes
 11. Paste the API key into WordPress:
 12.  * Go to Settings  BarkingLlama Roulette
      * Paste the key into the “YouTube API Key” field
      * Save changes

That’s it. BarkingLlama Roulette will automatically cache playlist data to minimize
API usage.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“BarkingLlama Roulette” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ grandllama ](https://profiles.wordpress.org/grandllama/)

[Translate “BarkingLlama Roulette” into your language.](https://translate.wordpress.org/projects/wp-plugins/barkingllama-roulette)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/barkingllama-roulette/),
check out the [SVN repository](https://plugins.svn.wordpress.org/barkingllama-roulette/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/barkingllama-roulette/)
by [RSS](https://plugins.trac.wordpress.org/log/barkingllama-roulette/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.4

 * FIX: Generic bugs
 * TESTED: Up to 7.0

#### 1.0.2

 * FEATURE: Added “Show Video Title” option in admin settings and shortcode.
 * FEATURE: Added `playlist` attribute to shortcode for per-instance overrides.
 * FIX: Improved shortcode initialization and reliability for multiple instances.
 * FIX: Added automatic cache refresh when switching to title-inclusive data format.

#### 1.0.1

 * SECURITY: Added output escaping for all template variables.
 * SECURITY: Improved redirect logic with `wp_safe_redirect`.
 * FIX: Endpoint button label now respects default settings.
 * FEATURE: Added “Start Muted” setting for reliable autoplay.
 * FEATURE: Added `muted` attribute to shortcode.
 * FIX: Improved shortcode attribute reliability via data attributes.

#### 1.0.0

 * Initial release: shortcode + REST endpoint + playlist caching + privacy mode

## Meta

 *  Version **1.0.4**
 *  Last updated **2 months ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.0 or higher **
 *  Tested up to **7.0**
 *  PHP version ** 7.4 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/barkingllama-roulette/)
 * Tags
 * [playlist](https://test.wordpress.org/plugins/tags/playlist/)[random](https://test.wordpress.org/plugins/tags/random/)
   [shortcode](https://test.wordpress.org/plugins/tags/shortcode/)[video](https://test.wordpress.org/plugins/tags/video/)
   [youtube](https://test.wordpress.org/plugins/tags/youtube/)
 *  [Advanced View](https://test.wordpress.org/plugins/barkingllama-roulette/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/barkingllama-roulette/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/barkingllama-roulette/reviews/)

## Contributors

 *   [ grandllama ](https://profiles.wordpress.org/grandllama/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/barkingllama-roulette/)