Video Thumbnails - Version 2.5.3

Version Description

  • Fixed bug with Automatic YouTube Video Posts when automatic publishing is disabled or when rescanning existing posts
  • Fixed bug with bulk scanner when 0 posts are queued
  • Improved markup test by checking if server can reach the resulting thumbnail URL
Download this release

Release Info

Developer sutherlandboswell
Plugin Icon 128x128 Video Thumbnails
Version 2.5.3
Comparing to
See all releases

Code changes from version 2.5.2 to 2.5.3

js/bulk.js CHANGED
@@ -37,8 +37,10 @@ jQuery(function ($) {
37
  $('#queue-count').text('working...');
38
  $.post(ajaxurl, data, function(response) {
39
  self.posts = $.parseJSON( response );
40
- $('#queue-count').text(self.posts.length+' posts');
41
- self.enableSubmit();
 
 
42
  });
43
  };
44
 
37
  $('#queue-count').text('working...');
38
  $.post(ajaxurl, data, function(response) {
39
  self.posts = $.parseJSON( response );
40
+ $('#queue-count').text(self.posts.length+' posts in queue');
41
+ if ( self.posts.length > 0 ) {
42
+ self.enableSubmit();
43
+ }
44
  });
45
  };
46
 
php/class-video-thumbnails-settings.php CHANGED
@@ -267,12 +267,27 @@ class Video_Thumbnails_Settings {
267
  $new_thumbnail = $video_thumbnails->get_first_thumbnail_url( stripslashes( $_POST['markup'] ) );
268
 
269
  if ( $new_thumbnail == null ) {
 
270
  echo '<p><span style="color:red;">&#10006;</span> No thumbnail found</p>';
271
  } elseif ( is_wp_error( $new_thumbnail ) ) {
 
272
  echo '<p><span style="color:red;">&#10006;</span> Error: ' . $new_thumbnail->get_error_message() . '</p>';
273
  } else {
274
- echo '<p><span style="color:green;">&#10004;</span> Thumbnail found! <a href="' . $new_thumbnail . '" target="_blank">View full size</a></p>';
275
- echo '<p><img src="' . $new_thumbnail . '" style="max-width: 500px;"></p>';
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  }
277
 
278
  die();
267
  $new_thumbnail = $video_thumbnails->get_first_thumbnail_url( stripslashes( $_POST['markup'] ) );
268
 
269
  if ( $new_thumbnail == null ) {
270
+ // No thumbnail
271
  echo '<p><span style="color:red;">&#10006;</span> No thumbnail found</p>';
272
  } elseif ( is_wp_error( $new_thumbnail ) ) {
273
+ // Error finding thumbnail
274
  echo '<p><span style="color:red;">&#10006;</span> Error: ' . $new_thumbnail->get_error_message() . '</p>';
275
  } else {
276
+ // Found a thumbnail
277
+ $remote_response = wp_remote_head( $new_thumbnail );
278
+ if ( is_wp_error( $remote_response ) ) {
279
+ // WP Error trying to read image from remote server
280
+ echo '<p><span style="color:red;">&#10006;</span> Thumbnail found, but there was an error retrieving the URL.</p>';
281
+ echo '<p>Error Details: ' . $remote_response->get_error_message() . '</p>';
282
+ } elseif ( $remote_response['response']['code'] != '200' ) {
283
+ // Response code isn't okay
284
+ echo '<p><span style="color:red;">&#10006;</span> Thumbnail found, but it may not exist on the source server. If opening the URL below in your web browser returns an error, the source is providing an invalid URL.</p>';
285
+ echo '<p>Thumbnail URL: <a href="' . $new_thumbnail . '" target="_blank">' . $new_thumbnail . '</a>';
286
+ } else {
287
+ // Everything is okay!
288
+ echo '<p><span style="color:green;">&#10004;</span> Thumbnail found! Image should appear below. <a href="' . $new_thumbnail . '" target="_blank">View full size</a></p>';
289
+ echo '<p><img src="' . $new_thumbnail . '" style="max-width: 500px;"></p>';
290
+ }
291
  }
292
 
293
  die();
php/extensions/class-ayvp-thumbnails.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- /* Copyright 2013 Sutherland Boswell (email : sutherland.boswell@gmail.com)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License, version 2, as
@@ -25,12 +25,20 @@ require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-youtube-thumbnails.p
25
  class AYVP_Thumbnails extends Video_Thumbnails_Extension {
26
 
27
  public static function new_thumbnail( $new_thumbnail, $post_id ) {
 
28
  global $tern_wp_youtube_array;
29
  if ( $new_thumbnail == null ) {
30
  if ( isset( $tern_wp_youtube_array['_tern_wp_youtube_video'] ) && $tern_wp_youtube_array['_tern_wp_youtube_video'] != '' ) {
31
  $new_thumbnail = YouTube_Thumbnails::get_thumbnail_url( $tern_wp_youtube_array['_tern_wp_youtube_video'] );
32
  }
33
  }
 
 
 
 
 
 
 
34
  return $new_thumbnail;
35
  }
36
 
1
  <?php
2
 
3
+ /* Copyright 2014 Sutherland Boswell (email : sutherland.boswell@gmail.com)
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License, version 2, as
25
  class AYVP_Thumbnails extends Video_Thumbnails_Extension {
26
 
27
  public static function new_thumbnail( $new_thumbnail, $post_id ) {
28
+ // When publishing a post during import, use the global variable to generate thumbnail
29
  global $tern_wp_youtube_array;
30
  if ( $new_thumbnail == null ) {
31
  if ( isset( $tern_wp_youtube_array['_tern_wp_youtube_video'] ) && $tern_wp_youtube_array['_tern_wp_youtube_video'] != '' ) {
32
  $new_thumbnail = YouTube_Thumbnails::get_thumbnail_url( $tern_wp_youtube_array['_tern_wp_youtube_video'] );
33
  }
34
  }
35
+ // When automatic publishing is disabled or rescanning an existing post, use custom field data to generate thumbnail
36
+ if ( $new_thumbnail == null ) {
37
+ $youtube_id = get_post_meta( $post_id, '_tern_wp_youtube_video', true );
38
+ if ( $youtube_id != '' ) {
39
+ $new_thumbnail = YouTube_Thumbnails::get_thumbnail_url( $youtube_id );
40
+ }
41
+ }
42
  return $new_thumbnail;
43
  }
44
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wie.ly/u/donate
4
  Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image
5
  Requires at least: 3.2
6
  Tested up to: 3.8.1
7
- Stable tag: 2.5.2
8
 
9
  Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
10
 
@@ -115,6 +115,11 @@ The Vimeo API has a rate limit, so in rare cases you may exceed this limit. Try
115
 
116
  == Changelog ==
117
 
 
 
 
 
 
118
  = 2.5.2 =
119
  * Better support for Automatic YouTube Video Posts
120
  * Added support tab to settings page
4
  Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image
5
  Requires at least: 3.2
6
  Tested up to: 3.8.1
7
+ Stable tag: 2.5.3
8
 
9
  Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
10
 
115
 
116
  == Changelog ==
117
 
118
+ = 2.5.3 =
119
+ * Fixed bug with Automatic YouTube Video Posts when automatic publishing is disabled or when rescanning existing posts
120
+ * Fixed bug with bulk scanner when 0 posts are queued
121
+ * Improved markup test by checking if server can reach the resulting thumbnail URL
122
+
123
  = 2.5.2 =
124
  * Better support for Automatic YouTube Video Posts
125
  * Added support tab to settings page
video-thumbnails.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://refactored.co/plugins/video-thumbnails
5
  Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Supports YouTube, Vimeo, Facebook, Vine, Justin.tv, Twitch, Dailymotion, Metacafe, Blip, Google Drive, Funny or Die, CollegeHumor, MPORA, Wistia, Youku, and Rutube.
6
  Author: Sutherland Boswell
7
  Author URI: http://sutherlandboswell.com
8
- Version: 2.5.2
9
  License: GPL2
10
  */
11
  /* Copyright 2014 Sutherland Boswell (email : sutherland.boswell@gmail.com)
@@ -28,7 +28,7 @@ License: GPL2
28
 
29
  define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
30
  define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
31
- define( 'VIDEO_THUMBNAILS_VERSION', '2.5.2' );
32
 
33
  // Providers
34
  require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-video-thumbnails-providers.php' );
@@ -154,7 +154,7 @@ class Video_Thumbnails {
154
  <li>Go to the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ); ?>">Debugging page</a> and click "Test Image Downloading" to test your server's ability to save an image from a video source.</li>
155
  <li>Try posting a video from other sources to help narrow down the problem.</li>
156
  <li>Search the <a href="http://wordpress.org/support/plugin/video-thumbnails">support threads</a> to see if anyone has had the same issue.</li>
157
- <li>If you are still unable to resolve the problem, <a href="http://wordpress.org/support/plugin/video-thumbnails">start a thread</a> with a good descriptive title ("Error" or "No thumbnails" is a bad title) and be sure to include the results of your testing as well. Also be sure to include the name of your theme, any video plugins you're using, and any other details you can think of.</li>
158
  </ol>
159
  <?php
160
  }
5
  Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Supports YouTube, Vimeo, Facebook, Vine, Justin.tv, Twitch, Dailymotion, Metacafe, Blip, Google Drive, Funny or Die, CollegeHumor, MPORA, Wistia, Youku, and Rutube.
6
  Author: Sutherland Boswell
7
  Author URI: http://sutherlandboswell.com
8
+ Version: 2.5.3
9
  License: GPL2
10
  */
11
  /* Copyright 2014 Sutherland Boswell (email : sutherland.boswell@gmail.com)
28
 
29
  define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
30
  define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
31
+ define( 'VIDEO_THUMBNAILS_VERSION', '2.5.3' );
32
 
33
  // Providers
34
  require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-video-thumbnails-providers.php' );
154
  <li>Go to the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ); ?>">Debugging page</a> and click "Test Image Downloading" to test your server's ability to save an image from a video source.</li>
155
  <li>Try posting a video from other sources to help narrow down the problem.</li>
156
  <li>Search the <a href="http://wordpress.org/support/plugin/video-thumbnails">support threads</a> to see if anyone has had the same issue.</li>
157
+ <li>If you are still unable to resolve the problem, <a href="http://wordpress.org/support/plugin/video-thumbnails">start a thread</a> with a <strong>good descriptive</strong> title ("Error" or "No thumbnails" is a <strong>bad</strong> title) and be sure to include the results of your testing as well. Also be sure to include the <strong>name of your theme</strong>, any <strong>video plugins</strong> you're using, and any other details you can think of.</li>
158
  </ol>
159
  <?php
160
  }