Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 103 additions & 104 deletions php/class-video-thumbnails-settings.php

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions php/extensions/automatic-youtube-video-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,3 @@ function ayvp_new_video_thumbnail_url_filter( $new_thumbnail, $post_id ) {
remove_filter( 'post_thumbnail_html', 'WP_ayvpp_thumbnail' );
remove_filter( 'post_thumbnail_size', 'WP_ayvpp_thumbnail_size' );
}

?>
2 changes: 0 additions & 2 deletions php/extensions/extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@
require_once( VIDEO_THUMBNAILS_PATH . '/php/extensions/automatic-youtube-video-posts.php' );
require_once( VIDEO_THUMBNAILS_PATH . '/php/extensions/simple-video-embedder.php' );
require_once( VIDEO_THUMBNAILS_PATH . '/php/extensions/wp-robot.php' );

?>
2 changes: 0 additions & 2 deletions php/extensions/simple-video-embedder.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ function simple_video_embedder_video_thumbnail_markup_filter( $markup, $post_id

// Add filter to modify markup
add_filter( 'video_thumbnail_markup', 'simple_video_embedder_video_thumbnail_markup_filter', 10, 2 );

?>
2 changes: 0 additions & 2 deletions php/extensions/wp-robot.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ function video_thumbnails_wpr_after_post_action( $post_id ) {
}

add_action( 'wpr_after_post', 'video_thumbnails_wpr_after_post_action', 10, 1 );

?>
6 changes: 2 additions & 4 deletions php/providers/class-blip-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,15 @@ public static function get_test_cases() {
'markup' => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917',
'expected' => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg',
'expected_hash' => '26a622f72bd4bdb3f8189f85598dd95d',
'name' => __( 'Video URL', 'video-thumbnails' )
'name' => esc_html__( 'Video URL', 'video-thumbnails' )
),
array(
'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>',
'expected' => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png',
'expected_hash' => '87efa9f6b0d9111b0826ae4fbdddec1b',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
);
}

}

?>
6 changes: 2 additions & 4 deletions php/providers/class-collegehumor-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ public static function get_test_cases() {
'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>',
'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg',
'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
array(
'markup' => 'http://www.collegehumor.com/video/6830834/mitt-romney-style-gangnam-style-parody',
'expected' => 'http://2.media.collegehumor.cvcdn.com/62/99/20502ca0d5b2172421002b52f437dcf8-mitt-romney-style-gangnam-style-parody.jpg',
'expected_hash' => 'ceac16f6ee1fa5d8707e813226060a15',
'name' => __( 'Video URL', 'video-thumbnails' )
'name' => esc_html__( 'Video URL', 'video-thumbnails' )
),
);
}

}

?>
6 changes: 2 additions & 4 deletions php/providers/class-dailymotion-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,15 @@ public static function get_test_cases() {
'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>',
'expected' => 'http://s1.dmcdn.net/AMjdy.jpg',
'expected_hash' => '077888b97839254892a377f51c06e642',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
array(
'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>',
'expected' => 'http://s1.dmcdn.net/AMjdy.jpg',
'expected_hash' => '077888b97839254892a377f51c06e642',
'name' => __( 'Flash Embed', 'video-thumbnails' )
'name' => esc_html__( 'Flash Embed', 'video-thumbnails' )
),
);
}

}

?>
8 changes: 3 additions & 5 deletions php/providers/class-facebook-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,21 @@ public static function get_test_cases() {
'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>',
'expected' => 'https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/v/t15.0-10/p160x160/50796_2560034672650_2560032632599_65313_313_b.jpg?oh=e8c767b1efafa6d8a4b672bad7be38d6&oe=55364081&__gda__=1428807476_a4d83140019b11ad602f2ef9960a364e',
'expected_hash' => '6b033d8f16dbf273048c5771d32ede64',
'name' => __( 'Flash Embed', 'video-thumbnails' )
'name' => esc_html__( 'Flash Embed', 'video-thumbnails' )
),
array(
'markup' => '<iframe src="https://www.facebook.com/video/embed?video_id=2560032632599" width="960" height="720" frameborder="0"></iframe>',
'expected' => 'https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/v/t15.0-10/p160x160/50796_2560034672650_2560032632599_65313_313_b.jpg?oh=e8c767b1efafa6d8a4b672bad7be38d6&oe=55364081&__gda__=1428807476_a4d83140019b11ad602f2ef9960a364e',
'expected_hash' => '6b033d8f16dbf273048c5771d32ede64',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
array(
'markup' => '<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, \'script\', \'facebook-jssdk\'));</script><div class="fb-post" data-href="https://www.facebook.com/video.php?v=10150326323406807" data-width="466"><div class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/video.php?v=10150326323406807">Post</a> by <a href="https://www.facebook.com/PeterJacksonNZ">Peter Jackson</a>.</div></div>',
'expected' => 'https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xfa1/v/t15.0-10/p128x128/244423_10150326375786807_10150326323406807_4366_759_b.jpg?oh=013ce21bb54de51c383071598b269a91&oe=552CD270&__gda__=1428479462_339647870ec32227c391e98000935aec',
'expected_hash' => '184d20db21ac8edef9c9cee291be5ee6',
'name' => __( 'FBML Embed', 'video-thumbnails' )
'name' => esc_html__( 'FBML Embed', 'video-thumbnails' )
),
);
}

}

?>
6 changes: 2 additions & 4 deletions php/providers/class-funnyordie-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,15 @@ public static function get_test_cases() {
'markup' => '<iframe src="http://www.funnyordie.com/embed/5325b03b52" width="640" height="400" frameborder="0"></iframe>',
'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg',
'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
array(
'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>',
'expected' => 'http://t.fod4.com/t/5325b03b52/c480x270_17.jpg',
'expected_hash' => '5aafa4a5f27bd4aead574db38a9e8b2b',
'name' => __( 'Flash Embed', 'video-thumbnails' )
'name' => esc_html__( 'Flash Embed', 'video-thumbnails' )
),
);
}

}

?>
10 changes: 4 additions & 6 deletions php/providers/class-googledrive-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,29 +83,27 @@ public static function get_test_cases() {
'markup' => '<iframe src="https://docs.google.com/file/d/0B2tG5YeQL99ZUHNja3l6am9jSGM/preview?pli=1" width="640" height="385"></iframe>',
'expected' => 'https://lh3.googleusercontent.com/QL3d7Wh7V_qcXnMpXT6bio77RS0veyCZZ0zQbMX6gd-qH7aeIXBkXlcSJVDEyftiiA=s480',
'expected_hash' => '3bc674d8d77b342e633ab9e93e345462',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
array(
'markup' => '<iframe height="385" src="https://docs.google.com/a/svpanthers.org/file/d/0BxQsabDaO6USYUgxSUJ3T0ZBa3M/preview" width="100%"></iframe>',
'expected' => 'https://lh6.googleusercontent.com/WeOdCsaplJ3am25To1uLZiVYkyrilAQ5rxzhjnyyFc5GAF4QeCF1eq3EMpbP7O5dFg=s480',
'expected_hash' => 'f120755bbd1d35e381cb84a829ac0dfa',
'name' => __( 'iFrame Embed (Apps account)', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed (Apps account)', 'video-thumbnails' )
),
array(
'markup' => '<object width="500" height="385" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="https://video.google.com/get_player?docid=0B92WKFCDHyg9NTRqYTFjVkZmNlk&amp;ps=docs&amp;partnerid=30&amp;cc_load_policy=1" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><embed width="500" height="385" type="application/x-shockwave-flash" src="https://video.google.com/get_player?docid=0B92WKFCDHyg9NTRqYTFjVkZmNlk&amp;ps=docs&amp;partnerid=30&amp;cc_load_policy=1" allowFullScreen="true" allowScriptAccess="always" allowfullscreen="true" allowscriptaccess="always" /></object>',
'expected' => 'https://lh3.googleusercontent.com/U_lqaX1o7E9iU75XwCrHZ4pdSi-Vch2F_GK5Ib7WAxgwKTvTl0kMHXm2GxKo1Pcp3Q=s480',
'expected_hash' => '31cf8e05f981c1beb6e04823ad54d267',
'name' => __( 'Flash Embed', 'video-thumbnails' )
'name' => esc_html__( 'Flash Embed', 'video-thumbnails' )
),
array(
'markup' => '<object style="" id="" data="https://youtube.com/get_player?el=leaf" wmode="opaque" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" height="720px" width="1280px"><param value="true" name="allowFullScreen"><param value="always" name="allowscriptaccess"><param value="opaque" name="wmode"><param value="allow_embed=0&partnerid=30&autoplay=1&showinfo=0&docid=0B9VJd4kStxIVellHZEdXdmdSamM&el=leaf" name="flashvars"></object>',
'expected' => 'https://lh5.googleusercontent.com/mHn5gESachhZHi-kbPCRbR6RVXZm3bR7oNNXL97LyYjpzV3Eqty71J2Waw0DPnXKKw=s480',
'expected_hash' => '2d0ad4881e4b38de0510a103d2f40dd1',
'name' => __( 'Flash Embed (YouTube player)', 'video-thumbnails' )
'name' => esc_html__( 'Flash Embed (YouTube player)', 'video-thumbnails' )
),
);
}

}

?>
4 changes: 1 addition & 3 deletions php/providers/class-kaltura-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,9 @@ public static function get_test_cases() {
array(
'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>',
'expected' => 'http://example.com/thumbnail.jpg',
'name' => __( 'Auto Embed', 'video-thumbnails' )
'name' => esc_html__( 'Auto Embed', 'video-thumbnails' )
),
);
}

}

?>
4 changes: 1 addition & 3 deletions php/providers/class-livestream-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ public static function get_test_cases() {
'markup' => '<iframe width="560" height="340" src="http://cdn.livestream.com/embed/WFMZ_Traffic?layout=4&amp;height=340&amp;width=560&amp;autoplay=false" style="border:0;outline:0" frameborder="0" scrolling="no"></iframe>',
'expected' => 'http://thumbnail.api.livestream.com/thumbnail?name=WFMZ_Traffic',
'expected_hash' => '1be02799b2fab7a4749b2187f7687412',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
);
}

}

?>
4 changes: 1 addition & 3 deletions php/providers/class-metacafe-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ public static function get_test_cases() {
'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>',
'expected' => 'http://s4.mcstatic.com/thumb/8456223/22479418/4/catalog_item5/0/1/men_in_black_3_trailer_2.jpg',
'expected_hash' => '977187bfb00df55b39724d7de284f617',
'name' => __( 'Flash Embed', 'video-thumbnails' )
'name' => esc_html__( 'Flash Embed', 'video-thumbnails' )
),
);
}

}

?>
6 changes: 2 additions & 4 deletions php/providers/class-mpora-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ public static function get_test_cases() {
'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>',
'expected' => 'http://ugc4.mporatrons.com/thumbs/wEr2CBooV_640x360_0000.jpg',
'expected_hash' => '95075bd4941251ebecbab3b436a90c49',
'name' => __( 'Flash Embed', 'video-thumbnails' )
'name' => esc_html__( 'Flash Embed', 'video-thumbnails' )
),
array(
'markup' => '<iframe width="640" height="360" src="http://mpora.com/videos/AAdfegovdop0/embed" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
'expected' => 'http://ugc4.mporatrons.com/thumbs/AAdfegovdop0_640x360_0000.jpg',
'expected_hash' => '45db22a2ba5ef20163f52ba562b89259',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
);
}

}

?>
6 changes: 2 additions & 4 deletions php/providers/class-rutube-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,15 @@ public static function get_test_cases() {
'markup' => 'http://rutube.ru/video/ca8607cd4f7ef28516e043dde0068564/',
'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg',
'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354',
'name' => __( 'Video URL', 'video-thumbnails' )
'name' => esc_html__( 'Video URL', 'video-thumbnails' )
),
array(
'markup' => '<iframe width="720" height="405" src="//rutube.ru/video/embed/6608735" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>',
'expected' => 'http://pic.rutube.ru/video/3a/c8/3ac8c1ded16501002d20fa3ba3ed3d61.jpg',
'expected_hash' => '85ad79c118ee82c7c2a756ba29a96354',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
);
}

}

?>
4 changes: 1 addition & 3 deletions php/providers/class-sapo-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ public static function get_test_cases() {
'markup' => '<iframe src="http://rd3.videos.sapo.pt/playhtml?file=http://rd3.videos.sapo.pt/ddACsFSuDEZZRWfNHTTy/mov/1" frameborder="0" scrolling="no" width="640" height="360" webkitallowfullscreen mozallowfullscreen allowfullscreen ></iframe>',
'expected' => 'http://cache02.stormap.sapo.pt/vidstore14/thumbnais/e9/08/37/7038489_l5VMt.jpg',
'expected_hash' => 'd8a74c3d4e054263a37abe9ceed782fd',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
);
}

}

?>
6 changes: 2 additions & 4 deletions php/providers/class-ted-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ public static function get_test_cases() {
'markup' => '<iframe src="http://embed.ted.com/talks/kitra_cahana_stories_of_the_homeless_and_hidden.html" width="640" height="360" frameborder="0" scrolling="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
'expected' => 'http://images.ted.com/images/ted/341053090f8bac8c324c75be3114b673b4355e8a_480x360.jpg?lang=en',
'expected_hash' => 'f2a5f6af49e841b4f9c7b95d6ca0372a',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
array(
'markup' => '<iframe src="https://embed-ssl.ted.com/talks/lang/fr-ca/shimpei_takahashi_play_this_game_to_come_up_with_original_ideas.html" width="640" height="360" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen"></iframe>',
'expected' => 'http://images.ted.com/images/ted/b1f1183311cda4df9e1b65f2b363e0b806bff914_480x360.jpg?lang=en',
'expected_hash' => 'ff47c99c9eb95e3d6c4b986b18991f22',
'name' => __( 'Custom Language', 'video-thumbnails' )
'name' => esc_html__( 'Custom Language', 'video-thumbnails' )
),
);
}

}

?>
4 changes: 1 addition & 3 deletions php/providers/class-tudou-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ public static function get_test_cases() {
'markup' => '<iframe src="http://www.tudou.com/programs/view/html5embed.action?type=1&code=V-TeNdhKVCA&lcode=eNoG-G9OkrQ&resourceId=0_06_05_99" allowtransparency="true" scrolling="no" border="0" frameborder="0" style="width:480px;height:400px;"></iframe>',
'expected' => 'http://g3.tdimg.com/83fedbc41cf9055dce9182a0c07da601/w_2.jpg',
'expected_hash' => '3a5e656f8c302ae5b23665f22d296ae1',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
'name' => esc_html__( 'iFrame Embed', 'video-thumbnails' )
),
);
}

}

?>
Loading