YouTube Channel - Version 3.0.2

Version Description

(2015-05-10) = * Fix: (typo - experiencing on frontend when no API Key set) PHP Fatal error: Call to undefined function __sprintf() in youtube-channel.php on line 445 * Fix: shortcode deprecated params res and show not backward compatibile

Download this release

Release Info

Developer urkekg
Plugin Icon YouTube Channel
Version 3.0.2
Comparing to
See all releases

Code changes from version 3.0.1 to 3.0.2

Files changed (2) hide show
  1. readme.txt +5 -1
  2. youtube-channel.php +16 -5
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: youtube, channel, playlist, single, widget, widgets, youtube player, flash player, rss, feed, video, thumbnail, embed, sidebar, chromeless, iframe, html5, responsive
5
  Requires at least: 3.9.0
6
  Tested up to: 4.2.2
7
- Stable tag: 3.0.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -195,6 +195,10 @@ Also, even when hidding logo works for your video, on hover or when video is pau
195
 
196
  == Changelog ==
197
 
 
 
 
 
198
  = 3.0.1 (2015-05-10) =
199
  * Fix: Fatal error: Using $this when not in object context in youtube-channel.php on line 89
200
  * Fix: Link to channel not visible on Twenty Fifteen theme
4
  Tags: youtube, channel, playlist, single, widget, widgets, youtube player, flash player, rss, feed, video, thumbnail, embed, sidebar, chromeless, iframe, html5, responsive
5
  Requires at least: 3.9.0
6
  Tested up to: 4.2.2
7
+ Stable tag: 3.0.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
195
 
196
  == Changelog ==
197
 
198
+ = 3.0.2 (2015-05-10) =
199
+ * Fix: (typo - experiencing on frontend when no API Key set) PHP Fatal error: Call to undefined function __sprintf() in youtube-channel.php on line 445
200
+ * Fix: shortcode deprecated params `res` and `show` not backward compatibile
201
+
202
  = 3.0.1 (2015-05-10) =
203
  * Fix: Fatal error: Using $this when not in object context in youtube-channel.php on line 89
204
  * Fix: Link to channel not visible on Twenty Fifteen theme
youtube-channel.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: YouTube Channel
4
  Plugin URI: http://urosevic.net/wordpress/plugins/youtube-channel/
5
  Description: <a href="widgets.php">Widget</a> that display latest video thumbnail or iframe (HTML5) video from YouTube Channel, Liked Videos, Favourites or Playlist.
6
  Author: Aleksandar Urošević
7
- Version: 3.0.1
8
  Author URI: http://urosevic.net/
9
  */
10
  // @TODO make FitVideo optional
@@ -18,7 +18,7 @@ if ( !class_exists('WPAU_YOUTUBE_CHANNEL') )
18
  {
19
 
20
  const DB_VER = 3;
21
- const VER = '3.0.1';
22
 
23
  public $plugin_name = "YouTube Channel";
24
  public $plugin_slug = "youtube-channel";
@@ -386,6 +386,15 @@ function ytc_mute(event){
386
  )
387
  );
388
 
 
 
 
 
 
 
 
 
 
389
  // prepare instance for output
390
  $instance['vanity'] = $vanity;
391
  $instance['channel'] = $channel;
@@ -441,14 +450,16 @@ function ytc_mute(event){
441
  // and "Coming soon..." for visitors
442
  if ( ! defined('YOUTUBE_DATA_API_KEY') ) {
443
  if ( current_user_can('manage_options') ) {
444
- return array(
445
- __sprintf('<strong>%s</strong> version 3+ requires <strong>YouTube DATA API Key</strong> to work. <a href="%s" target="_blank">Learn more here</a>.', 'youtube-channel'),
446
  $this->plugin_name,
447
  'http://urosevic.net/wordpress/plugins/youtube-channel/#youtube_data_api_key'
448
  );
 
449
  } else {
450
- return array("Coming soon...");
451
  }
 
452
  }
453
 
454
  // 1) Get resource from widget/shortcode
4
  Plugin URI: http://urosevic.net/wordpress/plugins/youtube-channel/
5
  Description: <a href="widgets.php">Widget</a> that display latest video thumbnail or iframe (HTML5) video from YouTube Channel, Liked Videos, Favourites or Playlist.
6
  Author: Aleksandar Urošević
7
+ Version: 3.0.2
8
  Author URI: http://urosevic.net/
9
  */
10
  // @TODO make FitVideo optional
18
  {
19
 
20
  const DB_VER = 3;
21
+ const VER = '3.0.2';
22
 
23
  public $plugin_name = "YouTube Channel";
24
  public $plugin_slug = "youtube-channel";
386
  )
387
  );
388
 
389
+ // backward compatibility for show -> display shortcode parameter
390
+ if ( $show !== $display && $show !== $instance['display'] ) {
391
+ $display = $show;
392
+ }
393
+ // backward compatibility for res -> resource shortcode parameter
394
+ if ( $res !== $resource && $res !== $instance['resource'] ) {
395
+ $resource = $res;
396
+ }
397
+
398
  // prepare instance for output
399
  $instance['vanity'] = $vanity;
400
  $instance['channel'] = $channel;
450
  // and "Coming soon..." for visitors
451
  if ( ! defined('YOUTUBE_DATA_API_KEY') ) {
452
  if ( current_user_can('manage_options') ) {
453
+ $output[] = sprintf(
454
+ __('<strong>%s</strong> version 3+ requires <strong>YouTube DATA API Key</strong> to work. <a href="%s" target="_blank">Learn more here</a>.', 'youtube-channel'),
455
  $this->plugin_name,
456
  'http://urosevic.net/wordpress/plugins/youtube-channel/#youtube_data_api_key'
457
  );
458
+
459
  } else {
460
+ $output[] = "Coming soon...";
461
  }
462
+ return $output;
463
  }
464
 
465
  // 1) Get resource from widget/shortcode