Video Thumbnails - Version 1.0.5

Version Description

  • Now using cURL to help save thumbnails locally instead of file_get_contents()
Download this release

Release Info

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

Code changes from version 1.0.4 to 1.0.5

Files changed (2) hide show
  1. readme.txt +4 -1
  2. video-thumbnails.php +10 -2
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://amzn.com/w/1L25YG6FO8AZ1
4
  Tags: Video, YouTube, Vimeo, Blip.tv, Justin.tv, Thumbnails
5
  Requires at least: 3.0
6
  Tested up to: 3.0.4
7
- Stable tag: 1.0.4
8
 
9
  Video Thumbnails is a simple plugin that makes it easy to automatically display video thumbnails in your template.
10
 
@@ -77,6 +77,9 @@ The Vimeo API has a rate limit, so in rare cases you may exceed this limit. Try
77
 
78
  == Changelog ==
79
 
 
 
 
80
  = 1.0.4 =
81
  * Added compatibility with YouTube's new iframe embedding
82
  * Now supports most embedding plugins
4
  Tags: Video, YouTube, Vimeo, Blip.tv, Justin.tv, Thumbnails
5
  Requires at least: 3.0
6
  Tested up to: 3.0.4
7
+ Stable tag: 1.0.5
8
 
9
  Video Thumbnails is a simple plugin that makes it easy to automatically display video thumbnails in your template.
10
 
77
 
78
  == Changelog ==
79
 
80
+ = 1.0.5 =
81
+ * Now using cURL to help save thumbnails locally instead of file_get_contents()
82
+
83
  = 1.0.4 =
84
  * Added compatibility with YouTube's new iframe embedding
85
  * Now supports most embedding plugins
video-thumbnails.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://sutherlandboswell.com/2010/11/wordpress-video-thumbnails/
5
  Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Currently supports YouTube, Vimeo, Blip.tv, and Justin.tv.
6
  Author: Sutherland Boswell
7
  Author URI: http://sutherlandboswell.com
8
- Version: 1.0.4
9
  License: GPL2
10
  */
11
  /* Copyright 2010 Sutherland Boswell (email : sutherland.boswell@gmail.com)
@@ -189,7 +189,15 @@ function get_video_thumbnail($post_id=null) {
189
  // Save as Attachment if enabled
190
  if(get_option('video_thumbnails_save_media')==1) {
191
 
192
- $upload = wp_upload_bits(basename($new_thumbnail), null, file_get_contents($new_thumbnail));
 
 
 
 
 
 
 
 
193
 
194
  $new_thumbnail = $upload['url'];
195
 
5
  Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Currently supports YouTube, Vimeo, Blip.tv, and Justin.tv.
6
  Author: Sutherland Boswell
7
  Author URI: http://sutherlandboswell.com
8
+ Version: 1.0.5
9
  License: GPL2
10
  */
11
  /* Copyright 2010 Sutherland Boswell (email : sutherland.boswell@gmail.com)
189
  // Save as Attachment if enabled
190
  if(get_option('video_thumbnails_save_media')==1) {
191
 
192
+ $ch = curl_init();
193
+ $timeout = 0;
194
+ curl_setopt ($ch, CURLOPT_URL, $new_thumbnail);
195
+ curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
196
+ curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
197
+ $image_contents = curl_exec($ch);
198
+ curl_close($ch);
199
+
200
+ $upload = wp_upload_bits(basename($new_thumbnail), null, $image_contents);
201
 
202
  $new_thumbnail = $upload['url'];
203