WP YouTube Lyte - Version 1.4.2

Version Description

  • Bugfix: Playlists in rss-feeds were broken
  • Bugfix: YouTube-link under a playlist was wrong
  • Improvement: example code in lyte_helper.php to also parse http-youtube-links now only triggers if the link is on a new line
  • Tested with WordPress 3.9
Download this release

Release Info

Developer futtta
Plugin Icon 128x128 WP YouTube Lyte
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

Files changed (3) hide show
  1. lyte_helper.php_example +1 -1
  2. readme.txt +8 -2
  3. wp-youtube-lyte.php +5 -5
lyte_helper.php_example CHANGED
@@ -22,7 +22,7 @@ function lyte_force_widgets() {
22
  /** force wp youtube lyte to act on normal youtube url's as well using lyte_content_preparse filter */
23
  // add_filter('lyte_content_preparse','lyte_force_nonhttpv',10,1);
24
  function lyte_force_nonhttpv($content) {
25
- $content=preg_replace('/https?:\/\/(www.)?youtu(be.com|.be)\/(watch\?v=)?/','httpv://www.youtube.com/watch?v=',$content);
26
  return $content;
27
  }
28
 
22
  /** force wp youtube lyte to act on normal youtube url's as well using lyte_content_preparse filter */
23
  // add_filter('lyte_content_preparse','lyte_force_nonhttpv',10,1);
24
  function lyte_force_nonhttpv($content) {
25
+ $content=preg_replace('/^https?:\/\/(www.)?youtu(be.com|.be)\/(watch\?v=)?/m','httpv://www.youtube.com/watch?v=',$content);
26
  return $content;
27
  }
28
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: futtta
3
  Tags: youtube, video, lyte, lite youtube embeds, html5 video, widget, youtube audio, audio, playlist, performance, accessibility, sidebar, lazy load, responsive, microdata, videoobject
4
  Donate link: http://blog.futtta.be/2013/10/21/do-not-donate-to-me/
5
  Requires at least: 2.9
6
- Tested up to: 3.8
7
- Stable tag: 1.4.1
8
 
9
  High performance YouTube video, playlist and audio-only embeds which don't slow down your blog and offer optimal accessibility.
10
 
@@ -109,6 +109,12 @@ Just tell me, I like the feedback! Use the [Contact-page on my blog](http://blog
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
112
  = 1.4.1 =
113
  * set interval for captionscheck to 30 days
114
 
3
  Tags: youtube, video, lyte, lite youtube embeds, html5 video, widget, youtube audio, audio, playlist, performance, accessibility, sidebar, lazy load, responsive, microdata, videoobject
4
  Donate link: http://blog.futtta.be/2013/10/21/do-not-donate-to-me/
5
  Requires at least: 2.9
6
+ Tested up to: 3.9
7
+ Stable tag: 1.4.2
8
 
9
  High performance YouTube video, playlist and audio-only embeds which don't slow down your blog and offer optimal accessibility.
10
 
109
 
110
  == Changelog ==
111
 
112
+ = 1.4.2 =
113
+ * Bugfix: Playlists in rss-feeds were broken
114
+ * Bugfix: YouTube-link under a playlist was wrong
115
+ * Improvement: example code in lyte_helper.php to also parse http-youtube-links now only triggers if the link is on a new line
116
+ * Tested with WordPress 3.9
117
+
118
  = 1.4.1 =
119
  * set interval for captionscheck to 30 days
120
 
wp-youtube-lyte.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP YouTube Lyte
4
  Plugin URI: http://blog.futtta.be/wp-youtube-lyte/
5
  Description: Lite and accessible YouTube audio and video embedding.
6
  Author: Frank Goossens (futtta)
7
- Version: 1.4.1
8
  Author URI: http://blog.futtta.be/
9
  Text Domain: wp-youtube-lyte
10
  Domain Path: /languages
@@ -13,7 +13,7 @@ Domain Path: /languages
13
  if ( ! defined( 'ABSPATH' ) ) exit;
14
 
15
  $debug=false;
16
- $lyte_version="1.4.1";
17
  $lyte_db_version=get_option('lyte_version','none');
18
 
19
  /** have we updated? */
@@ -171,12 +171,12 @@ function lyte_parse($the_content,$doExcerpt=false) {
171
  switch ($lyteSettings['links']) {
172
  case "0":
173
  $noscript_post="<br />".__("Watch this playlist on YouTube","wp-youtube-lyte");
174
- $noscript="<noscript><a href=\"".$lyteSettings['scheme']."://youtube.com/playlist?list=PL".$vid."\">".$noscript_post."</a></noscript>";
175
  $lytelinks_txt="";
176
  break;
177
  default:
178
  $noscript="";
179
- $lytelinks_txt="<div class=\"lL\" style=\"width:".$lyteSettings[2]."px;".$lyteSettings['pos']."\">".__("Watch this playlist","wp-youtube-lyte")." <a href=\"".$lyteSettings['scheme']."://www.youtube.com/playlist?list=PL".$vid."\">".__("on YouTube","wp-youtube-lyte")."</a></div>";
180
  }
181
  } else if ($match[9]!="") {
182
  $plClass="";
@@ -326,7 +326,7 @@ function lyte_parse($the_content,$doExcerpt=false) {
326
  } elseif ($lyte_feed) {
327
  $postURL = get_permalink( $postID );
328
  $textLink = ($lyteSettings['links']===0)? "" : "<br />".strip_tags($lytelinks_txt, '<a>')."<br />";
329
- $lytetemplate = "<a href=\"".$postURL."\"><img src=\"".$lyteSettings['scheme']."://i.ytimg.com/vi/".$vid."/0.jpg\" alt=\"YouTube Video\"></a>".$textLink;
330
  $templateType="feed";
331
  } elseif (($audio !== true) && ( $plClass !== " playlist") && (($lyteSettings['microdata'] === "1")&&($noMicroData !== "1" ))) {
332
  $lytetemplate = $wrapper."<div class=\"lyMe".$audioClass.$hidefClass.$plClass.$qsaClass."\" id=\"WYL_".$vid."\" itemprop=\"video\" itemscope itemtype=\"http://schema.org/VideoObject\"><meta itemprop=\"thumbnailUrl\" content=\"".$thumbUrl."\" /><meta itemprop=\"embedURL\" content=\"http://www.youtube.com/embed/".$vid."\" /><meta itemprop=\"uploadDate\" content=\"".$dateField."\" />".$captionsMeta."<div id=\"lyte_".$vid."\" data-src=\"".$thumbUrl."\" class=\"pL\"><div class=\"tC".$titleClass."\"><div class=\"tT\" itemprop=\"name\">".$yt_title."</div></div><div class=\"play\"></div><div class=\"ctrl\"><div class=\"Lctrl\"></div><div class=\"Rctrl\"></div></div></div>".$noscript."<meta itemprop=\"description\" content=\"".$description."\"></div></div>".$lytelinks_txt;
4
  Plugin URI: http://blog.futtta.be/wp-youtube-lyte/
5
  Description: Lite and accessible YouTube audio and video embedding.
6
  Author: Frank Goossens (futtta)
7
+ Version: 1.4.2
8
  Author URI: http://blog.futtta.be/
9
  Text Domain: wp-youtube-lyte
10
  Domain Path: /languages
13
  if ( ! defined( 'ABSPATH' ) ) exit;
14
 
15
  $debug=false;
16
+ $lyte_version="1.4.2";
17
  $lyte_db_version=get_option('lyte_version','none');
18
 
19
  /** have we updated? */
171
  switch ($lyteSettings['links']) {
172
  case "0":
173
  $noscript_post="<br />".__("Watch this playlist on YouTube","wp-youtube-lyte");
174
+ $noscript="<noscript><a href=\"".$lyteSettings['scheme']."://youtube.com/playlist?list=".$vid."\">".$noscript_post."</a></noscript>";
175
  $lytelinks_txt="";
176
  break;
177
  default:
178
  $noscript="";
179
+ $lytelinks_txt="<div class=\"lL\" style=\"width:".$lyteSettings[2]."px;".$lyteSettings['pos']."\">".__("Watch this playlist","wp-youtube-lyte")." <a href=\"".$lyteSettings['scheme']."://www.youtube.com/playlist?list=".$vid."\">".__("on YouTube","wp-youtube-lyte")."</a></div>";
180
  }
181
  } else if ($match[9]!="") {
182
  $plClass="";
326
  } elseif ($lyte_feed) {
327
  $postURL = get_permalink( $postID );
328
  $textLink = ($lyteSettings['links']===0)? "" : "<br />".strip_tags($lytelinks_txt, '<a>')."<br />";
329
+ $lytetemplate = "<a href=\"".$postURL."\"><img src=\"".$thumbUrl."\" alt=\"YouTube Video\"></a>".$textLink;
330
  $templateType="feed";
331
  } elseif (($audio !== true) && ( $plClass !== " playlist") && (($lyteSettings['microdata'] === "1")&&($noMicroData !== "1" ))) {
332
  $lytetemplate = $wrapper."<div class=\"lyMe".$audioClass.$hidefClass.$plClass.$qsaClass."\" id=\"WYL_".$vid."\" itemprop=\"video\" itemscope itemtype=\"http://schema.org/VideoObject\"><meta itemprop=\"thumbnailUrl\" content=\"".$thumbUrl."\" /><meta itemprop=\"embedURL\" content=\"http://www.youtube.com/embed/".$vid."\" /><meta itemprop=\"uploadDate\" content=\"".$dateField."\" />".$captionsMeta."<div id=\"lyte_".$vid."\" data-src=\"".$thumbUrl."\" class=\"pL\"><div class=\"tC".$titleClass."\"><div class=\"tT\" itemprop=\"name\">".$yt_title."</div></div><div class=\"play\"></div><div class=\"ctrl\"><div class=\"Lctrl\"></div><div class=\"Rctrl\"></div></div></div>".$noscript."<meta itemprop=\"description\" content=\"".$description."\"></div></div>".$lytelinks_txt;