ARVE Advanced Responsive Video Embedder (YouTube, Vimeo, HTML5 Video …) - Version 8.9.1

Version Description

Download this release

Release Info

Developer nico23
Plugin Icon 128x128 ARVE Advanced Responsive Video Embedder (YouTube, Vimeo, HTML5 Video …)
Version 8.9.1
Comparing to
See all releases

Code changes from version 8.9.5 to 8.9.1

LICENSE.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  GNU GENERAL PUBLIC LICENSE
2
  Version 3, 29 June 2007
3
 
1
+ class-arve-vimeo.php
2
+ Vimeo Video Post Lite
3
+ https://wordpress.org/plugins/codeflavors-vimeo-video-post-lite/
4
+ GPL 2.0 or later
5
+
6
  GNU GENERAL PUBLIC LICENSE
7
  Version 3, 29 June 2007
8
 
admin/arve-shortcode-ui.js CHANGED
@@ -17,9 +17,9 @@ function arve_extract_url( changed, collection, shortcode ) {
17
  return;
18
  }
19
 
20
- if( val.match(/src="?([^\s"]+)/) ) {
21
 
22
- var test_url = val.match(/src="?([^\s"]+)/),
23
  only_url = test_url && test_url[1];
24
 
25
  input.val( only_url ).trigger( 'input' );
17
  return;
18
  }
19
 
20
+ if( val.match(/src="([^"]+)/) ) {
21
 
22
+ var test_url = val.match(/src="([^"]+)/),
23
  only_url = test_url && test_url[1];
24
 
25
  input.val( only_url ).trigger( 'input' );
advanced-responsive-video-embedder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: ARVE Advanced Responsive Video Embedder
4
  * Plugin URI: https://nextgenthemes.com/plugins/arve-pro/
5
  * Description: Easy responsive video embeds via URL (like WordPress) or Shortcodes. Supports almost anything you can imagine.
6
- * Version: 8.9.5
7
  * Author: Nicolas Jonas
8
  * Author URI: https://nextgenthemes.com
9
  * License: GPL-3.0
@@ -19,7 +19,7 @@ if ( ! defined( 'WPINC' ) ) {
19
  }
20
 
21
  define( 'ARVE_SLUG', 'advanced-responsive-video-embedder' );
22
- define( 'ARVE_VERSION', '8.9.5' );
23
  define( 'ARVE_PRO_VERSION_REQUIRED', '4.0.0' );
24
 
25
  define( 'ARVE_URL', plugin_dir_url( __FILE__ ) );
3
  * Plugin Name: ARVE Advanced Responsive Video Embedder
4
  * Plugin URI: https://nextgenthemes.com/plugins/arve-pro/
5
  * Description: Easy responsive video embeds via URL (like WordPress) or Shortcodes. Supports almost anything you can imagine.
6
+ * Version: 8.9.1
7
  * Author: Nicolas Jonas
8
  * Author URI: https://nextgenthemes.com
9
  * License: GPL-3.0
19
  }
20
 
21
  define( 'ARVE_SLUG', 'advanced-responsive-video-embedder' );
22
+ define( 'ARVE_VERSION', '8.9.1' );
23
  define( 'ARVE_PRO_VERSION_REQUIRED', '4.0.0' );
24
 
25
  define( 'ARVE_URL', plugin_dir_url( __FILE__ ) );
public/functions-shortcode-filters.php CHANGED
@@ -14,7 +14,7 @@ function arve_get_wrapper_id( $a ) {
14
  static $wrapper_ids = array();
15
  $wrapper_id = null;
16
 
17
- foreach ( array( 'id', 'mp4', 'm4v', 'webm', 'ogv', 'url', 'random_video_url', 'webtorrent' ) as $att ) {
18
 
19
  if ( ! empty( $a[ $att ] ) && is_string( $a[ $att ] ) ) {
20
  $wrapper_id = 'arve-' . $a[ $att ];
@@ -95,14 +95,13 @@ function arve_sc_filter_attr( $a ) {
95
  }
96
 
97
  $a['iframe_attr'] = array(
98
- 'allow' => 'autoplay; fullscreen',
99
  'allowfullscreen' => '',
100
  'class' => 'arve-iframe fitvidsignore',
101
  'frameborder' => '0',
102
  'name' => $a['iframe_name'],
103
- 'sandbox' => 'allow-scripts allow-same-origin allow-presentation allow-popups',
104
  'scrolling' => 'no',
105
  'src' => $iframe_src,
 
106
  'width' => empty( $a['width'] ) ? false : $a['width'],
107
  'height' => empty( $a['height'] ) ? false : $a['height'],
108
  );
@@ -165,10 +164,12 @@ function arve_sc_filter_sanitise( $atts ) {
165
 
166
  foreach ( $atts as $key => $value ) {
167
 
168
- $atts[ $key ] = (string) $value;
 
 
169
 
170
- if ( '' === $value ) {
171
- $atts[ $key ] = null;
172
  }
173
  }
174
 
@@ -422,21 +423,21 @@ function arve_sc_filter_build_tracks_html( $atts ) {
422
  return $atts;
423
  }
424
 
425
- preg_match( '#-(?<type>captions|chapters|descriptions|metadata|subtitles)-(?<lang>[a-z]{2}).vtt$#i', $atts[ "track_{$n}" ], $matches );
426
 
427
  if ( empty( $matches[1] ) ) {
428
  $atts[ "track_{$n}" ] = new WP_Error( 'track', __( 'Track kind or language code could not detected from filename', ARVE_SLUG ) );
429
  return $atts;
430
  }
431
 
432
- $label = empty( $atts[ "track_{$n}_label" ] ) ? arve_get_language_name_from_code( $matches['lang'] ) : $atts[ "track_{$n}_label" ];
433
 
434
  $attr = array(
435
  'default' => ( 1 === $n ) ? true : false,
436
- 'kind' => $matches['type'],
437
  'label' => $label,
438
  'src' => $atts[ "track_{$n}" ],
439
- 'srclang' => $matches['lang'],
440
  );
441
 
442
  $atts['video_tracks_html'] .= sprintf( '<track%s>', arve_attr( $attr) );
14
  static $wrapper_ids = array();
15
  $wrapper_id = null;
16
 
17
+ foreach ( array( 'id', 'mp4', 'm4v', 'webm', 'ogv', 'url', 'webtorrent' ) as $att ) {
18
 
19
  if ( ! empty( $a[ $att ] ) && is_string( $a[ $att ] ) ) {
20
  $wrapper_id = 'arve-' . $a[ $att ];
95
  }
96
 
97
  $a['iframe_attr'] = array(
 
98
  'allowfullscreen' => '',
99
  'class' => 'arve-iframe fitvidsignore',
100
  'frameborder' => '0',
101
  'name' => $a['iframe_name'],
 
102
  'scrolling' => 'no',
103
  'src' => $iframe_src,
104
+ 'sandbox' => 'allow-scripts allow-same-origin allow-presentation allow-popups',
105
  'width' => empty( $a['width'] ) ? false : $a['width'],
106
  'height' => empty( $a['height'] ) ? false : $a['height'],
107
  );
164
 
165
  foreach ( $atts as $key => $value ) {
166
 
167
+ if ( null === $value ) {
168
+ continue;
169
+ }
170
 
171
+ if( ! is_string( $value ) ) {
172
+ $atts[ $key ] = arve_error( sprintf( __( '<code>%s</code> is not a string. Only Strings should be passed to the shortcode function', ARVE_SLUG ), $key ) );
173
  }
174
  }
175
 
423
  return $atts;
424
  }
425
 
426
+ preg_match( '#-(captions|chapters|descriptions|metadata|subtitles)-([a-z]{2}).vtt$#i', $atts[ "track_{$n}" ], $matches );
427
 
428
  if ( empty( $matches[1] ) ) {
429
  $atts[ "track_{$n}" ] = new WP_Error( 'track', __( 'Track kind or language code could not detected from filename', ARVE_SLUG ) );
430
  return $atts;
431
  }
432
 
433
+ $label = empty( $atts[ "track_{$n}_label" ] ) ? arve_get_language_name_from_code( $matches[2] ) : $atts[ "track_{$n}_label" ];
434
 
435
  $attr = array(
436
  'default' => ( 1 === $n ) ? true : false,
437
+ 'kind' => $matches[1],
438
  'label' => $label,
439
  'src' => $atts[ "track_{$n}" ],
440
+ 'srclang' => $matches[2],
441
  );
442
 
443
  $atts['video_tracks_html'] .= sprintf( '<track%s>', arve_attr( $attr) );
public/functions-shortcodes.php CHANGED
@@ -1,73 +1,53 @@
1
  <?php
2
 
3
- function arve_shortcode( $input_atts, $content = null ) {
4
-
5
- /**
6
- * Filters the default arve shortcode output.
7
- *
8
- * If the filtered output isn't empty, it will be used instead of generating
9
- * the default video template.
10
- *
11
- * @since 8.8.2
12
- *
13
- * @param string $html Empty variable to be replaced with shortcode markup.
14
- * @param array $atts Attributes of the shortcode.
15
- * @param string $content Video shortcode content.
16
- */
17
- $override = apply_filters( 'arve_shortcode_overwride', '', $input_atts, $content );
18
- if ( '' !== $override ) {
19
- return $override;
20
- }
21
-
22
- return arve_shortcode_arve( $input_atts, $content );
23
- }
24
-
25
  function arve_shortcode_arve( $input_atts, $content = null, $arve_shortcode = true ) {
26
 
27
  $errors = '';
28
  $options = arve_get_options();
29
  $properties = arve_get_host_properties();
30
  $input_atts = (array) $input_atts;
 
31
 
32
  $pairs = array(
33
- 'align' => $options['align'],
34
- 'arve_link' => arve_bool_to_shortcode_string( $options['promote_link'] ),
35
- 'aspect_ratio' => null,
36
- 'autoplay' => arve_bool_to_shortcode_string( $options['autoplay'] ),
37
- 'description' => null,
38
- 'duration' => null,
39
- 'disable_flash' => null,
40
- 'iframe_name' => null,
41
- 'maxwidth' => (string) $options['video_maxwidth'],
42
- 'mode' => $options['mode'],
43
- 'parameters' => null,
44
- 'src' => null, // Just a alias for url to make it simple
45
- 'thumbnail' => null,
46
- 'title' => null,
47
- 'upload_date' => null,
48
- // <video>
49
- 'm4v' => null,
50
- 'mp4' => null,
51
- 'ogv' => null,
52
- 'webm' => null,
53
- 'preload' => 'metadata',
54
- 'playsinline' => null,
55
- 'muted' => null,
56
- 'controls' => 'y',
57
- 'controlslist' => empty( $options['controlslist'] ) ? null : (string) $options['controlslist'],
58
- 'loop' => 'n',
59
- // TED only
60
- 'lang' => null,
61
- // Vimeo only
62
- 'start' => null,
63
- // Old Shortcodes / URL embeds
64
- 'id' => null,
65
- 'provider' => null,
66
- // deprecated, title should be used
67
- 'link_text' => null,
68
  );
69
 
70
  for ( $n = 1; $n <= ARVE_NUM_TRACKS; $n++ ) {
 
71
  $pairs["track_{$n}"] = null;
72
  $pairs["track_{$n}_label"] = null;
73
  }
@@ -99,7 +79,7 @@ function arve_shortcode_arve( $input_atts, $content = null, $arve_shortcode = tr
99
  $output = apply_filters( 'arve_output', $normal_embed, $html, $atts );
100
 
101
  if ( empty( $output ) ) {
102
- return arve_error( 'The output is empty, this should not happen', ARVE_SLUG );
103
  } elseif ( is_wp_error( $output ) ) {
104
  return arve_error( $output->get_error_message() );
105
  }
@@ -133,7 +113,7 @@ function arve_create_shortcodes() {
133
  add_shortcode( $shortcode, $function );
134
  }
135
 
136
- add_shortcode( 'arve', 'arve_shortcode' );
137
  add_shortcode( 'arve-supported', 'arve_shortcode_arve_supported' );
138
  add_shortcode( 'arve-supported-list', 'arve_shortcode_arve_supported_list' );
139
  add_shortcode( 'arve-params', 'arve_shortcode_arve_params' );
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  function arve_shortcode_arve( $input_atts, $content = null, $arve_shortcode = true ) {
4
 
5
  $errors = '';
6
  $options = arve_get_options();
7
  $properties = arve_get_host_properties();
8
  $input_atts = (array) $input_atts;
9
+ $f_atts = $input_atts;
10
 
11
  $pairs = array(
12
+ 'align' => $options['align'],
13
+ 'arve_link' => arve_bool_to_shortcode_string( $options['promote_link'] ),
14
+ 'aspect_ratio' => null,
15
+ 'autoplay' => arve_bool_to_shortcode_string( $options['autoplay'] ),
16
+ 'description' => null,
17
+ 'duration' => null,
18
+ 'disable_flash' => null,
19
+ 'iframe_name' => null,
20
+ 'maxwidth' => (string) $options['video_maxwidth'],
21
+ 'mode' => $options['mode'],
22
+ 'parameters' => null,
23
+ 'src' => null, # Just a alias for url to make it simple
24
+ 'thumbnail' => null,
25
+ 'title' => null,
26
+ 'upload_date' => null,
27
+ # <video>
28
+ 'm4v' => null,
29
+ 'mp4' => null,
30
+ 'ogv' => null,
31
+ 'webm' => null,
32
+ 'preload' => 'metadata',
33
+ 'playsinline' => null,
34
+ 'muted' => null,
35
+ 'controls' => 'y',
36
+ 'controlslist' => empty( $options['controlslist'] ) ? null : (string) $options['controlslist'],
37
+ 'loop' => 'n',
38
+ # TED only
39
+ 'lang' => null,
40
+ # Vimeo only
41
+ 'start' => null,
42
+ # Old Shortcodes / URL embeds
43
+ 'id' => null,
44
+ 'provider' => null,
45
+ # deprecated, title should be used
46
+ 'link_text' => null,
47
  );
48
 
49
  for ( $n = 1; $n <= ARVE_NUM_TRACKS; $n++ ) {
50
+
51
  $pairs["track_{$n}"] = null;
52
  $pairs["track_{$n}_label"] = null;
53
  }
79
  $output = apply_filters( 'arve_output', $normal_embed, $html, $atts );
80
 
81
  if ( empty( $output ) ) {
82
+ return arve_error( 'The output is empty, this should not happen' );
83
  } elseif ( is_wp_error( $output ) ) {
84
  return arve_error( $output->get_error_message() );
85
  }
113
  add_shortcode( $shortcode, $function );
114
  }
115
 
116
+ add_shortcode( 'arve', 'arve_shortcode_arve' );
117
  add_shortcode( 'arve-supported', 'arve_shortcode_arve_supported' );
118
  add_shortcode( 'arve-supported-list', 'arve_shortcode_arve_supported_list' );
119
  add_shortcode( 'arve-params', 'arve_shortcode_arve_params' );
readme.txt CHANGED
@@ -156,23 +156,6 @@ This plugins embed is considered as 'custom player' by YouTube so you have to pa
156
  * [ARVE Pro addon changelog](https://nextgenthemes.com/plugins/arve-pro/changelog/)
157
  * [ARVE AMP addon changelog](https://nextgenthemes.com/plugins/arve-amp/)
158
 
159
- ### 2018-06-07 - 8.9.5 ###
160
-
161
- * Fixed: When pasting embed codes into the Shortcode UI dialog the `src=` will be extracted even when no quotes are used.
162
- * Improved: Use youtube-nocookie.com domain again it is GPRP/Privacy friendly. Note the name is confusing as it sets cookies, but only when the user plays the video rather then just when loading the iframe. So its not "no cookies". But you can mention this into your cookie notices when dealing with GPRP.
163
-
164
- ### 2018-06-02 - 8.9.4 ###
165
-
166
- * Improved: Try to make autoplay in Chrome possible again. See [New Chrome Autoplay behavior](https://developers.google.com/web/updates/2017/09/autoplay-policy-changes). At the point of writing its not clear if the new iframe attribute makes them just autoplay no matter what. Please report your experiences.
167
-
168
- ### 2018-04-29 - 8.9.3 ###
169
-
170
- * Improved: Make overwrite of shortcode possible. Used in new [Random Video Addon](https://nextgenthemes.com/plugins/arve-random-video/)
171
-
172
- ### 2018-04-18 - 8.9.2 ###
173
-
174
- * Fix possible "not a string" errors.
175
-
176
  ### 2018-04-12 - 8.9.1 ###
177
 
178
  * New: Option to always load assets. Needed when dealing with AJAX and other special cases.
156
  * [ARVE Pro addon changelog](https://nextgenthemes.com/plugins/arve-pro/changelog/)
157
  * [ARVE AMP addon changelog](https://nextgenthemes.com/plugins/arve-amp/)
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  ### 2018-04-12 - 8.9.1 ###
160
 
161
  * New: Option to always load assets. Needed when dealing with AJAX and other special cases.
shared/functions-shared.php CHANGED
@@ -91,7 +91,7 @@ function arve_get_settings_definitions() {
91
  $current_mode_name = $options['mode'];
92
  }
93
 
94
- $definitions = array(
95
  array(
96
  'hide_from_settings' => true,
97
  'attr' => 'url',
@@ -377,16 +377,9 @@ function arve_get_settings_definitions() {
377
  'attr' => 'vimeo_api_token',
378
  'label' => esc_html__( 'Video API Token', ARVE_SLUG ),
379
  'type' => 'text',
380
- 'description' => sprintf(
381
- __( 'Needed for <a href="%s">Random Video Addon</a>.', ARVE_SLUG ),
382
- 'https://nextgenthemes.local/plugins/arve-random-video/'
383
- ),
384
  ),
385
  );
386
-
387
- $definitions = apply_filters( 'arve_settings_definitions', $definitions );
388
-
389
- return $definitions;
390
  }
391
 
392
  /**
@@ -1008,7 +1001,7 @@ function arve_get_host_properties() {
1008
  'youtube' => array(
1009
  'name' => 'YouTube',
1010
  'regex' => $s . '(youtube\.com\/\S*((\/e(mbed))?\/|watch\?(\S*?&?v\=))|youtu\.be\/)(?<id>[a-zA-Z0-9_-]{6,11}((\?|&)list=[a-z0-9_\-]+)?)',
1011
- 'embed_url' => 'https://www.youtube-nocookie.com/embed/%s',
1012
  'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1',
1013
  'auto_thumbnail' => true,
1014
  'auto_title' => true,
@@ -1204,7 +1197,7 @@ function arve_get_host_properties() {
1204
  'youtubelist' => array(
1205
  'regex' => $s . 'youtube\.com/(embed/videoseries|playlist)\?list=(?<id>[-a-z0-9_]+)',
1206
  'name' => 'YouTube Playlist',
1207
- 'embed_url' => 'https://www.youtube-nocookie.com/embed/videoseries?list=%s',
1208
  'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1',
1209
  'auto_thumbnail' => true,
1210
  'tests' => array(
91
  $current_mode_name = $options['mode'];
92
  }
93
 
94
+ return array(
95
  array(
96
  'hide_from_settings' => true,
97
  'attr' => 'url',
377
  'attr' => 'vimeo_api_token',
378
  'label' => esc_html__( 'Video API Token', ARVE_SLUG ),
379
  'type' => 'text',
380
+ 'description' => esc_html__( 'Leave blank for now.', ARVE_SLUG ),
 
 
 
381
  ),
382
  );
 
 
 
 
383
  }
384
 
385
  /**
1001
  'youtube' => array(
1002
  'name' => 'YouTube',
1003
  'regex' => $s . '(youtube\.com\/\S*((\/e(mbed))?\/|watch\?(\S*?&?v\=))|youtu\.be\/)(?<id>[a-zA-Z0-9_-]{6,11}((\?|&)list=[a-z0-9_\-]+)?)',
1004
+ 'embed_url' => 'https://www.youtube.com/embed/%s',
1005
  'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1',
1006
  'auto_thumbnail' => true,
1007
  'auto_title' => true,
1197
  'youtubelist' => array(
1198
  'regex' => $s . 'youtube\.com/(embed/videoseries|playlist)\?list=(?<id>[-a-z0-9_]+)',
1199
  'name' => 'YouTube Playlist',
1200
+ 'embed_url' => 'https://www.youtube.com/embed/videoseries?list=%s',
1201
  'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1',
1202
  'auto_thumbnail' => true,
1203
  'tests' => array(