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

Version Description

Download this release

Release Info

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

Code changes from version 8.9.5 to 8.9.2

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
  );
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
  );
public/functions-shortcodes.php CHANGED
@@ -1,27 +1,5 @@
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 = '';
@@ -30,41 +8,41 @@ function arve_shortcode_arve( $input_atts, $content = null, $arve_shortcode = tr
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++ ) {
@@ -99,7 +77,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 +111,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 = '';
8
  $input_atts = (array) $input_atts;
9
 
10
  $pairs = array(
11
+ 'align' => $options['align'],
12
+ 'arve_link' => arve_bool_to_shortcode_string( $options['promote_link'] ),
13
+ 'aspect_ratio' => null,
14
+ 'autoplay' => arve_bool_to_shortcode_string( $options['autoplay'] ),
15
+ 'description' => null,
16
+ 'duration' => null,
17
+ 'disable_flash' => null,
18
+ 'iframe_name' => null,
19
+ 'maxwidth' => (string) $options['video_maxwidth'],
20
+ 'mode' => $options['mode'],
21
+ 'parameters' => null,
22
+ 'src' => null, // Just a alias for url to make it simple
23
+ 'thumbnail' => null,
24
+ 'title' => null,
25
+ 'upload_date' => null,
26
  // <video>
27
+ 'm4v' => null,
28
+ 'mp4' => null,
29
+ 'ogv' => null,
30
+ 'webm' => null,
31
+ 'preload' => 'metadata',
32
+ 'playsinline' => null,
33
+ 'muted' => null,
34
+ 'controls' => 'y',
35
+ 'controlslist' => empty( $options['controlslist'] ) ? null : (string) $options['controlslist'],
36
+ 'loop' => 'n',
37
  // TED only
38
+ 'lang' => null,
39
  // Vimeo only
40
+ 'start' => null,
41
  // Old Shortcodes / URL embeds
42
+ 'id' => null,
43
+ 'provider' => null,
44
  // deprecated, title should be used
45
+ 'link_text' => null,
46
  );
47
 
48
  for ( $n = 1; $n <= ARVE_NUM_TRACKS; $n++ ) {
77
  $output = apply_filters( 'arve_output', $normal_embed, $html, $atts );
78
 
79
  if ( empty( $output ) ) {
80
+ return arve_error( 'The output is empty, this should not happen' );
81
  } elseif ( is_wp_error( $output ) ) {
82
  return arve_error( $output->get_error_message() );
83
  }
111
  add_shortcode( $shortcode, $function );
112
  }
113
 
114
+ add_shortcode( 'arve', 'arve_shortcode_arve' );
115
  add_shortcode( 'arve-supported', 'arve_shortcode_arve_supported' );
116
  add_shortcode( 'arve-supported-list', 'arve_shortcode_arve_supported_list' );
117
  add_shortcode( 'arve-params', 'arve_shortcode_arve_params' );
readme.txt CHANGED
@@ -156,19 +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.
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-18 - 8.9.2 ###
160
 
161
  * Fix possible "not a string" errors.
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(