Smart YouTube PRO - Version 4.2.6

Version Description

  • Better support for https sites
Download this release

Release Info

Developer freediver
Plugin Icon 128x128 Smart YouTube PRO
Version 4.2.6
Comparing to
See all releases

Code changes from version 4.2.5 to 4.2.6

Files changed (3) hide show
  1. patch1.diff +77 -0
  2. readme.txt +4 -1
  3. smartyoutube.php +9 -9
patch1.diff ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ From e6c2891d7ba1176e8a99d18d81b5363c320e6fc2 Mon Sep 17 00:00:00 2001
2
+ From: Mainboarder <git@mainboarder.de>
3
+ Date: Wed, 30 Jul 2014 08:56:25 +0200
4
+ Subject: [PATCH] Dynamic protocol decision
5
+
6
+ ---
7
+ smartyoutube.php | 16 ++++++++--------
8
+ 1 file changed, 8 insertions(+), 8 deletions(-)
9
+
10
+ diff --git a/smartyoutube.php b/smartyoutube.php
11
+ index 59c89a8..118897b 100644
12
+ --- a/smartyoutube.php
13
+ +++ b/smartyoutube.php
14
+ @@ -1021,10 +1021,10 @@ EOT;
15
+ $ll = '';
16
+ }
17
+
18
+ - $root_url = $this->options['privacy'] ? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com';
19
+ + $root_url = $this->options['privacy'] ? '//www.youtube-nocookie.com' : '//www.youtube.com';
20
+
21
+ if ( $excerpt == 'thm' ) {
22
+ - $img_url = htmlspecialchars( "https://img.youtube.com/vi/$file/0.jpg" );
23
+ + $img_url = htmlspecialchars( "//img.youtube.com/vi/$file/0.jpg" );
24
+ global $post;
25
+ $post_url = get_permalink( $post->ID );
26
+ $yte_tag = <<<EOT
27
+ @@ -1033,7 +1033,7 @@ EOT;
28
+ }
29
+
30
+ if ( ( ( is_home() || is_front_page() || is_archive() ) && $context == 'post' && $thumb == 'on' ) || ( $context == 'thumb' ) || ( $context == 'excerpt' && $excerpt == 'thm' ) ) {
31
+ - $img_url = htmlspecialchars( "https://img.youtube.com/vi/$file/0.jpg" );
32
+ + $img_url = htmlspecialchars( "//img.youtube.com/vi/$file/0.jpg" );
33
+ if ( $context == 'excerpt' && $excerpt == 'thm' ) {
34
+ global $post;
35
+ $post_url = get_permalink( $post->ID );
36
+ @@ -1058,7 +1058,7 @@ EOT;
37
+ EOT;
38
+ } elseif ( $valid == 'off' || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPhone' ) === TRUE || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPod' ) === TRUE || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPad' ) === TRUE ) {
39
+ if ( $context == 'post' && $colorbox == 'on' ) {
40
+ - $img_url = htmlspecialchars( "https://img.youtube.com/vi/$file/0.jpg" );
41
+ + $img_url = htmlspecialchars( "//img.youtube.com/vi/$file/0.jpg" );
42
+ $yte_tag = <<<EOT
43
+ <a class="colorbox_video" href="$video_url"><img width="$width" height="$height" src="$img_url" /></a></span>
44
+ EOT;
45
+ @@ -1073,7 +1073,7 @@ EOT;
46
+ EOT;
47
+ } else {
48
+ if ( $context == 'post' && $colorbox == 'on' ) {
49
+ - $img_url = htmlspecialchars( "https://img.youtube.com/vi/$file/0.jpg" );
50
+ + $img_url = htmlspecialchars( "//img.youtube.com/vi/$file/0.jpg" );
51
+ $yte_tag = <<<EOT
52
+ <a class="colorbox_video" href="$video_url"><img width="$width" height="$height" src="$img_url" /></a></span>
53
+ EOT;
54
+ @@ -1095,9 +1095,9 @@ EOT;
55
+ $high = '&fmt=18';
56
+ }
57
+ if ( $playlist )
58
+ - $url = 'https://www.youtube.com/playlist?list=';
59
+ + $url = '//www.youtube.com/playlist?list=';
60
+ else
61
+ - $url = 'https://www.youtube.com/watch?v=';
62
+ + $url = '//www.youtube.com/watch?v=';
63
+
64
+ $yte_tag = '';
65
+ if ( $this->options['link'] == 'on' ) {
66
+ @@ -1105,7 +1105,7 @@ EOT;
67
+ }
68
+
69
+ if ( $this->options['img'] == 'on' ) {
70
+ - $yte_tag .= '<p><a href="' . $url . $file . $high. '"><img src="https://img.youtube.com/vi/' . $file . '/default.jpg" width="130" height="97" border=0></a></p>';
71
+ + $yte_tag .= '<p><a href="' . $url . $file . $high. '"><img src="//img.youtube.com/vi/' . $file . '/default.jpg" width="130" height="97" border=0></a></p>';
72
+ }
73
+
74
+ if ($this->options['link'] == 'off' && $this->options['img'] == 'off')
75
+ --
76
+ 1.8.3.msysgit.0
77
+
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: freediver
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
4
  Tags: youtube, video, play, media, Post, posts, admin, metacafe, liveleak, vimeo, facebook, thumbnails
5
  Requires at least: 2.0
6
- Tested up to: 3.9
7
  Stable tag: trunk
8
 
9
  Smart Youtube is a professional WordPress Video plugin that allows you to easily insert videos/playlists into your post, comments and in your RSS feed. The plugin is designed to be small and fast and not use any external resources.
@@ -49,6 +49,9 @@ For updates, you can check out [my blog](http://www.prelovac.com/vladimir/) or f
49
 
50
  == Changelog ==
51
 
 
 
 
52
  = 4.2.5 =
53
  * Fixed Vimeo compatibility
54
 
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
4
  Tags: youtube, video, play, media, Post, posts, admin, metacafe, liveleak, vimeo, facebook, thumbnails
5
  Requires at least: 2.0
6
+ Tested up to: 4.0
7
  Stable tag: trunk
8
 
9
  Smart Youtube is a professional WordPress Video plugin that allows you to easily insert videos/playlists into your post, comments and in your RSS feed. The plugin is designed to be small and fast and not use any external resources.
49
 
50
  == Changelog ==
51
 
52
+ = 4.2.6 =
53
+ * Better support for https sites
54
+
55
  = 4.2.5 =
56
  * Fixed Vimeo compatibility
57
 
smartyoutube.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Smart Youtube PRO
4
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube
5
  Description: Insert YouTube videos in posts, comments and RSS feeds with ease and full customization.
6
  Author: Vladimir Prelovac
7
- Version: 4.2.5
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
 
@@ -1021,10 +1021,10 @@ EOT;
1021
  $ll = '';
1022
  }
1023
 
1024
- $root_url = $this->options['privacy'] ? 'http://www.youtube-nocookie.com' : 'http://www.youtube.com';
1025
 
1026
  if ( $excerpt == 'thm' ) {
1027
- $img_url = htmlspecialchars( "http://img.youtube.com/vi/$file/0.jpg" );
1028
  global $post;
1029
  $post_url = get_permalink( $post->ID );
1030
  $yte_tag = <<<EOT
@@ -1033,7 +1033,7 @@ EOT;
1033
  }
1034
 
1035
  if ( ( ( is_home() || is_front_page() || is_archive() ) && $context == 'post' && $thumb == 'on' ) || ( $context == 'thumb' ) || ( $context == 'excerpt' && $excerpt == 'thm' ) ) {
1036
- $img_url = htmlspecialchars( "http://img.youtube.com/vi/$file/0.jpg" );
1037
  if ( $context == 'excerpt' && $excerpt == 'thm' ) {
1038
  global $post;
1039
  $post_url = get_permalink( $post->ID );
@@ -1058,7 +1058,7 @@ EOT;
1058
  EOT;
1059
  } elseif ( $valid == 'off' || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPhone' ) === TRUE || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPod' ) === TRUE || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPad' ) === TRUE ) {
1060
  if ( $context == 'post' && $colorbox == 'on' ) {
1061
- $img_url = htmlspecialchars( "http://img.youtube.com/vi/$file/0.jpg" );
1062
  $yte_tag = <<<EOT
1063
  <a class="colorbox_video" href="$video_url"><img width="$width" height="$height" src="$img_url" /></a></span>
1064
  EOT;
@@ -1073,7 +1073,7 @@ EOT;
1073
  EOT;
1074
  } else {
1075
  if ( $context == 'post' && $colorbox == 'on' ) {
1076
- $img_url = htmlspecialchars( "http://img.youtube.com/vi/$file/0.jpg" );
1077
  $yte_tag = <<<EOT
1078
  <a class="colorbox_video" href="$video_url"><img width="$width" height="$height" src="$img_url" /></a></span>
1079
  EOT;
@@ -1095,9 +1095,9 @@ EOT;
1095
  $high = '&fmt=18';
1096
  }
1097
  if ( $playlist )
1098
- $url = 'http://www.youtube.com/playlist?list=';
1099
  else
1100
- $url = 'http://www.youtube.com/watch?v=';
1101
 
1102
  $yte_tag = '';
1103
  if ( $this->options['link'] == 'on' ) {
@@ -1105,7 +1105,7 @@ EOT;
1105
  }
1106
 
1107
  if ( $this->options['img'] == 'on' ) {
1108
- $yte_tag .= '<p><a href="' . $url . $file . $high. '"><img src="http://img.youtube.com/vi/' . $file . '/default.jpg" width="130" height="97" border=0></a></p>';
1109
  }
1110
 
1111
  if ($this->options['link'] == 'off' && $this->options['img'] == 'off')
4
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube
5
  Description: Insert YouTube videos in posts, comments and RSS feeds with ease and full customization.
6
  Author: Vladimir Prelovac
7
+ Version: 4.2.6
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
 
1021
  $ll = '';
1022
  }
1023
 
1024
+ $root_url = $this->options['privacy'] ? '//www.youtube-nocookie.com' : '//www.youtube.com';
1025
 
1026
  if ( $excerpt == 'thm' ) {
1027
+ $img_url = htmlspecialchars( "//img.youtube.com/vi/$file/0.jpg" );
1028
  global $post;
1029
  $post_url = get_permalink( $post->ID );
1030
  $yte_tag = <<<EOT
1033
  }
1034
 
1035
  if ( ( ( is_home() || is_front_page() || is_archive() ) && $context == 'post' && $thumb == 'on' ) || ( $context == 'thumb' ) || ( $context == 'excerpt' && $excerpt == 'thm' ) ) {
1036
+ $img_url = htmlspecialchars( "//img.youtube.com/vi/$file/0.jpg" );
1037
  if ( $context == 'excerpt' && $excerpt == 'thm' ) {
1038
  global $post;
1039
  $post_url = get_permalink( $post->ID );
1058
  EOT;
1059
  } elseif ( $valid == 'off' || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPhone' ) === TRUE || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPod' ) === TRUE || strpos( $_SERVER['HTTP_USER_AGENT'], 'iPad' ) === TRUE ) {
1060
  if ( $context == 'post' && $colorbox == 'on' ) {
1061
+ $img_url = htmlspecialchars( "//img.youtube.com/vi/$file/0.jpg" );
1062
  $yte_tag = <<<EOT
1063
  <a class="colorbox_video" href="$video_url"><img width="$width" height="$height" src="$img_url" /></a></span>
1064
  EOT;
1073
  EOT;
1074
  } else {
1075
  if ( $context == 'post' && $colorbox == 'on' ) {
1076
+ $img_url = htmlspecialchars( "//img.youtube.com/vi/$file/0.jpg" );
1077
  $yte_tag = <<<EOT
1078
  <a class="colorbox_video" href="$video_url"><img width="$width" height="$height" src="$img_url" /></a></span>
1079
  EOT;
1095
  $high = '&fmt=18';
1096
  }
1097
  if ( $playlist )
1098
+ $url = '//www.youtube.com/playlist?list=';
1099
  else
1100
+ $url = '//www.youtube.com/watch?v=';
1101
 
1102
  $yte_tag = '';
1103
  if ( $this->options['link'] == 'on' ) {
1105
  }
1106
 
1107
  if ( $this->options['img'] == 'on' ) {
1108
+ $yte_tag .= '<p><a href="' . $url . $file . $high. '"><img src="//img.youtube.com/vi/' . $file . '/default.jpg" width="130" height="97" border=0></a></p>';
1109
  }
1110
 
1111
  if ($this->options['link'] == 'off' && $this->options['img'] == 'off')