From 8500dbd25554b4c2a5c92b0c8cd86a72b71a9864 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Sat, 25 Jul 2015 18:33:41 +0100 Subject: [PATCH] [auto] Plugin: video-sidebar-widgets 5.8 --- .../class-postmetavideowidget.php | 2 +- .../class-randomvideosidebarwidget.php | 76 ++++++--- .../helper-functions.php | 158 +++++++++++++----- .../plugins/video-sidebar-widgets/readme.txt | 13 +- .../video-sidebar-widgets.php | 2 +- .../vsw_admin_settings.php | 1 - .../vsw_tinymce/vsw_dialog.htm | 4 +- 7 files changed, 179 insertions(+), 77 deletions(-) diff --git a/wp-content/plugins/video-sidebar-widgets/class-postmetavideowidget.php b/wp-content/plugins/video-sidebar-widgets/class-postmetavideowidget.php index 440f0ee58..3d11c65a8 100644 --- a/wp-content/plugins/video-sidebar-widgets/class-postmetavideowidget.php +++ b/wp-content/plugins/video-sidebar-widgets/class-postmetavideowidget.php @@ -293,7 +293,7 @@ function vsw_save_postdata( $post_id ){ // verify this came from the our screen and with proper authorization, // because save_post can be triggered at other times - if ( !wp_verify_nonce( $_POST['vsw_noncename'], plugin_basename( __FILE__ ) ) ) + if ( @!wp_verify_nonce( $_POST['vsw_noncename'], plugin_basename( __FILE__ ) ) ) return; diff --git a/wp-content/plugins/video-sidebar-widgets/class-randomvideosidebarwidget.php b/wp-content/plugins/video-sidebar-widgets/class-randomvideosidebarwidget.php index b5d76d8df..db8bb25b4 100644 --- a/wp-content/plugins/video-sidebar-widgets/class-randomvideosidebarwidget.php +++ b/wp-content/plugins/video-sidebar-widgets/class-randomvideosidebarwidget.php @@ -8,7 +8,7 @@ class RandomVideoSidebarWidget extends WP_Widget { function RandomVideoSidebarWidget() { $widget_ops = array( 'classname' => 'randomvideosidebar', 'description' => __('A Random Video Widget. Randomly selects 1 of the 5 preset videos for display', 'randomvideosidebar') ); -$control_ops = array( 'width' => 705, 'height' => 600, 'id_base' => 'randomvideosidebar' ); +$control_ops = array( 'width' => 850, 'height' => 700, 'id_base' => 'randomvideosidebar' ); $this->WP_Widget( 'randomvideosidebar', __('Random Video Sidebar Widget', 'randomvideosidebar'), $widget_ops, $control_ops ); } @@ -102,7 +102,8 @@ extract( $args ); $rv_flashvar2 = ""; $rv_cap = ""; break; - + + /** @since 5.8 we are not using this anymore.. case 'YouTube': //Youtube changed API. //Now needs to add a ? in embed url before the variables. @@ -118,7 +119,7 @@ extract( $args ); $rv_flashvar2 = ""; $rv_cap = $Embed_cap; break; - + **/ case 'MySpace': $rv_value = "http://mediaservices.myspace.com/services/media/embed.aspx/m=$Embed_id,t=1,mt=video,ap=$RV_autoplay"; $rv_flashvar = ""; @@ -227,22 +228,41 @@ extract( $args ); } - - - - echo "\n<object width=\"$RV_width\" height=\"$RV_height\">\n"; - echo $rv_flashvar; - echo "<param name=\"allowfullscreen\" value=\"true\" />\n"; - echo "<param name=\"allowscriptaccess\" value=\"always\" />\n"; - echo "<param name=\"movie\" value=\"$rv_value\" />\n"; - echo "<param name=\"wmode\" value=\"transparent\">\n"; - echo "<embed src=\"$rv_value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" "; - echo "allowfullscreen=\"true\" allowscriptaccess=\"always\" "; - echo $rv_flashvar2; - echo "width=\"$RV_width\" height=\"$RV_height\">\n"; - echo "</embed>\n"; - echo "</object>\n\n"; - if(!empty($rv_cap)){echo "<p class=\"VideoCaption\">$rv_cap</p>\n\n";}; + + + if($select_source == 'YouTube'): + /*This is the latest embed iframe code format, we use it now. + /*<iframe width="560" height="315" src="//www.youtube.com/embed/OMOVFvcNfvE" frameborder="0" allowfullscreen></iframe> + */ + echo "<iframe width='$RV_width' height='$RV_height' src='//www.youtube.com/embed/$Embed_id?autoplay=$RV_autoplay&loop=0&rel=0' frameborder='0' allowfullscreen></iframe>"; + if(!empty($Embed_cap)){echo "<p class=\"VideoCaption\">$Embed_cap</p>\n\n";}; + + + elseif($select_source == 'Vimeo'): + /*This is the latest embed iframe code format, we use it now. + *<iframe src="//player.vimeo.com/video/113758779" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> + */ + echo "<br/><iframe src='//player.vimeo.com/video/$Embed_id?autoplay=$RV_autoplay' width='$RV_width' height='$RV_height' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"; + if(!empty($Embed_cap)){echo "<p class=\"VideoCaption\">$Embed_cap</p>\n\n";}; + + else: + + + echo "\n<object width=\"$RV_width\" height=\"$RV_height\">\n"; + echo $rv_flashvar; + echo "<param name=\"allowfullscreen\" value=\"true\" />\n"; + echo "<param name=\"allowscriptaccess\" value=\"always\" />\n"; + echo "<param name=\"movie\" value=\"$rv_value\" />\n"; + echo "<param name=\"wmode\" value=\"transparent\">\n"; + echo "<embed src=\"$rv_value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" "; + echo "allowfullscreen=\"true\" allowscriptaccess=\"always\" "; + echo $rv_flashvar2; + echo "width=\"$RV_width\" height=\"$RV_height\">\n"; + echo "</embed>\n"; + echo "</object>\n\n"; + if(!empty($rv_cap)){echo "<p class=\"VideoCaption\">$rv_cap</p>\n\n";}; + + endif; echo $after_widget; @@ -299,8 +319,10 @@ $instance = wp_parse_args( (array) $instance, array( 'RV_title' => '', 'RV_width ?> -<div style="width:220px;height:350px;float:left;margin:0px 15px 20px 5px"> +<div style="width:400px;height:400px;float:left;margin:0px 15px 20px 5px"> <h2>General Settings</h2> +<br/> +<p class='description' style='padding-left:0px !important'>Please fill up settings before clicking on save to display video.</p> <!--Title --> <p> <label for="<?php echo $this->get_field_id('RV_title'); ?>">Widget Title:</label> @@ -321,16 +343,16 @@ $instance = wp_parse_args( (array) $instance, array( 'RV_title' => '', 'RV_width <!--auto play --> <p> -<label for="<?php echo $this->get_field_id( 'RV_autoplay' ); ?>">Auto Play:</label> +<label for="<?php echo $this->get_field_id( 'RV_autoplay' ); ?>">Auto Play: </label> <select id="<?php echo $this->get_field_id( 'RV_autoplay' );?>" name="<?php echo $this->get_field_name( 'RV_autoplay' );?>" class="widefat" style="width:100%;">'; <option value='1' <?php if($instance['RV_autoplay'] == '1'){echo 'selected="selected"';}?>>Yes</option> <option value='0' <?php if($instance['RV_autoplay'] == '0'){echo 'selected="selected"';}?>>No</option> </select> </p> -<p>Please fill up settings before clicking on save to display video.</p> +<p class='description' style='padding-left:0px !important'>Autoplay is for front end only, does not autoplay in admin. Applies to all widgets.</p> </div> -<div style="width:220px;height:350px;float:left;margin:0px 15px 20px 0px"> +<div style="width:400px;height:500px;float:left;margin:0px 15px 20px 0px"> <!--first video setting --> <h2>Video 1</h2> <?php @@ -374,7 +396,7 @@ $instance = wp_parse_args( (array) $instance, array( 'RV_title' => '', 'RV_width <input class="widefat" id="<?php echo $this->get_field_id('RV_cap1'); ?>" name="<?php echo $this->get_field_name('RV_cap1'); ?>" type="text" value="<?php echo $instance['RV_cap1']; ?>" /></p> </div> -<div style="width:220px;height:350px;float:left;margin:0px 15px 20px 0px"> +<div style="width:400px;height:500px;float:left;margin:0px 15px 20px 0px"> <!--second video setting --> <h2>Video 2</h2> @@ -421,7 +443,7 @@ $instance = wp_parse_args( (array) $instance, array( 'RV_title' => '', 'RV_width <input class="widefat" id="<?php echo $this->get_field_id('RV_cap2'); ?>" name="<?php echo $this->get_field_name('RV_cap2'); ?>" type="text" value="<?php echo $instance['RV_cap2']; ?>" /></p> </div> -<div style="width:220px;height:350px;float:left;margin:0px 15px 20px 0px"> +<div style="width:400px;height:500px;float:left;margin:0px 15px 20px 0px"> <!--third video setting --> <h2>Video 3</h2> @@ -467,7 +489,7 @@ $instance = wp_parse_args( (array) $instance, array( 'RV_title' => '', 'RV_width </div> -<div style="width:220px;height:350px;float:left;margin:0px 15px 20px 5px"> +<div style="width:400px;height:500px;float:left;margin:0px 15px 20px 5px"> <!--fourth video setting --> <h2>Video 4</h2> @@ -512,7 +534,7 @@ $instance = wp_parse_args( (array) $instance, array( 'RV_title' => '', 'RV_width <input class="widefat" id="<?php echo $this->get_field_id('RV_cap4'); ?>" name="<?php echo $this->get_field_name('RV_cap4'); ?>" type="text" value="<?php echo $instance['RV_cap4']; ?>" /></p> </div> -<div style="width:220px;height:350px;float:left;margin:0px 15px 20px 0px"> +<div style="width:400px;height:500px;float:left;margin:0px 15px 20px 0px"> <!--fifth video setting --> <h2>Video 5</h2> diff --git a/wp-content/plugins/video-sidebar-widgets/helper-functions.php b/wp-content/plugins/video-sidebar-widgets/helper-functions.php index df0aa8fbb..fde86a84f 100644 --- a/wp-content/plugins/video-sidebar-widgets/helper-functions.php +++ b/wp-content/plugins/video-sidebar-widgets/helper-functions.php @@ -31,7 +31,8 @@ if(!empty($source)): //do this only if video source not empty, to fix widget pag $flashvar = ""; $flashvar2 = ""; break; - + + /** @since 5.8 we are not using this anymore.. it been quite a while that I made an update! case 'YouTube': //Youtube changed API. //previous modification in version 5.4 does not work for some user, hope this works for everyone. @@ -46,6 +47,7 @@ if(!empty($source)): //do this only if video source not empty, to fix widget pag $flashvar = ""; $flashvar2 = ""; break; + **/ case 'MySpace': $value = "http://mediaservices.myspace.com/services/media/embed.aspx/m=$v_id2,t=1,mt=video,ap=$v_autoplay2"; @@ -142,52 +144,122 @@ if(!empty($source)): //do this only if video source not empty, to fix widget pag } if($shortcode=="true"){ - //added in version 2.3 - //return instead of echo video on blog using shortcode - $vsw_code = "\n<object width=\"$v_width2\" height=\"$v_height2\">\n"; - $vsw_code .= $flashvar; - $vsw_code .= "<param name=\"allowfullscreen\" value=\"true\" />\n"; - $vsw_code .= "<param name=\"allowscriptaccess\" value=\"always\" />\n"; - $vsw_code .= "<param name=\"movie\" value=\"$value\" />\n"; - $vsw_code .= "<param name=\"wmode\" value=\"transparent\">\n"; - $vsw_code .= "<embed src=\"$value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" "; - $vsw_code .= "allowfullscreen=\"true\" allowscriptaccess=\"always\" "; - $vsw_code .= $flashvar2; - $vsw_code .= "width=\"$v_width2\" height=\"$v_height2\">\n"; - $vsw_code .= "</embed>\n"; - $vsw_code .= "</object>\n\n"; - return $vsw_code; + + if($source == 'YouTube'): + /*This is the latest embed iframe code format, we use it now. + /*<iframe width="560" height="315" src="//www.youtube.com/embed/OMOVFvcNfvE" frameborder="0" allowfullscreen></iframe> + */ + return "<iframe width='$v_width2' height='$v_height2' src='//www.youtube.com/embed/$v_id2?autoplay=$v_autoplay2&loop=0&rel=0' frameborder='0' allowfullscreen></iframe>"; + + + elseif($source == 'Vimeo'): + /*This is the latest embed iframe code format, we use it now. + *<iframe src="//player.vimeo.com/video/113758779" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> + */ + return "<iframe src='//player.vimeo.com/video/$v_id2?autoplay=$v_autoplay2' width='$v_width2' height='$v_height2' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"; + + + else: + + //added in version 2.3 + //return instead of echo video on blog using shortcode + $vsw_code = "\n<object width=\"$v_width2\" height=\"$v_height2\">\n"; + $vsw_code .= $flashvar; + $vsw_code .= "<param name=\"allowfullscreen\" value=\"true\" />\n"; + $vsw_code .= "<param name=\"allowscriptaccess\" value=\"always\" />\n"; + $vsw_code .= "<param name=\"movie\" value=\"$value\" />\n"; + $vsw_code .= "<param name=\"wmode\" value=\"transparent\">\n"; + $vsw_code .= "<embed src=\"$value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" "; + $vsw_code .= "allowfullscreen=\"true\" allowscriptaccess=\"always\" "; + $vsw_code .= $flashvar2; + $vsw_code .= "width=\"$v_width2\" height=\"$v_height2\">\n"; + $vsw_code .= "</embed>\n"; + $vsw_code .= "</object>\n\n"; + return $vsw_code; + + endif; + } elseif($admin=="true"){ - // echo video in admin - echo "\n<object width=\"212\" height=\"172\">\n"; - echo $flashvar; - echo "<param name=\"allowfullscreen\" value=\"true\" />\n"; - echo "<param name=\"allowscriptaccess\" value=\"always\" />\n"; - echo "<param name=\"movie\" value=\"$value\" />\n"; - echo "<param name=\"wmode\" value=\"transparent\">\n"; - echo "<embed src=\"$value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" "; - echo "allowfullscreen=\"true\" allowscriptaccess=\"always\" "; - echo $flashvar2; - echo "width=\"212\" height=\"172\">\n"; - echo "</embed>\n"; - echo "</object>\n\n"; + + //determine admin video width. + global $current_screen; + if($current_screen->id == 'post' || $current_screen->id == 'page'){ + $admin_video_width = '250'; + $admin_video_height = '141'; + }else{ + $admin_video_width = '400'; + $admin_video_height = '225'; + } + + + if($source == 'YouTube'): + /*This is the latest embed iframe code format, we use it now. + /*<iframe width="560" height="315" src="//www.youtube.com/embed/OMOVFvcNfvE" frameborder="0" allowfullscreen></iframe> + */ + echo "<br/><iframe width='$admin_video_width' height='$admin_video_height' src='//www.youtube.com/embed/$v_id2?autoplay=0&loop=0&rel=0' frameborder='0' allowfullscreen></iframe>"; + + + elseif($source == 'Vimeo'): + /*This is the latest embed iframe code format, we use it now. + *<iframe src="//player.vimeo.com/video/113758779" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> + */ + echo "<br/><iframe src='//player.vimeo.com/video/$v_id2?autoplay=0' width='$admin_video_width' height='$admin_video_height' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"; + + + else: + + // echo video in admin + echo "<br/><object width=\"$admin_video_width\" height=\"$admin_video_height\">\n"; + echo $flashvar; + echo "<param name=\"allowfullscreen\" value=\"true\" />\n"; + echo "<param name=\"allowscriptaccess\" value=\"always\" />\n"; + echo "<param name=\"movie\" value=\"$value\" />\n"; + echo "<param name=\"wmode\" value=\"transparent\">\n"; + echo "<embed src=\"$value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" "; + echo "allowfullscreen=\"true\" allowscriptaccess=\"always\" "; + echo $flashvar2; + echo "width=\"$admin_video_width\" height=\"$admin_video_height\">\n"; + echo "</embed>\n"; + echo "</object>\n\n"; + + endif; }else{ - - // echo video on blog - echo "\n<object width=\"$v_width2\" height=\"$v_height2\">\n"; - echo $flashvar; - echo "<param name=\"allowfullscreen\" value=\"true\" />\n"; - echo "<param name=\"allowscriptaccess\" value=\"always\" />\n"; - echo "<param name=\"movie\" value=\"$value\" />\n"; - echo "<param name=\"wmode\" value=\"transparent\">\n"; - echo "<embed src=\"$value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" "; - echo "allowfullscreen=\"true\" allowscriptaccess=\"always\" "; - echo $flashvar2; - echo "width=\"$v_width2\" height=\"$v_height2\">\n"; - echo "</embed>\n"; - echo "</object>\n\n"; + + + if($source == 'YouTube'): + /*This is the latest embed iframe code format, we use it now. + /*<iframe width="560" height="315" src="//www.youtube.com/embed/OMOVFvcNfvE" frameborder="0" allowfullscreen></iframe> + */ + echo "<iframe width='$v_width2' height='$v_height2' src='//www.youtube.com/embed/$v_id2?autoplay=$v_autoplay2&loop=0&rel=0' frameborder='0' allowfullscreen></iframe>"; + + + elseif($source == 'Vimeo'): + /*This is the latest embed iframe code format, we use it now. + *<iframe src="//player.vimeo.com/video/113758779" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> + */ + echo "<iframe src='//player.vimeo.com/video/$v_id2?autoplay=$v_autoplay2' width='$v_width2' height='$v_height2' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"; + + + else: + + // echo video on blog + echo "\n<object width=\"$v_width2\" height=\"$v_height2\">\n"; + echo $flashvar; + echo "<param name=\"allowfullscreen\" value=\"true\" />\n"; + echo "<param name=\"allowscriptaccess\" value=\"always\" />\n"; + echo "<param name=\"movie\" value=\"$value\" />\n"; + echo "<param name=\"wmode\" value=\"transparent\">\n"; + echo "<embed src=\"$value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" "; + echo "allowfullscreen=\"true\" allowscriptaccess=\"always\" "; + echo $flashvar2; + echo "width=\"$v_width2\" height=\"$v_height2\">\n"; + echo "</embed>\n"; + echo "</object>\n\n"; + + endif; + } endif; diff --git a/wp-content/plugins/video-sidebar-widgets/readme.txt b/wp-content/plugins/video-sidebar-widgets/readme.txt index ee9920bbc..a7d5ad667 100644 --- a/wp-content/plugins/video-sidebar-widgets/readme.txt +++ b/wp-content/plugins/video-sidebar-widgets/readme.txt @@ -4,8 +4,8 @@ Donate link: http://denzeldesigns.com/wordpress-plugins/video-sidebar-widgets/ Author link: http://denzeldesigns.com Tags:video, widget, widgets, sidebar, videos, video sidebar widget, video widget, embed video, video embed, video in sidebar, youtube, vimeo, veoh, myspace video, revver, blip tv, tudou, youku, 6.cn, google videos, tangle Requires at least:2.8.1 -Tested up to: 3.9 -Stable tag:5.7 +Tested up to: 4.2 +Stable tag:5.8 == Description == @@ -14,6 +14,15 @@ Stable tag:5.7 == Changelog == + += 5.8 = + +Let YouTube and Vimeo video print iframe embed code, the others remains unchanged. +Now Youtube and Vimeo video plays in iOS. +Use two forward slashes for Youtube and Vimeo video src as shown in their original embed code, therefore should work in both http and https environment. +Some adjustments to admin layout. Thanks to qcdars for the pointers. + + = 5.7 = Added check to random video widget, do not print video caption p tags if user did not enter a video caption. diff --git a/wp-content/plugins/video-sidebar-widgets/video-sidebar-widgets.php b/wp-content/plugins/video-sidebar-widgets/video-sidebar-widgets.php index f329fe109..0f55f8c64 100644 --- a/wp-content/plugins/video-sidebar-widgets/video-sidebar-widgets.php +++ b/wp-content/plugins/video-sidebar-widgets/video-sidebar-widgets.php @@ -2,7 +2,7 @@ /* Plugin Name: Video Sidebar Widgets Plugin URI: http://denzeldesigns.com/wordpress-plugins/video-sidebar-widgets/ -Version: 5.7 +Version: 5.8 Description: Video Sidebar Widgets to display videos such as Vimeo, YouTube, MySpace Videos etc. Now with added shortcode and quicktag to embed video in post and page content. Author: Denzel Chia Author URI: http://denzeldesigns.com/ diff --git a/wp-content/plugins/video-sidebar-widgets/vsw_admin_settings.php b/wp-content/plugins/video-sidebar-widgets/vsw_admin_settings.php index 1543e83d8..0369c2b14 100644 --- a/wp-content/plugins/video-sidebar-widgets/vsw_admin_settings.php +++ b/wp-content/plugins/video-sidebar-widgets/vsw_admin_settings.php @@ -76,7 +76,6 @@ $checked1 = $checked2 = $checked3 = $checked4 = ''; <p> <input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes'); ?>" /> </p> - <p class="description">If you ever need any modifications to the plugin, Please post it on <a href="http://wpquestions.com/affiliates/register/name/denzelchia" target="_blank">WP Questions.</a> Thanks!</p> </div> </form> </div> diff --git a/wp-content/plugins/video-sidebar-widgets/vsw_tinymce/vsw_dialog.htm b/wp-content/plugins/video-sidebar-widgets/vsw_tinymce/vsw_dialog.htm index 58213e80e..d41b8fb71 100644 --- a/wp-content/plugins/video-sidebar-widgets/vsw_tinymce/vsw_dialog.htm +++ b/wp-content/plugins/video-sidebar-widgets/vsw_tinymce/vsw_dialog.htm @@ -22,7 +22,7 @@ html,body,td,th,input,select { <td height="38" colspan="3"><h2>Insert Video ShortCode</h2></td> </tr> <tr> - <td height="30">Video ID</td> + <td height="30" width="180px">Video ID</td> <td height="30" colspan="2"><input id="vsw_id" name="vsw_id" type="text" class="text" style="width:95%" value="" /></td> </tr> <tr> @@ -67,4 +67,4 @@ html,body,td,th,input,select { </table> </form> </body> -</html> +</html> \ No newline at end of file -- GitLab