Changeset 837855
- Timestamp:
- 01/13/2014 07:11:42 PM (12 years ago)
- Location:
- video-thumbnails
- Files:
-
- 10 added
- 27 edited
- 12 copied
-
tags/2.4 (copied) (copied from video-thumbnails/trunk)
-
tags/2.4/css (added)
-
tags/2.4/css/bulk.css (added)
-
tags/2.4/js/bulk.js (added)
-
tags/2.4/php/class-video-thumbnails-settings.php (copied) (copied from video-thumbnails/trunk/php/class-video-thumbnails-settings.php) (8 diffs)
-
tags/2.4/php/providers/class-blip-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-blip-thumbnails.php) (1 diff)
-
tags/2.4/php/providers/class-collegehumor-thumbnails.php (modified) (1 diff)
-
tags/2.4/php/providers/class-dailymotion-thumbnails.php (modified) (1 diff)
-
tags/2.4/php/providers/class-facebook-thumbnails.php (modified) (1 diff)
-
tags/2.4/php/providers/class-funnyordie-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-funnyordie-thumbnails.php) (1 diff)
-
tags/2.4/php/providers/class-googledrive-thumbnails.php (added)
-
tags/2.4/php/providers/class-justintv-thumbnails.php (modified) (1 diff)
-
tags/2.4/php/providers/class-kaltura-thumbnails.php (modified) (1 diff)
-
tags/2.4/php/providers/class-metacafe-thumbnails.php (modified) (1 diff)
-
tags/2.4/php/providers/class-mpora-thumbnails.php (modified) (1 diff)
-
tags/2.4/php/providers/class-rutube-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-rutube-thumbnails.php) (1 diff)
-
tags/2.4/php/providers/class-twitch-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-twitch-thumbnails.php) (1 diff)
-
tags/2.4/php/providers/class-video-thumbnails-providers.php (copied) (copied from video-thumbnails/trunk/php/providers/class-video-thumbnails-providers.php) (3 diffs)
-
tags/2.4/php/providers/class-vimeo-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-vimeo-thumbnails.php) (2 diffs)
-
tags/2.4/php/providers/class-vine-thumbnails.php (added)
-
tags/2.4/php/providers/class-wistia-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-wistia-thumbnails.php) (1 diff)
-
tags/2.4/php/providers/class-youku-thumbnails.php (modified) (1 diff)
-
tags/2.4/php/providers/class-youtube-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-youtube-thumbnails.php) (1 diff)
-
tags/2.4/readme.txt (copied) (copied from video-thumbnails/trunk/readme.txt) (4 diffs)
-
tags/2.4/video-thumbnails.php (copied) (copied from video-thumbnails/trunk/video-thumbnails.php) (6 diffs)
-
trunk/css (added)
-
trunk/css/bulk.css (added)
-
trunk/js/bulk.js (added)
-
trunk/php/class-video-thumbnails-settings.php (modified) (8 diffs)
-
trunk/php/providers/class-blip-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-collegehumor-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-dailymotion-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-facebook-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-funnyordie-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-googledrive-thumbnails.php (added)
-
trunk/php/providers/class-justintv-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-kaltura-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-metacafe-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-mpora-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-rutube-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-twitch-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-video-thumbnails-providers.php (modified) (3 diffs)
-
trunk/php/providers/class-vimeo-thumbnails.php (modified) (2 diffs)
-
trunk/php/providers/class-vine-thumbnails.php (added)
-
trunk/php/providers/class-wistia-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-youku-thumbnails.php (modified) (1 diff)
-
trunk/php/providers/class-youtube-thumbnails.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/video-thumbnails.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
video-thumbnails/tags/2.4/php/class-video-thumbnails-settings.php
r794208 r837855 38 38 // Initialize options 39 39 add_action( 'admin_init', array( &$this, 'initialize_options' ) ); 40 // Ajax past search callback 41 add_action( 'wp_ajax_past_video_thumbnail', array( &$this, 'ajax_past_callback' ) ); 42 // Ajax past search callback 40 // Ajax clear all callback 43 41 add_action( 'wp_ajax_clear_all_video_thumbnails', array( &$this, 'ajax_clear_all_callback' ) ); 44 42 // Ajax test callbacks … … 50 48 // Admin scripts 51 49 add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) ); 52 }53 // Ajax past posts script54 if ( isset ( $_GET['page'] ) && ( $_GET['page'] == 'video_thumbnails' ) && isset ( $_GET['tab'] ) && ( $_GET['tab'] == 'mass_actions' ) ) {55 add_action( 'admin_head', array( &$this, 'ajax_past_script' ) );56 50 } 57 51 } … … 140 134 wp_enqueue_script( 'video_thumbnails_test', plugins_url( 'js/test.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) ); 141 135 wp_enqueue_script( 'video_thumbnails_clear', plugins_url( 'js/clear.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) ); 142 }143 144 function ajax_past_script() {145 146 ?><!-- Video Thumbnails Past Post Ajax -->147 <script type="text/javascript">148 function video_thumbnails_past(id) {149 150 var data = {151 action: 'past_video_thumbnail',152 post_id: id153 };154 155 // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php156 jQuery.post(ajaxurl, data, function(response){157 158 document.getElementById(id+'_result').innerHTML = response;159 160 });161 162 };163 <?php164 $id_array = get_posts( array(165 'showposts' => -1,166 'post_type' => $this->options['post_types'],167 'fields' => 'ids'168 ) );169 $ids = implode( ', ', $id_array );170 ?>171 172 var scanComplete = false;173 174 function scan_video_thumbnails(){175 176 if(scanComplete==false){177 scanComplete = true;178 var ids = new Array(<?php echo $ids; ?>);179 for (var i = 0; i < ids.length; i++){180 var container = document.getElementById('video-thumbnails-past');181 var new_element = document.createElement('li');182 new_element.setAttribute('id',ids[i]+'_result');183 new_element.innerHTML = 'Waiting...';184 container.insertBefore(new_element, container.firstChild);185 }186 for (var i = 0; i < ids.length; i++){187 document.getElementById(ids[i]+'_result').innerHTML = '<span style="color:yellow">•</span> Working...';188 video_thumbnails_past(ids[i]);189 }190 } else {191 alert('Scan has already been run, please reload the page before trying again.')192 }193 194 }195 </script><?php196 197 }198 199 function ajax_past_callback() {200 global $wpdb; // this is how you get access to the database201 202 $post_id = $_POST['post_id'];203 204 echo get_the_title( $post_id ) . ' - ';205 206 $video_thumbnail = get_video_thumbnail( $post_id );207 208 if ( is_wp_error( $video_thumbnail ) ) {209 echo $video_thumbnail->get_error_message();210 } else if ( $video_thumbnail != null ) {211 echo '<span style="color:green">✔</span> Success!';212 } else {213 echo '<span style="color:red">✖</span> Couldn\'t find a video thumbnail for this post.';214 }215 216 die();217 136 } 218 137 … … 240 159 241 160 die(); 161 } 162 163 function get_file_hash( $url ) { 164 $response = wp_remote_get( $url, array( 'sslverify' => false ) ); 165 if( is_wp_error( $response ) ) { 166 $result = false; 167 } else { 168 $result = md5( $response['body'] ); 169 } 170 return $result; 242 171 } 243 172 … … 274 203 $result = explode( '?', $result ); 275 204 $result = $result[0]; 276 if ( $result == $test_case['expected'] ) { 205 $result_hash = $this->get_file_hash( $result ); 206 $matched = ( $result_hash == $test_case['expected_hash'] ? true : false ); 207 if ( $matched ) { 277 208 echo '<td style="color:green;">✔ Passed</td>'; 278 209 $passed++; … … 281 212 $failed++; 282 213 } 283 echo '<td>' . $result . '</td>'; 214 echo '<td>'; 215 if ( $result ) { 216 echo '<a href="' . $result . '">View Image</a>'; 217 } 218 if ( $result_hash ) { 219 echo ' <code>' . $result_hash . '</code>'; 220 } 221 echo '</td>'; 284 222 } 285 223 echo '</tr>'; … … 367 305 } 368 306 369 function sanitize_callback( $input ) { 307 function sanitize_callback( $input ) { 370 308 $current_settings = get_option( 'video_thumbnails' ); 371 309 $output = array(); … … 520 458 <p>Scan all of your past posts for video thumbnails. Be sure to save any settings before running the scan.</p> 521 459 522 <p><input type="submit" class="button-primary" onclick="scan_video_thumbnails();" value="Scan Past Posts" /></p> 523 524 <ol id="video-thumbnails-past"> 525 </ol> 460 <p><a class="button-primary" href="<?php echo admin_url( 'tools.php?page=video-thumbnails-bulk' ); ?>">Scan Past Posts</a></p> 526 461 527 462 <h3>Clear all Video Thumbnails</h3> -
video-thumbnails/tags/2.4/php/providers/class-blip-thumbnails.php
r746462 r837855 59 59 public $test_cases = array( 60 60 array( 61 'markup' => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917', 62 'expected' => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg', 63 'name' => 'Video URL' 61 'markup' => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917', 62 'expected' => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg', 63 'expected_hash' => '26a622f72bd4bdb3f8189f85598dd95d', 64 'name' => 'Video URL' 64 65 ), 65 66 array( 66 'markup' => '<iframe src="http://blip.tv/play/AYL1uFkC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYL1uFkC" style="display:none"></embed>', 67 'expected' => 'http://a.images.blip.tv/ReelScience-TheScientificMethodOfOz139.jpg', 68 'name' => 'iFrame player' 67 'markup' => '<iframe src="http://blip.tv/play/AYL1uFkC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYL1uFkC" style="display:none"></embed>', 68 'expected' => 'http://a.images.blip.tv/ReelScience-TheScientificMethodOfOz139.jpg', 69 'expected_hash' => 'bd2f58c2bc874e3a017167e74e5c842f', 70 'name' => 'iFrame player' 69 71 ), 70 72 array( 71 'markup' => '<iframe src="http://blip.tv/play/AYLz%2BEsC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYLz+EsC" style="display:none"></embed>', 72 'expected' => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png', 73 'name' => 'iFrame player (special characters in ID)' 73 'markup' => '<iframe src="http://blip.tv/play/AYLz%2BEsC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYLz+EsC" style="display:none"></embed>', 74 'expected' => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png', 75 'expected_hash' => '87efa9f6b0d9111b0826ae4fbdddec1b', 76 'name' => 'iFrame player (special characters in ID)' 74 77 ), 75 78 ); -
video-thumbnails/tags/2.4/php/providers/class-collegehumor-thumbnails.php
r710079 r837855 55 55 public $test_cases = array( 56 56 array( 57 'markup' => '<iframe src="http://www.collegehumor.com/e/6830834" width="600" height="338" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe><div style="padding:5px 0; text-align:center; width:600px;"><p><a href="http://www.collegehumor.com/videos/most-viewed/this-year">CollegeHumor\'s Favorite Funny Videos</a></p></div>', 58 'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg', 59 'name' => 'Embed' 57 'markup' => '<iframe src="http://www.collegehumor.com/e/6830834" width="600" height="338" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe><div style="padding:5px 0; text-align:center; width:600px;"><p><a href="http://www.collegehumor.com/videos/most-viewed/this-year">CollegeHumor\'s Favorite Funny Videos</a></p></div>', 58 'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg', 59 'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15', 60 'name' => 'Embed' 60 61 ), 61 62 array( 62 'markup' => 'http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody', 63 'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg', 64 'name' => 'URL' 63 'markup' => 'http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody', 64 'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg', 65 'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15', 66 'name' => 'URL' 65 67 ), 66 68 ); -
video-thumbnails/tags/2.4/php/providers/class-dailymotion-thumbnails.php
r710079 r837855 57 57 public $test_cases = array( 58 58 array( 59 'markup' => '<iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/xqlhts"></iframe><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>', 60 'expected' => 'http://s1.dmcdn.net/AMjdy.jpg', 61 'name' => 'iFrame player' 59 'markup' => '<iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/xqlhts"></iframe><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>', 60 'expected' => 'http://s1.dmcdn.net/AMjdy.jpg', 61 'expected_hash' => '077888b97839254892a377f51c06e642', 62 'name' => 'iFrame player' 62 63 ), 63 64 array( 64 'markup' => '<object width="480" height="270"><param name="movie" value="http://www.dailymotion.com/swf/video/xqlhts"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/xqlhts" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always"></embed></object><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>', 65 'expected' => 'http://s1.dmcdn.net/AMjdy.jpg', 66 'name' => 'Flash player' 65 'markup' => '<object width="480" height="270"><param name="movie" value="http://www.dailymotion.com/swf/video/xqlhts"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/xqlhts" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always"></embed></object><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>', 66 'expected' => 'http://s1.dmcdn.net/AMjdy.jpg', 67 'expected_hash' => '077888b97839254892a377f51c06e642', 68 'name' => 'Flash player' 67 69 ), 68 70 ); -
video-thumbnails/tags/2.4/php/providers/class-facebook-thumbnails.php
r710772 r837855 48 48 public $test_cases = array( 49 49 array( 50 'markup' => '<object width=420 height=180><param name=allowfullscreen value=true></param><param name=allowscriptaccess value=always></param><param name=movie value="http://www.facebook.com/v/2560032632599"></param><embed src="http://www.facebook.com/v/2560032632599" type="application/x-shockwave-flash" allowscriptaccess=always allowfullscreen=true width=420 height=180></embed></object>', 51 'expected' => 'https://graph.facebook.com/2560032632599/picture', 52 'name' => 'Flash Embed' 50 'markup' => '<object width=420 height=180><param name=allowfullscreen value=true></param><param name=allowscriptaccess value=always></param><param name=movie value="http://www.facebook.com/v/2560032632599"></param><embed src="http://www.facebook.com/v/2560032632599" type="application/x-shockwave-flash" allowscriptaccess=always allowfullscreen=true width=420 height=180></embed></object>', 51 'expected' => 'https://graph.facebook.com/2560032632599/picture', 52 'expected_hash' => '619591ec126ad889799ad992a227c75e', 53 'name' => 'Flash Embed' 53 54 ), 54 55 array( 55 'markup' => '<iframe src="https://www.facebook.com/video/embed?video_id=2560032632599" width="960" height="720" frameborder="0"></iframe>', 56 'expected' => 'https://graph.facebook.com/2560032632599/picture', 57 'name' => 'iFrame Embed' 56 'markup' => '<iframe src="https://www.facebook.com/video/embed?video_id=2560032632599" width="960" height="720" frameborder="0"></iframe>', 57 'expected' => 'https://graph.facebook.com/2560032632599/picture', 58 'expected_hash' => '619591ec126ad889799ad992a227c75e', 59 'name' => 'iFrame Embed' 58 60 ), 59 61 ); -
video-thumbnails/tags/2.4/php/providers/class-funnyordie-thumbnails.php
r835793 r837855 56 56 public $test_cases = array( 57 57 array( 58 'markup' => '<iframe src="http://www.funnyordie.com/embed/5325b03b52" width="640" height="400" frameborder="0"></iframe>', 59 'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg', 60 'name' => 'iFrame player' 58 'markup' => '<iframe src="http://www.funnyordie.com/embed/5325b03b52" width="640" height="400" frameborder="0"></iframe>', 59 'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg', 60 'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b', 61 'name' => 'iFrame player' 61 62 ), 62 63 array( 63 'markup' => '<object width="640" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="ordie_player_5325b03b52"><param name="movie" value="http://player.ordienetworks.com/flash/fodplayer.swf" /><param name="flashvars" value="key=5325b03b52" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always"><embed width="640" height="400" flashvars="key=5325b03b52" allowfullscreen="true" allowscriptaccess="always" quality="high" src="http://player.ordienetworks.com/flash/fodplayer.swf" name="ordie_player_5325b03b52" type="application/x-shockwave-flash"></embed></object>', 64 'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg', 65 'name' => 'Flash player' 64 'markup' => '<object width="640" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="ordie_player_5325b03b52"><param name="movie" value="http://player.ordienetworks.com/flash/fodplayer.swf" /><param name="flashvars" value="key=5325b03b52" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always"><embed width="640" height="400" flashvars="key=5325b03b52" allowfullscreen="true" allowscriptaccess="always" quality="high" src="http://player.ordienetworks.com/flash/fodplayer.swf" name="ordie_player_5325b03b52" type="application/x-shockwave-flash"></embed></object>', 65 'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg', 66 'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b', 67 'name' => 'Flash player' 66 68 ), 67 69 ); -
video-thumbnails/tags/2.4/php/providers/class-justintv-thumbnails.php
r710079 r837855 55 55 public $test_cases = array( 56 56 array( 57 'markup' => '<object type="application/x-shockwave-flash" height="300" width="400" id="clip_embed_player_flash" data="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" bgcolor="#000000"><param name="movie" value="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="auto_play=false&start_volume=25&title=Title&channel=scamschoolbrian&archive_id=392481524" /></object>', 58 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-392481524-320x240.jpg', 59 'name' => 'Embed' 57 'markup' => '<object type="application/x-shockwave-flash" height="300" width="400" id="clip_embed_player_flash" data="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" bgcolor="#000000"><param name="movie" value="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="auto_play=false&start_volume=25&title=Title&channel=scamschoolbrian&archive_id=392481524" /></object>', 58 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-392481524-320x240.jpg', 59 'expected_hash' => '7f260a2ce6ae75a3c2e5012108f161b7', 60 'name' => 'Embed' 60 61 ), 61 62 ); -
video-thumbnails/tags/2.4/php/providers/class-kaltura-thumbnails.php
r710079 r837855 63 63 public $test_cases = array( 64 64 array( 65 'markup' => '<script type="text/javascript" src="http://cdnapi.kaltura.com/p/1374841/sp/137484100/embedIframeJs/uiconf_id/12680902/partner_id/1374841?entry_id=1_y7xzqsxw&playerId=kaltura_player_1363589321&cache_st=1363589321&autoembed=true&width=400&height=333&"></script>',65 'markup' => '<script type="text/javascript" src="http://cdnapi.kaltura.com/p/1374841/sp/137484100/embedIframeJs/uiconf_id/12680902/partner_id/1374841?entry_id=1_y7xzqsxw&playerId=kaltura_player_1363589321&cache_st=1363589321&autoembed=true&width=400&height=333&"></script>', 66 66 'expected' => 'http://example.com/thumbnail.jpg', 67 'name' => 'Auto embed'67 'name' => 'Auto embed' 68 68 ), 69 69 ); -
video-thumbnails/tags/2.4/php/providers/class-metacafe-thumbnails.php
r710079 r837855 56 56 public $test_cases = array( 57 57 array( 58 'markup' => '<embed flashVars="playerVars=autoPlay=no" src="http://www.metacafe.com/fplayer/8456223/men_in_black_3_trailer_2.swf" width="440" height="248" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_8456223" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>', 59 'expected' => 'http://s4.mcstatic.com/thumb/8456223/22479418/4/catalog_item5/0/1/men_in_black_3_trailer_2.jpg', 60 'name' => 'Embed' 58 'markup' => '<embed flashVars="playerVars=autoPlay=no" src="http://www.metacafe.com/fplayer/8456223/men_in_black_3_trailer_2.swf" width="440" height="248" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_8456223" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>', 59 'expected' => 'http://s4.mcstatic.com/thumb/8456223/22479418/4/catalog_item5/0/1/men_in_black_3_trailer_2.jpg', 60 'expected_hash' => 'df46215fef1d9fb68eea64ba3ed9a4fd', 61 'name' => 'Embed' 61 62 ), 62 63 ); -
video-thumbnails/tags/2.4/php/providers/class-mpora-thumbnails.php
r710079 r837855 48 48 public $test_cases = array( 49 49 array( 50 'markup' => '<object width="480" height="270" id="mporaplayer_wEr2CBooV_N" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" ><param name="movie" value="http://video.mpora.com/ep/wEr2CBooV/"></param><param name="wmode" value="transparent"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="http://video.mpora.com/ep/wEr2CBooV/" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>', 51 'expected' => 'http://ugc4.mporatrons.com/thumbs/wEr2CBooV_640x360_0000.jpg', 52 'name' => 'Flash player' 50 'markup' => '<object width="480" height="270" id="mporaplayer_wEr2CBooV_N" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" ><param name="movie" value="http://video.mpora.com/ep/wEr2CBooV/"></param><param name="wmode" value="transparent"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="http://video.mpora.com/ep/wEr2CBooV/" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>', 51 'expected' => 'http://ugc4.mporatrons.com/thumbs/wEr2CBooV_640x360_0000.jpg', 52 'expected_hash' => '95075bd4941251ebecbab3b436a90c49', 53 'name' => 'Flash player' 53 54 ), 54 55 array( 55 'markup' => '<iframe width="640" height="360" src="http://mpora.com/videos/AAdfegovdop0/embed" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 56 'expected' => 'http://ugc4.mporatrons.com/thumbs/AAdfegovdop0_640x360_0000.jpg', 57 'name' => 'iFrame player' 56 'markup' => '<iframe width="640" height="360" src="http://mpora.com/videos/AAdfegovdop0/embed" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 57 'expected' => 'http://ugc4.mporatrons.com/thumbs/AAdfegovdop0_640x360_0000.jpg', 58 'expected_hash' => '45db22a2ba5ef20163f52ba562b89259', 59 'name' => 'iFrame player' 58 60 ), 59 61 ); -
video-thumbnails/tags/2.4/php/providers/class-rutube-thumbnails.php
r834141 r837855 56 56 public $test_cases = array( 57 57 array( 58 'markup' => 'http://rutube.ru/video/ca8607cd4f7ef28516e043dde0068564/', 59 'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg', 60 'name' => 'Video link' 58 'markup' => 'http://rutube.ru/video/ca8607cd4f7ef28516e043dde0068564/', 59 'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg', 60 'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354', 61 'name' => 'Video link' 61 62 ), 62 63 array( 63 'markup' => '<iframe width="720" height="405" src="//rutube.ru/video/embed/6608735" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>', 64 'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg', 65 'name' => 'iFrame embed' 64 'markup' => '<iframe width="720" height="405" src="//rutube.ru/video/embed/6608735" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>', 65 'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg', 66 'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354', 67 'name' => 'iFrame embed' 66 68 ), 67 69 ); -
video-thumbnails/tags/2.4/php/providers/class-twitch-thumbnails.php
r835793 r837855 56 56 public $test_cases = array( 57 57 array( 58 'markup' => 'http://www.twitch.tv/vanillatv/c/1537974', 59 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg', 60 'name' => 'Video link' 58 'markup' => 'http://www.twitch.tv/vanillatv/c/1537974', 59 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg', 60 'expected_hash' => 'f3921b65f799aa648ef6dae29871c137', 61 'name' => 'Video link' 61 62 ), 62 63 array( 63 'markup' => '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/archive_embed_player.swf" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"><param name="movie" value="http://www.twitch.tv/widgets/archive_embed_player.swf"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="allowFullScreen" value="true"><param name="flashvars" value="title=VanillaTV%2B-%2BSweden%2Bvs%2BRussia%2B-%2BETF2L%2BNations%2BCup%2B-%2BSnakewater%2B%255BMap3%255D%2B-%2BPart%2B3&channel=vanillatv&auto_play=false&start_volume=25&chapter_id=1537974"></object>', 64 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg', 65 'name' => 'Flash embed' 64 'markup' => '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/archive_embed_player.swf" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"><param name="movie" value="http://www.twitch.tv/widgets/archive_embed_player.swf"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="allowFullScreen" value="true"><param name="flashvars" value="title=VanillaTV%2B-%2BSweden%2Bvs%2BRussia%2B-%2BETF2L%2BNations%2BCup%2B-%2BSnakewater%2B%255BMap3%255D%2B-%2BPart%2B3&channel=vanillatv&auto_play=false&start_volume=25&chapter_id=1537974"></object>', 65 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg', 66 'expected_hash' => 'f3921b65f799aa648ef6dae29871c137', 67 'name' => 'Flash embed' 66 68 ), 67 69 ); -
video-thumbnails/tags/2.4/php/providers/class-video-thumbnails-providers.php
r835793 r837855 1 1 <?php 2 2 3 /* Copyright 201 3Sutherland Boswell (email : [email protected])3 /* Copyright 2014 Sutherland Boswell (email : [email protected]) 4 4 5 5 This program is free software; you can redistribute it and/or modify … … 93 93 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-vimeo-thumbnails.php' ); 94 94 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-facebook-thumbnails.php' ); 95 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-vine-thumbnails.php' ); 95 96 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-blip-thumbnails.php' ); 96 97 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-justintv-thumbnails.php' ); … … 105 106 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-rutube-thumbnails.php' ); 106 107 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-twitch-thumbnails.php' ); 108 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-googledrive-thumbnails.php' ); 107 109 108 110 ?> -
video-thumbnails/tags/2.4/php/providers/class-vimeo-thumbnails.php
r791525 r837855 62 62 // Regex strings 63 63 public $regexes = array( 64 '#<object[^>]+>.+?http://vimeo\.com/moogaloop.swf\?clip_id=([A-Za-z0-9\-_]+)&.+?</object>#s', // Standard Vimeo embed code65 '#(?:https?:)?//player\.vimeo\.com/video/([0-9]+)#', // Vimeo iframe player66 '#\[vimeo id=([A-Za-z0-9\-_]+)]#', // JR_embed shortcode67 '#\[vimeo clip_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Another shortcode68 '#\[vimeo video_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Yet another shortcode69 '#(?:https?://)?(?:www\.)?vimeo\.com/([0-9]+)#', // Vimeo URL70 '#(?:https?://)?(?:www\.)?vimeo\.com/channels/(?:[A-Za-z0-9]+)/([0-9]+)#' // Channel URL64 '#<object[^>]+>.+?http://vimeo\.com/moogaloop.swf\?clip_id=([A-Za-z0-9\-_]+)&.+?</object>#s', // Standard Vimeo embed code 65 '#(?:https?:)?//player\.vimeo\.com/video/([0-9]+)#', // Vimeo iframe player 66 '#\[vimeo id=([A-Za-z0-9\-_]+)]#', // JR_embed shortcode 67 '#\[vimeo clip_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Another shortcode 68 '#\[vimeo video_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Yet another shortcode 69 '#(?:https?://)?(?:www\.)?vimeo\.com/([0-9]+)#', // Vimeo URL 70 '#(?:https?://)?(?:www\.)?vimeo\.com/channels/(?:[A-Za-z0-9]+)/([0-9]+)#' // Channel URL 71 71 ); 72 72 73 73 // Thumbnail URL 74 74 public function get_thumbnail_url( $id ) { 75 // Get our settings76 $client_id = ( isset( $this->options['client_id'] ) && $this->options['client_id'] != '' ? $this->options['client_id'] : false );77 $client_secret = ( isset( $this->options['client_secret'] ) && $this->options['client_secret'] != '' ? $this->options['client_secret'] : false );78 $access_token = ( isset( $this->options['access_token'] ) && $this->options['access_token'] != '' ? $this->options['access_token'] : false );79 $access_token_secret = ( isset( $this->options['access_token_secret'] ) && $this->options['access_token_secret'] != '' ? $this->options['access_token_secret'] : false );75 // Get our settings 76 $client_id = ( isset( $this->options['client_id'] ) && $this->options['client_id'] != '' ? $this->options['client_id'] : false ); 77 $client_secret = ( isset( $this->options['client_secret'] ) && $this->options['client_secret'] != '' ? $this->options['client_secret'] : false ); 78 $access_token = ( isset( $this->options['access_token'] ) && $this->options['access_token'] != '' ? $this->options['access_token'] : false ); 79 $access_token_secret = ( isset( $this->options['access_token_secret'] ) && $this->options['access_token_secret'] != '' ? $this->options['access_token_secret'] : false ); 80 80 // If API credentials are entered, use the API 81 81 if ( $client_id && $client_secret && $access_token && $access_token_secret ) { … … 102 102 public $test_cases = array( 103 103 array( 104 'markup' => '<iframe src="http://player.vimeo.com/video/41504360" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 105 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 106 'name' => 'iFrame' 104 'markup' => '<iframe src="http://player.vimeo.com/video/41504360" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 105 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 106 'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623', 107 'name' => 'iFrame' 107 108 ), 108 109 array( 109 'markup' => '<object width="500" height="281"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=41504360&force_embed=1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00adef&fullscreen=1&autoplay=0&loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=41504360&force_embed=1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object>', 110 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 111 'name' => 'Old embed' 110 'markup' => '<object width="500" height="281"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=41504360&force_embed=1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00adef&fullscreen=1&autoplay=0&loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=41504360&force_embed=1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object>', 111 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 112 'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623', 113 'name' => 'Old embed' 112 114 ), 113 115 array( 114 'markup' => 'https://vimeo.com/channels/soundworkscollection/44520894', 115 'expected' => 'http://b.vimeocdn.com/ts/313/130/313130530_640.jpg', 116 'name' => 'Channel URL' 116 'markup' => 'https://vimeo.com/channels/soundworkscollection/44520894', 117 'expected' => 'http://b.vimeocdn.com/ts/313/130/313130530_640.jpg', 118 'expected_hash' => 'e9fd72872a39272f6c540ee66b1ecf28', 119 'name' => 'Channel URL' 117 120 ), 118 121 ); -
video-thumbnails/tags/2.4/php/providers/class-wistia-thumbnails.php
r794208 r837855 79 79 public $test_cases = array( 80 80 array( 81 'markup' => '<iframe src="http://fast.wistia.net/embed/iframe/po4utu3zde?controlsVisibleOnLoad=true&version=v1&videoHeight=360&videoWidth=640&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="640" height="360"></iframe>', 82 'expected' => 'http://embed-0.wistia.com/deliveries/6928fcba8355e38de4d95863a659e1de23cb2071.jpg', 83 'name' => 'Inline player' 81 'markup' => '<iframe src="http://fast.wistia.net/embed/iframe/po4utu3zde?controlsVisibleOnLoad=true&version=v1&videoHeight=360&videoWidth=640&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="640" height="360"></iframe>', 82 'expected' => 'http://embed-0.wistia.com/deliveries/6928fcba8355e38de4d95863a659e1de23cb2071.jpg', 83 'expected_hash' => 'bc4a2cec9ac97e2ccdae2c7387a01cb4', 84 'name' => 'Inline player' 84 85 ), 85 86 array( 86 'markup' => '<div class=\'wistia_embed\' data-video-height=\'312\' data-video-width=\'499\' id=\'wistia_j1qd2lvys1\'></div> <script charset=\'ISO-8859-1\' src=\'http://fast.wistia.com/static/concat/E-v1.js\'></script> <script> var platform = ( Modernizr.touch ) ? "html5" : "flash"; wistiaEmbed = Wistia.embed("j1qd2lvys1", { version: "v1", videoWidth: 499, videoHeight: 312, playButton: Modernizr.touch, smallPlayButton: Modernizr.touch, playbar: Modernizr.touch, platformPreference: platform, chromeless: Modernizr.touch ? false : true, fullscreenButton: false, autoPlay: !Modernizr.touch, videoFoam: true }); </script>', 87 'expected' => 'http://embed.wistia.com/deliveries/a086707fe096e7f3fbefef1d1dcba1488d23a3e9.jpg', 88 'name' => 'JavaScript API embedding' 87 'markup' => '<div class=\'wistia_embed\' data-video-height=\'312\' data-video-width=\'499\' id=\'wistia_j1qd2lvys1\'></div> <script charset=\'ISO-8859-1\' src=\'http://fast.wistia.com/static/concat/E-v1.js\'></script> <script> var platform = ( Modernizr.touch ) ? "html5" : "flash"; wistiaEmbed = Wistia.embed("j1qd2lvys1", { version: "v1", videoWidth: 499, videoHeight: 312, playButton: Modernizr.touch, smallPlayButton: Modernizr.touch, playbar: Modernizr.touch, platformPreference: platform, chromeless: Modernizr.touch ? false : true, fullscreenButton: false, autoPlay: !Modernizr.touch, videoFoam: true }); </script>', 88 'expected' => 'https://embed-ssl.wistia.com/deliveries/a086707fe096e7f3fbefef1d1dcba1488d23a3e9.jpg', 89 'expected_hash' => '4c63d131604bfc07b5178413ab245813', 90 'name' => 'JavaScript API embedding' 89 91 ), 90 92 ); -
video-thumbnails/tags/2.4/php/providers/class-youku-thumbnails.php
r710079 r837855 56 56 public $test_cases = array( 57 57 array( 58 'markup' => '<embed src="http://player.youku.com/player.php/sid/XMzQyMzk5MzQ4/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" allowFullscreen="true" type="application/x-shockwave-flash"></embed>', 59 'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493', 60 'name' => 'Flash embed' 58 'markup' => '<embed src="http://player.youku.com/player.php/sid/XMzQyMzk5MzQ4/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" allowFullscreen="true" type="application/x-shockwave-flash"></embed>', 59 'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493', 60 'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8', 61 'name' => 'Flash embed' 61 62 ), 62 63 array( 63 'markup' => 'http://v.youku.com/v_show/id_XMzQyMzk5MzQ4.html', 64 'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493', 65 'name' => 'Link' 64 'markup' => 'http://v.youku.com/v_show/id_XMzQyMzk5MzQ4.html', 65 'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493', 66 'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8', 67 'name' => 'Link' 66 68 ), 67 69 ); -
video-thumbnails/tags/2.4/php/providers/class-youtube-thumbnails.php
r794208 r837855 57 57 public $test_cases = array( 58 58 array( 59 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/Fp0U2Vglkjw" frameborder="0" allowfullscreen></iframe>', 60 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 61 'name' => 'iFrame HD' 59 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/Fp0U2Vglkjw" frameborder="0" allowfullscreen></iframe>', 60 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 61 'expected_hash' => 'c66256332969c38790c2b9f26f725e7a', 62 'name' => 'iFrame HD' 62 63 ), 63 64 array( 64 'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>', 65 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 66 'name' => 'Old embed HD' 65 'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>', 66 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 67 'expected_hash' => 'c66256332969c38790c2b9f26f725e7a', 68 'name' => 'Old embed HD' 67 69 ), 68 70 array( 69 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/vv_AitYPjtc" frameborder="0" allowfullscreen></iframe>', 70 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 71 'name' => 'iFrame SD' 71 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/vv_AitYPjtc" frameborder="0" allowfullscreen></iframe>', 72 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 73 'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9', 74 'name' => 'iFrame SD' 72 75 ), 73 76 array( 74 'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/vv_AitYPjtc?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vv_AitYPjtc?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>', 75 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 76 'name' => 'Old embed SD' 77 'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/vv_AitYPjtc?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vv_AitYPjtc?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>', 78 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 79 'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9', 80 'name' => 'Old embed SD' 77 81 ), 78 82 ); -
video-thumbnails/tags/2.4/readme.txt
r835793 r837855 2 2 Contributors: sutherlandboswell 3 3 Donate link: http://wie.ly/u/donate 4 Tags: Video, Thumbnails, YouTube, Vimeo, Blip, Justin.tv, Dailymotion, Metacafe, Image, Featured Image, Post Thumbnail4 Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image 5 5 Requires at least: 3.1 6 6 Tested up to: 3.8 7 Stable tag: 2. 37 Stable tag: 2.4 8 8 9 9 Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template. … … 18 18 * Vimeo 19 19 * Facebook 20 * Blip20 * Vine 21 21 * Justin.tv 22 * Twitch 22 23 * Dailymotion 23 24 * Metacafe 25 * Blip 26 * Google Drive 24 27 * Funny or Die 28 * CollegeHumor 25 29 * MPORA 26 30 * Wistia 27 31 * Youku 28 * CollegeHumor29 32 * Rutube 30 * Twitch31 33 32 34 Video Thumbnails even works with most video embedding plugins, including: … … 51 53 == Frequently Asked Questions == 52 54 55 = No video thumbnail for this post = 56 57 1. Ensure you have saved any changes to your post. 58 1. If you are using a a plugin or theme that stores videos in a special location other than the main post content area, be sure you've entered the correct custom field on the settings page. If you don't know the name of the field your video is being saved in, please contact the developer of that theme or plugin. 59 1. Copy and paste your embed code into the "Test Markup for Video" section of the Debugging page. If this doesn't find the thumbnail, you'll want to be sure to include the embed code you scanned when you request support. If it does find a thumbnail, please double check that you have the Custom Field set correctly in the settings page if you are using a a plugin or theme that stores videos in a special location. 60 1. Go to the Debugging page and click "Test Image Downloading" to test your server's ability to save an image from a video source. 61 1. Try posting a video from other sources to help narrow down the problem. 62 1. Check the support threads to see if anyone has had the same issue. 63 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. 64 53 65 = My theme isn't showing thumbnails, what's wrong? = 54 66 … … 99 111 100 112 == Changelog == 113 114 = 2.4 = 115 * Added support for Vine 116 * Added support for Google Drive videos 117 * Rewritten bulk video thumbnail scanner 118 * Added troubleshooting link in meta box when no video thumbnail is found 119 * Changed provider test to compare file hashes in case thumbnail URLs change 101 120 102 121 = 2.3 = -
video-thumbnails/tags/2.4/video-thumbnails.php
r835793 r837855 3 3 Plugin Name: Video Thumbnails 4 4 Plugin URI: http://refactored.co/plugins/video-thumbnails 5 Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Currently supports YouTube, Vimeo, Facebook, Blip.tv, Justin.tv, Dailymotion, Metacafe, Wistia, Youku, Funny or Die, and MPORA.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 6 Author: Sutherland Boswell 7 7 Author URI: http://sutherlandboswell.com 8 Version: 2. 38 Version: 2.4 9 9 License: GPL2 10 10 */ 11 /* Copyright 201 3Sutherland Boswell (email : [email protected])11 /* Copyright 2014 Sutherland Boswell (email : [email protected]) 12 12 13 13 This program is free software; you can redistribute it and/or modify … … 29 29 define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) ); 30 30 define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' ); 31 define( 'VIDEO_THUMBNAILS_VERSION', '2. 3' );31 define( 'VIDEO_THUMBNAILS_VERSION', '2.4' ); 32 32 33 33 // Providers … … 72 72 add_action( 'wp_ajax_reset_video_thumbnail', array( &$this, 'ajax_reset_callback' ) ); 73 73 74 // Add admin menus 75 add_action( 'admin_menu', array( &$this, 'admin_menu' ) ); 76 77 // Add JavaScript and CSS to admin pages 78 add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ), 20 ); 79 80 // Get the posts to be scanned in bulk 81 add_action('wp_ajax_video_thumbnails_bulk_posts_query', array( &$this, 'bulk_posts_query_callback' ) ); 82 // Get the thumbnail for an individual post 83 add_action('wp_ajax_video_thumbnails_get_thumbnail_for_post', array( &$this, 'get_thumbnail_for_post_callback' ) ); 84 85 } 86 87 /** 88 * Adds the admin menu items 89 */ 90 function admin_menu() { 91 add_management_page( 'Bulk Video Thumbnails', 'Bulk Video Thumbs', 'manage_options', 'video-thumbnails-bulk', array( &$this, 'bulk_scanning_page' ) ); 92 } 93 94 function admin_scripts( $hook ) { 95 // Bulk tool page 96 if ( 'tools_page_video-thumbnails-bulk' == $hook ) { 97 wp_enqueue_script( 'video-thumbnails-bulk-js', plugins_url( '/js/bulk.js' , __FILE__ ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION ); 98 wp_enqueue_style( 'video-thumbnails-bulk-css', plugins_url('/css/bulk.css', __FILE__), false, VIDEO_THUMBNAILS_VERSION ); 99 } 74 100 } 75 101 … … 85 111 // Construct the meta box 86 112 function meta_box() { 113 114 // Add hidden troubleshooting info 115 add_thickbox(); 116 ?> 117 <div id="video-thumbnail-not-found-troubleshooting" style="display:none;"> 118 <h2><?php _e( 'Troubleshooting Video Thumbnails' ); ?></h2> 119 <h3>No video thumbnail for this post</h3> 120 <ol> 121 <li>Ensure you have saved any changes to your post.</li> 122 <li>If you are using a a plugin or theme that stores videos in a special location other than the main post content area, be sure you've entered the correct custom field on the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails' ); ?>">settings page</a>. If you don't know the name of the field your video is being saved in, please contact the developer of that theme or plugin.</li> 123 <li>Copy and paste your embed code into the "Test Markup for Video" section of the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ); ?>">Debugging page</a>. If this doesn't find the thumbnail, you'll want to be sure to include the embed code you scanned when you request support. If it does find a thumbnail, please double check that you have the Custom Field set correctly in the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails' ); ?>">settings page</a> if you are using a a plugin or theme that stores videos in a special location.</li> 124 <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> 125 <li>Try posting a video from other sources to help narrow down the problem.</li> 126 <li>Check the <a href="http://wordpress.org/support/plugin/video-thumbnails">support threads</a> to see if anyone has had the same issue.</li> 127 <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> 128 </ol> 129 </div> 130 <?php 131 87 132 global $post; 88 133 $custom = get_post_custom( $post->ID ); … … 96 141 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Reset Video Thumbnail</a></p>'; 97 142 } else { 98 echo '<p id="video-thumbnails-preview"> We didn\'t find avideo thumbnail for this post.</p>';99 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Search Again</a> </p>';143 echo '<p id="video-thumbnails-preview">No video thumbnail for this post.</p>'; 144 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Search Again</a> <a href="#TB_inline?width=400&height=600&inlineId=video-thumbnail-not-found-troubleshooting" class="thickbox" style="float:right;">Troubleshoot<a/></p>'; 100 145 } 101 146 } else { … … 333 378 echo '<img src="' . $video_thumbnail . '" style="max-width:100%;" />'; 334 379 } else { 335 echo ' We didn\'t find a video thumbnail for this post. (be sure you have saved changes first)';380 echo 'No video thumbnail for this post.'; 336 381 } 337 382 338 383 die(); 384 } 385 386 function bulk_posts_query_callback() { 387 $args = array( 388 'showposts' => -1, 389 'post_type' => $this->settings->options['post_types'], 390 'fields' => 'ids' 391 ); 392 $query = new WP_Query( $args ); 393 echo json_encode( $query->posts ); 394 die(); 395 } 396 397 function get_thumbnail_for_post_callback() { 398 399 $post_id = $_POST['post_id']; 400 $thumb = get_post_meta( $post_id, VIDEO_THUMBNAILS_FIELD, true ); 401 402 if ( $thumb == '' ) { 403 global $video_thumbnails; 404 $thumb = $video_thumbnails->get_video_thumbnail( $post_id ); 405 if ( $thumb ) { 406 $type = 'new'; 407 } 408 } else { 409 $type = 'existing'; 410 } 411 412 if ( $thumb != '' ) { 413 $result = array( 414 'type' => $type, 415 'url' => $thumb 416 ); 417 } else { 418 $result = array(); 419 } 420 421 echo json_encode( $result ); 422 die(); 423 } 424 425 function bulk_scanning_page() { 426 427 if ( ! current_user_can( 'manage_options' ) ) { 428 wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); 429 } 430 431 ?> 432 <div class="wrap"> 433 434 <div id="icon-tools" class="icon32"></div><h2>Bulk Video Thumbnail Generator</h2> 435 436 <p>Use this tool to scan all of your posts for Video Thumbnails.</p> 437 438 <p><a id="video-thumbnails-scan-all-posts" href="#" class="button button-primary">Scan All Posts</a></p> 439 440 <div id="vt-bulk-scan-results"> 441 <div class="progress-bar-container"> 442 <span class="percentage">0%</span> 443 <div class="progress-bar"> </div> 444 </div> 445 <div class="stats"> 446 <div class="scanned"></div> 447 <div class="found"></div> 448 </div> 449 <ul class="log"></ul> 450 </div> 451 452 </div> 453 <?php 454 339 455 } 340 456 -
video-thumbnails/trunk/php/class-video-thumbnails-settings.php
r794208 r837855 38 38 // Initialize options 39 39 add_action( 'admin_init', array( &$this, 'initialize_options' ) ); 40 // Ajax past search callback 41 add_action( 'wp_ajax_past_video_thumbnail', array( &$this, 'ajax_past_callback' ) ); 42 // Ajax past search callback 40 // Ajax clear all callback 43 41 add_action( 'wp_ajax_clear_all_video_thumbnails', array( &$this, 'ajax_clear_all_callback' ) ); 44 42 // Ajax test callbacks … … 50 48 // Admin scripts 51 49 add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) ); 52 }53 // Ajax past posts script54 if ( isset ( $_GET['page'] ) && ( $_GET['page'] == 'video_thumbnails' ) && isset ( $_GET['tab'] ) && ( $_GET['tab'] == 'mass_actions' ) ) {55 add_action( 'admin_head', array( &$this, 'ajax_past_script' ) );56 50 } 57 51 } … … 140 134 wp_enqueue_script( 'video_thumbnails_test', plugins_url( 'js/test.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) ); 141 135 wp_enqueue_script( 'video_thumbnails_clear', plugins_url( 'js/clear.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) ); 142 }143 144 function ajax_past_script() {145 146 ?><!-- Video Thumbnails Past Post Ajax -->147 <script type="text/javascript">148 function video_thumbnails_past(id) {149 150 var data = {151 action: 'past_video_thumbnail',152 post_id: id153 };154 155 // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php156 jQuery.post(ajaxurl, data, function(response){157 158 document.getElementById(id+'_result').innerHTML = response;159 160 });161 162 };163 <?php164 $id_array = get_posts( array(165 'showposts' => -1,166 'post_type' => $this->options['post_types'],167 'fields' => 'ids'168 ) );169 $ids = implode( ', ', $id_array );170 ?>171 172 var scanComplete = false;173 174 function scan_video_thumbnails(){175 176 if(scanComplete==false){177 scanComplete = true;178 var ids = new Array(<?php echo $ids; ?>);179 for (var i = 0; i < ids.length; i++){180 var container = document.getElementById('video-thumbnails-past');181 var new_element = document.createElement('li');182 new_element.setAttribute('id',ids[i]+'_result');183 new_element.innerHTML = 'Waiting...';184 container.insertBefore(new_element, container.firstChild);185 }186 for (var i = 0; i < ids.length; i++){187 document.getElementById(ids[i]+'_result').innerHTML = '<span style="color:yellow">•</span> Working...';188 video_thumbnails_past(ids[i]);189 }190 } else {191 alert('Scan has already been run, please reload the page before trying again.')192 }193 194 }195 </script><?php196 197 }198 199 function ajax_past_callback() {200 global $wpdb; // this is how you get access to the database201 202 $post_id = $_POST['post_id'];203 204 echo get_the_title( $post_id ) . ' - ';205 206 $video_thumbnail = get_video_thumbnail( $post_id );207 208 if ( is_wp_error( $video_thumbnail ) ) {209 echo $video_thumbnail->get_error_message();210 } else if ( $video_thumbnail != null ) {211 echo '<span style="color:green">✔</span> Success!';212 } else {213 echo '<span style="color:red">✖</span> Couldn\'t find a video thumbnail for this post.';214 }215 216 die();217 136 } 218 137 … … 240 159 241 160 die(); 161 } 162 163 function get_file_hash( $url ) { 164 $response = wp_remote_get( $url, array( 'sslverify' => false ) ); 165 if( is_wp_error( $response ) ) { 166 $result = false; 167 } else { 168 $result = md5( $response['body'] ); 169 } 170 return $result; 242 171 } 243 172 … … 274 203 $result = explode( '?', $result ); 275 204 $result = $result[0]; 276 if ( $result == $test_case['expected'] ) { 205 $result_hash = $this->get_file_hash( $result ); 206 $matched = ( $result_hash == $test_case['expected_hash'] ? true : false ); 207 if ( $matched ) { 277 208 echo '<td style="color:green;">✔ Passed</td>'; 278 209 $passed++; … … 281 212 $failed++; 282 213 } 283 echo '<td>' . $result . '</td>'; 214 echo '<td>'; 215 if ( $result ) { 216 echo '<a href="' . $result . '">View Image</a>'; 217 } 218 if ( $result_hash ) { 219 echo ' <code>' . $result_hash . '</code>'; 220 } 221 echo '</td>'; 284 222 } 285 223 echo '</tr>'; … … 367 305 } 368 306 369 function sanitize_callback( $input ) { 307 function sanitize_callback( $input ) { 370 308 $current_settings = get_option( 'video_thumbnails' ); 371 309 $output = array(); … … 520 458 <p>Scan all of your past posts for video thumbnails. Be sure to save any settings before running the scan.</p> 521 459 522 <p><input type="submit" class="button-primary" onclick="scan_video_thumbnails();" value="Scan Past Posts" /></p> 523 524 <ol id="video-thumbnails-past"> 525 </ol> 460 <p><a class="button-primary" href="<?php echo admin_url( 'tools.php?page=video-thumbnails-bulk' ); ?>">Scan Past Posts</a></p> 526 461 527 462 <h3>Clear all Video Thumbnails</h3> -
video-thumbnails/trunk/php/providers/class-blip-thumbnails.php
r746462 r837855 59 59 public $test_cases = array( 60 60 array( 61 'markup' => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917', 62 'expected' => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg', 63 'name' => 'Video URL' 61 'markup' => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917', 62 'expected' => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg', 63 'expected_hash' => '26a622f72bd4bdb3f8189f85598dd95d', 64 'name' => 'Video URL' 64 65 ), 65 66 array( 66 'markup' => '<iframe src="http://blip.tv/play/AYL1uFkC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYL1uFkC" style="display:none"></embed>', 67 'expected' => 'http://a.images.blip.tv/ReelScience-TheScientificMethodOfOz139.jpg', 68 'name' => 'iFrame player' 67 'markup' => '<iframe src="http://blip.tv/play/AYL1uFkC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYL1uFkC" style="display:none"></embed>', 68 'expected' => 'http://a.images.blip.tv/ReelScience-TheScientificMethodOfOz139.jpg', 69 'expected_hash' => 'bd2f58c2bc874e3a017167e74e5c842f', 70 'name' => 'iFrame player' 69 71 ), 70 72 array( 71 'markup' => '<iframe src="http://blip.tv/play/AYLz%2BEsC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYLz+EsC" style="display:none"></embed>', 72 'expected' => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png', 73 'name' => 'iFrame player (special characters in ID)' 73 'markup' => '<iframe src="http://blip.tv/play/AYLz%2BEsC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYLz+EsC" style="display:none"></embed>', 74 'expected' => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png', 75 'expected_hash' => '87efa9f6b0d9111b0826ae4fbdddec1b', 76 'name' => 'iFrame player (special characters in ID)' 74 77 ), 75 78 ); -
video-thumbnails/trunk/php/providers/class-collegehumor-thumbnails.php
r710079 r837855 55 55 public $test_cases = array( 56 56 array( 57 'markup' => '<iframe src="http://www.collegehumor.com/e/6830834" width="600" height="338" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe><div style="padding:5px 0; text-align:center; width:600px;"><p><a href="http://www.collegehumor.com/videos/most-viewed/this-year">CollegeHumor\'s Favorite Funny Videos</a></p></div>', 58 'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg', 59 'name' => 'Embed' 57 'markup' => '<iframe src="http://www.collegehumor.com/e/6830834" width="600" height="338" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe><div style="padding:5px 0; text-align:center; width:600px;"><p><a href="http://www.collegehumor.com/videos/most-viewed/this-year">CollegeHumor\'s Favorite Funny Videos</a></p></div>', 58 'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg', 59 'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15', 60 'name' => 'Embed' 60 61 ), 61 62 array( 62 'markup' => 'http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody', 63 'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg', 64 'name' => 'URL' 63 'markup' => 'http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody', 64 'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg', 65 'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15', 66 'name' => 'URL' 65 67 ), 66 68 ); -
video-thumbnails/trunk/php/providers/class-dailymotion-thumbnails.php
r710079 r837855 57 57 public $test_cases = array( 58 58 array( 59 'markup' => '<iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/xqlhts"></iframe><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>', 60 'expected' => 'http://s1.dmcdn.net/AMjdy.jpg', 61 'name' => 'iFrame player' 59 'markup' => '<iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/xqlhts"></iframe><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>', 60 'expected' => 'http://s1.dmcdn.net/AMjdy.jpg', 61 'expected_hash' => '077888b97839254892a377f51c06e642', 62 'name' => 'iFrame player' 62 63 ), 63 64 array( 64 'markup' => '<object width="480" height="270"><param name="movie" value="http://www.dailymotion.com/swf/video/xqlhts"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/xqlhts" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always"></embed></object><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>', 65 'expected' => 'http://s1.dmcdn.net/AMjdy.jpg', 66 'name' => 'Flash player' 65 'markup' => '<object width="480" height="270"><param name="movie" value="http://www.dailymotion.com/swf/video/xqlhts"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/xqlhts" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always"></embed></object><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>', 66 'expected' => 'http://s1.dmcdn.net/AMjdy.jpg', 67 'expected_hash' => '077888b97839254892a377f51c06e642', 68 'name' => 'Flash player' 67 69 ), 68 70 ); -
video-thumbnails/trunk/php/providers/class-facebook-thumbnails.php
r710772 r837855 48 48 public $test_cases = array( 49 49 array( 50 'markup' => '<object width=420 height=180><param name=allowfullscreen value=true></param><param name=allowscriptaccess value=always></param><param name=movie value="http://www.facebook.com/v/2560032632599"></param><embed src="http://www.facebook.com/v/2560032632599" type="application/x-shockwave-flash" allowscriptaccess=always allowfullscreen=true width=420 height=180></embed></object>', 51 'expected' => 'https://graph.facebook.com/2560032632599/picture', 52 'name' => 'Flash Embed' 50 'markup' => '<object width=420 height=180><param name=allowfullscreen value=true></param><param name=allowscriptaccess value=always></param><param name=movie value="http://www.facebook.com/v/2560032632599"></param><embed src="http://www.facebook.com/v/2560032632599" type="application/x-shockwave-flash" allowscriptaccess=always allowfullscreen=true width=420 height=180></embed></object>', 51 'expected' => 'https://graph.facebook.com/2560032632599/picture', 52 'expected_hash' => '619591ec126ad889799ad992a227c75e', 53 'name' => 'Flash Embed' 53 54 ), 54 55 array( 55 'markup' => '<iframe src="https://www.facebook.com/video/embed?video_id=2560032632599" width="960" height="720" frameborder="0"></iframe>', 56 'expected' => 'https://graph.facebook.com/2560032632599/picture', 57 'name' => 'iFrame Embed' 56 'markup' => '<iframe src="https://www.facebook.com/video/embed?video_id=2560032632599" width="960" height="720" frameborder="0"></iframe>', 57 'expected' => 'https://graph.facebook.com/2560032632599/picture', 58 'expected_hash' => '619591ec126ad889799ad992a227c75e', 59 'name' => 'iFrame Embed' 58 60 ), 59 61 ); -
video-thumbnails/trunk/php/providers/class-funnyordie-thumbnails.php
r835793 r837855 56 56 public $test_cases = array( 57 57 array( 58 'markup' => '<iframe src="http://www.funnyordie.com/embed/5325b03b52" width="640" height="400" frameborder="0"></iframe>', 59 'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg', 60 'name' => 'iFrame player' 58 'markup' => '<iframe src="http://www.funnyordie.com/embed/5325b03b52" width="640" height="400" frameborder="0"></iframe>', 59 'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg', 60 'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b', 61 'name' => 'iFrame player' 61 62 ), 62 63 array( 63 'markup' => '<object width="640" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="ordie_player_5325b03b52"><param name="movie" value="http://player.ordienetworks.com/flash/fodplayer.swf" /><param name="flashvars" value="key=5325b03b52" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always"><embed width="640" height="400" flashvars="key=5325b03b52" allowfullscreen="true" allowscriptaccess="always" quality="high" src="http://player.ordienetworks.com/flash/fodplayer.swf" name="ordie_player_5325b03b52" type="application/x-shockwave-flash"></embed></object>', 64 'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg', 65 'name' => 'Flash player' 64 'markup' => '<object width="640" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="ordie_player_5325b03b52"><param name="movie" value="http://player.ordienetworks.com/flash/fodplayer.swf" /><param name="flashvars" value="key=5325b03b52" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always"><embed width="640" height="400" flashvars="key=5325b03b52" allowfullscreen="true" allowscriptaccess="always" quality="high" src="http://player.ordienetworks.com/flash/fodplayer.swf" name="ordie_player_5325b03b52" type="application/x-shockwave-flash"></embed></object>', 65 'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg', 66 'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b', 67 'name' => 'Flash player' 66 68 ), 67 69 ); -
video-thumbnails/trunk/php/providers/class-justintv-thumbnails.php
r710079 r837855 55 55 public $test_cases = array( 56 56 array( 57 'markup' => '<object type="application/x-shockwave-flash" height="300" width="400" id="clip_embed_player_flash" data="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" bgcolor="#000000"><param name="movie" value="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="auto_play=false&start_volume=25&title=Title&channel=scamschoolbrian&archive_id=392481524" /></object>', 58 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-392481524-320x240.jpg', 59 'name' => 'Embed' 57 'markup' => '<object type="application/x-shockwave-flash" height="300" width="400" id="clip_embed_player_flash" data="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" bgcolor="#000000"><param name="movie" value="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="auto_play=false&start_volume=25&title=Title&channel=scamschoolbrian&archive_id=392481524" /></object>', 58 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-392481524-320x240.jpg', 59 'expected_hash' => '7f260a2ce6ae75a3c2e5012108f161b7', 60 'name' => 'Embed' 60 61 ), 61 62 ); -
video-thumbnails/trunk/php/providers/class-kaltura-thumbnails.php
r710079 r837855 63 63 public $test_cases = array( 64 64 array( 65 'markup' => '<script type="text/javascript" src="http://cdnapi.kaltura.com/p/1374841/sp/137484100/embedIframeJs/uiconf_id/12680902/partner_id/1374841?entry_id=1_y7xzqsxw&playerId=kaltura_player_1363589321&cache_st=1363589321&autoembed=true&width=400&height=333&"></script>',65 'markup' => '<script type="text/javascript" src="http://cdnapi.kaltura.com/p/1374841/sp/137484100/embedIframeJs/uiconf_id/12680902/partner_id/1374841?entry_id=1_y7xzqsxw&playerId=kaltura_player_1363589321&cache_st=1363589321&autoembed=true&width=400&height=333&"></script>', 66 66 'expected' => 'http://example.com/thumbnail.jpg', 67 'name' => 'Auto embed'67 'name' => 'Auto embed' 68 68 ), 69 69 ); -
video-thumbnails/trunk/php/providers/class-metacafe-thumbnails.php
r710079 r837855 56 56 public $test_cases = array( 57 57 array( 58 'markup' => '<embed flashVars="playerVars=autoPlay=no" src="http://www.metacafe.com/fplayer/8456223/men_in_black_3_trailer_2.swf" width="440" height="248" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_8456223" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>', 59 'expected' => 'http://s4.mcstatic.com/thumb/8456223/22479418/4/catalog_item5/0/1/men_in_black_3_trailer_2.jpg', 60 'name' => 'Embed' 58 'markup' => '<embed flashVars="playerVars=autoPlay=no" src="http://www.metacafe.com/fplayer/8456223/men_in_black_3_trailer_2.swf" width="440" height="248" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_8456223" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>', 59 'expected' => 'http://s4.mcstatic.com/thumb/8456223/22479418/4/catalog_item5/0/1/men_in_black_3_trailer_2.jpg', 60 'expected_hash' => 'df46215fef1d9fb68eea64ba3ed9a4fd', 61 'name' => 'Embed' 61 62 ), 62 63 ); -
video-thumbnails/trunk/php/providers/class-mpora-thumbnails.php
r710079 r837855 48 48 public $test_cases = array( 49 49 array( 50 'markup' => '<object width="480" height="270" id="mporaplayer_wEr2CBooV_N" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" ><param name="movie" value="http://video.mpora.com/ep/wEr2CBooV/"></param><param name="wmode" value="transparent"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="http://video.mpora.com/ep/wEr2CBooV/" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>', 51 'expected' => 'http://ugc4.mporatrons.com/thumbs/wEr2CBooV_640x360_0000.jpg', 52 'name' => 'Flash player' 50 'markup' => '<object width="480" height="270" id="mporaplayer_wEr2CBooV_N" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" ><param name="movie" value="http://video.mpora.com/ep/wEr2CBooV/"></param><param name="wmode" value="transparent"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="http://video.mpora.com/ep/wEr2CBooV/" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>', 51 'expected' => 'http://ugc4.mporatrons.com/thumbs/wEr2CBooV_640x360_0000.jpg', 52 'expected_hash' => '95075bd4941251ebecbab3b436a90c49', 53 'name' => 'Flash player' 53 54 ), 54 55 array( 55 'markup' => '<iframe width="640" height="360" src="http://mpora.com/videos/AAdfegovdop0/embed" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 56 'expected' => 'http://ugc4.mporatrons.com/thumbs/AAdfegovdop0_640x360_0000.jpg', 57 'name' => 'iFrame player' 56 'markup' => '<iframe width="640" height="360" src="http://mpora.com/videos/AAdfegovdop0/embed" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 57 'expected' => 'http://ugc4.mporatrons.com/thumbs/AAdfegovdop0_640x360_0000.jpg', 58 'expected_hash' => '45db22a2ba5ef20163f52ba562b89259', 59 'name' => 'iFrame player' 58 60 ), 59 61 ); -
video-thumbnails/trunk/php/providers/class-rutube-thumbnails.php
r834141 r837855 56 56 public $test_cases = array( 57 57 array( 58 'markup' => 'http://rutube.ru/video/ca8607cd4f7ef28516e043dde0068564/', 59 'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg', 60 'name' => 'Video link' 58 'markup' => 'http://rutube.ru/video/ca8607cd4f7ef28516e043dde0068564/', 59 'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg', 60 'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354', 61 'name' => 'Video link' 61 62 ), 62 63 array( 63 'markup' => '<iframe width="720" height="405" src="//rutube.ru/video/embed/6608735" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>', 64 'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg', 65 'name' => 'iFrame embed' 64 'markup' => '<iframe width="720" height="405" src="//rutube.ru/video/embed/6608735" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>', 65 'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg', 66 'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354', 67 'name' => 'iFrame embed' 66 68 ), 67 69 ); -
video-thumbnails/trunk/php/providers/class-twitch-thumbnails.php
r835793 r837855 56 56 public $test_cases = array( 57 57 array( 58 'markup' => 'http://www.twitch.tv/vanillatv/c/1537974', 59 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg', 60 'name' => 'Video link' 58 'markup' => 'http://www.twitch.tv/vanillatv/c/1537974', 59 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg', 60 'expected_hash' => 'f3921b65f799aa648ef6dae29871c137', 61 'name' => 'Video link' 61 62 ), 62 63 array( 63 'markup' => '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/archive_embed_player.swf" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"><param name="movie" value="http://www.twitch.tv/widgets/archive_embed_player.swf"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="allowFullScreen" value="true"><param name="flashvars" value="title=VanillaTV%2B-%2BSweden%2Bvs%2BRussia%2B-%2BETF2L%2BNations%2BCup%2B-%2BSnakewater%2B%255BMap3%255D%2B-%2BPart%2B3&channel=vanillatv&auto_play=false&start_volume=25&chapter_id=1537974"></object>', 64 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg', 65 'name' => 'Flash embed' 64 'markup' => '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/archive_embed_player.swf" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"><param name="movie" value="http://www.twitch.tv/widgets/archive_embed_player.swf"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="allowFullScreen" value="true"><param name="flashvars" value="title=VanillaTV%2B-%2BSweden%2Bvs%2BRussia%2B-%2BETF2L%2BNations%2BCup%2B-%2BSnakewater%2B%255BMap3%255D%2B-%2BPart%2B3&channel=vanillatv&auto_play=false&start_volume=25&chapter_id=1537974"></object>', 65 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg', 66 'expected_hash' => 'f3921b65f799aa648ef6dae29871c137', 67 'name' => 'Flash embed' 66 68 ), 67 69 ); -
video-thumbnails/trunk/php/providers/class-video-thumbnails-providers.php
r835793 r837855 1 1 <?php 2 2 3 /* Copyright 201 3Sutherland Boswell (email : [email protected])3 /* Copyright 2014 Sutherland Boswell (email : [email protected]) 4 4 5 5 This program is free software; you can redistribute it and/or modify … … 93 93 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-vimeo-thumbnails.php' ); 94 94 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-facebook-thumbnails.php' ); 95 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-vine-thumbnails.php' ); 95 96 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-blip-thumbnails.php' ); 96 97 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-justintv-thumbnails.php' ); … … 105 106 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-rutube-thumbnails.php' ); 106 107 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-twitch-thumbnails.php' ); 108 require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-googledrive-thumbnails.php' ); 107 109 108 110 ?> -
video-thumbnails/trunk/php/providers/class-vimeo-thumbnails.php
r791525 r837855 62 62 // Regex strings 63 63 public $regexes = array( 64 '#<object[^>]+>.+?http://vimeo\.com/moogaloop.swf\?clip_id=([A-Za-z0-9\-_]+)&.+?</object>#s', // Standard Vimeo embed code65 '#(?:https?:)?//player\.vimeo\.com/video/([0-9]+)#', // Vimeo iframe player66 '#\[vimeo id=([A-Za-z0-9\-_]+)]#', // JR_embed shortcode67 '#\[vimeo clip_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Another shortcode68 '#\[vimeo video_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Yet another shortcode69 '#(?:https?://)?(?:www\.)?vimeo\.com/([0-9]+)#', // Vimeo URL70 '#(?:https?://)?(?:www\.)?vimeo\.com/channels/(?:[A-Za-z0-9]+)/([0-9]+)#' // Channel URL64 '#<object[^>]+>.+?http://vimeo\.com/moogaloop.swf\?clip_id=([A-Za-z0-9\-_]+)&.+?</object>#s', // Standard Vimeo embed code 65 '#(?:https?:)?//player\.vimeo\.com/video/([0-9]+)#', // Vimeo iframe player 66 '#\[vimeo id=([A-Za-z0-9\-_]+)]#', // JR_embed shortcode 67 '#\[vimeo clip_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Another shortcode 68 '#\[vimeo video_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Yet another shortcode 69 '#(?:https?://)?(?:www\.)?vimeo\.com/([0-9]+)#', // Vimeo URL 70 '#(?:https?://)?(?:www\.)?vimeo\.com/channels/(?:[A-Za-z0-9]+)/([0-9]+)#' // Channel URL 71 71 ); 72 72 73 73 // Thumbnail URL 74 74 public function get_thumbnail_url( $id ) { 75 // Get our settings76 $client_id = ( isset( $this->options['client_id'] ) && $this->options['client_id'] != '' ? $this->options['client_id'] : false );77 $client_secret = ( isset( $this->options['client_secret'] ) && $this->options['client_secret'] != '' ? $this->options['client_secret'] : false );78 $access_token = ( isset( $this->options['access_token'] ) && $this->options['access_token'] != '' ? $this->options['access_token'] : false );79 $access_token_secret = ( isset( $this->options['access_token_secret'] ) && $this->options['access_token_secret'] != '' ? $this->options['access_token_secret'] : false );75 // Get our settings 76 $client_id = ( isset( $this->options['client_id'] ) && $this->options['client_id'] != '' ? $this->options['client_id'] : false ); 77 $client_secret = ( isset( $this->options['client_secret'] ) && $this->options['client_secret'] != '' ? $this->options['client_secret'] : false ); 78 $access_token = ( isset( $this->options['access_token'] ) && $this->options['access_token'] != '' ? $this->options['access_token'] : false ); 79 $access_token_secret = ( isset( $this->options['access_token_secret'] ) && $this->options['access_token_secret'] != '' ? $this->options['access_token_secret'] : false ); 80 80 // If API credentials are entered, use the API 81 81 if ( $client_id && $client_secret && $access_token && $access_token_secret ) { … … 102 102 public $test_cases = array( 103 103 array( 104 'markup' => '<iframe src="http://player.vimeo.com/video/41504360" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 105 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 106 'name' => 'iFrame' 104 'markup' => '<iframe src="http://player.vimeo.com/video/41504360" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 105 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 106 'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623', 107 'name' => 'iFrame' 107 108 ), 108 109 array( 109 'markup' => '<object width="500" height="281"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=41504360&force_embed=1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00adef&fullscreen=1&autoplay=0&loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=41504360&force_embed=1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object>', 110 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 111 'name' => 'Old embed' 110 'markup' => '<object width="500" height="281"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=41504360&force_embed=1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00adef&fullscreen=1&autoplay=0&loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=41504360&force_embed=1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=1&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object>', 111 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 112 'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623', 113 'name' => 'Old embed' 112 114 ), 113 115 array( 114 'markup' => 'https://vimeo.com/channels/soundworkscollection/44520894', 115 'expected' => 'http://b.vimeocdn.com/ts/313/130/313130530_640.jpg', 116 'name' => 'Channel URL' 116 'markup' => 'https://vimeo.com/channels/soundworkscollection/44520894', 117 'expected' => 'http://b.vimeocdn.com/ts/313/130/313130530_640.jpg', 118 'expected_hash' => 'e9fd72872a39272f6c540ee66b1ecf28', 119 'name' => 'Channel URL' 117 120 ), 118 121 ); -
video-thumbnails/trunk/php/providers/class-wistia-thumbnails.php
r794208 r837855 79 79 public $test_cases = array( 80 80 array( 81 'markup' => '<iframe src="http://fast.wistia.net/embed/iframe/po4utu3zde?controlsVisibleOnLoad=true&version=v1&videoHeight=360&videoWidth=640&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="640" height="360"></iframe>', 82 'expected' => 'http://embed-0.wistia.com/deliveries/6928fcba8355e38de4d95863a659e1de23cb2071.jpg', 83 'name' => 'Inline player' 81 'markup' => '<iframe src="http://fast.wistia.net/embed/iframe/po4utu3zde?controlsVisibleOnLoad=true&version=v1&videoHeight=360&videoWidth=640&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="640" height="360"></iframe>', 82 'expected' => 'http://embed-0.wistia.com/deliveries/6928fcba8355e38de4d95863a659e1de23cb2071.jpg', 83 'expected_hash' => 'bc4a2cec9ac97e2ccdae2c7387a01cb4', 84 'name' => 'Inline player' 84 85 ), 85 86 array( 86 'markup' => '<div class=\'wistia_embed\' data-video-height=\'312\' data-video-width=\'499\' id=\'wistia_j1qd2lvys1\'></div> <script charset=\'ISO-8859-1\' src=\'http://fast.wistia.com/static/concat/E-v1.js\'></script> <script> var platform = ( Modernizr.touch ) ? "html5" : "flash"; wistiaEmbed = Wistia.embed("j1qd2lvys1", { version: "v1", videoWidth: 499, videoHeight: 312, playButton: Modernizr.touch, smallPlayButton: Modernizr.touch, playbar: Modernizr.touch, platformPreference: platform, chromeless: Modernizr.touch ? false : true, fullscreenButton: false, autoPlay: !Modernizr.touch, videoFoam: true }); </script>', 87 'expected' => 'http://embed.wistia.com/deliveries/a086707fe096e7f3fbefef1d1dcba1488d23a3e9.jpg', 88 'name' => 'JavaScript API embedding' 87 'markup' => '<div class=\'wistia_embed\' data-video-height=\'312\' data-video-width=\'499\' id=\'wistia_j1qd2lvys1\'></div> <script charset=\'ISO-8859-1\' src=\'http://fast.wistia.com/static/concat/E-v1.js\'></script> <script> var platform = ( Modernizr.touch ) ? "html5" : "flash"; wistiaEmbed = Wistia.embed("j1qd2lvys1", { version: "v1", videoWidth: 499, videoHeight: 312, playButton: Modernizr.touch, smallPlayButton: Modernizr.touch, playbar: Modernizr.touch, platformPreference: platform, chromeless: Modernizr.touch ? false : true, fullscreenButton: false, autoPlay: !Modernizr.touch, videoFoam: true }); </script>', 88 'expected' => 'https://embed-ssl.wistia.com/deliveries/a086707fe096e7f3fbefef1d1dcba1488d23a3e9.jpg', 89 'expected_hash' => '4c63d131604bfc07b5178413ab245813', 90 'name' => 'JavaScript API embedding' 89 91 ), 90 92 ); -
video-thumbnails/trunk/php/providers/class-youku-thumbnails.php
r710079 r837855 56 56 public $test_cases = array( 57 57 array( 58 'markup' => '<embed src="http://player.youku.com/player.php/sid/XMzQyMzk5MzQ4/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" allowFullscreen="true" type="application/x-shockwave-flash"></embed>', 59 'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493', 60 'name' => 'Flash embed' 58 'markup' => '<embed src="http://player.youku.com/player.php/sid/XMzQyMzk5MzQ4/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" allowFullscreen="true" type="application/x-shockwave-flash"></embed>', 59 'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493', 60 'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8', 61 'name' => 'Flash embed' 61 62 ), 62 63 array( 63 'markup' => 'http://v.youku.com/v_show/id_XMzQyMzk5MzQ4.html', 64 'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493', 65 'name' => 'Link' 64 'markup' => 'http://v.youku.com/v_show/id_XMzQyMzk5MzQ4.html', 65 'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493', 66 'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8', 67 'name' => 'Link' 66 68 ), 67 69 ); -
video-thumbnails/trunk/php/providers/class-youtube-thumbnails.php
r794208 r837855 57 57 public $test_cases = array( 58 58 array( 59 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/Fp0U2Vglkjw" frameborder="0" allowfullscreen></iframe>', 60 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 61 'name' => 'iFrame HD' 59 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/Fp0U2Vglkjw" frameborder="0" allowfullscreen></iframe>', 60 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 61 'expected_hash' => 'c66256332969c38790c2b9f26f725e7a', 62 'name' => 'iFrame HD' 62 63 ), 63 64 array( 64 'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>', 65 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 66 'name' => 'Old embed HD' 65 'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>', 66 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 67 'expected_hash' => 'c66256332969c38790c2b9f26f725e7a', 68 'name' => 'Old embed HD' 67 69 ), 68 70 array( 69 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/vv_AitYPjtc" frameborder="0" allowfullscreen></iframe>', 70 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 71 'name' => 'iFrame SD' 71 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/vv_AitYPjtc" frameborder="0" allowfullscreen></iframe>', 72 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 73 'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9', 74 'name' => 'iFrame SD' 72 75 ), 73 76 array( 74 'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/vv_AitYPjtc?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vv_AitYPjtc?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>', 75 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 76 'name' => 'Old embed SD' 77 'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/vv_AitYPjtc?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vv_AitYPjtc?version=3&hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>', 78 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 79 'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9', 80 'name' => 'Old embed SD' 77 81 ), 78 82 ); -
video-thumbnails/trunk/readme.txt
r835793 r837855 2 2 Contributors: sutherlandboswell 3 3 Donate link: http://wie.ly/u/donate 4 Tags: Video, Thumbnails, YouTube, Vimeo, Blip, Justin.tv, Dailymotion, Metacafe, Image, Featured Image, Post Thumbnail4 Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image 5 5 Requires at least: 3.1 6 6 Tested up to: 3.8 7 Stable tag: 2. 37 Stable tag: 2.4 8 8 9 9 Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template. … … 18 18 * Vimeo 19 19 * Facebook 20 * Blip20 * Vine 21 21 * Justin.tv 22 * Twitch 22 23 * Dailymotion 23 24 * Metacafe 25 * Blip 26 * Google Drive 24 27 * Funny or Die 28 * CollegeHumor 25 29 * MPORA 26 30 * Wistia 27 31 * Youku 28 * CollegeHumor29 32 * Rutube 30 * Twitch31 33 32 34 Video Thumbnails even works with most video embedding plugins, including: … … 51 53 == Frequently Asked Questions == 52 54 55 = No video thumbnail for this post = 56 57 1. Ensure you have saved any changes to your post. 58 1. If you are using a a plugin or theme that stores videos in a special location other than the main post content area, be sure you've entered the correct custom field on the settings page. If you don't know the name of the field your video is being saved in, please contact the developer of that theme or plugin. 59 1. Copy and paste your embed code into the "Test Markup for Video" section of the Debugging page. If this doesn't find the thumbnail, you'll want to be sure to include the embed code you scanned when you request support. If it does find a thumbnail, please double check that you have the Custom Field set correctly in the settings page if you are using a a plugin or theme that stores videos in a special location. 60 1. Go to the Debugging page and click "Test Image Downloading" to test your server's ability to save an image from a video source. 61 1. Try posting a video from other sources to help narrow down the problem. 62 1. Check the support threads to see if anyone has had the same issue. 63 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. 64 53 65 = My theme isn't showing thumbnails, what's wrong? = 54 66 … … 99 111 100 112 == Changelog == 113 114 = 2.4 = 115 * Added support for Vine 116 * Added support for Google Drive videos 117 * Rewritten bulk video thumbnail scanner 118 * Added troubleshooting link in meta box when no video thumbnail is found 119 * Changed provider test to compare file hashes in case thumbnail URLs change 101 120 102 121 = 2.3 = -
video-thumbnails/trunk/video-thumbnails.php
r835793 r837855 3 3 Plugin Name: Video Thumbnails 4 4 Plugin URI: http://refactored.co/plugins/video-thumbnails 5 Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Currently supports YouTube, Vimeo, Facebook, Blip.tv, Justin.tv, Dailymotion, Metacafe, Wistia, Youku, Funny or Die, and MPORA.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 6 Author: Sutherland Boswell 7 7 Author URI: http://sutherlandboswell.com 8 Version: 2. 38 Version: 2.4 9 9 License: GPL2 10 10 */ 11 /* Copyright 201 3Sutherland Boswell (email : [email protected])11 /* Copyright 2014 Sutherland Boswell (email : [email protected]) 12 12 13 13 This program is free software; you can redistribute it and/or modify … … 29 29 define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) ); 30 30 define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' ); 31 define( 'VIDEO_THUMBNAILS_VERSION', '2. 3' );31 define( 'VIDEO_THUMBNAILS_VERSION', '2.4' ); 32 32 33 33 // Providers … … 72 72 add_action( 'wp_ajax_reset_video_thumbnail', array( &$this, 'ajax_reset_callback' ) ); 73 73 74 // Add admin menus 75 add_action( 'admin_menu', array( &$this, 'admin_menu' ) ); 76 77 // Add JavaScript and CSS to admin pages 78 add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ), 20 ); 79 80 // Get the posts to be scanned in bulk 81 add_action('wp_ajax_video_thumbnails_bulk_posts_query', array( &$this, 'bulk_posts_query_callback' ) ); 82 // Get the thumbnail for an individual post 83 add_action('wp_ajax_video_thumbnails_get_thumbnail_for_post', array( &$this, 'get_thumbnail_for_post_callback' ) ); 84 85 } 86 87 /** 88 * Adds the admin menu items 89 */ 90 function admin_menu() { 91 add_management_page( 'Bulk Video Thumbnails', 'Bulk Video Thumbs', 'manage_options', 'video-thumbnails-bulk', array( &$this, 'bulk_scanning_page' ) ); 92 } 93 94 function admin_scripts( $hook ) { 95 // Bulk tool page 96 if ( 'tools_page_video-thumbnails-bulk' == $hook ) { 97 wp_enqueue_script( 'video-thumbnails-bulk-js', plugins_url( '/js/bulk.js' , __FILE__ ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION ); 98 wp_enqueue_style( 'video-thumbnails-bulk-css', plugins_url('/css/bulk.css', __FILE__), false, VIDEO_THUMBNAILS_VERSION ); 99 } 74 100 } 75 101 … … 85 111 // Construct the meta box 86 112 function meta_box() { 113 114 // Add hidden troubleshooting info 115 add_thickbox(); 116 ?> 117 <div id="video-thumbnail-not-found-troubleshooting" style="display:none;"> 118 <h2><?php _e( 'Troubleshooting Video Thumbnails' ); ?></h2> 119 <h3>No video thumbnail for this post</h3> 120 <ol> 121 <li>Ensure you have saved any changes to your post.</li> 122 <li>If you are using a a plugin or theme that stores videos in a special location other than the main post content area, be sure you've entered the correct custom field on the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails' ); ?>">settings page</a>. If you don't know the name of the field your video is being saved in, please contact the developer of that theme or plugin.</li> 123 <li>Copy and paste your embed code into the "Test Markup for Video" section of the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ); ?>">Debugging page</a>. If this doesn't find the thumbnail, you'll want to be sure to include the embed code you scanned when you request support. If it does find a thumbnail, please double check that you have the Custom Field set correctly in the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails' ); ?>">settings page</a> if you are using a a plugin or theme that stores videos in a special location.</li> 124 <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> 125 <li>Try posting a video from other sources to help narrow down the problem.</li> 126 <li>Check the <a href="http://wordpress.org/support/plugin/video-thumbnails">support threads</a> to see if anyone has had the same issue.</li> 127 <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> 128 </ol> 129 </div> 130 <?php 131 87 132 global $post; 88 133 $custom = get_post_custom( $post->ID ); … … 96 141 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Reset Video Thumbnail</a></p>'; 97 142 } else { 98 echo '<p id="video-thumbnails-preview"> We didn\'t find avideo thumbnail for this post.</p>';99 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Search Again</a> </p>';143 echo '<p id="video-thumbnails-preview">No video thumbnail for this post.</p>'; 144 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Search Again</a> <a href="#TB_inline?width=400&height=600&inlineId=video-thumbnail-not-found-troubleshooting" class="thickbox" style="float:right;">Troubleshoot<a/></p>'; 100 145 } 101 146 } else { … … 333 378 echo '<img src="' . $video_thumbnail . '" style="max-width:100%;" />'; 334 379 } else { 335 echo ' We didn\'t find a video thumbnail for this post. (be sure you have saved changes first)';380 echo 'No video thumbnail for this post.'; 336 381 } 337 382 338 383 die(); 384 } 385 386 function bulk_posts_query_callback() { 387 $args = array( 388 'showposts' => -1, 389 'post_type' => $this->settings->options['post_types'], 390 'fields' => 'ids' 391 ); 392 $query = new WP_Query( $args ); 393 echo json_encode( $query->posts ); 394 die(); 395 } 396 397 function get_thumbnail_for_post_callback() { 398 399 $post_id = $_POST['post_id']; 400 $thumb = get_post_meta( $post_id, VIDEO_THUMBNAILS_FIELD, true ); 401 402 if ( $thumb == '' ) { 403 global $video_thumbnails; 404 $thumb = $video_thumbnails->get_video_thumbnail( $post_id ); 405 if ( $thumb ) { 406 $type = 'new'; 407 } 408 } else { 409 $type = 'existing'; 410 } 411 412 if ( $thumb != '' ) { 413 $result = array( 414 'type' => $type, 415 'url' => $thumb 416 ); 417 } else { 418 $result = array(); 419 } 420 421 echo json_encode( $result ); 422 die(); 423 } 424 425 function bulk_scanning_page() { 426 427 if ( ! current_user_can( 'manage_options' ) ) { 428 wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); 429 } 430 431 ?> 432 <div class="wrap"> 433 434 <div id="icon-tools" class="icon32"></div><h2>Bulk Video Thumbnail Generator</h2> 435 436 <p>Use this tool to scan all of your posts for Video Thumbnails.</p> 437 438 <p><a id="video-thumbnails-scan-all-posts" href="#" class="button button-primary">Scan All Posts</a></p> 439 440 <div id="vt-bulk-scan-results"> 441 <div class="progress-bar-container"> 442 <span class="percentage">0%</span> 443 <div class="progress-bar"> </div> 444 </div> 445 <div class="stats"> 446 <div class="scanned"></div> 447 <div class="found"></div> 448 </div> 449 <ul class="log"></ul> 450 </div> 451 452 </div> 453 <?php 454 339 455 } 340 456
Note: See TracChangeset
for help on using the changeset viewer.