WP YouTube Lyte - Version 1.4.1

Version Description

  • set interval for captionscheck to 30 days
Download this release

Release Info

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

Code changes from version 1.4.0 to 1.4.1

Files changed (2) hide show
  1. readme.txt +4 -1
  2. wp-youtube-lyte.php +5 -4
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: youtube, video, lyte, lite youtube embeds, html5 video, widget, youtube au
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.0
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,9 @@ Just tell me, I like the feedback! Use the [Contact-page on my blog](http://blog
109
 
110
  == Changelog ==
111
 
 
 
 
112
  = 1.4.0 =
113
  * new: if microdata is enabled, check if captions are available and if so add the accessibilityFeature=captions markup. Gracefully contributed [by Benetech](http://benetech.org/)
114
  * bugfix: widgets with youtu.be short URL's were broken (as observed by [Robert of audio-times.com](http://www.audio-times.com/).
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
 
110
  == Changelog ==
111
 
112
+ = 1.4.1 =
113
+ * set interval for captionscheck to 30 days
114
+
115
  = 1.4.0 =
116
  * new: if microdata is enabled, check if captions are available and if so add the accessibilityFeature=captions markup. Gracefully contributed [by Benetech](http://benetech.org/)
117
  * bugfix: widgets with youtu.be short URL's were broken (as observed by [Robert of audio-times.com](http://www.audio-times.com/).
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.0
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.0";
17
  $lyte_db_version=get_option('lyte_version','none');
18
 
19
  /** have we updated? */
@@ -292,15 +292,16 @@ function lyte_parse($the_content,$doExcerpt=false) {
292
 
293
  if ($forceCaptionsUpdate===true) {
294
  $captionsMeta="";
 
295
  if (array_key_exists('captions_timestamp',$yt_resp_array)) {
296
  $cache_timestamp = $yt_resp_array["captions_timestamp"];
297
  $interval = (strtotime("now") - $cache_timestamp)/60/60/24;
298
  } else {
299
  $cache_timestamp = false;
300
- $interval = 2;
301
  }
302
 
303
- if(!is_int($cache_timestamp) || ($interval > 1 && !is_null($yt_resp_array["captions_data"]))) {
304
  $yt_resp_array['captions_timestamp'] = strtotime("now");
305
  wp_schedule_single_event(strtotime("now") + 60*60, 'schedule_captions_lookup', array($postID, $cachekey, $vid));
306
  $yt_resp_precache=json_encode($yt_resp_array);
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
  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? */
292
 
293
  if ($forceCaptionsUpdate===true) {
294
  $captionsMeta="";
295
+ $threshold = 30;
296
  if (array_key_exists('captions_timestamp',$yt_resp_array)) {
297
  $cache_timestamp = $yt_resp_array["captions_timestamp"];
298
  $interval = (strtotime("now") - $cache_timestamp)/60/60/24;
299
  } else {
300
  $cache_timestamp = false;
301
+ $interval = $threshold+1;
302
  }
303
 
304
+ if(!is_int($cache_timestamp) || ($interval > $threshold && !is_null($yt_resp_array["captions_data"]))) {
305
  $yt_resp_array['captions_timestamp'] = strtotime("now");
306
  wp_schedule_single_event(strtotime("now") + 60*60, 'schedule_captions_lookup', array($postID, $cachekey, $vid));
307
  $yt_resp_precache=json_encode($yt_resp_array);