Version Description
- Added support for VK iFrame embeds
- Minor bugfixes and improvements
Download this release
Release Info
Developer | sutherlandboswell |
Plugin | Video Thumbnails |
Version | 2.6 |
Comparing to | |
See all releases |
Code changes from version 2.5.3 to 2.6
php/class-video-thumbnails-settings.php
CHANGED
@@ -522,6 +522,8 @@ class Video_Thumbnails_Settings {
|
|
522 |
|
523 |
<p>This test checks for issues with the process of saving a remote thumbnail to your local media library.</p>
|
524 |
|
|
|
|
|
525 |
<div id="saving_media-test">
|
526 |
<p><input type="submit" class="button-primary" onclick="test_video_thumbnail('saving_media');" value="Test Image Downloading" /></p>
|
527 |
</div>
|
522 |
|
523 |
<p>This test checks for issues with the process of saving a remote thumbnail to your local media library.</p>
|
524 |
|
525 |
+
<p>Also be sure to test that you can manually upload an image to your site. If you're unable to upload images, you may need to <a href="http://codex.wordpress.org/Changing_File_Permissions">change file permissions</a>.</p>
|
526 |
+
|
527 |
<div id="saving_media-test">
|
528 |
<p><input type="submit" class="button-primary" onclick="test_video_thumbnail('saving_media');" value="Test Image Downloading" /></p>
|
529 |
</div>
|
php/providers/class-video-thumbnails-providers.php
CHANGED
@@ -97,6 +97,7 @@ require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-blip-thumbnails.php'
|
|
97 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-justintv-thumbnails.php' );
|
98 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-dailymotion-thumbnails.php' );
|
99 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-metacafe-thumbnails.php' );
|
|
|
100 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-funnyordie-thumbnails.php' );
|
101 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-mpora-thumbnails.php' );
|
102 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-wistia-thumbnails.php' );
|
97 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-justintv-thumbnails.php' );
|
98 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-dailymotion-thumbnails.php' );
|
99 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-metacafe-thumbnails.php' );
|
100 |
+
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-vk-thumbnails.php' );
|
101 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-funnyordie-thumbnails.php' );
|
102 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-mpora-thumbnails.php' );
|
103 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-wistia-thumbnails.php' );
|
php/providers/class-vk-thumbnails.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
7 |
+
published by the Free Software Foundation.
|
8 |
+
|
9 |
+
This program is distributed in the hope that it will be useful,
|
10 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
+
GNU General Public License for more details.
|
13 |
+
|
14 |
+
You should have received a copy of the GNU General Public License
|
15 |
+
along with this program; if not, write to the Free Software
|
16 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
+
*/
|
18 |
+
|
19 |
+
// Require thumbnail provider class
|
20 |
+
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-video-thumbnails-providers.php' );
|
21 |
+
|
22 |
+
class VK_Thumbnails extends Video_Thumbnails_Providers {
|
23 |
+
|
24 |
+
// Human-readable name of the video provider
|
25 |
+
public $service_name = 'VK';
|
26 |
+
const service_name = 'VK';
|
27 |
+
// Slug for the video provider
|
28 |
+
public $service_slug = 'vk';
|
29 |
+
const service_slug = 'vk';
|
30 |
+
|
31 |
+
public static function register_provider( $providers ) {
|
32 |
+
$providers[self::service_slug] = new self;
|
33 |
+
return $providers;
|
34 |
+
}
|
35 |
+
|
36 |
+
// Regex strings
|
37 |
+
public $regexes = array(
|
38 |
+
'#(//(?:www\.)?vk\.com/video_ext\.php\?oid=[0-9]+&id=[0-9]+&hash=[0-9a-zA-Z]+)#', // URL
|
39 |
+
);
|
40 |
+
|
41 |
+
// Thumbnail URL
|
42 |
+
public function get_thumbnail_url( $id ) {
|
43 |
+
$request = "http:$id";
|
44 |
+
$response = wp_remote_get( $request, array( 'sslverify' => false ) );
|
45 |
+
if( is_wp_error( $response ) ) {
|
46 |
+
$result = new WP_Error( 'vk_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ) );
|
47 |
+
} else {
|
48 |
+
$doc = new DOMDocument();
|
49 |
+
@$doc->loadHTML( $response['body'] );
|
50 |
+
$metas = $doc->getElementsByTagName( 'img' );
|
51 |
+
for ( $i = 0; $i < $metas->length; $i++ ) {
|
52 |
+
$meta = $metas->item( $i );
|
53 |
+
if ( $meta->getAttribute( 'id' ) == 'player_thumb' ) {
|
54 |
+
$result = $meta->getAttribute( 'src' );
|
55 |
+
break;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
return $result;
|
60 |
+
}
|
61 |
+
|
62 |
+
// Test cases
|
63 |
+
public $test_cases = array(
|
64 |
+
array(
|
65 |
+
'markup' => '<iframe src="http://vk.com/video_ext.php?oid=157000410&id=164106383&hash=0fdb5f49218be7c2&hd=1" width="607" height="360" frameborder="0"></iframe>',
|
66 |
+
'expected' => 'http://cs513416.vk.me/u157000410/video/l_73b292cc.jpg',
|
67 |
+
'expected_hash' => '6d4b086ff1a55c9b48f56bc7848e6c84',
|
68 |
+
'name' => 'iFrame'
|
69 |
+
),
|
70 |
+
);
|
71 |
+
|
72 |
+
}
|
73 |
+
|
74 |
+
// Add to provider array
|
75 |
+
add_filter( 'video_thumbnail_providers', array( 'VK_Thumbnails', 'register_provider' ) );
|
76 |
+
|
77 |
+
?>
|
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.
|
8 |
|
9 |
Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
|
10 |
|
@@ -12,7 +12,7 @@ Video Thumbnails simplifies the process of automatically displaying video thumbn
|
|
12 |
|
13 |
Video Thumbnails makes it easy to automatically display video thumbnails in your template. When you publish a post, this plugin will find the first video embedded and locate the thumbnail for you. Thumbnails can be saved to your media library and set as a featured image automatically. There's even support for custom post types and custom fields!
|
14 |
|
15 |
-
**New!**
|
16 |
|
17 |
Video Thumbnails currently supports these video services:
|
18 |
|
@@ -24,6 +24,7 @@ Video Thumbnails currently supports these video services:
|
|
24 |
* Twitch
|
25 |
* Dailymotion
|
26 |
* Metacafe
|
|
|
27 |
* Blip
|
28 |
* Google Drive
|
29 |
* Funny or Die
|
@@ -36,11 +37,9 @@ Video Thumbnails currently supports these video services:
|
|
36 |
Video Thumbnails even works with most video embedding plugins, including:
|
37 |
|
38 |
* [Refactored Video Importer](https://refactored.co/plugins/video-importer)
|
39 |
-
*
|
40 |
-
*
|
41 |
-
*
|
42 |
-
* [Vimeo Shortcode](http://blog.esimplestudios.com/2010/08/embedding-vimeo-videos-in-wordpress/)
|
43 |
-
* [WP YouTube Lyte](http://wordpress.org/extend/plugins/wp-youtube-lyte/)
|
44 |
|
45 |
Video Thumbnails will always be totally free while remaining a full-featured plugin, but if you'd like to support the developer consider purchasing [Video Thumbnails Pro](https://refactored.co/plugins/video-thumbnails). The pro version runs alongside the standard version and adds additional features like maximum image sizes, more powerful bulk scanning options, a customizable upload directory, and more!
|
46 |
|
@@ -66,6 +65,10 @@ Some functions are available to advanced users who want to customize their theme
|
|
66 |
1. Check the support threads to see if anyone has had the same issue.
|
67 |
1. If you are still unable to resolve the problem, start a thread 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.
|
68 |
|
|
|
|
|
|
|
|
|
69 |
= My theme isn't showing thumbnails, what's wrong? =
|
70 |
|
71 |
The most likely problem is that your theme doesn't support post thumbnails. If thumbnails are supported, you should see a box titled "Featured Image" on the edit post page. If thumbnails aren't supported, your theme will have to be modified to support Featured Images or to support one of our custom functions.
|
@@ -115,6 +118,10 @@ The Vimeo API has a rate limit, so in rare cases you may exceed this limit. Try
|
|
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
|
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.6
|
8 |
|
9 |
Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
|
10 |
|
12 |
|
13 |
Video Thumbnails makes it easy to automatically display video thumbnails in your template. When you publish a post, this plugin will find the first video embedded and locate the thumbnail for you. Thumbnails can be saved to your media library and set as a featured image automatically. There's even support for custom post types and custom fields!
|
14 |
|
15 |
+
**New!** [Video Thumbnails Pro](https://refactored.co/plugins/video-thumbnails) gives you even more power. Enjoy features like maximum image sizes, more powerful bulk scanning options, a customizable upload directory, and more!
|
16 |
|
17 |
Video Thumbnails currently supports these video services:
|
18 |
|
24 |
* Twitch
|
25 |
* Dailymotion
|
26 |
* Metacafe
|
27 |
+
* VK
|
28 |
* Blip
|
29 |
* Google Drive
|
30 |
* Funny or Die
|
37 |
Video Thumbnails even works with most video embedding plugins, including:
|
38 |
|
39 |
* [Refactored Video Importer](https://refactored.co/plugins/video-importer)
|
40 |
+
* Viper's Video Quicktags
|
41 |
+
* Automatic Youtube Video Posts Plugin
|
42 |
+
* WP YouTube Lyte
|
|
|
|
|
43 |
|
44 |
Video Thumbnails will always be totally free while remaining a full-featured plugin, but if you'd like to support the developer consider purchasing [Video Thumbnails Pro](https://refactored.co/plugins/video-thumbnails). The pro version runs alongside the standard version and adds additional features like maximum image sizes, more powerful bulk scanning options, a customizable upload directory, and more!
|
45 |
|
65 |
1. Check the support threads to see if anyone has had the same issue.
|
66 |
1. If you are still unable to resolve the problem, start a thread 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.
|
67 |
|
68 |
+
= Can I get thumbnails from a specific time? =
|
69 |
+
|
70 |
+
No, Video Thumbnails only uses thumbnails provided by the source. If you're posting videos from your own account, many providers allow you to choose the thumbnail.
|
71 |
+
|
72 |
= My theme isn't showing thumbnails, what's wrong? =
|
73 |
|
74 |
The most likely problem is that your theme doesn't support post thumbnails. If thumbnails are supported, you should see a box titled "Featured Image" on the edit post page. If thumbnails aren't supported, your theme will have to be modified to support Featured Images or to support one of our custom functions.
|
118 |
|
119 |
== Changelog ==
|
120 |
|
121 |
+
= 2.6 =
|
122 |
+
* Added support for VK iFrame embeds
|
123 |
+
* Minor bugfixes and improvements
|
124 |
+
|
125 |
= 2.5.3 =
|
126 |
* Fixed bug with Automatic YouTube Video Posts when automatic publishing is disabled or when rescanning existing posts
|
127 |
* Fixed bug with bulk scanner when 0 posts are queued
|
video-thumbnails.php
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
/*
|
3 |
Plugin Name: Video Thumbnails
|
4 |
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.
|
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.
|
32 |
|
33 |
// Providers
|
34 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-video-thumbnails-providers.php' );
|
@@ -326,8 +326,13 @@ class Video_Thumbnails {
|
|
326 |
} else {
|
327 |
|
328 |
// Translate MIME type into an extension
|
329 |
-
if ( $image_type == 'image/jpeg' )
|
330 |
-
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
// Construct a file name with extension
|
333 |
$new_filename = self::construct_filename( $post_id ) . $image_extension;
|
2 |
/*
|
3 |
Plugin Name: Video Thumbnails
|
4 |
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, VK, 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.6
|
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.6' );
|
32 |
|
33 |
// Providers
|
34 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-video-thumbnails-providers.php' );
|
326 |
} else {
|
327 |
|
328 |
// Translate MIME type into an extension
|
329 |
+
if ( $image_type == 'image/jpeg' ) {
|
330 |
+
$image_extension = '.jpg';
|
331 |
+
} elseif ( $image_type == 'image/png' ) {
|
332 |
+
$image_extension = '.png';
|
333 |
+
} else {
|
334 |
+
return new WP_Error( 'thumbnail_upload', __( 'Unsupported MIME type:' ) . ' ' . $image_type );
|
335 |
+
}
|
336 |
|
337 |
// Construct a file name with extension
|
338 |
$new_filename = self::construct_filename( $post_id ) . $image_extension;
|