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

Version Description

Download this release

Release Info

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

Code changes from version 9.7.16 to 9.7.18

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: 9.7.16
7
  * Author: Nicolas Jonas
8
  * Author URI: https://nextgenthemes.com
9
  * License: GPL-3.0
@@ -18,7 +18,7 @@
18
  */
19
  namespace Nextgenthemes\ARVE;
20
 
21
- const VERSION = '9.7.16';
22
  const PRO_VERSION_REQUIRED = '5.3.0-alpha1';
23
  const NUM_TRACKS = 3;
24
  const PLUGIN_FILE = __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: 9.7.18
7
  * Author: Nicolas Jonas
8
  * Author URI: https://nextgenthemes.com
9
  * License: GPL-3.0
18
  */
19
  namespace Nextgenthemes\ARVE;
20
 
21
+ const VERSION = '9.7.18';
22
  const PRO_VERSION_REQUIRED = '5.3.0-alpha1';
23
  const NUM_TRACKS = 3;
24
  const PLUGIN_FILE = __FILE__;
build/block.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '7fab7a1975070f1640e1');
1
+ <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => 'bd6299a64ee1ffc09b90');
build/block.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={};function t(){return t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(this,arguments)}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=window.wp.element,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"nextgenthemes/arve-block","title":"Video Embed (ARVE)","category":"embed","icon":"video-alt3","description":"Advanced Responsive Video Embedder","keywords":["embed","youtube","rumble","vimeo","odysee"],"version":"9.7.15","textdomain":"advanced-responsive-video-embedder","supports":{"align":["wide","full"]},"styles":[],"example":{"attributes":{"url":"https://www.youtube.com/watch?v=oe452WcY7fA","title":"Example Title"}},"editorScript":"arve-block","editorStyle":"arve","attributes":{"url":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"upload_date":{"type":"string"},"mode":{"type":"string"},"thumbnail":{"type":"string"},"hide_title":{"type":"boolean"},"grow":{"type":"string"},"fullscreen":{"type":"string"},"play_icon_style":{"type":"string"},"hover_effect":{"type":"string"},"disable_links":{"type":"string"},"align":{"type":"string"},"arve_link":{"type":"string"},"duration":{"type":"string"},"autoplay":{"type":"string"},"lightbox_maxwidth":{"type":"integer"},"sticky":{"type":"string"},"sticky_on_mobile":{"type":"string"},"sticky_position":{"type":"string"},"aspect_ratio":{"type":"string"},"parameters":{"type":"string"},"controlslist":{"type":"string"},"controls":{"type":"string"},"loop":{"type":"boolean"},"muted":{"type":"boolean"},"volume":{"type":"integer"},"random_video_url":{"type":"string"},"random_video_urls":{"type":"string"},"sandbox":{"type":"string"},"thumbnail_url":{"type":"string"}}}'),i=window.wp.i18n,a=window.wp.serverSideRender;var l=e.n(a);const o=window.wp.blockEditor,s=window.wp.components,c=window.wp.blocks,{name:d}=n,p=window.ARVEsettings,u=new DOMParser;function m(e){const t=[];return Object.entries(e).forEach((e=>{let[r,n]=e;const i={label:n,value:r};t.push(i)})),t}function b(e){if("string"!=typeof e.description)return"";if("string"==typeof e.descriptionlinktext){const t=e.description.split(e.descriptionlinktext);return(0,r.createElement)("span",null,(0,r.createElement)("span",null,t[0]),(0,r.createElement)("a",{href:e.descriptionlink},e.descriptionlinktext),",",(0,r.createElement)("span",null,t[1]))}return e.description}function g(e,t){const r=y(e,t);return e/r+":"+t/r}function y(e,t){return t?y(t,e%t):e}(0,c.registerBlockType)(d,{edit:function(e){const{attributes:{align:n},setAttributes:a}=e,c=(0,o.useBlockProps)(),d=function(e){const t=[],n={},a=(0,r.createElement)("p",null,(0,i.__)("To edit the featured image, you need permission to upload media."));let l=!1;Object.values(p).forEach((e=>{n[e.tag]=[]})),Object.entries(p).forEach((t=>{let[c,d]=t,p=e.attributes[c],y="";switch(d.type){case"boolean":"sandbox"===c&&void 0===p&&(p=!0),n[d.tag].push((0,r.createElement)(s.ToggleControl,{key:c,label:d.label,help:b(d),checked:!!p,onChange:t=>e.setAttributes({[c]:t})}));break;case"select":n[d.tag].push((0,r.createElement)(s.SelectControl,{key:c,value:p,label:d.label,help:b(d),options:m(d.options),onChange:t=>e.setAttributes({[c]:t})}));break;case"string":n[d.tag].push((0,r.createElement)(s.TextControl,{key:c,label:d.label,placeholder:d.placeholder,help:b(d),value:p,onChange:t=>(function(e,t,r){if("url"===e){const e=u.parseFromString(t,"text/html").querySelector("iframe");if(e&&e.getAttribute("src")){t=e.src;const n=e.width,i=e.height;n&&i&&r.setAttributes({aspect_ratio:g(n,i)})}}}(c,t,e),e.setAttributes({[c]:t}))}));break;case"attachment":y=e.attributes[c+"_url"],n[d.tag].push((0,r.createElement)(s.BaseControl,{className:"editor-post-featured-image",help:b(d),key:c},(0,r.createElement)(o.MediaUploadCheck,{fallback:a},(0,r.createElement)(o.MediaUpload,{title:(0,i.__)("Thumbnail"),onSelect:t=>(l=t,e.setAttributes({[c]:t.id.toString(),[c+"_url"]:t.url})),unstableFeaturedImageFlow:!0,allowedTypes:["image"],modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return(0,r.createElement)("div",{className:"editor-post-featured-image__container"},(0,r.createElement)(s.Button,{className:p?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:t,"aria-label":p?(0,i.__)("Edit or update the image"):null,"aria-describedby":p?`editor-post-featured-image-${p}-describedby`:""},!!p&&!!y&&(0,r.createElement)("div",{style:{overflow:"hidden"}},(0,r.createElement)(s.ResponsiveWrapper,{naturalWidth:640,naturalHeight:360,isInline:!0},(0,r.createElement)("img",{src:y,alt:"ARVE Thumbnail",style:{width:"100%",height:"100%",objectFit:"cover"}}))),!p&&(0,i.__)("Set Thumbnail")),(0,r.createElement)(s.DropZone,null))},value:p})),!!p&&!!y&&(0,r.createElement)(o.MediaUploadCheck,null,(0,r.createElement)(o.MediaUpload,{title:(0,i.__)("Thumbnail"),onSelect:t=>(l=t,e.setAttributes({[c]:t.id.toString(),[c+"_url"]:t.url})),unstableFeaturedImageFlow:!0,allowedTypes:["image"],modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return(0,r.createElement)(s.Button,{onClick:t,isSecondary:!0},(0,i.__)("Replace Thumbnail"))}})),!!p&&(0,r.createElement)(o.MediaUploadCheck,null,(0,r.createElement)(s.Button,{onClick:()=>e.setAttributes({[c]:"",[c+"_url"]:""}),isLink:!0,isDestructive:!0},(0,i.__)("Remove Thumbnail")))))}}));let c=!0;return n.main.push((0,r.createElement)(s.BaseControl,{key:"info",help:(0,i.__)("You can disable the extensive help texts on the ARVE settings page to clean up this UI","advanced-responsive-video-embedder")},(0,r.createElement)(s.BaseControl.VisualLabel,null,(0,i.__)("Info","advanced-responsive-video-embedder")))),Object.keys(n).forEach((e=>{var i;t.push((0,r.createElement)(s.PanelBody,{key:e,title:(i=e,i.charAt(0).toUpperCase()+i.slice(1)),initialOpen:c},n[e])),c=!1})),t}(e);return[(0,r.createElement)("div",t({},c,{key:"block"}),(0,r.createElement)("div",{className:"arve-select-helper",style:{textAlign:"center",padding:".1em"}},(0,i.__)("Select ARVE block","advanced-responsive-video-embedder")),(0,r.createElement)(l(),{block:"nextgenthemes/arve-block",attributes:e.attributes})),(0,r.createElement)(o.InspectorControls,{key:"insp"},d)]}})})();
1
+ (()=>{"use strict";var e={};function t(){return t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(this,arguments)}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=window.wp.element,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"nextgenthemes/arve-block","title":"Video Embed (ARVE)","category":"embed","icon":"video-alt3","description":"Advanced Responsive Video Embedder","keywords":["embed","youtube","rumble","vimeo","odysee"],"version":"9.7.17","textdomain":"advanced-responsive-video-embedder","supports":{"align":["wide","full"]},"styles":[],"example":{"attributes":{"url":"https://www.youtube.com/watch?v=oe452WcY7fA","title":"Example Title"}},"editorScript":"arve-block","editorStyle":"arve","attributes":{"url":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"upload_date":{"type":"string"},"mode":{"type":"string"},"thumbnail":{"type":"string"},"hide_title":{"type":"boolean"},"grow":{"type":"string"},"fullscreen":{"type":"string"},"play_icon_style":{"type":"string"},"hover_effect":{"type":"string"},"disable_links":{"type":"string"},"align":{"type":"string"},"arve_link":{"type":"string"},"duration":{"type":"string"},"autoplay":{"type":"string"},"lightbox_maxwidth":{"type":"integer"},"sticky":{"type":"string"},"sticky_on_mobile":{"type":"string"},"sticky_position":{"type":"string"},"aspect_ratio":{"type":"string"},"parameters":{"type":"string"},"controlslist":{"type":"string"},"controls":{"type":"string"},"loop":{"type":"boolean"},"muted":{"type":"boolean"},"volume":{"type":"integer"},"random_video_url":{"type":"string"},"random_video_urls":{"type":"string"},"sandbox":{"type":"string"},"thumbnail_url":{"type":"string"}}}'),i=window.wp.i18n,a=window.wp.serverSideRender;var l=e.n(a);const o=window.wp.blockEditor,s=window.wp.components,c=window.wp.blocks,{name:d}=n,p=window.ARVEsettings,u=new DOMParser;function m(e){const t=[];return Object.entries(e).forEach((e=>{let[r,n]=e;const i={label:n,value:r};t.push(i)})),t}function b(e){if("string"!=typeof e.description)return"";if("string"==typeof e.descriptionlinktext){const t=e.description.split(e.descriptionlinktext);return(0,r.createElement)("span",null,(0,r.createElement)("span",null,t[0]),(0,r.createElement)("a",{href:e.descriptionlink},e.descriptionlinktext),",",(0,r.createElement)("span",null,t[1]))}return e.description}function g(e,t){const r=y(e,t);return e/r+":"+t/r}function y(e,t){return t?y(t,e%t):e}(0,c.registerBlockType)(d,{edit:function(e){const{attributes:{align:n},setAttributes:a}=e,c=(0,o.useBlockProps)(),d=function(e){const t=[],n={},a=(0,r.createElement)("p",null,(0,i.__)("To edit the featured image, you need permission to upload media."));let l=!1;Object.values(p).forEach((e=>{n[e.tag]=[]})),Object.entries(p).forEach((t=>{let[c,d]=t,p=e.attributes[c],y="";switch(d.type){case"boolean":"sandbox"===c&&void 0===p&&(p=!0),n[d.tag].push((0,r.createElement)(s.ToggleControl,{key:c,label:d.label,help:b(d),checked:!!p,onChange:t=>e.setAttributes({[c]:t})}));break;case"select":n[d.tag].push((0,r.createElement)(s.SelectControl,{key:c,value:p,label:d.label,help:b(d),options:m(d.options),onChange:t=>e.setAttributes({[c]:t})}));break;case"string":n[d.tag].push((0,r.createElement)(s.TextControl,{key:c,label:d.label,placeholder:d.placeholder,help:b(d),value:p,onChange:t=>(function(e,t,r){if("url"===e){const e=u.parseFromString(t,"text/html").querySelector("iframe");if(e&&e.getAttribute("src")){t=e.src;const n=e.width,i=e.height;n&&i&&r.setAttributes({aspect_ratio:g(n,i)})}}}(c,t,e),e.setAttributes({[c]:t}))}));break;case"attachment":y=e.attributes[c+"_url"],n[d.tag].push((0,r.createElement)(s.BaseControl,{className:"editor-post-featured-image",help:b(d),key:c},(0,r.createElement)(o.MediaUploadCheck,{fallback:a},(0,r.createElement)(o.MediaUpload,{title:(0,i.__)("Thumbnail"),onSelect:t=>(l=t,e.setAttributes({[c]:t.id.toString(),[c+"_url"]:t.url})),unstableFeaturedImageFlow:!0,allowedTypes:["image"],modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return(0,r.createElement)("div",{className:"editor-post-featured-image__container"},(0,r.createElement)(s.Button,{className:p?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:t,"aria-label":p?(0,i.__)("Edit or update the image"):null,"aria-describedby":p?`editor-post-featured-image-${p}-describedby`:""},!!p&&!!y&&(0,r.createElement)("div",{style:{overflow:"hidden"}},(0,r.createElement)(s.ResponsiveWrapper,{naturalWidth:640,naturalHeight:360,isInline:!0},(0,r.createElement)("img",{src:y,alt:"ARVE Thumbnail",style:{width:"100%",height:"100%",objectFit:"cover"}}))),!p&&(0,i.__)("Set Thumbnail")),(0,r.createElement)(s.DropZone,null))},value:p})),!!p&&!!y&&(0,r.createElement)(o.MediaUploadCheck,null,(0,r.createElement)(o.MediaUpload,{title:(0,i.__)("Thumbnail"),onSelect:t=>(l=t,e.setAttributes({[c]:t.id.toString(),[c+"_url"]:t.url})),unstableFeaturedImageFlow:!0,allowedTypes:["image"],modalClass:"editor-post-featured-image__media-modal",render:e=>{let{open:t}=e;return(0,r.createElement)(s.Button,{onClick:t,isSecondary:!0},(0,i.__)("Replace Thumbnail"))}})),!!p&&(0,r.createElement)(o.MediaUploadCheck,null,(0,r.createElement)(s.Button,{onClick:()=>e.setAttributes({[c]:"",[c+"_url"]:""}),isLink:!0,isDestructive:!0},(0,i.__)("Remove Thumbnail")))))}}));let c=!0;return n.main.push((0,r.createElement)(s.BaseControl,{key:"info",help:(0,i.__)("You can disable the extensive help texts on the ARVE settings page to clean up this UI","advanced-responsive-video-embedder")},(0,r.createElement)(s.BaseControl.VisualLabel,null,(0,i.__)("Info","advanced-responsive-video-embedder")))),Object.keys(n).forEach((e=>{var i;t.push((0,r.createElement)(s.PanelBody,{key:e,title:(i=e,i.charAt(0).toUpperCase()+i.slice(1)),initialOpen:c},n[e])),c=!1})),t}(e);return[(0,r.createElement)("div",t({},c,{key:"block"}),(0,r.createElement)("div",{className:"arve-select-helper",style:{textAlign:"center",padding:".1em"}},(0,i.__)("Select ARVE block","advanced-responsive-video-embedder")),(0,r.createElement)(l(),{block:"nextgenthemes/arve-block",attributes:e.attributes})),(0,r.createElement)(o.InspectorControls,{key:"insp"},d)]}})})();
changelog.md CHANGED
@@ -4,9 +4,14 @@
4
  * [ARVE Pro changelog](https://nextgenthemes.com/plugins/arve-pro/#changelog)
5
  * [ARVE Random Videos changelog](https://nextgenthemes.com/plugins/arve-random-video/#changelog)
6
 
 
 
 
 
 
7
  ### 2022-09-01 9.7.16 ###
8
 
9
- * Fix: Divi endless reload issue is hopefully finally fixed. ARVE Pro users please note this is a workaround that causes previews inside the Divi builder not have the correct data. Most noticable thumbnails and titles. If you provide a fallback thumbnail in ARVE Pro settings it will show that while you using Divi. The plugin works correctly on the frontend. The "Video (ARVE)" button currently does not work in
10
 
11
  ### 2022-08-30 9.7.15 ###
12
 
4
  * [ARVE Pro changelog](https://nextgenthemes.com/plugins/arve-pro/#changelog)
5
  * [ARVE Random Videos changelog](https://nextgenthemes.com/plugins/arve-random-video/#changelog)
6
 
7
+ ### 2022-10-14 9.7.17 ###
8
+
9
+ * Fix: Give errors and prevent php 8.0 and 8.1 from having errors when the aspect ratio contains non integer numbers like `0.9:1` only integers are allowed like `9:10`.
10
+ * Improved: Update EDD updater class.
11
+
12
  ### 2022-09-01 9.7.16 ###
13
 
14
+ * Fix: Divi endless reload issue is hopefully finally fixed. ARVE Pro users please note this is a workaround that causes previews inside the Divi builder not have the correct data. Most noticable thumbnails and titles. If you provide a fallback thumbnail in ARVE Pro settings it will show that while you using Divi. The plugin works correctly on the frontend. However the "Video (ARVE)" button currently does not work in Divi.
15
 
16
  ### 2022-08-30 9.7.15 ###
17
 
php/Common/Admin/EDD/PluginUpdater.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  namespace Nextgenthemes\ARVE\Common\Admin\EDD;
 
3
  // Exit if accessed directly
4
  if ( ! defined( 'ABSPATH' ) ) {
5
  exit;
1
  <?php
2
  namespace Nextgenthemes\ARVE\Common\Admin\EDD;
3
+
4
  // Exit if accessed directly
5
  if ( ! defined( 'ABSPATH' ) ) {
6
  exit;
php/Common/functions-assets.php CHANGED
@@ -1,9 +1,28 @@
1
  <?php
2
  namespace Nextgenthemes\ARVE\Common;
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  function enqueue_asset( array $args ) {
5
  $args['enqueue'] = true;
6
- asset( $args );
7
  }
8
 
9
  function is_script( $src ) {
@@ -38,6 +57,10 @@ function deps_and_ver( $path ) {
38
  return $dv;
39
  }
40
 
 
 
 
 
41
  function replace_extension( $filename, $new_extension ) {
42
  $info = pathinfo( $filename );
43
  $dir = $info['dirname'] ? $info['dirname'] . DIRECTORY_SEPARATOR : '';
@@ -45,26 +68,28 @@ function replace_extension( $filename, $new_extension ) {
45
  return $dir . $info['filename'] . '.' . $new_extension;
46
  }
47
 
48
- function asset( array $args ) {
49
 
50
  $defaults = array(
51
- 'path' => '',
 
 
 
 
 
 
 
 
52
  'async' => false,
53
  'cdn_src' => '',
54
  'defer' => false,
55
- 'deps' => array(),
56
  'enqueue' => false,
57
- 'enqueue_hooks' => array(),
58
- 'handle' => '',
59
- 'in_footer' => true,
60
- 'integrity' => '',
61
- 'media' => 'all',
62
- 'src' => '',
63
- 'ver' => null,
64
- 'mce' => false,
65
- 'inline_style' => '',
66
  'inline_script' => '',
67
  'inline_script_pos' => 'after',
 
 
 
 
68
  );
69
 
70
  $args = wp_parse_args( $args, $defaults );
@@ -96,10 +121,6 @@ function asset( array $args ) {
96
  if ( $args['enqueue'] ) {
97
  wp_enqueue_script( $args['handle'] );
98
  }
99
-
100
- foreach ( $args['enqueue_hooks'] as $hook ) {
101
- enqueue_script( $args['handle'], $hook );
102
- }
103
  } else {
104
  wp_register_style( $args['handle'], $args['src'], $args['deps'], $args['ver'], $args['media'] );
105
 
@@ -115,10 +136,6 @@ function asset( array $args ) {
115
  wp_enqueue_style( $args['handle'] );
116
  }
117
 
118
- foreach ( $args['enqueue_hooks'] as $hook ) {
119
- enqueue_style( $args['handle'], $hook );
120
- }
121
-
122
  if ( $args['mce'] ) {
123
  add_filter(
124
  'mce_css',
@@ -134,26 +151,6 @@ function asset( array $args ) {
134
  }//end if
135
  }
136
 
137
- function enqueue_style( $handle, $hook ) {
138
-
139
- add_filter(
140
- $hook,
141
- function() use ( $handle ) {
142
- wp_enqueue_style( $handle );
143
- }
144
- );
145
- }
146
-
147
- function enqueue_script( $handle, $hook ) {
148
-
149
- add_filter(
150
- $hook,
151
- function() use ( $handle ) {
152
- wp_enqueue_script( $handle );
153
- }
154
- );
155
- }
156
-
157
  function add_attr_to_asset( $type, array $args ) {
158
 
159
  if ( ! in_array( $type, array( 'script', 'style' ), true ) ) {
1
  <?php
2
  namespace Nextgenthemes\ARVE\Common;
3
 
4
+ function theme_version() {
5
+ $theme_version = wp_get_theme()->get( 'Version' );
6
+ return is_string( $theme_version ) ? $theme_version : false;
7
+ }
8
+
9
+ function asset( array $args ) {
10
+
11
+ // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
12
+ trigger_error( 'Function ' . __FUNCTION__ . ' is deprecated', E_USER_DEPRECATED );
13
+
14
+ $args['enqueue'] = false;
15
+ _asset( $args );
16
+ }
17
+
18
+ function register_asset( array $args ) {
19
+ $args['enqueue'] = false;
20
+ _asset( $args );
21
+ }
22
+
23
  function enqueue_asset( array $args ) {
24
  $args['enqueue'] = true;
25
+ _asset( $args );
26
  }
27
 
28
  function is_script( $src ) {
57
  return $dv;
58
  }
59
 
60
+ function ver_from_asset( $path ) {
61
+ return deps_and_ver( $path )['version'];
62
+ }
63
+
64
  function replace_extension( $filename, $new_extension ) {
65
  $info = pathinfo( $filename );
66
  $dir = $info['dirname'] ? $info['dirname'] . DIRECTORY_SEPARATOR : '';
68
  return $dir . $info['filename'] . '.' . $new_extension;
69
  }
70
 
71
+ function _asset( array $args ) {
72
 
73
  $defaults = array(
74
+ // wp_register_script args in order
75
+ 'handle' => '',
76
+ 'src' => '',
77
+ 'deps' => array(),
78
+ 'media' => 'all',
79
+ 'ver' => null,
80
+ 'in_footer' => true,
81
+
82
+ // new
83
  'async' => false,
84
  'cdn_src' => '',
85
  'defer' => false,
 
86
  'enqueue' => false,
 
 
 
 
 
 
 
 
 
87
  'inline_script' => '',
88
  'inline_script_pos' => 'after',
89
+ 'inline_style' => '',
90
+ 'integrity' => '',
91
+ 'mce' => false,
92
+ 'path' => '',
93
  );
94
 
95
  $args = wp_parse_args( $args, $defaults );
121
  if ( $args['enqueue'] ) {
122
  wp_enqueue_script( $args['handle'] );
123
  }
 
 
 
 
124
  } else {
125
  wp_register_style( $args['handle'], $args['src'], $args['deps'], $args['ver'], $args['media'] );
126
 
136
  wp_enqueue_style( $args['handle'] );
137
  }
138
 
 
 
 
 
139
  if ( $args['mce'] ) {
140
  add_filter(
141
  'mce_css',
151
  }//end if
152
  }
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  function add_attr_to_asset( $type, array $args ) {
155
 
156
  if ( ! in_array( $type, array( 'script', 'style' ), true ) ) {
php/functions-assets.php CHANGED
@@ -3,7 +3,7 @@ namespace Nextgenthemes\ARVE;
3
 
4
  function register_assets() {
5
 
6
- Common\asset(
7
  array(
8
  'handle' => 'arve-main',
9
  'src' => plugins_url( 'build/main.css', PLUGIN_FILE ),
@@ -12,7 +12,7 @@ function register_assets() {
12
  )
13
  );
14
 
15
- Common\asset(
16
  array(
17
  'handle' => 'arve-main',
18
  'src' => plugins_url( 'build/main.js', PLUGIN_FILE ),
@@ -44,7 +44,7 @@ function register_assets() {
44
  }
45
  }
46
 
47
- Common\asset(
48
  array(
49
  'handle' => 'arve-block',
50
  'src' => plugins_url( 'build/block.js', PLUGIN_FILE ),
3
 
4
  function register_assets() {
5
 
6
+ Common\register_asset(
7
  array(
8
  'handle' => 'arve-main',
9
  'src' => plugins_url( 'build/main.css', PLUGIN_FILE ),
12
  )
13
  );
14
 
15
+ Common\register_asset(
16
  array(
17
  'handle' => 'arve-main',
18
  'src' => plugins_url( 'build/main.js', PLUGIN_FILE ),
44
  }
45
  }
46
 
47
+ Common\register_asset(
48
  array(
49
  'handle' => 'arve-block',
50
  'src' => plugins_url( 'build/block.js', PLUGIN_FILE ),
php/functions-shortcode-args.php CHANGED
@@ -250,8 +250,8 @@ function validate_aspect_ratio( array $a ) {
250
 
251
  $ratio = explode( ':', $a['aspect_ratio'] );
252
 
253
- if ( empty( $ratio[0] ) || ! is_numeric( $ratio[0] ) ||
254
- empty( $ratio[1] ) || ! is_numeric( $ratio[1] )
255
  ) {
256
  $a['errors']->add(
257
  'aspect_ratio',
@@ -271,7 +271,7 @@ function arg_img_src( array $a ) {
271
 
272
  if ( $a['thumbnail'] ) :
273
 
274
- if ( is_numeric( $a['thumbnail'] ) ) {
275
 
276
  $img_src = wp_get_attachment_image_url( $a['thumbnail'], 'small' );
277
 
@@ -676,7 +676,7 @@ function iframe_src_args( $src, array $a ) {
676
 
677
  $options = options();
678
 
679
- $parameters = wp_parse_args( preg_replace( '!\s+!', '&', $a['parameters'] ) );
680
  $params_options = array();
681
 
682
  if ( ! empty( $options[ 'url_params_' . $a['provider'] ] ) ) {
250
 
251
  $ratio = explode( ':', $a['aspect_ratio'] );
252
 
253
+ if ( empty( $ratio[0] ) || ! ctype_digit( (string) $ratio[0] ) ||
254
+ empty( $ratio[1] ) || ! ctype_digit( (string) $ratio[1] )
255
  ) {
256
  $a['errors']->add(
257
  'aspect_ratio',
271
 
272
  if ( $a['thumbnail'] ) :
273
 
274
+ if ( ctype_digit( (string) $a['thumbnail'] ) ) {
275
 
276
  $img_src = wp_get_attachment_image_url( $a['thumbnail'], 'small' );
277
 
676
 
677
  $options = options();
678
 
679
+ $parameters = wp_parse_args( preg_replace( '!\s+!', '&', (string) $a['parameters'] ) );
680
  $params_options = array();
681
 
682
  if ( ! empty( $options[ 'url_params_' . $a['provider'] ] ) ) {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: YouTube, Vimeo, lazyload, thumbnail, video, responsive, embeds, video-embe
5
  Requires at least: 4.9.16
6
  Tested up to: 6.0.2
7
  Requires PHP: 5.6
8
- Stable tag: 9.7.16
9
  License: GPL-3.0
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -196,9 +196,14 @@ Please read the [official documentation](https://wordpress.org/support/article/m
196
  * [ARVE Pro changelog](https://nextgenthemes.com/plugins/arve-pro/#changelog)
197
  * [ARVE Random Videos changelog](https://nextgenthemes.com/plugins/arve-random-video/#changelog)
198
 
 
 
 
 
 
199
  ### 2022-09-01 9.7.16 ###
200
 
201
- * Fix: Divi endless reload issue is hopefully finally fixed. ARVE Pro users please note this is a workaround that causes previews inside the Divi builder not have the correct data. Most noticable thumbnails and titles. If you provide a fallback thumbnail in ARVE Pro settings it will show that while you using Divi. The plugin works correctly on the frontend. The "Video (ARVE)" button currently does not work in
202
 
203
  ### 2022-08-30 9.7.15 ###
204
 
5
  Requires at least: 4.9.16
6
  Tested up to: 6.0.2
7
  Requires PHP: 5.6
8
+ Stable tag: 9.7.18
9
  License: GPL-3.0
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
196
  * [ARVE Pro changelog](https://nextgenthemes.com/plugins/arve-pro/#changelog)
197
  * [ARVE Random Videos changelog](https://nextgenthemes.com/plugins/arve-random-video/#changelog)
198
 
199
+ ### 2022-10-14 9.7.17 ###
200
+
201
+ * Fix: Give errors and prevent php 8.0 and 8.1 from having errors when the aspect ratio contains non integer numbers like `0.9:1` only integers are allowed like `9:10`.
202
+ * Improved: Update EDD updater class.
203
+
204
  ### 2022-09-01 9.7.16 ###
205
 
206
+ * Fix: Divi endless reload issue is hopefully finally fixed. ARVE Pro users please note this is a workaround that causes previews inside the Divi builder not have the correct data. Most noticable thumbnails and titles. If you provide a fallback thumbnail in ARVE Pro settings it will show that while you using Divi. The plugin works correctly on the frontend. However the "Video (ARVE)" button currently does not work in Divi.
207
 
208
  ### 2022-08-30 9.7.15 ###
209
 
src/block.json CHANGED
@@ -13,7 +13,7 @@
13
  "vimeo",
14
  "odysee"
15
  ],
16
- "version": "9.7.16",
17
  "textdomain": "advanced-responsive-video-embedder",
18
  "supports": {
19
  "align": [
13
  "vimeo",
14
  "odysee"
15
  ],
16
+ "version": "9.7.18",
17
  "textdomain": "advanced-responsive-video-embedder",
18
  "supports": {
19
  "align": [