WP YouTube Lyte - Version 1.6.7

Version Description

  • fix for AMP-trouble as reported by winderttal
Download this release

Release Info

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

Code changes from version 1.6.6 to 1.6.7

Files changed (2) hide show
  1. readme.txt +5 -2
  2. wp-youtube-lyte.php +14 -1
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: futtta, optimizingmatters
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: 4.4.2
7
- Stable tag: 1.6.6
8
 
9
  High performance YouTube video, playlist and audio-only embeds which don't slow down your blog and offer optimal accessibility.
10
 
@@ -154,6 +154,9 @@ Just tell me, I like the feedback! Use the [Contact-page on my blog](http://blog
154
 
155
  == Changelog ==
156
 
 
 
 
157
  = 1.6.6 =
158
  * emergency bugfix; else was lost but now got found. sorry for that!
159
 
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: 4.6
7
+ Stable tag: 1.6.7
8
 
9
  High performance YouTube video, playlist and audio-only embeds which don't slow down your blog and offer optimal accessibility.
10
 
154
 
155
  == Changelog ==
156
 
157
+ = 1.6.7 =
158
+ * fix for AMP-trouble as [reported by winderttal](https://wordpress.org/support/topic/error-in-amp-pages/)
159
+
160
  = 1.6.6 =
161
  * emergency bugfix; else was lost but now got found. sorry for that!
162
 
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.6.6
8
  Author URI: http://blog.futtta.be/
9
  Text Domain: wp-youtube-lyte
10
  Domain Path: /languages
@@ -81,6 +81,8 @@ function lyte_settings_enforcer() {
81
  add_action('after_setup_theme','lyte_settings_enforcer');
82
 
83
  function lyte_parse($the_content,$doExcerpt=false) {
 
 
84
  /** main function to parse the content, searching and replacing httpv-links */
85
  global $lyteSettings, $toCache_index, $postID, $cachekey;
86
  $lyteSettings['path']=plugins_url() . "/" . dirname(plugin_basename(__FILE__)) . '/lyte/';
@@ -590,6 +592,17 @@ function lyte_add_action_link($links) {
590
  return $links;
591
  }
592
 
 
 
 
 
 
 
 
 
 
 
 
593
  /** hooking it all up to wordpress */
594
  if ( is_admin() ) {
595
  require_once(dirname(__FILE__).'/options.php');
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.6.7
8
  Author URI: http://blog.futtta.be/
9
  Text Domain: wp-youtube-lyte
10
  Domain Path: /languages
81
  add_action('after_setup_theme','lyte_settings_enforcer');
82
 
83
  function lyte_parse($the_content,$doExcerpt=false) {
84
+ if ( is_amp()) { return $the_content; }
85
+
86
  /** main function to parse the content, searching and replacing httpv-links */
87
  global $lyteSettings, $toCache_index, $postID, $cachekey;
88
  $lyteSettings['path']=plugins_url() . "/" . dirname(plugin_basename(__FILE__)) . '/lyte/';
592
  return $links;
593
  }
594
 
595
+ /** is_amp */
596
+ if (!function_exists("is_amp")) {
597
+ function is_amp() {
598
+ if ((strpos($_SERVER['REQUEST_URI'],'?amp')!==false) || (strpos($_SERVER['REQUEST_URI'],'/amp/')!==false)) {
599
+ return true;
600
+ } else {
601
+ return false;
602
+ }
603
+ }
604
+ }
605
+
606
  /** hooking it all up to wordpress */
607
  if ( is_admin() ) {
608
  require_once(dirname(__FILE__).'/options.php');