Skip to content

Commit

Permalink
Merge pull request #26 from macbookandrew/release/1.10.0
Browse files Browse the repository at this point in the history
release 1.10.0
  • Loading branch information
macbookandrew authored Jan 16, 2024
2 parents aea90c3 + 2b348e2 commit 0c5180e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 15 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# WP YouTube Live #
**Contributors:** [macbookandrew](https://profiles.wordpress.org/macbookandrew)
**Donate link:** https://cash.me/$AndrewRMinionDesign
**Tags:** youtube, live, video, embed
**Requires at least:** 3.6
**Tested up to:** 6.3.2
**Stable tag:** 1.9.0
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
**Contributors:** [macbookandrew](https://profiles.wordpress.org/macbookandrew)
**Donate link:** https://cash.me/$AndrewRMinionDesign
**Tags:** youtube, live, video, embed
**Requires at least:** 3.6
**Tested up to:** 6.3.2
**Stable tag:** 1.10.0
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Displays the current YouTube live video from a specified channel.

Expand All @@ -26,7 +26,7 @@ If no live video is available, you can display a specified video or a “channel

You can also enable auto-refresh to automatically check for a live video every 30 seconds (warning: will increase server load, so use with caution).

By default, the server will check YouTube’s API and then cache that response for 30 seconds before checking the API again. If auto-refresh is enabled, clients will check against your server every 30 seconds and likely will hit that cache as well, so it can potentially take up to 60 seconds before a client will get a live video.
By default, the server will check YouTube’s API and then cache that response for 15 minutes before checking the API again (you may change this value in the admin settings). If auto-refresh is enabled, clients will check against your server every 30 seconds and likely will hit that cache as well, so it can potentially take up to 16 minutes before a client will get a live video.

The length of both caches can be changed using the `wp_youtube_live_transient_timeout` filter (see below for more information).

Expand Down Expand Up @@ -180,6 +180,11 @@ Because this plugin helps you use the YouTube service, you should refer to these

## Changelog ##

### 1.10.0 ###
- Fix `show_related` parameter
- Fix debug output
- Add capability checking to see debug output

### 1.9.0 ###
- Add YouTube Terms of Service and Google Privacy Policy

Expand Down
14 changes: 13 additions & 1 deletion inc/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,20 @@ function youtube_live_debugging_render() {
if ( ! array_key_exists( 'debugging', $options ) ) {
$options['debugging'] = false;
}

/**
* Filters the capability required to see debug output.
*
* @since 1.10.0
*
* @var string $capability The capability required.
*
* @return string
*/
$capability = apply_filters( 'wp_youtube_live_debug_user_capability', 'manage_options' );

?>
Show debugging information in an HTML comment for logged-in users? <label><input type="radio" name="youtube_live_settings[debugging]" value="true" <?php checked( $options['debugging'], 'true' ); ?>> Yes</label> <label><input type="radio" name="youtube_live_settings[debugging]" value="false" <?php checked( $options['debugging'], 'false' ); ?>> No</label>
Show debugging information in an HTML comment for logged-in users with the <code><?php echo esc_attr( $capability ); ?></code> capability? <label><input type="radio" name="youtube_live_settings[debugging]" value="true" <?php checked( $options['debugging'], 'true' ); ?>> Yes</label> <label><input type="radio" name="youtube_live_settings[debugging]" value="false" <?php checked( $options['debugging'], 'false' ); ?>> No</label>
<?php
}

Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://cash.me/$AndrewRMinionDesign
Tags: youtube, live, video, embed
Requires at least: 3.6
Tested up to: 6.3.2
Stable tag: 1.9.0
Stable tag: 1.10.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -26,7 +26,7 @@ If no live video is available, you can display a specified video or a “channel

You can also enable auto-refresh to automatically check for a live video every 30 seconds (warning: will increase server load, so use with caution).

By default, the server will check YouTube’s API and then cache that response for 30 seconds before checking the API again. If auto-refresh is enabled, clients will check against your server every 30 seconds and likely will hit that cache as well, so it can potentially take up to 60 seconds before a client will get a live video.
By default, the server will check YouTube’s API and then cache that response for 15 minutes before checking the API again (you may change this value in the admin settings). If auto-refresh is enabled, clients will check against your server every 30 seconds and likely will hit that cache as well, so it can potentially take up to 16 minutes before a client will get a live video.

The length of both caches can be changed using the `wp_youtube_live_transient_timeout` filter (see below for more information).

Expand Down Expand Up @@ -178,6 +178,11 @@ Because this plugin helps you use the YouTube service, you should refer to these

== Changelog ==

= 1.10.0 =
- Fix `show_related` parameter
- Fix debug output
- Add capability checking to see debug output

= 1.9.0 =
- Add YouTube Terms of Service and Google Privacy Policy

Expand Down
17 changes: 14 additions & 3 deletions wp-youtube-live.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: YouTube Live
* Plugin URI: https://github.com/macbookandrew/wp-youtube-live
* Description: Displays the current YouTube live video from a specified channel
* Version: 1.9.0
* Version: 1.10.0
* Author: Andrew Minion
* Author URI: https://andrewrminion.com/
*/
Expand All @@ -12,7 +12,7 @@
exit;
}

define( 'WP_YOUTUBE_LIVE_VERSION', '1.9.0' );
define( 'WP_YOUTUBE_LIVE_VERSION', '1.10.0' );

/**
* Include admin.
Expand Down Expand Up @@ -187,8 +187,19 @@ function get_youtube_live_content( $request_options ) {
}
}

/**
* Filters the capability required to see debug output.
*
* @since 1.10.0
*
* @var string $capability The capability required.
*
* @return string
*/
$capability = apply_filters( 'wp_youtube_live_debug_user_capability', 'manage_options' );

// debugging.
if ( 'true' === $youtube_options['debugging'] && is_user_logged_in() ) {
if ( 'true' === $youtube_options['debugging'] && is_user_logged_in() && current_user_can( $capability ) ) {
if ( $youtube_live->getErrorMessage() ) {
$error_message = '<p><strong>WP YouTube Live error:</strong></p>
<ul>';
Expand Down

0 comments on commit 0c5180e

Please sign in to comment.