Featured Video Plus - Version 2.3.3

Version Description

Download this release

Release Info

Developer a.hoereth
Plugin Icon 128x128 Featured Video Plus
Version 2.3.3
Comparing to
See all releases

Code changes from version 2.3.2 to 2.3.3

CHANGELOG.md CHANGED
@@ -1,10 +1,11 @@
1
  # Changelog #
2
 
3
- ## 2.3.2: 2016-12-16 ##
4
- * Quick fix for *illegal video* message when using oEmbed. ([*](https://wordpress.org/support/topic/illegal-warning-displays-on-youtube-videos-2/), [*](https://wordpress.org/support/topic/illegal-warning-displays-on-youtube-videos/))
5
 
6
- ## 2.3.1: 2016-12-16 ##
7
- * Quick fix for *are you sure* error on post creation. ([*](https://wordpress.org/support/topic/latest-update-causing-error/), [*](https://wordpress.org/support/topic/error-are-you-sure-you-want-to-do-this-3/))
 
8
 
9
  ## 2.3.0: 2016-12-15 ##
10
  * Now compatible with [Video SEO](https://yoast.com/wordpress/plugins/video-seo/)! ([*](https://wordpress.org/support/topic/compatibility-with-video-seo), [*](https://wordpress.org/support/topic/video-seo-featured-video-plus-compatability), [*](https://wordpress.org/support/topic/fantastic-a-must-have-for-all-video-sites))
1
  # Changelog #
2
 
3
+ ## 2.3.3: 2016-12-17 ##
4
+ * Fix frontend ajax requests. ([*](https://wordpress.org/support/topic/video-overlay-does-not-work/))
5
 
6
+ ## 2.3.1 & 2.3.2: 2016-12-16 ##
7
+ * Fix for *illegal video* message when using oEmbed. ([*](https://wordpress.org/support/topic/illegal-warning-displays-on-youtube-videos-2/), [*](https://wordpress.org/support/topic/illegal-warning-displays-on-youtube-videos/))
8
+ * Fix for *are you sure* error on post creation. ([*](https://wordpress.org/support/topic/latest-update-causing-error/), [*](https://wordpress.org/support/topic/error-are-you-sure-you-want-to-do-this-3/))
9
 
10
  ## 2.3.0: 2016-12-15 ##
11
  * Now compatible with [Video SEO](https://yoast.com/wordpress/plugins/video-seo/)! ([*](https://wordpress.org/support/topic/compatibility-with-video-seo), [*](https://wordpress.org/support/topic/video-seo-featured-video-plus-compatability), [*](https://wordpress.org/support/topic/fantastic-a-must-have-for-all-video-sites))
featured-video-plus.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Featured Video Plus
4
  Plugin URI: http://yrnxt.com/wordpress/featured-video-plus/
5
  Description: Add Featured Videos to your posts and pages.
6
- Version: 2.3.2
7
  Author: Alexander Höreth
8
  Author URI: http://yrnxt.com
9
  Text Domain: featured-video-plus
@@ -32,7 +32,7 @@ License: GPL-2.0
32
  // ********************
33
  // CONSTANTS
34
  if ( ! defined( 'FVP_VERSION' ) ) {
35
- define( 'FVP_VERSION', '2.3.2' );
36
  }
37
 
38
  $pathinfo = pathinfo( dirname( plugin_basename( __FILE__ ) ) );
3
  Plugin Name: Featured Video Plus
4
  Plugin URI: http://yrnxt.com/wordpress/featured-video-plus/
5
  Description: Add Featured Videos to your posts and pages.
6
+ Version: 2.3.3
7
  Author: Alexander Höreth
8
  Author URI: http://yrnxt.com
9
  Text Domain: featured-video-plus
32
  // ********************
33
  // CONSTANTS
34
  if ( ! defined( 'FVP_VERSION' ) ) {
35
+ define( 'FVP_VERSION', '2.3.3' );
36
  }
37
 
38
  $pathinfo = pathinfo( dirname( plugin_basename( __FILE__ ) ) );
php/class-backend.php CHANGED
@@ -269,7 +269,7 @@ class FVP_Backend extends Featured_Video_Plus {
269
  $post_id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : -1;
270
  if (
271
  $post_id === -1 ||
272
- ! self::verify_nonce( $post_id, true ) ||
273
  ! current_user_can( 'edit_post', $post_id )
274
  ) {
275
  wp_send_json_error();
@@ -555,7 +555,7 @@ class FVP_Backend extends Featured_Video_Plus {
555
  $post_id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : -1;
556
  if (
557
  $post_id === -1 ||
558
- ! self::verify_nonce( $post_id, true )
559
  ) {
560
  wp_send_json_error();
561
  }
269
  $post_id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : -1;
270
  if (
271
  $post_id === -1 ||
272
+ ! self::verify_nonce( $post_id ) ||
273
  ! current_user_can( 'edit_post', $post_id )
274
  ) {
275
  wp_send_json_error();
555
  $post_id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : -1;
556
  if (
557
  $post_id === -1 ||
558
+ ! self::verify_nonce( 'frontend' )
559
  ) {
560
  wp_send_json_error();
561
  }
php/class-main.php CHANGED
@@ -58,11 +58,9 @@ class Featured_Video_Plus {
58
  // Autoplay option. Suppressed when viewing admin.
59
  $general['autoplay'] = self::parse_autoplay_options( $options, $ajax );
60
 
61
- // Responsive scaling option. Not used when viewing the admin screen.
62
- $responsive =
63
- ! empty($options['sizing']['responsive']) &&
64
- $options['sizing']['responsive'] &&
65
- ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ! is_admin() );
66
 
67
  // Alignment option
68
  $align = ! empty($options['alignment']) ? $options['alignment'] : 'center';
@@ -180,6 +178,8 @@ class Featured_Video_Plus {
180
  $options['conditions'] : null;
181
  $single_replace = is_singular() &&
182
  ! empty( $options['single_replace'] ) && $options['single_replace'];
 
 
183
 
184
  // Don't show a video.
185
  if ( ( 'manual' === $mode ) ||
@@ -227,7 +227,7 @@ class Featured_Video_Plus {
227
  }
228
 
229
  // Replace the featured image with the video.
230
- return get_the_post_video( $post_id, $size ) . $onload;
231
  }
232
 
233
 
@@ -310,14 +310,14 @@ class Featured_Video_Plus {
310
 
311
  if ( empty( $width ) ) {
312
  $width = ! empty( $options['sizing']['width'] ) ?
313
- $options['sizing']['width'] : 1280;
314
  }
315
 
316
  if ( empty( $height ) ) {
317
  // Calculate height relative to width.
318
  $height = ! empty( $original ) ?
319
  round( $original['height'] * ($width / $original['width']) ) :
320
- $height = $width / 16 * 9;
321
  }
322
 
323
  return array(
58
  // Autoplay option. Suppressed when viewing admin.
59
  $general['autoplay'] = self::parse_autoplay_options( $options, $ajax );
60
 
61
+ // Responsive scaling option.
62
+ $responsive = ! empty( $options['sizing']['responsive'] ) &&
63
+ $options['sizing']['responsive'];
 
 
64
 
65
  // Alignment option
66
  $align = ! empty($options['alignment']) ? $options['alignment'] : 'center';
178
  $options['conditions'] : null;
179
  $single_replace = is_singular() &&
180
  ! empty( $options['single_replace'] ) && $options['single_replace'];
181
+ $responsive = ! empty( $options['sizing']['responsive'] ) &&
182
+ $options['sizing']['responsive'];
183
 
184
  // Don't show a video.
185
  if ( ( 'manual' === $mode ) ||
227
  }
228
 
229
  // Replace the featured image with the video.
230
+ return get_the_post_video( $post_id, $responsive ? $size : null ) . $onload;
231
  }
232
 
233
 
310
 
311
  if ( empty( $width ) ) {
312
  $width = ! empty( $options['sizing']['width'] ) ?
313
+ floatval( $options['sizing']['width'] ) : 1280;
314
  }
315
 
316
  if ( empty( $height ) ) {
317
  // Calculate height relative to width.
318
  $height = ! empty( $original ) ?
319
  round( $original['height'] * ($width / $original['width']) ) :
320
+ round( $width / 16 * 9 );
321
  }
322
 
323
  return array(
readme.txt CHANGED
@@ -10,7 +10,7 @@ License: GPL-2.0
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  Requires at least: 3.7
12
  Tested up to: 4.7
13
- Stable tag: 2.3.2
14
 
15
  Add Featured Videos to your posts and pages. Works like magic with most themes which use Featured Images. Local Media, YouTube, Vimeo and many more.
16
 
@@ -112,11 +112,12 @@ Yes, please! Check out the official [Featured Video Plus Translation Project](ht
112
 
113
  == Changelog ==
114
 
115
- = 2.3.2: 2016-12-16 =
116
- * Quick fix for *illegal video* message when using oEmbed. ([*](https://wordpress.org/support/topic/illegal-warning-displays-on-youtube-videos-2/), [*](https://wordpress.org/support/topic/illegal-warning-displays-on-youtube-videos/))
117
 
118
- = 2.3.1: 2016-12-16 =
119
- * Quick fix for *are you sure* error on post creation. ([*](https://wordpress.org/support/topic/latest-update-causing-error/), [*](https://wordpress.org/support/topic/error-are-you-sure-you-want-to-do-this-3/))
 
120
 
121
  = 2.3.0: 2016-12-15 =
122
  * Now compatible with [Video SEO](https://yoast.com/wordpress/plugins/video-seo/)! ([*](https://wordpress.org/support/topic/compatibility-with-video-seo), [*](https://wordpress.org/support/topic/video-seo-featured-video-plus-compatability), [*](https://wordpress.org/support/topic/fantastic-a-must-have-for-all-video-sites))
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  Requires at least: 3.7
12
  Tested up to: 4.7
13
+ Stable tag: 2.3.3
14
 
15
  Add Featured Videos to your posts and pages. Works like magic with most themes which use Featured Images. Local Media, YouTube, Vimeo and many more.
16
 
112
 
113
  == Changelog ==
114
 
115
+ = 2.3.3: 2016-12-17 =
116
+ * Fix frontend ajax requests. ([*](https://wordpress.org/support/topic/video-overlay-does-not-work/))
117
 
118
+ = 2.3.1 & 2.3.2: 2016-12-16 =
119
+ * Fix for *illegal video* message when using oEmbed. ([*](https://wordpress.org/support/topic/illegal-warning-displays-on-youtube-videos-2/), [*](https://wordpress.org/support/topic/illegal-warning-displays-on-youtube-videos/))
120
+ * Fix for *are you sure* error on post creation. ([*](https://wordpress.org/support/topic/latest-update-causing-error/), [*](https://wordpress.org/support/topic/error-are-you-sure-you-want-to-do-this-3/))
121
 
122
  = 2.3.0: 2016-12-15 =
123
  * Now compatible with [Video SEO](https://yoast.com/wordpress/plugins/video-seo/)! ([*](https://wordpress.org/support/topic/compatibility-with-video-seo), [*](https://wordpress.org/support/topic/video-seo-featured-video-plus-compatability), [*](https://wordpress.org/support/topic/fantastic-a-must-have-for-all-video-sites))