Youtube Channel Gallery - Version 1.8.6

Version Description

  • Check accounts suspended.
  • SSL support (checks if HTTPS or on Port 443). Be aware that the YouTube player is not fully compatible with SSL. See HTTPS Support for YouTube Embeds
  • Changes in CSS to correct IE support.
Download this release

Release Info

Developer javitxu123
Plugin Icon 128x128 Youtube Channel Gallery
Version 1.8.6
Comparing to
See all releases

Code changes from version 1.8.5 to 1.8.6

admin-scripts.js CHANGED
File without changes
admin-styles.css CHANGED
File without changes
img/play.png CHANGED
File without changes
languages/youtube-channel-gallery-es_ES.mo CHANGED
File without changes
languages/youtube-channel-gallery-es_ES.po CHANGED
File without changes
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://poselab.com/
4
  Tags: widget, gallery, youtube, channel, user, sidebar, video, youtube playlist, html5, iframe, Youtube channel, youtube videos
5
  Requires at least: 2.8
6
  Tested up to: 3.5.1
7
- Stable tag: 1.8.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -121,6 +121,14 @@ This will happen if your playlist has more than 1000 videos because YouTube API
121
 
122
  If another plugin or your theme throws a javascript error before Youtube Channel Gallery has been executed, it will prevent Youtube Channel Gallery JavaScript from functioning properly, so thumbnails links will go to the YouTube page instead of playing the video in the player.
123
 
 
 
 
 
 
 
 
 
124
 
125
 
126
  == Screenshots ==
@@ -134,6 +142,11 @@ If another plugin or your theme throws a javascript error before Youtube Channel
134
 
135
  == Changelog ==
136
 
 
 
 
 
 
137
  = 1.8.5 =
138
  * Added option to show only thumbnails without player.
139
  * Added option to add target="_blank" to thumbnails if the option without player is selected.
4
  Tags: widget, gallery, youtube, channel, user, sidebar, video, youtube playlist, html5, iframe, Youtube channel, youtube videos
5
  Requires at least: 2.8
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.8.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
121
 
122
  If another plugin or your theme throws a javascript error before Youtube Channel Gallery has been executed, it will prevent Youtube Channel Gallery JavaScript from functioning properly, so thumbnails links will go to the YouTube page instead of playing the video in the player.
123
 
124
+ = The plugin throws the following error in the error console of Google Chrome: Blocked a frame with origin "http://www.youtube.com" from accessing a frame with origin "http://myweb.com". Protocols, domains, and ports must match. =
125
+
126
+ I think this is a browser error because this also happens to players that can be seen in https://developers.google.com/youtube/.
127
+
128
+ = If the plugin is used on a page using SSL, the player will throw warnings in the browser console =
129
+
130
+ See [HTTPS Support for YouTube Embeds](http://apiblog.youtube.com/2011/02/https-support-for-youtube-embeds.html):
131
+ "The actual video bitstream, and some additional content loaded by the YouTube player may still be accessed via standard HTTP connections when you use an HTTPS URL in your embed code."
132
 
133
 
134
  == Screenshots ==
142
 
143
  == Changelog ==
144
 
145
+ = 1.8.6 =
146
+ * Check accounts suspended.
147
+ * SSL support (checks if HTTPS or on Port 443). Be aware that the YouTube player is not fully compatible with SSL. See [HTTPS Support for YouTube Embeds](http://apiblog.youtube.com/2011/02/https-support-for-youtube-embeds.html)
148
+ * Changes in CSS to correct IE support.
149
+
150
  = 1.8.5 =
151
  * Added option to show only thumbnails without player.
152
  * Added option to add target="_blank" to thumbnails if the option without player is selected.
scripts.js CHANGED
@@ -1,10 +1,16 @@
 
 
 
 
 
 
1
  jQuery(document).ready(function($) {
2
 
3
  //thumbnails
4
  var ytcplayer = {};
5
  $('.ytclink').click(function(){
6
  var iframeid = $(this).attr('data-playerid');
7
- var youtubeid = $(this).attr('href').split("youtu.be/")[1];
8
  var quality = $(this).attr('data-quality');
9
  checkIfInView($('#' + iframeid));
10
  ytcplayVideo (iframeid, youtubeid, quality);
1
+ /*------------------------------------------------------------
2
+ Plugin Name: Youtube Channel Gallery
3
+ Plugin URI: http://www.poselab.com/
4
+ Version: 1.8.6
5
+ Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
+ ------------------------------------------------------------*/
7
  jQuery(document).ready(function($) {
8
 
9
  //thumbnails
10
  var ytcplayer = {};
11
  $('.ytclink').click(function(){
12
  var iframeid = $(this).attr('data-playerid');
13
+ var youtubeid = $(this).attr('href').split("watch?v=")[1];
14
  var quality = $(this).attr('data-quality');
15
  checkIfInView($('#' + iframeid));
16
  ytcplayVideo (iframeid, youtubeid, quality);
styles.css CHANGED
@@ -1,7 +1,7 @@
1
  /*------------------------------------------------------------
2
  Plugin Name: Youtube Channel Gallery
3
  Plugin URI: http://www.poselab.com/
4
- Version: 1.8.5
5
  Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
  ------------------------------------------------------------*/
7
  /*plugin wrapper*/
@@ -43,10 +43,10 @@ iframe.ytcplayer{
43
  /*Thumbnails, title and description*/
44
  /*---------------------------------------------------*/
45
  ul.ytchagallery{margin: 0!important; padding: 0!important;list-style: none!important; width: 100%!important; overflow: hidden!important;}
46
- ul.ytchagallery .ytc-row{width:-webkit-calc(100% + 10px)!important; width:calc(100% + 10px)!important}
47
- ul.ytchagallery li{float:left!important;margin: 0!important;list-style: none!important;padding: 0 10px 10px 0!important;clear: none!important;}
48
  ul.ytchagallery li.ytccell-first{clear: left!important;}
49
- ul.ytchagallery li .ytcliinner {overflow: hidden!important;}
50
 
51
  /*Thumbnails*/
52
  /*----------------------------*/
1
  /*------------------------------------------------------------
2
  Plugin Name: Youtube Channel Gallery
3
  Plugin URI: http://www.poselab.com/
4
+ Version: 1.8.6
5
  Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
  ------------------------------------------------------------*/
7
  /*plugin wrapper*/
43
  /*Thumbnails, title and description*/
44
  /*---------------------------------------------------*/
45
  ul.ytchagallery{margin: 0!important; padding: 0!important;list-style: none!important; width: 100%!important; overflow: hidden!important;}
46
+ ul.ytchagallery .ytc-row{width:-webkit-calc(100% + 10px)!important; width:calc(100% + 10px)!important;margin: 0!important;padding: 0!important} /*added 15px instead of 10px because IE10 is not calculating correctly*/
47
+ ul.ytchagallery li{float:left!important;margin: 0!important;list-style: none!important;padding: 0!important;clear: none!important;}
48
  ul.ytchagallery li.ytccell-first{clear: left!important;}
49
+ ul.ytchagallery li .ytcliinner {overflow: hidden!important;padding: 0 10px 10px 0!important}
50
 
51
  /*Thumbnails*/
52
  /*----------------------------*/
templates/player.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
 
4
  // Load js
5
  $this->register_scripts();
@@ -12,5 +11,5 @@
12
  $content .= '<div class="ytcplayer-wrapper ytc-player' . $ytchag_ratio . '">';
13
 
14
  //iframe
15
- $content .= '<iframe id="ytcplayer' . $plugincount . '" class="ytcplayer" allowfullscreen src="http://www.youtube.com/embed/' . $youtubeid . '?version=3' . $ytchag_theme . $ytchag_color . $ytchag_autoplay. $ytchag_modestbranding . $ytchag_rel . $ytchag_showinfo .'&enablejsapi=1&wmode=transparent" frameborder="0"></iframe>';
16
  $content .= '</div></div>';
1
  <?php
 
2
 
3
  // Load js
4
  $this->register_scripts();
11
  $content .= '<div class="ytcplayer-wrapper ytc-player' . $ytchag_ratio . '">';
12
 
13
  //iframe
14
+ $content .= '<iframe id="ytcplayer' . $plugincount . '" class="ytcplayer" allowfullscreen src="' . $youtube_url . '/embed/' . $youtubeid . '?version=3' . $ytchag_theme . $ytchag_color . $ytchag_autoplay. $ytchag_modestbranding . $ytchag_rel . $ytchag_showinfo .'&enablejsapi=1&wmode=transparent" frameborder="0"></iframe>';
15
  $content .= '</div></div>';
youtube-channel-gallery.php CHANGED
@@ -5,7 +5,7 @@
5
  Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
  Author: Javier Gómez Pose
7
  Author URI: http://www.poselab.com/
8
- Version: 1.8.5
9
  License: GPL2
10
 
11
  Copyright 2013 Javier Gómez Pose (email : javierpose@gmail.com)
@@ -530,20 +530,24 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
530
  $content= '<p class="empty">' . __( 'There is no video to show.', 'youtube-channel-gallery' ) . '</p>';
531
 
532
  } else {
533
- $youtube_feed_url = 'http://gdata.youtube.com/feeds/api';
 
 
534
  // links
535
  if ( $ytchag_feed == 'user' ) {
536
- $ytchag_rss_url = $youtube_feed_url . '/users/' . $ytchag_user . '/uploads?v=2&prettyprint=true&max-results='. $ytchag_maxitems;
537
- $ytchag_link_url = 'http://www.youtube.com/user/' . $ytchag_user;
538
  }
539
  if ( $ytchag_feed == 'favorites' ) {
540
  $ytchag_rss_url = $youtube_feed_url . '/users/' . $ytchag_user . '/favorites';
541
- $ytchag_link_url = 'http://www.youtube.com/user/' . $ytchag_user . '/favorites';
542
  }
543
  if ( $ytchag_feed == 'playlist' ) {
544
- $ytchag_rss_url = $youtube_feed_url . '/playlists/' . $ytchag_user . '?v=2&prettyprint=true&max-results=' . $ytchag_maxitems;//&prettyprint=true
545
- $ytchag_link_url = 'http://www.youtube.com/playlist?list=' . $ytchag_user;
546
  }
 
 
547
  //HTTP API
548
 
549
  $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_maxitems );
@@ -570,7 +574,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
570
  $startindex = $totalResults - $ytchag_maxitems + 1;
571
  }
572
 
573
- $ytchag_rss_url = $youtube_feed_url . '/playlists/' . $ytchag_user . '?v=2&prettyprint=true&start-index=' . $startindex . '&max-results=' . $ytchag_maxitems;// . '&orderby=reversedPosition';
574
 
575
  $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_feed_order . $ytchag_maxitems );
576
 
@@ -631,6 +635,11 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
631
 
632
  // get video description
633
  $description = $media->group->description;
 
 
 
 
 
634
 
635
  //default url thumbnail
636
  $thumb_attrs = $media->group->thumbnail[0]->attributes();
@@ -756,7 +765,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
756
  $title_and_description_content= '<div class="ytctitledesc-cont">';
757
 
758
  if ( $ytchag_title ) {
759
- $title_and_description_content.= '<h5 class="ytctitle"><a class="ytclink" href="http://youtu.be/' . $youtubeid . '" data-playerid="ytcplayer' . $plugincount . '" data-quality="' . $ytchag_quality . '" alt="' . $title . '" title="' . $title . '" ' . $ytchag_nofollow . '>' . $title . '</a></h5>';
760
  }
761
 
762
  if ( $ytchag_description ) {
@@ -787,7 +796,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
787
  }
788
 
789
  $content.= '<div class="ytcthumb-cont"' . $ytchag_thumbnail_fixed_witdh . '>';
790
- $content.= '<a class="ytcthumb ytclink" ' .$ytchag_thumb_window. ' href="http://youtu.be/' . $youtubeid . '" data-playerid="ytcplayer' . $plugincount . '" data-quality="' . $ytchag_quality . '" title="' . $title . '" style="background-image:url(' . $thumb . ')" ' . $ytchag_nofollow . '>';
791
  $content.= '<div class="ytcplay"></div>';
792
  $content.= '</a>';
793
  $content.= '</div>';
@@ -908,7 +917,7 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
908
  // load js
909
  private function register_scripts() {
910
  wp_enqueue_script( 'jquery' );
911
- wp_enqueue_script( 'youtube_player_api', 'http://www.youtube.com/player_api', false, false, true );
912
  wp_enqueue_script( 'youtube-channel-gallery', plugins_url( '/scripts.js', __FILE__ ), false, false, true );
913
  }
914
 
@@ -921,6 +930,15 @@ class YoutubeChannelGallery_Widget extends WP_Widget {
921
 
922
  }
923
 
 
 
 
 
 
 
 
 
 
924
  /*--------------------------------------------------*/
925
  /* Shortcode
926
  /*--------------------------------------------------*/
5
  Description: Show a youtube video and a gallery of thumbnails for a youtube channel.
6
  Author: Javier Gómez Pose
7
  Author URI: http://www.poselab.com/
8
+ Version: 1.8.6
9
  License: GPL2
10
 
11
  Copyright 2013 Javier Gómez Pose (email : javierpose@gmail.com)
530
  $content= '<p class="empty">' . __( 'There is no video to show.', 'youtube-channel-gallery' ) . '</p>';
531
 
532
  } else {
533
+ $youtube_feed_url = $this->check_ssl( 'http://gdata.youtube.com/feeds/api' );
534
+ $youtube_url = $this->check_ssl( 'http://www.youtube.com' );
535
+
536
  // links
537
  if ( $ytchag_feed == 'user' ) {
538
+ $ytchag_rss_url = $youtube_feed_url . '/users/' . $ytchag_user . '/uploads?v=2&max-results='. $ytchag_maxitems;
539
+ $ytchag_link_url = $youtube_url . '/user/' . $ytchag_user;
540
  }
541
  if ( $ytchag_feed == 'favorites' ) {
542
  $ytchag_rss_url = $youtube_feed_url . '/users/' . $ytchag_user . '/favorites';
543
+ $ytchag_link_url = $youtube_url . '/user/' . $ytchag_user . '/favorites';
544
  }
545
  if ( $ytchag_feed == 'playlist' ) {
546
+ $ytchag_rss_url = $youtube_feed_url . '/playlists/' . $ytchag_user . '?v=2&max-results=' . $ytchag_maxitems;
547
+ $ytchag_link_url = $youtube_url . '/playlist?list=' . $ytchag_user;
548
  }
549
+
550
+
551
  //HTTP API
552
 
553
  $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_maxitems );
574
  $startindex = $totalResults - $ytchag_maxitems + 1;
575
  }
576
 
577
+ $ytchag_rss_url = $youtube_feed_url . '/playlists/' . $ytchag_user . '?v=2&start-index=' . $startindex . '&max-results=' . $ytchag_maxitems;// . '&orderby=reversedPosition';
578
 
579
  $transientId = 'ytc-' .md5( $ytchag_feed . $ytchag_user . $ytchag_feed_order . $ytchag_maxitems );
580
 
635
 
636
  // get video description
637
  $description = $media->group->description;
638
+
639
+ //check if thumbnails exist (to avoid Accounts suspended)
640
+ if(!isset($media->group->thumbnail[0])){
641
+ continue;
642
+ }
643
 
644
  //default url thumbnail
645
  $thumb_attrs = $media->group->thumbnail[0]->attributes();
765
  $title_and_description_content= '<div class="ytctitledesc-cont">';
766
 
767
  if ( $ytchag_title ) {
768
+ $title_and_description_content.= '<h5 class="ytctitle"><a class="ytclink" href="' . $youtube_url . '/watch?v=' . $youtubeid . '" data-playerid="ytcplayer' . $plugincount . '" data-quality="' . $ytchag_quality . '" alt="' . $title . '" title="' . $title . '" ' . $ytchag_nofollow . '>' . $title . '</a></h5>';
769
  }
770
 
771
  if ( $ytchag_description ) {
796
  }
797
 
798
  $content.= '<div class="ytcthumb-cont"' . $ytchag_thumbnail_fixed_witdh . '>';
799
+ $content.= '<a class="ytcthumb ytclink" ' .$ytchag_thumb_window. ' href="' . $youtube_url . '/watch?v=' . $youtubeid . '" data-playerid="ytcplayer' . $plugincount . '" data-quality="' . $ytchag_quality . '" title="' . $title . '" style="background-image:url(' . $this->check_ssl( $thumb ) . ')" ' . $ytchag_nofollow . '>';
800
  $content.= '<div class="ytcplay"></div>';
801
  $content.= '</a>';
802
  $content.= '</div>';
917
  // load js
918
  private function register_scripts() {
919
  wp_enqueue_script( 'jquery' );
920
+ wp_enqueue_script( 'youtube_player_api', $this->check_ssl( 'http://www.youtube.com/player_api' ), false, false, true );
921
  wp_enqueue_script( 'youtube-channel-gallery', plugins_url( '/scripts.js', __FILE__ ), false, false, true );
922
  }
923
 
930
 
931
  }
932
 
933
+ // check http protocol
934
+ public function check_ssl ( $url ) {
935
+ if ( is_ssl() ) {
936
+ return str_replace( 'http://', 'https://', $url );
937
+ } else {
938
+ return $url;
939
+ }
940
+ }
941
+
942
  /*--------------------------------------------------*/
943
  /* Shortcode
944
  /*--------------------------------------------------*/