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

Version Description

Download this release

Release Info

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

Code changes from version 9.5.1-beta8 to 9.5.2-beta1

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.5.1-beta8
7
  * Author: Nicolas Jonas
8
  * Author URI: https://nextgenthemes.com
9
  * License: GPL-3.0
@@ -19,7 +19,7 @@
19
 
20
  namespace Nextgenthemes\ARVE;
21
 
22
- const VERSION = '9.5.1-beta8';
23
  const PRO_VERSION_REQUIRED = '5.1.11';
24
  const NUM_TRACKS = 3;
25
  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.5.2-beta1
7
  * Author: Nicolas Jonas
8
  * Author URI: https://nextgenthemes.com
9
  * License: GPL-3.0
19
 
20
  namespace Nextgenthemes\ARVE;
21
 
22
+ const VERSION = '9.5.2-beta1';
23
  const PRO_VERSION_REQUIRED = '5.1.11';
24
  const NUM_TRACKS = 3;
25
  const PLUGIN_FILE = __FILE__;
build/admin.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => '576d5f19e9222dfa62643982ce45cb43');
1
+ <?php return array('dependencies' => array('wp-polyfill'), 'version' => '5fd2792ec9d8e13cf53971029614082a');
build/admin.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}({10:function(e,t,r){"use strict";r.r(t),r(11),window.jQuery(document).on("click","#arve-btn",(function(){const e=window.sui;void 0!==e?(e.utils.shortcodeViewConstructor.parseShortcodeString("[arve]"),window.wp.media({frame:"post",state:"shortcode-ui",currentShortcode:e.utils.shortcodeViewConstructor.parseShortcodeString("[arve]")}).open()):window.tb_show("ARVE Optional Features","#TB_inline?inlineId=arve-thickbox")}))},11:function(e,t,r){}});
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}({10:function(e,t,n){"use strict";n.r(t),n(11),window.jQuery(document).on("click","#arve-btn",(function(){const e=window.sui;void 0!==e?(e.utils.shortcodeViewConstructor.parseShortcodeString("[arve]"),window.wp.media({frame:"post",state:"shortcode-ui",currentShortcode:e.utils.shortcodeViewConstructor.parseShortcodeString("[arve]")}).open()):window.tb_show("ARVE Optional Features","#TB_inline?inlineId=arve-thickbox")})),window.jQuery(document).ready((function(e){e(".notice.is-dismissible").on("click",".notice-dismiss",(function(t){t.preventDefault();const n=e(this);"undefined"!=n.parent().attr("id")&&e.post(window.ajaxurl,{action:"dnh_dismiss_notice",url:window.ajaxurl,id:n.parent().attr("id")})}))}))},11:function(e,t,n){}});
changelog.md CHANGED
@@ -4,9 +4,15 @@
4
  * [ARVE Pro changelog](https://nextgenthemes.com/plugins/arve-pro/#changelog)
5
  * [ARVE Random Videos changelog](https://nextgenthemes.com/plugins/random-video/#changelog)
6
 
 
 
 
 
 
7
  ### 2021-02-13 9.5.1-beta7 ###
8
 
9
  * Fixed and further simplified oembed caching.
 
10
 
11
  ### 2021-02-13 9.5.1-beta1 ###
12
 
4
  * [ARVE Pro changelog](https://nextgenthemes.com/plugins/arve-pro/#changelog)
5
  * [ARVE Random Videos changelog](https://nextgenthemes.com/plugins/random-video/#changelog)
6
 
7
+ ### 2021-02-17 9.5.2-beta1 ###
8
+
9
+ * Fix: Conflict with Notice library.
10
+ * Changes to oembed data caching.
11
+
12
  ### 2021-02-13 9.5.1-beta7 ###
13
 
14
  * Fixed and further simplified oembed caching.
15
+ * Improved: Allow forms for Wistia.
16
 
17
  ### 2021-02-13 9.5.1-beta1 ###
18
 
libs/autoload.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- // autoload.php @generated by Composer
4
-
5
- require_once __DIR__ . '/composer/autoload_real.php';
6
-
7
- return ComposerAutoloaderInit516b5fd3c4d56c19317857df7012b08f::getLoader();
 
 
 
 
 
 
 
libs/composer/ClassLoader.php DELETED
@@ -1,423 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Composer.
5
- *
6
- * (c) Nils Adermann <naderman@naderman.de>
7
- * Jordi Boggiano <j.boggiano@seld.be>
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- namespace Composer\Autoload;
14
-
15
- /**
16
- * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
- *
18
- * $loader = new \Composer\Autoload\ClassLoader();
19
- *
20
- * // register classes with namespaces
21
- * $loader->add('Symfony\Component', __DIR__.'/component');
22
- * $loader->add('Symfony', __DIR__.'/framework');
23
- *
24
- * // activate the autoloader
25
- * $loader->register();
26
- *
27
- * // to enable searching the include path (eg. for PEAR packages)
28
- * $loader->setUseIncludePath(true);
29
- *
30
- * In this example, if you try to use a class in the Symfony\Component
31
- * namespace or one of its children (Symfony\Component\Console for instance),
32
- * the autoloader will first look for the class under the component/
33
- * directory, and it will then fallback to the framework/ directory if not
34
- * found before giving up.
35
- *
36
- * This class is loosely based on the Symfony UniversalClassLoader.
37
- *
38
- * @author Fabien Potencier <fabien@symfony.com>
39
- * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
- */
43
- class ClassLoader {
44
-
45
- // PSR-4
46
- private $prefixLengthsPsr4 = array();
47
- private $prefixDirsPsr4 = array();
48
- private $fallbackDirsPsr4 = array();
49
-
50
- // PSR-0
51
- private $prefixesPsr0 = array();
52
- private $fallbackDirsPsr0 = array();
53
-
54
- private $useIncludePath = false;
55
- private $classMap = array();
56
- private $classMapAuthoritative = false;
57
- private $missingClasses = array();
58
- private $apcuPrefix;
59
-
60
- public function getPrefixes() {
61
- if ( ! empty( $this->prefixesPsr0 ) ) {
62
- return call_user_func_array( 'array_merge', array_values( $this->prefixesPsr0 ) );
63
- }
64
-
65
- return array();
66
- }
67
-
68
- public function getPrefixesPsr4() {
69
- return $this->prefixDirsPsr4;
70
- }
71
-
72
- public function getFallbackDirs() {
73
- return $this->fallbackDirsPsr0;
74
- }
75
-
76
- public function getFallbackDirsPsr4() {
77
- return $this->fallbackDirsPsr4;
78
- }
79
-
80
- public function getClassMap() {
81
- return $this->classMap;
82
- }
83
-
84
- /**
85
- * @param array $classMap Class to filename map
86
- */
87
- public function addClassMap( array $classMap ) {
88
- if ( $this->classMap ) {
89
- $this->classMap = array_merge( $this->classMap, $classMap );
90
- } else {
91
- $this->classMap = $classMap;
92
- }
93
- }
94
-
95
- /**
96
- * Registers a set of PSR-0 directories for a given prefix, either
97
- * appending or prepending to the ones previously set for this prefix.
98
- *
99
- * @param string $prefix The prefix
100
- * @param array|string $paths The PSR-0 root directories
101
- * @param bool $prepend Whether to prepend the directories
102
- */
103
- public function add( $prefix, $paths, $prepend = false ) {
104
- if ( ! $prefix ) {
105
- if ( $prepend ) {
106
- $this->fallbackDirsPsr0 = array_merge(
107
- (array) $paths,
108
- $this->fallbackDirsPsr0
109
- );
110
- } else {
111
- $this->fallbackDirsPsr0 = array_merge(
112
- $this->fallbackDirsPsr0,
113
- (array) $paths
114
- );
115
- }
116
-
117
- return;
118
- }
119
-
120
- $first = $prefix[0];
121
- if ( ! isset( $this->prefixesPsr0[ $first ][ $prefix ] ) ) {
122
- $this->prefixesPsr0[ $first ][ $prefix ] = (array) $paths;
123
-
124
- return;
125
- }
126
- if ( $prepend ) {
127
- $this->prefixesPsr0[ $first ][ $prefix ] = array_merge(
128
- (array) $paths,
129
- $this->prefixesPsr0[ $first ][ $prefix ]
130
- );
131
- } else {
132
- $this->prefixesPsr0[ $first ][ $prefix ] = array_merge(
133
- $this->prefixesPsr0[ $first ][ $prefix ],
134
- (array) $paths
135
- );
136
- }
137
- }
138
-
139
- /**
140
- * Registers a set of PSR-4 directories for a given namespace, either
141
- * appending or prepending to the ones previously set for this namespace.
142
- *
143
- * @param string $prefix The prefix/namespace, with trailing '\\'
144
- * @param array|string $paths The PSR-4 base directories
145
- * @param bool $prepend Whether to prepend the directories
146
- *
147
- * @throws \InvalidArgumentException
148
- */
149
- public function addPsr4( $prefix, $paths, $prepend = false ) {
150
- if ( ! $prefix ) {
151
- // Register directories for the root namespace.
152
- if ( $prepend ) {
153
- $this->fallbackDirsPsr4 = array_merge(
154
- (array) $paths,
155
- $this->fallbackDirsPsr4
156
- );
157
- } else {
158
- $this->fallbackDirsPsr4 = array_merge(
159
- $this->fallbackDirsPsr4,
160
- (array) $paths
161
- );
162
- }
163
- } elseif ( ! isset( $this->prefixDirsPsr4[ $prefix ] ) ) {
164
- // Register directories for a new namespace.
165
- $length = strlen( $prefix );
166
- if ( '\\' !== $prefix[ $length - 1 ] ) {
167
- throw new \InvalidArgumentException( 'A non-empty PSR-4 prefix must end with a namespace separator.' );
168
- }
169
- $this->prefixLengthsPsr4[ $prefix[0] ][ $prefix ] = $length;
170
- $this->prefixDirsPsr4[ $prefix ] = (array) $paths;
171
- } elseif ( $prepend ) {
172
- // Prepend directories for an already registered namespace.
173
- $this->prefixDirsPsr4[ $prefix ] = array_merge(
174
- (array) $paths,
175
- $this->prefixDirsPsr4[ $prefix ]
176
- );
177
- } else {
178
- // Append directories for an already registered namespace.
179
- $this->prefixDirsPsr4[ $prefix ] = array_merge(
180
- $this->prefixDirsPsr4[ $prefix ],
181
- (array) $paths
182
- );
183
- }
184
- }
185
-
186
- /**
187
- * Registers a set of PSR-0 directories for a given prefix,
188
- * replacing any others previously set for this prefix.
189
- *
190
- * @param string $prefix The prefix
191
- * @param array|string $paths The PSR-0 base directories
192
- */
193
- public function set( $prefix, $paths ) {
194
- if ( ! $prefix ) {
195
- $this->fallbackDirsPsr0 = (array) $paths;
196
- } else {
197
- $this->prefixesPsr0[ $prefix[0] ][ $prefix ] = (array) $paths;
198
- }
199
- }
200
-
201
- /**
202
- * Registers a set of PSR-4 directories for a given namespace,
203
- * replacing any others previously set for this namespace.
204
- *
205
- * @param string $prefix The prefix/namespace, with trailing '\\'
206
- * @param array|string $paths The PSR-4 base directories
207
- *
208
- * @throws \InvalidArgumentException
209
- */
210
- public function setPsr4( $prefix, $paths ) {
211
- if ( ! $prefix ) {
212
- $this->fallbackDirsPsr4 = (array) $paths;
213
- } else {
214
- $length = strlen( $prefix );
215
- if ( '\\' !== $prefix[ $length - 1 ] ) {
216
- throw new \InvalidArgumentException( 'A non-empty PSR-4 prefix must end with a namespace separator.' );
217
- }
218
- $this->prefixLengthsPsr4[ $prefix[0] ][ $prefix ] = $length;
219
- $this->prefixDirsPsr4[ $prefix ] = (array) $paths;
220
- }
221
- }
222
-
223
- /**
224
- * Turns on searching the include path for class files.
225
- *
226
- * @param bool $useIncludePath
227
- */
228
- public function setUseIncludePath( $useIncludePath ) {
229
- $this->useIncludePath = $useIncludePath;
230
- }
231
-
232
- /**
233
- * Can be used to check if the autoloader uses the include path to check
234
- * for classes.
235
- *
236
- * @return bool
237
- */
238
- public function getUseIncludePath() {
239
- return $this->useIncludePath;
240
- }
241
-
242
- /**
243
- * Turns off searching the prefix and fallback directories for classes
244
- * that have not been registered with the class map.
245
- *
246
- * @param bool $classMapAuthoritative
247
- */
248
- public function setClassMapAuthoritative( $classMapAuthoritative ) {
249
- $this->classMapAuthoritative = $classMapAuthoritative;
250
- }
251
-
252
- /**
253
- * Should class lookup fail if not found in the current class map?
254
- *
255
- * @return bool
256
- */
257
- public function isClassMapAuthoritative() {
258
- return $this->classMapAuthoritative;
259
- }
260
-
261
- /**
262
- * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
263
- *
264
- * @param string|null $apcuPrefix
265
- */
266
- public function setApcuPrefix( $apcuPrefix ) {
267
- $this->apcuPrefix = function_exists( 'apcu_fetch' ) && filter_var( ini_get( 'apc.enabled' ), FILTER_VALIDATE_BOOLEAN ) ? $apcuPrefix : null;
268
- }
269
-
270
- /**
271
- * The APCu prefix in use, or null if APCu caching is not enabled.
272
- *
273
- * @return string|null
274
- */
275
- public function getApcuPrefix() {
276
- return $this->apcuPrefix;
277
- }
278
-
279
- /**
280
- * Registers this instance as an autoloader.
281
- *
282
- * @param bool $prepend Whether to prepend the autoloader or not
283
- */
284
- public function register( $prepend = false ) {
285
- spl_autoload_register( array( $this, 'loadClass' ), true, $prepend );
286
- }
287
-
288
- /**
289
- * Unregisters this instance as an autoloader.
290
- */
291
- public function unregister() {
292
- spl_autoload_unregister( array( $this, 'loadClass' ) );
293
- }
294
-
295
- /**
296
- * Loads the given class or interface.
297
- *
298
- * @param string $class The name of the class
299
- * @return bool|null True if loaded, null otherwise
300
- */
301
- public function loadClass( $class ) {
302
- if ( $file = $this->findFile( $class ) ) {
303
- includeFile( $file );
304
-
305
- return true;
306
- }
307
- }
308
-
309
- /**
310
- * Finds the path to the file where the class is defined.
311
- *
312
- * @param string $class The name of the class
313
- *
314
- * @return string|false The path if found, false otherwise
315
- */
316
- public function findFile( $class ) {
317
- // class map lookup
318
- if ( isset( $this->classMap[ $class ] ) ) {
319
- return $this->classMap[ $class ];
320
- }
321
- if ( $this->classMapAuthoritative || isset( $this->missingClasses[ $class ] ) ) {
322
- return false;
323
- }
324
- if ( null !== $this->apcuPrefix ) {
325
- $file = apcu_fetch( $this->apcuPrefix . $class, $hit );
326
- if ( $hit ) {
327
- return $file;
328
- }
329
- }
330
-
331
- $file = $this->findFileWithExtension( $class, '.php' );
332
-
333
- // Search for Hack files if we are running on HHVM
334
- if ( false === $file && defined( 'HHVM_VERSION' ) ) {
335
- $file = $this->findFileWithExtension( $class, '.hh' );
336
- }
337
-
338
- if ( null !== $this->apcuPrefix ) {
339
- apcu_add( $this->apcuPrefix . $class, $file );
340
- }
341
-
342
- if ( false === $file ) {
343
- // Remember that this class does not exist.
344
- $this->missingClasses[ $class ] = true;
345
- }
346
-
347
- return $file;
348
- }
349
-
350
- private function findFileWithExtension( $class, $ext ) {
351
- // PSR-4 lookup
352
- $logicalPathPsr4 = strtr( $class, '\\', DIRECTORY_SEPARATOR ) . $ext;
353
-
354
- $first = $class[0];
355
- if ( isset( $this->prefixLengthsPsr4[ $first ] ) ) {
356
- $subPath = $class;
357
- while ( false !== $lastPos = strrpos( $subPath, '\\' ) ) {
358
- $subPath = substr( $subPath, 0, $lastPos );
359
- $search = $subPath . '\\';
360
- if ( isset( $this->prefixDirsPsr4[ $search ] ) ) {
361
- $pathEnd = DIRECTORY_SEPARATOR . substr( $logicalPathPsr4, $lastPos + 1 );
362
- foreach ( $this->prefixDirsPsr4[ $search ] as $dir ) {
363
- if ( file_exists( $file = $dir . $pathEnd ) ) {
364
- return $file;
365
- }
366
- }
367
- }
368
- }
369
- }
370
-
371
- // PSR-4 fallback dirs
372
- foreach ( $this->fallbackDirsPsr4 as $dir ) {
373
- if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4 ) ) {
374
- return $file;
375
- }
376
- }
377
-
378
- // PSR-0 lookup
379
- if ( false !== $pos = strrpos( $class, '\\' ) ) {
380
- // namespaced class name
381
- $logicalPathPsr0 = substr( $logicalPathPsr4, 0, $pos + 1 )
382
- . strtr( substr( $logicalPathPsr4, $pos + 1 ), '_', DIRECTORY_SEPARATOR );
383
- } else {
384
- // PEAR-like class name
385
- $logicalPathPsr0 = strtr( $class, '_', DIRECTORY_SEPARATOR ) . $ext;
386
- }
387
-
388
- if ( isset( $this->prefixesPsr0[ $first ] ) ) {
389
- foreach ( $this->prefixesPsr0[ $first ] as $prefix => $dirs ) {
390
- if ( 0 === strpos( $class, $prefix ) ) {
391
- foreach ( $dirs as $dir ) {
392
- if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0 ) ) {
393
- return $file;
394
- }
395
- }
396
- }
397
- }
398
- }
399
-
400
- // PSR-0 fallback dirs
401
- foreach ( $this->fallbackDirsPsr0 as $dir ) {
402
- if ( file_exists( $file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0 ) ) {
403
- return $file;
404
- }
405
- }
406
-
407
- // PSR-0 include paths.
408
- if ( $this->useIncludePath && $file = stream_resolve_include_path( $logicalPathPsr0 ) ) {
409
- return $file;
410
- }
411
-
412
- return false;
413
- }
414
- }
415
-
416
- /**
417
- * Scope isolated include.
418
- *
419
- * Prevents access to $this/self from included files.
420
- */
421
- function includeFile( $file ) {
422
- include $file;
423
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/composer/LICENSE DELETED
@@ -1,21 +0,0 @@
1
-
2
- Copyright (c) Nils Adermann, Jordi Boggiano
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is furnished
9
- to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- THE SOFTWARE.
21
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/composer/autoload_classmap.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
-
3
- // autoload_classmap.php @generated by Composer
4
-
5
- $vendorDir = dirname( dirname( __FILE__ ) );
6
- $baseDir = dirname( $vendorDir );
7
-
8
- return array();
 
 
 
 
 
 
 
 
libs/composer/autoload_files.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- // autoload_files.php @generated by Composer
4
-
5
- $vendorDir = dirname( dirname( __FILE__ ) );
6
- $baseDir = dirname( $vendorDir );
7
-
8
- return array(
9
- 'c14057a02afc95b84dc5bf85d98c5b66' => $vendorDir . '/julien731/wp-dismissible-notices-handler/handler.php',
10
- 'ff8834a662873e3e689a4283b27598d2' => $vendorDir . '/julien731/wp-dismissible-notices-handler/includes/helper-functions.php',
11
- );
 
 
 
 
 
 
 
 
 
 
 
libs/composer/autoload_namespaces.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
-
3
- // autoload_namespaces.php @generated by Composer
4
-
5
- $vendorDir = dirname( dirname( __FILE__ ) );
6
- $baseDir = dirname( $vendorDir );
7
-
8
- return array();
 
 
 
 
 
 
 
 
libs/composer/autoload_psr4.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
-
3
- // autoload_psr4.php @generated by Composer
4
-
5
- $vendorDir = dirname( dirname( __FILE__ ) );
6
- $baseDir = dirname( $vendorDir );
7
-
8
- return array();
 
 
 
 
 
 
 
 
libs/composer/autoload_real.php DELETED
@@ -1,70 +0,0 @@
1
- <?php
2
-
3
- // autoload_real.php @generated by Composer
4
-
5
- class ComposerAutoloaderInit516b5fd3c4d56c19317857df7012b08f {
6
-
7
- private static $loader;
8
-
9
- public static function loadClassLoader( $class ) {
10
- if ( 'Composer\Autoload\ClassLoader' === $class ) {
11
- require __DIR__ . '/ClassLoader.php';
12
- }
13
- }
14
-
15
- /**
16
- * @return \Composer\Autoload\ClassLoader
17
- */
18
- public static function getLoader() {
19
- if ( null !== self::$loader ) {
20
- return self::$loader;
21
- }
22
-
23
- spl_autoload_register( array( 'ComposerAutoloaderInit516b5fd3c4d56c19317857df7012b08f', 'loadClassLoader' ), true, true );
24
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
25
- spl_autoload_unregister( array( 'ComposerAutoloaderInit516b5fd3c4d56c19317857df7012b08f', 'loadClassLoader' ) );
26
-
27
- $useStaticLoader = PHP_VERSION_ID >= 50600 && ! defined( 'HHVM_VERSION' ) && ( ! function_exists( 'zend_loader_file_encoded' ) || ! zend_loader_file_encoded() );
28
- if ( $useStaticLoader ) {
29
- require_once __DIR__ . '/autoload_static.php';
30
-
31
- call_user_func( \Composer\Autoload\ComposerStaticInit516b5fd3c4d56c19317857df7012b08f::getInitializer( $loader ) );
32
- } else {
33
- $map = require __DIR__ . '/autoload_namespaces.php';
34
- foreach ( $map as $namespace => $path ) {
35
- $loader->set( $namespace, $path );
36
- }
37
-
38
- $map = require __DIR__ . '/autoload_psr4.php';
39
- foreach ( $map as $namespace => $path ) {
40
- $loader->setPsr4( $namespace, $path );
41
- }
42
-
43
- $classMap = require __DIR__ . '/autoload_classmap.php';
44
- if ( $classMap ) {
45
- $loader->addClassMap( $classMap );
46
- }
47
- }
48
-
49
- $loader->register( true );
50
-
51
- if ( $useStaticLoader ) {
52
- $includeFiles = Composer\Autoload\ComposerStaticInit516b5fd3c4d56c19317857df7012b08f::$files;
53
- } else {
54
- $includeFiles = require __DIR__ . '/autoload_files.php';
55
- }
56
- foreach ( $includeFiles as $fileIdentifier => $file ) {
57
- composerRequire516b5fd3c4d56c19317857df7012b08f( $fileIdentifier, $file );
58
- }
59
-
60
- return $loader;
61
- }
62
- }
63
-
64
- function composerRequire516b5fd3c4d56c19317857df7012b08f( $fileIdentifier, $file ) {
65
- if ( empty( $GLOBALS['__composer_autoload_files'][ $fileIdentifier ] ) ) {
66
- require $file;
67
-
68
- $GLOBALS['__composer_autoload_files'][ $fileIdentifier ] = true;
69
- }
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/composer/autoload_static.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- // autoload_static.php @generated by Composer
4
-
5
- namespace Composer\Autoload;
6
-
7
- class ComposerStaticInit516b5fd3c4d56c19317857df7012b08f {
8
-
9
- public static $files = array(
10
- 'c14057a02afc95b84dc5bf85d98c5b66' => __DIR__ . '/..' . '/julien731/wp-dismissible-notices-handler/handler.php',
11
- 'ff8834a662873e3e689a4283b27598d2' => __DIR__ . '/..' . '/julien731/wp-dismissible-notices-handler/includes/helper-functions.php',
12
- );
13
-
14
- public static function getInitializer( ClassLoader $loader ) {
15
- return \Closure::bind(
16
- function () use ( $loader ) {
17
-
18
- },
19
- null,
20
- ClassLoader::class
21
- );
22
- }
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/composer/installed.json DELETED
@@ -1,44 +0,0 @@
1
- [
2
- {
3
- "name": "julien731/wp-dismissible-notices-handler",
4
- "version": "1.2.1",
5
- "version_normalized": "1.2.1.0",
6
- "source": {
7
- "type": "git",
8
- "url": "https://github.com/julien731/WP-Dismissible-Notices-Handler.git",
9
- "reference": "e5c11a5bd490405f162213c45fb579ba8a9ae992"
10
- },
11
- "dist": {
12
- "type": "zip",
13
- "url": "https://api.github.com/repos/julien731/WP-Dismissible-Notices-Handler/zipball/e5c11a5bd490405f162213c45fb579ba8a9ae992",
14
- "reference": "e5c11a5bd490405f162213c45fb579ba8a9ae992",
15
- "shasum": ""
16
- },
17
- "require": {
18
- "php": ">=5.5.0"
19
- },
20
- "time": "2021-01-15T10:27:28+00:00",
21
- "type": "library",
22
- "installation-source": "dist",
23
- "autoload": {
24
- "files": [
25
- "handler.php",
26
- "includes/helper-functions.php"
27
- ]
28
- },
29
- "notification-url": "https://packagist.org/downloads/",
30
- "license": [
31
- "GNU GPL"
32
- ],
33
- "authors": [
34
- {
35
- "name": "Julien Liabeuf",
36
- "email": "julien@liabeuf.fr",
37
- "homepage": "https://julienliabeuf.com",
38
- "role": "Lead Developer"
39
- }
40
- ],
41
- "description": "A simple library to handle Ajax-dismissible admin notices for WordPress",
42
- "homepage": "https://github.com/julien731/WP-Dismissible-Notices-Handler"
43
- }
44
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/julien731/wp-dismissible-notices-handler/assets/js/main.js DELETED
@@ -1,15 +0,0 @@
1
- jQuery(document).ready(function($) {
2
- $( '.notice.is-dismissible' ).on('click', '.notice-dismiss', function ( event ) {
3
- event.preventDefault();
4
- var $this = $(this);
5
- if( 'undefined' == $this.parent().attr('id') ){
6
- return;
7
- }
8
- $.post( ajaxurl, {
9
- action: 'dnh_dismiss_notice',
10
- url: ajaxurl,
11
- id: $this.parent().attr('id')
12
- });
13
-
14
- });
15
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/julien731/wp-dismissible-notices-handler/composer.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "name": "julien731/wp-dismissible-notices-handler",
3
- "description": "A simple library to handle Ajax-dismissible admin notices for WordPress",
4
- "homepage": "https://github.com/julien731/WP-Dismissible-Notices-Handler",
5
- "license": "GNU GPL",
6
- "authors": [
7
- {
8
- "name": "Julien Liabeuf",
9
- "email": "julien@liabeuf.fr",
10
- "homepage": "https://julienliabeuf.com",
11
- "role": "Lead Developer"
12
- }
13
- ],
14
- "require": {
15
- "php": ">=5.5.0"
16
- },
17
- "autoload": {
18
- "files": ["handler.php", "includes/helper-functions.php"]
19
- }
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/julien731/wp-dismissible-notices-handler/includes/helper-functions.php DELETED
@@ -1,111 +0,0 @@
1
- <?php
2
- /**
3
- * Dismissible Notices Handler.
4
- *
5
- * LICENSE: This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6
- * General Public License as published by the Free Software Foundation; either version 3 of the License, or (at
7
- * your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY
8
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9
- * General Public License for more details. You should have received a copy of the GNU General Public License along
10
- * with this program. If not, see <http://opensource.org/licenses/gpl-license.php>
11
- *
12
- * @package Dismissible Notices Handler/Helper Functions
13
- * @author Julien Liabeuf <julien@liabeuf.fr>
14
- * @version 1.0
15
- * @license GPL-2.0+
16
- * @link https://julienliabeuf.com
17
- * @copyright 2016 Julien Liabeuf
18
- */
19
-
20
- /**
21
- * The main function responsible for returning the unique Dismissible Notices Handler instance
22
- *
23
- * Use this function like you would a global variable, except without needing
24
- * to declare the global.
25
- *
26
- * @since 1.0
27
- * @return object Dismissible_Notices_Handler
28
- */
29
-
30
- if ( function_exists( 'DNH' ) ) {
31
- return;
32
- }
33
-
34
- function DNH() {
35
- return Dismissible_Notices_Handler::instance();
36
- }
37
-
38
- /**
39
- * Register a new notice
40
- *
41
- * @since 1.0
42
- *
43
- * @param string $id Notice ID, used to identify it
44
- * @param string $type Type of notice to display
45
- * @param string $content Notice content
46
- * @param array $args Additional parameters
47
- *
48
- * @return bool
49
- */
50
- function dnh_register_notice( $id, $type, $content, $args = array() ) {
51
-
52
- if ( ! function_exists( 'DNH' ) ) {
53
- return false;
54
- }
55
-
56
- /**
57
- * Get the library running
58
- */
59
- DNH();
60
-
61
- return DNH()->register_notice( $id, $type, $content, $args );
62
-
63
- }
64
-
65
- /**
66
- * Restore a previously dismissed notice
67
- *
68
- * @since 1.0
69
- *
70
- * @param string $id ID of the notice to restore
71
- *
72
- * @return bool
73
- */
74
- function dnh_restore_notice( $id ) {
75
-
76
- if ( ! function_exists( 'DNH' ) ) {
77
- return false;
78
- }
79
-
80
- /**
81
- * Get the library running
82
- */
83
- DNH();
84
-
85
- return DNH()->restore_notice( $id );
86
-
87
- }
88
-
89
- /**
90
- * Check if a notice has been dismissed
91
- *
92
- * @since 1.0
93
- *
94
- * @param string $id ID of the notice to check
95
- *
96
- * @return bool
97
- */
98
- function dnh_is_dismissed( $id ) {
99
-
100
- if ( ! function_exists( 'DNH' ) ) {
101
- return false;
102
- }
103
-
104
- /**
105
- * Get the library running
106
- */
107
- DNH();
108
-
109
- return DNH()->is_dismissed( $id );
110
-
111
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
php/Admin/functions-admin.php CHANGED
@@ -4,6 +4,7 @@ namespace Nextgenthemes\ARVE\Admin;
4
  use const \Nextgenthemes\ARVE\PRO_VERSION_REQUIRED;
5
 
6
  use \Nextgenthemes\ARVE;
 
7
 
8
  use function \Nextgenthemes\ARVE\Common\ver;
9
  use function \Nextgenthemes\ARVE\Common\attr;
@@ -27,10 +28,6 @@ const ALLOWED_HTML = array(
27
 
28
  function action_admin_init_setup_messages() {
29
 
30
- if ( ! function_exists( 'dnh_register_notice' ) ) {
31
- return;
32
- }
33
-
34
  $pro_ver = false;
35
 
36
  if ( defined( 'ARVE_PRO_VERSION' ) ) {
@@ -49,7 +46,7 @@ function action_admin_init_setup_messages() {
49
  'https://nextgenthemes.com/plugins/arve/documentation/installing-and-license-management/'
50
  );
51
 
52
- dnh_register_notice(
53
  'ngt-arve-outdated-pro-v' . PRO_VERSION_REQUIRED,
54
  'notice-error',
55
  wp_kses( $msg, ALLOWED_HTML ),
@@ -60,7 +57,7 @@ function action_admin_init_setup_messages() {
60
  }
61
 
62
  if ( display_pro_ad() ) {
63
- dnh_register_notice(
64
  'ngt-arve-addon-ad',
65
  'notice-info',
66
  wp_kses( ad_html(), ALLOWED_HTML ),
4
  use const \Nextgenthemes\ARVE\PRO_VERSION_REQUIRED;
5
 
6
  use \Nextgenthemes\ARVE;
7
+ use \Nextgenthemes\ARVE\Common\Admin\Notices;
8
 
9
  use function \Nextgenthemes\ARVE\Common\ver;
10
  use function \Nextgenthemes\ARVE\Common\attr;
28
 
29
  function action_admin_init_setup_messages() {
30
 
 
 
 
 
31
  $pro_ver = false;
32
 
33
  if ( defined( 'ARVE_PRO_VERSION' ) ) {
46
  'https://nextgenthemes.com/plugins/arve/documentation/installing-and-license-management/'
47
  );
48
 
49
+ Notices::instance()->register_notice(
50
  'ngt-arve-outdated-pro-v' . PRO_VERSION_REQUIRED,
51
  'notice-error',
52
  wp_kses( $msg, ALLOWED_HTML ),
57
  }
58
 
59
  if ( display_pro_ad() ) {
60
+ Notices::instance()->register_notice(
61
  'ngt-arve-addon-ad',
62
  'notice-info',
63
  wp_kses( ad_html(), ALLOWED_HTML ),
libs/julien731/wp-dismissible-notices-handler/handler.php → php/Common/Admin/Notices.php RENAMED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
  /**
3
  * Dismissible Notices Handler.
4
  *
@@ -19,12 +21,12 @@
19
  * @copyright 2018 Julien Liabeuf
20
  */
21
 
22
- if ( ! class_exists( 'Dismissible_Notices_Handler' ) ) {
23
 
24
- final class Dismissible_Notices_Handler {
25
 
26
  /**
27
- * @var Dismissible_Notices_Handler Holds the unique instance of the handler
28
  * @since 1.0
29
  */
30
  private static $instance;
@@ -60,15 +62,15 @@ if ( ! class_exists( 'Dismissible_Notices_Handler' ) ) {
60
  private $notices;
61
 
62
  /**
63
- * Instantiate and return the unique Dismissible_Notices_Handler object
64
  *
65
  * @since 1.0
66
- * @return object Dismissible_Notices_Handler Unique instance of the handler
67
  */
68
  public static function instance() {
69
 
70
- if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Dismissible_Notices_Handler ) ) {
71
- self::$instance = new Dismissible_Notices_Handler;
72
  self::$instance->init();
73
  }
74
 
1
  <?php
2
+ namespace Nextgenthemes\ARVE\Common\Admin;
3
+
4
  /**
5
  * Dismissible Notices Handler.
6
  *
21
  * @copyright 2018 Julien Liabeuf
22
  */
23
 
24
+ if ( 'always' ) {
25
 
26
+ final class Notices {
27
 
28
  /**
29
+ * @var Notices Holds the unique instance of the handler
30
  * @since 1.0
31
  */
32
  private static $instance;
62
  private $notices;
63
 
64
  /**
65
+ * Instantiate and return the unique Notices object
66
  *
67
  * @since 1.0
68
+ * @return object Notices Unique instance of the handler
69
  */
70
  public static function instance() {
71
 
72
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Notices ) ) {
73
+ self::$instance = new Notices;
74
  self::$instance->init();
75
  }
76
 
php/Common/Admin/functions-notices.php CHANGED
@@ -2,14 +2,11 @@
2
  namespace Nextgenthemes\ARVE\Common\Admin;
3
 
4
  use \Nextgenthemes\ARVE\Common;
 
5
 
6
  // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralDomain
7
  function activation_notices() {
8
 
9
- if ( ! function_exists( 'dnh_register_notice' ) ) {
10
- return;
11
- }
12
-
13
  $products = Common\get_products();
14
 
15
  foreach ( $products as $key => $value ) :
@@ -22,7 +19,7 @@ function activation_notices() {
22
  get_admin_url() . 'options-general.php?page=nextgenthemes'
23
  );
24
 
25
- dnh_register_notice(
26
  "ngt-$key-activation-notice",
27
  'notice-info',
28
  '<p>' . $msg . '</p>',
2
  namespace Nextgenthemes\ARVE\Common\Admin;
3
 
4
  use \Nextgenthemes\ARVE\Common;
5
+ use \Nextgenthemes\ARVE\Common\Admin\Notices;
6
 
7
  // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralDomain
8
  function activation_notices() {
9
 
 
 
 
 
10
  $products = Common\get_products();
11
 
12
  foreach ( $products as $key => $value ) :
19
  get_admin_url() . 'options-general.php?page=nextgenthemes'
20
  );
21
 
22
+ Notices::instance()->register_notice(
23
  "ngt-$key-activation-notice",
24
  'notice-info',
25
  '<p>' . $msg . '</p>',
php/Common/init.php CHANGED
@@ -18,6 +18,7 @@ require_once __DIR__ . '/functions-assets.php';
18
  require_once __DIR__ . '/functions-remote-get.php';
19
  require_once __DIR__ . '/Admin/EDD/PluginUpdater.php';
20
  require_once __DIR__ . '/Admin/EDD/ThemeUpdater.php';
 
21
  require_once __DIR__ . '/Admin/functions-licensing.php';
22
  require_once __DIR__ . '/Admin/functions-settings.php';
23
  require_once __DIR__ . '/Admin/functions-notices.php';
18
  require_once __DIR__ . '/functions-remote-get.php';
19
  require_once __DIR__ . '/Admin/EDD/PluginUpdater.php';
20
  require_once __DIR__ . '/Admin/EDD/ThemeUpdater.php';
21
+ require_once __DIR__ . '/Admin/Notices.php';
22
  require_once __DIR__ . '/Admin/functions-licensing.php';
23
  require_once __DIR__ . '/Admin/functions-settings.php';
24
  require_once __DIR__ . '/Admin/functions-notices.php';
php/functions-oembed.php CHANGED
@@ -1,9 +1,6 @@
1
  <?php
2
  namespace Nextgenthemes\ARVE;
3
 
4
- const JSON_REGEX = '#<script type="application/json" data-arve-oembed>({[^}]+})</script>#s';
5
- const DATA_REGEX = '#(?<=data-arve-oembed>).*?(?=</script>)#s';
6
-
7
  /**
8
  * Info: https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-oembed.php
9
  * https://github.com/iamcal/oembed/tree/master/providers
@@ -18,13 +15,18 @@ function add_oembed_providers() {
18
  function filter_oembed_dataparse( $result, $data, $url ) {
19
 
20
  if ( $data && 'video' === $data->type ) {
21
- $data->html = str_replace( '<script', '<ESCAPED-cript', $data->html );
22
- $data->html = str_replace( '</script', '</ESCAPED-cript', $data->html );
23
- $data->arve_cachetime = time();
24
  if ( 'YouTube' === $data->provider_name ) {
25
  $data->arve_srcset = yt_srcset( $data->thumbnail_url );
26
  }
27
- $result .= '<script type="text" data-arve-oembed>' . \serialize( $data ) . '</script>';
 
 
 
 
 
28
  }
29
 
30
  return $result;
@@ -35,7 +37,8 @@ function filter_embed_oembed_html( $cache, $url, array $attr, $post_ID ) {
35
  \preg_match( '#(?<=data-arve-oembed>).*?(?=</script>)#s', $cache, $matches );
36
 
37
  if ( ! empty( $matches[0] ) ) {
38
- $attr['oembed_data'] = unserialize( $matches[0] );
 
39
  $attr['url'] = $url;
40
  $attr['post_id'] = (string) $post_ID;
41
 
@@ -57,7 +60,7 @@ function yt_srcset( $url ) {
57
  $size_maxres = Common\get_image_size( $maxres );
58
 
59
  $srcset[320] = $mq;
60
- $srcset[480] = $url; // 480x360
61
 
62
  if ( $size_sd && 640 === $size_sd[0] ) {
63
  $srcset[640] = $sd;
1
  <?php
2
  namespace Nextgenthemes\ARVE;
3
 
 
 
 
4
  /**
5
  * Info: https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-oembed.php
6
  * https://github.com/iamcal/oembed/tree/master/providers
15
  function filter_oembed_dataparse( $result, $data, $url ) {
16
 
17
  if ( $data && 'video' === $data->type ) {
18
+ unset($data->type);
19
+ $data->arve_cachetime = gmdate('Y-m-d H:i:s');
20
+
21
  if ( 'YouTube' === $data->provider_name ) {
22
  $data->arve_srcset = yt_srcset( $data->thumbnail_url );
23
  }
24
+
25
+ foreach ( $data as $k => $v ) {
26
+ $data->$k = \esc_html($v);
27
+ }
28
+
29
+ $result .= '<script type="application/json" data-arve-oembed>'.\wp_json_encode($data, JSON_UNESCAPED_UNICODE).'</script>';
30
  }
31
 
32
  return $result;
37
  \preg_match( '#(?<=data-arve-oembed>).*?(?=</script>)#s', $cache, $matches );
38
 
39
  if ( ! empty( $matches[0] ) ) {
40
+
41
+ $attr['oembed_data'] = json_decode( $matches[0], false, 512, JSON_UNESCAPED_UNICODE );
42
  $attr['url'] = $url;
43
  $attr['post_id'] = (string) $post_ID;
44
 
60
  $size_maxres = Common\get_image_size( $maxres );
61
 
62
  $srcset[320] = $mq;
63
+ $srcset[480] = $url; // hqdefault.jpg 480x360
64
 
65
  if ( $size_sd && 640 === $size_sd[0] ) {
66
  $srcset[640] = $sd;
php/functions-shortcode-args.php CHANGED
@@ -40,6 +40,13 @@ function sane_provider_name( $provider ) {
40
 
41
  function oembed_html2src( $data, $a ) {
42
 
 
 
 
 
 
 
 
43
  if ( 'Facebook' === $data->provider_name ) {
44
  preg_match( '/class="fb-video" data-href="([^"]+)"/', $data->html, $matches );
45
  } else {
@@ -47,7 +54,7 @@ function oembed_html2src( $data, $a ) {
47
  }
48
 
49
  if ( empty( $matches[1] ) ) {
50
- $a['errors']->add( 'on-oembed-src', 'No oembed src detected' );
51
  return null;
52
  }
53
 
40
 
41
  function oembed_html2src( $data, $a ) {
42
 
43
+ if ( empty( $data->html ) ) {
44
+ $a['errors']->add( 'no-oembed-html', 'No oembed html' );
45
+ return null;
46
+ }
47
+
48
+ $data->html = htmlspecialchars_decode( $data->html, ENT_COMPAT | ENT_HTML5 );
49
+
50
  if ( 'Facebook' === $data->provider_name ) {
51
  preg_match( '/class="fb-video" data-href="([^"]+)"/', $data->html, $matches );
52
  } else {
54
  }
55
 
56
  if ( empty( $matches[1] ) ) {
57
+ $a['errors']->add( 'no-oembed-src', 'No oembed src detected' );
58
  return null;
59
  }
60
 
php/init.php CHANGED
@@ -12,7 +12,7 @@ function init_public() {
12
 
13
  add_option( 'arve_install_date', time() );
14
 
15
- if ( version_compare( get_option( 'arve_version' ), '9.5.1-beta7', '<' ) ) {
16
  $GLOBALS['wpdb']->query( "DELETE FROM {$GLOBALS['wpdb']->postmeta} WHERE meta_key LIKE '%_oembed_%'" );
17
  }
18
  update_option( 'arve_version', VERSION );
@@ -39,16 +39,12 @@ function init_public() {
39
  add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\action_wp_enqueue_scripts' );
40
  add_action( 'wp_video_shortcode_override', __NAMESPACE__ . '\wp_video_shortcode_override', 10, 4 );
41
  add_filter( 'language_attributes', __NAMESPACE__ . '\html_id' );
42
- add_filter( 'oembed_dataparse', __NAMESPACE__ . '\filter_oembed_dataparse', 11, 3 );
43
- add_filter( 'embed_oembed_html', __NAMESPACE__ . '\filter_embed_oembed_html', 20, 4 );
44
  }
45
 
46
  function init_admin() {
47
 
48
- if ( is_admin() ) {
49
- require_once PLUGIN_DIR . '/libs/autoload.php';
50
- }
51
-
52
  require_once PLUGIN_DIR . '/php/Admin/functions-admin.php';
53
  require_once PLUGIN_DIR . '/php/Admin/functions-settings-page.php';
54
 
12
 
13
  add_option( 'arve_install_date', time() );
14
 
15
+ if ( version_compare( get_option( 'arve_version' ), '9.5.2-beta1', '<' ) ) {
16
  $GLOBALS['wpdb']->query( "DELETE FROM {$GLOBALS['wpdb']->postmeta} WHERE meta_key LIKE '%_oembed_%'" );
17
  }
18
  update_option( 'arve_version', VERSION );
39
  add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\action_wp_enqueue_scripts' );
40
  add_action( 'wp_video_shortcode_override', __NAMESPACE__ . '\wp_video_shortcode_override', 10, 4 );
41
  add_filter( 'language_attributes', __NAMESPACE__ . '\html_id' );
42
+ add_filter( 'oembed_dataparse', __NAMESPACE__ . '\filter_oembed_dataparse', PHP_INT_MAX, 3 );
43
+ add_filter( 'embed_oembed_html', __NAMESPACE__ . '\filter_embed_oembed_html', -5, 4 );
44
  }
45
 
46
  function init_admin() {
47
 
 
 
 
 
48
  require_once PLUGIN_DIR . '/php/Admin/functions-admin.php';
49
  require_once PLUGIN_DIR . '/php/Admin/functions-settings-page.php';
50
 
readme.txt CHANGED
@@ -56,7 +56,6 @@ It is very likely the one and only plugin you will ever need to handle video emb
56
 
57
  [All providers with iframe embed codes](https://nextgenthemes.com/plugins/arve/documentation/#general-iframe-embedding)
58
  Alugha, Archive.org, Banned.video, Bitchute, Break, Mail.ru, Brightcove, cantcensortruth.com, Comedy Central, Dailymotion, Dailymotion Playlist, DTube, Facebook, Google Drive, mp4 or webm video files, ARVE general iframe embed, IGN, IMDB, Kickstarter, kla.tv, LiveLeak, Livestream.com, Metacafe, myspace, ooyala, Rumble.com, RuTube.ru, Snotr, Spike, TED Talks, Twitch, Ustream, Viddler, Vimeo, VK, vzaar, Wistia, XTube, Yahoo, Youku, YouTube, YouTube Playlist
59
-
60
  ### Reviews ###
61
 
62
  #### &#9733; &#9733; &#9733; &#9733; &#9733; Great plugin, great support ####
@@ -173,6 +172,11 @@ Please read the [official documentation](https://wordpress.org/support/article/m
173
  * [ARVE Pro changelog](https://nextgenthemes.com/plugins/arve-pro/#changelog)
174
  * [ARVE Random Videos changelog](https://nextgenthemes.com/plugins/random-video/#changelog)
175
 
 
 
 
 
 
176
  ### 2021-02-13 9.5.1-beta7 ###
177
 
178
  * Fixed and further simplified oembed caching.
56
 
57
  [All providers with iframe embed codes](https://nextgenthemes.com/plugins/arve/documentation/#general-iframe-embedding)
58
  Alugha, Archive.org, Banned.video, Bitchute, Break, Mail.ru, Brightcove, cantcensortruth.com, Comedy Central, Dailymotion, Dailymotion Playlist, DTube, Facebook, Google Drive, mp4 or webm video files, ARVE general iframe embed, IGN, IMDB, Kickstarter, kla.tv, LiveLeak, Livestream.com, Metacafe, myspace, ooyala, Rumble.com, RuTube.ru, Snotr, Spike, TED Talks, Twitch, Ustream, Viddler, Vimeo, VK, vzaar, Wistia, XTube, Yahoo, Youku, YouTube, YouTube Playlist
 
59
  ### Reviews ###
60
 
61
  #### &#9733; &#9733; &#9733; &#9733; &#9733; Great plugin, great support ####
172
  * [ARVE Pro changelog](https://nextgenthemes.com/plugins/arve-pro/#changelog)
173
  * [ARVE Random Videos changelog](https://nextgenthemes.com/plugins/random-video/#changelog)
174
 
175
+ ### 2021-02-17 9.5.2-beta1 ###
176
+
177
+ * Fix: Conflict with Notice library.
178
+ * Changes to oembed data caching.
179
+
180
  ### 2021-02-13 9.5.1-beta7 ###
181
 
182
  * Fixed and further simplified oembed caching.