Plugin Directory

Changeset 1202444

Timestamp:
07/20/2015 05:05:33 PM (9 years ago)
Author:
a.hoereth
Message:

Version 2.2.0

Location:
featured-video-plus
Files:
16 deleted
16 edited
24 copied

Legend:

Unmodified
Added
Removed
  • featured-video-plus/tags/2.2.0/CHANGELOG.md

    r1181823 r1202444  
    11# Changelog #
     2
     3
     4
     5
     6
     7
     8
     9
     10
     11
     12
    213
    314## 2.1.2: 2015-06-16 ##
     
    516
    617## 2.1.1: 2015-06-15 ##
    7 * Fix play and loading featured image overlay for some themes ([*](https://wordpress.org/support/topic/play-icon-missing)).
     18* Fix play and loading featured image overlay for some themes
    819* Fix broken `remove featured image` link. ([*](https://wordpress.org/support/topic/cant-remove-featured-image-2),  [*](https://wordpress.org/support/topic/version-210-conflict-with-wp-featured-image), [*](https://wordpress.org/support/topic/fvp-not-working-after-210-update))
    920
    1021## 2.1.0: 2015-06-11 ##
    1122* Display options are now chained using OR - if one of them holds, the replace mode is used.
    12 * Added `always use replace mode when viewing single posts and pages` option, was implicitly true since 2.0.0. ([*](https://wordpress.org/support/topic/featured-video-overrides-featured-image)).
    13 * Fixed undefined warnings when using `WP_DEBUG` ([*](https://wordpress.org/support/topic/debug-error-16)).
    14 * Fixed double-wrapped .post-thumbnails ([*](https://wordpress.org/support/topic/video-no-longer-appearing)).
     23* Added `always use replace mode when viewing single posts and pages` option, was implicitly true since 2.0.0. ([*](https://wordpress.org/support/topic/featured-video-overrides-featured-image))
     24* Fixed undefined warnings when using `WP_DEBUG`
     25* Fixed double-wrapped .post-thumbnails
    1526* Lazy loading a video no longer breaks other videos. ([*](https://wordpress.org/support/topic/blank-screen-after-the-video-is-played))
    1627
  • featured-video-plus/tags/2.2.0/README.md

    r1181823 r1202444  
    6464
    6565
    66 ## Screenshots ##
    67 
    68 1. A Featured Video in the Twenty Fifteen theme on [yrnxt.com](http://yrnxt.com/wordpress/featured-video-plus).
    69 ![1. A Featured Video in the Twenty Fifteen theme on [yrnxt.com](http://yrnxt.com/wordpress/featured-video-plus).](https://ps.w.org/featured-video-plus/assets/screenshot-1.jpg)
    70 
    71 2. Featured Video and Featured Image boxes on the post edit screen.
    72 ![2. Featured Video and Featured Image boxes on the post edit screen.](https://ps.w.org/featured-video-plus/assets/screenshot-2.jpg)
    73 
    74 3. Featured Video settings on the `Settings -> Media` administration screen.
    75 ![3. Featured Video settings on the `Settings -> Media` administration screen.](https://ps.w.org/featured-video-plus/assets/screenshot-3.jpg)
    76 
    77 
    78 
    79 
  • featured-video-plus/tags/2.2.0/featured-video-plus.php

    r1181823 r1202444  
    44Plugin URI: http://yrnxt.com/wordpress/featured-video-plus/
    55Description: Add Featured Videos to your posts and pages.
    6 Version: 2.1.2
     6Version: 2.
    77Author: Alexander Höreth
    88Author URI: http://yrnxt.com
     
    3333// CONSTANTS
    3434if ( ! defined( 'FVP_VERSION' ) ) {
    35     define( 'FVP_VERSION', '2.1.2' );
     35    define( 'FVP_VERSION', '2.' );
    3636}
    3737
     
    7373}
    7474
     75
    7576// ********************
    7677// PUBLIC API
  • featured-video-plus/tags/2.2.0/js/frontend.js

    r1181823 r1202444  
     1
     2
    13(function($) {
    24  'use strict';
     
    810  var loadBg = 'url(\'' + fvpdata.loadicon + '\')';
    911  var bgState;
     12
    1013
    1114
     
    152155    $('#DOMWindow').css({ backgroundImage: loadBg });
    153156
    154     var $cache = $('#fvp-cache-' + id);
    155 
    156157    // Check if the result is already cached
    157     if (0 === $cache.html().length) {
     158    if () {
    158159      $.post(fvpdata.ajaxurl, {
    159           'action'    : 'fvp_get_embed',
    160           'fvp_nonce' : fvpdata.nonce,
    161           'id'        : id
     160        'action'    : 'fvp_get_embed',
     161        'fvp_nonce' : fvpdata.nonce,
     162        'id'        : id
    162163      }, function(response) {
    163164        if (response.success) {
    164165          // cache the result to not reload when opened again
    165           $cache.html(response.data);
     166          ;
    166167
    167168          $('#DOMWindow').html(response.data);
     
    172173    } else {
    173174      // From cache
    174       $('#DOMWindow').html( $cache.html() );
     175      $('#DOMWindow').html( );
    175176      $(window).trigger('scroll');
    176177    }
     
    178179
    179180
    180   // Initialization after DOM is completly loaded.
    181   $(document).ready(function() {
     181  initFeaturedVideoPlus = function() {
    182182    // remove wrapping anchors
    183183    // doing this twice with a 1 second delay to fix wrapped local video posters
     
    199199    // overlay click handler
    200200    $('.fvp-overlay').click(overlayTrigger);
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
    201214  });
    202215})(jQuery);
  • featured-video-plus/tags/2.2.0/js/frontend.min.js

    r1181823 r1202444  
    1 !function(a){"use strict";function t(){a(".has-post-video a>.featured-video-plus,.has-post-video a>.fvp-dynamic,.has-post-video a>.fvp-overlay,.has-post-video a>.wp-video,.has-post-video a>.wp-video-shortcode").unwrap(),a(".has-post-video .post-thumbnail>.post-thumbnail").removeClass("post-thumbnail"),a("a.post-thumbnail:empty").not(".fvp-dynamic, .fvp-overlay").remove()}function e(){fvpdata.fitvids&&a(".featured-video-plus.fvp-responsive").fitVids({customSelector:["iframe","object","embed"]})}function i(){if(fvpdata.width&&!fvpdata.fitvids){a(".fvp-local .wp-video").css({width:fvpdata.width,height:"auto"});var t=a(".fvp-local .wp-video .wp-video-shortcode");t.attr({width:fvpdata.width,height:fvpdata.width/t.attr("width")*t.attr("heigth")})}}function o(){void 0===r&&[fvpdata.playicon,fvpdata.loadicon].forEach(function(t){a("body").append(a("<img/>",{src:t}).hide())}),r=r===c?s:c,v.css({backgroundImage:r})}function d(t){var e=a(t.currentTarget).children("img");0===e.siblings(".fvp-loader").length?(v.addClass(e.attr("class")).css({height:e.height(),width:e.width(),margin:e.css("margin")}),e.animate({opacity:fvpdata.opacity}).before(v)):r!==s&&(e.animate({opacity:1}),v.remove())}function n(i){i.preventDefault();var d=a(i.currentTarget),n=parseInt(d.attr("data-id"),10);o(),a.post(fvpdata.ajaxurl,{action:"fvp_get_embed",fvp_nonce:fvpdata.nonce,id:n},function(a){if(a.success){var i=d.parent();d.replaceWith(a.data),i.find(".wp-audio-shortcode, .wp-video-shortcode").mediaelementplayer(),e(),t()}o()})}function p(t){t.preventDefault();var e=a(t.currentTarget),o=parseInt(e.attr("data-id"),10);e.openDOMWindow({eventType:null,windowPadding:0,borderSize:0,windowBGColor:"transparent",overlayOpacity:100*fvpdata.opacity,width:"100%",height:"100%"}),a("#DOMWindow").css({backgroundImage:s});var d=a("#fvp-cache-"+o);0===d.html().length?a.post(fvpdata.ajaxurl,{action:"fvp_get_embed",fvp_nonce:fvpdata.nonce,id:o},function(t){t.success&&(d.html(t.data),a("#DOMWindow").html(t.data),i(),a(window).trigger("scroll"))}):(a("#DOMWindow").html(d.html()),a(window).trigger("scroll"))}var r,v=a("<div />").addClass("fvp-loader"),c="url('"+fvpdata.playicon+"')",s="url('"+fvpdata.loadicon+"')";a(document).ready(function(){t(),setTimeout(t,1e3),e(),i(),a(".fvp-overlay, .fvp-dynamic").hover(d,d),o(),a(".fvp-dynamic").click(n),a(".fvp-overlay").click(p)})}(jQuery);
     1)})}(jQuery);
  • featured-video-plus/tags/2.2.0/js/html.js

    r1179150 r1202444  
    6969
    7070      var targetNames = $target.data('names').split('|');
    71       var targetValues = $target.data('values').split('|');
     71      var targetValues = ).split('|');
    7272
    7373      var index = $.inArray($trigger.attr('name'), targetNames);
  • featured-video-plus/tags/2.2.0/js/html.min.js

    r1179150 r1202444  
    1 !function(t){"use strict";var i=function(){var i=t(this),e=i.siblings("[data-hook='"+i.data("hook")+"']");i.hasClass("active")&&e.hasClass("active")||(i.siblings(fvphtml.prefix+"tab-title").removeClass("active"),i.siblings(fvphtml.prefix+"tab-body").slideUp(),i.addClass("active"),e.addClass("active").slideDown())};t(document).ready(function(){for(var e=t(fvphtml.prefix+"tabs"),r=e.length-1;r>=0;r--){var n=t(e[r]),a=n.children(fvphtml.prefix+"tab-title"),s=n.children(fvphtml.prefix+"tab-body");a.first().addClass("active"),s.first().addClass("active"),n.prepend(a),s.filter(":not(.active)").hide(),n.children(fvphtml.prefix+"tab-title").click(i)}})}(jQuery),function(t){"use strict";var i={},e=function(){for(var e=t(this),r=i[e.attr("name")],n=0;n<r.length;n++){var a=t(r[n]),s=a.data("names").split("|"),l=a.data("values").split("|"),o=t.inArray(e.attr("name"),s);if(-1!==o){var c=!0,f=l[o],h="checkbox"!==e.attr("type")||e.prop("checked")?e.val():null;"string"==typeof f&&"!"===f.charAt(0)&&(c=!1,f=f.substr(1)),c&&h!==f||!c&&h===f?a.addClass("hidden"):a.removeClass("hidden")}}};t(document).ready(function(){for(var r=t(fvphtml.prefix+"conditional"),n=0;n<r.length;n++)for(var a=t(r[n]),s=a.data("names").split("|"),l=0;l<s.length;l++){var o=s[l];i.hasOwnProperty(o)||(i[o]=[]),i[o].push(a)}for(var c in i){var f=t("[name='"+c+"']");f.change(e)}})}(jQuery),function(t){"use strict";function i(t){t=t?t:"#fffff",t="#"===t.charAt(0)?t.substr(1):t;var i=parseInt(t.substr(0,2),16),e=parseInt(t.substr(2,2),16),r=parseInt(t.substr(4,2),16),n=(299*i+587*e+114*r)/1e3;return n>=128?"#000":"#fff"}function e(t){return 3===t.length&&"#"!==t.charAt(0)&&(t="#"+t),4===t.length&&"#"===t.charAt(0)&&(t="#"+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)+t.charAt(3)+t.charAt(3)),7===t.length?t:!1}var r,n=function(r,n){var a=t(this),s=n&&n.color?n.color.toString():a.val();s=e(s),a.css({backgroundColor:s?s:"#ffffff",color:i(s)}),s?a.siblings(fvphtml.prefix+"reset").show():a.siblings(fvphtml.prefix+"reset").hide()},a=function(){var i=t(this);r.not(i).iris("hide"),i.iris("show")},s=function(i){i&&i.preventDefault();var e=t(this);""===e.val()&&e.siblings(fvphtml.prefix+"reset").hide()},l=function(i){i&&i.preventDefault(),r.iris("hide"),t(this).siblings(fvphtml.prefix+"colorpicker").val("").each(n)};t(document).ready(function(){r=t(fvphtml.prefix+"colorpicker"),r.iris({change:n}),r.bind("input",n),r.click(a),r.blur(s),r.siblings(fvphtml.prefix+"reset").click(l),r.each(n)})}(jQuery),function(t){"use strict";function i(i){var r=i.title||"",n=i.content||"",a=i.position||{edge:"right",align:"middle"};t(i.target).pointer({pointer_id:i.identifier,content:"<h3>"+r+"</h3><p>"+n+"</p>",position:a,close:e}).pointer("open")}var e=function(){var i=t(this).data("wpPointer").options.pointer_id;t.post(ajaxurl,{pointer:i,action:"dismiss-wp-pointer"})};t(document).ready(function(){for(var t=fvphtml.pointers||[],e=0;e<t.length;e++)i(fvphtml.pointers[e])})}(jQuery),jQuery(document).ready(function(t){"use strict";t(fvphtml.prefix+"help-link, .help-link").click(function(){t("#contextual-help-link").trigger("click")})});
     1!function(t){"use strict";var i=function(){var i=t(this),e=i.siblings("[data-hook='"+i.data("hook")+"']");i.hasClass("active")&&e.hasClass("active")||(i.siblings(fvphtml.prefix+"tab-title").removeClass("active"),i.siblings(fvphtml.prefix+"tab-body").slideUp(),i.addClass("active"),e.addClass("active").slideDown())};t(document).ready(function(){for(var e=t(fvphtml.prefix+"tabs"),r=e.length-1;r>=0;r--){var n=t(e[r]),a=n.children(fvphtml.prefix+"tab-title"),s=n.children(fvphtml.prefix+"tab-body");a.first().addClass("active"),s.first().addClass("active"),n.prepend(a),s.filter(":not(.active)").hide(),n.children(fvphtml.prefix+"tab-title").click(i)}})}(jQuery),function(t){"use strict";var i={},e=function(){for(var e=t(this),r=i[e.attr("name")],n=0;n<r.length;n++){var a=t(r[n]),s=a.data("names").split("|"),l=).split("|"),o=t.inArray(e.attr("name"),s);if(-1!==o){var c=!0,f=l[o],h="checkbox"!==e.attr("type")||e.prop("checked")?e.val():null;"string"==typeof f&&"!"===f.charAt(0)&&(c=!1,f=f.substr(1)),c&&h!==f||!c&&h===f?a.addClass("hidden"):a.removeClass("hidden")}}};t(document).ready(function(){for(var r=t(fvphtml.prefix+"conditional"),n=0;n<r.length;n++)for(var a=t(r[n]),s=a.data("names").split("|"),l=0;l<s.length;l++){var o=s[l];i.hasOwnProperty(o)||(i[o]=[]),i[o].push(a)}for(var c in i){var f=t("[name='"+c+"']");f.change(e)}})}(jQuery),function(t){"use strict";function i(t){t=t?t:"#fffff",t="#"===t.charAt(0)?t.substr(1):t;var i=parseInt(t.substr(0,2),16),e=parseInt(t.substr(2,2),16),r=parseInt(t.substr(4,2),16),n=(299*i+587*e+114*r)/1e3;return n>=128?"#000":"#fff"}function e(t){return 3===t.length&&"#"!==t.charAt(0)&&(t="#"+t),4===t.length&&"#"===t.charAt(0)&&(t="#"+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)+t.charAt(3)+t.charAt(3)),7===t.length?t:!1}var r,n=function(r,n){var a=t(this),s=n&&n.color?n.color.toString():a.val();s=e(s),a.css({backgroundColor:s?s:"#ffffff",color:i(s)}),s?a.siblings(fvphtml.prefix+"reset").show():a.siblings(fvphtml.prefix+"reset").hide()},a=function(){var i=t(this);r.not(i).iris("hide"),i.iris("show")},s=function(i){i&&i.preventDefault();var e=t(this);""===e.val()&&e.siblings(fvphtml.prefix+"reset").hide()},l=function(i){i&&i.preventDefault(),r.iris("hide"),t(this).siblings(fvphtml.prefix+"colorpicker").val("").each(n)};t(document).ready(function(){r=t(fvphtml.prefix+"colorpicker"),r.iris({change:n}),r.bind("input",n),r.click(a),r.blur(s),r.siblings(fvphtml.prefix+"reset").click(l),r.each(n)})}(jQuery),function(t){"use strict";function i(i){var r=i.title||"",n=i.content||"",a=i.position||{edge:"right",align:"middle"};t(i.target).pointer({pointer_id:i.identifier,content:"<h3>"+r+"</h3><p>"+n+"</p>",position:a,close:e}).pointer("open")}var e=function(){var i=t(this).data("wpPointer").options.pointer_id;t.post(ajaxurl,{pointer:i,action:"dismiss-wp-pointer"})};t(document).ready(function(){for(var t=fvphtml.pointers||[],e=0;e<t.length;e++)i(fvphtml.pointers[e])})}(jQuery),jQuery(document).ready(function(t){"use strict";t(fvphtml.prefix+"help-link, .help-link").click(function(){t("#contextual-help-link").trigger("click")})});
  • featured-video-plus/tags/2.2.0/js/post.js

    r1181216 r1202444  
    109109      // new video data
    110110      } else {
     111
     112
     113
     114
    111115        $container
    112116          .css({height: ''})
  • featured-video-plus/tags/2.2.0/js/post.min.js

    r1181216 r1202444  
    1 !function(e){"use strict";function t(t){var i=e("#postimagediv .inside");t=t||i.html(),i.html(t),0<i.find(".fvp-remove-image").length&&(i.find("#remove-post-thumbnail").parent("p").hide(),i.find(".fvp-remove-image").parent("p").show())}function i(e){n(e,!0)}function a(i){i.preventDefault(),r.css({backgroundImage:f}),e.post(ajaxurl,{action:"fvp_remove_img",id:e("#post_ID").val(),fvp_nonce:e("#fvp_nonce").val()},function(e){e.success&&(t(e.data),r.css({backgroundImage:c}))},"json")}function n(i,a){if(i.preventDefault(),a=a||!1,o.val(e.trim(o.val())).trigger("autosize"),s!==o.val()||a){r.css({backgroundImage:f}),s=o.val();var n={action:"fvp_save",id:e("#post_ID").val(),fvp_nonce:e("#fvp_nonce").val(),fvp_video:o.val(),fvp_set_featimg:a};e.post(ajaxurl,n,function(i){if(!i.success)return!1;var a=i.data,n=e(".fvp-current-video");r.css({backgroundImage:c}),"remove"===a.task?n.css({height:n.height()}).html("").animate({height:0}):n.css({height:""}).html(a.video),t(a.img)},"json")}}var o,r,s,c,v=fvpPost,f="url("+v.loading_gif+")";e(document).ready(function(){o=e(".fvp-video"),r=o.siblings(".fvp-video-choose").children(".fvp-media-icon"),s=o.val(),c=r.css("backgroundImage"),o.blur(n),o.autosize().trigger("blur").keypress(function(t){13===t.keyCode&&(t.preventDefault(),e(this).trigger("blur"))}).click(function(){e(this).select()}),e("#postimagediv").on("click",".fvp-set-image",i).on("click",".fvp-remove-image",a),t();var v,f={frame:function(){return this._frame?this._frame:(this._frame=wp.media({title:v.data("title"),library:{type:"video"},button:{text:v.data("button")},multiple:!1}),this._frame.on("open",this.updateFrame).state("library").on("select",this.select),this._frame)},select:function(){var t=this.get("selection"),i="url",a=v.data("target");e(a).val(t.pluck(i)).change().trigger("blur")},updateFrame:function(){},init:function(){e("#wpbody").on("click",".fvp-video-choose",function(t){t.preventDefault(),v=e(this).closest(".fvp-input-wrapper"),f.frame().open()})}};f.init()})}(jQuery);
     1!function(e){"use strict";function t(t){var i=e("#postimagediv .inside");t=t||i.html(),i.html(t),0<i.find(".fvp-remove-image").length&&(i.find("#remove-post-thumbnail").parent("p").hide(),i.find(".fvp-remove-image").parent("p").show())}function i(e){n(e,!0)}function a(i){i.preventDefault(),r.css({backgroundImage:f}),e.post(ajaxurl,{action:"fvp_remove_img",id:e("#post_ID").val(),fvp_nonce:e("#fvp_nonce").val()},function(e){e.success&&(t(e.data),r.css({backgroundImage:c}))},"json")}function n(i,a){if(i.preventDefault(),a=a||!1,o.val(e.trim(o.val())).trigger("autosize"),s!==o.val()||a){r.css({backgroundImage:f}),s=o.val();var n={action:"fvp_save",id:e("#post_ID").val(),fvp_nonce:e("#fvp_nonce").val(),fvp_video:o.val(),fvp_set_featimg:a};e.post(ajaxurl,n,function(i){if(!i.success)return!1;var a=i.data,n=e(".fvp-current-video");r.css({backgroundImage:c}),"remove"===a.task?n.css({height:n.height()}).html("").animate({height:0}):),t(a.img)},"json")}}var o,r,s,c,v=fvpPost,f="url("+v.loading_gif+")";e(document).ready(function(){o=e(".fvp-video"),r=o.siblings(".fvp-video-choose").children(".fvp-media-icon"),s=o.val(),c=r.css("backgroundImage"),o.blur(n),o.autosize().trigger("blur").keypress(function(t){13===t.keyCode&&(t.preventDefault(),e(this).trigger("blur"))}).click(function(){e(this).select()}),e("#postimagediv").on("click",".fvp-set-image",i).on("click",".fvp-remove-image",a),t();var v,f={frame:function(){return this._frame?this._frame:(this._frame=wp.media({title:v.data("title"),library:{type:"video"},button:{text:v.data("button")},multiple:!1}),this._frame.on("open",this.updateFrame).state("library").on("select",this.select),this._frame)},select:function(){var t=this.get("selection"),i="url",a=v.data("target");e(a).val(t.pluck(i)).change().trigger("blur")},updateFrame:function(){},init:function(){e("#wpbody").on("click",".fvp-video-choose",function(t){t.preventDefault(),v=e(this).closest(".fvp-input-wrapper"),f.frame().open()})}};f.init()})}(jQuery);
  • featured-video-plus/tags/2.2.0/php/class-backend.php

    r1181216 r1202444  
    330330        if ( ! empty( $meta['full'] ) && empty( $url ) ) {
    331331            delete_post_meta( $post['id'], '_fvp_video' );
    332             $this->delete_featured_image( $post['id'], $meta );
     332            if ( get_post_thumbnail_id( $post['id'] ) == $meta['img'] ) {
     333                $this->delete_featured_image( $post['id'], $meta );
     334            }
    333335            return false;
    334336        }
     
    403405                'description' => ! empty( $raw->description )   ? $raw->description : null,
    404406                'img_url'     => ! empty( $raw->thumbnail_url ) ? $raw->thumbnail_url : null,
    405                 'filename'    => ! empty( $raw->title ) ? sanitize_file_name( $raw->title ) : null,
    406             );
     407                'filename'    => ! empty( $raw->title ) ? $raw->title : null,
     408            );
     409
     410            switch ( $provider ) {
     411                case 'dailymotion':
     412                    $data['id'] = $this->oembed->get_video_id( $url );
     413                    $img_url = $this->oembed->get_thumbnail_url( $provider, $data['id'] );
     414                    if ( false !== $img_url ) {
     415                        $data['img_url'] = $img_url;
     416                    }
     417                    break;
     418            }
    407419        }
    408420
     
    448460
    449461        if ( empty( $img ) ) {
    450             $file = array(
    451               'name' => basename( $data['img_url'] ),
    452             );
    453 
    454             // Get external image
    455             $file['tmp_name'] = download_url( $data['img_url'] );
    456             if ( is_wp_error( $file['tmp_name'] ) ) {
    457                 return false;
     462            $file = array();
     463
     464            // Handle YouTube max res image
     465            if ( false !== strpos( $data['img_url'], 'hqdefault' ) ) {
     466                $file['tmp_name'] = download_url( str_replace(
     467                    'hqdefault',
     468                    'maxresdefault',
     469                    $data['img_url']
     470                ) );
    458471            }
    459472
     473
     474
     475
     476
     477
     478
     479
     480
    460481            // Insert into media library
    461             $url_type = image_type_to_extension(
    462                 exif_imagetype( $file['tmp_name'] ),
     482            $type = image_type_to_extension(
     483                type( $file['tmp_name'] ),
    463484                false
    464485            );
    465             $file['name'] = basename( $data['img_url'] . '.' . $url_type );
     486            $title = ! empty( $data['title'] ) ?
     487                $data['title'] : basename( $data['img_url'], $type );
     488            $file['name'] = sanitize_file_name( $title . '.' . $type );
    466489            $img = media_handle_sideload( $file, $post_id );
    467490
     
    489512     */
    490513    private function delete_featured_image( $post_id, $meta ) {
     514
     515
     516
     517
     518
    491519        if ( empty( $meta['img'] ) ) {
    492520            return false;
    493521        }
    494 
    495         // Unset featured image if it is from this video
    496         delete_post_meta( $post_id, '_thumbnail_id', $meta['img'] );
    497522
    498523        // Check if other posts use the image, if not we can delete it completely
     
    740765
    741766
     767
     768
     769
     770
     771
     772
     773
     774
     775
     776
     777
     778
     779
     780
     781
     782
     783
     784
     785
    742786}
  • featured-video-plus/tags/2.2.0/php/class-main.php

    r1179150 r1202444  
    4444
    4545        // Autoplay option. Suppressed when viewing admin.
    46         $general['autoplay'] =
    47             ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ! is_admin() ) &&
    48             ! empty( $general['autoplay'] ) && $general['autoplay'] ? '1' : null;
     46        $general['autoplay'] = self::parse_autoplay_options($options) ? true : null;
    4947
    5048        // Responsive scaling option. Not used when viewing the admin screen.
     
    8785
    8886            case 'raw':
    89                 $embed = $meta['full'];
     87                $embed = ;
    9088                break;
    9189
     
    190188    }
    191189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
    192232
    193233    /**
  • featured-video-plus/tags/2.2.0/php/class-oembed.php

    r1172119 r1202444  
    257257
    258258        return $provider;
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
     271
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
     282
     283
     284
     285
     286
     287
     288
     289
     290
     291
     292
     293
     294
     295
     296
     297
     298
     299
     300
     301
     302
     303
     304
     305
     306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
    259317    }
    260318
  • featured-video-plus/tags/2.2.0/php/class-settings.php

    r1179150 r1202444  
    334334    public function arguments() {
    335335        $options     = get_option( 'fvp-settings' );
     336
    336337        $args        = ! empty( $options['default_args'] ) ? $options['default_args'] : array();
    337338        $vimeo       = ! empty( $args['vimeo'] )       ? $args['vimeo'] : array();
     
    350351                    'fvp-settings[default_args][general]',
    351352                    array(
    352                         'autoplay' => esc_html__( 'Autoplay', 'featured-video-plus' ),
    353                         'loop'     => esc_html__( 'Loop', 'featured-video-plus' )
     353                        'loop'     => esc_html__( 'Loop', 'featured-video-plus' ),
    354354                    ),
    355355                    ! empty( $args['general'] ) ? $args['general'] : array()
    356356                ),
     357
     358
     359
     360
     361
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
     372
     373
     374
     375
    357376            ),
    358377
     
    402421                        ),
    403422                        'modestbranding' => esc_html__( 'Hide YouTube logo', 'featured-video-plus' ),
     423
     424
     425
     426
    404427                        'rel' => array(
    405428                            'value' => '0',
     
    527550                'width'      => $patterns['number'],
    528551            ),
     552
     553
     554
     555
     556
    529557            'default_args' => array(
    530558                'general' => array(
    531                     'autoplay' => $patterns['digit'],
    532                     'loop'     => $patterns['digit'],
     559                    'loop' => $patterns['digit'],
    533560                ),
    534561                'vimeo' => array(
     
    542569                    'color'          => $patterns['word'],
    543570                    'modestbranding' => $patterns['digit'],
     571
    544572                    'fs'             => $patterns['digit'],
    545573                    'rel'            => $patterns['digit'],
  • featured-video-plus/tags/2.2.0/php/inc-upgrade.php

    r1179150 r1202444  
    208208        }
    209209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
    210223
    211224    default:
  • featured-video-plus/tags/2.2.0/readme.txt

    r1181823 r1202444  
    1111Requires at least: 3.7
    1212Tested up to: 4.2.2
    13 Stable tag: 2.1.2
     13Stable tag: 2.
    1414
    1515Add Featured Videos to your posts and pages. Works like magic with most themes which use Featured Images. Local Media, YouTube, Vimeo and many more.
     
    108108== Changelog ==
    109109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
    110121= 2.1.2: 2015-06-16 =
    111122* Fix bug which resulted in missing featured images when a post did not have a featured video. ([*](https://wordpress.org/support/topic/cookie-send-to-you-and-video-yes-image-no), [*](https://wordpress.org/support/topic/version-221-featured-image-not-diplayed))
    112123
    113124= 2.1.1: 2015-06-15 =
    114 * Fix play and loading featured image overlay for some themes ([*](https://wordpress.org/support/topic/play-icon-missing)).
     125* Fix play and loading featured image overlay for some themes
    115126* Fix broken `remove featured image` link. ([*](https://wordpress.org/support/topic/cant-remove-featured-image-2),  [*](https://wordpress.org/support/topic/version-210-conflict-with-wp-featured-image), [*](https://wordpress.org/support/topic/fvp-not-working-after-210-update))
    116127
    117128= 2.1.0: 2015-06-11 =
    118129* Display options are now chained using OR - if one of them holds, the replace mode is used.
    119 * Added `always use replace mode when viewing single posts and pages` option, was implicitly true since 2.0.0. ([*](https://wordpress.org/support/topic/featured-video-overrides-featured-image)).
    120 * Fixed undefined warnings when using `WP_DEBUG` ([*](https://wordpress.org/support/topic/debug-error-16)).
    121 * Fixed double-wrapped .post-thumbnails ([*](https://wordpress.org/support/topic/video-no-longer-appearing)).
     130* Added `always use replace mode when viewing single posts and pages` option, was implicitly true since 2.0.0. ([*](https://wordpress.org/support/topic/featured-video-overrides-featured-image))
     131* Fixed undefined warnings when using `WP_DEBUG`
     132* Fixed double-wrapped .post-thumbnails
    122133* Lazy loading a video no longer breaks other videos. ([*](https://wordpress.org/support/topic/blank-screen-after-the-video-is-played))
    123134
  • featured-video-plus/trunk/CHANGELOG.md

    r1181823 r1202444  
    11# Changelog #
     2
     3
     4
     5
     6
     7
     8
     9
     10
     11
     12
    213
    314## 2.1.2: 2015-06-16 ##
     
    516
    617## 2.1.1: 2015-06-15 ##
    7 * Fix play and loading featured image overlay for some themes ([*](https://wordpress.org/support/topic/play-icon-missing)).
     18* Fix play and loading featured image overlay for some themes
    819* Fix broken `remove featured image` link. ([*](https://wordpress.org/support/topic/cant-remove-featured-image-2),  [*](https://wordpress.org/support/topic/version-210-conflict-with-wp-featured-image), [*](https://wordpress.org/support/topic/fvp-not-working-after-210-update))
    920
    1021## 2.1.0: 2015-06-11 ##
    1122* Display options are now chained using OR - if one of them holds, the replace mode is used.
    12 * Added `always use replace mode when viewing single posts and pages` option, was implicitly true since 2.0.0. ([*](https://wordpress.org/support/topic/featured-video-overrides-featured-image)).
    13 * Fixed undefined warnings when using `WP_DEBUG` ([*](https://wordpress.org/support/topic/debug-error-16)).
    14 * Fixed double-wrapped .post-thumbnails ([*](https://wordpress.org/support/topic/video-no-longer-appearing)).
     23* Added `always use replace mode when viewing single posts and pages` option, was implicitly true since 2.0.0. ([*](https://wordpress.org/support/topic/featured-video-overrides-featured-image))
     24* Fixed undefined warnings when using `WP_DEBUG`
     25* Fixed double-wrapped .post-thumbnails
    1526* Lazy loading a video no longer breaks other videos. ([*](https://wordpress.org/support/topic/blank-screen-after-the-video-is-played))
    1627
  • featured-video-plus/trunk/README.md

    r1181823 r1202444  
    6464
    6565
    66 ## Screenshots ##
    67 
    68 1. A Featured Video in the Twenty Fifteen theme on [yrnxt.com](http://yrnxt.com/wordpress/featured-video-plus).
    69 ![1. A Featured Video in the Twenty Fifteen theme on [yrnxt.com](http://yrnxt.com/wordpress/featured-video-plus).](https://ps.w.org/featured-video-plus/assets/screenshot-1.jpg)
    70 
    71 2. Featured Video and Featured Image boxes on the post edit screen.
    72 ![2. Featured Video and Featured Image boxes on the post edit screen.](https://ps.w.org/featured-video-plus/assets/screenshot-2.jpg)
    73 
    74 3. Featured Video settings on the `Settings -> Media` administration screen.
    75 ![3. Featured Video settings on the `Settings -> Media` administration screen.](https://ps.w.org/featured-video-plus/assets/screenshot-3.jpg)
    76 
    77 
    78 
    79 
  • featured-video-plus/trunk/featured-video-plus.php

    r1181823 r1202444  
    44Plugin URI: http://yrnxt.com/wordpress/featured-video-plus/
    55Description: Add Featured Videos to your posts and pages.
    6 Version: 2.1.2
     6Version: 2.
    77Author: Alexander Höreth
    88Author URI: http://yrnxt.com
     
    3333// CONSTANTS
    3434if ( ! defined( 'FVP_VERSION' ) ) {
    35     define( 'FVP_VERSION', '2.1.2' );
     35    define( 'FVP_VERSION', '2.' );
    3636}
    3737
     
    7373}
    7474
     75
    7576// ********************
    7677// PUBLIC API
  • featured-video-plus/trunk/js/frontend.js

    r1181823 r1202444  
     1
     2
    13(function($) {
    24  'use strict';
     
    810  var loadBg = 'url(\'' + fvpdata.loadicon + '\')';
    911  var bgState;
     12
    1013
    1114
     
    152155    $('#DOMWindow').css({ backgroundImage: loadBg });
    153156
    154     var $cache = $('#fvp-cache-' + id);
    155 
    156157    // Check if the result is already cached
    157     if (0 === $cache.html().length) {
     158    if () {
    158159      $.post(fvpdata.ajaxurl, {
    159           'action'    : 'fvp_get_embed',
    160           'fvp_nonce' : fvpdata.nonce,
    161           'id'        : id
     160        'action'    : 'fvp_get_embed',
     161        'fvp_nonce' : fvpdata.nonce,
     162        'id'        : id
    162163      }, function(response) {
    163164        if (response.success) {
    164165          // cache the result to not reload when opened again
    165           $cache.html(response.data);
     166          ;
    166167
    167168          $('#DOMWindow').html(response.data);
     
    172173    } else {
    173174      // From cache
    174       $('#DOMWindow').html( $cache.html() );
     175      $('#DOMWindow').html( );
    175176      $(window).trigger('scroll');
    176177    }
     
    178179
    179180
    180   // Initialization after DOM is completly loaded.
    181   $(document).ready(function() {
     181  initFeaturedVideoPlus = function() {
    182182    // remove wrapping anchors
    183183    // doing this twice with a 1 second delay to fix wrapped local video posters
     
    199199    // overlay click handler
    200200    $('.fvp-overlay').click(overlayTrigger);
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
    201214  });
    202215})(jQuery);
  • featured-video-plus/trunk/js/frontend.min.js

    r1181823 r1202444  
    1 !function(a){"use strict";function t(){a(".has-post-video a>.featured-video-plus,.has-post-video a>.fvp-dynamic,.has-post-video a>.fvp-overlay,.has-post-video a>.wp-video,.has-post-video a>.wp-video-shortcode").unwrap(),a(".has-post-video .post-thumbnail>.post-thumbnail").removeClass("post-thumbnail"),a("a.post-thumbnail:empty").not(".fvp-dynamic, .fvp-overlay").remove()}function e(){fvpdata.fitvids&&a(".featured-video-plus.fvp-responsive").fitVids({customSelector:["iframe","object","embed"]})}function i(){if(fvpdata.width&&!fvpdata.fitvids){a(".fvp-local .wp-video").css({width:fvpdata.width,height:"auto"});var t=a(".fvp-local .wp-video .wp-video-shortcode");t.attr({width:fvpdata.width,height:fvpdata.width/t.attr("width")*t.attr("heigth")})}}function o(){void 0===r&&[fvpdata.playicon,fvpdata.loadicon].forEach(function(t){a("body").append(a("<img/>",{src:t}).hide())}),r=r===c?s:c,v.css({backgroundImage:r})}function d(t){var e=a(t.currentTarget).children("img");0===e.siblings(".fvp-loader").length?(v.addClass(e.attr("class")).css({height:e.height(),width:e.width(),margin:e.css("margin")}),e.animate({opacity:fvpdata.opacity}).before(v)):r!==s&&(e.animate({opacity:1}),v.remove())}function n(i){i.preventDefault();var d=a(i.currentTarget),n=parseInt(d.attr("data-id"),10);o(),a.post(fvpdata.ajaxurl,{action:"fvp_get_embed",fvp_nonce:fvpdata.nonce,id:n},function(a){if(a.success){var i=d.parent();d.replaceWith(a.data),i.find(".wp-audio-shortcode, .wp-video-shortcode").mediaelementplayer(),e(),t()}o()})}function p(t){t.preventDefault();var e=a(t.currentTarget),o=parseInt(e.attr("data-id"),10);e.openDOMWindow({eventType:null,windowPadding:0,borderSize:0,windowBGColor:"transparent",overlayOpacity:100*fvpdata.opacity,width:"100%",height:"100%"}),a("#DOMWindow").css({backgroundImage:s});var d=a("#fvp-cache-"+o);0===d.html().length?a.post(fvpdata.ajaxurl,{action:"fvp_get_embed",fvp_nonce:fvpdata.nonce,id:o},function(t){t.success&&(d.html(t.data),a("#DOMWindow").html(t.data),i(),a(window).trigger("scroll"))}):(a("#DOMWindow").html(d.html()),a(window).trigger("scroll"))}var r,v=a("<div />").addClass("fvp-loader"),c="url('"+fvpdata.playicon+"')",s="url('"+fvpdata.loadicon+"')";a(document).ready(function(){t(),setTimeout(t,1e3),e(),i(),a(".fvp-overlay, .fvp-dynamic").hover(d,d),o(),a(".fvp-dynamic").click(n),a(".fvp-overlay").click(p)})}(jQuery);
     1)})}(jQuery);
  • featured-video-plus/trunk/js/html.js

    r1179150 r1202444  
    6969
    7070      var targetNames = $target.data('names').split('|');
    71       var targetValues = $target.data('values').split('|');
     71      var targetValues = ).split('|');
    7272
    7373      var index = $.inArray($trigger.attr('name'), targetNames);
  • featured-video-plus/trunk/js/html.min.js

    r1179150 r1202444  
    1 !function(t){"use strict";var i=function(){var i=t(this),e=i.siblings("[data-hook='"+i.data("hook")+"']");i.hasClass("active")&&e.hasClass("active")||(i.siblings(fvphtml.prefix+"tab-title").removeClass("active"),i.siblings(fvphtml.prefix+"tab-body").slideUp(),i.addClass("active"),e.addClass("active").slideDown())};t(document).ready(function(){for(var e=t(fvphtml.prefix+"tabs"),r=e.length-1;r>=0;r--){var n=t(e[r]),a=n.children(fvphtml.prefix+"tab-title"),s=n.children(fvphtml.prefix+"tab-body");a.first().addClass("active"),s.first().addClass("active"),n.prepend(a),s.filter(":not(.active)").hide(),n.children(fvphtml.prefix+"tab-title").click(i)}})}(jQuery),function(t){"use strict";var i={},e=function(){for(var e=t(this),r=i[e.attr("name")],n=0;n<r.length;n++){var a=t(r[n]),s=a.data("names").split("|"),l=a.data("values").split("|"),o=t.inArray(e.attr("name"),s);if(-1!==o){var c=!0,f=l[o],h="checkbox"!==e.attr("type")||e.prop("checked")?e.val():null;"string"==typeof f&&"!"===f.charAt(0)&&(c=!1,f=f.substr(1)),c&&h!==f||!c&&h===f?a.addClass("hidden"):a.removeClass("hidden")}}};t(document).ready(function(){for(var r=t(fvphtml.prefix+"conditional"),n=0;n<r.length;n++)for(var a=t(r[n]),s=a.data("names").split("|"),l=0;l<s.length;l++){var o=s[l];i.hasOwnProperty(o)||(i[o]=[]),i[o].push(a)}for(var c in i){var f=t("[name='"+c+"']");f.change(e)}})}(jQuery),function(t){"use strict";function i(t){t=t?t:"#fffff",t="#"===t.charAt(0)?t.substr(1):t;var i=parseInt(t.substr(0,2),16),e=parseInt(t.substr(2,2),16),r=parseInt(t.substr(4,2),16),n=(299*i+587*e+114*r)/1e3;return n>=128?"#000":"#fff"}function e(t){return 3===t.length&&"#"!==t.charAt(0)&&(t="#"+t),4===t.length&&"#"===t.charAt(0)&&(t="#"+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)+t.charAt(3)+t.charAt(3)),7===t.length?t:!1}var r,n=function(r,n){var a=t(this),s=n&&n.color?n.color.toString():a.val();s=e(s),a.css({backgroundColor:s?s:"#ffffff",color:i(s)}),s?a.siblings(fvphtml.prefix+"reset").show():a.siblings(fvphtml.prefix+"reset").hide()},a=function(){var i=t(this);r.not(i).iris("hide"),i.iris("show")},s=function(i){i&&i.preventDefault();var e=t(this);""===e.val()&&e.siblings(fvphtml.prefix+"reset").hide()},l=function(i){i&&i.preventDefault(),r.iris("hide"),t(this).siblings(fvphtml.prefix+"colorpicker").val("").each(n)};t(document).ready(function(){r=t(fvphtml.prefix+"colorpicker"),r.iris({change:n}),r.bind("input",n),r.click(a),r.blur(s),r.siblings(fvphtml.prefix+"reset").click(l),r.each(n)})}(jQuery),function(t){"use strict";function i(i){var r=i.title||"",n=i.content||"",a=i.position||{edge:"right",align:"middle"};t(i.target).pointer({pointer_id:i.identifier,content:"<h3>"+r+"</h3><p>"+n+"</p>",position:a,close:e}).pointer("open")}var e=function(){var i=t(this).data("wpPointer").options.pointer_id;t.post(ajaxurl,{pointer:i,action:"dismiss-wp-pointer"})};t(document).ready(function(){for(var t=fvphtml.pointers||[],e=0;e<t.length;e++)i(fvphtml.pointers[e])})}(jQuery),jQuery(document).ready(function(t){"use strict";t(fvphtml.prefix+"help-link, .help-link").click(function(){t("#contextual-help-link").trigger("click")})});
     1!function(t){"use strict";var i=function(){var i=t(this),e=i.siblings("[data-hook='"+i.data("hook")+"']");i.hasClass("active")&&e.hasClass("active")||(i.siblings(fvphtml.prefix+"tab-title").removeClass("active"),i.siblings(fvphtml.prefix+"tab-body").slideUp(),i.addClass("active"),e.addClass("active").slideDown())};t(document).ready(function(){for(var e=t(fvphtml.prefix+"tabs"),r=e.length-1;r>=0;r--){var n=t(e[r]),a=n.children(fvphtml.prefix+"tab-title"),s=n.children(fvphtml.prefix+"tab-body");a.first().addClass("active"),s.first().addClass("active"),n.prepend(a),s.filter(":not(.active)").hide(),n.children(fvphtml.prefix+"tab-title").click(i)}})}(jQuery),function(t){"use strict";var i={},e=function(){for(var e=t(this),r=i[e.attr("name")],n=0;n<r.length;n++){var a=t(r[n]),s=a.data("names").split("|"),l=).split("|"),o=t.inArray(e.attr("name"),s);if(-1!==o){var c=!0,f=l[o],h="checkbox"!==e.attr("type")||e.prop("checked")?e.val():null;"string"==typeof f&&"!"===f.charAt(0)&&(c=!1,f=f.substr(1)),c&&h!==f||!c&&h===f?a.addClass("hidden"):a.removeClass("hidden")}}};t(document).ready(function(){for(var r=t(fvphtml.prefix+"conditional"),n=0;n<r.length;n++)for(var a=t(r[n]),s=a.data("names").split("|"),l=0;l<s.length;l++){var o=s[l];i.hasOwnProperty(o)||(i[o]=[]),i[o].push(a)}for(var c in i){var f=t("[name='"+c+"']");f.change(e)}})}(jQuery),function(t){"use strict";function i(t){t=t?t:"#fffff",t="#"===t.charAt(0)?t.substr(1):t;var i=parseInt(t.substr(0,2),16),e=parseInt(t.substr(2,2),16),r=parseInt(t.substr(4,2),16),n=(299*i+587*e+114*r)/1e3;return n>=128?"#000":"#fff"}function e(t){return 3===t.length&&"#"!==t.charAt(0)&&(t="#"+t),4===t.length&&"#"===t.charAt(0)&&(t="#"+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)+t.charAt(3)+t.charAt(3)),7===t.length?t:!1}var r,n=function(r,n){var a=t(this),s=n&&n.color?n.color.toString():a.val();s=e(s),a.css({backgroundColor:s?s:"#ffffff",color:i(s)}),s?a.siblings(fvphtml.prefix+"reset").show():a.siblings(fvphtml.prefix+"reset").hide()},a=function(){var i=t(this);r.not(i).iris("hide"),i.iris("show")},s=function(i){i&&i.preventDefault();var e=t(this);""===e.val()&&e.siblings(fvphtml.prefix+"reset").hide()},l=function(i){i&&i.preventDefault(),r.iris("hide"),t(this).siblings(fvphtml.prefix+"colorpicker").val("").each(n)};t(document).ready(function(){r=t(fvphtml.prefix+"colorpicker"),r.iris({change:n}),r.bind("input",n),r.click(a),r.blur(s),r.siblings(fvphtml.prefix+"reset").click(l),r.each(n)})}(jQuery),function(t){"use strict";function i(i){var r=i.title||"",n=i.content||"",a=i.position||{edge:"right",align:"middle"};t(i.target).pointer({pointer_id:i.identifier,content:"<h3>"+r+"</h3><p>"+n+"</p>",position:a,close:e}).pointer("open")}var e=function(){var i=t(this).data("wpPointer").options.pointer_id;t.post(ajaxurl,{pointer:i,action:"dismiss-wp-pointer"})};t(document).ready(function(){for(var t=fvphtml.pointers||[],e=0;e<t.length;e++)i(fvphtml.pointers[e])})}(jQuery),jQuery(document).ready(function(t){"use strict";t(fvphtml.prefix+"help-link, .help-link").click(function(){t("#contextual-help-link").trigger("click")})});
  • featured-video-plus/trunk/js/post.js

    r1181216 r1202444  
    109109      // new video data
    110110      } else {
     111
     112
     113
     114
    111115        $container
    112116          .css({height: ''})
  • featured-video-plus/trunk/js/post.min.js

    r1181216 r1202444  
    1 !function(e){"use strict";function t(t){var i=e("#postimagediv .inside");t=t||i.html(),i.html(t),0<i.find(".fvp-remove-image").length&&(i.find("#remove-post-thumbnail").parent("p").hide(),i.find(".fvp-remove-image").parent("p").show())}function i(e){n(e,!0)}function a(i){i.preventDefault(),r.css({backgroundImage:f}),e.post(ajaxurl,{action:"fvp_remove_img",id:e("#post_ID").val(),fvp_nonce:e("#fvp_nonce").val()},function(e){e.success&&(t(e.data),r.css({backgroundImage:c}))},"json")}function n(i,a){if(i.preventDefault(),a=a||!1,o.val(e.trim(o.val())).trigger("autosize"),s!==o.val()||a){r.css({backgroundImage:f}),s=o.val();var n={action:"fvp_save",id:e("#post_ID").val(),fvp_nonce:e("#fvp_nonce").val(),fvp_video:o.val(),fvp_set_featimg:a};e.post(ajaxurl,n,function(i){if(!i.success)return!1;var a=i.data,n=e(".fvp-current-video");r.css({backgroundImage:c}),"remove"===a.task?n.css({height:n.height()}).html("").animate({height:0}):n.css({height:""}).html(a.video),t(a.img)},"json")}}var o,r,s,c,v=fvpPost,f="url("+v.loading_gif+")";e(document).ready(function(){o=e(".fvp-video"),r=o.siblings(".fvp-video-choose").children(".fvp-media-icon"),s=o.val(),c=r.css("backgroundImage"),o.blur(n),o.autosize().trigger("blur").keypress(function(t){13===t.keyCode&&(t.preventDefault(),e(this).trigger("blur"))}).click(function(){e(this).select()}),e("#postimagediv").on("click",".fvp-set-image",i).on("click",".fvp-remove-image",a),t();var v,f={frame:function(){return this._frame?this._frame:(this._frame=wp.media({title:v.data("title"),library:{type:"video"},button:{text:v.data("button")},multiple:!1}),this._frame.on("open",this.updateFrame).state("library").on("select",this.select),this._frame)},select:function(){var t=this.get("selection"),i="url",a=v.data("target");e(a).val(t.pluck(i)).change().trigger("blur")},updateFrame:function(){},init:function(){e("#wpbody").on("click",".fvp-video-choose",function(t){t.preventDefault(),v=e(this).closest(".fvp-input-wrapper"),f.frame().open()})}};f.init()})}(jQuery);
     1!function(e){"use strict";function t(t){var i=e("#postimagediv .inside");t=t||i.html(),i.html(t),0<i.find(".fvp-remove-image").length&&(i.find("#remove-post-thumbnail").parent("p").hide(),i.find(".fvp-remove-image").parent("p").show())}function i(e){n(e,!0)}function a(i){i.preventDefault(),r.css({backgroundImage:f}),e.post(ajaxurl,{action:"fvp_remove_img",id:e("#post_ID").val(),fvp_nonce:e("#fvp_nonce").val()},function(e){e.success&&(t(e.data),r.css({backgroundImage:c}))},"json")}function n(i,a){if(i.preventDefault(),a=a||!1,o.val(e.trim(o.val())).trigger("autosize"),s!==o.val()||a){r.css({backgroundImage:f}),s=o.val();var n={action:"fvp_save",id:e("#post_ID").val(),fvp_nonce:e("#fvp_nonce").val(),fvp_video:o.val(),fvp_set_featimg:a};e.post(ajaxurl,n,function(i){if(!i.success)return!1;var a=i.data,n=e(".fvp-current-video");r.css({backgroundImage:c}),"remove"===a.task?n.css({height:n.height()}).html("").animate({height:0}):),t(a.img)},"json")}}var o,r,s,c,v=fvpPost,f="url("+v.loading_gif+")";e(document).ready(function(){o=e(".fvp-video"),r=o.siblings(".fvp-video-choose").children(".fvp-media-icon"),s=o.val(),c=r.css("backgroundImage"),o.blur(n),o.autosize().trigger("blur").keypress(function(t){13===t.keyCode&&(t.preventDefault(),e(this).trigger("blur"))}).click(function(){e(this).select()}),e("#postimagediv").on("click",".fvp-set-image",i).on("click",".fvp-remove-image",a),t();var v,f={frame:function(){return this._frame?this._frame:(this._frame=wp.media({title:v.data("title"),library:{type:"video"},button:{text:v.data("button")},multiple:!1}),this._frame.on("open",this.updateFrame).state("library").on("select",this.select),this._frame)},select:function(){var t=this.get("selection"),i="url",a=v.data("target");e(a).val(t.pluck(i)).change().trigger("blur")},updateFrame:function(){},init:function(){e("#wpbody").on("click",".fvp-video-choose",function(t){t.preventDefault(),v=e(this).closest(".fvp-input-wrapper"),f.frame().open()})}};f.init()})}(jQuery);
  • featured-video-plus/trunk/php/class-backend.php

    r1181216 r1202444  
    330330        if ( ! empty( $meta['full'] ) && empty( $url ) ) {
    331331            delete_post_meta( $post['id'], '_fvp_video' );
    332             $this->delete_featured_image( $post['id'], $meta );
     332            if ( get_post_thumbnail_id( $post['id'] ) == $meta['img'] ) {
     333                $this->delete_featured_image( $post['id'], $meta );
     334            }
    333335            return false;
    334336        }
     
    403405                'description' => ! empty( $raw->description )   ? $raw->description : null,
    404406                'img_url'     => ! empty( $raw->thumbnail_url ) ? $raw->thumbnail_url : null,
    405                 'filename'    => ! empty( $raw->title ) ? sanitize_file_name( $raw->title ) : null,
    406             );
     407                'filename'    => ! empty( $raw->title ) ? $raw->title : null,
     408            );
     409
     410            switch ( $provider ) {
     411                case 'dailymotion':
     412                    $data['id'] = $this->oembed->get_video_id( $url );
     413                    $img_url = $this->oembed->get_thumbnail_url( $provider, $data['id'] );
     414                    if ( false !== $img_url ) {
     415                        $data['img_url'] = $img_url;
     416                    }
     417                    break;
     418            }
    407419        }
    408420
     
    448460
    449461        if ( empty( $img ) ) {
    450             $file = array(
    451               'name' => basename( $data['img_url'] ),
    452             );
    453 
    454             // Get external image
    455             $file['tmp_name'] = download_url( $data['img_url'] );
    456             if ( is_wp_error( $file['tmp_name'] ) ) {
    457                 return false;
     462            $file = array();
     463
     464            // Handle YouTube max res image
     465            if ( false !== strpos( $data['img_url'], 'hqdefault' ) ) {
     466                $file['tmp_name'] = download_url( str_replace(
     467                    'hqdefault',
     468                    'maxresdefault',
     469                    $data['img_url']
     470                ) );
    458471            }
    459472
     473
     474
     475
     476
     477
     478
     479
     480
    460481            // Insert into media library
    461             $url_type = image_type_to_extension(
    462                 exif_imagetype( $file['tmp_name'] ),
     482            $type = image_type_to_extension(
     483                type( $file['tmp_name'] ),
    463484                false
    464485            );
    465             $file['name'] = basename( $data['img_url'] . '.' . $url_type );
     486            $title = ! empty( $data['title'] ) ?
     487                $data['title'] : basename( $data['img_url'], $type );
     488            $file['name'] = sanitize_file_name( $title . '.' . $type );
    466489            $img = media_handle_sideload( $file, $post_id );
    467490
     
    489512     */
    490513    private function delete_featured_image( $post_id, $meta ) {
     514
     515
     516
     517
     518
    491519        if ( empty( $meta['img'] ) ) {
    492520            return false;
    493521        }
    494 
    495         // Unset featured image if it is from this video
    496         delete_post_meta( $post_id, '_thumbnail_id', $meta['img'] );
    497522
    498523        // Check if other posts use the image, if not we can delete it completely
     
    740765
    741766
     767
     768
     769
     770
     771
     772
     773
     774
     775
     776
     777
     778
     779
     780
     781
     782
     783
     784
     785
    742786}
  • featured-video-plus/trunk/php/class-main.php

    r1179150 r1202444  
    4444
    4545        // Autoplay option. Suppressed when viewing admin.
    46         $general['autoplay'] =
    47             ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ! is_admin() ) &&
    48             ! empty( $general['autoplay'] ) && $general['autoplay'] ? '1' : null;
     46        $general['autoplay'] = self::parse_autoplay_options($options) ? true : null;
    4947
    5048        // Responsive scaling option. Not used when viewing the admin screen.
     
    8785
    8886            case 'raw':
    89                 $embed = $meta['full'];
     87                $embed = ;
    9088                break;
    9189
     
    190188    }
    191189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
    192232
    193233    /**
  • featured-video-plus/trunk/php/class-oembed.php

    r1172119 r1202444  
    257257
    258258        return $provider;
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
     271
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
     282
     283
     284
     285
     286
     287
     288
     289
     290
     291
     292
     293
     294
     295
     296
     297
     298
     299
     300
     301
     302
     303
     304
     305
     306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
    259317    }
    260318
  • featured-video-plus/trunk/php/class-settings.php

    r1179150 r1202444  
    334334    public function arguments() {
    335335        $options     = get_option( 'fvp-settings' );
     336
    336337        $args        = ! empty( $options['default_args'] ) ? $options['default_args'] : array();
    337338        $vimeo       = ! empty( $args['vimeo'] )       ? $args['vimeo'] : array();
     
    350351                    'fvp-settings[default_args][general]',
    351352                    array(
    352                         'autoplay' => esc_html__( 'Autoplay', 'featured-video-plus' ),
    353                         'loop'     => esc_html__( 'Loop', 'featured-video-plus' )
     353                        'loop'     => esc_html__( 'Loop', 'featured-video-plus' ),
    354354                    ),
    355355                    ! empty( $args['general'] ) ? $args['general'] : array()
    356356                ),
     357
     358
     359
     360
     361
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
     372
     373
     374
     375
    357376            ),
    358377
     
    402421                        ),
    403422                        'modestbranding' => esc_html__( 'Hide YouTube logo', 'featured-video-plus' ),
     423
     424
     425
     426
    404427                        'rel' => array(
    405428                            'value' => '0',
     
    527550                'width'      => $patterns['number'],
    528551            ),
     552
     553
     554
     555
     556
    529557            'default_args' => array(
    530558                'general' => array(
    531                     'autoplay' => $patterns['digit'],
    532                     'loop'     => $patterns['digit'],
     559                    'loop' => $patterns['digit'],
    533560                ),
    534561                'vimeo' => array(
     
    542569                    'color'          => $patterns['word'],
    543570                    'modestbranding' => $patterns['digit'],
     571
    544572                    'fs'             => $patterns['digit'],
    545573                    'rel'            => $patterns['digit'],
  • featured-video-plus/trunk/php/inc-upgrade.php

    r1179150 r1202444  
    208208        }
    209209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
    210223
    211224    default:
  • featured-video-plus/trunk/readme.txt

    r1181823 r1202444  
    1111Requires at least: 3.7
    1212Tested up to: 4.2.2
    13 Stable tag: 2.1.2
     13Stable tag: 2.
    1414
    1515Add Featured Videos to your posts and pages. Works like magic with most themes which use Featured Images. Local Media, YouTube, Vimeo and many more.
     
    108108== Changelog ==
    109109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
    110121= 2.1.2: 2015-06-16 =
    111122* Fix bug which resulted in missing featured images when a post did not have a featured video. ([*](https://wordpress.org/support/topic/cookie-send-to-you-and-video-yes-image-no), [*](https://wordpress.org/support/topic/version-221-featured-image-not-diplayed))
    112123
    113124= 2.1.1: 2015-06-15 =
    114 * Fix play and loading featured image overlay for some themes ([*](https://wordpress.org/support/topic/play-icon-missing)).
     125* Fix play and loading featured image overlay for some themes
    115126* Fix broken `remove featured image` link. ([*](https://wordpress.org/support/topic/cant-remove-featured-image-2),  [*](https://wordpress.org/support/topic/version-210-conflict-with-wp-featured-image), [*](https://wordpress.org/support/topic/fvp-not-working-after-210-update))
    116127
    117128= 2.1.0: 2015-06-11 =
    118129* Display options are now chained using OR - if one of them holds, the replace mode is used.
    119 * Added `always use replace mode when viewing single posts and pages` option, was implicitly true since 2.0.0. ([*](https://wordpress.org/support/topic/featured-video-overrides-featured-image)).
    120 * Fixed undefined warnings when using `WP_DEBUG` ([*](https://wordpress.org/support/topic/debug-error-16)).
    121 * Fixed double-wrapped .post-thumbnails ([*](https://wordpress.org/support/topic/video-no-longer-appearing)).
     130* Added `always use replace mode when viewing single posts and pages` option, was implicitly true since 2.0.0. ([*](https://wordpress.org/support/topic/featured-video-overrides-featured-image))
     131* Fixed undefined warnings when using `WP_DEBUG`
     132* Fixed double-wrapped .post-thumbnails
    122133* Lazy loading a video no longer breaks other videos. ([*](https://wordpress.org/support/topic/blank-screen-after-the-video-is-played))
    123134
Note: See TracChangeset for help on using the changeset viewer.