Plugin Directory

Changeset 837855


Ignore:
Timestamp:
01/13/2014 07:11:42 PM (12 years ago)
Author:
sutherlandboswell
Message:

Added Vine and Google Drive. Improved bulk scan tool.

Location:
video-thumbnails
Files:
10 added
27 edited
12 copied

Legend:

Unmodified
Added
Removed
  • video-thumbnails/tags/2.4/php/class-video-thumbnails-settings.php

    r794208 r837855  
    3838        // Initialize options
    3939        add_action( 'admin_init', array( &$this, 'initialize_options' ) );
    40         // Ajax past search callback
    41         add_action( 'wp_ajax_past_video_thumbnail', array( &$this, 'ajax_past_callback' ) );
    42         // Ajax past search callback
     40        // Ajax clear all callback
    4341        add_action( 'wp_ajax_clear_all_video_thumbnails', array( &$this, 'ajax_clear_all_callback' ) );
    4442        // Ajax test callbacks
     
    5048            // Admin scripts
    5149            add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );
    52         }
    53         // Ajax past posts script
    54         if ( isset ( $_GET['page'] ) && ( $_GET['page'] == 'video_thumbnails' ) && isset ( $_GET['tab'] ) && ( $_GET['tab'] == 'mass_actions' ) ) {
    55             add_action( 'admin_head', array( &$this, 'ajax_past_script' ) );
    5650        }
    5751    }
     
    140134        wp_enqueue_script( 'video_thumbnails_test', plugins_url( 'js/test.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) );
    141135        wp_enqueue_script( 'video_thumbnails_clear', plugins_url( 'js/clear.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) );
    142     }
    143 
    144     function ajax_past_script() {
    145 
    146 ?><!-- Video Thumbnails Past Post Ajax -->
    147 <script type="text/javascript">
    148 function video_thumbnails_past(id) {
    149 
    150     var data = {
    151         action: 'past_video_thumbnail',
    152         post_id: id
    153     };
    154 
    155     // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
    156     jQuery.post(ajaxurl, data, function(response){
    157 
    158         document.getElementById(id+'_result').innerHTML = response;
    159 
    160     });
    161 
    162 };
    163 <?php
    164 $id_array = get_posts( array(
    165     'showposts' => -1,
    166     'post_type' => $this->options['post_types'],
    167     'fields' => 'ids'
    168 ) );
    169 $ids = implode( ', ', $id_array );
    170 ?>
    171 
    172 var scanComplete = false;
    173 
    174 function scan_video_thumbnails(){
    175 
    176     if(scanComplete==false){
    177         scanComplete = true;
    178         var ids = new Array(<?php echo $ids; ?>);
    179         for (var i = 0; i < ids.length; i++){
    180             var container = document.getElementById('video-thumbnails-past');
    181             var new_element = document.createElement('li');
    182             new_element.setAttribute('id',ids[i]+'_result');
    183             new_element.innerHTML = 'Waiting...';
    184             container.insertBefore(new_element, container.firstChild);
    185         }
    186         for (var i = 0; i < ids.length; i++){
    187             document.getElementById(ids[i]+'_result').innerHTML = '<span style="color:yellow">&#8226;</span> Working...';
    188             video_thumbnails_past(ids[i]);
    189         }
    190     } else {
    191         alert('Scan has already been run, please reload the page before trying again.')
    192     }
    193 
    194 }
    195 </script><?php
    196 
    197     }
    198 
    199     function ajax_past_callback() {
    200         global $wpdb; // this is how you get access to the database
    201 
    202         $post_id = $_POST['post_id'];
    203 
    204         echo get_the_title( $post_id ) . ' - ';
    205 
    206         $video_thumbnail = get_video_thumbnail( $post_id );
    207 
    208         if ( is_wp_error( $video_thumbnail ) ) {
    209             echo $video_thumbnail->get_error_message();
    210         } else if ( $video_thumbnail != null ) {
    211             echo '<span style="color:green">&#10004;</span> Success!';
    212         } else {
    213             echo '<span style="color:red">&#10006;</span> Couldn\'t find a video thumbnail for this post.';
    214         }
    215 
    216         die();
    217136    }
    218137
     
    240159
    241160        die();
     161    }
     162
     163    function get_file_hash( $url ) {
     164        $response = wp_remote_get( $url, array( 'sslverify' => false ) );
     165        if( is_wp_error( $response ) ) {
     166            $result = false;
     167        } else {
     168            $result = md5( $response['body'] );
     169        }
     170        return $result;
    242171    }
    243172
     
    274203                        $result = explode( '?', $result );
    275204                        $result = $result[0];
    276                         if ( $result == $test_case['expected'] ) {
     205                        $result_hash = $this->get_file_hash( $result );
     206                        $matched = ( $result_hash == $test_case['expected_hash'] ? true : false );
     207                        if ( $matched ) {
    277208                            echo '<td style="color:green;">&#10004; Passed</td>';
    278209                            $passed++;
     
    281212                            $failed++;
    282213                        }
    283                         echo '<td>' . $result . '</td>';
     214                        echo '<td>';
     215                        if ( $result ) {
     216                            echo '<a href="' . $result . '">View Image</a>';
     217                        }
     218                        if ( $result_hash ) {
     219                            echo ' <code>' . $result_hash . '</code>';
     220                        }
     221                        echo '</td>';
    284222                    }
    285223                    echo '</tr>';
     
    367305    }
    368306
    369     function sanitize_callback( $input ) {   
     307    function sanitize_callback( $input ) {
    370308        $current_settings = get_option( 'video_thumbnails' );
    371309        $output = array();
     
    520458            <p>Scan all of your past posts for video thumbnails. Be sure to save any settings before running the scan.</p>
    521459
    522             <p><input type="submit" class="button-primary" onclick="scan_video_thumbnails();" value="Scan Past Posts" /></p>
    523 
    524             <ol id="video-thumbnails-past">
    525             </ol>
     460            <p><a class="button-primary" href="<?php echo admin_url( 'tools.php?page=video-thumbnails-bulk' ); ?>">Scan Past Posts</a></p>
    526461
    527462            <h3>Clear all Video Thumbnails</h3>
  • video-thumbnails/tags/2.4/php/providers/class-blip-thumbnails.php

    r746462 r837855  
    5959    public $test_cases = array(
    6060        array(
    61             'markup' => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917',
    62             'expected' => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg',
    63             'name' => 'Video URL'
     61            'markup'        => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917',
     62            'expected'      => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg',
     63            'expected_hash' => '26a622f72bd4bdb3f8189f85598dd95d',
     64            'name'          => 'Video URL'
    6465        ),
    6566        array(
    66             'markup' => '<iframe src="http://blip.tv/play/AYL1uFkC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYL1uFkC" style="display:none"></embed>',
    67             'expected' => 'http://a.images.blip.tv/ReelScience-TheScientificMethodOfOz139.jpg',
    68             'name' => 'iFrame player'
     67            'markup'        => '<iframe src="http://blip.tv/play/AYL1uFkC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYL1uFkC" style="display:none"></embed>',
     68            'expected'      => 'http://a.images.blip.tv/ReelScience-TheScientificMethodOfOz139.jpg',
     69            'expected_hash' => 'bd2f58c2bc874e3a017167e74e5c842f',
     70            'name'          => 'iFrame player'
    6971        ),
    7072        array(
    71             'markup' => '<iframe src="http://blip.tv/play/AYLz%2BEsC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYLz+EsC" style="display:none"></embed>',
    72             'expected' => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png',
    73             'name' => 'iFrame player (special characters in ID)'
     73            'markup'        => '<iframe src="http://blip.tv/play/AYLz%2BEsC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYLz+EsC" style="display:none"></embed>',
     74            'expected'      => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png',
     75            'expected_hash' => '87efa9f6b0d9111b0826ae4fbdddec1b',
     76            'name'          => 'iFrame player (special characters in ID)'
    7477        ),
    7578    );
  • video-thumbnails/tags/2.4/php/providers/class-collegehumor-thumbnails.php

    r710079 r837855  
    5555    public $test_cases = array(
    5656        array(
    57             'markup' => '<iframe src="http://www.collegehumor.com/e/6830834" width="600" height="338" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe><div style="padding:5px 0; text-align:center; width:600px;"><p><a href="http://www.collegehumor.com/videos/most-viewed/this-year">CollegeHumor\'s Favorite Funny Videos</a></p></div>',
    58             'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg',
    59             'name' => 'Embed'
     57            'markup'        => '<iframe src="http://www.collegehumor.com/e/6830834" width="600" height="338" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe><div style="padding:5px 0; text-align:center; width:600px;"><p><a href="http://www.collegehumor.com/videos/most-viewed/this-year">CollegeHumor\'s Favorite Funny Videos</a></p></div>',
     58            'expected'      => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg',
     59            'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15',
     60            'name'          => 'Embed'
    6061        ),
    6162        array(
    62             'markup' => 'http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody',
    63             'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg',
    64             'name' => 'URL'
     63            'markup'        => 'http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody',
     64            'expected'      => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg',
     65            'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15',
     66            'name'          => 'URL'
    6567        ),
    6668    );
  • video-thumbnails/tags/2.4/php/providers/class-dailymotion-thumbnails.php

    r710079 r837855  
    5757    public $test_cases = array(
    5858        array(
    59             'markup' => '<iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/xqlhts"></iframe><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>',
    60             'expected' => 'http://s1.dmcdn.net/AMjdy.jpg',
    61             'name' => 'iFrame player'
     59            'markup'        => '<iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/xqlhts"></iframe><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>',
     60            'expected'      => 'http://s1.dmcdn.net/AMjdy.jpg',
     61            'expected_hash' => '077888b97839254892a377f51c06e642',
     62            'name'          => 'iFrame player'
    6263        ),
    6364        array(
    64             'markup' => '<object width="480" height="270"><param name="movie" value="http://www.dailymotion.com/swf/video/xqlhts"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/xqlhts" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always"></embed></object><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>',
    65             'expected' => 'http://s1.dmcdn.net/AMjdy.jpg',
    66             'name' => 'Flash player'
     65            'markup'        => '<object width="480" height="270"><param name="movie" value="http://www.dailymotion.com/swf/video/xqlhts"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/xqlhts" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always"></embed></object><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>',
     66            'expected'      => 'http://s1.dmcdn.net/AMjdy.jpg',
     67            'expected_hash' => '077888b97839254892a377f51c06e642',
     68            'name'          => 'Flash player'
    6769        ),
    6870    );
  • video-thumbnails/tags/2.4/php/providers/class-facebook-thumbnails.php

    r710772 r837855  
    4848    public $test_cases = array(
    4949        array(
    50             'markup' => '<object width=420 height=180><param name=allowfullscreen value=true></param><param name=allowscriptaccess value=always></param><param name=movie value="http://www.facebook.com/v/2560032632599"></param><embed src="http://www.facebook.com/v/2560032632599" type="application/x-shockwave-flash" allowscriptaccess=always allowfullscreen=true width=420 height=180></embed></object>',
    51             'expected' => 'https://graph.facebook.com/2560032632599/picture',
    52             'name' => 'Flash Embed'
     50            'markup'        => '<object width=420 height=180><param name=allowfullscreen value=true></param><param name=allowscriptaccess value=always></param><param name=movie value="http://www.facebook.com/v/2560032632599"></param><embed src="http://www.facebook.com/v/2560032632599" type="application/x-shockwave-flash" allowscriptaccess=always allowfullscreen=true width=420 height=180></embed></object>',
     51            'expected'      => 'https://graph.facebook.com/2560032632599/picture',
     52            'expected_hash' => '619591ec126ad889799ad992a227c75e',
     53            'name'          => 'Flash Embed'
    5354        ),
    5455        array(
    55             'markup' => '<iframe src="https://www.facebook.com/video/embed?video_id=2560032632599" width="960" height="720" frameborder="0"></iframe>',
    56             'expected' => 'https://graph.facebook.com/2560032632599/picture',
    57             'name' => 'iFrame Embed'
     56            'markup'        => '<iframe src="https://www.facebook.com/video/embed?video_id=2560032632599" width="960" height="720" frameborder="0"></iframe>',
     57            'expected'      => 'https://graph.facebook.com/2560032632599/picture',
     58            'expected_hash' => '619591ec126ad889799ad992a227c75e',
     59            'name'          => 'iFrame Embed'
    5860        ),
    5961    );
  • video-thumbnails/tags/2.4/php/providers/class-funnyordie-thumbnails.php

    r835793 r837855  
    5656    public $test_cases = array(
    5757        array(
    58             'markup' => '<iframe src="http://www.funnyordie.com/embed/5325b03b52" width="640" height="400" frameborder="0"></iframe>',
    59             'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg',
    60             'name' => 'iFrame player'
     58            'markup'        => '<iframe src="http://www.funnyordie.com/embed/5325b03b52" width="640" height="400" frameborder="0"></iframe>',
     59            'expected'      => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg',
     60            'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b',
     61            'name'          => 'iFrame player'
    6162        ),
    6263        array(
    63             'markup' => '<object width="640" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="ordie_player_5325b03b52"><param name="movie" value="http://player.ordienetworks.com/flash/fodplayer.swf" /><param name="flashvars" value="key=5325b03b52" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always"><embed width="640" height="400" flashvars="key=5325b03b52" allowfullscreen="true" allowscriptaccess="always" quality="high" src="http://player.ordienetworks.com/flash/fodplayer.swf" name="ordie_player_5325b03b52" type="application/x-shockwave-flash"></embed></object>',
    64             'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg',
    65             'name' => 'Flash player'
     64            'markup'        => '<object width="640" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="ordie_player_5325b03b52"><param name="movie" value="http://player.ordienetworks.com/flash/fodplayer.swf" /><param name="flashvars" value="key=5325b03b52" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always"><embed width="640" height="400" flashvars="key=5325b03b52" allowfullscreen="true" allowscriptaccess="always" quality="high" src="http://player.ordienetworks.com/flash/fodplayer.swf" name="ordie_player_5325b03b52" type="application/x-shockwave-flash"></embed></object>',
     65            'expected'      => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg',
     66            'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b',
     67            'name'          => 'Flash player'
    6668        ),
    6769    );
  • video-thumbnails/tags/2.4/php/providers/class-justintv-thumbnails.php

    r710079 r837855  
    5555    public $test_cases = array(
    5656        array(
    57             'markup' => '<object type="application/x-shockwave-flash" height="300" width="400" id="clip_embed_player_flash" data="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" bgcolor="#000000"><param name="movie" value="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="auto_play=false&start_volume=25&title=Title&channel=scamschoolbrian&archive_id=392481524" /></object>',
    58             'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-392481524-320x240.jpg',
    59             'name' => 'Embed'
     57            'markup'        => '<object type="application/x-shockwave-flash" height="300" width="400" id="clip_embed_player_flash" data="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" bgcolor="#000000"><param name="movie" value="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="auto_play=false&start_volume=25&title=Title&channel=scamschoolbrian&archive_id=392481524" /></object>',
     58            'expected'      => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-392481524-320x240.jpg',
     59            'expected_hash' => '7f260a2ce6ae75a3c2e5012108f161b7',
     60            'name'          => 'Embed'
    6061        ),
    6162    );
  • video-thumbnails/tags/2.4/php/providers/class-kaltura-thumbnails.php

    r710079 r837855  
    6363    public $test_cases = array(
    6464        array(
    65             'markup' => '<script type="text/javascript" src="http://cdnapi.kaltura.com/p/1374841/sp/137484100/embedIframeJs/uiconf_id/12680902/partner_id/1374841?entry_id=1_y7xzqsxw&playerId=kaltura_player_1363589321&cache_st=1363589321&autoembed=true&width=400&height=333&"></script>',
     65            'markup'   => '<script type="text/javascript" src="http://cdnapi.kaltura.com/p/1374841/sp/137484100/embedIframeJs/uiconf_id/12680902/partner_id/1374841?entry_id=1_y7xzqsxw&playerId=kaltura_player_1363589321&cache_st=1363589321&autoembed=true&width=400&height=333&"></script>',
    6666            'expected' => 'http://example.com/thumbnail.jpg',
    67             'name' => 'Auto embed'
     67            'name'     => 'Auto embed'
    6868        ),
    6969    );
  • video-thumbnails/tags/2.4/php/providers/class-metacafe-thumbnails.php

    r710079 r837855  
    5656    public $test_cases = array(
    5757        array(
    58             'markup' => '<embed flashVars="playerVars=autoPlay=no" src="http://www.metacafe.com/fplayer/8456223/men_in_black_3_trailer_2.swf" width="440" height="248" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_8456223" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>',
    59             'expected' => 'http://s4.mcstatic.com/thumb/8456223/22479418/4/catalog_item5/0/1/men_in_black_3_trailer_2.jpg',
    60             'name' => 'Embed'
     58            'markup'        => '<embed flashVars="playerVars=autoPlay=no" src="http://www.metacafe.com/fplayer/8456223/men_in_black_3_trailer_2.swf" width="440" height="248" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_8456223" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>',
     59            'expected'      => 'http://s4.mcstatic.com/thumb/8456223/22479418/4/catalog_item5/0/1/men_in_black_3_trailer_2.jpg',
     60            'expected_hash' => 'df46215fef1d9fb68eea64ba3ed9a4fd',
     61            'name'          => 'Embed'
    6162        ),
    6263    );
  • video-thumbnails/tags/2.4/php/providers/class-mpora-thumbnails.php

    r710079 r837855  
    4848    public $test_cases = array(
    4949        array(
    50             'markup' => '<object width="480" height="270" id="mporaplayer_wEr2CBooV_N" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" ><param name="movie" value="http://video.mpora.com/ep/wEr2CBooV/"></param><param name="wmode" value="transparent"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="http://video.mpora.com/ep/wEr2CBooV/" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>',
    51             'expected' => 'http://ugc4.mporatrons.com/thumbs/wEr2CBooV_640x360_0000.jpg',
    52             'name' => 'Flash player'
     50            'markup'        => '<object width="480" height="270" id="mporaplayer_wEr2CBooV_N" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" ><param name="movie" value="http://video.mpora.com/ep/wEr2CBooV/"></param><param name="wmode" value="transparent"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="http://video.mpora.com/ep/wEr2CBooV/" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>',
     51            'expected'      => 'http://ugc4.mporatrons.com/thumbs/wEr2CBooV_640x360_0000.jpg',
     52            'expected_hash' => '95075bd4941251ebecbab3b436a90c49',
     53            'name'          => 'Flash player'
    5354        ),
    5455        array(
    55             'markup' => '<iframe width="640" height="360" src="http://mpora.com/videos/AAdfegovdop0/embed" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
    56             'expected' => 'http://ugc4.mporatrons.com/thumbs/AAdfegovdop0_640x360_0000.jpg',
    57             'name' => 'iFrame player'
     56            'markup'        => '<iframe width="640" height="360" src="http://mpora.com/videos/AAdfegovdop0/embed" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
     57            'expected'      => 'http://ugc4.mporatrons.com/thumbs/AAdfegovdop0_640x360_0000.jpg',
     58            'expected_hash' => '45db22a2ba5ef20163f52ba562b89259',
     59            'name'          => 'iFrame player'
    5860        ),
    5961    );
  • video-thumbnails/tags/2.4/php/providers/class-rutube-thumbnails.php

    r834141 r837855  
    5656    public $test_cases = array(
    5757        array(
    58             'markup' => 'http://rutube.ru/video/ca8607cd4f7ef28516e043dde0068564/',
    59             'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg',
    60             'name' => 'Video link'
     58            'markup'        => 'http://rutube.ru/video/ca8607cd4f7ef28516e043dde0068564/',
     59            'expected'      => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg',
     60            'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354',
     61            'name'          => 'Video link'
    6162        ),
    6263        array(
    63             'markup' => '<iframe width="720" height="405" src="//rutube.ru/video/embed/6608735" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>',
    64             'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg',
    65             'name' => 'iFrame embed'
     64            'markup'        => '<iframe width="720" height="405" src="//rutube.ru/video/embed/6608735" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>',
     65            'expected'      => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg',
     66            'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354',
     67            'name'          => 'iFrame embed'
    6668        ),
    6769    );
  • video-thumbnails/tags/2.4/php/providers/class-twitch-thumbnails.php

    r835793 r837855  
    5656    public $test_cases = array(
    5757        array(
    58             'markup' => 'http://www.twitch.tv/vanillatv/c/1537974',
    59             'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg',
    60             'name' => 'Video link'
     58            'markup'        => 'http://www.twitch.tv/vanillatv/c/1537974',
     59            'expected'      => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg',
     60            'expected_hash' => 'f3921b65f799aa648ef6dae29871c137',
     61            'name'          => 'Video link'
    6162        ),
    6263        array(
    63             'markup' => '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/archive_embed_player.swf" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"><param name="movie" value="http://www.twitch.tv/widgets/archive_embed_player.swf"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="allowFullScreen" value="true"><param name="flashvars" value="title=VanillaTV%2B-%2BSweden%2Bvs%2BRussia%2B-%2BETF2L%2BNations%2BCup%2B-%2BSnakewater%2B%255BMap3%255D%2B-%2BPart%2B3&amp;channel=vanillatv&amp;auto_play=false&amp;start_volume=25&amp;chapter_id=1537974"></object>',
    64             'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg',
    65             'name' => 'Flash embed'
     64            'markup'        => '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/archive_embed_player.swf" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"><param name="movie" value="http://www.twitch.tv/widgets/archive_embed_player.swf"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="allowFullScreen" value="true"><param name="flashvars" value="title=VanillaTV%2B-%2BSweden%2Bvs%2BRussia%2B-%2BETF2L%2BNations%2BCup%2B-%2BSnakewater%2B%255BMap3%255D%2B-%2BPart%2B3&amp;channel=vanillatv&amp;auto_play=false&amp;start_volume=25&amp;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'
    6668        ),
    6769    );
  • video-thumbnails/tags/2.4/php/providers/class-video-thumbnails-providers.php

    r835793 r837855  
    11<?php
    22
    3 /*  Copyright 2013 Sutherland Boswell  (email : [email protected])
     3/*  Copyright 2014 Sutherland Boswell  (email : [email protected])
    44
    55    This program is free software; you can redistribute it and/or modify
     
    9393require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-vimeo-thumbnails.php' );
    9494require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-facebook-thumbnails.php' );
     95require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-vine-thumbnails.php' );
    9596require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-blip-thumbnails.php' );
    9697require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-justintv-thumbnails.php' );
     
    105106require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-rutube-thumbnails.php' );
    106107require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-twitch-thumbnails.php' );
     108require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-googledrive-thumbnails.php' );
    107109
    108110?>
  • video-thumbnails/tags/2.4/php/providers/class-vimeo-thumbnails.php

    r791525 r837855  
    6262    // Regex strings
    6363    public $regexes = array(
    64         '#<object[^>]+>.+?http://vimeo\.com/moogaloop.swf\?clip_id=([A-Za-z0-9\-_]+)&.+?</object>#s', // Standard Vimeo embed code
    65         '#(?:https?:)?//player\.vimeo\.com/video/([0-9]+)#', // Vimeo iframe player
    66         '#\[vimeo id=([A-Za-z0-9\-_]+)]#', // JR_embed shortcode
    67         '#\[vimeo clip_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Another shortcode
    68         '#\[vimeo video_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Yet another shortcode
    69         '#(?:https?://)?(?:www\.)?vimeo\.com/([0-9]+)#', // Vimeo URL
    70         '#(?:https?://)?(?:www\.)?vimeo\.com/channels/(?:[A-Za-z0-9]+)/([0-9]+)#' // Channel URL
     64        '#<object[^>]+>.+?http://vimeo\.com/moogaloop.swf\?clip_id=([A-Za-z0-9\-_]+)&.+?</object>#s', // Standard Vimeo embed code
     65        '#(?:https?:)?//player\.vimeo\.com/video/([0-9]+)#', // Vimeo iframe player
     66        '#\[vimeo id=([A-Za-z0-9\-_]+)]#', // JR_embed shortcode
     67        '#\[vimeo clip_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Another shortcode
     68        '#\[vimeo video_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Yet another shortcode
     69        '#(?:https?://)?(?:www\.)?vimeo\.com/([0-9]+)#', // Vimeo URL
     70        '#(?:https?://)?(?:www\.)?vimeo\.com/channels/(?:[A-Za-z0-9]+)/([0-9]+)#' // Channel URL
    7171    );
    7272
    7373    // Thumbnail URL
    7474    public function get_thumbnail_url( $id ) {
    75         // Get our settings
    76         $client_id = ( isset( $this->options['client_id'] ) && $this->options['client_id'] != '' ? $this->options['client_id'] : false );
    77         $client_secret = ( isset( $this->options['client_secret'] ) && $this->options['client_secret'] != '' ? $this->options['client_secret'] : false );
    78         $access_token = ( isset( $this->options['access_token'] ) && $this->options['access_token'] != '' ? $this->options['access_token'] : false );
    79         $access_token_secret = ( isset( $this->options['access_token_secret'] ) && $this->options['access_token_secret'] != '' ? $this->options['access_token_secret'] : false );
     75        // Get our settings
     76        $client_id = ( isset( $this->options['client_id'] ) && $this->options['client_id'] != '' ? $this->options['client_id'] : false );
     77        $client_secret = ( isset( $this->options['client_secret'] ) && $this->options['client_secret'] != '' ? $this->options['client_secret'] : false );
     78        $access_token = ( isset( $this->options['access_token'] ) && $this->options['access_token'] != '' ? $this->options['access_token'] : false );
     79        $access_token_secret = ( isset( $this->options['access_token_secret'] ) && $this->options['access_token_secret'] != '' ? $this->options['access_token_secret'] : false );
    8080        // If API credentials are entered, use the API
    8181        if ( $client_id && $client_secret && $access_token && $access_token_secret ) {
     
    102102    public $test_cases = array(
    103103        array(
    104             'markup' => '<iframe src="http://player.vimeo.com/video/41504360" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
    105             'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg',
    106             'name' => 'iFrame'
     104            'markup'        => '<iframe src="http://player.vimeo.com/video/41504360" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
     105            'expected'      => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg',
     106            'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623',
     107            'name'          => 'iFrame'
    107108        ),
    108109        array(
    109             'markup' => '<object width="500" height="281"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=41504360&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=41504360&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object>',
    110             'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg',
    111             'name' => 'Old embed'
     110            'markup'        => '<object width="500" height="281"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=41504360&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=41504360&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object>',
     111            'expected'      => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg',
     112            'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623',
     113            'name'          => 'Old embed'
    112114        ),
    113115        array(
    114             'markup' => 'https://vimeo.com/channels/soundworkscollection/44520894',
    115             'expected' => 'http://b.vimeocdn.com/ts/313/130/313130530_640.jpg',
    116             'name' => 'Channel URL'
     116            'markup'        => 'https://vimeo.com/channels/soundworkscollection/44520894',
     117            'expected'      => 'http://b.vimeocdn.com/ts/313/130/313130530_640.jpg',
     118            'expected_hash' => 'e9fd72872a39272f6c540ee66b1ecf28',
     119            'name'          => 'Channel URL'
    117120        ),
    118121    );
  • video-thumbnails/tags/2.4/php/providers/class-wistia-thumbnails.php

    r794208 r837855  
    7979    public $test_cases = array(
    8080        array(
    81             'markup' => '<iframe src="http://fast.wistia.net/embed/iframe/po4utu3zde?controlsVisibleOnLoad=true&version=v1&videoHeight=360&videoWidth=640&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="640" height="360"></iframe>',
    82             'expected' => 'http://embed-0.wistia.com/deliveries/6928fcba8355e38de4d95863a659e1de23cb2071.jpg',
    83             'name' => 'Inline player'
     81            'markup'        => '<iframe src="http://fast.wistia.net/embed/iframe/po4utu3zde?controlsVisibleOnLoad=true&version=v1&videoHeight=360&videoWidth=640&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="640" height="360"></iframe>',
     82            'expected'      => 'http://embed-0.wistia.com/deliveries/6928fcba8355e38de4d95863a659e1de23cb2071.jpg',
     83            'expected_hash' => 'bc4a2cec9ac97e2ccdae2c7387a01cb4',
     84            'name'          => 'Inline player'
    8485        ),
    8586        array(
    86             'markup' => '<div class=\'wistia_embed\' data-video-height=\'312\' data-video-width=\'499\' id=\'wistia_j1qd2lvys1\'></div> <script charset=\'ISO-8859-1\' src=\'http://fast.wistia.com/static/concat/E-v1.js\'></script> <script> var platform = ( Modernizr.touch ) ? "html5" : "flash"; wistiaEmbed = Wistia.embed("j1qd2lvys1", { version: "v1", videoWidth: 499, videoHeight: 312, playButton: Modernizr.touch, smallPlayButton: Modernizr.touch, playbar: Modernizr.touch, platformPreference: platform, chromeless: Modernizr.touch ? false : true, fullscreenButton: false, autoPlay: !Modernizr.touch, videoFoam: true }); </script>',
    87             'expected' => 'http://embed.wistia.com/deliveries/a086707fe096e7f3fbefef1d1dcba1488d23a3e9.jpg',
    88             'name' => 'JavaScript API embedding'
     87            'markup'        => '<div class=\'wistia_embed\' data-video-height=\'312\' data-video-width=\'499\' id=\'wistia_j1qd2lvys1\'></div> <script charset=\'ISO-8859-1\' src=\'http://fast.wistia.com/static/concat/E-v1.js\'></script> <script> var platform = ( Modernizr.touch ) ? "html5" : "flash"; wistiaEmbed = Wistia.embed("j1qd2lvys1", { version: "v1", videoWidth: 499, videoHeight: 312, playButton: Modernizr.touch, smallPlayButton: Modernizr.touch, playbar: Modernizr.touch, platformPreference: platform, chromeless: Modernizr.touch ? false : true, fullscreenButton: false, autoPlay: !Modernizr.touch, videoFoam: true }); </script>',
     88            'expected'      => 'https://embed-ssl.wistia.com/deliveries/a086707fe096e7f3fbefef1d1dcba1488d23a3e9.jpg',
     89            'expected_hash' => '4c63d131604bfc07b5178413ab245813',
     90            'name'          => 'JavaScript API embedding'
    8991        ),
    9092    );
  • video-thumbnails/tags/2.4/php/providers/class-youku-thumbnails.php

    r710079 r837855  
    5656    public $test_cases = array(
    5757        array(
    58             'markup' => '<embed src="http://player.youku.com/player.php/sid/XMzQyMzk5MzQ4/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" allowFullscreen="true" type="application/x-shockwave-flash"></embed>',
    59             'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493',
    60             'name' => 'Flash embed'
     58            'markup'        => '<embed src="http://player.youku.com/player.php/sid/XMzQyMzk5MzQ4/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" allowFullscreen="true" type="application/x-shockwave-flash"></embed>',
     59            'expected'      => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493',
     60            'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8',
     61            'name'          => 'Flash embed'
    6162        ),
    6263        array(
    63             'markup' => 'http://v.youku.com/v_show/id_XMzQyMzk5MzQ4.html',
    64             'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493',
    65             'name' => 'Link'
     64            'markup'        => 'http://v.youku.com/v_show/id_XMzQyMzk5MzQ4.html',
     65            'expected'      => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493',
     66            'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8',
     67            'name'          => 'Link'
    6668        ),
    6769    );
  • video-thumbnails/tags/2.4/php/providers/class-youtube-thumbnails.php

    r794208 r837855  
    5757    public $test_cases = array(
    5858        array(
    59             'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/Fp0U2Vglkjw" frameborder="0" allowfullscreen></iframe>',
    60             'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg',
    61             'name' => 'iFrame HD'
     59            'markup'        => '<iframe width="560" height="315" src="http://www.youtube.com/embed/Fp0U2Vglkjw" frameborder="0" allowfullscreen></iframe>',
     60            'expected'      => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg',
     61            'expected_hash' => 'c66256332969c38790c2b9f26f725e7a',
     62            'name'          => 'iFrame HD'
    6263        ),
    6364        array(
    64             'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&amp;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&amp;hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>',
    65             'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg',
    66             'name' => 'Old embed HD'
     65            'markup'        => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&amp;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&amp;hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>',
     66            'expected'      => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg',
     67            'expected_hash' => 'c66256332969c38790c2b9f26f725e7a',
     68            'name'          => 'Old embed HD'
    6769        ),
    6870        array(
    69             'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/vv_AitYPjtc" frameborder="0" allowfullscreen></iframe>',
    70             'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg',
    71             'name' => 'iFrame SD'
     71            'markup'        => '<iframe width="560" height="315" src="http://www.youtube.com/embed/vv_AitYPjtc" frameborder="0" allowfullscreen></iframe>',
     72            'expected'      => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg',
     73            'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9',
     74            'name'          => 'iFrame SD'
    7275        ),
    7376        array(
    74             'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/vv_AitYPjtc?version=3&amp;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&amp;hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>',
    75             'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg',
    76             'name' => 'Old embed SD'
     77            'markup'        => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/vv_AitYPjtc?version=3&amp;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&amp;hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>',
     78            'expected'      => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg',
     79            'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9',
     80            'name'          => 'Old embed SD'
    7781        ),
    7882    );
  • video-thumbnails/tags/2.4/readme.txt

    r835793 r837855  
    22Contributors: sutherlandboswell
    33Donate link: http://wie.ly/u/donate
    4 Tags: Video, Thumbnails, YouTube, Vimeo, Blip, Justin.tv, Dailymotion, Metacafe, Image, Featured Image, Post Thumbnail
     4Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image
    55Requires at least: 3.1
    66Tested up to: 3.8
    7 Stable tag: 2.3
     7Stable tag: 2.4
    88
    99Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
     
    1818* Vimeo
    1919* Facebook
    20 * Blip
     20* Vine
    2121* Justin.tv
     22* Twitch
    2223* Dailymotion
    2324* Metacafe
     25* Blip
     26* Google Drive
    2427* Funny or Die
     28* CollegeHumor
    2529* MPORA
    2630* Wistia
    2731* Youku
    28 * CollegeHumor
    2932* Rutube
    30 * Twitch
    3133
    3234Video Thumbnails even works with most video embedding plugins, including:
     
    5153== Frequently Asked Questions ==
    5254
     55= No video thumbnail for this post =
     56
     571. Ensure you have saved any changes to your post.
     581. If you are using a a plugin or theme that stores videos in a special location other than the main post content area, be sure you've entered the correct custom field on the settings page. If you don't know the name of the field your video is being saved in, please contact the developer of that theme or plugin.
     591. Copy and paste your embed code into the "Test Markup for Video" section of the Debugging page. If this doesn't find the thumbnail, you'll want to be sure to include the embed code you scanned when you request support. If it does find a thumbnail, please double check that you have the Custom Field set correctly in the settings page if you are using a a plugin or theme that stores videos in a special location.
     601. Go to the Debugging page and click "Test Image Downloading" to test your server's ability to save an image from a video source.
     611. Try posting a video from other sources to help narrow down the problem.
     621. Check the support threads to see if anyone has had the same issue.
     631. If you are still unable to resolve the problem, start a thread with a good descriptive title ("Error" or "No thumbnails" is a bad title) and be sure to include the results of your testing as well. Also be sure to include the name of your theme, any video plugins you're using, and any other details you can think of.
     64
    5365= My theme isn't showing thumbnails, what's wrong? =
    5466
     
    99111
    100112== Changelog ==
     113
     114= 2.4 =
     115* Added support for Vine
     116* Added support for Google Drive videos
     117* Rewritten bulk video thumbnail scanner
     118* Added troubleshooting link in meta box when no video thumbnail is found
     119* Changed provider test to compare file hashes in case thumbnail URLs change
    101120
    102121= 2.3 =
  • video-thumbnails/tags/2.4/video-thumbnails.php

    r835793 r837855  
    33Plugin Name: Video Thumbnails
    44Plugin URI: http://refactored.co/plugins/video-thumbnails
    5 Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Currently supports YouTube, Vimeo, Facebook, Blip.tv, Justin.tv, Dailymotion, Metacafe, Wistia, Youku, Funny or Die, and MPORA.
     5Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Supports YouTube, Vimeo, Facebook, Vine, Justin.tv, Twitch, Dailymotion, Metacafe, Blip, Google Drive, Funny or Die, CollegeHumor, MPORA, Wistia, Youku, and Rutube.
    66Author: Sutherland Boswell
    77Author URI: http://sutherlandboswell.com
    8 Version: 2.3
     8Version: 2.4
    99License: GPL2
    1010*/
    11 /*  Copyright 2013 Sutherland Boswell  (email : [email protected])
     11/*  Copyright 2014 Sutherland Boswell  (email : [email protected])
    1212
    1313    This program is free software; you can redistribute it and/or modify
     
    2929define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
    3030define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
    31 define( 'VIDEO_THUMBNAILS_VERSION', '2.3' );
     31define( 'VIDEO_THUMBNAILS_VERSION', '2.4' );
    3232
    3333// Providers
     
    7272        add_action( 'wp_ajax_reset_video_thumbnail', array( &$this, 'ajax_reset_callback' ) );
    7373
     74        // Add admin menus
     75        add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
     76
     77        // Add JavaScript and CSS to admin pages
     78        add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ), 20 );
     79
     80        // Get the posts to be scanned in bulk
     81        add_action('wp_ajax_video_thumbnails_bulk_posts_query', array( &$this, 'bulk_posts_query_callback' ) );
     82        // Get the thumbnail for an individual post
     83        add_action('wp_ajax_video_thumbnails_get_thumbnail_for_post', array( &$this, 'get_thumbnail_for_post_callback' ) );
     84
     85    }
     86
     87    /**
     88     * Adds the admin menu items
     89     */
     90    function admin_menu() {
     91        add_management_page( 'Bulk Video Thumbnails', 'Bulk Video Thumbs', 'manage_options', 'video-thumbnails-bulk', array( &$this, 'bulk_scanning_page' ) );
     92    }
     93
     94    function admin_scripts( $hook ) {
     95        // Bulk tool page
     96        if ( 'tools_page_video-thumbnails-bulk' == $hook ) {
     97            wp_enqueue_script( 'video-thumbnails-bulk-js', plugins_url( '/js/bulk.js' , __FILE__ ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION );
     98            wp_enqueue_style( 'video-thumbnails-bulk-css', plugins_url('/css/bulk.css', __FILE__), false, VIDEO_THUMBNAILS_VERSION );
     99        }
    74100    }
    75101
     
    85111    // Construct the meta box
    86112    function meta_box() {
     113
     114        // Add hidden troubleshooting info
     115        add_thickbox();
     116        ?>
     117        <div id="video-thumbnail-not-found-troubleshooting" style="display:none;">
     118            <h2><?php _e( 'Troubleshooting Video Thumbnails' ); ?></h2>
     119            <h3>No video thumbnail for this post</h3>
     120            <ol>
     121                <li>Ensure you have saved any changes to your post.</li>
     122                <li>If you are using a a plugin or theme that stores videos in a special location other than the main post content area, be sure you've entered the correct custom field on the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails' ); ?>">settings page</a>. If you don't know the name of the field your video is being saved in, please contact the developer of that theme or plugin.</li>
     123                <li>Copy and paste your embed code into the "Test Markup for Video" section of the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ); ?>">Debugging page</a>. If this doesn't find the thumbnail, you'll want to be sure to include the embed code you scanned when you request support. If it does find a thumbnail, please double check that you have the Custom Field set correctly in the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails' ); ?>">settings page</a> if you are using a a plugin or theme that stores videos in a special location.</li>
     124                <li>Go to the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ); ?>">Debugging page</a> and click "Test Image Downloading" to test your server's ability to save an image from a video source.</li>
     125                <li>Try posting a video from other sources to help narrow down the problem.</li>
     126                <li>Check the <a href="http://wordpress.org/support/plugin/video-thumbnails">support threads</a> to see if anyone has had the same issue.</li>
     127                <li>If you are still unable to resolve the problem, <a href="http://wordpress.org/support/plugin/video-thumbnails">start a thread</a> with a good descriptive title ("Error" or "No thumbnails" is a bad title) and be sure to include the results of your testing as well. Also be sure to include the name of your theme, any video plugins you're using, and any other details you can think of.</li>
     128            </ol>
     129        </div>
     130        <?php
     131
    87132        global $post;
    88133        $custom = get_post_custom( $post->ID );
     
    96141                echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Reset Video Thumbnail</a></p>';
    97142            } else {
    98                 echo '<p id="video-thumbnails-preview">We didn\'t find a video thumbnail for this post.</p>';
    99                 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Search Again</a></p>';
     143                echo '<p id="video-thumbnails-preview">No video thumbnail for this post.</p>';
     144                echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Search Again</a> <a href="#TB_inline?width=400&height=600&inlineId=video-thumbnail-not-found-troubleshooting" class="thickbox" style="float:right;">Troubleshoot<a/></p>';
    100145            }
    101146        } else {
     
    333378            echo '<img src="' . $video_thumbnail . '" style="max-width:100%;" />';
    334379        } else {
    335             echo 'We didn\'t find a video thumbnail for this post. (be sure you have saved changes first)';
     380            echo 'No video thumbnail for this post.';
    336381        }
    337382
    338383        die();
     384    }
     385
     386    function bulk_posts_query_callback() {
     387        $args = array(
     388            'showposts' => -1,
     389            'post_type' => $this->settings->options['post_types'],
     390            'fields'    => 'ids'
     391        );
     392        $query = new WP_Query( $args );
     393        echo json_encode( $query->posts );
     394        die();
     395    }
     396
     397    function get_thumbnail_for_post_callback() {
     398
     399        $post_id = $_POST['post_id'];
     400        $thumb = get_post_meta( $post_id, VIDEO_THUMBNAILS_FIELD, true );
     401
     402        if ( $thumb == '' ) {
     403            global $video_thumbnails;
     404            $thumb = $video_thumbnails->get_video_thumbnail( $post_id );
     405            if ( $thumb ) {
     406                $type = 'new';
     407            }
     408        } else {
     409            $type = 'existing';
     410        }
     411
     412        if ( $thumb != '' ) {
     413            $result = array(
     414                'type' => $type,
     415                'url' => $thumb
     416            );
     417        } else {
     418            $result = array();
     419        }
     420
     421        echo json_encode( $result );
     422        die();
     423    }
     424
     425    function bulk_scanning_page() {
     426
     427        if ( ! current_user_can( 'manage_options' ) ) {
     428            wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
     429        }
     430
     431        ?>
     432        <div class="wrap">
     433
     434            <div id="icon-tools" class="icon32"></div><h2>Bulk Video Thumbnail Generator</h2>
     435
     436            <p>Use this tool to scan all of your posts for Video Thumbnails.</p>
     437
     438            <p><a id="video-thumbnails-scan-all-posts" href="#" class="button button-primary">Scan All Posts</a></p>
     439
     440            <div id="vt-bulk-scan-results">
     441                <div class="progress-bar-container">
     442                    <span class="percentage">0%</span>
     443                    <div class="progress-bar">&nbsp;</div>
     444                </div>
     445                <div class="stats">
     446                    <div class="scanned"></div>
     447                    <div class="found"></div>
     448                </div>
     449                <ul class="log"></ul>
     450            </div>
     451
     452        </div>
     453        <?php
     454
    339455    }
    340456
  • video-thumbnails/trunk/php/class-video-thumbnails-settings.php

    r794208 r837855  
    3838        // Initialize options
    3939        add_action( 'admin_init', array( &$this, 'initialize_options' ) );
    40         // Ajax past search callback
    41         add_action( 'wp_ajax_past_video_thumbnail', array( &$this, 'ajax_past_callback' ) );
    42         // Ajax past search callback
     40        // Ajax clear all callback
    4341        add_action( 'wp_ajax_clear_all_video_thumbnails', array( &$this, 'ajax_clear_all_callback' ) );
    4442        // Ajax test callbacks
     
    5048            // Admin scripts
    5149            add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );
    52         }
    53         // Ajax past posts script
    54         if ( isset ( $_GET['page'] ) && ( $_GET['page'] == 'video_thumbnails' ) && isset ( $_GET['tab'] ) && ( $_GET['tab'] == 'mass_actions' ) ) {
    55             add_action( 'admin_head', array( &$this, 'ajax_past_script' ) );
    5650        }
    5751    }
     
    140134        wp_enqueue_script( 'video_thumbnails_test', plugins_url( 'js/test.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) );
    141135        wp_enqueue_script( 'video_thumbnails_clear', plugins_url( 'js/clear.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) );
    142     }
    143 
    144     function ajax_past_script() {
    145 
    146 ?><!-- Video Thumbnails Past Post Ajax -->
    147 <script type="text/javascript">
    148 function video_thumbnails_past(id) {
    149 
    150     var data = {
    151         action: 'past_video_thumbnail',
    152         post_id: id
    153     };
    154 
    155     // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
    156     jQuery.post(ajaxurl, data, function(response){
    157 
    158         document.getElementById(id+'_result').innerHTML = response;
    159 
    160     });
    161 
    162 };
    163 <?php
    164 $id_array = get_posts( array(
    165     'showposts' => -1,
    166     'post_type' => $this->options['post_types'],
    167     'fields' => 'ids'
    168 ) );
    169 $ids = implode( ', ', $id_array );
    170 ?>
    171 
    172 var scanComplete = false;
    173 
    174 function scan_video_thumbnails(){
    175 
    176     if(scanComplete==false){
    177         scanComplete = true;
    178         var ids = new Array(<?php echo $ids; ?>);
    179         for (var i = 0; i < ids.length; i++){
    180             var container = document.getElementById('video-thumbnails-past');
    181             var new_element = document.createElement('li');
    182             new_element.setAttribute('id',ids[i]+'_result');
    183             new_element.innerHTML = 'Waiting...';
    184             container.insertBefore(new_element, container.firstChild);
    185         }
    186         for (var i = 0; i < ids.length; i++){
    187             document.getElementById(ids[i]+'_result').innerHTML = '<span style="color:yellow">&#8226;</span> Working...';
    188             video_thumbnails_past(ids[i]);
    189         }
    190     } else {
    191         alert('Scan has already been run, please reload the page before trying again.')
    192     }
    193 
    194 }
    195 </script><?php
    196 
    197     }
    198 
    199     function ajax_past_callback() {
    200         global $wpdb; // this is how you get access to the database
    201 
    202         $post_id = $_POST['post_id'];
    203 
    204         echo get_the_title( $post_id ) . ' - ';
    205 
    206         $video_thumbnail = get_video_thumbnail( $post_id );
    207 
    208         if ( is_wp_error( $video_thumbnail ) ) {
    209             echo $video_thumbnail->get_error_message();
    210         } else if ( $video_thumbnail != null ) {
    211             echo '<span style="color:green">&#10004;</span> Success!';
    212         } else {
    213             echo '<span style="color:red">&#10006;</span> Couldn\'t find a video thumbnail for this post.';
    214         }
    215 
    216         die();
    217136    }
    218137
     
    240159
    241160        die();
     161    }
     162
     163    function get_file_hash( $url ) {
     164        $response = wp_remote_get( $url, array( 'sslverify' => false ) );
     165        if( is_wp_error( $response ) ) {
     166            $result = false;
     167        } else {
     168            $result = md5( $response['body'] );
     169        }
     170        return $result;
    242171    }
    243172
     
    274203                        $result = explode( '?', $result );
    275204                        $result = $result[0];
    276                         if ( $result == $test_case['expected'] ) {
     205                        $result_hash = $this->get_file_hash( $result );
     206                        $matched = ( $result_hash == $test_case['expected_hash'] ? true : false );
     207                        if ( $matched ) {
    277208                            echo '<td style="color:green;">&#10004; Passed</td>';
    278209                            $passed++;
     
    281212                            $failed++;
    282213                        }
    283                         echo '<td>' . $result . '</td>';
     214                        echo '<td>';
     215                        if ( $result ) {
     216                            echo '<a href="' . $result . '">View Image</a>';
     217                        }
     218                        if ( $result_hash ) {
     219                            echo ' <code>' . $result_hash . '</code>';
     220                        }
     221                        echo '</td>';
    284222                    }
    285223                    echo '</tr>';
     
    367305    }
    368306
    369     function sanitize_callback( $input ) {   
     307    function sanitize_callback( $input ) {
    370308        $current_settings = get_option( 'video_thumbnails' );
    371309        $output = array();
     
    520458            <p>Scan all of your past posts for video thumbnails. Be sure to save any settings before running the scan.</p>
    521459
    522             <p><input type="submit" class="button-primary" onclick="scan_video_thumbnails();" value="Scan Past Posts" /></p>
    523 
    524             <ol id="video-thumbnails-past">
    525             </ol>
     460            <p><a class="button-primary" href="<?php echo admin_url( 'tools.php?page=video-thumbnails-bulk' ); ?>">Scan Past Posts</a></p>
    526461
    527462            <h3>Clear all Video Thumbnails</h3>
  • video-thumbnails/trunk/php/providers/class-blip-thumbnails.php

    r746462 r837855  
    5959    public $test_cases = array(
    6060        array(
    61             'markup' => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917',
    62             'expected' => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg',
    63             'name' => 'Video URL'
     61            'markup'        => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917',
     62            'expected'      => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg',
     63            'expected_hash' => '26a622f72bd4bdb3f8189f85598dd95d',
     64            'name'          => 'Video URL'
    6465        ),
    6566        array(
    66             'markup' => '<iframe src="http://blip.tv/play/AYL1uFkC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYL1uFkC" style="display:none"></embed>',
    67             'expected' => 'http://a.images.blip.tv/ReelScience-TheScientificMethodOfOz139.jpg',
    68             'name' => 'iFrame player'
     67            'markup'        => '<iframe src="http://blip.tv/play/AYL1uFkC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYL1uFkC" style="display:none"></embed>',
     68            'expected'      => 'http://a.images.blip.tv/ReelScience-TheScientificMethodOfOz139.jpg',
     69            'expected_hash' => 'bd2f58c2bc874e3a017167e74e5c842f',
     70            'name'          => 'iFrame player'
    6971        ),
    7072        array(
    71             'markup' => '<iframe src="http://blip.tv/play/AYLz%2BEsC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYLz+EsC" style="display:none"></embed>',
    72             'expected' => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png',
    73             'name' => 'iFrame player (special characters in ID)'
     73            'markup'        => '<iframe src="http://blip.tv/play/AYLz%2BEsC.html?p=1" width="780" height="438" frameborder="0" allowfullscreen></iframe><embed type="application/x-shockwave-flash" src="http://a.blip.tv/api.swf#AYLz+EsC" style="display:none"></embed>',
     74            'expected'      => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png',
     75            'expected_hash' => '87efa9f6b0d9111b0826ae4fbdddec1b',
     76            'name'          => 'iFrame player (special characters in ID)'
    7477        ),
    7578    );
  • video-thumbnails/trunk/php/providers/class-collegehumor-thumbnails.php

    r710079 r837855  
    5555    public $test_cases = array(
    5656        array(
    57             'markup' => '<iframe src="http://www.collegehumor.com/e/6830834" width="600" height="338" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe><div style="padding:5px 0; text-align:center; width:600px;"><p><a href="http://www.collegehumor.com/videos/most-viewed/this-year">CollegeHumor\'s Favorite Funny Videos</a></p></div>',
    58             'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg',
    59             'name' => 'Embed'
     57            'markup'        => '<iframe src="http://www.collegehumor.com/e/6830834" width="600" height="338" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe><div style="padding:5px 0; text-align:center; width:600px;"><p><a href="http://www.collegehumor.com/videos/most-viewed/this-year">CollegeHumor\'s Favorite Funny Videos</a></p></div>',
     58            'expected'      => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg',
     59            'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15',
     60            'name'          => 'Embed'
    6061        ),
    6162        array(
    62             'markup' => 'http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody',
    63             'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg',
    64             'name' => 'URL'
     63            'markup'        => 'http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody',
     64            'expected'      => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg',
     65            'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15',
     66            'name'          => 'URL'
    6567        ),
    6668    );
  • video-thumbnails/trunk/php/providers/class-dailymotion-thumbnails.php

    r710079 r837855  
    5757    public $test_cases = array(
    5858        array(
    59             'markup' => '<iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/xqlhts"></iframe><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>',
    60             'expected' => 'http://s1.dmcdn.net/AMjdy.jpg',
    61             'name' => 'iFrame player'
     59            'markup'        => '<iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/xqlhts"></iframe><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>',
     60            'expected'      => 'http://s1.dmcdn.net/AMjdy.jpg',
     61            'expected_hash' => '077888b97839254892a377f51c06e642',
     62            'name'          => 'iFrame player'
    6263        ),
    6364        array(
    64             'markup' => '<object width="480" height="270"><param name="movie" value="http://www.dailymotion.com/swf/video/xqlhts"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/xqlhts" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always"></embed></object><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>',
    65             'expected' => 'http://s1.dmcdn.net/AMjdy.jpg',
    66             'name' => 'Flash player'
     65            'markup'        => '<object width="480" height="270"><param name="movie" value="http://www.dailymotion.com/swf/video/xqlhts"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/xqlhts" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always"></embed></object><br /><a href="http://www.dailymotion.com/video/xqlhts_adam-yauch-of-the-beastie-boys-dies-at-47_people" target="_blank">Adam Yauch of the Beastie Boys Dies at 47</a> <i>by <a href="http://www.dailymotion.com/associatedpress" target="_blank">associatedpress</a></i>',
     66            'expected'      => 'http://s1.dmcdn.net/AMjdy.jpg',
     67            'expected_hash' => '077888b97839254892a377f51c06e642',
     68            'name'          => 'Flash player'
    6769        ),
    6870    );
  • video-thumbnails/trunk/php/providers/class-facebook-thumbnails.php

    r710772 r837855  
    4848    public $test_cases = array(
    4949        array(
    50             'markup' => '<object width=420 height=180><param name=allowfullscreen value=true></param><param name=allowscriptaccess value=always></param><param name=movie value="http://www.facebook.com/v/2560032632599"></param><embed src="http://www.facebook.com/v/2560032632599" type="application/x-shockwave-flash" allowscriptaccess=always allowfullscreen=true width=420 height=180></embed></object>',
    51             'expected' => 'https://graph.facebook.com/2560032632599/picture',
    52             'name' => 'Flash Embed'
     50            'markup'        => '<object width=420 height=180><param name=allowfullscreen value=true></param><param name=allowscriptaccess value=always></param><param name=movie value="http://www.facebook.com/v/2560032632599"></param><embed src="http://www.facebook.com/v/2560032632599" type="application/x-shockwave-flash" allowscriptaccess=always allowfullscreen=true width=420 height=180></embed></object>',
     51            'expected'      => 'https://graph.facebook.com/2560032632599/picture',
     52            'expected_hash' => '619591ec126ad889799ad992a227c75e',
     53            'name'          => 'Flash Embed'
    5354        ),
    5455        array(
    55             'markup' => '<iframe src="https://www.facebook.com/video/embed?video_id=2560032632599" width="960" height="720" frameborder="0"></iframe>',
    56             'expected' => 'https://graph.facebook.com/2560032632599/picture',
    57             'name' => 'iFrame Embed'
     56            'markup'        => '<iframe src="https://www.facebook.com/video/embed?video_id=2560032632599" width="960" height="720" frameborder="0"></iframe>',
     57            'expected'      => 'https://graph.facebook.com/2560032632599/picture',
     58            'expected_hash' => '619591ec126ad889799ad992a227c75e',
     59            'name'          => 'iFrame Embed'
    5860        ),
    5961    );
  • video-thumbnails/trunk/php/providers/class-funnyordie-thumbnails.php

    r835793 r837855  
    5656    public $test_cases = array(
    5757        array(
    58             'markup' => '<iframe src="http://www.funnyordie.com/embed/5325b03b52" width="640" height="400" frameborder="0"></iframe>',
    59             'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg',
    60             'name' => 'iFrame player'
     58            'markup'        => '<iframe src="http://www.funnyordie.com/embed/5325b03b52" width="640" height="400" frameborder="0"></iframe>',
     59            'expected'      => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg',
     60            'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b',
     61            'name'          => 'iFrame player'
    6162        ),
    6263        array(
    63             'markup' => '<object width="640" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="ordie_player_5325b03b52"><param name="movie" value="http://player.ordienetworks.com/flash/fodplayer.swf" /><param name="flashvars" value="key=5325b03b52" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always"><embed width="640" height="400" flashvars="key=5325b03b52" allowfullscreen="true" allowscriptaccess="always" quality="high" src="http://player.ordienetworks.com/flash/fodplayer.swf" name="ordie_player_5325b03b52" type="application/x-shockwave-flash"></embed></object>',
    64             'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg',
    65             'name' => 'Flash player'
     64            'markup'        => '<object width="640" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="ordie_player_5325b03b52"><param name="movie" value="http://player.ordienetworks.com/flash/fodplayer.swf" /><param name="flashvars" value="key=5325b03b52" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always"><embed width="640" height="400" flashvars="key=5325b03b52" allowfullscreen="true" allowscriptaccess="always" quality="high" src="http://player.ordienetworks.com/flash/fodplayer.swf" name="ordie_player_5325b03b52" type="application/x-shockwave-flash"></embed></object>',
     65            'expected'      => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg',
     66            'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b',
     67            'name'          => 'Flash player'
    6668        ),
    6769    );
  • video-thumbnails/trunk/php/providers/class-justintv-thumbnails.php

    r710079 r837855  
    5555    public $test_cases = array(
    5656        array(
    57             'markup' => '<object type="application/x-shockwave-flash" height="300" width="400" id="clip_embed_player_flash" data="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" bgcolor="#000000"><param name="movie" value="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="auto_play=false&start_volume=25&title=Title&channel=scamschoolbrian&archive_id=392481524" /></object>',
    58             'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-392481524-320x240.jpg',
    59             'name' => 'Embed'
     57            'markup'        => '<object type="application/x-shockwave-flash" height="300" width="400" id="clip_embed_player_flash" data="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" bgcolor="#000000"><param name="movie" value="http://www-cdn.justin.tv/widgets/archive_embed_player.swf" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="allowFullScreen" value="true" /><param name="flashvars" value="auto_play=false&start_volume=25&title=Title&channel=scamschoolbrian&archive_id=392481524" /></object>',
     58            'expected'      => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-392481524-320x240.jpg',
     59            'expected_hash' => '7f260a2ce6ae75a3c2e5012108f161b7',
     60            'name'          => 'Embed'
    6061        ),
    6162    );
  • video-thumbnails/trunk/php/providers/class-kaltura-thumbnails.php

    r710079 r837855  
    6363    public $test_cases = array(
    6464        array(
    65             'markup' => '<script type="text/javascript" src="http://cdnapi.kaltura.com/p/1374841/sp/137484100/embedIframeJs/uiconf_id/12680902/partner_id/1374841?entry_id=1_y7xzqsxw&playerId=kaltura_player_1363589321&cache_st=1363589321&autoembed=true&width=400&height=333&"></script>',
     65            'markup'   => '<script type="text/javascript" src="http://cdnapi.kaltura.com/p/1374841/sp/137484100/embedIframeJs/uiconf_id/12680902/partner_id/1374841?entry_id=1_y7xzqsxw&playerId=kaltura_player_1363589321&cache_st=1363589321&autoembed=true&width=400&height=333&"></script>',
    6666            'expected' => 'http://example.com/thumbnail.jpg',
    67             'name' => 'Auto embed'
     67            'name'     => 'Auto embed'
    6868        ),
    6969    );
  • video-thumbnails/trunk/php/providers/class-metacafe-thumbnails.php

    r710079 r837855  
    5656    public $test_cases = array(
    5757        array(
    58             'markup' => '<embed flashVars="playerVars=autoPlay=no" src="http://www.metacafe.com/fplayer/8456223/men_in_black_3_trailer_2.swf" width="440" height="248" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_8456223" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>',
    59             'expected' => 'http://s4.mcstatic.com/thumb/8456223/22479418/4/catalog_item5/0/1/men_in_black_3_trailer_2.jpg',
    60             'name' => 'Embed'
     58            'markup'        => '<embed flashVars="playerVars=autoPlay=no" src="http://www.metacafe.com/fplayer/8456223/men_in_black_3_trailer_2.swf" width="440" height="248" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_8456223" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>',
     59            'expected'      => 'http://s4.mcstatic.com/thumb/8456223/22479418/4/catalog_item5/0/1/men_in_black_3_trailer_2.jpg',
     60            'expected_hash' => 'df46215fef1d9fb68eea64ba3ed9a4fd',
     61            'name'          => 'Embed'
    6162        ),
    6263    );
  • video-thumbnails/trunk/php/providers/class-mpora-thumbnails.php

    r710079 r837855  
    4848    public $test_cases = array(
    4949        array(
    50             'markup' => '<object width="480" height="270" id="mporaplayer_wEr2CBooV_N" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" ><param name="movie" value="http://video.mpora.com/ep/wEr2CBooV/"></param><param name="wmode" value="transparent"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="http://video.mpora.com/ep/wEr2CBooV/" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>',
    51             'expected' => 'http://ugc4.mporatrons.com/thumbs/wEr2CBooV_640x360_0000.jpg',
    52             'name' => 'Flash player'
     50            'markup'        => '<object width="480" height="270" id="mporaplayer_wEr2CBooV_N" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" ><param name="movie" value="http://video.mpora.com/ep/wEr2CBooV/"></param><param name="wmode" value="transparent"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="http://video.mpora.com/ep/wEr2CBooV/" width="480" height="270" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>',
     51            'expected'      => 'http://ugc4.mporatrons.com/thumbs/wEr2CBooV_640x360_0000.jpg',
     52            'expected_hash' => '95075bd4941251ebecbab3b436a90c49',
     53            'name'          => 'Flash player'
    5354        ),
    5455        array(
    55             'markup' => '<iframe width="640" height="360" src="http://mpora.com/videos/AAdfegovdop0/embed" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
    56             'expected' => 'http://ugc4.mporatrons.com/thumbs/AAdfegovdop0_640x360_0000.jpg',
    57             'name' => 'iFrame player'
     56            'markup'        => '<iframe width="640" height="360" src="http://mpora.com/videos/AAdfegovdop0/embed" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
     57            'expected'      => 'http://ugc4.mporatrons.com/thumbs/AAdfegovdop0_640x360_0000.jpg',
     58            'expected_hash' => '45db22a2ba5ef20163f52ba562b89259',
     59            'name'          => 'iFrame player'
    5860        ),
    5961    );
  • video-thumbnails/trunk/php/providers/class-rutube-thumbnails.php

    r834141 r837855  
    5656    public $test_cases = array(
    5757        array(
    58             'markup' => 'http://rutube.ru/video/ca8607cd4f7ef28516e043dde0068564/',
    59             'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg',
    60             'name' => 'Video link'
     58            'markup'        => 'http://rutube.ru/video/ca8607cd4f7ef28516e043dde0068564/',
     59            'expected'      => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg',
     60            'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354',
     61            'name'          => 'Video link'
    6162        ),
    6263        array(
    63             'markup' => '<iframe width="720" height="405" src="//rutube.ru/video/embed/6608735" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>',
    64             'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg',
    65             'name' => 'iFrame embed'
     64            'markup'        => '<iframe width="720" height="405" src="//rutube.ru/video/embed/6608735" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>',
     65            'expected'      => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg',
     66            'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354',
     67            'name'          => 'iFrame embed'
    6668        ),
    6769    );
  • video-thumbnails/trunk/php/providers/class-twitch-thumbnails.php

    r835793 r837855  
    5656    public $test_cases = array(
    5757        array(
    58             'markup' => 'http://www.twitch.tv/vanillatv/c/1537974',
    59             'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg',
    60             'name' => 'Video link'
     58            'markup'        => 'http://www.twitch.tv/vanillatv/c/1537974',
     59            'expected'      => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg',
     60            'expected_hash' => 'f3921b65f799aa648ef6dae29871c137',
     61            'name'          => 'Video link'
    6162        ),
    6263        array(
    63             'markup' => '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/archive_embed_player.swf" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"><param name="movie" value="http://www.twitch.tv/widgets/archive_embed_player.swf"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="allowFullScreen" value="true"><param name="flashvars" value="title=VanillaTV%2B-%2BSweden%2Bvs%2BRussia%2B-%2BETF2L%2BNations%2BCup%2B-%2BSnakewater%2B%255BMap3%255D%2B-%2BPart%2B3&amp;channel=vanillatv&amp;auto_play=false&amp;start_volume=25&amp;chapter_id=1537974"></object>',
    64             'expected' => 'http://static-cdn.jtvnw.net/jtv.thumbs/archive-328087483-320x240.jpg',
    65             'name' => 'Flash embed'
     64            'markup'        => '<object bgcolor="#000000" data="http://www.twitch.tv/widgets/archive_embed_player.swf" height="378" id="clip_embed_player_flash" type="application/x-shockwave-flash" width="620"><param name="movie" value="http://www.twitch.tv/widgets/archive_embed_player.swf"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="allowFullScreen" value="true"><param name="flashvars" value="title=VanillaTV%2B-%2BSweden%2Bvs%2BRussia%2B-%2BETF2L%2BNations%2BCup%2B-%2BSnakewater%2B%255BMap3%255D%2B-%2BPart%2B3&amp;channel=vanillatv&amp;auto_play=false&amp;start_volume=25&amp;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'
    6668        ),
    6769    );
  • video-thumbnails/trunk/php/providers/class-video-thumbnails-providers.php

    r835793 r837855  
    11<?php
    22
    3 /*  Copyright 2013 Sutherland Boswell  (email : [email protected])
     3/*  Copyright 2014 Sutherland Boswell  (email : [email protected])
    44
    55    This program is free software; you can redistribute it and/or modify
     
    9393require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-vimeo-thumbnails.php' );
    9494require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-facebook-thumbnails.php' );
     95require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-vine-thumbnails.php' );
    9596require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-blip-thumbnails.php' );
    9697require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-justintv-thumbnails.php' );
     
    105106require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-rutube-thumbnails.php' );
    106107require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-twitch-thumbnails.php' );
     108require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-googledrive-thumbnails.php' );
    107109
    108110?>
  • video-thumbnails/trunk/php/providers/class-vimeo-thumbnails.php

    r791525 r837855  
    6262    // Regex strings
    6363    public $regexes = array(
    64         '#<object[^>]+>.+?http://vimeo\.com/moogaloop.swf\?clip_id=([A-Za-z0-9\-_]+)&.+?</object>#s', // Standard Vimeo embed code
    65         '#(?:https?:)?//player\.vimeo\.com/video/([0-9]+)#', // Vimeo iframe player
    66         '#\[vimeo id=([A-Za-z0-9\-_]+)]#', // JR_embed shortcode
    67         '#\[vimeo clip_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Another shortcode
    68         '#\[vimeo video_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Yet another shortcode
    69         '#(?:https?://)?(?:www\.)?vimeo\.com/([0-9]+)#', // Vimeo URL
    70         '#(?:https?://)?(?:www\.)?vimeo\.com/channels/(?:[A-Za-z0-9]+)/([0-9]+)#' // Channel URL
     64        '#<object[^>]+>.+?http://vimeo\.com/moogaloop.swf\?clip_id=([A-Za-z0-9\-_]+)&.+?</object>#s', // Standard Vimeo embed code
     65        '#(?:https?:)?//player\.vimeo\.com/video/([0-9]+)#', // Vimeo iframe player
     66        '#\[vimeo id=([A-Za-z0-9\-_]+)]#', // JR_embed shortcode
     67        '#\[vimeo clip_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Another shortcode
     68        '#\[vimeo video_id="([A-Za-z0-9\-_]+)"[^>]*]#', // Yet another shortcode
     69        '#(?:https?://)?(?:www\.)?vimeo\.com/([0-9]+)#', // Vimeo URL
     70        '#(?:https?://)?(?:www\.)?vimeo\.com/channels/(?:[A-Za-z0-9]+)/([0-9]+)#' // Channel URL
    7171    );
    7272
    7373    // Thumbnail URL
    7474    public function get_thumbnail_url( $id ) {
    75         // Get our settings
    76         $client_id = ( isset( $this->options['client_id'] ) && $this->options['client_id'] != '' ? $this->options['client_id'] : false );
    77         $client_secret = ( isset( $this->options['client_secret'] ) && $this->options['client_secret'] != '' ? $this->options['client_secret'] : false );
    78         $access_token = ( isset( $this->options['access_token'] ) && $this->options['access_token'] != '' ? $this->options['access_token'] : false );
    79         $access_token_secret = ( isset( $this->options['access_token_secret'] ) && $this->options['access_token_secret'] != '' ? $this->options['access_token_secret'] : false );
     75        // Get our settings
     76        $client_id = ( isset( $this->options['client_id'] ) && $this->options['client_id'] != '' ? $this->options['client_id'] : false );
     77        $client_secret = ( isset( $this->options['client_secret'] ) && $this->options['client_secret'] != '' ? $this->options['client_secret'] : false );
     78        $access_token = ( isset( $this->options['access_token'] ) && $this->options['access_token'] != '' ? $this->options['access_token'] : false );
     79        $access_token_secret = ( isset( $this->options['access_token_secret'] ) && $this->options['access_token_secret'] != '' ? $this->options['access_token_secret'] : false );
    8080        // If API credentials are entered, use the API
    8181        if ( $client_id && $client_secret && $access_token && $access_token_secret ) {
     
    102102    public $test_cases = array(
    103103        array(
    104             'markup' => '<iframe src="http://player.vimeo.com/video/41504360" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
    105             'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg',
    106             'name' => 'iFrame'
     104            'markup'        => '<iframe src="http://player.vimeo.com/video/41504360" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
     105            'expected'      => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg',
     106            'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623',
     107            'name'          => 'iFrame'
    107108        ),
    108109        array(
    109             'markup' => '<object width="500" height="281"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=41504360&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=41504360&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object>',
    110             'expected' => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg',
    111             'name' => 'Old embed'
     110            'markup'        => '<object width="500" height="281"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=41504360&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=41504360&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object>',
     111            'expected'      => 'http://b.vimeocdn.com/ts/287/850/287850781_1280.jpg',
     112            'expected_hash' => 'c60989d7ef599cfd07ec196c35a43623',
     113            'name'          => 'Old embed'
    112114        ),
    113115        array(
    114             'markup' => 'https://vimeo.com/channels/soundworkscollection/44520894',
    115             'expected' => 'http://b.vimeocdn.com/ts/313/130/313130530_640.jpg',
    116             'name' => 'Channel URL'
     116            'markup'        => 'https://vimeo.com/channels/soundworkscollection/44520894',
     117            'expected'      => 'http://b.vimeocdn.com/ts/313/130/313130530_640.jpg',
     118            'expected_hash' => 'e9fd72872a39272f6c540ee66b1ecf28',
     119            'name'          => 'Channel URL'
    117120        ),
    118121    );
  • video-thumbnails/trunk/php/providers/class-wistia-thumbnails.php

    r794208 r837855  
    7979    public $test_cases = array(
    8080        array(
    81             'markup' => '<iframe src="http://fast.wistia.net/embed/iframe/po4utu3zde?controlsVisibleOnLoad=true&version=v1&videoHeight=360&videoWidth=640&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="640" height="360"></iframe>',
    82             'expected' => 'http://embed-0.wistia.com/deliveries/6928fcba8355e38de4d95863a659e1de23cb2071.jpg',
    83             'name' => 'Inline player'
     81            'markup'        => '<iframe src="http://fast.wistia.net/embed/iframe/po4utu3zde?controlsVisibleOnLoad=true&version=v1&videoHeight=360&videoWidth=640&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="640" height="360"></iframe>',
     82            'expected'      => 'http://embed-0.wistia.com/deliveries/6928fcba8355e38de4d95863a659e1de23cb2071.jpg',
     83            'expected_hash' => 'bc4a2cec9ac97e2ccdae2c7387a01cb4',
     84            'name'          => 'Inline player'
    8485        ),
    8586        array(
    86             'markup' => '<div class=\'wistia_embed\' data-video-height=\'312\' data-video-width=\'499\' id=\'wistia_j1qd2lvys1\'></div> <script charset=\'ISO-8859-1\' src=\'http://fast.wistia.com/static/concat/E-v1.js\'></script> <script> var platform = ( Modernizr.touch ) ? "html5" : "flash"; wistiaEmbed = Wistia.embed("j1qd2lvys1", { version: "v1", videoWidth: 499, videoHeight: 312, playButton: Modernizr.touch, smallPlayButton: Modernizr.touch, playbar: Modernizr.touch, platformPreference: platform, chromeless: Modernizr.touch ? false : true, fullscreenButton: false, autoPlay: !Modernizr.touch, videoFoam: true }); </script>',
    87             'expected' => 'http://embed.wistia.com/deliveries/a086707fe096e7f3fbefef1d1dcba1488d23a3e9.jpg',
    88             'name' => 'JavaScript API embedding'
     87            'markup'        => '<div class=\'wistia_embed\' data-video-height=\'312\' data-video-width=\'499\' id=\'wistia_j1qd2lvys1\'></div> <script charset=\'ISO-8859-1\' src=\'http://fast.wistia.com/static/concat/E-v1.js\'></script> <script> var platform = ( Modernizr.touch ) ? "html5" : "flash"; wistiaEmbed = Wistia.embed("j1qd2lvys1", { version: "v1", videoWidth: 499, videoHeight: 312, playButton: Modernizr.touch, smallPlayButton: Modernizr.touch, playbar: Modernizr.touch, platformPreference: platform, chromeless: Modernizr.touch ? false : true, fullscreenButton: false, autoPlay: !Modernizr.touch, videoFoam: true }); </script>',
     88            'expected'      => 'https://embed-ssl.wistia.com/deliveries/a086707fe096e7f3fbefef1d1dcba1488d23a3e9.jpg',
     89            'expected_hash' => '4c63d131604bfc07b5178413ab245813',
     90            'name'          => 'JavaScript API embedding'
    8991        ),
    9092    );
  • video-thumbnails/trunk/php/providers/class-youku-thumbnails.php

    r710079 r837855  
    5656    public $test_cases = array(
    5757        array(
    58             'markup' => '<embed src="http://player.youku.com/player.php/sid/XMzQyMzk5MzQ4/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" allowFullscreen="true" type="application/x-shockwave-flash"></embed>',
    59             'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493',
    60             'name' => 'Flash embed'
     58            'markup'        => '<embed src="http://player.youku.com/player.php/sid/XMzQyMzk5MzQ4/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" allowFullscreen="true" type="application/x-shockwave-flash"></embed>',
     59            'expected'      => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493',
     60            'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8',
     61            'name'          => 'Flash embed'
    6162        ),
    6263        array(
    63             'markup' => 'http://v.youku.com/v_show/id_XMzQyMzk5MzQ4.html',
    64             'expected' => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493',
    65             'name' => 'Link'
     64            'markup'        => 'http://v.youku.com/v_show/id_XMzQyMzk5MzQ4.html',
     65            'expected'      => 'http://g1.ykimg.com/1100641F464F0FB57407E2053DFCBC802FBBC4-E4C5-7A58-0394-26C366F10493',
     66            'expected_hash' => 'deac7bb89058a8c46ae2350da9d33ba8',
     67            'name'          => 'Link'
    6668        ),
    6769    );
  • video-thumbnails/trunk/php/providers/class-youtube-thumbnails.php

    r794208 r837855  
    5757    public $test_cases = array(
    5858        array(
    59             'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/Fp0U2Vglkjw" frameborder="0" allowfullscreen></iframe>',
    60             'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg',
    61             'name' => 'iFrame HD'
     59            'markup'        => '<iframe width="560" height="315" src="http://www.youtube.com/embed/Fp0U2Vglkjw" frameborder="0" allowfullscreen></iframe>',
     60            'expected'      => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg',
     61            'expected_hash' => 'c66256332969c38790c2b9f26f725e7a',
     62            'name'          => 'iFrame HD'
    6263        ),
    6364        array(
    64             'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&amp;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&amp;hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>',
    65             'expected' => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg',
    66             'name' => 'Old embed HD'
     65            'markup'        => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/Fp0U2Vglkjw?version=3&amp;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&amp;hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>',
     66            'expected'      => 'http://img.youtube.com/vi/Fp0U2Vglkjw/maxresdefault.jpg',
     67            'expected_hash' => 'c66256332969c38790c2b9f26f725e7a',
     68            'name'          => 'Old embed HD'
    6769        ),
    6870        array(
    69             'markup' => '<iframe width="560" height="315" src="http://www.youtube.com/embed/vv_AitYPjtc" frameborder="0" allowfullscreen></iframe>',
    70             'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg',
    71             'name' => 'iFrame SD'
     71            'markup'        => '<iframe width="560" height="315" src="http://www.youtube.com/embed/vv_AitYPjtc" frameborder="0" allowfullscreen></iframe>',
     72            'expected'      => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg',
     73            'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9',
     74            'name'          => 'iFrame SD'
    7275        ),
    7376        array(
    74             'markup' => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/vv_AitYPjtc?version=3&amp;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&amp;hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>',
    75             'expected' => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg',
    76             'name' => 'Old embed SD'
     77            'markup'        => '<object width="560" height="315"><param name="movie" value="http://www.youtube.com/v/vv_AitYPjtc?version=3&amp;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&amp;hl=en_US" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>',
     78            'expected'      => 'http://img.youtube.com/vi/vv_AitYPjtc/0.jpg',
     79            'expected_hash' => '6c00b9ab335a6ea00b0fb964c39a6dc9',
     80            'name'          => 'Old embed SD'
    7781        ),
    7882    );
  • video-thumbnails/trunk/readme.txt

    r835793 r837855  
    22Contributors: sutherlandboswell
    33Donate link: http://wie.ly/u/donate
    4 Tags: Video, Thumbnails, YouTube, Vimeo, Blip, Justin.tv, Dailymotion, Metacafe, Image, Featured Image, Post Thumbnail
     4Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image
    55Requires at least: 3.1
    66Tested up to: 3.8
    7 Stable tag: 2.3
     7Stable tag: 2.4
    88
    99Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
     
    1818* Vimeo
    1919* Facebook
    20 * Blip
     20* Vine
    2121* Justin.tv
     22* Twitch
    2223* Dailymotion
    2324* Metacafe
     25* Blip
     26* Google Drive
    2427* Funny or Die
     28* CollegeHumor
    2529* MPORA
    2630* Wistia
    2731* Youku
    28 * CollegeHumor
    2932* Rutube
    30 * Twitch
    3133
    3234Video Thumbnails even works with most video embedding plugins, including:
     
    5153== Frequently Asked Questions ==
    5254
     55= No video thumbnail for this post =
     56
     571. Ensure you have saved any changes to your post.
     581. If you are using a a plugin or theme that stores videos in a special location other than the main post content area, be sure you've entered the correct custom field on the settings page. If you don't know the name of the field your video is being saved in, please contact the developer of that theme or plugin.
     591. Copy and paste your embed code into the "Test Markup for Video" section of the Debugging page. If this doesn't find the thumbnail, you'll want to be sure to include the embed code you scanned when you request support. If it does find a thumbnail, please double check that you have the Custom Field set correctly in the settings page if you are using a a plugin or theme that stores videos in a special location.
     601. Go to the Debugging page and click "Test Image Downloading" to test your server's ability to save an image from a video source.
     611. Try posting a video from other sources to help narrow down the problem.
     621. Check the support threads to see if anyone has had the same issue.
     631. If you are still unable to resolve the problem, start a thread with a good descriptive title ("Error" or "No thumbnails" is a bad title) and be sure to include the results of your testing as well. Also be sure to include the name of your theme, any video plugins you're using, and any other details you can think of.
     64
    5365= My theme isn't showing thumbnails, what's wrong? =
    5466
     
    99111
    100112== Changelog ==
     113
     114= 2.4 =
     115* Added support for Vine
     116* Added support for Google Drive videos
     117* Rewritten bulk video thumbnail scanner
     118* Added troubleshooting link in meta box when no video thumbnail is found
     119* Changed provider test to compare file hashes in case thumbnail URLs change
    101120
    102121= 2.3 =
  • video-thumbnails/trunk/video-thumbnails.php

    r835793 r837855  
    33Plugin Name: Video Thumbnails
    44Plugin URI: http://refactored.co/plugins/video-thumbnails
    5 Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Currently supports YouTube, Vimeo, Facebook, Blip.tv, Justin.tv, Dailymotion, Metacafe, Wistia, Youku, Funny or Die, and MPORA.
     5Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Supports YouTube, Vimeo, Facebook, Vine, Justin.tv, Twitch, Dailymotion, Metacafe, Blip, Google Drive, Funny or Die, CollegeHumor, MPORA, Wistia, Youku, and Rutube.
    66Author: Sutherland Boswell
    77Author URI: http://sutherlandboswell.com
    8 Version: 2.3
     8Version: 2.4
    99License: GPL2
    1010*/
    11 /*  Copyright 2013 Sutherland Boswell  (email : [email protected])
     11/*  Copyright 2014 Sutherland Boswell  (email : [email protected])
    1212
    1313    This program is free software; you can redistribute it and/or modify
     
    2929define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
    3030define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
    31 define( 'VIDEO_THUMBNAILS_VERSION', '2.3' );
     31define( 'VIDEO_THUMBNAILS_VERSION', '2.4' );
    3232
    3333// Providers
     
    7272        add_action( 'wp_ajax_reset_video_thumbnail', array( &$this, 'ajax_reset_callback' ) );
    7373
     74        // Add admin menus
     75        add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
     76
     77        // Add JavaScript and CSS to admin pages
     78        add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ), 20 );
     79
     80        // Get the posts to be scanned in bulk
     81        add_action('wp_ajax_video_thumbnails_bulk_posts_query', array( &$this, 'bulk_posts_query_callback' ) );
     82        // Get the thumbnail for an individual post
     83        add_action('wp_ajax_video_thumbnails_get_thumbnail_for_post', array( &$this, 'get_thumbnail_for_post_callback' ) );
     84
     85    }
     86
     87    /**
     88     * Adds the admin menu items
     89     */
     90    function admin_menu() {
     91        add_management_page( 'Bulk Video Thumbnails', 'Bulk Video Thumbs', 'manage_options', 'video-thumbnails-bulk', array( &$this, 'bulk_scanning_page' ) );
     92    }
     93
     94    function admin_scripts( $hook ) {
     95        // Bulk tool page
     96        if ( 'tools_page_video-thumbnails-bulk' == $hook ) {
     97            wp_enqueue_script( 'video-thumbnails-bulk-js', plugins_url( '/js/bulk.js' , __FILE__ ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION );
     98            wp_enqueue_style( 'video-thumbnails-bulk-css', plugins_url('/css/bulk.css', __FILE__), false, VIDEO_THUMBNAILS_VERSION );
     99        }
    74100    }
    75101
     
    85111    // Construct the meta box
    86112    function meta_box() {
     113
     114        // Add hidden troubleshooting info
     115        add_thickbox();
     116        ?>
     117        <div id="video-thumbnail-not-found-troubleshooting" style="display:none;">
     118            <h2><?php _e( 'Troubleshooting Video Thumbnails' ); ?></h2>
     119            <h3>No video thumbnail for this post</h3>
     120            <ol>
     121                <li>Ensure you have saved any changes to your post.</li>
     122                <li>If you are using a a plugin or theme that stores videos in a special location other than the main post content area, be sure you've entered the correct custom field on the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails' ); ?>">settings page</a>. If you don't know the name of the field your video is being saved in, please contact the developer of that theme or plugin.</li>
     123                <li>Copy and paste your embed code into the "Test Markup for Video" section of the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ); ?>">Debugging page</a>. If this doesn't find the thumbnail, you'll want to be sure to include the embed code you scanned when you request support. If it does find a thumbnail, please double check that you have the Custom Field set correctly in the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails' ); ?>">settings page</a> if you are using a a plugin or theme that stores videos in a special location.</li>
     124                <li>Go to the <a href="<?php echo admin_url( 'options-general.php?page=video_thumbnails&tab=debugging' ); ?>">Debugging page</a> and click "Test Image Downloading" to test your server's ability to save an image from a video source.</li>
     125                <li>Try posting a video from other sources to help narrow down the problem.</li>
     126                <li>Check the <a href="http://wordpress.org/support/plugin/video-thumbnails">support threads</a> to see if anyone has had the same issue.</li>
     127                <li>If you are still unable to resolve the problem, <a href="http://wordpress.org/support/plugin/video-thumbnails">start a thread</a> with a good descriptive title ("Error" or "No thumbnails" is a bad title) and be sure to include the results of your testing as well. Also be sure to include the name of your theme, any video plugins you're using, and any other details you can think of.</li>
     128            </ol>
     129        </div>
     130        <?php
     131
    87132        global $post;
    88133        $custom = get_post_custom( $post->ID );
     
    96141                echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Reset Video Thumbnail</a></p>';
    97142            } else {
    98                 echo '<p id="video-thumbnails-preview">We didn\'t find a video thumbnail for this post.</p>';
    99                 echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Search Again</a></p>';
     143                echo '<p id="video-thumbnails-preview">No video thumbnail for this post.</p>';
     144                echo '<p><a href="#" id="video-thumbnails-reset" onclick="video_thumbnails_reset(\'' . $post->ID . '\' );return false;">Search Again</a> <a href="#TB_inline?width=400&height=600&inlineId=video-thumbnail-not-found-troubleshooting" class="thickbox" style="float:right;">Troubleshoot<a/></p>';
    100145            }
    101146        } else {
     
    333378            echo '<img src="' . $video_thumbnail . '" style="max-width:100%;" />';
    334379        } else {
    335             echo 'We didn\'t find a video thumbnail for this post. (be sure you have saved changes first)';
     380            echo 'No video thumbnail for this post.';
    336381        }
    337382
    338383        die();
     384    }
     385
     386    function bulk_posts_query_callback() {
     387        $args = array(
     388            'showposts' => -1,
     389            'post_type' => $this->settings->options['post_types'],
     390            'fields'    => 'ids'
     391        );
     392        $query = new WP_Query( $args );
     393        echo json_encode( $query->posts );
     394        die();
     395    }
     396
     397    function get_thumbnail_for_post_callback() {
     398
     399        $post_id = $_POST['post_id'];
     400        $thumb = get_post_meta( $post_id, VIDEO_THUMBNAILS_FIELD, true );
     401
     402        if ( $thumb == '' ) {
     403            global $video_thumbnails;
     404            $thumb = $video_thumbnails->get_video_thumbnail( $post_id );
     405            if ( $thumb ) {
     406                $type = 'new';
     407            }
     408        } else {
     409            $type = 'existing';
     410        }
     411
     412        if ( $thumb != '' ) {
     413            $result = array(
     414                'type' => $type,
     415                'url' => $thumb
     416            );
     417        } else {
     418            $result = array();
     419        }
     420
     421        echo json_encode( $result );
     422        die();
     423    }
     424
     425    function bulk_scanning_page() {
     426
     427        if ( ! current_user_can( 'manage_options' ) ) {
     428            wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
     429        }
     430
     431        ?>
     432        <div class="wrap">
     433
     434            <div id="icon-tools" class="icon32"></div><h2>Bulk Video Thumbnail Generator</h2>
     435
     436            <p>Use this tool to scan all of your posts for Video Thumbnails.</p>
     437
     438            <p><a id="video-thumbnails-scan-all-posts" href="#" class="button button-primary">Scan All Posts</a></p>
     439
     440            <div id="vt-bulk-scan-results">
     441                <div class="progress-bar-container">
     442                    <span class="percentage">0%</span>
     443                    <div class="progress-bar">&nbsp;</div>
     444                </div>
     445                <div class="stats">
     446                    <div class="scanned"></div>
     447                    <div class="found"></div>
     448                </div>
     449                <ul class="log"></ul>
     450            </div>
     451
     452        </div>
     453        <?php
     454
    339455    }
    340456
Note: See TracChangeset for help on using the changeset viewer.