Plugin Directory

Changeset 1555602

Timestamp:
12/15/2016 05:38:02 PM (8 years ago)
Author:
a.hoereth
Message:

Version 2.3.0

Location:
featured-video-plus
Files:
54 added
18 edited

Legend:

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

    r1457131 r1555602  
    11# Changelog #
     2
     3
     4
     5
     6
     7
     8
    29
    310## 2.2.3: 2016-07-19 ##
  • featured-video-plus/trunk/FAQ.md

    r1172119 r1555602  
    22
    33## Why do I just get text back after adding an URL to the Featured Video input? ##
    4 If the plugin just displays the URL back as text it probably does not recognize that it comes from a video provider. Try inserting the raw embed code instead and [check the docs](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) to see which providers are supported.
     4If the plugin just [check the docs](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) to see which providers are supported.
    55
    66## How do I use my local videos? ##
    77Click the small media icon in the Featured Video input box on the post edit screen and upload your video or choose it from the media library. WordPress does not support all formats tho, [check this table](http://www.mediaelementjs.com/#devices) for details.
    88
    9 ## Why do I not see a featuerd video or image on the frontend at all? ##
    10 For the videos to be automatically displayed you need to define a Featured Image. This image will never be shown if a video is available. If your theme does not support featured images the plugin also has no chance of working out of the box.
     9## Why do I not see a featud video or image on the frontend at all? ##
     10For the videos to be automatically displayed you need to define a Featured Image. . If your theme does not support featured images the plugin also has no chance of working out of the box.
    1111
    1212## Why does the frontend still display the featured image although I added a featured video to the post? ##
     
    1616Take a look at your media settings and try using a fixed width instead of responsive sizing.
    1717
     18
     19
     20
    1821## Can I help translating the plugin? ##
    19 Yes, please! Check out the public [Featured Video Plus Translation Project](https://poeditor.com/join/project?hash=WlyLh0cFO3).
     22Yes, please! Check out the ).
  • featured-video-plus/trunk/README.md

    r1202444 r1555602  
    16163. manually make use of the __PHP-functions__ in your theme's source files.
    1717
     18
     19
    1820> <strong>Theme compatibility</strong><br>
    1921> Sadly many themes do not follow the WordPress standards and implement their own fancy functions for displaying featured images - those very likely break this plugin. Check out the [FAQ](https://wordpress.org/plugins/featured-video-plus/faq/). Another common problem are sliders: Videos, in general, do not like sliders at all.
     
    2628
    2729> <strong>Support</strong><br>
    28 > I do read all support questions in the [forums](https://wordpress.org/support/plugin/featured-video-plus) but cannot reply to all of them. The plugin is an unpaid side project and full support would require more time than I can invest for free for over 10k active installs. If you really need help, consider [buying me a cookie](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6) - best way to attract my attention and to support future enhancements.
     30> I do read all support questions in the [forums](http0k active installs. If you really need help, consider [buying me a cookie](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6) - best way to attract my attention and to support future enhancements.
    2931
    3032
  • featured-video-plus/trunk/featured-video-plus.php

    r1457131 r1555602  
    44Plugin URI: http://yrnxt.com/wordpress/featured-video-plus/
    55Description: Add Featured Videos to your posts and pages.
    6 Version: 2.2.3
     6Version: 2.
    77Author: Alexander Höreth
    88Author URI: http://yrnxt.com
     
    3333// CONSTANTS
    3434if ( ! defined( 'FVP_VERSION' ) ) {
    35     define( 'FVP_VERSION', '2.2.3' );
     35    define( 'FVP_VERSION', '2.' );
    3636}
    3737
  • featured-video-plus/trunk/js/post.js

    r1202444 r1555602  
    99  var mediaicon;
    1010  var loadingicon = 'url(' + context.loading_gif + ')';
     11
    1112
    1213
     
    100101      $media.css({ backgroundImage: mediaicon });
    101102
    102       // removed video
    103       if('remove' === data.task) {
    104         $container
    105           .css({height: $container.height() })
    106           .html('')
    107           .animate({height: 0});
    108 
    109       // new video data
     103      if (data.valid !== false) {
     104        $invalidNotice.hide();
     105      } else {
     106        $invalidNotice.css({ display: 'block' });
     107      }
     108
     109      $input.val(data.full);
     110      currentUrl = data.full; // Remember new url.
     111      if(!data.full) {
     112        var height = $container.height();
     113        if (height) {
     114          $container.css({ height: height }).animate({ height: 0 });
     115        }
     116        $container.html('')
    110117      } else {
    111118        // Suppress autoplay in admin interface. Cannot do this on the server
    112119        // side because ajax requests from frontend and backend look the same.
    113120        data.video = data.video.replace(/autoplay(?:=.?)?&?/i, '');
    114 
    115         $container
    116           .css({height: ''})
    117           .html(data.video);
     121        $container.css({ height: '' }).html(data.video);
    118122      }
    119123
     
    127131    $input = $('.fvp-video');
    128132    $media = $input.siblings('.fvp-video-choose').children('.fvp-media-icon');
     133
    129134    currentUrl  = $input.val();
    130135    mediaicon = $media.css('backgroundImage');
     
    133138    // Update video and featured image with the returned data.
    134139    $input.blur(submitVideo);
     140
     141
     142
     143
     144
     145
    135146
    136147    // Initialize autosizing the url input field, disable enter key and
  • featured-video-plus/trunk/js/post.min.js

    r1202444 r1555602  
    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}):(a.video=a.video.replace(/autoplay(?:=.?)?&?/i,""),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(),),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/lng/featured-video-plus-de_DE.po

    r1179150 r1555602  
     1
     2
    13msgid ""
    24msgstr ""
     5
    36"MIME-Version: 1.0\n"
    47"Content-Type: text/plain; charset=UTF-8\n"
    58"Content-Transfer-Encoding: 8bit\n"
    6 "X-Generator: POEditor.com\n"
    7 "Project-Id-Version: Featured Video Plus\n"
    8 "Language: de\n"
    9 
    10 #: build/php/class-backend.php:122 php/class-backend.php:122
     9"\n"
     10"\n"
     11"\n"
     12
     13#: php/class-backend.php:122
    1114msgid "Featured Video"
    1215msgstr "Beitragsvideo"
    1316
    14 #: build/php/class-backend.php:164 php/class-backend.php:164
     17#: php/class-backend.php:164
    1518msgid "Set Featured Video"
    1619msgstr "Beitragsvideo festlegen"
    1720
    18 #: build/php/class-backend.php:170 php/class-backend.php:170
     21#: php/class-backend.php:170
    1922msgid "Video URL"
    2023msgstr "Video URL"
    2124
    22 #: build/php/class-backend.php:198 php/class-backend.php:198
     25#: php/class-backend.php:198
    2326msgid "The current theme does not support Featured Images"
    2427msgstr "Das aktuelle Theme nutzt keine Beitragsbilder."
    2528
    26 #: build/php/class-backend.php:205 php/class-backend.php:205
     29#: php/class-backend.php:205
    2730msgid "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s. To hide this notice deactivate %3$sReplace Featured Images%4$s in the %5$sMedia Settings%6$s."
    2831msgstr "Um Beitragsvideos darzustellen musst du den %1$sShortcode%2§s oder %1$sPHP-Funktionen%2$s nutzen. Um diese Warnung zu deaktivieren stell %3$sBeitragsbilder ersetzen%4$s in den %5$sMedieneinstellungen%6$s aus."
    2932
    30 #. #-#-#-#-#  featured-video-plus.pot (Featured Video Plus 1.9.2)  #-#-#-#-#
     33#: php/class-backend.php:628 php/class-settings.php:39
     34msgid "Featured Videos"
     35msgstr "Beitragsvideos"
     36
     37#: php/class-backend.php:630
     38msgid "Simply paste a URL into this input to add a bit extra life to your posts. %sTry an example%s."
     39msgstr "Kopier einfach eine URL in das Eingabefeld um deinen Videos ein wenig extra Leben einzuhauchen. %sProbier ein Beispiel%s."
     40
     41#: php/class-backend.php:637
     42msgid "To adjust how featured videos are displayed on the frontend checkout the %smedia settings%s."
     43msgstr "Wirf einen Blick in die %sMedien-Einstellungen%s um anzupassen wie Beitragsvideos dargestellt werden."
     44
     45#: php/class-backend.php:693
     46msgid "Remove featured image"
     47msgstr "Beitragsbild entfernen"
     48
     49#: php/class-backend.php:700
     50msgid "Featured Videos require a Featured Image for automatic replacement."
     51msgstr "Beitragsvideos benötigen ein Beitragsbild um automatisch dargestellt werden zu können."
     52
     53#: php/class-backend.php:704
     54msgid "Auto set"
     55msgstr "Automatisch erstellen"
     56
     57#. #-#-#-#-#  tmp-featured-video-plus.pot (Featured Video Plus 2.2.3)
     58#. #-#-#-#-#
    3159#. Plugin Name of the plugin/theme
    32 #: build/php/class-help.php:23 php/class-help.php:23
     60#: php/class-help.php:23
    3361msgid "Featured Video Plus"
    3462msgstr "Featured Video Plus"
    3563
    36 #: build/php/class-help.php:31 php/class-help.php:31
     64#: php/class-help.php:31
    3765msgid "Take a video url from one of the %ssupported oembed providers%s and paste it into the Featured Video input field."
    3866msgstr "Kopiere einen Video-Link von einem der %sunterstützten Anbieter%s in das Beitragsvideo-Eingabefeld."
    3967
    40 #: php/class-backend.php:580
    41 msgid "Alternatively you can select one of the videos from your media library using the small media icon to the right in the URL input vield. The plugin makes use of %sWordPress' native functionality%s - no gurantee for compatibility with all formats."
    42 msgstr "Alternativ kannst du ein Video aus deiner Mediengallerie auswählen. Das Plugin nutzt die %soriginale WordPress Funktionsweise%s - keine Garantie für Kombatibilität mit allen Formaten & Geräten."
    43 
    44 #: php/class-backend.php:588
    45 msgid "Converting your videos"
    46 msgstr "Videos konvertieren"
    47 
    48 #: php/class-backend.php:592
    49 msgid "Take a look at the %sMiro Video Converter%s. It is open source, lightweight and compatible with Windows, Mac and Linux."
    50 msgstr "Schau dir den %sMiro Video Converter%s an. Er is Open Source, klein, einfach zu verwenden und mit Windows, Mac und Linux kompatibel."
    51 
    52 #: build/php/class-help.php:52 php/class-help.php:52
     68#: php/class-help.php:41
     69msgid "Alternatively you can select one of the videos from your media library using the small media icon to the right in the URL input field. The plugin makes use of %sWordPress' native HTML5 video functionality%s - no gurantee for compatibility with all formats."
     70msgstr "Alternativ kannst du eines deiner eigenen Videos aus der Medienbibliothek auswählen indem du das kleine Icon rechts im URL Eingabefeld anklickst. Das Plugin nutzt die %WordPress eigene HTML5 Video-Funktionalität%s - keine Garantie dafür, dass alle Formate funktionieren."
     71
     72#: php/class-help.php:52
    5373msgid "Fixing upload errors"
    5474msgstr "Videoupload Fehler beheben"
    5575
    56 #: build/php/class-help.php:58 php/class-help.php:58
     76#: php/class-help.php:58
    5777msgid "Read %sthis%s on how to increase the maximum file upload size."
    5878msgstr "Schau dir %sdiesen Link%s an um zu erfahren wie man die maximale Upload größe erhöht."
    5979
    60 #: build/php/class-backend.php:603 build/php/class-settings.php:39
    61 #: php/class-backend.php:603 php/class-settings.php:39
    62 msgid "Featured Videos"
    63 msgstr "Beitragsvideos"
    64 
    65 #: build/php/class-backend.php:605 php/class-backend.php:605
    66 msgid "Simply paste a URL into this input to add a bit extra life to your posts. %sTry an example%s."
    67 msgstr "Kopier einfach eine URL in das Eingabefeld um deinen Videos ein wenig extra Leben einzuhauchen. %sProbier ein Beispiel%s."
    68 
    69 #: build/php/class-backend.php:612 php/class-backend.php:612
    70 msgid "To adjust how featured videos are displayed on the frontend checkout the %smedia settings%s."
    71 msgstr "Wirf einen Blick in die %sMedien-Einstellungen%s um anzupassen wie Beitragsvideos dargestellt werden."
    72 
    73 #: build/php/class-backend.php:669 php/class-backend.php:669
    74 msgid "Featured Videos require a Featured Image for automatic replacement."
    75 msgstr "Beitragsvideos benötigen ein Beitragsbild um automatisch dargestellt werden zu können."
    76 
    77 #: build/php/class-backend.php:673 php/class-backend.php:673
    78 msgid "Auto set"
    79 msgstr "Automatisch erstellen"
    80 
    81 #: build/php/class-settings.php:50 php/class-settings.php:50
    82 msgid "Display mode"
    83 msgstr "Modus"
    84 
    85 #: build/php/class-settings.php:58 php/class-settings.php:58
    86 msgid "Display Conditions"
    87 msgstr "Konditionen"
    88 
    89 #: build/php/class-settings.php:68 php/class-settings.php:68
    90 msgid "Video Sizing"
    91 msgstr "Videogröße"
    92 
    93 #: build/php/class-settings.php:77 php/class-settings.php:77
    94 msgid "Video Align"
    95 msgstr "Positionierung"
    96 
    97 #: build/php/class-settings.php:86 php/class-settings.php:86
    98 msgid "Default Arguments"
    99 msgstr "Parameter"
    100 
    101 #: build/php/class-settings.php:95 php/class-settings.php:95
    102 msgid "Support"
    103 msgstr "Support"
    104 
    105 #: build/php/class-settings.php:116 php/class-settings.php:116
    106 msgid "To display your featured videos you can either make use of the automatic replacement, use the %s or manually edit your theme's source files to make use of the plugins PHP-functions."
    107 msgstr "Um die Artikelvideos anzuzeigen kannst du entweder das automatische Ersetzen der Artikelbilder nutzen, auf den %s zurückgreifen oder manuel die PHP-Funktionen in deine Theme Dateien integrieren."
    108 
    109 #: build/php/class-settings.php:117 php/class-settings.php:117
    110 msgid "For more information about Shortcode and PHP functions see the %sContextual Help%s."
    111 msgstr "Für mehr Informationen über den Shortcode und die PHP-Funktionen schaue in die %sHilfe%s."
    112 
    113 #: build/php/class-settings.php:125 php/class-settings.php:125
    114 msgid "The current theme does not support featured images."
    115 msgstr "Das aktuelle Theme unterstützt keine Beitragsbilder."
    116 
    117 #: build/php/class-settings.php:128 php/class-settings.php:128
    118 msgid "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s."
    119 msgstr "Um Beitragsvideos darzustellen musst du leider den %1$sShortcode%2$s oder die %1$sPHP-Funktionen%2$s nutzen."
    120 
    121 #: build/php/class-settings.php:151 php/class-settings.php:151
    122 msgid "Replace featured image automatically."
    123 msgstr "Beitragsbild automatisch ersetzen."
    124 
    125 #: build/php/class-settings.php:152 php/class-settings.php:152
    126 msgid "Replace featured image on click."
    127 msgstr "Beitragsbild bei anklicken ersetzen."
    128 
    129 #: build/php/class-settings.php:153 php/class-settings.php:153
    130 msgid "Open video overlay when featured image is clicked."
    131 msgstr "Video in Overlay darstellen."
    132 
    133 #: build/php/class-settings.php:154 php/class-settings.php:154
    134 msgid "Manual: PHP-functions or shortcodes."
    135 msgstr "Manuell: PHP-Funktionen oder Shortcode."
    136 
    137 #: build/php/class-settings.php:160 php/class-settings.php:160
    138 msgid "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality."
    139 msgstr "Automatische Integration (Optionen 1 bis 3) benötigen ein Theme das die nativen WordPress %sBeitragsbild%s Funktionen nutzt."
    140 
    141 #: build/php/class-settings.php:203 php/class-settings.php:203
    142 msgid "View options are not available in manual mode."
    143 msgstr "Darstellungsoptionen sind im manuellen Modus nicht verfügbar."
    144 
    145 #: build/php/class-settings.php:274 php/class-settings.php:274
    146 msgid "Responsive"
    147 msgstr "Dynamisch"
    148 
    149 #: build/php/class-settings.php:281 php/class-settings.php:281
    150 msgid "Width in pixels:"
    151 msgstr "Breite in Pixeln:"
    152 
    153 #: build/php/class-settings.php:298 php/class-settings.php:298
    154 msgid "The %1$sresponsive%2$s setting does not work when using the %1$soverlay%2$s display mode and might break completly in some themes - in such cases you should use a fixed width instead."
    155 msgstr "Die %1$dynamisch%2$s Einstellung funktioniert nicht in allen Themes und speziell auch nicht im %1$sOverlay%2$s-Modus. In dem Fall muss eine absolute Breite angegeben werden."
    156 
    157 #: build/php/class-settings.php:319 php/class-settings.php:319
    158 msgid "left"
    159 msgstr "links"
    160 
    161 #: build/php/class-settings.php:320 php/class-settings.php:320
    162 msgid "center"
    163 msgstr "zentriert"
    164 
    165 #: build/php/class-settings.php:321 php/class-settings.php:321
    166 msgid "right"
    167 msgstr "rechts"
    168 
    169 #: build/php/class-settings.php:344 php/class-settings.php:344
    170 msgid "Not all of the following options might be supported by all providers."
    171 msgstr "Nicht alle der folgenden Einstellungen werden von allen Providern unterstützt."
    172 
    173 #: build/php/class-settings.php:352 php/class-settings.php:352
    174 msgid "Autoplay"
    175 msgstr "Automatisch Abspielen"
    176 
    177 #: build/php/class-settings.php:353 php/class-settings.php:353
    178 msgid "Loop"
    179 msgstr "Dauerschleife"
    180 
    181 #: build/php/class-settings.php:361 php/class-settings.php:361
    182 msgid "If the owner of a video is a Plus member, some of these settings may be overridden by their preferences."
    183 msgstr "Wenn der Videoeigentümer Vimeo-Plus Mitglied ist, kann er die folgenden Einstellungen für sein Video überschreiben."
    184 
    185 #: build/php/class-settings.php:376 php/class-settings.php:376
    186 msgid "Hide user's portrait"
    187 msgstr "Nutzerbild verbergen."
    188 
    189 #: build/php/class-settings.php:380 php/class-settings.php:380
    190 msgid "Hide video title"
    191 msgstr "Videotitel verbergen."
    192 
    193 #: build/php/class-settings.php:384 php/class-settings.php:384
    194 msgid "Hide video byline"
    195 msgstr "Erstellerzeile verbergen."
    196 
    197 #: build/php/class-settings.php:397 php/class-settings.php:397
    198 msgid "Light theme"
    199 msgstr "Helles Theme."
    200 
    201 #: build/php/class-settings.php:401 php/class-settings.php:401
    202 msgid "White highlight color"
    203 msgstr "Weiße Betonungsfarbe."
    204 
    205 #: build/php/class-settings.php:403 php/class-settings.php:403
    206 msgid "Hide YouTube logo"
    207 msgstr "YouTube Logo verbergen."
    208 
    209 #: build/php/class-settings.php:406 build/php/class-settings.php:456
    210 #: php/class-settings.php:406 php/class-settings.php:456
    211 msgid "Hide related videos"
    212 msgstr "Verwandte Videos verbergen."
    213 
    214 #: build/php/class-settings.php:410 php/class-settings.php:410
    215 msgid "Disallow fullscreen"
    216 msgstr "Vollbildmodus unterdrücken."
    217 
    218 #: build/php/class-settings.php:414 build/php/class-settings.php:452
    219 #: php/class-settings.php:414 php/class-settings.php:452
    220 msgid "Hide video info"
    221 msgstr "Videoinfo verbergen."
    222 
    223 #: build/php/class-settings.php:416 php/class-settings.php:416
    224 msgid "Enable JavaScript API"
    225 msgstr "JavaScript API aktivieren."
    226 
    227 #: build/php/class-settings.php:448 php/class-settings.php:448
    228 msgid "Hide DailyMotion logo"
    229 msgstr "DailyMotion Logo verbergen."
    230 
    231 #: build/php/class-settings.php:460 php/class-settings.php:460
    232 msgid "Turn HD on by default"
    233 msgstr "HD automatisch einschalten."
    234 
    235 #: build/php/class-settings.php:479 php/class-settings.php:479
    236 msgid "If you have found a bug or think a specific feature is missing, %slet me know%s in the support forum. Like this plugin? %sRate it%s or %sbuy me a cookie%s!"
    237 msgstr "Wenn du einen Fehler gefunden hast oder eine bestimmte Funktion vermisst, %ssag im Support-Forum Bescheid%s. Dir gefällt das Plugin? %sHinterlasse eine Bewertung%s oder %sspende für die Entwicklung%s!"
    238 
    239 #: build/php/class-help.php:82 php/class-help.php:82
     80#: php/class-help.php:82
    24081msgid "PHP-Functions"
    24182msgstr "PHP-Funktionen"
    24283
    243 #: php/class-settings.php:583
    244 msgid "All parameters are optional. If %s the current post's id will be used. %s is either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32)."
    245 msgstr "Alle Parameter sind optional. Wenn %s gilt, wird die ID des aktuellen Beitrags genutzt. %s ist entweder ein String (thumbnail, medium, large oder full) oder ein Array mit zwei Stellen (Breite und Höhe); Zum Beispiel array(32,32)."
    246 
    247 #: build/php/class-help.php:115 php/class-help.php:115
    248 msgid "The functions are implemented corresponding to the original %sfunctions%s: They are intended to be used and to act the same way. Take a look into the WordPress Codex for further guidance:"
    249 msgstr "Die Funktionen sind nach den original %sFunktionen%s implementiert. Sie sollten genauso genutzt werden können und sich genauso verhalten. Schau dir für mehr Informationen den WordPress Codex an:"
    250 
    251 #: build/php/class-help.php:119 php/class-help.php:119
    252 msgid "Featured Image"
    253 msgstr "Beitragsbild"
    254 
    255 #: build/php/class-help.php:156 php/class-help.php:156
    256 msgid "Displays the video in its default size."
    257 msgstr "Stellt das Video in seiner Standardgröße dar."
    258 
    259 #: php/class-settings.php:620
    260 msgid "Displays the video with an width of 300 pixel. Height will be fitted to the aspect ratio."
    261 msgstr "Stellt das Video mit einer Breite von 300 Pixeln dar. Die Höhe wird automatisch angepasst, so dass das Seitenverhältniss erhalten bleibt."
    262 
    263 #: php/class-settings.php:624
    264 msgid "Displays the video with an fixed width and height."
    265 msgstr "Stellt das Video mit fester Breite und Höhe dar."
    266 
    267 #. Plugin URI of the plugin/theme
    268 #:
    269 msgid "http://yrnxt.com/wordpress/featured-video-plus/"
    270 msgstr "http://yrnxt.com/wordpress/featured-video-plus/"
    271 
    272 #. Description of the plugin/theme
    273 #:
    274 msgid "Add Featured Videos to your posts and pages."
    275 msgstr "Füge deinen Beiträgen und Seiten Beitragsvideos hinzu."
    276 
    277 #. Author of the plugin/theme
    278 #:
    279 msgid "Alexander Höreth"
    280 msgstr "Alexander Höreth"
    281 
    282 #. Author URI of the plugin/theme
    283 #:
    284 msgid "http://yrnxt.com"
    285 msgstr "http://yrnxt.com"
    286 
    287 #: build/php/class-help.php:41 php/class-help.php:41
    288 msgid "Alternatively you can select one of the videos from your media library using the small media icon to the right in the URL input field. The plugin makes use of %sWordPress' native HTML5 video functionality%s - no gurantee for compatibility with all formats."
    289 msgstr "Alternativ kannst du eines deiner eigenen Videos aus der Medienbibliothek auswählen indem du das kleine Icon rechts im URL Eingabefeld anklickst. Das Plugin nutzt die %WordPress eigene HTML5 Video-Funktionalität%s - keine Garantie dafür, dass alle Formate funktionieren."
    290 
    291 #: build/php/class-help.php:104 php/class-help.php:104
     84#: php/class-help.php:104
    29285msgctxt "%1$s is a boolean condition, \\\"post_id == null\\\", %2$s is a PHP variable, %2$s is a list of strings in paranthesis."
    29386msgid "All parameters are optional. If %1$s the current post's id will be used. %2$s is either a string %2$s or a 2-item array representing width and height in pixels, e.g. array(32,32)."
    29487msgstr "Alle Parameter sind optional. Wenn %1$s, wird die ID des aktuellen Posts genutzt. %2$s kann entweder ein String %2$s oder ein Array mit 2 Elementen sein die die Breite und Höhe in Pixeln festlegen, z.B. array(32, 32)."
    29588
    296 #: build/php/class-help.php:111 build/php/class-settings.php:198
    29789#: php/class-help.php:111 php/class-settings.php:198
    29890msgid "or"
    29991msgstr "oder"
    30092
    301 #: build/php/class-help.php:143 php/class-help.php:143
     93#: php/class-help.php:115
     94msgid "The functions are implemented corresponding to the original %sfunctions%s: They are intended to be used and to act the same way. Take a look into the WordPress Codex for further guidance:"
     95msgstr "Die Funktionen sind nach den original %sFunktionen%s implementiert. Sie sollten genauso genutzt werden können und sich genauso verhalten. Schau dir für mehr Informationen den WordPress Codex an:"
     96
     97#: php/class-help.php:119
     98msgid "Featured Image"
     99msgstr "Beitragsbild"
     100
     101#: php/class-help.php:143
    302102msgid "Featured Video Plus: Shortcode"
    303103msgstr "Featured Video Plus: Shortcode"
    304104
    305 #: build/php/class-help.php:160 php/class-help.php:160
     105#: php/class-help.php:156
     106msgid "Displays the video in its default size."
     107msgstr "Stellt das Video in seiner Standardgröße dar."
     108
     109#: php/class-help.php:160
    306110msgid "Displays the video with a width of 300 pixel. Height will be fitted such that the aspect ratio is preserved."
    307111msgstr "Stellt das Video mit einer Breite von 300 Pixeln dar. Die Höhe wird automatisch so angepasst, dass das Seitenverhältnis erhalten bleibt."
    308112
    309 #: build/php/class-help.php:164 php/class-help.php:164
     113#: php/class-help.php:164
    310114msgid "Displays the video with a fixed width and height."
    311115msgstr "Stellt das Video mit einer absoluten Höhe und Breite dar."
    312116
    313 #: build/php/class-settings.php:169 php/class-settings.php:169
     117#: php/class-settings.php:50
     118msgid "Display mode"
     119msgstr "Modus"
     120
     121#: php/class-settings.php:58
     122msgid "Display Conditions"
     123msgstr "Konditionen"
     124
     125#: php/class-settings.php:68
     126msgid "Video Sizing"
     127msgstr "Videogröße"
     128
     129#: php/class-settings.php:77
     130msgid "Video Align"
     131msgstr "Positionierung"
     132
     133#: php/class-settings.php:86
     134msgid "Default Arguments"
     135msgstr "Parameter"
     136
     137#: php/class-settings.php:95
     138msgid "Support"
     139msgstr "Support"
     140
     141#: php/class-settings.php:116
     142msgid "To display your featured videos you can either make use of the automatic replacement, use the %s or manually edit your theme's source files to make use of the plugins PHP-functions."
     143msgstr "Um die Artikelvideos anzuzeigen kannst du entweder das automatische Ersetzen der Artikelbilder nutzen, auf den %s zurückgreifen oder manuel die PHP-Funktionen in deine Theme Dateien integrieren."
     144
     145#: php/class-settings.php:117
     146msgid "For more information about Shortcode and PHP functions see the %sContextual Help%s."
     147msgstr "Für mehr Informationen über den Shortcode und die PHP-Funktionen schaue in die %sHilfe%s."
     148
     149#: php/class-settings.php:125
     150msgid "The current theme does not support featured images."
     151msgstr "Das aktuelle Theme unterstützt keine Beitragsbilder."
     152
     153#: php/class-settings.php:128
     154msgid "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s."
     155msgstr "Um Beitragsvideos darzustellen musst du leider den %1$sShortcode%2$s oder die %1$sPHP-Funktionen%2$s nutzen."
     156
     157#: php/class-settings.php:151
     158msgid "Replace featured image automatically."
     159msgstr "Beitragsbild automatisch ersetzen."
     160
     161#: php/class-settings.php:152
     162msgid "Replace featured image on click."
     163msgstr "Beitragsbild bei anklicken ersetzen."
     164
     165#: php/class-settings.php:153
     166msgid "Open video overlay when featured image is clicked."
     167msgstr "Video in Overlay darstellen."
     168
     169#: php/class-settings.php:154
     170msgid "Manual: PHP-functions or shortcodes."
     171msgstr "Manuell: PHP-Funktionen oder Shortcode."
     172
     173#: php/class-settings.php:160
     174msgid "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality."
     175msgstr "Automatische Integration (Optionen 1 bis 3) benötigen ein Theme das die nativen WordPress %sBeitragsbild%s Funktionen nutzt."
     176
     177#: php/class-settings.php:169
    314178msgid "Always use replace mode when viewing %ssingle%s posts and pages."
    315179msgstr "Auf %seinzelnen%s Seiten immer \"automatisch ersetzen\" nutzen."
    316180
    317 #: build/php/class-settings.php:225 php/class-settings.php:225
     181#: php/class-settings.php:203
     182msgid "View options are not available in manual mode."
     183msgstr "Darstellungsoptionen sind im manuellen Modus nicht verfügbar."
     184
     185#: php/class-settings.php:213
     186msgid "Apply display mode..."
     187msgstr "Darstellungsmodus anwenden..."
     188
     189#: php/class-settings.php:219
     190msgid "when viewing %ssingle%s posts and pages %s"
     191msgstr "wenn %seinzelne%s Beiträge oder Seiten angeschaut werden %s"
     192
     193#: php/class-settings.php:225
    318194msgid "when on the %spost index page%s %s"
    319195msgstr "wenn auf der %sIndex-Seite%s %s"
    320196
    321 #: build/php/class-settings.php:231 php/class-settings.php:231
     197#: php/class-settings.php:231
    322198msgid "when inside the %smain query%s of each page %s"
    323199msgstr "wenn innerhalb des %Main-Queries%s einer jeden Seite %s"
    324200
    325 #: build/php/class-settings.php:237 php/class-settings.php:237
     201#: php/class-settings.php:237
    326202msgid "when displaying %ssticky%s posts."
    327203msgstr "wenn ein %ssticky%s Post dargestellt wird."
    328204
    329 #: build/php/class-settings.php:249 php/class-settings.php:249
     205#: php/class-settings.php:242
     206msgid "when displaying not %ssticky%s posts."
     207msgstr "wenn nicht %sangeheftete%s Beiträge angezeigt werden."
     208
     209#: php/class-settings.php:249
    330210msgid "If none of the above options is selected the display mode will be applied whenever possible."
    331211msgstr "Wenn keine der obenstehenden Optionen gewählt ist, wird der festgelegte Darstellungsmodus immer wenn möglich angewendet."
    332212
    333 #: build/php/class-settings.php:213 php/class-settings.php:213
    334 msgid "Apply display mode..."
    335 msgstr "Darstellungsmodus anwenden..."
    336 
    337 #: build/php/class-settings.php:219 php/class-settings.php:219
    338 msgid "when viewing %ssingle%s posts and pages %s"
    339 msgstr "wenn %seinzelne%s Beiträge oder Seiten angeschaut werden %s"
    340 
    341 #: build/php/class-backend.php:662 php/class-backend.php:662
    342 msgid "Remove featured image"
    343 msgstr "Beitragsbild entfernen"
    344 
    345 #: build/php/class-settings.php:242 php/class-settings.php:242
    346 msgid "when displaying not %ssticky%s posts."
    347 msgstr "wenn nicht %sangeheftete%s Beiträge angezeigt werden."
    348 
     213#: php/class-settings.php:274
     214msgid "Responsive"
     215msgstr "Dynamisch"
     216
     217#: php/class-settings.php:281
     218msgid "Width in pixels:"
     219msgstr "Breite in Pixeln:"
     220
     221#: php/class-settings.php:298
     222msgid "The %1$sresponsive%2$s setting does not work when using the %1$soverlay%2$s display mode and might break completly in some themes - in such cases you should use a fixed width instead."
     223msgstr "Die %1$dynamisch%2$s Einstellung funktioniert nicht in allen Themes und speziell auch nicht im %1$sOverlay%2$s-Modus. In dem Fall muss eine absolute Breite angegeben werden."
     224
     225#: php/class-settings.php:319
     226msgid "left"
     227msgstr "links"
     228
     229#: php/class-settings.php:320
     230msgid "center"
     231msgstr "zentriert"
     232
     233#: php/class-settings.php:321
     234msgid "right"
     235msgstr "rechts"
     236
     237#: php/class-settings.php:345
     238msgid "Not all of the following options might be supported by all providers."
     239msgstr "Nicht alle der folgenden Einstellungen werden von allen Providern unterstützt."
     240
     241#: php/class-settings.php:353
     242msgid "Loop"
     243msgstr "Dauerschleife"
     244
     245#: php/class-settings.php:360
     246msgid "Always autoplay."
     247msgstr "Immer automatisch abspielen."
     248
     249#: php/class-settings.php:361
     250msgid "Autoplay when..."
     251msgstr "Automatisch abspielen, wenn..."
     252
     253#: php/class-settings.php:368
     254msgid "... lazy loading videos."
     255msgstr "... Videos nachträglich geladen werden."
     256
     257#: php/class-settings.php:370
     258msgid "... viewing %ssingle%s posts and pages."
     259msgstr "... %seinzelne%s Posts oder Seiten angezeigt werden."
     260
     261#: php/class-settings.php:380
     262msgid "If the owner of a video is a Plus member, some of these settings may be overridden by their preferences."
     263msgstr "Wenn der Videoeigentümer Vimeo-Plus Mitglied ist, kann er die folgenden Einstellungen für sein Video überschreiben."
     264
     265#: php/class-settings.php:395
     266msgid "Hide user's portrait"
     267msgstr "Nutzerbild verbergen."
     268
     269#: php/class-settings.php:399
     270msgid "Hide video title"
     271msgstr "Videotitel verbergen."
     272
     273#: php/class-settings.php:403
     274msgid "Hide video byline"
     275msgstr "Erstellerzeile verbergen."
     276
     277#: php/class-settings.php:416
     278msgid "Light theme"
     279msgstr "Helles Theme."
     280
     281#: php/class-settings.php:420
     282msgid "White highlight color"
     283msgstr "Weiße Betonungsfarbe."
     284
     285#: php/class-settings.php:422
     286msgid "Hide YouTube logo"
     287msgstr "YouTube Logo verbergen."
     288
     289#: php/class-settings.php:425
     290msgid "Hide annotations"
     291msgstr "Anmerkungen verbergen."
     292
     293#: php/class-settings.php:429 php/class-settings.php:479
     294msgid "Hide related videos"
     295msgstr "Verwandte Videos verbergen."
     296
     297#: php/class-settings.php:433
     298msgid "Disallow fullscreen"
     299msgstr "Vollbildmodus unterdrücken."
     300
     301#: php/class-settings.php:437 php/class-settings.php:475
     302msgid "Hide video info"
     303msgstr "Videoinfo verbergen."
     304
     305#: php/class-settings.php:439
     306msgid "Enable JavaScript API"
     307msgstr "JavaScript API aktivieren."
     308
     309#: php/class-settings.php:471
     310msgid "Hide DailyMotion logo"
     311msgstr "DailyMotion Logo verbergen."
     312
     313#: php/class-settings.php:483
     314msgid "Turn HD on by default"
     315msgstr "HD automatisch einschalten."
     316
     317#: php/class-settings.php:502
     318msgid "If you have found a bug or think a specific feature is missing, %slet me know%s in the support forum. Like this plugin? %sRate it%s or %sbuy me a cookie%s!"
     319msgstr "Wenn du einen Fehler gefunden hast oder eine bestimmte Funktion vermisst, %ssag im Support-Forum Bescheid%s. Dir gefällt das Plugin? %sHinterlasse eine Bewertung%s oder %sspende für die Entwicklung%s!"
     320
     321#. Plugin URI of the plugin/theme
     322msgid "http://yrnxt.com/wordpress/featured-video-plus/"
     323msgstr "http://yrnxt.com/wordpress/featured-video-plus/"
     324
     325#. Description of the plugin/theme
     326msgid "Add Featured Videos to your posts and pages."
     327msgstr "Füge deinen Beiträgen und Seiten Beitragsvideos hinzu."
     328
     329#. Author of the plugin/theme
     330msgid "Alexander Höreth"
     331msgstr "Alexander Höreth"
     332
     333#. Author URI of the plugin/theme
     334msgid "http://yrnxt.com"
     335msgstr "http://yrnxt.com"
  • featured-video-plus/trunk/php/class-backend.php

    r1457131 r1555602  
    136136     */
    137137    public function metabox_content() {
    138         wp_nonce_field( FVP_NAME . FVP_VERSION, 'fvp_nonce' );
    139 
    140         // Get current post's id.
    141138        $post_id = isset( $_GET['post'] ) ? $_GET['post'] : $GLOBALS['post']->ID;
    142 
    143139        $options = get_option( 'fvp-settings' );
    144140        $meta = get_post_meta( $post_id, '_fvp_video', true );
     141
    145142        $has_post_video = has_post_video( $post_id );
    146143
     
    188185        $content .= '</div>';
    189186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
    190199        // 'Current theme does not support Featured Images' warning.
    191200        if (
     
    193202            'manual' !== $options['mode']
    194203        ) {
    195             $content .= '<p class="fvp-warning description">';
     204            $content .= '<>';
    196205            $content .= sprintf(
    197206                '<span style="font-weight: bold;">%s</span>&nbsp;',
     
    212221                '</a>'
    213222            );
    214                 '</p>';
     223                '</p>';
    215224        }
    216225
    217226        echo "\n\n\n<!-- Featured Video Plus Metabox -->\n";
     227
    218228        echo $content;
    219         echo "<!-- Featured Video Plus Metabox End-->\n\n\n";
     229        echo "<!-- Featured Video Plus Metabox End-->\n\n\n";
    220230    }
    221231
     
    229239     * @param {int} $post_id
    230240     */
    231     public function metabox_save( $post_id ){
    232         if ( ! self::has_valid_nonce( $_POST ) ) {
    233             return false;
    234         }
     241    public function metabox_save( $post_id ) {
     242        self::verify_nonce( $post_id );
    235243
    236244        if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ||
     
    260268     */
    261269    public function metabox_save_ajax() {
    262         if ( ! self::has_valid_nonce( $_POST ) || empty( $_POST['id'] ) ) {
     270        $post_id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : -1;
     271        if (
     272            $post_id === -1 ||
     273            ! self::verify_nonce( $post_id, true ) ||
     274            ! current_user_can( 'edit_post', $post_id )
     275        ) {
    263276            wp_send_json_error();
    264277        }
    265278
    266279        $post = array(
    267             'id' => (int) $_POST['id'],
     280            'id' => ,
    268281            'fvp_video' => ! empty( $_POST['fvp_video'] ) ? $_POST['fvp_video'] : '',
    269282            'fvp_set_featimg' =>
     
    271284        );
    272285
    273         // this also verifies the nonce
    274286        $meta = $this->save( $post );
    275287
     
    279291        );
    280292
    281         if ( has_post_video( $post['id'] ) ) {
    282             $video = get_the_post_video( $post['id'], array( 256, 144 ) );
    283             $response = array(
    284                 'type'     => 'update',
    285                 'valid'    => isset( $meta['valid'] ) ? $meta['valid'] : null,
    286                 'video'    => $video,
    287                 'img'      => $img,
    288                 'provider' => isset( $meta['provider'] ) ? $meta['provider'] : null
    289             );
    290         } else {
    291             $response = array(
    292                 'task'  => 'remove',
    293                 'valid' => isset( $meta['valid'] ) ? $meta['valid'] : null,
    294                 'img'   => $img,
    295             );
    296         }
     293        $response = array(
     294            'valid'    => isset( $meta['valid'] ) ? $meta['valid'] : null,
     295            'video'    => get_the_post_video( $post['id'], array( 256, 144 ) ),
     296            'img'      => $img,
     297            'full'     => $meta['full'],
     298            'provider' => isset( $meta['provider'] ) ? $meta['provider'] : null
     299        );
    297300
    298301        wp_send_json_success( $response );
     
    313316
    314317        // parse video url
    315         $url = ! empty( $post['fvp_video'] ) ? trim( $post['fvp_video'] ) : '';
     318        $ = ! empty( $post['fvp_video'] ) ? trim( $post['fvp_video'] ) : '';
    316319
    317320        // Was this a force-auto-set featimg action?
     
    321324        // URL is empty AND did not change.
    322325        if ( ! $setimg && (
    323             ( ! empty( $meta['full'] ) && $url == $meta['full'] ) ||
    324             (   empty( $meta['full'] ) && empty( $url ) )
     326            ( ! empty( $meta['full'] ) && $ == $meta['full'] ) ||
     327            (   empty( $meta ) )
    325328        ) ) {
    326329            return false;
     
    328331
    329332        // there was a video and we want to delete it
    330         if ( ! empty( $meta['full'] ) && empty( $url ) ) {
     333        if ( ) ) {
    331334            delete_post_meta( $post['id'], '_fvp_video' );
    332335            if ( get_post_thumbnail_id( $post['id'] ) == $meta['img'] ) {
     
    336339        }
    337340
    338         $data = $this->get_video_data( $url );
     341        $data = $this->get_video_data( $ );
    339342
    340343        // Do we have a screen capture to pull?
     
    356359        $meta = array_merge(
    357360            array(
    358                 'full'     => $url,
    359                 'img'      => ! empty( $img ) ? $img : null,
    360                 'valid'    => 1, // can be overwritten by $data
    361                 'provider' => 'raw', // "
     361                'valid' => true, // can be overwritten by $data
     362                'img' => ! empty( $img ) ? $img : null,
    362363            ),
    363364            $data
     
    374375     * @since 1.5.0
    375376     *
    376      * @param  {string} $url The video URL
     377     * @param  {string} $ The video URL
    377378     * @return {assoc}  Associative array containing the video information data
    378379     */
    379     private function get_video_data( $url ) {
     380    private function get_video_data( $video ) {
     381        $video = trim( self::kses_video( stripslashes( $video ) ) );
     382        $provider = null;
    380383        $data = array();
    381384
    382385        $local = wp_upload_dir();
    383         $islocal = strpos( $url, $local['baseurl'] );
    384 
    385         // handle local videos
     386        $islocal = strpos( $video, $local['baseurl'] );
    386387        if ( false !== $islocal ) {
    387388            $provider = 'local';
    388 
    389             // handle external videos
     389        } elseif ( $video !== strip_tags( $video ) ) {
     390           
    390391        } else {
    391             $raw = $this->oembed->request( $url );
    392 
    393             // If no provider is returned the URL is invalid
    394             if ( empty( $raw ) || empty( $raw->provider_name ) ) {
    395                 return array( 'valid' => false );
     392            $v = $this->oembed->request( $video );
     393            if ( ! empty( $raw ) && ! empty( $raw->provider_name ) ) {
     394                $provider = strtolower( $v->provider_name );
     395
     396                $data = array(
     397                    'id'          => null,
     398                    'provider'    => $provider,
     399                    'title'       => ! empty( $v->title ) ? $v->title : null,
     400                    'author'      => ! empty( $v->author_name ) ? $v->author_name : null,
     401                    'description' => ! empty( $v->description ) ? $v->description : null,
     402                    'img_url'     => ! empty( $v->thumbnail_url ) ? $v->thumbnail_url : null,
     403                    'filename'    => ! empty( $v->title ) ? $v->title : null,
     404                    'full'        => $video,
     405                    'parameters'  => $this->oembed->get_args( $video, $provider ),
     406                );
    396407            }
    397 
    398             $provider = strtolower( $raw->provider_name );
    399 
    400             $data = array(
    401                 'id'          => null,
    402                 'provider'    => $provider,
    403                 'title'       => ! empty( $raw->title )         ? $raw->title : null,
    404                 'author'      => ! empty( $raw->author_name )   ? $raw->author_name : null,
    405                 'description' => ! empty( $raw->description )   ? $raw->description : null,
    406                 'img_url'     => ! empty( $raw->thumbnail_url ) ? $raw->thumbnail_url : null,
    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             }
    419         }
    420 
    421         $data['parameters'] = $this->oembed->get_args( $url, $provider );
    422 
    423         // provider specific handling
     408        }
     409
    424410        switch ( $provider ) {
    425 
    426             // local video
     411            case 'dailymotion':
     412                $id = $this->oembed->get_video_id( $video );
     413                $img = $this->oembed->get_thumbnail_url( $provider, $id );
     414                return array_merge( $data, array(
     415                    'id' => $id,
     416                    'img_url' => $img !== false ? $img : null,
     417                ) );
     418
    427419            case 'local':
     420
    428421                $ext_legal = array( 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv' );
    429                 $ext = pathinfo( $url, PATHINFO_EXTENSION );
    430 
    431                 // check if extension is legal
     422                $ext = pathinfo( $video, PATHINFO_EXTENSION );
    432423                if ( empty( $ext ) || ! in_array( $ext, $ext_legal ) ) {
    433                     return array( 'valid' => false );
     424                    return array(
     425                        'full' => $video,
     426                    );
    434427                }
    435428
    436                 $data = array(
    437                     'provider' => 'local',
    438                     'id'  => self::get_post_by_url( $url ),
    439                     'url' => $url,
     429                array(
     430                    'provider' => ,
     431                    'id' ),
     432                    ',
    440433                );
    441                 break;
    442         }
    443 
    444         return ! empty( $data ) ? $data : false;
     434
     435            case 'raw':
     436                return array(
     437                    'provider' => $provider,
     438                    'full' => $video,
     439                );
     440
     441            default:
     442                if ( ! empty( $data ) ) {
     443                    return $data;
     444                } else {
     445                    return array(
     446                        'valid' => false,
     447                        'full' => $video,
     448                    );
     449                }
     450        }
    445451    }
    446452
     
    548554     */
    549555    public function ajax_get_embed() {
    550         if ( ! self::has_valid_nonce( $_POST ) || empty( $_POST['id'] ) ) {
     556        $post_id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : -1;
     557        if (
     558            $post_id === -1 ||
     559            ! self::verify_nonce( $post_id, true )
     560        ) {
    551561            wp_send_json_error();
    552562        }
    553563
    554         // Parse post id.
    555         $id = (int) $_POST['id'];
    556 
    557         if ( has_post_video( $id ) ) {
     564        if ( has_post_video( $post_id ) ) {
    558565            // Return featured video html as requested.
    559             $video = $this->get_the_post_video( $id, null, true );
     566            $video = $this->get_the_post_video( $id, null, true );
    560567            wp_send_json_success( $video );
    561568        } else {
    562569            // Post has no video, return featured image html.
    563             $image = get_the_post_thumbnail( $id );
     570            $image = get_the_post_thumbnail( $id );
    564571            wp_send_json_success( $image );
    565572        }
     
    577584     */
    578585    public function ajax_remove_img() {
    579         if ( ! self::has_valid_nonce( $_POST ) || empty( $_POST['id'] ) ) {
     586        $post_id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : -1;
     587        if (
     588            $post_id === -1 ||
     589            ! self::verify_nonce( $post_id ) ||
     590            ! current_user_can( 'edit_post', $post_id )
     591        ) {
    580592            wp_send_json_error();
    581593        }
    582594
    583         // Retrieve post id and check user capabilities.
    584         $id = (int) $_POST['id'];
    585         if ( ! current_user_can( 'edit_post', $id ) ) {
    586             wp_send_json_error();
    587         }
    588595
    589596        // Retrieve featured video metadata.
    590         $meta = get_post_meta( $id, '_fvp_video', true );
     597        $meta = get_post_meta( $id, '_fvp_video', true );
    591598
    592599        // Delete the image from database if feasible. This also again tries to
    593600        // remove the link of the featured image to the post although it will
    594601        // probably already be unlinked by WordPress internal functionality.
    595         $this->delete_featured_image( $id, $meta );
     602        $this->delete_featured_image( $id, $meta );
    596603
    597604        // Remember that we do not want to set a featured image automatically for
     
    603610
    604611        // Save meta.
    605         update_post_meta( $id, '_fvp_video', $meta );
     612        update_post_meta( $id, '_fvp_video', $meta );
    606613
    607614        // Respond to the client.
    608         $html = _wp_post_thumbnail_html( get_post_thumbnail_id( $id ), $id );
    609         wp_send_json_success( $html );
     615        wp_send_json_success(
     616            _wp_post_thumbnail_html( get_post_thumbnail_id( $post_id ), $post_id )
     617        );
    610618    }
    611619
     
    632640                    'featured-video-plus'
    633641                ),
    634                 '<a href="#" onclick="jQuery(\'.fvp-video\').val(\'http://youtu.be/CfNHleTEpTI\').trigger(\'blur\'); return false;">',
     642                '<a href="#" onclick="jQuery(\'.fvp-video\').val(\'http://youtu.be/CfNHleTEpTI\').trigger(\'blur\'); return false;">',
    635643                '</a>'
    636644            ) . '</p><p>' . sprintf(
     
    728736     * Gets post id by it's url / guid.
    729737     *
    730      * @see http://codex.wordpress.org/Class_Reference/wpdb
     738     * @see http://codex.wordpress.org/Class_Reference/wpdb
    731739     * @since 1.0
    732740     *
     
    747755
    748756    /**
    749      * Check the given assoc array for a 'fvp_nonce' field and check if this
    750      * field contains a valid nonce.
    751      *
    752      * @param  {assoc}  $post_data
    753      * @return boolean
    754      */
    755     private static function has_valid_nonce( $post_data ) {
     757     * Verify the current request's nonce. Nonce is expected in the REQUEST
     758     * object's `fvp_nonce` field.
     759     *
     760     * @param  int/string $identifier nonce identifier
     761     * @param  bool       $bool       whether to return a boolean or strictly exit
     762     * @return bool/none  Return bool if $bool is set to true
     763     */
     764    private static function verify_nonce( $identifier, $bool = false ) {
     765        $action = self::get_nonce_action( $identifier );
     766
    756767        if (
    757             ! isset( $post_data['fvp_nonce'] ) ||
    758             ! wp_verify_nonce( $post_data['fvp_nonce'], FVP_NAME . FVP_VERSION )
     768            ! isset( $] ) ||
     769            ! wp_verify_nonce( $ )
    759770        ) {
     771
     772
     773
     774
     775
    760776            return false;
    761777        }
     
    764780    }
    765781
     782
     783
     784
     785
     786
     787
     788
     789
     790
     791
     792
     793
     794
     795
     796
     797
     798
     799
     800
     801
     802
     803
     804
     805
     806
     807
     808
     809
     810
     811
     812
     813
     814
     815
     816
     817
     818
     819
     820
     821
     822
     823
     824
     825
     826
     827
     828
     829
    766830
    767831    /**
  • featured-video-plus/trunk/php/class-frontend.php

    r1245652 r1555602  
    8888        wp_localize_script( 'fvp-frontend', 'fvpdata', array(
    8989            'ajaxurl'  => admin_url( 'admin-ajax.php' ),
    90             'nonce'    => wp_create_nonce( FVP_NAME . FVP_VERSION ),
     90            'nonce'    => wp_create_nonce( ),
    9191            'fitvids'  => ! empty( $options['sizing']['responsive'] ) &&
    9292                          $options['sizing']['responsive'],
  • featured-video-plus/trunk/php/class-help.php

    r1172119 r1555602  
    3333                'featured-video-plus'
    3434            ),
    35             '<a href="https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F" target="_blank">',
     35            '<a href="https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F" target="_blank">',
    3636            '</a>'
    3737        ) );
     
    6060                    'featured-video-plus'
    6161                ),
    62                 '<a href="http://goo.gl/yxov27" target="_blank">',
     62                '<a href="http">',
    6363                '</a>'
    6464            )
     
    117117                'featured-video-plus'
    118118            ),
    119             '<a href="http://codex.wordpress.org/Post_Thumbnails#Function_Reference" target="_blank">' . esc_html__( 'Featured Image' ) . '&nbsp;',
     119            '<a href="http">' . esc_html__( 'Featured Image' ) . '&nbsp;',
    120120            '</a>'
    121121        ) );
     
    123123        // WordPress Featured Image functions
    124124        $content[] = FVP_HTML::unordered_list( array(
    125             '<code><a href="https://developer.wordpress.org/reference/functions/the_post_thumbnail/" target="_blank">get_the_post_thumbnail</a></code>',
    126             '<code><a href="https://developer.wordpress.org/reference/functions/wp_get_attachment_image/" target="_blank">wp_get_attachment_image</a></code>',
     125            '<code><a href="https://developer.wordpress.org/reference/functions/the_post_thumbnail/" target="_blank">get_the_post_thumbnail</a></code>',
     126            '<code><a href="https://developer.wordpress.org/reference/functions/wp_get_attachment_image/" target="_blank">wp_get_attachment_image</a></code>',
    127127        ) );
    128128
  • featured-video-plus/trunk/php/class-main.php

    r1245652 r1555602  
    175175        $attr
    176176    ) {
    177         $size = self::get_size();
    178 
    179177        $options = get_option( 'fvp-settings' );
    180178        $mode = ! empty( $options['mode'] ) ? $options['mode'] : null;
    181179        $conditions = ! empty( $options['conditions'] ) ?
    182180            $options['conditions'] : null;
    183         $single_replace = is_single() &&
     181        $single_replace = is_sing() &&
    184182            ! empty( $options['single_replace'] ) && $options['single_replace'];
    185183
     
    281279        $options = get_option( 'fvp-settings' );
    282280
    283         // fixed size requested as array( width => #, height => # ) or array( #, # )
    284281        if ( is_array( $size ) ) {
     282
    285283                $width = isset( $size['width'] ) && is_numeric( $size['width'] ) ?
    286284                    $size['width'] :
     
    290288                    ( isset( $size[1] ) && is_numeric( $size[1] ) ? $size[1] : null );
    291289
    292             // size requested using a string pointing to a WordPress preset
    293290        } elseif ( is_string( $size ) ) {
     291
    294292            global $_wp_additional_image_sizes;
    295293            $presets = get_intermediate_image_sizes();
     
    306304            }
    307305
    308             // single number provided - use it for the width
    309306        } elseif ( is_numeric( $size ) ) {
     307
    310308            $width = $size;
    311309        }
     
    317315
    318316        if ( empty( $height ) ) {
    319             // calculate height relative to width
     317            //
    320318            $height = ! empty( $original ) ?
    321319                round( $original['height'] * ($width / $original['width']) ) :
     
    364362
    365363    /**
     364
     365
     366
     367
     368
     369
     370
     371
     372
     373
     374
    366375     * Check a given set of display conditions if one or more of them hold. If
    367376     * an empty set is given, return true.
     
    429438            ! empty( $options['autoplay']['single'] ) &&
    430439            $options['autoplay']['single'] &&
    431             is_single()
     440            is_sing()
    432441        ) {
    433442            return true;
  • featured-video-plus/trunk/php/class-oembed.php

    r1457131 r1555602  
    348348    private function filter_legal_args( $provider, $args ) {
    349349        $legals = array(
     350
     351
     352
     353
    350354
    351355            // YouTube.com
     
    428432
    429433        if ( ! empty( $legals[ $provider ] ) ) {
    430             foreach ( $legals[ $provider ] AS $key => $value ) {
    431                 if ( array_key_exists( $value, $args ) &&
    432                      ! is_null( $args[ $value ] )
    433                 ) {
    434                     $key = is_numeric( $key ) ? $value : $key;
    435                     $result[ $key ] = urlencode( $args[ $value ] );
     434            $combinedlegals = array_merge( $legals['default'], $legals[ $provider ] );
     435            foreach ( $combinedlegals AS $key => $val ) {
     436                if ( array_key_exists( $val, $args ) && ! is_null( $args[ $val ] ) ) {
     437                    $key = is_numeric( $key ) ? $val : $key;
     438                    $result[ $key ] = urlencode( $args[ $val ] );
    436439                }
    437440            }
  • featured-video-plus/trunk/php/class-settings.php

    r1202444 r1555602  
    2727     * Initializes the plugin settings section, the settings fields and registers the options field and save function.
    2828     *
    29      * @see http://codex.wordpress.org/Settings_API
     29     * @see http://codex.wordpress.org/Settings_API
    3030     * @since 1.0
    3131     */
     
    7777            esc_html__( 'Video Align', 'featured-video-plus' ),
    7878            array( $this, 'alignment' ),
     79
     80
     81
     82
     83
     84
     85
     86
     87
    7988            self::$page,
    8089            self::$section
     
    158167
    159168        echo FVP_HTML::description(
    160             sprintf( esc_html__( "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality.", 'featured-video-plus' ), '<a href="http://codex.wordpress.org/Post_Thumbnails" target="_blank">', '</a>' )
    161         );
    162 
    163         // Always replace on is_single() ?
     169            sprintf( esc_html__( "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality.", 'featured-video-plus' ), '<a href="http">', '</a>' )
     170        );
     171
     172        // Always replace on is_sing() ?
    164173        echo FVP_HTML::conditional(
    165174            '<br />' .
     
    171180                        'featured-video-plus'
    172181                    ),
    173                     '<a href="http://codex.wordpress.org/Function_Reference/is_single" target="_blank">',
     182                    '<a href="http">',
    174183                    '</a>'
    175184                ),
     
    186195
    187196    /**
    188      * Video replace condition option like is_single or is_home.
     197     * Video replace condition option like is_sing or is_home.
    189198     *
    190199     * @since  2.0.0
    ��  
    218227                    'single' => sprintf(
    219228                        esc_html__( 'when viewing %ssingle%s posts and pages %s', 'featured-video-plus' ),
    220                         '<a href="http://codex.wordpress.org/Function_Reference/is_single" target="_blank">',
     229                        '<a href="http">',
    221230                        '</a>',
    222231                        $or
     
    224233                    'home' => sprintf(
    225234                        esc_html__( 'when on the %spost index page%s %s', 'featured-video-plus' ),
    226                         '<a href="http://codex.wordpress.org/Function_Reference/is_home" target="_blank">',
     235                        '<a href="http">',
    227236                        '</a>',
    228237                        $or
     
    230239                    'main_query' => sprintf(
    231240                        esc_html__( 'when inside the %smain query%s of each page %s', 'featured-video-plus' ),
    232                         '<a href="https://developer.wordpress.org/reference/functions/is_main_query/" target="_blank">',
     241                        '<a href="https://developer.wordpress.org/reference/functions/is_main_query/" target="_blank">',
    233242                        '</a>',
    234243                        $or
     
    236245                    'sticky' => sprintf(
    237246                        esc_html__( 'when displaying %ssticky%s posts.', 'featured-video-plus' ),
    238                         '<a href="http://codex.wordpress.org/Function_Reference/is_sticky" target="_blank">',
     247                        '<a href="http">',
    239248                        '</a>'
    240249                    ),
    241250                    '!sticky' => sprintf(
    242251                        esc_html__( 'when displaying not %ssticky%s posts.', 'featured-video-plus' ),
    243                         '<a href="http://codex.wordpress.org/Function_Reference/is_sticky" target="_blank">',
     252                        '<a href="http">',
    244253                        '</a>'
    245254                    )
     
    301310            array( 'fvp_warning' )
    302311        );
    303 
    304312    }
    305313
     
    322330            ),
    323331            ! empty( $options['alignment'] ) ? $options['alignment'] : 'center'
     332
     333
     334
     335
     336
     337
     338
     339
     340
     341
     342
     343
     344
     345
     346
     347
     348
     349
     350
     351
     352
     353
     354
     355
     356
     357
     358
     359
     360
     361
    324362        );
    325363    }
     
    369407                        'single' => sprintf(
    370408                            esc_html__( '... viewing %ssingle%s posts and pages.', 'featured-video-plus' ),
    371                             '<a href="http://codex.wordpress.org/Function_Reference/is_single" target="_blank">', '</a>'
     409                            '<a href="http">', '</a>'
    372410                        ),
    373411                    ),
     
    504542                    'featured-video-plus'
    505543                ),
    506                 '<a href="https://wordpress.org/support/plugin/featured-video-plus#plugin-title" title="Featured Video Plus Support Forum on WordPress.org" target="_blank" style="font-weight: bold;">',
     544                '<a href="https://wordpress.org/support/plugin/featured-video-plus#plugin-title" title="Featured Video Plus Support Forum on WordPress.org" target="_blank" style="font-weight: bold;">',
    507545                '</a>',
    508                 '<a href="https://wordpress.org/support/view/plugin-reviews/featured-video-plus#plugin-title" title="Rate Featured Video Plus on WordPress.org" target="_blank" style="font-weight: bold;">',
     546                '<a href="https://wordpress.org/support/view/plugin-reviews/featured-video-plus#plugin-title" title="Rate Featured Video Plus on WordPress.org" target="_blank" style="font-weight: bold;">',
    509547                '</a>',
    510                 '<a href="https://paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6" title="Gift to the developer!" target="_blank" style="font-weight: bold;">',
     548                '<a href="https://paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6" title="Gift to the developer!" target="_blank" style="font-weight: bold;">',
    511549                '</a>'
    512550            )
     
    545583                '!sticky'    => 'BOOLEAN',
    546584            ),
    547             'alignment' => '(left|center|right)',
    548585            'sizing' => array(
    549586                'responsive' => 'BOOLEAN',
    550587                'width'      => $patterns['number'],
     588
     589
     590
     591
     592
     593
    551594            ),
    552595            'autoplay' => array(
  • featured-video-plus/trunk/php/inc-upgrade.php

    r1202444 r1555602  
    221221        unset( $options['default_args']['general']['autoplay'] );
    222222
     223
     224
     225
     226
     227
     228
     229
    223230
    224231    default:
  • featured-video-plus/trunk/readme.txt

    r1457131 r1555602  
    66Author: Alexander Höreth
    77Author URI: http://yrnxt.com/
    8 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6
     8Donate link: https://www.paypal.
    99License: GPL-2.0
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111Requires at least: 3.7
    12 Tested up to: 4.5
    13 Stable tag: 2.2.3
     12Tested up to: 4.
     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.
     
    28283. manually make use of the __PHP-functions__ in your theme's source files.
    2929
     30
     31
    3032> <strong>Theme compatibility</strong><br>
    3133> Sadly many themes do not follow the WordPress standards and implement their own fancy functions for displaying featured images - those very likely break this plugin. Check out the [FAQ](https://wordpress.org/plugins/featured-video-plus/faq/). Another common problem are sliders: Videos, in general, do not like sliders at all.
     
    3840
    3941> <strong>Support</strong><br>
    40 > I do read all support questions in the [forums](https://wordpress.org/support/plugin/featured-video-plus) but cannot reply to all of them. The plugin is an unpaid side project and full support would require more time than I can invest for free for over 10k active installs. If you really need help, consider [buying me a cookie](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6) - best way to attract my attention and to support future enhancements.
     42> I do read all support questions in the [forums](http0k active installs. If you really need help, consider [buying me a cookie](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6) - best way to attract my attention and to support future enhancements.
    4143
    4244
     
    8789
    8890= Why do I just get text back after adding an URL to the Featured Video input? =
    89 If the plugin just displays the URL back as text it probably does not recognize that it comes from a video provider. Try inserting the raw embed code instead and [check the docs](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) to see which providers are supported.
     91If the plugin just [check the docs](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) to see which providers are supported.
    9092
    9193= How do I use my local videos? =
    9294Click the small media icon in the Featured Video input box on the post edit screen and upload your video or choose it from the media library. WordPress does not support all formats tho, [check this table](http://www.mediaelementjs.com/#devices) for details.
    9395
    94 = Why do I not see a featuerd video or image on the frontend at all? =
    95 For the videos to be automatically displayed you need to define a Featured Image. This image will never be shown if a video is available. If your theme does not support featured images the plugin also has no chance of working out of the box.
     96= Why do I not see a featud video or image on the frontend at all? =
     97For the videos to be automatically displayed you need to define a Featured Image. . If your theme does not support featured images the plugin also has no chance of working out of the box.
    9698
    9799= Why does the frontend still display the featured image although I added a featured video to the post? =
     
    101103Take a look at your media settings and try using a fixed width instead of responsive sizing.
    102104
     105
     106
     107
    103108= Can I help translating the plugin? =
    104 Yes, please! Check out the public [Featured Video Plus Translation Project](https://poeditor.com/join/project?hash=WlyLh0cFO3).
     109Yes, please! Check out the ).
    105110
    106111
    107112
    108113== Changelog ==
     114
     115
     116
     117
     118
     119
     120
    109121
    110122= 2.2.3: 2016-07-19 =
  • featured-video-plus/trunk/styles/backend.css

    r1181216 r1555602  
    2020  border: 1px solid #808080;
    2121  background-color: #fff;
     22
     23
     24
     25
     26
    2227}
    2328#featured-video-plus-box .fvp-warning {
  • featured-video-plus/trunk/styles/backend.less

    r1457131 r1555602  
    2424        border: 1px solid #808080;
    2525        background-color: #fff;
     26
     27
     28
     29
     30
    2631    }
    2732
Note: See TracChangeset for help on using the changeset viewer.