Changeset 873686
- Timestamp:
- 03/11/2014 11:16:18 PM (12 years ago)
- Location:
- video-thumbnails
- Files:
-
- 4 added
- 2 deleted
- 3 edited
- 27 copied
-
tags/2.7 (copied) (copied from video-thumbnails/trunk)
-
tags/2.7/css (copied) (copied from video-thumbnails/trunk/css)
-
tags/2.7/css/bulk.css (modified) (1 diff)
-
tags/2.7/js/bulk.js (copied) (copied from video-thumbnails/trunk/js/bulk.js) (10 diffs)
-
tags/2.7/js/clear.js (deleted)
-
tags/2.7/js/settings.js (copied) (copied from video-thumbnails/trunk/js/settings.js) (5 diffs)
-
tags/2.7/js/test.js (deleted)
-
tags/2.7/languages (added)
-
tags/2.7/languages/video-thumbnails.pot (added)
-
tags/2.7/php/class-video-thumbnails-settings.php (copied) (copied from video-thumbnails/trunk/php/class-video-thumbnails-settings.php) (20 diffs)
-
tags/2.7/php/extensions/class-ayvp-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/extensions/class-ayvp-thumbnails.php)
-
tags/2.7/php/providers/class-blip-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-blip-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-collegehumor-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-collegehumor-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-dailymotion-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-dailymotion-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-facebook-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-facebook-thumbnails.php) (1 diff)
-
tags/2.7/php/providers/class-funnyordie-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-funnyordie-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-googledrive-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-googledrive-thumbnails.php) (3 diffs)
-
tags/2.7/php/providers/class-justintv-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-justintv-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-kaltura-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-kaltura-thumbnails.php) (3 diffs)
-
tags/2.7/php/providers/class-metacafe-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-metacafe-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-mpora-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-mpora-thumbnails.php) (1 diff)
-
tags/2.7/php/providers/class-rutube-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-rutube-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-twitch-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-twitch-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-video-thumbnails-providers.php (copied) (copied from video-thumbnails/trunk/php/providers/class-video-thumbnails-providers.php) (1 diff)
-
tags/2.7/php/providers/class-vimeo-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-vimeo-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-vine-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-vine-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-vk-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-vk-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-wistia-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-wistia-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-youku-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-youku-thumbnails.php) (2 diffs)
-
tags/2.7/php/providers/class-youtube-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-youtube-thumbnails.php) (1 diff)
-
tags/2.7/readme.txt (copied) (copied from video-thumbnails/trunk/readme.txt) (2 diffs)
-
tags/2.7/video-thumbnails.php (copied) (copied from video-thumbnails/trunk/video-thumbnails.php) (17 diffs)
-
trunk/languages (added)
-
trunk/languages/video-thumbnails.pot (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/video-thumbnails.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
video-thumbnails/tags/2.7/css/bulk.css
r837855 r873686 56 56 57 57 #vt-bulk-scan-results .stats { 58 width: 100%; 58 59 margin-top: 1em; 59 60 text-align: center; 61 } 62 63 #vt-bulk-scan-results .stats .scanned, 64 #vt-bulk-scan-results .stats .found-new, 65 #vt-bulk-scan-results .stats .found-existing { 66 font-size: 24px; 67 font-weight: bold; 68 width: 33%; 60 69 } 61 70 -
video-thumbnails/tags/2.7/js/bulk.js
r850958 r873686 13 13 this.logList = $('#vt-bulk-scan-results .log'); 14 14 this.progressBar = $('#vt-bulk-scan-results .progress-bar'); 15 this.language = video_thumbnails_bulk_language; 15 16 } 16 17 … … 35 36 var self = this; 36 37 this.disableSubmit(); 37 $('#queue-count').text( 'working...');38 $('#queue-count').text(this.language.working); 38 39 $.post(ajaxurl, data, function(response) { 39 40 self.posts = $.parseJSON( response ); 40 $('#queue-count').text(self.posts.length+' posts in queue'); 41 if ( self.posts.length == 1 ) { 42 queueText = self.language.queue_singular; 43 } else { 44 queueText = self.language.queue_plural.replace('%d',self.posts.length); 45 } 46 $('#queue-count').text(queueText); 41 47 if ( self.posts.length > 0 ) { 42 48 self.enableSubmit(); … … 49 55 this.paused = false; 50 56 if ( this.currentItem == 0 ) { 51 this.log( 'Started Scanning');57 this.log( this.language.started ); 52 58 this.progressBar.show(); 53 59 this.resetProgressBar(); 54 60 $('#video-thumbnails-bulk-scan-options').slideUp(); 55 61 } else { 56 this.log( 'Resumed Scanning');62 this.log( this.language.resumed ); 57 63 } 58 64 this.scanCurrentItem(); … … 62 68 this.clearSchedule(); 63 69 this.paused = true; 64 this.log( 'Paused Scanning');70 this.log( this.language.paused ); 65 71 }; 66 72 … … 74 80 75 81 VideoThumbnailsBulkScanner.prototype.scanCompleted = function() { 76 this.log( 'Done! Scanned ' + this.posts.length + ' posts' ); 82 if ( this.posts.length == 1 ) { 83 message = this.language.done + ' ' + this.language.final_count_singular; 84 } else { 85 message = this.language.done + ' ' + this.language.final_count_plural.replace('%d',this.posts.length); 86 } 87 this.log( message ); 77 88 }; 78 89 … … 89 100 console.log( percentage = ( this.currentItem + 1 ) / this.posts.length ); 90 101 if ( percentage == 1 ) { 91 progressText = 'Done!';102 progressText = this.language.done; 92 103 this.scanCompleted(); 93 104 } else { … … 99 110 100 111 VideoThumbnailsBulkScanner.prototype.updateCounter = function() { 101 $('#vt-bulk-scan-results .stats .scanned').html( 'Scanned ' + (this.currentItem+1) + ' of ' + this.posts.length ); 102 $('#vt-bulk-scan-results .stats .found').html( 'Found ' + this.newThumbnails + ' new thumbnails and ' + this.existingThumbnails + ' existing thumbnails' ); 112 $('#vt-bulk-scan-results .stats .scanned').html( (this.currentItem+1) + '/' + this.posts.length ); 113 $('#vt-bulk-scan-results .stats .found-new').html( this.newThumbnails ); 114 $('#vt-bulk-scan-results .stats .found-existing').html( this.existingThumbnails ); 103 115 } 104 116 … … 128 140 if ( this.currentItem < this.posts.length ) { 129 141 130 this.log( '[ ' + this.posts[this.currentItem] + '] Scanning ' + (this.currentItem+1) + ' of ' + this.posts.length);142 this.log( '[ID: ' + this.posts[this.currentItem] + '] ' + this.language.scanning_of.replace('%1$s',this.currentItem+1).replace('%2$s',this.posts.length) ); 131 143 132 144 var data = { … … 142 154 var result = $.parseJSON( response ); 143 155 if ( result.length == 0 ) { 144 self.log( '[ ' + self.posts[self.currentItem] + '] No thumbnail');156 self.log( '[ID: ' + self.posts[self.currentItem] + '] ' + self.language.no_thumbnail ); 145 157 } else { 146 self.log( '[' + self.posts[self.currentItem] + '] ' + result.url + ' (' + result.type + ')' ); 158 if ( result.type == 'new' ) { 159 resultText = self.language.new_thumbnail; 160 } else { 161 resultText = self.language.existing_thumbnail; 162 } 163 self.log( '[ID: ' + self.posts[self.currentItem] + '] ' + resultText + ' ' + result.url ); 147 164 if ( result.type == 'new' ) { 148 165 self.newThumbnails++; … … 155 172 }, 156 173 error: function(jqXHR, textStatus, errorThrown) { 157 self.log( '[ ' + self.posts[self.currentItem] + '] Error:' + errorThrown );174 self.log( '[ID: ' + self.posts[self.currentItem] + '] ' + self.language.error + ' ' + errorThrown ); 158 175 self.updateStats(); 159 176 self.scheduleNextItem(); -
video-thumbnails/tags/2.7/js/settings.js
r862503 r873686 11 11 $('#custom_field').val(response); 12 12 } else { 13 alert( 'We were unable to find a video in the custom fields of your most recently updated post.');13 alert(video_thumbnails_settings_language.detection_failed); 14 14 } 15 15 }); … … 23 23 action: 'video_thumbnail_' + test_type + '_test' 24 24 }; 25 document.getElementById( test_type + '-test' ).innerHTML = 'Working...';25 document.getElementById( test_type + '-test' ).innerHTML = video_thumbnails_settings_language.working; 26 26 jQuery.post(ajaxurl, data, function(response){ 27 27 document.getElementById( test_type + '-test' ).innerHTML = response; … … 34 34 markup: jQuery('#markup-input').val() 35 35 }; 36 document.getElementById( 'markup-test-result' ).innerHTML = '<p> Working...</p>';36 document.getElementById( 'markup-test-result' ).innerHTML = '<p>' + video_thumbnails_settings_language.working + '</p>'; 37 37 jQuery.post(ajaxurl, data, function(response){ 38 38 document.getElementById( 'markup-test-result' ).innerHTML = response; … … 42 42 // Clear all video thumbnails 43 43 function clear_all_video_thumbnails( nonce ) { 44 var confimation_result = confirm( "Are you sure you want to clear all video thumbnails? This cannot be undone.");44 var confimation_result = confirm(video_thumbnails_settings_language.clear_all_confirmation); 45 45 if (confimation_result){ 46 46 var data = { … … 48 48 nonce: nonce 49 49 }; 50 document.getElementById( 'clear-all-video-thumbnails-result' ).innerHTML = '<p> Working...</p>';50 document.getElementById( 'clear-all-video-thumbnails-result' ).innerHTML = '<p>' + video_thumbnails_settings_language.working + '</p>'; 51 51 jQuery.post(ajaxurl, data, function(response){ 52 52 document.getElementById( 'clear-all-video-thumbnails-result' ).innerHTML = response; -
video-thumbnails/tags/2.7/php/class-video-thumbnails-settings.php
r862503 r873686 127 127 function admin_menu() { 128 128 add_options_page( 129 'Video Thumbnail Options',130 'Video Thumbnails',129 __( 'Video Thumbnails Options', 'video-thumbnails' ), 130 __( 'Video Thumbnails', 'video-thumbnails' ), 131 131 'manage_options', 132 132 'video_thumbnails', … … 137 137 function admin_scripts() { 138 138 wp_enqueue_script( 'video_thumbnails_settings', plugins_url( 'js/settings.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION ); 139 wp_localize_script( 'video_thumbnails_settings', 'video_thumbnails_settings_language', array( 140 'detection_failed' => __( 'We were unable to find a video in the custom fields of your most recently updated post.', 'video-thumbnails' ), 141 'working' => __( 'Working...', 'video-thumbnails' ), 142 'clear_all_confirmation' => __( 'Are you sure you want to clear all video thumbnails? This cannot be undone.', 'video-thumbnails' ), 143 ) ); 139 144 } 140 145 … … 183 188 echo '<p><span style="color:green">✔</span> ' . sprintf( _n( '1 custom field cleared', '%s custom fields cleared', $custom_fields_cleared, 'video-thumbnails' ), $custom_fields_cleared ) . '</p>'; 184 189 } else { 185 echo '<p><span style="color:red">✖</span> <strong>Error</strong>: Could not verify nonce.</p>';190 echo '<p><span style="color:red">✖</span> ' . __( '<strong>Error</strong>: Could not verify nonce.', 'video-thumbnails' ) . '</p>'; 186 191 } 187 192 … … 207 212 <thead> 208 213 <tr> 209 <th> Name</th>210 <th> Pass/Fail</th>211 <th> Result</th>214 <th><?php _e( 'Name', 'video-thumbnails' ); ?></th> 215 <th><?php _e( 'Pass/Fail', 'video-thumbnails' ); ?></th> 216 <th><?php _e( 'Result', 'video-thumbnails' ); ?></th> 212 217 </tr> 213 218 </thead> … … 217 222 $failed = 0; 218 223 foreach ( $video_thumbnails->providers as $provider ) { 219 foreach ( $provider-> test_casesas $test_case ) {224 foreach ( $provider->get_test_cases() as $test_case ) { 220 225 echo '<tr>'; 221 226 echo '<td><strong>' . $provider->service_name . '</strong> - ' . $test_case['name'] . '</td>'; … … 223 228 if ( is_wp_error( $result ) ) { 224 229 $error_string = $result->get_error_message(); 225 echo '<td style="color:red;">✗ Failed</td>';230 echo '<td style="color:red;">✗ ' . __( 'Failed', 'video-thumbnails' ) . '</td>'; 226 231 echo '<td>'; 227 232 echo '<div class="error"><p>' . $error_string . '</p></div>'; … … 240 245 241 246 if ( $matched ) { 242 echo '<td style="color:green;">✔ Passed</td>';247 echo '<td style="color:green;">✔ ' . __( 'Passed', 'video-thumbnails' ) . '</td>'; 243 248 $passed++; 244 249 } else { 245 echo '<td style="color:red;">✗ Failed</td>';250 echo '<td style="color:red;">✗ ' . __( 'Failed', 'video-thumbnails' ) . '</td>'; 246 251 $failed++; 247 252 } 248 253 echo '<td>'; 249 254 if ( $result ) { 250 echo '<a href="' . $result . '"> View Image</a>';255 echo '<a href="' . $result . '">' . __( 'View Image', 'video-thumbnails' ) . '</a>'; 251 256 } 252 257 if ( $result_hash ) { … … 277 282 echo '<p><span style="color:red;">✖</span> ' . $attachment_id->get_error_message() . '</p>'; 278 283 } else { 279 echo '<p><span style="color:green;">✔</span> Attachment created with an ID of ' . $attachment_id. '</p>';284 echo '<p><span style="color:green;">✔</span> ' . sprintf( __( 'Attachment created with an ID of %d', 'video-thumbnails' ), $attachment_id ) . '</p>'; 280 285 wp_delete_attachment( $attachment_id, true ); 281 echo '<p><span style="color:green;">✔</span> Attachment with an ID of ' . $attachment_id . ' deleted</p>';286 echo '<p><span style="color:green;">✔</span> ' . sprintf( __( 'Attachment with an ID of %d deleted', 'video-thumbnails' ), $attachment_id ) . '</p>'; 282 287 } 283 288 … … 295 300 if ( $new_thumbnail == null ) { 296 301 // No thumbnail 297 echo '<p><span style="color:red;">✖</span> No thumbnail found</p>';302 echo '<p><span style="color:red;">✖</span> ' . __( 'No thumbnail found', 'video-thumbnails' ) . '</p>'; 298 303 } elseif ( is_wp_error( $new_thumbnail ) ) { 299 304 // Error finding thumbnail 300 echo '<p><span style="color:red;">✖</span> Error:' . $new_thumbnail->get_error_message() . '</p>';305 echo '<p><span style="color:red;">✖</span> ' . __( 'Error Details:', 'video-thumbnails' ) . ' ' . $new_thumbnail->get_error_message() . '</p>'; 301 306 } else { 302 307 // Found a thumbnail … … 304 309 if ( is_wp_error( $remote_response ) ) { 305 310 // WP Error trying to read image from remote server 306 echo '<p><span style="color:red;">✖</span> Thumbnail found, but there was an error retrieving the URL.</p>';307 echo '<p> Error Details:' . $remote_response->get_error_message() . '</p>';311 echo '<p><span style="color:red;">✖</span> ' . __( 'Thumbnail found, but there was an error retrieving the URL.', 'video-thumbnails' ) . '</p>'; 312 echo '<p>' . __( 'Error Details:', 'video-thumbnails' ) . ' ' . $remote_response->get_error_message() . '</p>'; 308 313 } elseif ( $remote_response['response']['code'] != '200' ) { 309 314 // Response code isn't okay 310 echo '<p><span style="color:red;">✖</span> Thumbnail found, but it may not exist on the source server. If opening the URL below in your web browser returns an error, the source is providing an invalid URL.</p>';311 echo '<p> Thumbnail URL:<a href="' . $new_thumbnail . '" target="_blank">' . $new_thumbnail . '</a>';315 echo '<p><span style="color:red;">✖</span> ' . __( 'Thumbnail found, but it may not exist on the source server. If opening the URL below in your web browser returns an error, the source is providing an invalid URL.', 'video-thumbnails' ) . '</p>'; 316 echo '<p>' . __( 'Thumbnail URL:', 'video-thumbnails' ) . ' <a href="' . $new_thumbnail . '" target="_blank">' . $new_thumbnail . '</a>'; 312 317 } else { 313 318 // Everything is okay! 314 echo '<p><span style="color:green;">✔</span> Thumbnail found! Image should appear below. <a href="' . $new_thumbnail . '" target="_blank">View full size</a></p>';319 echo '<p><span style="color:green;">✔</span> ' . __( 'Thumbnail found! Image should appear below.', 'video-thumbnails' ) . ' <a href="' . $new_thumbnail . '" target="_blank">' . __( 'View full size', 'video-thumbnails' ) . '</a></p>'; 315 320 echo '<p><img src="' . $new_thumbnail . '" style="max-width: 500px;"></p>'; 316 321 } … … 323 328 add_settings_section( 324 329 'general_settings_section', 325 'General Settings',330 __( 'General Settings', 'video-thumbnails' ), 326 331 array( &$this, 'general_settings_callback' ), 327 332 'video_thumbnails' … … 329 334 $this->add_checkbox_setting( 330 335 'save_media', 331 'Save Thumbnails to Media Library',332 'Checking this option will download video thumbnails to your server'336 __( 'Save Thumbnails to Media Library', 'video-thumbnails' ), 337 __( 'Checking this option will download video thumbnails to your server', 'video-thumbnails' ) 333 338 ); 334 339 $this->add_checkbox_setting( 335 340 'set_featured', 336 'Automatically Set Featured Image',337 'Check this option to automatically set video thumbnails as the featured image (requires saving to media library)'341 __( 'Automatically Set Featured Image', 'video-thumbnails' ), 342 __( 'Check this option to automatically set video thumbnails as the featured image (requires saving to media library)', 'video-thumbnails' ) 338 343 ); 339 344 // Get post types … … 343 348 $this->add_multicheckbox_setting( 344 349 'post_types', 345 'Post Types',350 __( 'Post Types', 'video-thumbnails' ), 346 351 $post_types 347 352 ); 348 353 $this->add_text_setting( 349 354 'custom_field', 350 'Custom Field (optional)',351 '<a href="#" class="button" id="vt_detect_custom_field"> Automatically Detect</a> Enter the name of the custom field where your embed code or video URL is stored.'355 __( 'Custom Field (optional)', 'video-thumbnails' ), 356 '<a href="#" class="button" id="vt_detect_custom_field">' . __( 'Automatically Detect', 'video-thumbnails' ) . '</a> ' . __( 'Enter the name of the custom field where your embed code or video URL is stored.', 'video-thumbnails' ) 352 357 ); 353 358 register_setting( 'video_thumbnails', 'video_thumbnails', array( &$this, 'sanitize_callback' ) ); … … 379 384 380 385 function general_settings_callback() { 381 echo '<p> These options configure where the plugin will search for videos and what to do with thumbnails once found.</p>';386 echo '<p>' . __( 'These options configure where the plugin will search for videos and what to do with thumbnails once found.', 'video-thumbnails' ) . '</p>'; 382 387 } 383 388 … … 452 457 453 458 if ( ! current_user_can( 'manage_options' ) ) { 454 wp_die( __( 'You do not have sufficient permissions to access this page.' ) );459 wp_die( __( 'You do not have sufficient permissions to access this page.', 'video-thumbnails' ) ); 455 460 } 456 461 457 462 ?><div class="wrap"> 458 463 459 <div id="icon-options-general" class="icon32"></div><h2> Video Thumbnails Options</h2>464 <div id="icon-options-general" class="icon32"></div><h2><?php _e( 'Video Thumbnails Options', 'video-thumbnails' ); ?></h2> 460 465 461 466 <?php $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general_settings'; ?> 462 467 <h2 class="nav-tab-wrapper"> 463 <a href="?page=video_thumbnails&tab=general_settings" class="nav-tab <?php echo $active_tab == 'general_settings' ? 'nav-tab-active' : ''; ?>"> General</a>464 <a href="?page=video_thumbnails&tab=provider_settings" class="nav-tab <?php echo $active_tab == 'provider_settings' ? 'nav-tab-active' : ''; ?>"> Providers</a>465 <a href="?page=video_thumbnails&tab=mass_actions" class="nav-tab <?php echo $active_tab == 'mass_actions' ? 'nav-tab-active' : ''; ?>"> Mass Actions</a>466 <a href="?page=video_thumbnails&tab=debugging" class="nav-tab <?php echo $active_tab == 'debugging' ? 'nav-tab-active' : ''; ?>"> Debugging</a>467 <a href="?page=video_thumbnails&tab=support" class="nav-tab <?php echo $active_tab == 'support' ? 'nav-tab-active' : ''; ?>"> Support</a>468 <a href="?page=video_thumbnails&tab=general_settings" class="nav-tab <?php echo $active_tab == 'general_settings' ? 'nav-tab-active' : ''; ?>"><?php _e( 'General', 'video-thumbnails' ); ?></a> 469 <a href="?page=video_thumbnails&tab=provider_settings" class="nav-tab <?php echo $active_tab == 'provider_settings' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Providers', 'video-thumbnails' ); ?></a> 470 <a href="?page=video_thumbnails&tab=mass_actions" class="nav-tab <?php echo $active_tab == 'mass_actions' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Mass Actions', 'video-thumbnails' ); ?></a> 471 <a href="?page=video_thumbnails&tab=debugging" class="nav-tab <?php echo $active_tab == 'debugging' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Debugging', 'video-thumbnails' ); ?></a> 472 <a href="?page=video_thumbnails&tab=support" class="nav-tab <?php echo $active_tab == 'support' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Support', 'video-thumbnails' ); ?></a> 468 473 </h2> 469 474 … … 472 477 if ( $active_tab == 'general_settings' ) { 473 478 ?> 474 <h3> Getting started</h3>475 476 <p> If your theme supports post thumbnails, just leave "Save Thumbnails to Media Library" and "Automatically Set Featured Image" enabled, then select what post types you'd like scanned for videos.</p>477 478 <p> For more detailed instructions, check out the page for <a href="http://wordpress.org/extend/plugins/video-thumbnails/">Video Thumbnails on the official plugin directory</a>.</p>479 <h3><?php _e( 'Getting started', 'video-thumbnails' ); ?></h3> 480 481 <p><?php _e( 'If your theme supports post thumbnails, just leave "Save Thumbnails to Media Library" and "Automatically Set Featured Image" enabled, then select what post types you\'d like scanned for videos.', 'video-thumbnails' ); ?></p> 482 483 <p><?php _e( 'For more detailed instructions, check out the page for <a href="http://wordpress.org/extend/plugins/video-thumbnails/">Video Thumbnails on the official plugin directory</a>.', 'video-thumbnails' ); ?></p> 479 484 480 485 <form method="post" action="options.php"> … … 504 509 if ( $active_tab == 'mass_actions' ) { 505 510 ?> 506 <h3> Scan All Posts</h3>507 508 <p> Scan all of your past posts for video thumbnails. Be sure to save any settings before running the scan.</p>509 510 <p><a class="button-primary" href="<?php echo admin_url( 'tools.php?page=video-thumbnails-bulk' ); ?>"> Scan Past Posts</a></p>511 512 <h3> Clear all Video Thumbnails</h3>513 514 <p> This will clear the video thumbnail field for all posts and delete any video thumbnail attachments. Note: This only works for attachments added using version 2.0 or later.</p>515 516 <p><input type="submit" class="button-primary" onclick="clear_all_video_thumbnails('<?php echo wp_create_nonce( 'clear_all_video_thumbnails' ); ?>');" value=" Clear Video Thumbnails" /></p>511 <h3><?php _e( 'Scan All Posts', 'video-thumbnails' ); ?></h3> 512 513 <p><?php _e( 'Scan all of your past posts for video thumbnails. Be sure to save any settings before running the scan.', 'video-thumbnails' ); ?></p> 514 515 <p><a class="button-primary" href="<?php echo admin_url( 'tools.php?page=video-thumbnails-bulk' ); ?>"><?php _e( 'Scan Past Posts', 'video-thumbnails' ); ?></a></p> 516 517 <h3><?php _e( 'Clear all Video Thumbnails', 'video-thumbnails' ); ?></h3> 518 519 <p><?php _e( 'This will clear the video thumbnail field for all posts and delete any video thumbnail attachments. Note: This only works for attachments added using version 2.0 or later.', 'video-thumbnails' ); ?></p> 520 521 <p><input type="submit" class="button-primary" onclick="clear_all_video_thumbnails('<?php echo wp_create_nonce( 'clear_all_video_thumbnails' ); ?>');" value="<?php esc_attr_e( 'Clear Video Thumbnails', 'video-thumbnails' ); ?>" /></p> 517 522 518 523 <div id="clear-all-video-thumbnails-result"></div> … … 525 530 ?> 526 531 527 <p> Use these tests to help diagnose any problems. Please include results when requesting support.</p>528 529 <h3> Test Thumbnail Providers</h3>530 531 <p> This test automatically searches a sample for every type of video supported and compares it to the expected value. Sometimes tests may fail due to API rate limits.</p>532 <p><?php _e( 'Use these tests to help diagnose any problems. Please include results when requesting support.', 'video-thumbnails' ); ?></p> 533 534 <h3><?php _e( 'Test Video Providers', 'video-thumbnails' ); ?></h3> 535 536 <p><?php _e( 'This test automatically searches a sample for every type of video supported and compares it to the expected value. Sometimes tests may fail due to API rate limits.', 'video-thumbnails' ); ?></p> 532 537 533 538 <div id="provider-test"> 534 <p><input type="submit" class="button-primary" onclick="test_video_thumbnail('provider');" value=" Test Providers" /></p>539 <p><input type="submit" class="button-primary" onclick="test_video_thumbnail('provider');" value="<?php esc_attr_e( 'Test Video Providers', 'video-thumbnails' ); ?>" /></p> 535 540 </div> 536 541 537 <h3> Test Markup for Video</h3>538 539 <p> Copy and paste an embed code below to see if a video is detected.</p>542 <h3><?php _e( 'Test Markup for Video', 'video-thumbnails' ); ?></h3> 543 544 <p><?php _e( 'Copy and paste an embed code below to see if a video is detected.', 'video-thumbnails' ); ?></p> 540 545 541 546 <textarea id="markup-input" cols="50" rows="5"></textarea> 542 547 543 <p><input type="submit" class="button-primary" onclick="test_video_thumbnail_markup_detection();" value=" Scan For Thumbnail" /></p>548 <p><input type="submit" class="button-primary" onclick="test_video_thumbnail_markup_detection();" value="<?php esc_attr_e( 'Scan For Thumbnail', 'video-thumbnails' ); ?>" /></p> 544 549 545 550 <div id="markup-test-result"></div> 546 551 547 <h3> Test Saving to Media Library</h3>548 549 <p> This test checks for issues with the process of saving a remote thumbnail to your local media library.</p>550 551 <p> Also be sure to test that you can manually upload an image to your site. If you're unable to upload images, you may need to <a href="http://codex.wordpress.org/Changing_File_Permissions">change file permissions</a>.</p>552 <h3><?php _e( 'Test Saving to Media Library', 'video-thumbnails' ); ?></h3> 553 554 <p><?php _e( 'This test checks for issues with the process of saving a remote thumbnail to your local media library.', 'video-thumbnails' ); ?></p> 555 556 <p><?php _e( 'Also be sure to test that you can manually upload an image to your site. If you\'re unable to upload images, you may need to <a href="http://codex.wordpress.org/Changing_File_Permissions">change file permissions</a>.', 'video-thumbnails' ); ?></p> 552 557 553 558 <div id="saving_media-test"> 554 <p><input type="submit" class="button-primary" onclick="test_video_thumbnail('saving_media');" value=" Test Image Downloading" /></p>559 <p><input type="submit" class="button-primary" onclick="test_video_thumbnail('saving_media');" value="<?php esc_attr_e( 'Test Image Downloading', 'video-thumbnails' ); ?>" /></p> 555 560 </div> 556 561 557 <h3> Installation Information</h3>562 <h3><?php _e( 'Installation Information', 'video-thumbnails' ); ?></h3> 558 563 <table class="widefat"> 559 564 <thead> … … 566 571 <tbody> 567 572 <tr> 568 <td><strong> WordPress Version</strong></td>573 <td><strong><?php _e( 'WordPress Version', 'video-thumbnails' ); ?></strong></td> 569 574 <td><?php echo get_bloginfo( 'version' ); ?></td> 570 575 <td></td> 571 576 </tr> 572 577 <tr> 573 <td><strong> Video Thumbnails Version</strong></td>578 <td><strong><?php _e( 'Video Thumbnails Version', 'video-thumbnails' ); ?></strong></td> 574 579 <td><?php echo VIDEO_THUMBNAILS_VERSION; ?></td> 575 580 <td></td> 576 581 </tr> 577 582 <tr> 578 <td><strong> Video Thumbnails Settings Version</strong></td>583 <td><strong><?php _e( 'Video Thumbnails Settings Version', 'video-thumbnails' ); ?></strong></td> 579 584 <td><?php echo $this->options['version']; ?></td> 580 585 <td></td> 581 586 </tr> 582 587 <tr> 583 <td><strong> PHP Version</strong></td>588 <td><strong><?php _e( 'PHP Version', 'video-thumbnails' ); ?></strong></td> 584 589 <td><?php echo PHP_VERSION; ?></td> 585 590 <td></td> 586 591 </tr> 587 592 <tr> 588 <td><strong> Post Thumbnails</strong></td>589 <td><?php if ( current_theme_supports( 'post-thumbnails' ) ) : ?><span style="color:green">✔</span> Your theme supports post thumbnails.<?php else: ?><span style="color:red">✖</span> Your theme doesn't support post thumbnails, you'll need to make modifications or switch to a different theme. <a href="http://codex.wordpress.org/Post_Thumbnails">More info</a><?php endif; ?></td>593 <td><strong><?php _e( 'Post Thumbnails', 'video-thumbnails' ); ?></strong></td> 594 <td><?php if ( current_theme_supports( 'post-thumbnails' ) ) : ?><span style="color:green">✔</span> <?php _e( 'Your theme supports post thumbnails.', 'video-thumbnails' ); ?><?php else: ?><span style="color:red">✖</span> <?php _e( 'Your theme does not support post thumbnails, you\'ll need to make modifications or switch to a different theme. <a href="http://codex.wordpress.org/Post_Thumbnails">More info</a>', 'video-thumbnails' ); ?><?php endif; ?></td> 590 595 <td></td> 591 596 </tr> 592 597 <tr> 593 <td><strong> Providers</strong></td>598 <td><strong><?php _e( 'Video Providers', 'video-thumbnails' ); ?></strong></td> 594 599 <td> 595 600 <?php global $video_thumbnails; ?> … … 630 635 <div style="width: 250px; margin: 20px 0; padding: 0 20px; background: #fff; border: 1px solid #dfdfdf; text-align: center;"> 631 636 <div> 632 <p> Support video thumbnails and unlock additional features</p>633 <p><a href="https://refactored.co/plugins/video-thumbnails" class="button button-primary button-large"> Go Pro</a></p>637 <p><?php _e( 'Support video thumbnails and unlock additional features', 'video-thumbnails' ); ?></p> 638 <p><a href="https://refactored.co/plugins/video-thumbnails" class="button button-primary button-large"><?php _e( 'Go Pro', 'video-thumbnails' ); ?></a></p> 634 639 </div> 635 640 </div> -
video-thumbnails/tags/2.7/php/providers/class-blip-thumbnails.php
r837855 r873686 44 44 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 45 45 if( is_wp_error( $response ) ) { 46 $result = new WP_Error( 'blip_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));46 $result = $this->construct_info_retrieval_error( $request, $response ); 47 47 } else { 48 48 $json = json_decode( $response['body'] ); 49 49 if ( isset( $json->error ) ) { 50 $result = new WP_Error( 'blip_invalid_url', __( 'Error retrieving video information for <a href="' . $url . '">' . $url . '</a>. Check to be sure this is a valid Blip video URL.') );50 $result = new WP_Error( 'blip_invalid_url', sprintf( __( 'Error retrieving video information for <a href="%1$s">%1$s</a>. Check to be sure this is a valid Blip video URL.', 'video-thumbnails' ), $url ) ); 51 51 } else { 52 52 $result = $json->thumbnail_url; … … 57 57 58 58 // Test cases 59 public $test_cases = array( 60 array( 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' 65 ), 66 array( 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' 71 ), 72 array( 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)' 77 ), 78 ); 59 public static function get_test_cases() { 60 return array( 61 array( 62 'markup' => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917', 63 'expected' => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg', 64 'expected_hash' => '26a622f72bd4bdb3f8189f85598dd95d', 65 'name' => __( 'Video URL', 'video-thumbnails' ) 66 ), 67 array( 68 '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>', 69 'expected' => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png', 70 'expected_hash' => '87efa9f6b0d9111b0826ae4fbdddec1b', 71 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 72 ), 73 ); 74 } 79 75 80 76 } -
video-thumbnails/tags/2.7/php/providers/class-collegehumor-thumbnails.php
r837855 r873686 44 44 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 45 45 if( is_wp_error( $response ) ) { 46 $result = new WP_Error( 'collegehumor_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));46 $result = $this->construct_info_retrieval_error( $request, $response ); 47 47 } else { 48 48 $result = json_decode( $response['body'] ); … … 53 53 54 54 // Test cases 55 public $test_cases = array( 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 'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15', 60 'name' => 'Embed' 61 ), 62 array( 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' 67 ), 68 ); 55 public static function get_test_cases() { 56 return array( 57 array( 58 '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>', 59 'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg', 60 'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15', 61 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 62 ), 63 array( 64 'markup' => 'http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody', 65 'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg', 66 'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15', 67 'name' => __( 'Video URL', 'video-thumbnails' ) 68 ), 69 ); 70 } 69 71 70 72 } -
video-thumbnails/tags/2.7/php/providers/class-dailymotion-thumbnails.php
r837855 r873686 46 46 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 47 47 if( is_wp_error( $response ) ) { 48 $result = new WP_Error( 'dailymotion_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));48 $result = $this->construct_info_retrieval_error( $request, $response ); 49 49 } else { 50 50 $result = json_decode( $response['body'] ); … … 55 55 56 56 // Test cases 57 public $test_cases = array( 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 'expected_hash' => '077888b97839254892a377f51c06e642', 62 'name' => 'iFrame player' 63 ), 64 array( 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' 69 ), 70 ); 57 public static function get_test_cases() { 58 return array( 59 array( 60 '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>', 61 'expected' => 'http://s1.dmcdn.net/AMjdy.jpg', 62 'expected_hash' => '077888b97839254892a377f51c06e642', 63 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 64 ), 65 array( 66 '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>', 67 'expected' => 'http://s1.dmcdn.net/AMjdy.jpg', 68 'expected_hash' => '077888b97839254892a377f51c06e642', 69 'name' => __( 'Flash Embed', 'video-thumbnails' ) 70 ), 71 ); 72 } 71 73 72 74 } -
video-thumbnails/tags/2.7/php/providers/class-facebook-thumbnails.php
r837855 r873686 46 46 47 47 // Test cases 48 public $test_cases = array( 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 'expected_hash' => '619591ec126ad889799ad992a227c75e', 53 'name' => 'Flash Embed' 54 ), 55 array( 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' 60 ), 61 ); 48 public static function get_test_cases() { 49 return array( 50 array( 51 '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>', 52 'expected' => 'https://graph.facebook.com/2560032632599/picture', 53 'expected_hash' => '619591ec126ad889799ad992a227c75e', 54 'name' => __( 'Flash Embed', 'video-thumbnails' ) 55 ), 56 array( 57 'markup' => '<iframe src="https://www.facebook.com/video/embed?video_id=2560032632599" width="960" height="720" frameborder="0"></iframe>', 58 'expected' => 'https://graph.facebook.com/2560032632599/picture', 59 'expected_hash' => '619591ec126ad889799ad992a227c75e', 60 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 61 ), 62 ); 63 } 62 64 63 65 } -
video-thumbnails/tags/2.7/php/providers/class-funnyordie-thumbnails.php
r837855 r873686 45 45 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 46 46 if( is_wp_error( $response ) ) { 47 $result = new WP_Error( 'funnyordie_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));47 $result = $this->construct_info_retrieval_error( $request, $response ); 48 48 } else { 49 49 $result = json_decode( $response['body'] ); … … 54 54 55 55 // Test cases 56 public $test_cases = array( 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 'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b', 61 'name' => 'iFrame player' 62 ), 63 array( 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' 68 ), 69 ); 56 public static function get_test_cases() { 57 return array( 58 array( 59 'markup' => '<iframe src="http://www.funnyordie.com/embed/5325b03b52" width="640" height="400" frameborder="0"></iframe>', 60 'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg', 61 'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b', 62 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 63 ), 64 array( 65 '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>', 66 'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg', 67 'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b', 68 'name' => __( 'Flash Embed', 'video-thumbnails' ) 69 ), 70 ); 71 } 70 72 71 73 } -
video-thumbnails/tags/2.7/php/providers/class-googledrive-thumbnails.php
r869386 r873686 61 61 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 62 62 if( is_wp_error( $response ) ) { 63 $result = new WP_Error( 'googledrive_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));63 $result = $this->construct_info_retrieval_error( $request, $response ); 64 64 } else { 65 65 $json = json_decode( $response['body'] ); … … 68 68 } 69 69 } else { 70 $result = new WP_Error( 'googledrive_api_key', __( 'You must enter an API key in the <a href="' . admin_url( 'options-general.php?page=video_thumbnails&tab=provider_settings' ) . '">provider settings</a> to retrieve thumbnails from Google Drive.' ) );70 $result = new WP_Error( 'googledrive_api_key', __( 'You must enter an API key in the <a href="' . admin_url( 'options-general.php?page=video_thumbnails&tab=provider_settings' ) . '">provider settings</a> to retrieve thumbnails from Google Drive.', 'video-thumbnails' ) ); 71 71 } 72 72 return $result; … … 74 74 75 75 // Test cases 76 public $test_cases = array( 77 array( 78 'markup' => '<iframe src="https://docs.google.com/file/d/0B2tG5YeQL99ZUHNja3l6am9jSGM/preview?pli=1" width="640" height="385"></iframe>', 79 'expected' => 'https://lh3.googleusercontent.com/QL3d7Wh7V_qcXnMpXT6bio77RS0veyCZZ0zQbMX6gd-qH7aeIXBkXlcSJVDEyftiiA=s480', 80 'expected_hash' => '3bc674d8d77b342e633ab9e93e345462', 81 'name' => 'iFrame embed' 82 ), 83 array( 84 'markup' => '<iframe height="385" src="https://docs.google.com/a/svpanthers.org/file/d/0BxQsabDaO6USYUgxSUJ3T0ZBa3M/preview" width="100%"></iframe>', 85 'expected' => 'https://lh6.googleusercontent.com/WeOdCsaplJ3am25To1uLZiVYkyrilAQ5rxzhjnyyFc5GAF4QeCF1eq3EMpbP7O5dFg=s480', 86 'expected_hash' => 'f120755bbd1d35e381cb84a829ac0dfa', 87 'name' => 'iFrame embed (Apps account)' 88 ), 89 array( 90 'markup' => '<object width="500" height="385" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="https://video.google.com/get_player?docid=0B92WKFCDHyg9NTRqYTFjVkZmNlk&ps=docs&partnerid=30&cc_load_policy=1" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><embed width="500" height="385" type="application/x-shockwave-flash" src="https://video.google.com/get_player?docid=0B92WKFCDHyg9NTRqYTFjVkZmNlk&ps=docs&partnerid=30&cc_load_policy=1" allowFullScreen="true" allowScriptAccess="always" allowfullscreen="true" allowscriptaccess="always" /></object>', 91 'expected' => 'https://lh3.googleusercontent.com/U_lqaX1o7E9iU75XwCrHZ4pdSi-Vch2F_GK5Ib7WAxgwKTvTl0kMHXm2GxKo1Pcp3Q=s480', 92 'expected_hash' => '31cf8e05f981c1beb6e04823ad54d267', 93 'name' => 'Flash embed' 94 ), 95 array( 96 'markup' => '<object style="" id="" data="https://youtube.com/get_player?el=leaf" wmode="opaque" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" height="720px" width="1280px"><param value="true" name="allowFullScreen"><param value="always" name="allowscriptaccess"><param value="opaque" name="wmode"><param value="allow_embed=0&partnerid=30&autoplay=1&showinfo=0&docid=0B9VJd4kStxIVellHZEdXdmdSamM&el=leaf" name="flashvars"></object>', 97 'expected' => 'https://lh5.googleusercontent.com/mHn5gESachhZHi-kbPCRbR6RVXZm3bR7oNNXL97LyYjpzV3Eqty71J2Waw0DPnXKKw=s480', 98 'expected_hash' => '2d0ad4881e4b38de0510a103d2f40dd1', 99 'name' => 'Flash embed (YouTube player)' 100 ), 101 ); 76 public static function get_test_cases() { 77 return array( 78 array( 79 'markup' => '<iframe src="https://docs.google.com/file/d/0B2tG5YeQL99ZUHNja3l6am9jSGM/preview?pli=1" width="640" height="385"></iframe>', 80 'expected' => 'https://lh3.googleusercontent.com/QL3d7Wh7V_qcXnMpXT6bio77RS0veyCZZ0zQbMX6gd-qH7aeIXBkXlcSJVDEyftiiA=s480', 81 'expected_hash' => '3bc674d8d77b342e633ab9e93e345462', 82 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 83 ), 84 array( 85 'markup' => '<iframe height="385" src="https://docs.google.com/a/svpanthers.org/file/d/0BxQsabDaO6USYUgxSUJ3T0ZBa3M/preview" width="100%"></iframe>', 86 'expected' => 'https://lh6.googleusercontent.com/WeOdCsaplJ3am25To1uLZiVYkyrilAQ5rxzhjnyyFc5GAF4QeCF1eq3EMpbP7O5dFg=s480', 87 'expected_hash' => 'f120755bbd1d35e381cb84a829ac0dfa', 88 'name' => __( 'iFrame Embed (Apps account)', 'video-thumbnails' ) 89 ), 90 array( 91 'markup' => '<object width="500" height="385" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="https://video.google.com/get_player?docid=0B92WKFCDHyg9NTRqYTFjVkZmNlk&ps=docs&partnerid=30&cc_load_policy=1" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><embed width="500" height="385" type="application/x-shockwave-flash" src="https://video.google.com/get_player?docid=0B92WKFCDHyg9NTRqYTFjVkZmNlk&ps=docs&partnerid=30&cc_load_policy=1" allowFullScreen="true" allowScriptAccess="always" allowfullscreen="true" allowscriptaccess="always" /></object>', 92 'expected' => 'https://lh3.googleusercontent.com/U_lqaX1o7E9iU75XwCrHZ4pdSi-Vch2F_GK5Ib7WAxgwKTvTl0kMHXm2GxKo1Pcp3Q=s480', 93 'expected_hash' => '31cf8e05f981c1beb6e04823ad54d267', 94 'name' => __( 'Flash Embed', 'video-thumbnails' ) 95 ), 96 array( 97 'markup' => '<object style="" id="" data="https://youtube.com/get_player?el=leaf" wmode="opaque" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" height="720px" width="1280px"><param value="true" name="allowFullScreen"><param value="always" name="allowscriptaccess"><param value="opaque" name="wmode"><param value="allow_embed=0&partnerid=30&autoplay=1&showinfo=0&docid=0B9VJd4kStxIVellHZEdXdmdSamM&el=leaf" name="flashvars"></object>', 98 'expected' => 'https://lh5.googleusercontent.com/mHn5gESachhZHi-kbPCRbR6RVXZm3bR7oNNXL97LyYjpzV3Eqty71J2Waw0DPnXKKw=s480', 99 'expected_hash' => '2d0ad4881e4b38de0510a103d2f40dd1', 100 'name' => __( 'Flash Embed (YouTube player)', 'video-thumbnails' ) 101 ), 102 ); 103 } 102 104 103 105 } -
video-thumbnails/tags/2.7/php/providers/class-justintv-thumbnails.php
r837855 r873686 44 44 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 45 45 if( is_wp_error( $response ) ) { 46 $result = new WP_Error( 'justintv_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));46 $result = $this->construct_info_retrieval_error( $request, $response ); 47 47 } else { 48 48 $xml = new SimpleXMLElement( $response['body'] ); … … 53 53 54 54 // Test cases 55 public $test_cases = array( 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 'expected_hash' => '7f260a2ce6ae75a3c2e5012108f161b7', 60 'name' => 'Embed' 61 ), 62 ); 55 public static function get_test_cases() { 56 return array( 57 array( 58 '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>', 59 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-392481524-320x240.jpg', 60 'expected_hash' => '7f260a2ce6ae75a3c2e5012108f161b7', 61 'name' => __( 'Flash Embed', 'video-thumbnails' ) 62 ), 63 ); 64 } 63 65 64 66 } -
video-thumbnails/tags/2.7/php/providers/class-kaltura-thumbnails.php
r837855 r873686 44 44 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 45 45 if( is_wp_error( $response ) ) { 46 $result = new WP_Error( 'kaltura_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));46 $result = $this->construct_info_retrieval_error( $request, $response ); 47 47 } else { 48 48 $xml = new SimpleXMLElement( $response['body'] ); … … 51 51 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 52 52 if( is_wp_error( $response ) ) { 53 $result = new WP_Error( 'kaltura_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));53 $result = $this->construct_info_retrieval_error( $request, $response ); 54 54 } else { 55 55 $xml = new SimpleXMLElement( $response['body'] ); … … 61 61 62 62 // Test cases 63 public $test_cases = array( 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>', 66 'expected' => 'http://example.com/thumbnail.jpg', 67 'name' => 'Auto embed' 68 ), 69 ); 63 public static function get_test_cases() { 64 return array( 65 array( 66 '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>', 67 'expected' => 'http://example.com/thumbnail.jpg', 68 'name' => __( 'Auto Embed', 'video-thumbnails' ) 69 ), 70 ); 71 } 70 72 71 73 } -
video-thumbnails/tags/2.7/php/providers/class-metacafe-thumbnails.php
r837855 r873686 44 44 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 45 45 if( is_wp_error( $response ) ) { 46 $result = new WP_Error( 'metacafe_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));46 $result = $this->construct_info_retrieval_error( $request, $response ); 47 47 } else { 48 48 $xml = new SimpleXMLElement( $response['body'] ); … … 54 54 55 55 // Test cases 56 public $test_cases = array( 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 'expected_hash' => 'df46215fef1d9fb68eea64ba3ed9a4fd', 61 'name' => 'Embed' 62 ), 63 ); 56 public static function get_test_cases() { 57 return array( 58 array( 59 '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>', 60 'expected' => 'http://s4.mcstatic.com/thumb/8456223/22479418/4/catalog_item5/0/1/men_in_black_3_trailer_2.jpg', 61 'expected_hash' => 'df46215fef1d9fb68eea64ba3ed9a4fd', 62 'name' => __( 'Flash Embed', 'video-thumbnails' ) 63 ), 64 ); 65 } 64 66 65 67 } -
video-thumbnails/tags/2.7/php/providers/class-mpora-thumbnails.php
r837855 r873686 46 46 47 47 // Test cases 48 public $test_cases = array( 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 'expected_hash' => '95075bd4941251ebecbab3b436a90c49', 53 'name' => 'Flash player' 54 ), 55 array( 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' 60 ), 61 ); 48 public static function get_test_cases() { 49 return array( 50 array( 51 '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>', 52 'expected' => 'http://ugc4.mporatrons.com/thumbs/wEr2CBooV_640x360_0000.jpg', 53 'expected_hash' => '95075bd4941251ebecbab3b436a90c49', 54 'name' => __( 'Flash Embed', 'video-thumbnails' ) 55 ), 56 array( 57 'markup' => '<iframe width="640" height="360" src="http://mpora.com/videos/AAdfegovdop0/embed" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 58 'expected' => 'http://ugc4.mporatrons.com/thumbs/AAdfegovdop0_640x360_0000.jpg', 59 'expected_hash' => '45db22a2ba5ef20163f52ba562b89259', 60 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 61 ), 62 ); 63 } 64 62 65 } 63 66 -
video-thumbnails/tags/2.7/php/providers/class-rutube-thumbnails.php
r837855 r873686 45 45 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 46 46 if( is_wp_error( $response ) ) { 47 $result = new WP_Error( 'rutube_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));47 $result = $this->construct_info_retrieval_error( $request, $response ); 48 48 } else { 49 49 $result = json_decode( $response['body'] ); … … 54 54 55 55 // Test cases 56 public $test_cases = array( 57 array( 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' 62 ), 63 array( 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' 68 ), 69 ); 56 public static function get_test_cases() { 57 return array( 58 array( 59 'markup' => 'http://rutube.ru/video/ca8607cd4f7ef28516e043dde0068564/', 60 'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg', 61 'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354', 62 'name' => __( 'Video URL', 'video-thumbnails' ) 63 ), 64 array( 65 'markup' => '<iframe width="720" height="405" src="//rutube.ru/video/embed/6608735" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>', 66 'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg', 67 'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354', 68 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 69 ), 70 ); 71 } 70 72 71 73 } -
video-thumbnails/tags/2.7/php/providers/class-twitch-thumbnails.php
r837855 r873686 45 45 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 46 46 if( is_wp_error( $response ) ) { 47 $result = new WP_Error( 'twitch_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));47 $result = $this->construct_info_retrieval_error( $request, $response ); 48 48 } else { 49 49 $result = json_decode( $response['body'] ); … … 54 54 55 55 // Test cases 56 public $test_cases = array( 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 'expected_hash' => 'f3921b65f799aa648ef6dae29871c137', 61 'name' => 'Video link' 62 ), 63 array( 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' 68 ), 69 ); 56 public static function get_test_cases() { 57 return array( 58 array( 59 'markup' => 'http://www.twitch.tv/vanillatv/c/1537974', 60 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg', 61 'expected_hash' => 'f3921b65f799aa648ef6dae29871c137', 62 'name' => __( 'Video URL', 'video-thumbnails' ) 63 ), 64 array( 65 '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>', 66 'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg', 67 'expected_hash' => 'f3921b65f799aa648ef6dae29871c137', 68 'name' => __( 'Flash Embed', 'video-thumbnails' ) 69 ), 70 ); 71 } 70 72 71 73 } -
video-thumbnails/tags/2.7/php/providers/class-video-thumbnails-providers.php
r859638 r873686 82 82 } 83 83 84 /** 85 * Constructs a WP_Error object after failed API retrieval 86 * @param string $request The URL wp_remote_get() failed to retrieve 87 * @param WP_Error $response A WP_Error object returned by the failed wp_remote_get() 88 * @return WP_Error An error object with a descriptive message including troubleshooting instructions 89 */ 90 function construct_info_retrieval_error( $request, $response ) { 91 $code = $this->service_slug . '_info_retrieval'; 92 $message = sprintf( __( 'Error retrieving video information from the URL <a href="%1$s">%1$s</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.', 'video-thumbnails' ), $request ) . '<br />' . __( 'Error Details:', 'video-thumbnails' ) . ' ' . $response->get_error_message(); 93 return new WP_Error( $code, $message ); 94 } 95 84 96 // // Requires PHP 5.3.0+ 85 97 // public static function register_provider( $providers ) { -
video-thumbnails/tags/2.7/php/providers/class-vimeo-thumbnails.php
r862503 r873686 88 88 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 89 89 if( is_wp_error( $response ) ) { 90 $result = new WP_Error( 'vimeo_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));90 $result = $this->construct_info_retrieval_error( $request, $response ); 91 91 } elseif ( $response['response']['code'] == 404 ) { 92 $result = new WP_Error( 'vimeo_info_retrieval', __( 'The Vimeo endpoint located at <a href="' . $request . '">' . $request . '</a> returned a 404 error.<br />Details: ' . $response['response']['message'] ) );92 $result = new WP_Error( 'vimeo_info_retrieval', __( 'The Vimeo endpoint located at <a href="' . $request . '">' . $request . '</a> returned a 404 error.<br />Details: ' . $response['response']['message'], 'video-thumbnails' ) ); 93 93 } elseif ( $response['response']['code'] == 403 ) { 94 $result = new WP_Error( 'vimeo_info_retrieval', __( 'The Vimeo endpoint located at <a href="' . $request . '">' . $request . '</a> returned a 403 error.<br />This can occur when a video has embedding disabled or restricted to certain domains. Try entering API credentials in the provider settings.' ) );94 $result = new WP_Error( 'vimeo_info_retrieval', __( 'The Vimeo endpoint located at <a href="' . $request . '">' . $request . '</a> returned a 403 error.<br />This can occur when a video has embedding disabled or restricted to certain domains. Try entering API credentials in the provider settings.', 'video-thumbnails' ) ); 95 95 } else { 96 96 $result = json_decode( $response['body'] ); … … 102 102 103 103 // Test cases 104 public $test_cases = array( 105 array( 106 'markup' => '<iframe src="http://player.vimeo.com/video/41504360" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 107 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 108 'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623', 109 'name' => 'iFrame' 110 ), 111 array( 112 '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>', 113 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 114 'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623', 115 'name' => 'Old embed' 116 ), 117 array( 118 'markup' => 'https://vimeo.com/channels/soundworkscollection/44520894', 119 'expected' => 'http://b.vimeocdn.com/ts/313/130/313130530_640.jpg', 120 'expected_hash' => 'e9fd72872a39272f6c540ee66b1ecf28', 121 'name' => 'Channel URL' 122 ), 123 ); 104 public static function get_test_cases() { 105 return array( 106 array( 107 'markup' => '<iframe src="http://player.vimeo.com/video/41504360" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 108 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 109 'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623', 110 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 111 ), 112 array( 113 '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>', 114 'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg', 115 'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623', 116 'name' => __( 'Flash Embed', 'video-thumbnails' ) 117 ), 118 array( 119 'markup' => 'https://vimeo.com/channels/soundworkscollection/44520894', 120 'expected' => 'http://b.vimeocdn.com/ts/313/130/313130530_640.jpg', 121 'expected_hash' => 'e9fd72872a39272f6c540ee66b1ecf28', 122 'name' => __( 'Channel URL', 'video-thumbnails' ) 123 ), 124 ); 125 } 124 126 125 127 } -
video-thumbnails/tags/2.7/php/providers/class-vine-thumbnails.php
r837855 r873686 44 44 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 45 45 if( is_wp_error( $response ) ) { 46 $result = new WP_Error( 'vine_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));46 $result = $this->construct_info_retrieval_error( $request, $response ); 47 47 } else { 48 48 $doc = new DOMDocument(); … … 61 61 62 62 // Test cases 63 public $test_cases = array( 64 array( 65 'markup' => '<iframe class="vine-embed" src="https://vine.co/v/bpj7Km0T3d5/embed/simple" width="600" height="600" frameborder="0"></iframe><script async src="//platform.vine.co/static/scripts/embed.js" charset="utf-8"></script>', 66 'expected' => 'https://v.cdn.vine.co/v/thumbs/D6DDE013-F8DA-4929-9BED-49568F424343-184-00000008A20C1AEC_1.0.6.mp4.jpg', 67 'expected_hash' => '7cca5921108abe15b8c1c1f884a5b3ac', 68 'name' => 'Embed/Video URL' 69 ), 70 ); 63 public static function get_test_cases() { 64 return array( 65 array( 66 'markup' => '<iframe class="vine-embed" src="https://vine.co/v/bpj7Km0T3d5/embed/simple" width="600" height="600" frameborder="0"></iframe><script async src="//platform.vine.co/static/scripts/embed.js" charset="utf-8"></script>', 67 'expected' => 'https://v.cdn.vine.co/v/thumbs/D6DDE013-F8DA-4929-9BED-49568F424343-184-00000008A20C1AEC_1.0.6.mp4.jpg', 68 'expected_hash' => '7cca5921108abe15b8c1c1f884a5b3ac', 69 'name' => __( 'iFrame Embed/Video URL', 'video-thumbnails' ) 70 ), 71 ); 72 } 71 73 72 74 } -
video-thumbnails/tags/2.7/php/providers/class-vk-thumbnails.php
r859790 r873686 44 44 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 45 45 if( is_wp_error( $response ) ) { 46 $result = new WP_Error( 'vk_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));46 $result = $this->construct_info_retrieval_error( $request, $response ); 47 47 } else { 48 48 $doc = new DOMDocument(); … … 61 61 62 62 // Test cases 63 public $test_cases = array( 64 array( 65 'markup' => '<iframe src="http://vk.com/video_ext.php?oid=157000410&id=164106383&hash=0fdb5f49218be7c2&hd=1" width="607" height="360" frameborder="0"></iframe>', 66 'expected' => 'http://cs513416.vk.me/u157000410/video/l_73b292cc.jpg', 67 'expected_hash' => '6d4b086ff1a55c9b48f56bc7848e6c84', 68 'name' => 'iFrame' 69 ), 70 ); 63 public static function get_test_cases() { 64 return array( 65 array( 66 'markup' => '<iframe src="http://vk.com/video_ext.php?oid=157000410&id=164106383&hash=0fdb5f49218be7c2&hd=1" width="607" height="360" frameborder="0"></iframe>', 67 'expected' => 'http://cs513416.vk.me/u157000410/video/l_73b292cc.jpg', 68 'expected_hash' => '6d4b086ff1a55c9b48f56bc7848e6c84', 69 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 70 ), 71 ); 72 } 71 73 72 74 } -
video-thumbnails/tags/2.7/php/providers/class-wistia-thumbnails.php
r840515 r873686 66 66 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 67 67 if( is_wp_error( $response ) ) { 68 $result = new WP_Error( 'wistia_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));68 $result = $this->construct_info_retrieval_error( $request, $response ); 69 69 } else { 70 70 $result = json_decode( $response['body'] ); … … 77 77 78 78 // Test cases 79 public $test_cases = array( 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' => 'https://embed-ssl.wistia.com/deliveries/6928fcba8355e38de4d95863a659e1de23cb2071.jpg', 83 'expected_hash' => 'bc4a2cec9ac97e2ccdae2c7387a01cb4', 84 'name' => 'Inline player' 85 ), 86 array( 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' 91 ), 92 ); 79 public static function get_test_cases() { 80 return array( 81 array( 82 '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>', 83 'expected' => 'https://embed-ssl.wistia.com/deliveries/6928fcba8355e38de4d95863a659e1de23cb2071.jpg', 84 'expected_hash' => 'bc4a2cec9ac97e2ccdae2c7387a01cb4', 85 'name' => __( 'iFrame Embed', 'video-thumbnails' ) 86 ), 87 array( 88 '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>', 89 'expected' => 'https://embed-ssl.wistia.com/deliveries/a086707fe096e7f3fbefef1d1dcba1488d23a3e9.jpg', 90 'expected_hash' => '4c63d131604bfc07b5178413ab245813', 91 'name' => __( 'JavaScript Embed', 'video-thumbnails' ) 92 ), 93 ); 94 } 93 95 94 96 } -
video-thumbnails/tags/2.7/php/providers/class-youku-thumbnails.php
r837855 r873686 45 45 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 46 46 if( is_wp_error( $response ) ) { 47 $result = new WP_Error( 'youku_info_retrieval', __( 'Error retrieving video information from the URL <a href="' . $request . '">' . $request . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message() ));47 $result = $this->construct_info_retrieval_error( $request, $response ); 48 48 } else { 49 49 $result = json_decode( $response['body'] ); … … 54 54 55 55 // Test cases 56 public $test_cases = array( 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 'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8', 61 'name' => 'Flash embed' 62 ), 63 array( 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' 68 ), 69 ); 56 public static function get_test_cases() { 57 return array( 58 array( 59 '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>', 60 'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493', 61 'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8', 62 'name' => __( 'Flash Embed', 'video-thumbnails' ) 63 ), 64 array( 65 'markup' => 'http://v.youku.com/v_show/id_XMzQyMzk5MzQ4.html', 66 'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493', 67 'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8', 68 'name' => __( 'Video URL', 'video-thumbnails' ) 69 ), 70 ); 71 } 70 72 71 73 } -
video-thumbnails/tags/2.7/php/providers/class-youtube-thumbnails.php
r840515 r873686 56 56 57 57 // Test cases 58 public $test_cases = array( 59 array( 60 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/Fp0U2Vglkjw" frameborder="0" allowfullscreen></iframe>', 61 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 62 'expected_hash' => 'c66256332969c38790c2b9f26f725e7a', 63 'name' => 'iFrame HD' 64 ), 65 array( 66 '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>', 67 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 68 'expected_hash' => 'c66256332969c38790c2b9f26f725e7a', 69 'name' => 'Old embed HD' 70 ), 71 array( 72 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/vv_AitYPjtc" frameborder="0" allowfullscreen></iframe>', 73 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 74 'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9', 75 'name' => 'iFrame SD' 76 ), 77 array( 78 '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>', 79 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 80 'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9', 81 'name' => 'Old embed SD' 82 ), 83 ); 58 public static function get_test_cases() { 59 return array( 60 array( 61 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/Fp0U2Vglkjw" frameborder="0" allowfullscreen></iframe>', 62 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 63 'expected_hash' => 'c66256332969c38790c2b9f26f725e7a', 64 'name' => __( 'iFrame Embed HD', 'video-thumbnails' ) 65 ), 66 array( 67 '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>', 68 'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg', 69 'expected_hash' => 'c66256332969c38790c2b9f26f725e7a', 70 'name' => __( 'Flash Embed HD', 'video-thumbnails' ) 71 ), 72 array( 73 'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/vv_AitYPjtc" frameborder="0" allowfullscreen></iframe>', 74 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 75 'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9', 76 'name' => __( 'iFrame Embed SD', 'video-thumbnails' ) 77 ), 78 array( 79 '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>', 80 'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg', 81 'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9', 82 'name' => __( 'Flash Embed SD', 'video-thumbnails' ) 83 ), 84 ); 85 } 84 86 85 87 } -
video-thumbnails/tags/2.7/readme.txt
r869386 r873686 5 5 Requires at least: 3.2 6 6 Tested up to: 3.8.1 7 Stable tag: 2. 6.37 Stable tag: 2.7 8 8 9 9 Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template. … … 118 118 119 119 == Changelog == 120 121 = 2.7 = 122 * Video Thumbnails is now translation ready and looking for volunteers 120 123 121 124 = 2.6.3 = -
video-thumbnails/tags/2.7/video-thumbnails.php
r869386 r873686 6 6 Author: Sutherland Boswell 7 7 Author URI: http://sutherlandboswell.com 8 Version: 2. 6.38 Version: 2.7 9 9 License: GPL2 10 Text Domain: video-thumbnails 11 Domain Path: /languages/ 10 12 */ 11 13 /* Copyright 2014 Sutherland Boswell (email : [email protected]) … … 29 31 define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) ); 30 32 define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' ); 31 define( 'VIDEO_THUMBNAILS_VERSION', '2. 6.3' );33 define( 'VIDEO_THUMBNAILS_VERSION', '2.7' ); 32 34 33 35 // Providers … … 48 50 49 51 function __construct() { 52 53 // Load translations 54 add_action( 'plugins_loaded', array( &$this, 'plugin_textdomain' )); 50 55 51 56 // Create provider array … … 86 91 87 92 /** 93 * Load language files 94 */ 95 function plugin_textdomain() { 96 load_plugin_textdomain( 'video-thumbnails', false, VIDEO_THUMBNAILS_PATH . '/languages/' ); 97 } 98 99 /** 88 100 * Adds the admin menu items 89 101 */ 90 102 function admin_menu() { 91 add_management_page( 'Bulk Video Thumbnails', 'Bulk Video Thumbs', 'manage_options', 'video-thumbnails-bulk', array( &$this, 'bulk_scanning_page' ) );103 add_management_page( __( 'Bulk Video Thumbnails', 'video-thumbnails' ), __( 'Bulk Video Thumbs', 'video-thumbnails' ), 'manage_options', 'video-thumbnails-bulk', array( &$this, 'bulk_scanning_page' ) ); 92 104 } 93 105 … … 96 108 if ( 'tools_page_video-thumbnails-bulk' == $hook ) { 97 109 wp_enqueue_script( 'video-thumbnails-bulk-js', plugins_url( '/js/bulk.js' , __FILE__ ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION ); 110 wp_localize_script( 'video-thumbnails-bulk-js', 'video_thumbnails_bulk_language', array( 111 'working' => __( 'Working...', 'video-thumbnails' ), 112 'started' => __( 'Started Scanning', 'video-thumbnails' ), 113 'resumed' => __( 'Resumed Scanning', 'video-thumbnails' ), 114 'paused' => __( 'Paused Scanning', 'video-thumbnails' ), 115 'done' => __( 'Done!', 'video-thumbnails' ), 116 'final_count_singular' => __( 'Scanned 1 post', 'video-thumbnails' ), 117 'final_count_plural' => __( 'Scanned %d posts', 'video-thumbnails' ), 118 'queue_singular' => __( '1 post in queue', 'video-thumbnails' ), 119 'queue_plural' => __( '%d posts in queue', 'video-thumbnails' ), 120 'scanning_of' => __( 'Scanning %1$s of %2$s', 'video-thumbnails' ), 121 'no_thumbnail' => __( 'No thumbnail', 'video-thumbnails' ), 122 'new_thumbnail' => __( 'New thumbnail:', 'video-thumbnails' ), 123 'existing_thumbnail' => __( 'Existing thumbnail:', 'video-thumbnails' ), 124 'error' => __( 'Error:', 'video-thumbnails' ), 125 ) ); 98 126 wp_enqueue_style( 'video-thumbnails-bulk-css', plugins_url('/css/bulk.css', __FILE__), false, VIDEO_THUMBNAILS_VERSION ); 99 127 } … … 116 144 ?> 117 145 <div id="video-thumbnail-not-found-troubleshooting" style="display:none;"> 118 <h2><?php _e( 'Troubleshooting Video Thumbnails' ); ?></h2>146 <h2><?php _e( 'Troubleshooting Video Thumbnails', 'video-thumbnails' ); ?></h2> 119 147 <?php $this->no_video_thumbnail_troubleshooting_instructions(); ?> 120 148 </div> … … 128 156 if ( get_post_status() == 'publish' || get_post_status() == 'private' ) { 129 157 if ( isset( $video_thumbnail ) && $video_thumbnail != '' ) { 130 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;"> Reset Video Thumbnail</a></p>';158 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">' . __( 'Reset Video Thumbnail', 'video-thumbnails' ) . '</a></p>'; 131 159 } else { 132 echo '<p id="video-thumbnails-preview"> No video thumbnail for this post.</p>';133 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>';160 echo '<p id="video-thumbnails-preview">' . __( 'No video thumbnail for this post.', 'video-thumbnails' ) . '</p>'; 161 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">' . __( 'Search Again', 'video-thumbnails' ) . '</a> <a href="#TB_inline?width=400&height=600&inlineId=video-thumbnail-not-found-troubleshooting" class="thickbox" style="float:right;">' . __( 'Troubleshoot', 'video-thumbnails' ) . '<a/></p>'; 134 162 } 135 163 } else { 136 164 if ( isset( $video_thumbnail ) && $video_thumbnail != '' ) { 137 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;"> Reset Video Thumbnail</a></p>';165 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">' . __( 'Reset Video Thumbnail', 'video-thumbnails' ) . '</a></p>'; 138 166 } else { 139 echo '<p> A video thumbnail will be found for this post when it is published.</p>';167 echo '<p>' . __( 'A video thumbnail will be found for this post when it is published.', 'video-thumbnails' ) . '</p>'; 140 168 } 141 169 } … … 147 175 public static function no_video_thumbnail_troubleshooting_instructions() { 148 176 ?> 149 <h3> Fixing "No video thumbnail for this post"</h3>177 <h3><?php _e( 'Fixing "No video thumbnail for this post"', 'video-thumbnails' ); ?></h3> 150 178 <ol> 151 <li> Ensure you have saved any changes to your post.</li>152 <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>153 <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>154 <li> Go to the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ); ?>">Debugging page</a> and click "Test Image Downloading" to test your server's ability to save an image from a video source.</li>155 <li> Try posting a video from other sources to help narrow down the problem.</li>156 <li> Search the <a href="http://wordpress.org/support/plugin/video-thumbnails">support threads</a> to see if anyone has had the same issue.</li>157 <li> If you are still unable to resolve the problem, <a href="http://wordpress.org/support/plugin/video-thumbnails">start a thread</a> with a <strong>good descriptive</strong> title ("Error" or "No thumbnails" is a <strong>bad</strong> title) and be sure to include the results of your testing as well. Also be sure to include the <strong>name of your theme</strong>, any <strong>video plugins</strong> you're using, and any other details you can think of.</li>179 <li><?php _e( 'Ensure you have saved any changes to your post.', 'video-thumbnails' ); ?></li> 180 <li><?php echo sprintf( __( '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="%s">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.', 'video-thumbnails' ), admin_url( 'options-general.php?page=video_thumbnails' ) ); ?></li> 181 <li><?php echo sprintf( __( 'Copy and paste your embed code into the "Test Markup for Video" section of the <a href="%1$s">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="%2$s">settings page</a> if you are using a a plugin or theme that stores videos in a special location.', 'video-thumbnails' ), admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ), admin_url( 'options-general.php?page=video_thumbnails' ) ); ?></li> 182 <li><?php echo sprintf( __( 'Go to the <a href="%s">Debugging page</a> and click "Test Image Downloading" to test your server\'s ability to save an image from a video source.', 'video-thumbnails' ), admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ) ); ?></li> 183 <li><?php _e( 'Try posting a video from other sources to help narrow down the problem.', 'video-thumbnails' ); ?></li> 184 <li><?php _e( 'Search the <a href="http://wordpress.org/support/plugin/video-thumbnails">support threads</a> to see if anyone has had the same issue.', 'video-thumbnails' ); ?></li> 185 <li><?php _e( 'If you are still unable to resolve the problem, <a href="http://wordpress.org/support/plugin/video-thumbnails">start a thread</a> with a <strong>good descriptive</strong> title ("Error" or "No thumbnails" is a <strong>bad</strong> title) and be sure to include the results of your testing as well. Also be sure to include the <strong>name of your theme</strong>, any <strong>video plugins</strong> you\'re using, and any other details you can think of.', 'video-thumbnails' ); ?></li> 158 186 </ol> 159 187 <?php … … 316 344 $response = wp_remote_get( $image_url, array( 'sslverify' => false ) ); 317 345 if( is_wp_error( $response ) ) { 318 $error = new WP_Error( 'thumbnail_retrieval', __( 'Error retrieving a thumbnail from the URL <a href="' . $image_url . '">' . $image_url . '</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.<br />Details: ' . $response->get_error_message()) );346 $error = new WP_Error( 'thumbnail_retrieval', sprintf( __( 'Error retrieving a thumbnail from the URL <a href="%1$s">%1$s</a> using <code>wp_remote_get()</code><br />If opening that URL in your web browser returns anything else than an error page, the problem may be related to your web server and might be something your host administrator can solve.', 'video-thumbnails' ), $image_url ) . '<br>' . __( 'Error Details:', 'video-thumbnails' ) . ' ' . $response->get_error_message() ); 319 347 } else { 320 348 $image_contents = $response['body']; … … 334 362 $image_extension = '.gif'; 335 363 } else { 336 return new WP_Error( 'thumbnail_upload', __( 'Unsupported MIME type:' ) . ' ' . $image_type );364 return new WP_Error( 'thumbnail_upload', __( 'Unsupported MIME type:', 'video-thumbnails' ) . ' ' . $image_type ); 337 365 } 338 366 … … 347 375 // Stop for any errors while saving the data or else continue adding the image to the media library 348 376 if ( $upload['error'] ) { 349 $error = new WP_Error( 'thumbnail_upload', __( 'Error uploading image data:' ) . ' ' . $upload['error'] );377 $error = new WP_Error( 'thumbnail_upload', __( 'Error uploading image data:', 'video-thumbnails' ) . ' ' . $upload['error'] ); 350 378 return $error; 351 379 } else { … … 391 419 echo ' post_id: id' . PHP_EOL; 392 420 echo ' };' . PHP_EOL; 393 echo ' document.getElementById(\'video-thumbnails-preview\').innerHTML=\' Working...<img src="' . home_url( 'wp-admin/images/loading.gif' ) . '"/>\';' . PHP_EOL;421 echo ' document.getElementById(\'video-thumbnails-preview\').innerHTML=\'' . __( 'Working...', 'video-thumbnails' ) . ' <img src="' . home_url( 'wp-admin/images/loading.gif' ) . '"/>\';' . PHP_EOL; 394 422 echo ' jQuery.post(ajaxurl, data, function(response){' . PHP_EOL; 395 423 echo ' document.getElementById(\'video-thumbnails-preview\').innerHTML=response;' . PHP_EOL; … … 414 442 echo '<img src="' . $video_thumbnail . '" style="max-width:100%;" />'; 415 443 } else { 416 echo 'No video thumbnail for this post.';444 echo __( 'No video thumbnail for this post.', 'video-thumbnails' ); 417 445 } 418 446 … … 469 497 470 498 if ( ! current_user_can( 'manage_options' ) ) { 471 wp_die( __( 'You do not have sufficient permissions to access this page.' ) );499 wp_die( __( 'You do not have sufficient permissions to access this page.', 'video-thumbnails' ) ); 472 500 } 473 501 … … 475 503 <div class="wrap"> 476 504 477 <div id="icon-tools" class="icon32"></div><h2> Bulk Video Thumbnail Generator</h2>478 479 <p> Use this tool to scan all of your posts for Video Thumbnails.</p>505 <div id="icon-tools" class="icon32"></div><h2><?php _e( 'Bulk Video Thumbnail Generator', 'video-thumbnails' ); ?></h2> 506 507 <p><?php _e( 'Use this tool to scan all of your posts for Video Thumbnails.', 'video-thumbnails' ); ?></p> 480 508 481 509 <form id="video-thumbnails-bulk-scan-options"> … … 486 514 <th scope="row"><span id="queue-count">...</span></th> 487 515 <td> 488 <input type="submit" value=" Scan Now" class="button button-primary">516 <input type="submit" value="<?php esc_attr_e( 'Scan Now', 'video-thumbnails' ); ?>" class="button button-primary"> 489 517 </td> 490 518 </tr> … … 498 526 <div class="progress-bar"> </div> 499 527 </div> 500 <div class="stats"> 501 <div class="scanned"></div> 502 <div class="found"></div> 503 </div> 528 <table class="stats"> 529 <thead> 530 <tr> 531 <th><?php _e( 'Scanned', 'video-thumbnails' ); ?></th> 532 <th><?php _e( 'New Thumbnails', 'video-thumbnails' ); ?></th> 533 <th><?php _e( 'Existing', 'video-thumbnails' ); ?></th> 534 </tr> 535 </thead> 536 <tr> 537 <td class="scanned">0</td> 538 <td class="found-new">0</td> 539 <td class="found-existing">0</td> 540 </tr> 541 </table> 504 542 <ul class="log"></ul> 505 543 </div> -
video-thumbnails/trunk/readme.txt
r869386 r873686 5 5 Requires at least: 3.2 6 6 Tested up to: 3.8.1 7 Stable tag: 2. 6.37 Stable tag: 2.7 8 8 9 9 Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template. … … 118 118 119 119 == Changelog == 120 121 = 2.7 = 122 * Video Thumbnails is now translation ready and looking for volunteers 120 123 121 124 = 2.6.3 = -
video-thumbnails/trunk/video-thumbnails.php
r870830 r873686 6 6 Author: Sutherland Boswell 7 7 Author URI: http://sutherlandboswell.com 8 Version: 2. 6.38 Version: 2.7 9 9 License: GPL2 10 10 Text Domain: video-thumbnails … … 31 31 define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) ); 32 32 define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' ); 33 define( 'VIDEO_THUMBNAILS_VERSION', '2. 6.3' );33 define( 'VIDEO_THUMBNAILS_VERSION', '2.7' ); 34 34 35 35 // Providers … … 50 50 51 51 function __construct() { 52 53 // Load translations 54 add_action( 'plugins_loaded', array( &$this, 'plugin_textdomain' )); 52 55 53 56 // Create provider array … … 85 88 add_action('wp_ajax_video_thumbnails_get_thumbnail_for_post', array( &$this, 'get_thumbnail_for_post_callback' ) ); 86 89 90 } 91 92 /** 93 * Load language files 94 */ 95 function plugin_textdomain() { 96 load_plugin_textdomain( 'video-thumbnails', false, VIDEO_THUMBNAILS_PATH . '/languages/' ); 87 97 } 88 98
Note: See TracChangeset
for help on using the changeset viewer.