Version Description
Download this release
Release Info
Developer | nico23 |
Plugin | ARVE Advanced Responsive Video Embedder (YouTube, Vimeo, HTML5 Video …) |
Version | 9.0.0-beta5 |
Comparing to | |
See all releases |
Code changes from version 8.10.28 to 9.0.0-beta5
- admin/arve-admin.css +0 -67
- admin/arve-admin.js +0 -108
- admin/arve-shortcode-ui.js +0 -74
- admin/class-arve-admin-notice-factory.php +0 -61
- admin/functions-admin.php +0 -650
- admin/functions-licensing.php +0 -621
- admin/html-debug-info.php +0 -60
- admin/html-settings-page.php +0 -78
- admin/index.php +0 -1
- admin/pro-ad.html +0 -14
- admin/product-images/arve.svg +0 -1230
- advanced-responsive-video-embedder.php +106 -80
- build/admin.asset.php +1 -0
- build/admin.css +2 -0
- build/admin.js +1 -0
- build/block.asset.php +1 -0
- build/block.js +1 -0
- build/common/notice-ajax.asset.php +1 -0
- build/common/notice-ajax.js +1 -0
- build/common/settings.asset.php +1 -0
- build/common/settings.css +2 -0
- build/common/settings.js +1 -0
- build/main.asset.php +1 -0
- build/main.css +2 -0
- build/main.js +1 -0
- build/shortcode-ui.asset.php +1 -0
- build/shortcode-ui.js +1 -0
- php/Admin/functions-admin.php +383 -0
- php/Admin/functions-settings-page.php +112 -0
- php/Admin/partials/debug-info.php +18 -0
- php/Admin/partials/pro-ad.html +10 -0
- php/Admin/partials/pro-ad.md +11 -0
- php/Admin/partials/settings-sidebar.html +22 -0
- php/Admin/partials/settings-sidebar.md +33 -0
- admin/class-nextgenthemes-plugin-updater.php → php/Common/Admin/EDD/PluginUpdater.php +5 -4
- php/Common/Admin/EDD/ThemeUpdater.php +160 -0
- php/Common/Admin/NoticeFactory.php +73 -0
- php/Common/Admin/functions-licensing.php +78 -0
- php/Common/Admin/functions-notices.php +23 -0
- php/Common/Admin/functions-settings.php +172 -0
- php/Common/Settings.php +227 -0
- php/Common/functions-assets.php +268 -0
- php/Common/functions-attr.php +33 -0
- php/Common/functions-license.php +129 -0
- php/Common/functions-misc.php +123 -0
- php/Common/functions-remote-get.php +97 -0
- php/Common/functions-settings.php +174 -0
- php/Common/functions-string.php +33 -0
- php/Common/init.php +32 -0
- php/EmbedChecker.php +29 -0
- php/functions-assets.php +127 -0
- php/functions-deprecated.php +1 -0
- php/functions-host-properties.php +874 -0
- php/functions-html-output.php +381 -0
- php/functions-misc.php +125 -0
- php/functions-oembed.php +115 -0
- php/functions-settings.php +771 -0
- php/functions-shortcode-data.php +126 -0
- php/functions-shortcode-filters.php +688 -0
- php/functions-shortcodes.php +194 -0
- php/functions-url-handlers.php +39 -0
- php/functions-validation.php +128 -0
- public/arve.css +0 -71
- public/arve.js +0 -50
- public/arve.min.css +0 -1
- public/arve.min.js +0 -1
- public/functions-enqueue.php +0 -39
- public/functions-html-output.php +0 -253
- public/functions-misc.php +0 -152
- public/functions-shortcode-data.php +0 -298
- public/functions-shortcode-filters.php +0 -437
- public/functions-shortcodes.php +0 -286
- public/functions-thumbnails.php +0 -47
- public/functions-url-handlers.php +0 -140
- public/functions-validation.php +0 -106
- readme.md +5 -0
- readme.txt +176 -237
- shared/functions-shared.php +0 -1187
- tsconfig.json +38 -0
- uninstall.php +0 -31
admin/arve-admin.css
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
.arve-license-input {
|
2 |
-
width: 280px;
|
3 |
-
}
|
4 |
-
|
5 |
-
.arve-btn {
|
6 |
-
padding-left: 3px;
|
7 |
-
}
|
8 |
-
|
9 |
-
.arve-icon:before {
|
10 |
-
content: "\f236" !important; /* dashicon-video-alt */
|
11 |
-
}
|
12 |
-
|
13 |
-
.edit-shortcode-form-fields.shortcode-ui-edit-arve .field-block {
|
14 |
-
padding-top: .4em;
|
15 |
-
padding-bottom: .4em;
|
16 |
-
}
|
17 |
-
|
18 |
-
.edit-shortcode-form-fields.shortcode-ui-edit-arve .field-block label {
|
19 |
-
display: inline-block;
|
20 |
-
margin: 0;
|
21 |
-
}
|
22 |
-
|
23 |
-
.edit-shortcode-form-fields.shortcode-ui-edit-arve .field-block label:first-child {
|
24 |
-
width: 110px;
|
25 |
-
}
|
26 |
-
|
27 |
-
.edit-shortcode-form-fields.shortcode-ui-edit-arve .shortcode-ui-attribute-upload_date input,
|
28 |
-
.edit-shortcode-form-fields.shortcode-ui-edit-arve .shortcode-ui-attribute-aspect_ratio input,
|
29 |
-
.edit-shortcode-form-fields.shortcode-ui-edit-arve .shortcode-ui-attribute-url input,
|
30 |
-
.edit-shortcode-form-fields.shortcode-ui-edit-arve .shortcode-ui-attribute-title input,
|
31 |
-
.edit-shortcode-form-fields.shortcode-ui-edit-arve .shortcode-ui-attribute-description input {
|
32 |
-
width: 700px;
|
33 |
-
}
|
34 |
-
|
35 |
-
.arve-list-small {
|
36 |
-
font-size: .85em;
|
37 |
-
list-style: square;
|
38 |
-
padding-left: 20px;
|
39 |
-
}
|
40 |
-
|
41 |
-
.arve-list-small li {
|
42 |
-
margin-bottom: 2px;
|
43 |
-
}
|
44 |
-
|
45 |
-
.arve-settings-page-ad {
|
46 |
-
margin: 0;
|
47 |
-
padding-right: .7rem !important;
|
48 |
-
}
|
49 |
-
|
50 |
-
.arve-corner-spacer {
|
51 |
-
float: right;
|
52 |
-
width: 20px;
|
53 |
-
height: 38px;
|
54 |
-
}
|
55 |
-
|
56 |
-
@media all and (min-width: 1024px) {
|
57 |
-
.arve-settings-page-ad {
|
58 |
-
position: absolute !important;
|
59 |
-
right: 0;
|
60 |
-
width: 320px;
|
61 |
-
}
|
62 |
-
|
63 |
-
.arve-options-wrap {
|
64 |
-
padding-right: 350px;
|
65 |
-
position: relative;
|
66 |
-
}
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/arve-admin.js
DELETED
@@ -1,108 +0,0 @@
|
|
1 |
-
(function ( $ ) {
|
2 |
-
'use strict';
|
3 |
-
/*global ajaxurl */
|
4 |
-
/*global sui */
|
5 |
-
/*global tb_show */
|
6 |
-
|
7 |
-
// Options Page
|
8 |
-
$('.arve-settings-section').each( function() {
|
9 |
-
|
10 |
-
$(this).insertBefore( $(this).parent() );
|
11 |
-
});
|
12 |
-
|
13 |
-
$('.arve-settings-section').each( function() {
|
14 |
-
|
15 |
-
var id = $(this).attr( 'id' );
|
16 |
-
var classs = $(this).attr( 'class' );
|
17 |
-
var title = $(this).attr( 'title' );
|
18 |
-
|
19 |
-
$(this).nextUntil( '.arve-settings-section' ).wrapAll( '<section id="' + id + '" class="' + classs + '" />' );
|
20 |
-
|
21 |
-
$( '<a href="#" data-target="#' + id + '" class="nav-tab">' + title + '</a>' ).appendTo( '.arve-settings-tabs' );
|
22 |
-
|
23 |
-
$(this).remove();
|
24 |
-
});
|
25 |
-
|
26 |
-
function show_tab( target ) {
|
27 |
-
|
28 |
-
$('.arve-settings-section').show();
|
29 |
-
$( target ).prependTo( '.arve-options-form' );
|
30 |
-
$('.arve-settings-section').not( target ).hide();
|
31 |
-
$('.arve-settings-tabs a').removeClass( 'nav-tab-active' );
|
32 |
-
$('.arve-settings-tabs a[data-target="' + target + '"]').addClass( 'nav-tab-active' );
|
33 |
-
}
|
34 |
-
|
35 |
-
if ( $( '#arve_options_main\\[last_settings_tab\\]' ).length && $( '#arve_options_main\\[last_settings_tab\\]' ).val().length ) {
|
36 |
-
show_tab( $( '#arve_options_main\\[last_settings_tab\\]' ).val() );
|
37 |
-
}
|
38 |
-
|
39 |
-
$(document).on( 'click', '.arve-settings-tabs a', function(e) {
|
40 |
-
|
41 |
-
e.preventDefault();
|
42 |
-
var target = $(this).attr('data-target');
|
43 |
-
show_tab( target );
|
44 |
-
$( '#arve_options_main\\[last_settings_tab\\]' ).val( target );
|
45 |
-
} );
|
46 |
-
|
47 |
-
$(document).on( 'click', '[data-image-upload]', function(e) {
|
48 |
-
|
49 |
-
e.preventDefault();
|
50 |
-
var target = $( this ).attr('data-image-upload');
|
51 |
-
var image = wp.media({
|
52 |
-
title: 'Upload Image',
|
53 |
-
// mutiple: true if you want to upload multiple files at once
|
54 |
-
multiple: false
|
55 |
-
}).open()
|
56 |
-
.on('select', function(){
|
57 |
-
// This will return the selected image from the Media Uploader, the result is an object
|
58 |
-
var uploaded_image = image.state().get('selection').first();
|
59 |
-
// We convert uploaded_image to a JSON object to make accessing it easier
|
60 |
-
// Output to the console uploaded_image
|
61 |
-
var attachment_id = uploaded_image.toJSON().id;
|
62 |
-
// Let's assign the url value to the input field
|
63 |
-
$( target ).val(attachment_id);
|
64 |
-
});
|
65 |
-
});
|
66 |
-
|
67 |
-
$(document).on( 'click', '.arve-pro-notice .notice-dismiss', function() {
|
68 |
-
|
69 |
-
jQuery.ajax({
|
70 |
-
url: ajaxurl,
|
71 |
-
data: {
|
72 |
-
action: 'arve_ajax_dismiss_pro_notice'
|
73 |
-
}
|
74 |
-
});
|
75 |
-
});
|
76 |
-
|
77 |
-
$(document).on( 'click', '[data-nj-notice-id] .notice-dismiss', function() {
|
78 |
-
|
79 |
-
var id = $(this).closest('[data-nj-notice-id]').attr('data-nj-notice-id');
|
80 |
-
|
81 |
-
jQuery.ajax({
|
82 |
-
url: ajaxurl,
|
83 |
-
data: {
|
84 |
-
action: id
|
85 |
-
}
|
86 |
-
});
|
87 |
-
});
|
88 |
-
|
89 |
-
$(document).on( 'click', '#arve-btn', function() {
|
90 |
-
|
91 |
-
if ( typeof( sui ) !== 'undefined' ) {
|
92 |
-
|
93 |
-
var arve_shortcode = sui.utils.shortcodeViewConstructor.parseShortcodeString( '[arve]' );
|
94 |
-
|
95 |
-
wp.media({
|
96 |
-
frame : 'post',
|
97 |
-
state : 'shortcode-ui',
|
98 |
-
currentShortcode : arve_shortcode
|
99 |
-
}).open();
|
100 |
-
|
101 |
-
} else {
|
102 |
-
|
103 |
-
tb_show( 'ARVE Optional Features', '#TB_inline?inlineId=arve-thickbox' );
|
104 |
-
}
|
105 |
-
|
106 |
-
} );
|
107 |
-
|
108 |
-
}(jQuery));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/arve-shortcode-ui.js
DELETED
@@ -1,74 +0,0 @@
|
|
1 |
-
function arve_extract_url( changed, collection, shortcode ) {
|
2 |
-
|
3 |
-
function attr_by_name( name ) {
|
4 |
-
return _.find(
|
5 |
-
collection,
|
6 |
-
function( viewModel ) {
|
7 |
-
return name === viewModel.model.get( 'attr' );
|
8 |
-
}
|
9 |
-
);
|
10 |
-
}
|
11 |
-
|
12 |
-
var val = changed.value,
|
13 |
-
short_val = changed.value,
|
14 |
-
input = attr_by_name( 'url' ).$el.find( 'input' );
|
15 |
-
|
16 |
-
if( typeof val === 'undefined' ) {
|
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' );
|
26 |
-
}
|
27 |
-
}
|
28 |
-
|
29 |
-
function arve_mode_select_listener( changed, collection, shortcode ) {
|
30 |
-
|
31 |
-
function attr_by_name(name) {
|
32 |
-
return _.find(
|
33 |
-
collection,
|
34 |
-
function( viewModel ) {
|
35 |
-
return name === viewModel.model.get('attr');
|
36 |
-
}
|
37 |
-
);
|
38 |
-
}
|
39 |
-
|
40 |
-
var val = changed.value,
|
41 |
-
autoplay = attr_by_name( 'autoplay' ),
|
42 |
-
grow = attr_by_name( 'grow' ),
|
43 |
-
align = attr_by_name( 'align' ),
|
44 |
-
hide_title = attr_by_name( 'hide_title' );
|
45 |
-
|
46 |
-
if( typeof val === 'undefined' ) {
|
47 |
-
return;
|
48 |
-
}
|
49 |
-
|
50 |
-
if ( 'lazyload-lightbox' === val ) {
|
51 |
-
align.$el.show();
|
52 |
-
autoplay.$el.hide();
|
53 |
-
grow.$el.hide();
|
54 |
-
hide_title.$el.show();
|
55 |
-
} else if ( 'lazyload' === val ) {
|
56 |
-
align.$el.show();
|
57 |
-
autoplay.$el.hide();
|
58 |
-
grow.$el.show();
|
59 |
-
hide_title.$el.show();
|
60 |
-
} else if ( 'link-lightbox' === val ) {
|
61 |
-
align.$el.hide();
|
62 |
-
autoplay.$el.hide();
|
63 |
-
grow.$el.hide();
|
64 |
-
hide_title.$el.hide();
|
65 |
-
} else { // normal
|
66 |
-
align.$el.show();
|
67 |
-
autoplay.$el.show();
|
68 |
-
grow.$el.hide();
|
69 |
-
hide_title.$el.hide();
|
70 |
-
}
|
71 |
-
}
|
72 |
-
|
73 |
-
wp.shortcake.hooks.addAction( 'arve.mode', arve_mode_select_listener );
|
74 |
-
wp.shortcake.hooks.addAction( 'arve.url', arve_extract_url );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/class-arve-admin-notice-factory.php
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class ARVE_Admin_Notice_Factory {
|
4 |
-
|
5 |
-
private $notice_id;
|
6 |
-
private $notice;
|
7 |
-
private $dismiss_forever;
|
8 |
-
|
9 |
-
public function __construct( $notice_id, $notice, $dismiss_forever = true, $capabilities = 'activate_plugins' ) {
|
10 |
-
|
11 |
-
if ( ! current_user_can( $capabilities ) ) {
|
12 |
-
return;
|
13 |
-
}
|
14 |
-
|
15 |
-
$this->notice_id = "admin-notice-factory-$notice_id";
|
16 |
-
$this->notice = $notice;
|
17 |
-
$this->dismiss_forever = $dismiss_forever;
|
18 |
-
|
19 |
-
if ( 'admin-notice-factory-arve_dismiss_pro_notice' === $this->notice_id ) {
|
20 |
-
$this->notice_id = 'arve_dismiss_pro_notice';
|
21 |
-
}
|
22 |
-
|
23 |
-
add_action( 'admin_notices', array( $this, 'action_admin_notices' ) );
|
24 |
-
add_action( 'wp_ajax_' . $this->notice_id, array( $this, 'ajax_call' ) );
|
25 |
-
}
|
26 |
-
|
27 |
-
public function action_admin_notices() {
|
28 |
-
|
29 |
-
if ( apply_filters( 'nj_debug_admin_message', false ) ) {
|
30 |
-
delete_user_meta( get_current_user_id(), $this->notice_id );
|
31 |
-
delete_transient( $this->notice_id );
|
32 |
-
}
|
33 |
-
|
34 |
-
$user_id = get_current_user_id();
|
35 |
-
$user_meta = get_user_meta( $user_id, $this->notice_id );
|
36 |
-
|
37 |
-
if ( $this->dismiss_forever && ! empty( $user_meta ) ) {
|
38 |
-
return;
|
39 |
-
} elseif ( get_transient( $this->notice_id ) ) {
|
40 |
-
return;
|
41 |
-
}
|
42 |
-
|
43 |
-
printf(
|
44 |
-
'<div class="notice is-dismissible updated" data-nj-notice-id="%s">%s</div>',
|
45 |
-
esc_attr( $this->notice_id ),
|
46 |
-
$this->notice // phpcs:ignore
|
47 |
-
);
|
48 |
-
}
|
49 |
-
|
50 |
-
public function ajax_call() {
|
51 |
-
|
52 |
-
$user_id = get_current_user_id();
|
53 |
-
|
54 |
-
if ( $this->dismiss_forever ) {
|
55 |
-
add_user_meta( $user_id, $this->notice_id, true );
|
56 |
-
} else {
|
57 |
-
set_transient( $this->notice_id, true, HOUR_IN_SECONDS );
|
58 |
-
}
|
59 |
-
wp_die();
|
60 |
-
}
|
61 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/functions-admin.php
DELETED
@@ -1,650 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_action_admin_init_setup_messages() {
|
4 |
-
|
5 |
-
if ( defined( 'ARVE_PRO_VERSION' ) && version_compare( ARVE_PRO_VERSION_REQUIRED, ARVE_PRO_VERSION, '>' ) ) {
|
6 |
-
|
7 |
-
$msg = sprintf(
|
8 |
-
__( 'Your ARVE Pro Addon is outdated, you need version %1$s or later. If you have setup your license <a href="%2$s">here</a> semi auto updates (Admin panel notice and auto install on confirmation) should work again. If not please <a href="%3$s">report it</a> and manually update as <a href="%4$s">described here.</a>', ARVE_SLUG ),
|
9 |
-
ARVE_PRO_VERSION_REQUIRED,
|
10 |
-
get_admin_url() . 'admin.php?page=nextgenthemes-licenses',
|
11 |
-
'https://nextgenthemes.com/support/',
|
12 |
-
'https://nextgenthemes.com/plugins/arve/documentation/installing-and-license-management/'
|
13 |
-
);
|
14 |
-
|
15 |
-
new ARVE_Admin_Notice_Factory( 'arve-pro-outdated', "<p>$msg</p>", false );
|
16 |
-
}
|
17 |
-
|
18 |
-
if ( arve_display_pro_ad() ) {
|
19 |
-
|
20 |
-
$pro_ad_message = __( '<p>Hi, this is Nico(las Jonas) the author of the ARVE - Advanced Responsive Video Embedder plugin. If you are interrested in additional features and/or want to support the work I do on this plugin please consider buying the Pro Addon.</p>', ARVE_SLUG );
|
21 |
-
|
22 |
-
$pro_ad_message .= file_get_contents( ARVE_PATH . 'admin/pro-ad.html' );
|
23 |
-
|
24 |
-
new ARVE_Admin_Notice_Factory( 'arve_dismiss_pro_notice', $pro_ad_message, true );
|
25 |
-
}
|
26 |
-
|
27 |
-
$msg = sprintf(
|
28 |
-
__( '<p>Dear ARVE users, if you can spare the time <a href="%s">I need your help</a> trying out the upcoming version with new features and improvements before official release on wp.org. I would really really appreciate you helping out. Thanks so much!</p>', ARVE_SLUG ),
|
29 |
-
'https://nextgenthemes.com/help-test-the-beta-version/'
|
30 |
-
);
|
31 |
-
|
32 |
-
new ARVE_Admin_Notice_Factory( 'arve-beta-testers', "<p>$msg</p>" );
|
33 |
-
}
|
34 |
-
|
35 |
-
function arve_add_tinymce_plugin( $plugin_array ) {
|
36 |
-
$plugin_array['arve'] = ARVE_ADMIN_URL . 'tinymce.js';
|
37 |
-
return $plugin_array;
|
38 |
-
}
|
39 |
-
|
40 |
-
function arve_display_pro_ad() {
|
41 |
-
|
42 |
-
$inst = (int) get_option( 'arve_install_date' );
|
43 |
-
|
44 |
-
if ( ! current_user_can( 'update_plugins' ) || ! apply_filters( 'arve_pro_ad', true ) || current_time( 'timestamp' ) < strtotime( '+1 week', $inst ) ) {
|
45 |
-
return false;
|
46 |
-
}
|
47 |
-
|
48 |
-
return true;
|
49 |
-
}
|
50 |
-
|
51 |
-
function arve_widget_text() {
|
52 |
-
|
53 |
-
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
54 |
-
echo '<p>';
|
55 |
-
printf( '<a href="%s">Documentation</a>, ', 'https://nextgenthemes.com/plugins/arve/documentation/' );
|
56 |
-
printf( '<a href="%s">Support</a>, ', 'https://nextgenthemes.com/support/' );
|
57 |
-
printf( '<a href="%s">%s</a>', admin_url( 'admin.php?page=advanced-responsive-video-embedder' ), __( 'Settings', ARVE_SLUG ) );
|
58 |
-
echo '</p>';
|
59 |
-
|
60 |
-
printf( '<a href="%s">ARVE Pro Addon Features</a>:', 'https://nextgenthemes.com/plugins/arve-pro/' );
|
61 |
-
|
62 |
-
echo file_get_contents( ARVE_PATH . 'admin/pro-ad.html' );
|
63 |
-
}
|
64 |
-
|
65 |
-
function arve_add_dashboard_widget() {
|
66 |
-
|
67 |
-
if ( ! arve_display_pro_ad() ) {
|
68 |
-
return false;
|
69 |
-
}
|
70 |
-
|
71 |
-
wp_add_dashboard_widget(
|
72 |
-
'arve_dashboard_widget', // Widget slug.
|
73 |
-
'Advanced Responsive Video Embedder', // Title.
|
74 |
-
'arve_widget_text' // Display function.
|
75 |
-
);
|
76 |
-
|
77 |
-
// phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited
|
78 |
-
|
79 |
-
// Globalize the metaboxes array, this holds all the widgets for wp-admin.
|
80 |
-
global $wp_meta_boxes, $pagenow;
|
81 |
-
|
82 |
-
if ( 'index.php' === $pagenow ) {
|
83 |
-
// Get the regular dashboard widgets array.
|
84 |
-
// (which has our new widget already but at the end).
|
85 |
-
$normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core'];
|
86 |
-
|
87 |
-
// Backup and delete our new dashboard widget from the end of the array.
|
88 |
-
$arve_widget_backup = array( 'arve_dashboard_widget' => $normal_dashboard['arve_dashboard_widget'] );
|
89 |
-
unset( $normal_dashboard['arve_dashboard_widget'] );
|
90 |
-
|
91 |
-
// Merge the two arrays together so our widget is at the beginning.
|
92 |
-
$sorted_dashboard = array_merge( $arve_widget_backup, $normal_dashboard );
|
93 |
-
|
94 |
-
// Save the sorted array back into the original metaboxes.
|
95 |
-
$wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard;
|
96 |
-
}
|
97 |
-
// phpcs:enable WordPress.WP.GlobalVariablesOverride.Prohibited
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Register the administration menu for this plugin into the WordPress Dashboard menu.
|
102 |
-
*
|
103 |
-
* @since 1.0.0
|
104 |
-
*/
|
105 |
-
function arve_add_plugin_admin_menu() {
|
106 |
-
|
107 |
-
$plugin_screen_hook_suffix = add_options_page(
|
108 |
-
__( 'Advanced Responsive Video Embedder Settings', ARVE_SLUG ),
|
109 |
-
__( 'ARVE', ARVE_SLUG ),
|
110 |
-
'manage_options',
|
111 |
-
ARVE_SLUG, # menu-slug
|
112 |
-
function() {
|
113 |
-
require_once plugin_dir_path( __FILE__ ) . 'html-settings-page.php';
|
114 |
-
}
|
115 |
-
);
|
116 |
-
|
117 |
-
add_submenu_page(
|
118 |
-
'nextgenthemes', # parent_slug
|
119 |
-
__( 'Advanced Responsive Video Embedder Settings', ARVE_SLUG ), # Page Title
|
120 |
-
__( 'ARVE', ARVE_SLUG ), # Menu Title
|
121 |
-
'manage_options', # capability
|
122 |
-
ARVE_SLUG # menu-slug
|
123 |
-
);
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Add settings action link to the plugins page.
|
128 |
-
*
|
129 |
-
* @since 1.0.0
|
130 |
-
*/
|
131 |
-
function arve_add_action_links( $links ) {
|
132 |
-
|
133 |
-
if ( ! is_plugin_active( 'arve-pro/arve-pro.php' ) ) {
|
134 |
-
|
135 |
-
$extra_links['buy_pro_addon'] = sprintf(
|
136 |
-
'<a href="%s"><strong style="display: inline;">%s</strong></a>',
|
137 |
-
'https://nextgenthemes.com/plugins/arve-pro/',
|
138 |
-
__( 'Buy Pro Addon', ARVE_SLUG )
|
139 |
-
);
|
140 |
-
}
|
141 |
-
|
142 |
-
$extra_links['donate'] = sprintf( '<a href="https://nextgenthemes.com/donate/"><strong style="display: inline;">%s</strong></a>', __( 'Donate', ARVE_SLUG ) );
|
143 |
-
$extra_links['settings'] = sprintf( '<a href="%s">%s</a>', admin_url( 'options-general.php?page=' . ARVE_SLUG ), __( 'Settings', ARVE_SLUG ) );
|
144 |
-
|
145 |
-
return array_merge( $extra_links, $links );
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Action to add a custom button to the content editor
|
150 |
-
*
|
151 |
-
* @since 4.3.0
|
152 |
-
*/
|
153 |
-
function arve_add_media_button() {
|
154 |
-
|
155 |
-
$options = arve_get_options();
|
156 |
-
|
157 |
-
add_thickbox();
|
158 |
-
|
159 |
-
$p1 = __( 'This button can open a optional ARVE a Shortcode creation dialog. ARVE needs the <a href="%s">Shortcode UI plugin</a> active for this fuctionality.', ARVE_SLUG );
|
160 |
-
$p2 = __( 'The "Shortcake (Shortcode UI)" plugin also adds What You See Is What You Get functionality to WordPress visual post editor.', ARVE_SLUG );
|
161 |
-
$p3 = __( 'It is perfectly fine to pass on this and <a href="%s">manually</a> write shortcodes or don\'t use shortcodes at all, but it makes things easier.', ARVE_SLUG );
|
162 |
-
|
163 |
-
printf(
|
164 |
-
"<div id='arve-thickbox' style='display:none;'><p>$p1</p><p>$p2</p><p>$p3</p></div>",
|
165 |
-
nextgenthemes_admin_install_search_url( 'Shortcode+UI' ),
|
166 |
-
esc_url( 'https://nextgenthemes.com/plugins/arve/documentation/' )
|
167 |
-
);
|
168 |
-
|
169 |
-
printf(
|
170 |
-
'<button id="arve-btn" title="%s" data-mode="%s" class="arve-btn button add_media" type="button"><span class="wp-media-buttons-icon arve-icon"></span> %s</button>',
|
171 |
-
esc_attr__( 'ARVE Advanced Responsive Video Embedder', ARVE_SLUG ),
|
172 |
-
esc_attr( $options['mode'] ),
|
173 |
-
esc_html__( 'Embed Video (ARVE)', ARVE_SLUG )
|
174 |
-
);
|
175 |
-
}
|
176 |
-
|
177 |
-
function arve_register_shortcode_ui() {
|
178 |
-
|
179 |
-
$attrs = arve_get_settings_definitions();
|
180 |
-
|
181 |
-
if ( function_exists( 'arve_pro_get_settings_definitions' ) ) {
|
182 |
-
$attrs = array_merge( $attrs, arve_pro_get_settings_definitions() );
|
183 |
-
}
|
184 |
-
|
185 |
-
foreach ( $attrs as $key => $values ) {
|
186 |
-
|
187 |
-
if ( isset( $values['hide_from_sc'] ) && $values['hide_from_sc'] ) {
|
188 |
-
continue;
|
189 |
-
}
|
190 |
-
|
191 |
-
$sc_attrs[] = $values;
|
192 |
-
}
|
193 |
-
|
194 |
-
shortcode_ui_register_for_shortcode(
|
195 |
-
'arve',
|
196 |
-
array(
|
197 |
-
'label' => esc_html( 'ARVE' ),
|
198 |
-
'listItemImage' => 'dashicons-format-video',
|
199 |
-
'attrs' => $sc_attrs,
|
200 |
-
)
|
201 |
-
);
|
202 |
-
|
203 |
-
}
|
204 |
-
|
205 |
-
function arve_input( $args ) {
|
206 |
-
|
207 |
-
$out = sprintf( '<input%s>', arve_attr( $args['input_attr'] ) );
|
208 |
-
|
209 |
-
if ( ! empty( $args['option_values']['attr'] ) && 'thumbnail_fallback' === $args['option_values']['attr'] ) {
|
210 |
-
|
211 |
-
// jQuery
|
212 |
-
wp_enqueue_script( 'jquery' );
|
213 |
-
// This will enqueue the Media Uploader script
|
214 |
-
wp_enqueue_media();
|
215 |
-
|
216 |
-
$out .= sprintf(
|
217 |
-
'<a %s>%s</a>',
|
218 |
-
arve_attr(
|
219 |
-
array(
|
220 |
-
'data-image-upload' => sprintf( '[name="%s"]', $args['input_attr']['name'] ),
|
221 |
-
'class' => 'button-secondary',
|
222 |
-
)
|
223 |
-
),
|
224 |
-
__( 'Upload Image', ARVE_SLUG )
|
225 |
-
);
|
226 |
-
}
|
227 |
-
|
228 |
-
if ( ! empty( $args['description'] ) ) {
|
229 |
-
$out = $out . '<p class="description">' . $args['description'] . '</p>';
|
230 |
-
}
|
231 |
-
|
232 |
-
echo $out;
|
233 |
-
}
|
234 |
-
|
235 |
-
function arve_textarea( $args ) {
|
236 |
-
|
237 |
-
unset( $args['input_attr']['type'] );
|
238 |
-
|
239 |
-
$out = sprintf( '<textarea%s></textarea>', arve_attr( $args['input_attr'] ) );
|
240 |
-
|
241 |
-
if ( ! empty( $args['description'] ) ) {
|
242 |
-
$out = $out . '<p class="description">' . $args['description'] . '</p>';
|
243 |
-
}
|
244 |
-
|
245 |
-
echo $out;
|
246 |
-
}
|
247 |
-
|
248 |
-
function arve_select( $args ) {
|
249 |
-
|
250 |
-
unset( $args['input_attr']['type'] );
|
251 |
-
|
252 |
-
foreach ( $args['option_values']['options'] as $key => $value ) {
|
253 |
-
|
254 |
-
if (
|
255 |
-
2 === count( $args['option_values']['options'] ) &&
|
256 |
-
array_key_exists( 'yes', $args['option_values']['options'] ) &&
|
257 |
-
array_key_exists( 'no', $args['option_values']['options'] )
|
258 |
-
) {
|
259 |
-
$current_option = $args['input_attr']['value'] ? 'yes' : 'no';
|
260 |
-
} else {
|
261 |
-
$current_option = $args['input_attr']['value'];
|
262 |
-
}
|
263 |
-
|
264 |
-
$options[] = sprintf(
|
265 |
-
'<option value="%s" %s>%s</option>',
|
266 |
-
esc_attr( $key ),
|
267 |
-
selected( $current_option, $key, false ),
|
268 |
-
esc_html( $value )
|
269 |
-
);
|
270 |
-
}
|
271 |
-
|
272 |
-
$select_attr = $args['input_attr'];
|
273 |
-
unset( $select_attr['value'] );
|
274 |
-
|
275 |
-
$out = sprintf( '<select%s>%s</select>', arve_attr( $select_attr ), implode( '', $options ) );
|
276 |
-
|
277 |
-
if ( ! empty( $args['description'] ) ) {
|
278 |
-
$out = $out . '<p class="description">' . $args['description'] . '</p>';
|
279 |
-
}
|
280 |
-
|
281 |
-
echo $out;
|
282 |
-
}
|
283 |
-
|
284 |
-
/**
|
285 |
-
*
|
286 |
-
*
|
287 |
-
* @since 2.6.0
|
288 |
-
*/
|
289 |
-
function arve_register_settings() {
|
290 |
-
|
291 |
-
$options = arve_get_options();
|
292 |
-
|
293 |
-
// Main
|
294 |
-
$main_title = __( 'Main Options', ARVE_SLUG );
|
295 |
-
|
296 |
-
add_settings_section(
|
297 |
-
'main_section',
|
298 |
-
sprintf( '<span class="arve-settings-section" id="arve-settings-section-main" title="%s"></span>%s', esc_attr( $main_title ), esc_html( $main_title ) ),
|
299 |
-
null,
|
300 |
-
ARVE_SLUG
|
301 |
-
);
|
302 |
-
|
303 |
-
foreach ( arve_get_settings_definitions() as $key => $value ) {
|
304 |
-
|
305 |
-
if ( ! empty( $value['hide_from_settings'] ) ) {
|
306 |
-
continue;
|
307 |
-
};
|
308 |
-
|
309 |
-
if ( empty( $value['meta'] ) ) {
|
310 |
-
$value['meta'] = array();
|
311 |
-
};
|
312 |
-
|
313 |
-
if ( isset( $value['options'][''] ) ) {
|
314 |
-
unset( $value['options'][''] );
|
315 |
-
}
|
316 |
-
|
317 |
-
if ( in_array( $value['type'], array( 'text', 'number', 'url' ), true ) ) {
|
318 |
-
$callback_function = 'arve_input';
|
319 |
-
} else {
|
320 |
-
$callback_function = 'arve_' . $value['type'];
|
321 |
-
}
|
322 |
-
|
323 |
-
add_settings_field(
|
324 |
-
"arve_options_main[{$value['attr']}]", // ID
|
325 |
-
$value['label'], // title
|
326 |
-
$callback_function, // callback
|
327 |
-
ARVE_SLUG, // page
|
328 |
-
'main_section', // section
|
329 |
-
array( // args
|
330 |
-
'label_for' => ( 'radio' === $value['type'] ) ? null : "arve_options_main[{$value['attr']}]",
|
331 |
-
'input_attr' => $value['meta'] + array(
|
332 |
-
'type' => $value['type'],
|
333 |
-
'value' => $options[ $value['attr'] ],
|
334 |
-
'id' => "arve_options_main[{$value['attr']}]",
|
335 |
-
'name' => "arve_options_main[{$value['attr']}]",
|
336 |
-
),
|
337 |
-
'description' => ! empty( $value['description'] ) ? $value['description'] : null,
|
338 |
-
'option_values' => $value,
|
339 |
-
)
|
340 |
-
);
|
341 |
-
}
|
342 |
-
|
343 |
-
add_settings_field(
|
344 |
-
'arve_options_main[reset]',
|
345 |
-
null,
|
346 |
-
'arve_submit_reset',
|
347 |
-
ARVE_SLUG,
|
348 |
-
'main_section',
|
349 |
-
array(
|
350 |
-
'reset_name' => 'arve_options_main[reset]',
|
351 |
-
)
|
352 |
-
);
|
353 |
-
|
354 |
-
// Params
|
355 |
-
$params_title = __( 'URL Parameters', ARVE_SLUG );
|
356 |
-
add_settings_section(
|
357 |
-
'params_section',
|
358 |
-
sprintf( '<span class="arve-settings-section" id="arve-settings-section-params" title="%s"></span>%s', esc_attr( $params_title ), esc_html( $params_title ) ),
|
359 |
-
'arve_params_section_description',
|
360 |
-
ARVE_SLUG
|
361 |
-
);
|
362 |
-
|
363 |
-
// Options
|
364 |
-
foreach ( $options['params'] as $provider => $params ) {
|
365 |
-
|
366 |
-
add_settings_field(
|
367 |
-
"arve_options_params[$provider]",
|
368 |
-
ucfirst( $provider ),
|
369 |
-
'arve_input',
|
370 |
-
ARVE_SLUG,
|
371 |
-
'params_section',
|
372 |
-
array(
|
373 |
-
'label_for' => "arve_options_params[$provider]",
|
374 |
-
'input_attr' => array(
|
375 |
-
'type' => 'text',
|
376 |
-
'value' => $params,
|
377 |
-
'id' => "arve_options_params[$provider]",
|
378 |
-
'name' => "arve_options_params[$provider]",
|
379 |
-
'class' => 'large-text'
|
380 |
-
),
|
381 |
-
)
|
382 |
-
);
|
383 |
-
}
|
384 |
-
|
385 |
-
add_settings_field(
|
386 |
-
'arve_options_params[reset]',
|
387 |
-
null,
|
388 |
-
'arve_submit_reset',
|
389 |
-
ARVE_SLUG,
|
390 |
-
'params_section',
|
391 |
-
array(
|
392 |
-
'reset_name' => 'arve_options_params[reset]',
|
393 |
-
)
|
394 |
-
);
|
395 |
-
|
396 |
-
// Shortcode Tags
|
397 |
-
$shortcodes_title = __( 'Shortcode Tags', ARVE_SLUG );
|
398 |
-
|
399 |
-
add_settings_section(
|
400 |
-
'shortcodes_section',
|
401 |
-
sprintf( '<span class="arve-settings-section" id="arve-settings-section-shortcodes" title="%s"></span>%s', esc_attr( $shortcodes_title ), esc_html( $shortcodes_title ) ),
|
402 |
-
'arve_shortcodes_section_description',
|
403 |
-
ARVE_SLUG
|
404 |
-
);
|
405 |
-
|
406 |
-
foreach ( $options['shortcodes'] as $provider => $shortcode ) {
|
407 |
-
|
408 |
-
add_settings_field(
|
409 |
-
"arve_options_shortcodes[$provider]",
|
410 |
-
ucfirst( $provider ),
|
411 |
-
'arve_input',
|
412 |
-
ARVE_SLUG,
|
413 |
-
'shortcodes_section',
|
414 |
-
array(
|
415 |
-
'label_for' => "arve_options_shortcodes[$provider]",
|
416 |
-
'input_attr' => array(
|
417 |
-
'type' => 'text',
|
418 |
-
'value' => $shortcode,
|
419 |
-
'id' => "arve_options_shortcodes[$provider]",
|
420 |
-
'name' => "arve_options_shortcodes[$provider]",
|
421 |
-
'class' => 'medium-text'
|
422 |
-
),
|
423 |
-
)
|
424 |
-
);
|
425 |
-
}
|
426 |
-
|
427 |
-
add_settings_field(
|
428 |
-
'arve_options_shortcodes[reset]',
|
429 |
-
null,
|
430 |
-
'arve_submit_reset',
|
431 |
-
ARVE_SLUG,
|
432 |
-
'shortcodes_section',
|
433 |
-
array(
|
434 |
-
'reset_name' => 'arve_options_shortcodes[reset]',
|
435 |
-
)
|
436 |
-
);
|
437 |
-
|
438 |
-
register_setting( 'arve-settings-group', 'arve_options_main', 'arve_validate_options_main' );
|
439 |
-
register_setting( 'arve-settings-group', 'arve_options_params', 'arve_validate_options_params' );
|
440 |
-
register_setting( 'arve-settings-group', 'arve_options_shortcodes', 'arve_validate_options_shortcodes' );
|
441 |
-
}
|
442 |
-
|
443 |
-
/**
|
444 |
-
*
|
445 |
-
*
|
446 |
-
* @since 6.0.6
|
447 |
-
*/
|
448 |
-
function arve_register_settings_debug() {
|
449 |
-
|
450 |
-
// Debug Information
|
451 |
-
$debug_title = __( 'Debug Info', ARVE_SLUG );
|
452 |
-
|
453 |
-
add_settings_section(
|
454 |
-
'debug_section',
|
455 |
-
sprintf( '<span class="arve-settings-section" id="arve-settings-section-debug" title="%s"></span>%s', esc_attr( $debug_title ), esc_html( $debug_title ) ),
|
456 |
-
'arve_debug_section_description',
|
457 |
-
ARVE_SLUG
|
458 |
-
);
|
459 |
-
}
|
460 |
-
|
461 |
-
function arve_submit_reset( $args ) {
|
462 |
-
|
463 |
-
submit_button( __( 'Save Changes', ARVE_SLUG ), 'primary', 'submit', false );
|
464 |
-
echo ' ';
|
465 |
-
submit_button( __( 'Reset This Settings Section', ARVE_SLUG ), 'secondary', $args['reset_name'], false );
|
466 |
-
}
|
467 |
-
|
468 |
-
function arve_shortcodes_section_description() {
|
469 |
-
$desc = __( 'This shortcodes exist for backwards compatiblity only. It is not recommended to use them at all, please use the <code>[arve]</code> shortcode. You can change the old shortcode tags here. You may need this to prevent conflicts with other plugins you want to use.', ARVE_SLUG );
|
470 |
-
echo "<p>$desc</p>";
|
471 |
-
}
|
472 |
-
|
473 |
-
function arve_params_section_description() {
|
474 |
-
|
475 |
-
$desc = sprintf(
|
476 |
-
__(
|
477 |
-
'This parameters will be added to the <code>iframe src</code> urls, you can control the video players behavior with them. Please read <a href="%s" target="_blank">the documentation</a> on.',
|
478 |
-
ARVE_SLUG
|
479 |
-
),
|
480 |
-
esc_url( 'https://nextgenthemes.com/arve/documentation' )
|
481 |
-
);
|
482 |
-
|
483 |
-
echo "<p>$desc</p>";
|
484 |
-
|
485 |
-
?>
|
486 |
-
<p>
|
487 |
-
See
|
488 |
-
<a target="_blank" href="https://developers.google.com/youtube/player_parameters">Youtube Parameters</a>,
|
489 |
-
<a target="_blank" href="http://www.dailymotion.com/doc/api/player.html#parameters">Dailymotion Parameters</a>,
|
490 |
-
<a target="_blank" href="https://developer.vimeo.com/player/embedding">Vimeo Parameters</a>,
|
491 |
-
<a target="_blank" href="https://nextgenthemes.com/arve-pro/documentation">Vimeo Parameters</a>,
|
492 |
-
</p>
|
493 |
-
<?php
|
494 |
-
}
|
495 |
-
|
496 |
-
function arve_get_plugin_version_and_status( $folder_and_filename ) {
|
497 |
-
|
498 |
-
$file = WP_PLUGIN_DIR . '/' . $folder_and_filename;
|
499 |
-
|
500 |
-
if ( ! is_file( $file ) ) {
|
501 |
-
return 'NOT INSTALLED';
|
502 |
-
}
|
503 |
-
|
504 |
-
$data = get_plugin_data( $file );
|
505 |
-
$out = $data['Version'];
|
506 |
-
|
507 |
-
if ( ! is_plugin_active( $folder_and_filename ) ) {
|
508 |
-
$out .= ' INACTIVE';
|
509 |
-
}
|
510 |
-
|
511 |
-
return $out;
|
512 |
-
}
|
513 |
-
|
514 |
-
|
515 |
-
function arve_debug_section_description() {
|
516 |
-
|
517 |
-
global $wp_version;
|
518 |
-
|
519 |
-
$arve_version = arve_get_plugin_version_and_status( 'advanced-responsive-video-embedder/advanced-responsive-video-embedder.php' );
|
520 |
-
$arve_pro_version = arve_get_plugin_version_and_status( 'arve-pro/arve-pro.php' );
|
521 |
-
|
522 |
-
if ( ! is_plugin_active( 'arve-pro/arve-pro.php' ) ) {
|
523 |
-
$pro_options_dump = '';
|
524 |
-
} else {
|
525 |
-
$pro_options = get_option( 'arve_options_pro' );
|
526 |
-
unset( $pro_options['key'] );
|
527 |
-
ob_start();
|
528 |
-
var_dump( $pro_options ); // phpcs:ignore
|
529 |
-
$pro_options_dump = ob_get_clean();
|
530 |
-
}
|
531 |
-
|
532 |
-
include_once plugin_dir_path( __FILE__ ) . 'html-debug-info.php';
|
533 |
-
}
|
534 |
-
|
535 |
-
/**
|
536 |
-
*
|
537 |
-
*
|
538 |
-
* @since 2.6.0
|
539 |
-
*/
|
540 |
-
function arve_validate_options_main( $input ) {
|
541 |
-
|
542 |
-
// Storing the Options Section as a empty array will cause the plugin to use defaults
|
543 |
-
if ( isset( $input['reset'] ) ) {
|
544 |
-
return array();
|
545 |
-
}
|
546 |
-
|
547 |
-
$output['align'] = sanitize_text_field( $input['align'] );
|
548 |
-
$output['mode'] = sanitize_text_field( $input['mode'] );
|
549 |
-
$output['last_settings_tab'] = sanitize_text_field( $input['last_settings_tab'] );
|
550 |
-
$output['controlslist'] = sanitize_text_field( $input['controlslist'] );
|
551 |
-
$output['vimeo_api_token'] = sanitize_text_field( $input['vimeo_api_token'] );
|
552 |
-
|
553 |
-
$output['always_enqueue_assets'] = ( 'yes' === $input['always_enqueue_assets'] ) ? true : false;
|
554 |
-
$output['autoplay'] = ( 'yes' === $input['autoplay'] ) ? true : false;
|
555 |
-
$output['promote_link'] = ( 'yes' === $input['promote_link'] ) ? true : false;
|
556 |
-
$output['wp_video_override'] = ( 'yes' === $input['wp_video_override'] ) ? true : false;
|
557 |
-
$output['youtube_nocookie'] = ( 'yes' === $input['youtube_nocookie'] ) ? true : false;
|
558 |
-
|
559 |
-
$output['wp_image_cache_time'] = (int) $input['wp_image_cache_time'];
|
560 |
-
|
561 |
-
if ( (int) $input['video_maxwidth'] > 100 ) {
|
562 |
-
$output['video_maxwidth'] = (int) $input['video_maxwidth'];
|
563 |
-
} else {
|
564 |
-
$output['video_maxwidth'] = '';
|
565 |
-
}
|
566 |
-
|
567 |
-
if ( (int) $input['align_maxwidth'] > 100 ) {
|
568 |
-
$output['align_maxwidth'] = (int) $input['align_maxwidth'];
|
569 |
-
}
|
570 |
-
|
571 |
-
$options_defaults = arve_get_options_defaults( 'main' );
|
572 |
-
// Store only the options in the database that are different from the defaults.
|
573 |
-
return array_diff_assoc( $output, $options_defaults );
|
574 |
-
}
|
575 |
-
|
576 |
-
function arve_validate_options_params( $input ) {
|
577 |
-
|
578 |
-
// Storing the Options Section as a empty array will cause the plugin to use defaults
|
579 |
-
if ( isset( $input['reset'] ) ) {
|
580 |
-
return array();
|
581 |
-
}
|
582 |
-
|
583 |
-
$output = array();
|
584 |
-
|
585 |
-
foreach ( $input as $key => $var ) {
|
586 |
-
$output[ $key ] = preg_replace( '!\s+!', '&', trim( $var ) );
|
587 |
-
$output[ $key ] = preg_replace( '!\s+!', '&', trim( $var ) );
|
588 |
-
}
|
589 |
-
|
590 |
-
$options_defaults = arve_get_options_defaults( 'params' );
|
591 |
-
//* Store only the options in the database that are different from the defaults.
|
592 |
-
return array_diff_assoc( $output, $options_defaults );
|
593 |
-
}
|
594 |
-
|
595 |
-
function arve_validate_options_shortcodes( $input ) {
|
596 |
-
|
597 |
-
$output = array();
|
598 |
-
|
599 |
-
//* Storing the Options Section as a empty array will cause the plugin to use defaults
|
600 |
-
if ( isset( $input['reset'] ) ) {
|
601 |
-
return array();
|
602 |
-
}
|
603 |
-
|
604 |
-
foreach ( $input as $key => $var ) {
|
605 |
-
|
606 |
-
$var = preg_replace( '/[_]+/', '_', $var ); // remove multiple underscores
|
607 |
-
$var = preg_replace( '/[^A-Za-z0-9_]/', '', $var ); // strip away everything except a-z,0-9 and underscores
|
608 |
-
|
609 |
-
if ( strlen( $var ) < 3 ) {
|
610 |
-
continue;
|
611 |
-
}
|
612 |
-
|
613 |
-
$output[ $key ] = $var;
|
614 |
-
}
|
615 |
-
|
616 |
-
$options_defaults = arve_get_options_defaults( 'shortcodes' );
|
617 |
-
//* Store only the options in the database that are different from the defaults.
|
618 |
-
return array_diff_assoc( $output, $options_defaults );
|
619 |
-
}
|
620 |
-
|
621 |
-
|
622 |
-
function arve_admin_enqueue_styles() {
|
623 |
-
wp_enqueue_style( ARVE_SLUG, ARVE_ADMIN_URL . 'arve-admin.css', array(), ARVE_VERSION, 'all' );
|
624 |
-
}
|
625 |
-
|
626 |
-
function arve_mce_css( $mce_css ) {
|
627 |
-
|
628 |
-
$min = arve_get_min_suffix();
|
629 |
-
|
630 |
-
if ( ! empty( $mce_css ) ) {
|
631 |
-
$mce_css .= ',';
|
632 |
-
}
|
633 |
-
$mce_css .= ARVE_PUBLIC_URL . "arve{$min}.css";
|
634 |
-
|
635 |
-
return $mce_css;
|
636 |
-
}
|
637 |
-
|
638 |
-
/**
|
639 |
-
* Register the JavaScript for the dashboard.
|
640 |
-
*
|
641 |
-
* @since 1.0.0
|
642 |
-
*/
|
643 |
-
function arve_admin_enqueue_scripts() {
|
644 |
-
|
645 |
-
wp_enqueue_script( ARVE_SLUG, ARVE_ADMIN_URL . 'arve-admin.js', array( 'jquery' ), ARVE_VERSION, true );
|
646 |
-
|
647 |
-
if ( is_plugin_active( 'shortcode-ui/shortcode-ui.php' ) ) {
|
648 |
-
wp_enqueue_script( ARVE_SLUG . '-sc-ui', ARVE_ADMIN_URL . 'arve-shortcode-ui.js', array( 'shortcode-ui' ), ARVE_VERSION, true );
|
649 |
-
}
|
650 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/functions-licensing.php
DELETED
@@ -1,621 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
add_action( 'admin_init', 'nextgenthemes_init_edd_updaters', 0 );
|
3 |
-
add_action( 'admin_init', 'nextgenthemes_activation_notices' );
|
4 |
-
add_action( 'admin_init', 'nextgenthemes_register_settings' );
|
5 |
-
add_action( 'admin_menu', 'nextgenthemes_menus' );
|
6 |
-
|
7 |
-
function nextgenthemes_admin_install_search_url( $search_term ) {
|
8 |
-
|
9 |
-
$path = "plugin-install.php?s={$search_term}&tab=search&type=term";
|
10 |
-
|
11 |
-
if ( is_multisite() ) {
|
12 |
-
return network_admin_url( $path );
|
13 |
-
} else {
|
14 |
-
return admin_url( $path );
|
15 |
-
}
|
16 |
-
}
|
17 |
-
|
18 |
-
function nextgenthemes_ads_page() { ?>
|
19 |
-
<style>
|
20 |
-
body {
|
21 |
-
background: hsl(210, 13%, 16%);
|
22 |
-
}
|
23 |
-
#wpcontent {
|
24 |
-
padding: 0;
|
25 |
-
}
|
26 |
-
#wpbody-content {
|
27 |
-
/* padding-bottom: 2rem; */
|
28 |
-
}
|
29 |
-
#wpfooter {
|
30 |
-
display: none;
|
31 |
-
}
|
32 |
-
#nextgenthemes-ads {
|
33 |
-
padding: 1.7rem;
|
34 |
-
column-width: 40rem;
|
35 |
-
column-gap: 1.7rem;
|
36 |
-
}
|
37 |
-
@media only screen and (max-device-width: 400px) {
|
38 |
-
|
39 |
-
#nextgenthemes-ads {
|
40 |
-
padding-left: 0;
|
41 |
-
padding-right: 0;
|
42 |
-
}
|
43 |
-
}
|
44 |
-
#nextgenthemes-ads,
|
45 |
-
#nextgenthemes-ads * {
|
46 |
-
box-sizing: border-box;
|
47 |
-
}
|
48 |
-
#nextgenthemes-ads::after {
|
49 |
-
content: "";
|
50 |
-
display: table;
|
51 |
-
clear: both;
|
52 |
-
}
|
53 |
-
#nextgenthemes-ads {
|
54 |
-
color: white;
|
55 |
-
}
|
56 |
-
#nextgenthemes-ads h1,
|
57 |
-
#nextgenthemes-ads h2,
|
58 |
-
#nextgenthemes-ads h3 {
|
59 |
-
color: inherit;
|
60 |
-
margin-left: 2rem;
|
61 |
-
margin-right: 1.7rem;
|
62 |
-
}
|
63 |
-
#nextgenthemes-ads h1 {
|
64 |
-
line-height: 1;
|
65 |
-
}
|
66 |
-
#nextgenthemes-ads img {
|
67 |
-
width: 100%;
|
68 |
-
height: auto;
|
69 |
-
}
|
70 |
-
#nextgenthemes-ads > a {
|
71 |
-
text-decoration: none;
|
72 |
-
position: relative;
|
73 |
-
display: inline-block;
|
74 |
-
width: 100%;
|
75 |
-
background-color: hsl(210, 13%, 13%);
|
76 |
-
border: 1px solid hsl(207, 48%, 30%);
|
77 |
-
transition: box-shadow .3s, background-color .3s, border-color .3s;
|
78 |
-
color: #eee;
|
79 |
-
font-size: 1.05rem;
|
80 |
-
margin-bottom: 2rem;
|
81 |
-
line-height: 1.4;
|
82 |
-
}
|
83 |
-
#nextgenthemes-ads > a:hover {
|
84 |
-
background-color: hsl(210, 13%, 10%);
|
85 |
-
box-shadow: 0 0 10px hsla(207, 48%, 50%, 1);
|
86 |
-
border-color: hsl(207, 48%, 40%);
|
87 |
-
}
|
88 |
-
#nextgenthemes-ads p {
|
89 |
-
margin-left: 2rem;
|
90 |
-
margin-right: 1.7rem;
|
91 |
-
font-size: 1.2rem;
|
92 |
-
}
|
93 |
-
#nextgenthemes-ads ul {
|
94 |
-
list-style: square;
|
95 |
-
margin-left: 2.5rem;
|
96 |
-
margin-right: .7rem;
|
97 |
-
}
|
98 |
-
#nextgenthemes-ads > a > span {
|
99 |
-
position: absolute;
|
100 |
-
padding: .6rem 1rem;
|
101 |
-
right: 0px;
|
102 |
-
bottom: 0px;
|
103 |
-
font-size: 2rem;
|
104 |
-
color: white;
|
105 |
-
background-color: hsl(207, 48%, 30%);
|
106 |
-
border-top-left-radius: 3px;
|
107 |
-
//transform: rotate(3deg);
|
108 |
-
}
|
109 |
-
#nextgenthemes-ads figure {
|
110 |
-
margin: 1rem;
|
111 |
-
}
|
112 |
-
</style>
|
113 |
-
|
114 |
-
<?php
|
115 |
-
$img_dir = plugin_dir_url( __FILE__ ) . 'product-images/';
|
116 |
-
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
117 |
-
?>
|
118 |
-
|
119 |
-
<div id="nextgenthemes-ads">
|
120 |
-
|
121 |
-
<?php if ( ! defined( 'ARVE_PRO_VERSION' ) ) : ?>
|
122 |
-
<a href="https://nextgenthemes.com/plugins/arve-pro/">
|
123 |
-
<figure><img src="<?php echo $img_dir; ?>arve.svg" alt"ARVE"></figure>
|
124 |
-
<?php nextgenthemes_feature_list_html( ARVE_PATH . 'readme/html/20-description-features-pro.html' ); ?>
|
125 |
-
<span>Paid</span>
|
126 |
-
</a>
|
127 |
-
<?php endif; ?>
|
128 |
-
|
129 |
-
<?php if ( ! defined( 'ARVE_AMP_VERSION' ) ) : ?>
|
130 |
-
<a href="https://nextgenthemes.com/plugins/arve-accelerated-mobile-pages-addon/">
|
131 |
-
<figure><img src="<?php echo $img_dir; ?>arve.svg" alt"ARVE"></figure>
|
132 |
-
<?php nextgenthemes_feature_list_html( ARVE_PATH . 'readme/html/25-description-features-amp.html' ); ?>
|
133 |
-
<span>Paid</span>
|
134 |
-
</a>
|
135 |
-
<?php endif; ?>
|
136 |
-
|
137 |
-
<?php if ( ! is_plugin_active( 'regenerate-thumbnails-reminder/regenerate-thumbnails-reminder.php' ) ) : ?>
|
138 |
-
<a href="<?php echo nextgenthemes_admin_install_search_url( 'Regenerate+Thumbnails+Reminder' ); ?>">
|
139 |
-
<h1>Regenerate Thumbnails Reminder</h1>
|
140 |
-
<p>Get a reminder when you change your thumbnail sizes to regenerate them. Note Thumbnails sizes change automatically if you swtich themes.</p>
|
141 |
-
<span>Free</span>
|
142 |
-
</a>
|
143 |
-
<?php endif; ?>
|
144 |
-
|
145 |
-
</div>
|
146 |
-
|
147 |
-
<?php
|
148 |
-
}
|
149 |
-
|
150 |
-
function nextgenthemes_feature_list_html( $filepath ) {
|
151 |
-
echo strip_tags( file_get_contents( $filepath ), '<ul></ul><li></li><h3></h3>' );
|
152 |
-
}
|
153 |
-
|
154 |
-
function nextgenthemes_activation_notices() {
|
155 |
-
|
156 |
-
$products = nextgenthemes_get_products();
|
157 |
-
|
158 |
-
foreach ( $products as $key => $value ) {
|
159 |
-
|
160 |
-
if ( $value['active'] && ! $value['valid_key'] ) {
|
161 |
-
|
162 |
-
$msg = sprintf(
|
163 |
-
__( 'Hi there, thanks for your purchase. One last step, please activate your %1$s <a href="%2$s">here now</a>.', ARVE_SLUG ),
|
164 |
-
$value['name'],
|
165 |
-
get_admin_url() . 'admin.php?page=nextgenthemes-licenses'
|
166 |
-
);
|
167 |
-
new ARVE_Admin_Notice_Factory( $key . '-activation-notice', "<p>$msg</p>", false );
|
168 |
-
}
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
function nextgenthemes_get_products() {
|
173 |
-
|
174 |
-
$products = array(
|
175 |
-
'arve_pro' => array(
|
176 |
-
'name' => 'ARVE Pro',
|
177 |
-
'id' => 1253,
|
178 |
-
'type' => 'plugin',
|
179 |
-
'author' => 'Nicolas Jonas',
|
180 |
-
'url' => 'https://nextgenthemes.com/plugins/arve-pro/',
|
181 |
-
),
|
182 |
-
'arve_amp' => array(
|
183 |
-
'name' => 'ARVE AMP',
|
184 |
-
'id' => 16941,
|
185 |
-
'type' => 'plugin',
|
186 |
-
'author' => 'Nicolas Jonas',
|
187 |
-
'url' => 'https://nextgenthemes.com/plugins/arve-amp/',
|
188 |
-
),
|
189 |
-
'arve_random_video' => array(
|
190 |
-
'name' => 'ARVE Random Video',
|
191 |
-
'id' => 31933,
|
192 |
-
'type' => 'plugin',
|
193 |
-
'author' => 'Nicolas Jonas',
|
194 |
-
'url' => 'https://nextgenthemes.com/plugins/arve-random-video/',
|
195 |
-
)
|
196 |
-
);
|
197 |
-
|
198 |
-
$products = apply_filters( 'nextgenthemes_products', $products );
|
199 |
-
|
200 |
-
foreach ( $products as $key => $value ) {
|
201 |
-
|
202 |
-
$products[ $key ]['slug'] = $key;
|
203 |
-
$products[ $key ]['installed'] = false;
|
204 |
-
$products[ $key ]['active'] = false;
|
205 |
-
$products[ $key ]['valid_key'] = nextgenthemes_has_valid_key( $key );
|
206 |
-
|
207 |
-
$version_define = strtoupper( $key ) . '_VERSION';
|
208 |
-
$file_define = strtoupper( $key ) . '_FILE';
|
209 |
-
|
210 |
-
if ( defined( $version_define ) ) {
|
211 |
-
$products[ $key ]['version'] = constant( $version_define );
|
212 |
-
}
|
213 |
-
if ( defined( $file_define ) ) {
|
214 |
-
$products[ $key ]['file'] = constant( $file_define );
|
215 |
-
}
|
216 |
-
|
217 |
-
$version_define = "\\nextgenthemes\\$key\\VERSION";
|
218 |
-
$file_define = "\\nextgenthemes\\$key\\FILE";
|
219 |
-
|
220 |
-
if ( defined( $version_define ) ) {
|
221 |
-
$products[ $key ]['version'] = constant( $version_define );
|
222 |
-
}
|
223 |
-
if ( defined( $file_define ) ) {
|
224 |
-
$products[ $key ]['file'] = constant( $file_define );
|
225 |
-
}
|
226 |
-
|
227 |
-
if ( 'plugin' === $value['type'] ) {
|
228 |
-
|
229 |
-
$file_slug = str_replace( '_', '-', $key );
|
230 |
-
|
231 |
-
$products[ $key ]['installed'] = nextgenthemes_is_plugin_installed( "$file_slug/$file_slug.php" );
|
232 |
-
$products[ $key ]['active'] = is_plugin_active( "$file_slug/$file_slug.php" );
|
233 |
-
}
|
234 |
-
}
|
235 |
-
|
236 |
-
return $products;
|
237 |
-
}
|
238 |
-
|
239 |
-
function nextgenthemes_is_plugin_installed( $plugin_basename ) {
|
240 |
-
|
241 |
-
$plugins = get_plugins();
|
242 |
-
|
243 |
-
if ( array_key_exists( $plugin_basename, $plugins ) ) {
|
244 |
-
return true;
|
245 |
-
} else {
|
246 |
-
return false;
|
247 |
-
}
|
248 |
-
}
|
249 |
-
|
250 |
-
/**
|
251 |
-
* Register the administration menu for this plugin into the WordPress Dashboard menu.
|
252 |
-
*
|
253 |
-
* @since 1.0.0
|
254 |
-
*/
|
255 |
-
function nextgenthemes_menus() {
|
256 |
-
|
257 |
-
$plugin_screen_hook_suffix = add_options_page(
|
258 |
-
__( 'ARVE Licenses', ARVE_SLUG ),
|
259 |
-
__( 'ARVE Licenses', ARVE_SLUG ),
|
260 |
-
'manage_options',
|
261 |
-
'nextgenthemes-licenses',
|
262 |
-
'nextgenthemes_licenses_page'
|
263 |
-
);
|
264 |
-
}
|
265 |
-
|
266 |
-
function nextgenthemes_register_settings() {
|
267 |
-
|
268 |
-
add_settings_section(
|
269 |
-
'keys', # id,
|
270 |
-
__( 'Licenses', ARVE_SLUG ), # title,
|
271 |
-
'__return_empty_string', # callback,
|
272 |
-
'nextgenthemes-licenses' # page
|
273 |
-
);
|
274 |
-
|
275 |
-
foreach ( nextgenthemes_get_products() as $product_slug => $product ) :
|
276 |
-
|
277 |
-
$option_basename = "nextgenthemes_{$product_slug}_key";
|
278 |
-
$option_keyname = $option_basename . '[key]';
|
279 |
-
|
280 |
-
add_settings_field(
|
281 |
-
$option_keyname, # id,
|
282 |
-
$product['name'], # title,
|
283 |
-
'nextgenthemes_key_callback', # callback,
|
284 |
-
'nextgenthemes-licenses', # page,
|
285 |
-
'keys', # section
|
286 |
-
array( # args
|
287 |
-
'product' => $product,
|
288 |
-
'label_for' => $option_keyname,
|
289 |
-
'option_basename' => $option_basename,
|
290 |
-
'attr' => array(
|
291 |
-
'type' => 'text',
|
292 |
-
'id' => $option_keyname,
|
293 |
-
'name' => $option_keyname,
|
294 |
-
'class' => 'arve-license-input',
|
295 |
-
'value' => nextgenthemes_get_defined_key( $product_slug ) ? __( 'is defined (wp-config.php?)', ARVE_SLUG ) : nextgenthemes_get_key( $product_slug, 'option_only' ),
|
296 |
-
)
|
297 |
-
)
|
298 |
-
);
|
299 |
-
|
300 |
-
register_setting(
|
301 |
-
'nextgenthemes', # option_group
|
302 |
-
$option_basename, # option_name
|
303 |
-
'nextgenthemes_validate_license' # validation callback
|
304 |
-
);
|
305 |
-
|
306 |
-
endforeach;
|
307 |
-
}
|
308 |
-
|
309 |
-
function nextgenthemes_key_callback( $args ) {
|
310 |
-
|
311 |
-
echo '<p>';
|
312 |
-
|
313 |
-
printf(
|
314 |
-
'<input%s>',
|
315 |
-
arve_attr(
|
316 |
-
array(
|
317 |
-
'type' => 'hidden',
|
318 |
-
'id' => $args['option_basename'] . '[product]',
|
319 |
-
'name' => $args['option_basename'] . '[product]',
|
320 |
-
'value' => $args['product']['slug'],
|
321 |
-
)
|
322 |
-
)
|
323 |
-
);
|
324 |
-
|
325 |
-
printf(
|
326 |
-
'<input%s%s>',
|
327 |
-
arve_attr( $args['attr'] ),
|
328 |
-
nextgenthemes_get_defined_key( $args['product']['slug'] ) ? ' disabled' : ''
|
329 |
-
);
|
330 |
-
|
331 |
-
$defined_key = nextgenthemes_get_defined_key( $args['product']['slug'] );
|
332 |
-
$key = nextgenthemes_get_key( $args['product']['slug'] );
|
333 |
-
|
334 |
-
if ( $defined_key || ! empty( $key ) ) {
|
335 |
-
|
336 |
-
submit_button( __( 'Activate License', ARVE_SLUG ), 'primary', $args['option_basename'] . '[activate_key]', false );
|
337 |
-
submit_button( __( 'Deactivate License', ARVE_SLUG ), 'secondary', $args['option_basename'] . '[deactivate_key]', false );
|
338 |
-
submit_button( __( 'Check License', ARVE_SLUG ), 'secondary', $args['option_basename'] . '[check_key]', false );
|
339 |
-
}
|
340 |
-
echo '</p>';
|
341 |
-
|
342 |
-
echo '<p>';
|
343 |
-
echo __( 'License Status: ', ARVE_SLUG ) . nextgenthemes_get_key_status( $args['product']['slug'] );
|
344 |
-
echo '</p>';
|
345 |
-
|
346 |
-
if ( $args['product']['installed'] && ! $args['product']['active'] ) {
|
347 |
-
printf( '<strong>%s</strong>', __( 'Plugin is installed but not activated', ARVE_SLUG ) );
|
348 |
-
} elseif ( ! $args['product']['active'] ) {
|
349 |
-
printf(
|
350 |
-
'<a%s>%s</a>',
|
351 |
-
arve_attr(
|
352 |
-
array(
|
353 |
-
'href' => $args['product']['url'],
|
354 |
-
'class' => 'button button-primary',
|
355 |
-
)
|
356 |
-
),
|
357 |
-
__( 'Not installed, check it out', ARVE_SLUG )
|
358 |
-
);
|
359 |
-
}
|
360 |
-
}
|
361 |
-
|
362 |
-
function nextgenthemes_validate_license( $input ) {
|
363 |
-
|
364 |
-
if ( ! is_array( $input ) ) {
|
365 |
-
return sanitize_text_field( $input );
|
366 |
-
}
|
367 |
-
|
368 |
-
$product = $input['product'];
|
369 |
-
$defined_key = nextgenthemes_get_defined_key( $product );
|
370 |
-
|
371 |
-
if ( $defined_key ) {
|
372 |
-
$option_key = $defined_key;
|
373 |
-
$key = $defined_key;
|
374 |
-
} else {
|
375 |
-
$key = sanitize_text_field( $input['key'] );
|
376 |
-
$option_key = nextgenthemes_get_key( $product );
|
377 |
-
}
|
378 |
-
|
379 |
-
if ( ( $key !== $option_key ) || isset( $input['activate_key'] ) ) {
|
380 |
-
|
381 |
-
nextgenthemes_api_update_key_status( $product, $key, 'activate' );
|
382 |
-
|
383 |
-
} elseif ( isset( $input['deactivate_key'] ) ) {
|
384 |
-
|
385 |
-
nextgenthemes_api_update_key_status( $product, $key, 'deactivate' );
|
386 |
-
|
387 |
-
} elseif ( isset( $input['check_key'] ) ) {
|
388 |
-
|
389 |
-
nextgenthemes_api_update_key_status( $product, $key, 'check' );
|
390 |
-
}
|
391 |
-
|
392 |
-
return $key;
|
393 |
-
}
|
394 |
-
|
395 |
-
function nextgenthemes_get_key( $product, $option_only = false ) {
|
396 |
-
|
397 |
-
$defined_key = nextgenthemes_get_defined_key( $product );
|
398 |
-
|
399 |
-
if ( ! $option_only && $defined_key ) {
|
400 |
-
return $defined_key;
|
401 |
-
}
|
402 |
-
|
403 |
-
return get_option( "nextgenthemes_{$product}_key" );
|
404 |
-
}
|
405 |
-
function nextgenthemes_get_key_status( $product ) {
|
406 |
-
return get_option( "nextgenthemes_{$product}_key_status" );
|
407 |
-
}
|
408 |
-
function nextgenthemes_update_key_status( $product, $key ) {
|
409 |
-
update_option( "nextgenthemes_{$product}_key_status", $key );
|
410 |
-
}
|
411 |
-
function nextgenthemes_has_valid_key( $product ) {
|
412 |
-
return ( 'valid' === nextgenthemes_get_key_status( $product ) ) ? true : false;
|
413 |
-
}
|
414 |
-
|
415 |
-
function nextgenthemes_api_update_key_status( $product, $key, $action ) {
|
416 |
-
|
417 |
-
$products = nextgenthemes_get_products();
|
418 |
-
$key_status = nextgenthemes_api_action( $products[ $product ]['id'], $key, $action );
|
419 |
-
|
420 |
-
nextgenthemes_update_key_status( $product, $key_status );
|
421 |
-
}
|
422 |
-
|
423 |
-
function nextgenthemes_get_defined_key( $slug ) {
|
424 |
-
|
425 |
-
$constant_name = str_replace( '-', '_', strtoupper( $slug . '_KEY' ) );
|
426 |
-
|
427 |
-
if ( defined( $constant_name ) && constant( $constant_name ) ) {
|
428 |
-
return constant( $constant_name );
|
429 |
-
} else {
|
430 |
-
return false;
|
431 |
-
}
|
432 |
-
}
|
433 |
-
|
434 |
-
function nextgenthemes_licenses_page() {
|
435 |
-
?>
|
436 |
-
<div class="wrap">
|
437 |
-
|
438 |
-
<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
|
439 |
-
|
440 |
-
<form method="post" action="options.php">
|
441 |
-
|
442 |
-
<?php do_settings_sections( 'nextgenthemes-licenses' ); ?>
|
443 |
-
<?php settings_fields( 'nextgenthemes' ); ?>
|
444 |
-
<?php submit_button( __( 'Save Changes' ), 'primary', 'submit', false ); ?>
|
445 |
-
</form>
|
446 |
-
|
447 |
-
</div>
|
448 |
-
<?php
|
449 |
-
}
|
450 |
-
|
451 |
-
function nextgenthemes_init_edd_updaters() {
|
452 |
-
|
453 |
-
$products = nextgenthemes_get_products();
|
454 |
-
|
455 |
-
foreach ( $products as $product ) {
|
456 |
-
|
457 |
-
if ( 'plugin' === $product['type'] && ! empty( $product['file'] ) ) {
|
458 |
-
nextgenthemes_init_plugin_updater( $product );
|
459 |
-
} elseif ( 'theme' === $product['type'] ) {
|
460 |
-
nextgenthemes_init_theme_updater( $product );
|
461 |
-
}
|
462 |
-
}
|
463 |
-
}
|
464 |
-
|
465 |
-
function nextgenthemes_init_plugin_updater( $product ) {
|
466 |
-
|
467 |
-
// setup the updater
|
468 |
-
new Nextgenthemes_Plugin_Updater(
|
469 |
-
apply_filters( 'nextgenthemes_api_url', 'https://nextgenthemes.com' ),
|
470 |
-
$product['file'],
|
471 |
-
array(
|
472 |
-
'version' => $product['version'],
|
473 |
-
'license' => nextgenthemes_get_key( $product['slug'] ),
|
474 |
-
'item_id' => $product['id'],
|
475 |
-
'author' => $product['author']
|
476 |
-
)
|
477 |
-
);
|
478 |
-
}
|
479 |
-
|
480 |
-
function nextgenthemes_init_theme_updater( $product ) {
|
481 |
-
|
482 |
-
new EDD_Theme_Updater(
|
483 |
-
array(
|
484 |
-
'remote_api_url' => 'https://nextgenthemes.com',
|
485 |
-
'version' => $product['version'],
|
486 |
-
'license' => nextgenthemes_get_key( $product['slug'] ),
|
487 |
-
'item_id' => $product['name'],
|
488 |
-
'author' => $product['id'],
|
489 |
-
'theme_slug' => $product['slug'],
|
490 |
-
'download_id' => $product['download_id'], // Optional, used for generating a license renewal link
|
491 |
-
#'renew_url' => $product['renew_link'], // Optional, allows for a custom license renewal link
|
492 |
-
),
|
493 |
-
array(
|
494 |
-
'theme-license' => __( 'Theme License', ARVE_SLUG ),
|
495 |
-
'enter-key' => __( 'Enter your theme license key.', ARVE_SLUG ),
|
496 |
-
'license-key' => __( 'License Key', ARVE_SLUG ),
|
497 |
-
'license-action' => __( 'License Action', ARVE_SLUG ),
|
498 |
-
'deactivate-license' => __( 'Deactivate License', ARVE_SLUG ),
|
499 |
-
'activate-license' => __( 'Activate License', ARVE_SLUG ),
|
500 |
-
'status-unknown' => __( 'License status is unknown.', ARVE_SLUG ),
|
501 |
-
'renew' => __( 'Renew?', ARVE_SLUG ),
|
502 |
-
'unlimited' => __( 'unlimited', ARVE_SLUG ),
|
503 |
-
'license-key-is-active' => __( 'License key is active.', ARVE_SLUG ),
|
504 |
-
'expires%s' => __( 'Expires %s.', ARVE_SLUG ),
|
505 |
-
'expires-never' => __( 'Lifetime License.', ARVE_SLUG ),
|
506 |
-
'%1$s/%2$-sites' => __( 'You have %1$s / %2$s sites activated.', ARVE_SLUG ),
|
507 |
-
'license-key-expired-%s' => __( 'License key expired %s.', ARVE_SLUG ),
|
508 |
-
'license-key-expired' => __( 'License key has expired.', ARVE_SLUG ),
|
509 |
-
'license-keys-do-not-match' => __( 'License keys do not match.', ARVE_SLUG ),
|
510 |
-
'license-is-inactive' => __( 'License is inactive.', ARVE_SLUG ),
|
511 |
-
'license-key-is-disabled' => __( 'License key is disabled.', ARVE_SLUG ),
|
512 |
-
'site-is-inactive' => __( 'Site is inactive.', ARVE_SLUG ),
|
513 |
-
'license-status-unknown' => __( 'License status is unknown.', ARVE_SLUG ),
|
514 |
-
'update-notice' => __( "Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.", ARVE_SLUG ),
|
515 |
-
'update-available' => __( '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4$s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.', ARVE_SLUG ),
|
516 |
-
)
|
517 |
-
);
|
518 |
-
}
|
519 |
-
|
520 |
-
function nextgenthemes_api_action( $item_id, $key, $action ) {
|
521 |
-
|
522 |
-
if ( ! in_array( $action, array( 'activate', 'deactivate', 'check' ), true ) ) {
|
523 |
-
wp_die( 'invalid action' );
|
524 |
-
}
|
525 |
-
|
526 |
-
// data to send in our API request
|
527 |
-
$api_params = array(
|
528 |
-
'edd_action' => $action . '_license',
|
529 |
-
'license' => sanitize_text_field( $key ),
|
530 |
-
'item_id' => $item_id,
|
531 |
-
'url' => home_url()
|
532 |
-
);
|
533 |
-
|
534 |
-
// Call the custom API.
|
535 |
-
$response = wp_remote_post(
|
536 |
-
'https://nextgenthemes.com',
|
537 |
-
array(
|
538 |
-
'timeout' => 15,
|
539 |
-
'sslverify' => true,
|
540 |
-
'body' => $api_params
|
541 |
-
)
|
542 |
-
);
|
543 |
-
|
544 |
-
// make sure the response came back okay
|
545 |
-
if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
|
546 |
-
|
547 |
-
if ( is_wp_error( $response ) ) {
|
548 |
-
$message = $response->get_error_message();
|
549 |
-
} else {
|
550 |
-
$message = __( 'An error occurred, please try again.', ARVE_SLUG );
|
551 |
-
}
|
552 |
-
} else {
|
553 |
-
|
554 |
-
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
555 |
-
|
556 |
-
if ( false === $license_data->success ) {
|
557 |
-
|
558 |
-
switch ( $license_data->error ) {
|
559 |
-
|
560 |
-
case 'expired':
|
561 |
-
$message = sprintf(
|
562 |
-
__( 'Your license key expired on %s.' ),
|
563 |
-
date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
|
564 |
-
);
|
565 |
-
break;
|
566 |
-
|
567 |
-
case 'revoked':
|
568 |
-
$message = __( 'Your license key has been disabled.', ARVE_SLUG );
|
569 |
-
break;
|
570 |
-
|
571 |
-
case 'missing':
|
572 |
-
$message = __( 'Invalid license.', ARVE_SLUG );
|
573 |
-
break;
|
574 |
-
|
575 |
-
case 'invalid':
|
576 |
-
case 'site_inactive':
|
577 |
-
$message = __( 'Your license is not active for this URL.', ARVE_SLUG );
|
578 |
-
break;
|
579 |
-
|
580 |
-
case 'item_name_mismatch':
|
581 |
-
$message = sprintf( __( 'This appears to be an invalid license key for %s.' ), ARVE_SLUG );
|
582 |
-
break;
|
583 |
-
|
584 |
-
case 'no_activations_left':
|
585 |
-
$message = __( 'Your license key has reached its activation limit.', ARVE_SLUG );
|
586 |
-
break;
|
587 |
-
|
588 |
-
default:
|
589 |
-
$message = __( 'An error occurred, please try again.', ARVE_SLUG );
|
590 |
-
break;
|
591 |
-
}
|
592 |
-
}
|
593 |
-
}
|
594 |
-
|
595 |
-
if ( empty( $message ) ) {
|
596 |
-
|
597 |
-
if ( empty( $license_data->license ) ) {
|
598 |
-
|
599 |
-
$textarea_dump = arve_textarea_dump( $response );
|
600 |
-
|
601 |
-
$message = sprintf(
|
602 |
-
__( 'Error. Please report the following:<br> %s', ARVE_SLUG ),
|
603 |
-
$textarea_dump
|
604 |
-
);
|
605 |
-
} else {
|
606 |
-
$message = $license_data->license;
|
607 |
-
}
|
608 |
-
}
|
609 |
-
|
610 |
-
return $message;
|
611 |
-
}
|
612 |
-
|
613 |
-
function arve_dump( $var ) {
|
614 |
-
ob_start();
|
615 |
-
var_dump( $var ); // phpcs:ignore
|
616 |
-
return ob_get_clean();
|
617 |
-
}
|
618 |
-
|
619 |
-
function arve_textarea_dump( $var ) {
|
620 |
-
return sprintf( '<textarea style="width: 100%; height: 70vh;">%s</textarea>', esc_textarea( arve_dump( $var ) ) );
|
621 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/html-debug-info.php
DELETED
@@ -1,60 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.PHP.DevelopmentFunctions.error_log_var_dump
|
3 |
-
?>
|
4 |
-
<textarea style="font-family: monospace; width: 100%" rows="25">
|
5 |
-
ARVE Version: <?php echo $arve_version . "\n"; ?>
|
6 |
-
ARVE-Pro Version: <?php echo $arve_pro_version . "\n"; ?>
|
7 |
-
WordPress Version: <?php echo $wp_version . "\n"; ?>
|
8 |
-
PHP Version: <?php echo phpversion() . "\n"; ?>
|
9 |
-
|
10 |
-
ACTIVE PLUGINS:
|
11 |
-
<?php
|
12 |
-
$get_plugins = get_plugins();
|
13 |
-
$active_plugins = get_option( 'active_plugins', array() );
|
14 |
-
|
15 |
-
foreach ( $get_plugins as $plugin_path => $plugin ) {
|
16 |
-
// If the plugin isn't active, don't show it.
|
17 |
-
if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
|
18 |
-
continue;
|
19 |
-
}
|
20 |
-
|
21 |
-
echo $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
|
22 |
-
}
|
23 |
-
|
24 |
-
if ( is_multisite() ) :
|
25 |
-
?>
|
26 |
-
|
27 |
-
NETWORK ACTIVE PLUGINS:
|
28 |
-
<?php
|
29 |
-
$netw_plugins = wp_get_active_network_plugins();
|
30 |
-
$active_plugins = get_site_option( 'active_sitewide_plugins', array() );
|
31 |
-
|
32 |
-
foreach ( $netw_plugins as $plugin_path ) {
|
33 |
-
$plugin_base = plugin_basename( $plugin_path );
|
34 |
-
|
35 |
-
// If the plugin isn't active, don't show it.
|
36 |
-
if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
|
37 |
-
continue;
|
38 |
-
}
|
39 |
-
|
40 |
-
$plugin = get_plugin_data( $plugin_path );
|
41 |
-
|
42 |
-
echo $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
|
43 |
-
}
|
44 |
-
|
45 |
-
endif;
|
46 |
-
?>
|
47 |
-
|
48 |
-
ARVE OPTIONS:
|
49 |
-
<?php var_dump( get_option( 'arve_options_main' ) ); ?>
|
50 |
-
<?php var_dump( get_option( 'arve_options_params' ) ); ?>
|
51 |
-
<?php var_dump( get_option( 'arve_options_shortcodes' ) ); ?>
|
52 |
-
<?php if ( is_plugin_active( 'arve-pro/arve-pro.php' ) ) : ?>
|
53 |
-
ARVE PRO OPTIONS:
|
54 |
-
<?php
|
55 |
-
$pro_options = get_option( 'arve_options_pro' );
|
56 |
-
unset( $pro_options['key'] );
|
57 |
-
var_dump( $pro_options );
|
58 |
-
?>
|
59 |
-
<?php endif; ?>
|
60 |
-
</textarea>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/html-settings-page.php
DELETED
@@ -1,78 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Represents the view for the administration dashboard.
|
4 |
-
*
|
5 |
-
* This includes the header, options, and other information that should provide
|
6 |
-
* The User Interface to the end user.
|
7 |
-
*
|
8 |
-
* @package Advanced_Responsive_Video_Embedder
|
9 |
-
* @author Nicolas Jonas
|
10 |
-
* @license GPL-3.0+
|
11 |
-
* @link http://nextgenthemes.com
|
12 |
-
* @copyright 2013 Nicolas Jonas
|
13 |
-
*/
|
14 |
-
|
15 |
-
$options = arve_get_options();
|
16 |
-
?>
|
17 |
-
|
18 |
-
<div class="wrap arve-options-wrap">
|
19 |
-
|
20 |
-
<?php if ( arve_display_pro_ad() ) : ?>
|
21 |
-
|
22 |
-
<div class="arve-settings-page-ad notice is-dismissible updated">
|
23 |
-
|
24 |
-
<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>
|
25 |
-
|
26 |
-
<div class="arve-corner-spacer"></div>
|
27 |
-
|
28 |
-
<p><a href="https://nextgenthemes.com/help-test-the-beta-version/">please help test the upcoming version</a></p>
|
29 |
-
|
30 |
-
<h3>Please rate</h3>
|
31 |
-
|
32 |
-
It would really help to get a <a href="https://wordpress.org/support/plugin/advanced-responsive-video-embedder/reviews/#new-post">5 star rating from you.</a>
|
33 |
-
|
34 |
-
<h3><a href="https://nextgenthemes.com/plugins/arve-pro/">Pro Addon</a></h3>
|
35 |
-
|
36 |
-
<strong><big>10% off</big></strong> first year with discount code <code>settingspage</code></p>
|
37 |
-
|
38 |
-
<p>This plugin is financed by purchases of the <a href="https://nextgenthemes.com/plugins/arve-pro/">Pro Addon</a>. The development and support of this plugins has become a job for me so I hope you understand that I can not make all features gratis and that you <a href="https://nextgenthemes.com/plugins/arve-pro/">purchase it</a> to get extra features and support the development.</p>
|
39 |
-
|
40 |
-
<ul>
|
41 |
-
<li><strong>Disable links in embeds (killer feature!)</strong><br>
|
42 |
-
For example: Clicking on a title in a YouTube embed will not open a new popup/tab/window. <strong>Prevent video hosts to lead your visitors away from your site!</strong> Note this also breaks sharing functionality and is not possible when the provider requires flash. Try it on <a href="https://nextgenthemes.com/plugins/arve-pro/">this page</a>. Right click on links still works.</li>
|
43 |
-
<li><strong>Lazyload mode</strong><br>
|
44 |
-
Make your site load <strong>faster</strong> by loading only a image instead of the entire video player on pageload. </li>
|
45 |
-
<li><strong>Lazyload -> Lightbox</strong><br>
|
46 |
-
Shows the Video in a Lightbox after clicking a preview image</li>
|
47 |
-
<li><strong>Link -> Lightbox</strong><br>
|
48 |
-
Use simple links as triggers for lightboxed videos</li>
|
49 |
-
<li>Automatic or custom thumbnail images</li>
|
50 |
-
<li>Automatic or custom titles on top of your thumbnails</li>
|
51 |
-
<li>'Expand on click' feature</li>
|
52 |
-
<li>3 hover styles</li>
|
53 |
-
<li>2 play icon styles to choose from</li>
|
54 |
-
<li>Responsive thumbnails using cutting edge HTML5 technology</li>
|
55 |
-
<li><strong>Feel good about yourself</strong><br>
|
56 |
-
for supporting my 5+ years work on this plugin. Tons of hours, weekends … always worked on improving it.</li>
|
57 |
-
<li>Show the latest video of a YouTube channel by using the channel URL (updated/cached hourly)</li>
|
58 |
-
<li><strong><a href="https://nextgenthemes.com/plugins/arve-pro/">Get the ARVE Pro Addon</a></strong></li>
|
59 |
-
</ul>
|
60 |
-
|
61 |
-
</div>
|
62 |
-
|
63 |
-
<?php endif; ?>
|
64 |
-
|
65 |
-
<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
|
66 |
-
|
67 |
-
<h2 class="nav-tab-wrapper arve-settings-tabs"></h2>
|
68 |
-
|
69 |
-
<form class="arve-options-form" method="post" action="options.php">
|
70 |
-
|
71 |
-
<?php do_settings_sections( ARVE_SLUG ); ?>
|
72 |
-
<?php settings_fields( 'arve-settings-group' ); ?>
|
73 |
-
|
74 |
-
<input type="hidden" id="arve_options_main[last_settings_tab]" name="arve_options_main[last_settings_tab]" value="<?php echo esc_attr( $options['last_settings_tab'] ); ?>">
|
75 |
-
|
76 |
-
</form>
|
77 |
-
|
78 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/index.php
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<?php // Silence is golden
|
|
admin/pro-ad.html
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
<ul class="arve-list-small">
|
2 |
-
<li><strong>Disable links in embeds</strong><br>
|
3 |
-
For example: Clicking on a title in a YouTube embed will not open a new popup/tab/window. <strong>Prevent video hosts to lead your visitors away from your site!</strong> Note this also breaks sharing functionality and is not possible when the provider requires flash.</li>
|
4 |
-
<li><strong>Lazyload mode</strong><br>
|
5 |
-
Make your site load <strong>faster</strong> by loading only a image instead of the entire video player on pageload. </li>
|
6 |
-
<li><strong>Lazyload -> Lightbox</strong><br>
|
7 |
-
Shows the Video in a Lightbox after clicking a preview image</li>
|
8 |
-
<li><strong>Link -> Lightbox</strong><br>
|
9 |
-
Use simple links as triggers for lightboxed videos</li>
|
10 |
-
<li>Automatic or custom titles and thumbnails images</li>
|
11 |
-
<li>'Expand on click' feature</li>
|
12 |
-
<li>Show the latest video of a YouTube channel by using the channel URL (updated/cached hourly)</li>
|
13 |
-
<li>And more, for a <strong><a href="https://nextgenthemes.com/plugins/arve-pro/">complete feature list</a></strong> and purchase please visit the <strong><a href="https://nextgenthemes.com/plugins/arve-pro/">official site</a></strong></li>
|
14 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/product-images/arve.svg
DELETED
@@ -1,1230 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2 |
-
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
-
|
4 |
-
<svg
|
5 |
-
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
6 |
-
xmlns:cc="http://creativecommons.org/ns#"
|
7 |
-
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
8 |
-
xmlns:svg="http://www.w3.org/2000/svg"
|
9 |
-
xmlns="http://www.w3.org/2000/svg"
|
10 |
-
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
11 |
-
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
12 |
-
version="1.1"
|
13 |
-
id="Layer_1"
|
14 |
-
x="0px"
|
15 |
-
y="0px"
|
16 |
-
width="485.41898"
|
17 |
-
height="94.260002"
|
18 |
-
viewBox="0 0 485.41898 94.260002"
|
19 |
-
enable-background="new 0 0 1600 1200"
|
20 |
-
xml:space="preserve"
|
21 |
-
sodipodi:docname="arve.svg"
|
22 |
-
inkscape:version="0.92.1 unknown"><metadata
|
23 |
-
id="metadata136"><rdf:RDF><cc:Work
|
24 |
-
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
25 |
-
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
26 |
-
id="defs134"><filter
|
27 |
-
style="color-interpolation-filters:sRGB;"
|
28 |
-
inkscape:label="Colorize"
|
29 |
-
id="filter32776"><feComposite
|
30 |
-
in2="SourceGraphic"
|
31 |
-
operator="arithmetic"
|
32 |
-
k1="0"
|
33 |
-
k2="1.92513"
|
34 |
-
result="composite1"
|
35 |
-
id="feComposite32762" /><feColorMatrix
|
36 |
-
in="composite1"
|
37 |
-
values="1"
|
38 |
-
type="saturate"
|
39 |
-
result="colormatrix1"
|
40 |
-
id="feColorMatrix32764" /><feFlood
|
41 |
-
flood-opacity="1"
|
42 |
-
flood-color="rgb(255,255,255)"
|
43 |
-
result="flood1"
|
44 |
-
id="feFlood32766" /><feBlend
|
45 |
-
in="flood1"
|
46 |
-
in2="colormatrix1"
|
47 |
-
mode="normal"
|
48 |
-
result="blend1"
|
49 |
-
id="feBlend32768" /><feBlend
|
50 |
-
in2="blend1"
|
51 |
-
mode="screen"
|
52 |
-
result="blend2"
|
53 |
-
id="feBlend32770" /><feColorMatrix
|
54 |
-
in="blend2"
|
55 |
-
values="1"
|
56 |
-
type="saturate"
|
57 |
-
result="colormatrix2"
|
58 |
-
id="feColorMatrix32772" /><feComposite
|
59 |
-
in="colormatrix2"
|
60 |
-
in2="SourceGraphic"
|
61 |
-
operator="in"
|
62 |
-
k2="1"
|
63 |
-
result="composite2"
|
64 |
-
id="feComposite32774" /></filter><filter
|
65 |
-
style="color-interpolation-filters:sRGB;"
|
66 |
-
inkscape:label="Colorize"
|
67 |
-
id="filter32792"><feComposite
|
68 |
-
in2="SourceGraphic"
|
69 |
-
operator="arithmetic"
|
70 |
-
k1="0"
|
71 |
-
k2="1.92513"
|
72 |
-
result="composite1"
|
73 |
-
id="feComposite32778" /><feColorMatrix
|
74 |
-
in="composite1"
|
75 |
-
values="1"
|
76 |
-
type="saturate"
|
77 |
-
result="colormatrix1"
|
78 |
-
id="feColorMatrix32780" /><feFlood
|
79 |
-
flood-opacity="1"
|
80 |
-
flood-color="rgb(255,255,255)"
|
81 |
-
result="flood1"
|
82 |
-
id="feFlood32782" /><feBlend
|
83 |
-
in="flood1"
|
84 |
-
in2="colormatrix1"
|
85 |
-
mode="normal"
|
86 |
-
result="blend1"
|
87 |
-
id="feBlend32784" /><feBlend
|
88 |
-
in2="blend1"
|
89 |
-
mode="screen"
|
90 |
-
result="blend2"
|
91 |
-
id="feBlend32786" /><feColorMatrix
|
92 |
-
in="blend2"
|
93 |
-
values="1"
|
94 |
-
type="saturate"
|
95 |
-
result="colormatrix2"
|
96 |
-
id="feColorMatrix32788" /><feComposite
|
97 |
-
in="colormatrix2"
|
98 |
-
in2="SourceGraphic"
|
99 |
-
operator="in"
|
100 |
-
k2="1"
|
101 |
-
result="composite2"
|
102 |
-
id="feComposite32790" /></filter><filter
|
103 |
-
style="color-interpolation-filters:sRGB;"
|
104 |
-
inkscape:label="Colorize"
|
105 |
-
id="filter32808"><feComposite
|
106 |
-
in2="SourceGraphic"
|
107 |
-
operator="arithmetic"
|
108 |
-
k1="0"
|
109 |
-
k2="1.92513"
|
110 |
-
result="composite1"
|
111 |
-
id="feComposite32794" /><feColorMatrix
|
112 |
-
in="composite1"
|
113 |
-
values="1"
|
114 |
-
type="saturate"
|
115 |
-
result="colormatrix1"
|
116 |
-
id="feColorMatrix32796" /><feFlood
|
117 |
-
flood-opacity="1"
|
118 |
-
flood-color="rgb(255,255,255)"
|
119 |
-
result="flood1"
|
120 |
-
id="feFlood32798" /><feBlend
|
121 |
-
in="flood1"
|
122 |
-
in2="colormatrix1"
|
123 |
-
mode="normal"
|
124 |
-
result="blend1"
|
125 |
-
id="feBlend32800" /><feBlend
|
126 |
-
in2="blend1"
|
127 |
-
mode="screen"
|
128 |
-
result="blend2"
|
129 |
-
id="feBlend32802" /><feColorMatrix
|
130 |
-
in="blend2"
|
131 |
-
values="1"
|
132 |
-
type="saturate"
|
133 |
-
result="colormatrix2"
|
134 |
-
id="feColorMatrix32804" /><feComposite
|
135 |
-
in="colormatrix2"
|
136 |
-
in2="SourceGraphic"
|
137 |
-
operator="in"
|
138 |
-
k2="1"
|
139 |
-
result="composite2"
|
140 |
-
id="feComposite32806" /></filter><filter
|
141 |
-
style="color-interpolation-filters:sRGB;"
|
142 |
-
inkscape:label="Colorize"
|
143 |
-
id="filter32824"><feComposite
|
144 |
-
in2="SourceGraphic"
|
145 |
-
operator="arithmetic"
|
146 |
-
k1="0"
|
147 |
-
k2="1.92513"
|
148 |
-
result="composite1"
|
149 |
-
id="feComposite32810" /><feColorMatrix
|
150 |
-
in="composite1"
|
151 |
-
values="1"
|
152 |
-
type="saturate"
|
153 |
-
result="colormatrix1"
|
154 |
-
id="feColorMatrix32812" /><feFlood
|
155 |
-
flood-opacity="1"
|
156 |
-
flood-color="rgb(255,255,255)"
|
157 |
-
result="flood1"
|
158 |
-
id="feFlood32814" /><feBlend
|
159 |
-
in="flood1"
|
160 |
-
in2="colormatrix1"
|
161 |
-
mode="normal"
|
162 |
-
result="blend1"
|
163 |
-
id="feBlend32816" /><feBlend
|
164 |
-
in2="blend1"
|
165 |
-
mode="screen"
|
166 |
-
result="blend2"
|
167 |
-
id="feBlend32818" /><feColorMatrix
|
168 |
-
in="blend2"
|
169 |
-
values="1"
|
170 |
-
type="saturate"
|
171 |
-
result="colormatrix2"
|
172 |
-
id="feColorMatrix32820" /><feComposite
|
173 |
-
in="colormatrix2"
|
174 |
-
in2="SourceGraphic"
|
175 |
-
operator="in"
|
176 |
-
k2="1"
|
177 |
-
result="composite2"
|
178 |
-
id="feComposite32822" /></filter><filter
|
179 |
-
style="color-interpolation-filters:sRGB;"
|
180 |
-
inkscape:label="Colorize"
|
181 |
-
id="filter32840"><feComposite
|
182 |
-
in2="SourceGraphic"
|
183 |
-
operator="arithmetic"
|
184 |
-
k1="0"
|
185 |
-
k2="1.92513"
|
186 |
-
result="composite1"
|
187 |
-
id="feComposite32826" /><feColorMatrix
|
188 |
-
in="composite1"
|
189 |
-
values="1"
|
190 |
-
type="saturate"
|
191 |
-
result="colormatrix1"
|
192 |
-
id="feColorMatrix32828" /><feFlood
|
193 |
-
flood-opacity="1"
|
194 |
-
flood-color="rgb(255,255,255)"
|
195 |
-
result="flood1"
|
196 |
-
id="feFlood32830" /><feBlend
|
197 |
-
in="flood1"
|
198 |
-
in2="colormatrix1"
|
199 |
-
mode="normal"
|
200 |
-
result="blend1"
|
201 |
-
id="feBlend32832" /><feBlend
|
202 |
-
in2="blend1"
|
203 |
-
mode="screen"
|
204 |
-
result="blend2"
|
205 |
-
id="feBlend32834" /><feColorMatrix
|
206 |
-
in="blend2"
|
207 |
-
values="1"
|
208 |
-
type="saturate"
|
209 |
-
result="colormatrix2"
|
210 |
-
id="feColorMatrix32836" /><feComposite
|
211 |
-
in="colormatrix2"
|
212 |
-
in2="SourceGraphic"
|
213 |
-
operator="in"
|
214 |
-
k2="1"
|
215 |
-
result="composite2"
|
216 |
-
id="feComposite32838" /></filter><filter
|
217 |
-
style="color-interpolation-filters:sRGB;"
|
218 |
-
inkscape:label="Colorize"
|
219 |
-
id="filter32856"><feComposite
|
220 |
-
in2="SourceGraphic"
|
221 |
-
operator="arithmetic"
|
222 |
-
k1="0"
|
223 |
-
k2="1.92513"
|
224 |
-
result="composite1"
|
225 |
-
id="feComposite32842" /><feColorMatrix
|
226 |
-
in="composite1"
|
227 |
-
values="1"
|
228 |
-
type="saturate"
|
229 |
-
result="colormatrix1"
|
230 |
-
id="feColorMatrix32844" /><feFlood
|
231 |
-
flood-opacity="1"
|
232 |
-
flood-color="rgb(255,255,255)"
|
233 |
-
result="flood1"
|
234 |
-
id="feFlood32846" /><feBlend
|
235 |
-
in="flood1"
|
236 |
-
in2="colormatrix1"
|
237 |
-
mode="normal"
|
238 |
-
result="blend1"
|
239 |
-
id="feBlend32848" /><feBlend
|
240 |
-
in2="blend1"
|
241 |
-
mode="screen"
|
242 |
-
result="blend2"
|
243 |
-
id="feBlend32850" /><feColorMatrix
|
244 |
-
in="blend2"
|
245 |
-
values="1"
|
246 |
-
type="saturate"
|
247 |
-
result="colormatrix2"
|
248 |
-
id="feColorMatrix32852" /><feComposite
|
249 |
-
in="colormatrix2"
|
250 |
-
in2="SourceGraphic"
|
251 |
-
operator="in"
|
252 |
-
k2="1"
|
253 |
-
result="composite2"
|
254 |
-
id="feComposite32854" /></filter><filter
|
255 |
-
style="color-interpolation-filters:sRGB;"
|
256 |
-
inkscape:label="Colorize"
|
257 |
-
id="filter32872"><feComposite
|
258 |
-
in2="SourceGraphic"
|
259 |
-
operator="arithmetic"
|
260 |
-
k1="0"
|
261 |
-
k2="1.92513"
|
262 |
-
result="composite1"
|
263 |
-
id="feComposite32858" /><feColorMatrix
|
264 |
-
in="composite1"
|
265 |
-
values="1"
|
266 |
-
type="saturate"
|
267 |
-
result="colormatrix1"
|
268 |
-
id="feColorMatrix32860" /><feFlood
|
269 |
-
flood-opacity="1"
|
270 |
-
flood-color="rgb(255,255,255)"
|
271 |
-
result="flood1"
|
272 |
-
id="feFlood32862" /><feBlend
|
273 |
-
in="flood1"
|
274 |
-
in2="colormatrix1"
|
275 |
-
mode="normal"
|
276 |
-
result="blend1"
|
277 |
-
id="feBlend32864" /><feBlend
|
278 |
-
in2="blend1"
|
279 |
-
mode="screen"
|
280 |
-
result="blend2"
|
281 |
-
id="feBlend32866" /><feColorMatrix
|
282 |
-
in="blend2"
|
283 |
-
values="1"
|
284 |
-
type="saturate"
|
285 |
-
result="colormatrix2"
|
286 |
-
id="feColorMatrix32868" /><feComposite
|
287 |
-
in="colormatrix2"
|
288 |
-
in2="SourceGraphic"
|
289 |
-
operator="in"
|
290 |
-
k2="1"
|
291 |
-
result="composite2"
|
292 |
-
id="feComposite32870" /></filter><filter
|
293 |
-
style="color-interpolation-filters:sRGB;"
|
294 |
-
inkscape:label="Colorize"
|
295 |
-
id="filter32888"><feComposite
|
296 |
-
in2="SourceGraphic"
|
297 |
-
operator="arithmetic"
|
298 |
-
k1="0"
|
299 |
-
k2="1.92513"
|
300 |
-
result="composite1"
|
301 |
-
id="feComposite32874" /><feColorMatrix
|
302 |
-
in="composite1"
|
303 |
-
values="1"
|
304 |
-
type="saturate"
|
305 |
-
result="colormatrix1"
|
306 |
-
id="feColorMatrix32876" /><feFlood
|
307 |
-
flood-opacity="1"
|
308 |
-
flood-color="rgb(255,255,255)"
|
309 |
-
result="flood1"
|
310 |
-
id="feFlood32878" /><feBlend
|
311 |
-
in="flood1"
|
312 |
-
in2="colormatrix1"
|
313 |
-
mode="normal"
|
314 |
-
result="blend1"
|
315 |
-
id="feBlend32880" /><feBlend
|
316 |
-
in2="blend1"
|
317 |
-
mode="screen"
|
318 |
-
result="blend2"
|
319 |
-
id="feBlend32882" /><feColorMatrix
|
320 |
-
in="blend2"
|
321 |
-
values="1"
|
322 |
-
type="saturate"
|
323 |
-
result="colormatrix2"
|
324 |
-
id="feColorMatrix32884" /><feComposite
|
325 |
-
in="colormatrix2"
|
326 |
-
in2="SourceGraphic"
|
327 |
-
operator="in"
|
328 |
-
k2="1"
|
329 |
-
result="composite2"
|
330 |
-
id="feComposite32886" /></filter><filter
|
331 |
-
style="color-interpolation-filters:sRGB;"
|
332 |
-
inkscape:label="Colorize"
|
333 |
-
id="filter32904"><feComposite
|
334 |
-
in2="SourceGraphic"
|
335 |
-
operator="arithmetic"
|
336 |
-
k1="0"
|
337 |
-
k2="1.92513"
|
338 |
-
result="composite1"
|
339 |
-
id="feComposite32890" /><feColorMatrix
|
340 |
-
in="composite1"
|
341 |
-
values="1"
|
342 |
-
type="saturate"
|
343 |
-
result="colormatrix1"
|
344 |
-
id="feColorMatrix32892" /><feFlood
|
345 |
-
flood-opacity="1"
|
346 |
-
flood-color="rgb(255,255,255)"
|
347 |
-
result="flood1"
|
348 |
-
id="feFlood32894" /><feBlend
|
349 |
-
in="flood1"
|
350 |
-
in2="colormatrix1"
|
351 |
-
mode="normal"
|
352 |
-
result="blend1"
|
353 |
-
id="feBlend32896" /><feBlend
|
354 |
-
in2="blend1"
|
355 |
-
mode="screen"
|
356 |
-
result="blend2"
|
357 |
-
id="feBlend32898" /><feColorMatrix
|
358 |
-
in="blend2"
|
359 |
-
values="1"
|
360 |
-
type="saturate"
|
361 |
-
result="colormatrix2"
|
362 |
-
id="feColorMatrix32900" /><feComposite
|
363 |
-
in="colormatrix2"
|
364 |
-
in2="SourceGraphic"
|
365 |
-
operator="in"
|
366 |
-
k2="1"
|
367 |
-
result="composite2"
|
368 |
-
id="feComposite32902" /></filter><filter
|
369 |
-
style="color-interpolation-filters:sRGB;"
|
370 |
-
inkscape:label="Colorize"
|
371 |
-
id="filter32920"><feComposite
|
372 |
-
in2="SourceGraphic"
|
373 |
-
operator="arithmetic"
|
374 |
-
k1="0"
|
375 |
-
k2="1.92513"
|
376 |
-
result="composite1"
|
377 |
-
id="feComposite32906" /><feColorMatrix
|
378 |
-
in="composite1"
|
379 |
-
values="1"
|
380 |
-
type="saturate"
|
381 |
-
result="colormatrix1"
|
382 |
-
id="feColorMatrix32908" /><feFlood
|
383 |
-
flood-opacity="1"
|
384 |
-
flood-color="rgb(255,255,255)"
|
385 |
-
result="flood1"
|
386 |
-
id="feFlood32910" /><feBlend
|
387 |
-
in="flood1"
|
388 |
-
in2="colormatrix1"
|
389 |
-
mode="normal"
|
390 |
-
result="blend1"
|
391 |
-
id="feBlend32912" /><feBlend
|
392 |
-
in2="blend1"
|
393 |
-
mode="screen"
|
394 |
-
result="blend2"
|
395 |
-
id="feBlend32914" /><feColorMatrix
|
396 |
-
in="blend2"
|
397 |
-
values="1"
|
398 |
-
type="saturate"
|
399 |
-
result="colormatrix2"
|
400 |
-
id="feColorMatrix32916" /><feComposite
|
401 |
-
in="colormatrix2"
|
402 |
-
in2="SourceGraphic"
|
403 |
-
operator="in"
|
404 |
-
k2="1"
|
405 |
-
result="composite2"
|
406 |
-
id="feComposite32918" /></filter><filter
|
407 |
-
style="color-interpolation-filters:sRGB;"
|
408 |
-
inkscape:label="Colorize"
|
409 |
-
id="filter32936"><feComposite
|
410 |
-
in2="SourceGraphic"
|
411 |
-
operator="arithmetic"
|
412 |
-
k1="0"
|
413 |
-
k2="1.92513"
|
414 |
-
result="composite1"
|
415 |
-
id="feComposite32922" /><feColorMatrix
|
416 |
-
in="composite1"
|
417 |
-
values="1"
|
418 |
-
type="saturate"
|
419 |
-
result="colormatrix1"
|
420 |
-
id="feColorMatrix32924" /><feFlood
|
421 |
-
flood-opacity="1"
|
422 |
-
flood-color="rgb(255,255,255)"
|
423 |
-
result="flood1"
|
424 |
-
id="feFlood32926" /><feBlend
|
425 |
-
in="flood1"
|
426 |
-
in2="colormatrix1"
|
427 |
-
mode="normal"
|
428 |
-
result="blend1"
|
429 |
-
id="feBlend32928" /><feBlend
|
430 |
-
in2="blend1"
|
431 |
-
mode="screen"
|
432 |
-
result="blend2"
|
433 |
-
id="feBlend32930" /><feColorMatrix
|
434 |
-
in="blend2"
|
435 |
-
values="1"
|
436 |
-
type="saturate"
|
437 |
-
result="colormatrix2"
|
438 |
-
id="feColorMatrix32932" /><feComposite
|
439 |
-
in="colormatrix2"
|
440 |
-
in2="SourceGraphic"
|
441 |
-
operator="in"
|
442 |
-
k2="1"
|
443 |
-
result="composite2"
|
444 |
-
id="feComposite32934" /></filter><filter
|
445 |
-
style="color-interpolation-filters:sRGB;"
|
446 |
-
inkscape:label="Colorize"
|
447 |
-
id="filter32952"><feComposite
|
448 |
-
in2="SourceGraphic"
|
449 |
-
operator="arithmetic"
|
450 |
-
k1="0"
|
451 |
-
k2="1.92513"
|
452 |
-
result="composite1"
|
453 |
-
id="feComposite32938" /><feColorMatrix
|
454 |
-
in="composite1"
|
455 |
-
values="1"
|
456 |
-
type="saturate"
|
457 |
-
result="colormatrix1"
|
458 |
-
id="feColorMatrix32940" /><feFlood
|
459 |
-
flood-opacity="1"
|
460 |
-
flood-color="rgb(255,255,255)"
|
461 |
-
result="flood1"
|
462 |
-
id="feFlood32942" /><feBlend
|
463 |
-
in="flood1"
|
464 |
-
in2="colormatrix1"
|
465 |
-
mode="normal"
|
466 |
-
result="blend1"
|
467 |
-
id="feBlend32944" /><feBlend
|
468 |
-
in2="blend1"
|
469 |
-
mode="screen"
|
470 |
-
result="blend2"
|
471 |
-
id="feBlend32946" /><feColorMatrix
|
472 |
-
in="blend2"
|
473 |
-
values="1"
|
474 |
-
type="saturate"
|
475 |
-
result="colormatrix2"
|
476 |
-
id="feColorMatrix32948" /><feComposite
|
477 |
-
in="colormatrix2"
|
478 |
-
in2="SourceGraphic"
|
479 |
-
operator="in"
|
480 |
-
k2="1"
|
481 |
-
result="composite2"
|
482 |
-
id="feComposite32950" /></filter><filter
|
483 |
-
style="color-interpolation-filters:sRGB;"
|
484 |
-
inkscape:label="Colorize"
|
485 |
-
id="filter32968"><feComposite
|
486 |
-
in2="SourceGraphic"
|
487 |
-
operator="arithmetic"
|
488 |
-
k1="0"
|
489 |
-
k2="1.92513"
|
490 |
-
result="composite1"
|
491 |
-
id="feComposite32954" /><feColorMatrix
|
492 |
-
in="composite1"
|
493 |
-
values="1"
|
494 |
-
type="saturate"
|
495 |
-
result="colormatrix1"
|
496 |
-
id="feColorMatrix32956" /><feFlood
|
497 |
-
flood-opacity="1"
|
498 |
-
flood-color="rgb(255,255,255)"
|
499 |
-
result="flood1"
|
500 |
-
id="feFlood32958" /><feBlend
|
501 |
-
in="flood1"
|
502 |
-
in2="colormatrix1"
|
503 |
-
mode="normal"
|
504 |
-
result="blend1"
|
505 |
-
id="feBlend32960" /><feBlend
|
506 |
-
in2="blend1"
|
507 |
-
mode="screen"
|
508 |
-
result="blend2"
|
509 |
-
id="feBlend32962" /><feColorMatrix
|
510 |
-
in="blend2"
|
511 |
-
values="1"
|
512 |
-
type="saturate"
|
513 |
-
result="colormatrix2"
|
514 |
-
id="feColorMatrix32964" /><feComposite
|
515 |
-
in="colormatrix2"
|
516 |
-
in2="SourceGraphic"
|
517 |
-
operator="in"
|
518 |
-
k2="1"
|
519 |
-
result="composite2"
|
520 |
-
id="feComposite32966" /></filter><filter
|
521 |
-
style="color-interpolation-filters:sRGB;"
|
522 |
-
inkscape:label="Colorize"
|
523 |
-
id="filter32984"><feComposite
|
524 |
-
in2="SourceGraphic"
|
525 |
-
operator="arithmetic"
|
526 |
-
k1="0"
|
527 |
-
k2="1.92513"
|
528 |
-
result="composite1"
|
529 |
-
id="feComposite32970" /><feColorMatrix
|
530 |
-
in="composite1"
|
531 |
-
values="1"
|
532 |
-
type="saturate"
|
533 |
-
result="colormatrix1"
|
534 |
-
id="feColorMatrix32972" /><feFlood
|
535 |
-
flood-opacity="1"
|
536 |
-
flood-color="rgb(255,255,255)"
|
537 |
-
result="flood1"
|
538 |
-
id="feFlood32974" /><feBlend
|
539 |
-
in="flood1"
|
540 |
-
in2="colormatrix1"
|
541 |
-
mode="normal"
|
542 |
-
result="blend1"
|
543 |
-
id="feBlend32976" /><feBlend
|
544 |
-
in2="blend1"
|
545 |
-
mode="screen"
|
546 |
-
result="blend2"
|
547 |
-
id="feBlend32978" /><feColorMatrix
|
548 |
-
in="blend2"
|
549 |
-
values="1"
|
550 |
-
type="saturate"
|
551 |
-
result="colormatrix2"
|
552 |
-
id="feColorMatrix32980" /><feComposite
|
553 |
-
in="colormatrix2"
|
554 |
-
in2="SourceGraphic"
|
555 |
-
operator="in"
|
556 |
-
k2="1"
|
557 |
-
result="composite2"
|
558 |
-
id="feComposite32982" /></filter><filter
|
559 |
-
style="color-interpolation-filters:sRGB;"
|
560 |
-
inkscape:label="Colorize"
|
561 |
-
id="filter33000"><feComposite
|
562 |
-
in2="SourceGraphic"
|
563 |
-
operator="arithmetic"
|
564 |
-
k1="0"
|
565 |
-
k2="1.92513"
|
566 |
-
result="composite1"
|
567 |
-
id="feComposite32986" /><feColorMatrix
|
568 |
-
in="composite1"
|
569 |
-
values="1"
|
570 |
-
type="saturate"
|
571 |
-
result="colormatrix1"
|
572 |
-
id="feColorMatrix32988" /><feFlood
|
573 |
-
flood-opacity="1"
|
574 |
-
flood-color="rgb(255,255,255)"
|
575 |
-
result="flood1"
|
576 |
-
id="feFlood32990" /><feBlend
|
577 |
-
in="flood1"
|
578 |
-
in2="colormatrix1"
|
579 |
-
mode="normal"
|
580 |
-
result="blend1"
|
581 |
-
id="feBlend32992" /><feBlend
|
582 |
-
in2="blend1"
|
583 |
-
mode="screen"
|
584 |
-
result="blend2"
|
585 |
-
id="feBlend32994" /><feColorMatrix
|
586 |
-
in="blend2"
|
587 |
-
values="1"
|
588 |
-
type="saturate"
|
589 |
-
result="colormatrix2"
|
590 |
-
id="feColorMatrix32996" /><feComposite
|
591 |
-
in="colormatrix2"
|
592 |
-
in2="SourceGraphic"
|
593 |
-
operator="in"
|
594 |
-
k2="1"
|
595 |
-
result="composite2"
|
596 |
-
id="feComposite32998" /></filter><filter
|
597 |
-
style="color-interpolation-filters:sRGB;"
|
598 |
-
inkscape:label="Colorize"
|
599 |
-
id="filter33016"><feComposite
|
600 |
-
in2="SourceGraphic"
|
601 |
-
operator="arithmetic"
|
602 |
-
k1="0"
|
603 |
-
k2="1.92513"
|
604 |
-
result="composite1"
|
605 |
-
id="feComposite33002" /><feColorMatrix
|
606 |
-
in="composite1"
|
607 |
-
values="1"
|
608 |
-
type="saturate"
|
609 |
-
result="colormatrix1"
|
610 |
-
id="feColorMatrix33004" /><feFlood
|
611 |
-
flood-opacity="1"
|
612 |
-
flood-color="rgb(255,255,255)"
|
613 |
-
result="flood1"
|
614 |
-
id="feFlood33006" /><feBlend
|
615 |
-
in="flood1"
|
616 |
-
in2="colormatrix1"
|
617 |
-
mode="normal"
|
618 |
-
result="blend1"
|
619 |
-
id="feBlend33008" /><feBlend
|
620 |
-
in2="blend1"
|
621 |
-
mode="screen"
|
622 |
-
result="blend2"
|
623 |
-
id="feBlend33010" /><feColorMatrix
|
624 |
-
in="blend2"
|
625 |
-
values="1"
|
626 |
-
type="saturate"
|
627 |
-
result="colormatrix2"
|
628 |
-
id="feColorMatrix33012" /><feComposite
|
629 |
-
in="colormatrix2"
|
630 |
-
in2="SourceGraphic"
|
631 |
-
operator="in"
|
632 |
-
k2="1"
|
633 |
-
result="composite2"
|
634 |
-
id="feComposite33014" /></filter><filter
|
635 |
-
style="color-interpolation-filters:sRGB;"
|
636 |
-
inkscape:label="Colorize"
|
637 |
-
id="filter33032"><feComposite
|
638 |
-
in2="SourceGraphic"
|
639 |
-
operator="arithmetic"
|
640 |
-
k1="0"
|
641 |
-
k2="1.92513"
|
642 |
-
result="composite1"
|
643 |
-
id="feComposite33018" /><feColorMatrix
|
644 |
-
in="composite1"
|
645 |
-
values="1"
|
646 |
-
type="saturate"
|
647 |
-
result="colormatrix1"
|
648 |
-
id="feColorMatrix33020" /><feFlood
|
649 |
-
flood-opacity="1"
|
650 |
-
flood-color="rgb(255,255,255)"
|
651 |
-
result="flood1"
|
652 |
-
id="feFlood33022" /><feBlend
|
653 |
-
in="flood1"
|
654 |
-
in2="colormatrix1"
|
655 |
-
mode="normal"
|
656 |
-
result="blend1"
|
657 |
-
id="feBlend33024" /><feBlend
|
658 |
-
in2="blend1"
|
659 |
-
mode="screen"
|
660 |
-
result="blend2"
|
661 |
-
id="feBlend33026" /><feColorMatrix
|
662 |
-
in="blend2"
|
663 |
-
values="1"
|
664 |
-
type="saturate"
|
665 |
-
result="colormatrix2"
|
666 |
-
id="feColorMatrix33028" /><feComposite
|
667 |
-
in="colormatrix2"
|
668 |
-
in2="SourceGraphic"
|
669 |
-
operator="in"
|
670 |
-
k2="1"
|
671 |
-
result="composite2"
|
672 |
-
id="feComposite33030" /></filter><filter
|
673 |
-
style="color-interpolation-filters:sRGB;"
|
674 |
-
inkscape:label="Colorize"
|
675 |
-
id="filter33048"><feComposite
|
676 |
-
in2="SourceGraphic"
|
677 |
-
operator="arithmetic"
|
678 |
-
k1="0"
|
679 |
-
k2="1.92513"
|
680 |
-
result="composite1"
|
681 |
-
id="feComposite33034" /><feColorMatrix
|
682 |
-
in="composite1"
|
683 |
-
values="1"
|
684 |
-
type="saturate"
|
685 |
-
result="colormatrix1"
|
686 |
-
id="feColorMatrix33036" /><feFlood
|
687 |
-
flood-opacity="1"
|
688 |
-
flood-color="rgb(255,255,255)"
|
689 |
-
result="flood1"
|
690 |
-
id="feFlood33038" /><feBlend
|
691 |
-
in="flood1"
|
692 |
-
in2="colormatrix1"
|
693 |
-
mode="normal"
|
694 |
-
result="blend1"
|
695 |
-
id="feBlend33040" /><feBlend
|
696 |
-
in2="blend1"
|
697 |
-
mode="screen"
|
698 |
-
result="blend2"
|
699 |
-
id="feBlend33042" /><feColorMatrix
|
700 |
-
in="blend2"
|
701 |
-
values="1"
|
702 |
-
type="saturate"
|
703 |
-
result="colormatrix2"
|
704 |
-
id="feColorMatrix33044" /><feComposite
|
705 |
-
in="colormatrix2"
|
706 |
-
in2="SourceGraphic"
|
707 |
-
operator="in"
|
708 |
-
k2="1"
|
709 |
-
result="composite2"
|
710 |
-
id="feComposite33046" /></filter><filter
|
711 |
-
style="color-interpolation-filters:sRGB;"
|
712 |
-
inkscape:label="Colorize"
|
713 |
-
id="filter33064"><feComposite
|
714 |
-
in2="SourceGraphic"
|
715 |
-
operator="arithmetic"
|
716 |
-
k1="0"
|
717 |
-
k2="1.92513"
|
718 |
-
result="composite1"
|
719 |
-
id="feComposite33050" /><feColorMatrix
|
720 |
-
in="composite1"
|
721 |
-
values="1"
|
722 |
-
type="saturate"
|
723 |
-
result="colormatrix1"
|
724 |
-
id="feColorMatrix33052" /><feFlood
|
725 |
-
flood-opacity="1"
|
726 |
-
flood-color="rgb(255,255,255)"
|
727 |
-
result="flood1"
|
728 |
-
id="feFlood33054" /><feBlend
|
729 |
-
in="flood1"
|
730 |
-
in2="colormatrix1"
|
731 |
-
mode="normal"
|
732 |
-
result="blend1"
|
733 |
-
id="feBlend33056" /><feBlend
|
734 |
-
in2="blend1"
|
735 |
-
mode="screen"
|
736 |
-
result="blend2"
|
737 |
-
id="feBlend33058" /><feColorMatrix
|
738 |
-
in="blend2"
|
739 |
-
values="1"
|
740 |
-
type="saturate"
|
741 |
-
result="colormatrix2"
|
742 |
-
id="feColorMatrix33060" /><feComposite
|
743 |
-
in="colormatrix2"
|
744 |
-
in2="SourceGraphic"
|
745 |
-
operator="in"
|
746 |
-
k2="1"
|
747 |
-
result="composite2"
|
748 |
-
id="feComposite33062" /></filter><filter
|
749 |
-
style="color-interpolation-filters:sRGB;"
|
750 |
-
inkscape:label="Colorize"
|
751 |
-
id="filter33080"><feComposite
|
752 |
-
in2="SourceGraphic"
|
753 |
-
operator="arithmetic"
|
754 |
-
k1="0"
|
755 |
-
k2="1.92513"
|
756 |
-
result="composite1"
|
757 |
-
id="feComposite33066" /><feColorMatrix
|
758 |
-
in="composite1"
|
759 |
-
values="1"
|
760 |
-
type="saturate"
|
761 |
-
result="colormatrix1"
|
762 |
-
id="feColorMatrix33068" /><feFlood
|
763 |
-
flood-opacity="1"
|
764 |
-
flood-color="rgb(255,255,255)"
|
765 |
-
result="flood1"
|
766 |
-
id="feFlood33070" /><feBlend
|
767 |
-
in="flood1"
|
768 |
-
in2="colormatrix1"
|
769 |
-
mode="normal"
|
770 |
-
result="blend1"
|
771 |
-
id="feBlend33072" /><feBlend
|
772 |
-
in2="blend1"
|
773 |
-
mode="screen"
|
774 |
-
result="blend2"
|
775 |
-
id="feBlend33074" /><feColorMatrix
|
776 |
-
in="blend2"
|
777 |
-
values="1"
|
778 |
-
type="saturate"
|
779 |
-
result="colormatrix2"
|
780 |
-
id="feColorMatrix33076" /><feComposite
|
781 |
-
in="colormatrix2"
|
782 |
-
in2="SourceGraphic"
|
783 |
-
operator="in"
|
784 |
-
k2="1"
|
785 |
-
result="composite2"
|
786 |
-
id="feComposite33078" /></filter><filter
|
787 |
-
style="color-interpolation-filters:sRGB;"
|
788 |
-
inkscape:label="Colorize"
|
789 |
-
id="filter33096"><feComposite
|
790 |
-
in2="SourceGraphic"
|
791 |
-
operator="arithmetic"
|
792 |
-
k1="0"
|
793 |
-
k2="1.92513"
|
794 |
-
result="composite1"
|
795 |
-
id="feComposite33082" /><feColorMatrix
|
796 |
-
in="composite1"
|
797 |
-
values="1"
|
798 |
-
type="saturate"
|
799 |
-
result="colormatrix1"
|
800 |
-
id="feColorMatrix33084" /><feFlood
|
801 |
-
flood-opacity="1"
|
802 |
-
flood-color="rgb(255,255,255)"
|
803 |
-
result="flood1"
|
804 |
-
id="feFlood33086" /><feBlend
|
805 |
-
in="flood1"
|
806 |
-
in2="colormatrix1"
|
807 |
-
mode="normal"
|
808 |
-
result="blend1"
|
809 |
-
id="feBlend33088" /><feBlend
|
810 |
-
in2="blend1"
|
811 |
-
mode="screen"
|
812 |
-
result="blend2"
|
813 |
-
id="feBlend33090" /><feColorMatrix
|
814 |
-
in="blend2"
|
815 |
-
values="1"
|
816 |
-
type="saturate"
|
817 |
-
result="colormatrix2"
|
818 |
-
id="feColorMatrix33092" /><feComposite
|
819 |
-
in="colormatrix2"
|
820 |
-
in2="SourceGraphic"
|
821 |
-
operator="in"
|
822 |
-
k2="1"
|
823 |
-
result="composite2"
|
824 |
-
id="feComposite33094" /></filter><filter
|
825 |
-
style="color-interpolation-filters:sRGB;"
|
826 |
-
inkscape:label="Colorize"
|
827 |
-
id="filter33112"><feComposite
|
828 |
-
in2="SourceGraphic"
|
829 |
-
operator="arithmetic"
|
830 |
-
k1="0"
|
831 |
-
k2="1.92513"
|
832 |
-
result="composite1"
|
833 |
-
id="feComposite33098" /><feColorMatrix
|
834 |
-
in="composite1"
|
835 |
-
values="1"
|
836 |
-
type="saturate"
|
837 |
-
result="colormatrix1"
|
838 |
-
id="feColorMatrix33100" /><feFlood
|
839 |
-
flood-opacity="1"
|
840 |
-
flood-color="rgb(255,255,255)"
|
841 |
-
result="flood1"
|
842 |
-
id="feFlood33102" /><feBlend
|
843 |
-
in="flood1"
|
844 |
-
in2="colormatrix1"
|
845 |
-
mode="normal"
|
846 |
-
result="blend1"
|
847 |
-
id="feBlend33104" /><feBlend
|
848 |
-
in2="blend1"
|
849 |
-
mode="screen"
|
850 |
-
result="blend2"
|
851 |
-
id="feBlend33106" /><feColorMatrix
|
852 |
-
in="blend2"
|
853 |
-
values="1"
|
854 |
-
type="saturate"
|
855 |
-
result="colormatrix2"
|
856 |
-
id="feColorMatrix33108" /><feComposite
|
857 |
-
in="colormatrix2"
|
858 |
-
in2="SourceGraphic"
|
859 |
-
operator="in"
|
860 |
-
k2="1"
|
861 |
-
result="composite2"
|
862 |
-
id="feComposite33110" /></filter><filter
|
863 |
-
style="color-interpolation-filters:sRGB;"
|
864 |
-
inkscape:label="Colorize"
|
865 |
-
id="filter33128"><feComposite
|
866 |
-
in2="SourceGraphic"
|
867 |
-
operator="arithmetic"
|
868 |
-
k1="0"
|
869 |
-
k2="1.92513"
|
870 |
-
result="composite1"
|
871 |
-
id="feComposite33114" /><feColorMatrix
|
872 |
-
in="composite1"
|
873 |
-
values="1"
|
874 |
-
type="saturate"
|
875 |
-
result="colormatrix1"
|
876 |
-
id="feColorMatrix33116" /><feFlood
|
877 |
-
flood-opacity="1"
|
878 |
-
flood-color="rgb(255,255,255)"
|
879 |
-
result="flood1"
|
880 |
-
id="feFlood33118" /><feBlend
|
881 |
-
in="flood1"
|
882 |
-
in2="colormatrix1"
|
883 |
-
mode="normal"
|
884 |
-
result="blend1"
|
885 |
-
id="feBlend33120" /><feBlend
|
886 |
-
in2="blend1"
|
887 |
-
mode="screen"
|
888 |
-
result="blend2"
|
889 |
-
id="feBlend33122" /><feColorMatrix
|
890 |
-
in="blend2"
|
891 |
-
values="1"
|
892 |
-
type="saturate"
|
893 |
-
result="colormatrix2"
|
894 |
-
id="feColorMatrix33124" /><feComposite
|
895 |
-
in="colormatrix2"
|
896 |
-
in2="SourceGraphic"
|
897 |
-
operator="in"
|
898 |
-
k2="1"
|
899 |
-
result="composite2"
|
900 |
-
id="feComposite33126" /></filter><filter
|
901 |
-
style="color-interpolation-filters:sRGB;"
|
902 |
-
inkscape:label="Colorize"
|
903 |
-
id="filter33144"><feComposite
|
904 |
-
in2="SourceGraphic"
|
905 |
-
operator="arithmetic"
|
906 |
-
k1="0"
|
907 |
-
k2="1.92513"
|
908 |
-
result="composite1"
|
909 |
-
id="feComposite33130" /><feColorMatrix
|
910 |
-
in="composite1"
|
911 |
-
values="1"
|
912 |
-
type="saturate"
|
913 |
-
result="colormatrix1"
|
914 |
-
id="feColorMatrix33132" /><feFlood
|
915 |
-
flood-opacity="1"
|
916 |
-
flood-color="rgb(255,255,255)"
|
917 |
-
result="flood1"
|
918 |
-
id="feFlood33134" /><feBlend
|
919 |
-
in="flood1"
|
920 |
-
in2="colormatrix1"
|
921 |
-
mode="normal"
|
922 |
-
result="blend1"
|
923 |
-
id="feBlend33136" /><feBlend
|
924 |
-
in2="blend1"
|
925 |
-
mode="screen"
|
926 |
-
result="blend2"
|
927 |
-
id="feBlend33138" /><feColorMatrix
|
928 |
-
in="blend2"
|
929 |
-
values="1"
|
930 |
-
type="saturate"
|
931 |
-
result="colormatrix2"
|
932 |
-
id="feColorMatrix33140" /><feComposite
|
933 |
-
in="colormatrix2"
|
934 |
-
in2="SourceGraphic"
|
935 |
-
operator="in"
|
936 |
-
k2="1"
|
937 |
-
result="composite2"
|
938 |
-
id="feComposite33142" /></filter><filter
|
939 |
-
style="color-interpolation-filters:sRGB;"
|
940 |
-
inkscape:label="Colorize"
|
941 |
-
id="filter33160"><feComposite
|
942 |
-
in2="SourceGraphic"
|
943 |
-
operator="arithmetic"
|
944 |
-
k1="0"
|
945 |
-
k2="1.92513"
|
946 |
-
result="composite1"
|
947 |
-
id="feComposite33146" /><feColorMatrix
|
948 |
-
in="composite1"
|
949 |
-
values="1"
|
950 |
-
type="saturate"
|
951 |
-
result="colormatrix1"
|
952 |
-
id="feColorMatrix33148" /><feFlood
|
953 |
-
flood-opacity="1"
|
954 |
-
flood-color="rgb(255,255,255)"
|
955 |
-
result="flood1"
|
956 |
-
id="feFlood33150" /><feBlend
|
957 |
-
in="flood1"
|
958 |
-
in2="colormatrix1"
|
959 |
-
mode="normal"
|
960 |
-
result="blend1"
|
961 |
-
id="feBlend33152" /><feBlend
|
962 |
-
in2="blend1"
|
963 |
-
mode="screen"
|
964 |
-
result="blend2"
|
965 |
-
id="feBlend33154" /><feColorMatrix
|
966 |
-
in="blend2"
|
967 |
-
values="1"
|
968 |
-
type="saturate"
|
969 |
-
result="colormatrix2"
|
970 |
-
id="feColorMatrix33156" /><feComposite
|
971 |
-
in="colormatrix2"
|
972 |
-
in2="SourceGraphic"
|
973 |
-
operator="in"
|
974 |
-
k2="1"
|
975 |
-
result="composite2"
|
976 |
-
id="feComposite33158" /></filter></defs><sodipodi:namedview
|
977 |
-
pagecolor="#ffffff"
|
978 |
-
bordercolor="#666666"
|
979 |
-
borderopacity="1"
|
980 |
-
objecttolerance="10"
|
981 |
-
gridtolerance="10"
|
982 |
-
guidetolerance="10"
|
983 |
-
inkscape:pageopacity="0"
|
984 |
-
inkscape:pageshadow="2"
|
985 |
-
inkscape:window-width="1855"
|
986 |
-
inkscape:window-height="1176"
|
987 |
-
id="namedview132"
|
988 |
-
showgrid="false"
|
989 |
-
inkscape:showpageshadow="false"
|
990 |
-
inkscape:zoom="2.2250293"
|
991 |
-
inkscape:cx="250.07699"
|
992 |
-
inkscape:cy="120.20161"
|
993 |
-
inkscape:window-x="65"
|
994 |
-
inkscape:window-y="24"
|
995 |
-
inkscape:window-maximized="1"
|
996 |
-
inkscape:current-layer="Layer_1"
|
997 |
-
fit-margin-top="0"
|
998 |
-
fit-margin-left="0"
|
999 |
-
fit-margin-right="0"
|
1000 |
-
fit-margin-bottom="0" /><polygon
|
1001 |
-
id="polygon2"
|
1002 |
-
points="712.459,582.144 690.578,582.144 670.544,619.146 693.247,619.146 "
|
1003 |
-
transform="translate(-557.291,-552.87)"
|
1004 |
-
style="filter:url(#filter33160)" /><polygon
|
1005 |
-
id="polygon4"
|
1006 |
-
points="746.707,619.146 769.318,619.146 748.977,582.144 726.967,582.144 732.792,593.149 "
|
1007 |
-
transform="translate(-557.291,-552.87)"
|
1008 |
-
style="filter:url(#filter33144)" /><polygon
|
1009 |
-
style="fill:#e52d27"
|
1010 |
-
id="polygon6"
|
1011 |
-
points="697.89,568.249 719.398,568.249 741.126,568.249 732.672,552.87 706.216,552.87 "
|
1012 |
-
transform="translate(-557.291,-552.87)" /><path
|
1013 |
-
inkscape:connector-curvature="0"
|
1014 |
-
id="path8"
|
1015 |
-
d="m 280.02,30.941 c -1.16,1.099 -3.083,1.648 -5.767,1.648 h -33.596 v -3.315 h -20.322 v 37.002 h 20.322 v -17.21 h 31.948 c 3.173,0 5.355,0.672 6.545,2.014 1.19,1.343 1.785,3.753 1.785,7.232 v 7.964 h 20.322 v -11.26 c 0,-2.623 -0.274,-4.836 -0.824,-6.637 -0.549,-1.799 -1.327,-3.218 -2.334,-4.257 -1.007,-1.037 -2.151,-1.845 -3.433,-2.426 -1.282,-0.579 -2.778,-1.021 -4.485,-1.327 v -0.183 c 4.454,-1.037 7.461,-2.822 9.017,-5.355 0.905,-1.472 1.538,-3.333 1.917,-5.558 h -19.978 c -0.28,0.665 -0.649,1.224 -1.117,1.668 z"
|
1016 |
-
style="filter:url(#filter33128)" /><path
|
1017 |
-
style="fill:#e52d27"
|
1018 |
-
inkscape:connector-curvature="0"
|
1019 |
-
id="path10"
|
1020 |
-
d="M 300.359,11.443 C 299.718,9.063 298.65,7.019 297.155,5.31 295.659,3.602 293.631,2.289 291.068,1.374 288.505,0.458 285.301,10e-4 281.456,10e-4 H 220.123 V 15.38 h 80.965 c -0.161,-1.407 -0.402,-2.721 -0.729,-3.937 z" /><polygon
|
1021 |
-
id="polygon12"
|
1022 |
-
points="902.499,582.144 880.584,582.144 900.466,619.146 925.548,619.146 945.429,582.144 923.514,582.144 913.006,602.12 "
|
1023 |
-
transform="translate(-557.291,-552.87)"
|
1024 |
-
style="filter:url(#filter33112)" /><polygon
|
1025 |
-
style="fill:#e52d27"
|
1026 |
-
id="polygon14"
|
1027 |
-
points="961.157,552.87 938.913,552.87 930.823,568.249 952.894,568.249 "
|
1028 |
-
transform="translate(-557.291,-552.87)" /><polygon
|
1029 |
-
style="fill:#e52d27"
|
1030 |
-
id="polygon16"
|
1031 |
-
points="887.1,552.87 864.856,552.87 873.119,568.249 895.19,568.249 "
|
1032 |
-
transform="translate(-557.291,-552.87)" /><polygon
|
1033 |
-
style="fill:#e52d27"
|
1034 |
-
id="polygon18"
|
1035 |
-
points="968.48,568.249 988.803,568.249 1040.982,568.249 1040.982,552.87 968.48,552.87 "
|
1036 |
-
transform="translate(-557.291,-552.87)" /><polygon
|
1037 |
-
id="polygon20"
|
1038 |
-
points="988.803,603.218 988.803,592.599 1038.235,592.599 1038.235,582.144 968.48,582.144 968.48,619.146 1042.171,619.146 1042.171,603.218 "
|
1039 |
-
transform="translate(-557.291,-552.87)"
|
1040 |
-
style="filter:url(#filter33096)" /><g
|
1041 |
-
id="g28"
|
1042 |
-
transform="translate(-557.291,-552.87)"
|
1043 |
-
style="filter:url(#filter33064)"><g
|
1044 |
-
id="g26"><rect
|
1045 |
-
id="rect24"
|
1046 |
-
height="1.5"
|
1047 |
-
width="372.21399"
|
1048 |
-
y="625.79901"
|
1049 |
-
x="670.49597" /></g></g><path
|
1050 |
-
d="m 119.878,77.729 h 4.095 l 5.639,10.259 h -3.5 l -0.978,-1.814 h -6.376 l -0.921,1.814 h -3.514 z m 0.057,6.235 h 4.024 l -2.04,-3.854 z"
|
1051 |
-
id="path30"
|
1052 |
-
inkscape:connector-curvature="0"
|
1053 |
-
style="fill:#e52d27" /><path
|
1054 |
-
d="m 130.42,83.723 c 0,-0.519 0.045,-0.959 0.135,-1.318 0.09,-0.359 0.267,-0.671 0.531,-0.935 0.264,-0.264 0.654,-0.468 1.169,-0.609 0.515,-0.142 1.193,-0.213 2.033,-0.213 h 0.808 c 0.302,0 0.586,0.024 0.85,0.071 0.264,0.047 0.51,0.125 0.737,0.234 0.227,0.109 0.416,0.258 0.567,0.446 0.151,0.189 0.245,0.421 0.283,0.695 h 0.028 V 77.73 h 2.72 v 10.259 h -2.55 v -1.332 h -0.028 c -0.161,0.473 -0.442,0.831 -0.843,1.077 -0.402,0.246 -0.994,0.369 -1.778,0.369 h -0.793 c -0.841,0 -1.518,-0.071 -2.033,-0.213 -0.515,-0.142 -0.905,-0.345 -1.169,-0.609 -0.265,-0.264 -0.442,-0.576 -0.531,-0.935 -0.09,-0.359 -0.135,-0.798 -0.135,-1.318 v -1.305 z m 2.636,1.077 c 0,0.454 0.088,0.777 0.262,0.971 0.175,0.194 0.565,0.291 1.169,0.291 h 1.601 c 0.576,0 0.994,-0.092 1.254,-0.276 0.26,-0.184 0.39,-0.536 0.39,-1.056 v -0.708 c 0,-0.52 -0.13,-0.871 -0.39,-1.056 -0.26,-0.184 -0.678,-0.276 -1.254,-0.276 h -1.601 c -0.604,0 -0.994,0.097 -1.169,0.29 -0.175,0.194 -0.262,0.517 -0.262,0.971 z"
|
1055 |
-
id="path32"
|
1056 |
-
inkscape:connector-curvature="0"
|
1057 |
-
style="fill:#e52d27" /><path
|
1058 |
-
d="m 141.302,80.762 h 2.962 l 2.21,5.101 2.21,-5.101 h 2.961 l -3.471,7.226 h -3.401 z"
|
1059 |
-
id="path34"
|
1060 |
-
inkscape:connector-curvature="0"
|
1061 |
-
style="fill:#e52d27" /><path
|
1062 |
-
d="m 152.213,85.452 c 0,-0.482 0.082,-0.864 0.248,-1.148 0.165,-0.283 0.411,-0.491 0.737,-0.624 0.326,-0.132 0.718,-0.217 1.176,-0.255 0.458,-0.038 1.069,-0.057 1.835,-0.057 0.841,0 1.462,0.033 1.863,0.099 0.402,0.066 0.725,0.227 0.971,0.481 v -0.637 c 0,-0.368 -0.083,-0.621 -0.248,-0.758 -0.166,-0.137 -0.508,-0.205 -1.027,-0.205 h -1.601 c -0.416,0 -0.692,0.036 -0.829,0.107 -0.137,0.071 -0.21,0.229 -0.22,0.474 h -2.635 c 0,-0.482 0.062,-0.874 0.184,-1.176 0.123,-0.302 0.314,-0.533 0.574,-0.694 0.26,-0.161 0.588,-0.269 0.984,-0.326 0.397,-0.056 0.902,-0.085 1.516,-0.085 h 3.16 c 0.935,0 1.646,0.22 2.133,0.659 0.486,0.439 0.73,1.084 0.73,1.934 v 4.747 h -2.579 v -0.822 c -0.198,0.208 -0.371,0.371 -0.517,0.489 -0.147,0.118 -0.3,0.21 -0.461,0.276 -0.161,0.066 -0.35,0.111 -0.567,0.135 -0.218,0.023 -0.501,0.036 -0.85,0.036 h -1.856 c -0.916,0 -1.599,-0.146 -2.047,-0.439 -0.449,-0.293 -0.673,-0.831 -0.673,-1.615 v -0.596 z m 4.845,0.949 c 0.463,0 0.829,-0.016 1.098,-0.05 0.269,-0.033 0.472,-0.082 0.609,-0.149 0.137,-0.066 0.227,-0.142 0.269,-0.227 0.042,-0.085 0.064,-0.198 0.064,-0.34 0,-0.293 -0.099,-0.489 -0.298,-0.588 -0.198,-0.099 -0.652,-0.149 -1.36,-0.149 h -1.204 c -0.548,0 -0.916,0.064 -1.105,0.191 -0.189,0.127 -0.283,0.347 -0.283,0.659 0,0.237 0.106,0.404 0.319,0.503 0.212,0.099 0.583,0.149 1.112,0.149 h 0.779 z"
|
1063 |
-
id="path36"
|
1064 |
-
inkscape:connector-curvature="0"
|
1065 |
-
style="fill:#e52d27" /><path
|
1066 |
-
d="m 163.506,80.762 h 2.721 v 1.162 h 0.028 c 0.227,-0.482 0.572,-0.815 1.034,-0.999 0.463,-0.184 1.082,-0.276 1.856,-0.276 0.567,0 1.063,0.026 1.488,0.078 0.425,0.052 0.834,0.177 1.226,0.376 0.392,0.198 0.711,0.52 0.956,0.963 0.246,0.444 0.368,1.034 0.368,1.771 v 4.152 h -2.72 v -4.152 c 0,-0.708 -0.586,-1.063 -1.757,-1.063 h -0.624 c -0.586,0 -1.041,0.135 -1.367,0.404 -0.326,0.269 -0.489,0.659 -0.489,1.169 v 3.642 h -2.721 v -7.227 z"
|
1067 |
-
id="path38"
|
1068 |
-
inkscape:connector-curvature="0"
|
1069 |
-
style="fill:#e52d27" /><path
|
1070 |
-
d="m 174.713,83.978 c 0,-0.661 0.078,-1.212 0.234,-1.651 0.156,-0.439 0.38,-0.779 0.673,-1.02 0.293,-0.241 0.64,-0.411 1.042,-0.51 0.401,-0.099 0.866,-0.149 1.396,-0.149 h 3.061 c 1.039,0 1.839,0.196 2.402,0.588 0.562,0.392 0.843,0.994 0.843,1.807 v 0.652 h -2.635 c 0,-0.368 -0.116,-0.628 -0.347,-0.78 -0.232,-0.151 -0.64,-0.227 -1.226,-0.227 h -1.049 c -0.576,0 -0.999,0.088 -1.268,0.262 -0.269,0.175 -0.404,0.456 -0.404,0.843 v 0.963 c 0,0.444 0.125,0.758 0.375,0.942 0.25,0.184 0.607,0.276 1.07,0.276 h 1.389 c 0.434,0 0.786,-0.064 1.056,-0.191 0.269,-0.127 0.404,-0.342 0.404,-0.645 v -0.17 h 2.635 v 0.637 c 0,0.463 -0.088,0.857 -0.262,1.183 -0.175,0.326 -0.413,0.583 -0.715,0.772 -0.302,0.189 -0.64,0.326 -1.013,0.411 -0.373,0.085 -0.768,0.128 -1.183,0.128 h -2.777 c -0.52,0 -0.99,-0.038 -1.41,-0.114 -0.421,-0.075 -0.805,-0.231 -1.155,-0.468 -0.349,-0.236 -0.626,-0.586 -0.829,-1.049 -0.203,-0.463 -0.305,-1.063 -0.305,-1.8 v -0.69 z"
|
1071 |
-
id="path40"
|
1072 |
-
inkscape:connector-curvature="0"
|
1073 |
-
style="fill:#e52d27" /><path
|
1074 |
-
d="m 185.553,83.978 c 0,-0.661 0.078,-1.212 0.234,-1.651 0.156,-0.439 0.38,-0.779 0.673,-1.02 0.293,-0.241 0.64,-0.411 1.042,-0.51 0.401,-0.099 0.866,-0.149 1.396,-0.149 h 1.899 c 0.755,0 1.386,0.048 1.891,0.142 0.505,0.094 0.919,0.255 1.24,0.482 0.321,0.227 0.56,0.541 0.716,0.942 0.156,0.402 0.234,0.919 0.234,1.551 v 1.219 h -6.603 v 0.439 c 0,0.368 0.13,0.624 0.39,0.765 0.26,0.142 0.687,0.213 1.282,0.213 h 0.836 c 0.359,0 0.642,-0.021 0.85,-0.064 0.208,-0.042 0.361,-0.101 0.461,-0.177 0.099,-0.076 0.163,-0.158 0.191,-0.248 0.028,-0.089 0.042,-0.2 0.042,-0.333 h 2.55 v 0.312 c 0,0.435 -0.09,0.799 -0.269,1.091 -0.18,0.293 -0.432,0.52 -0.758,0.68 -0.326,0.161 -0.701,0.274 -1.126,0.34 -0.425,0.066 -0.902,0.099 -1.431,0.099 h -2.04 c -0.52,0 -0.99,-0.038 -1.41,-0.114 -0.421,-0.075 -0.805,-0.231 -1.155,-0.468 -0.349,-0.236 -0.626,-0.586 -0.829,-1.049 -0.203,-0.463 -0.305,-1.063 -0.305,-1.8 v -0.692 z m 6.688,-0.609 c 0,-0.425 -0.127,-0.702 -0.383,-0.829 -0.255,-0.128 -0.789,-0.192 -1.601,-0.192 -0.473,0 -0.834,0.014 -1.084,0.042 -0.25,0.029 -0.442,0.076 -0.574,0.142 -0.133,0.066 -0.22,0.163 -0.262,0.291 -0.042,0.127 -0.064,0.309 -0.064,0.546 z"
|
1075 |
-
id="path42"
|
1076 |
-
inkscape:connector-curvature="0"
|
1077 |
-
style="fill:#e52d27" /><path
|
1078 |
-
d="m 196.223,83.723 c 0,-0.519 0.045,-0.959 0.135,-1.318 0.09,-0.359 0.267,-0.671 0.531,-0.935 0.264,-0.264 0.654,-0.468 1.169,-0.609 0.515,-0.142 1.193,-0.213 2.033,-0.213 h 0.808 c 0.302,0 0.586,0.024 0.85,0.071 0.264,0.047 0.51,0.125 0.737,0.234 0.227,0.109 0.416,0.258 0.567,0.446 0.151,0.189 0.245,0.421 0.283,0.695 h 0.028 V 77.73 h 2.72 v 10.259 h -2.55 v -1.332 h -0.028 c -0.161,0.473 -0.442,0.831 -0.843,1.077 -0.402,0.246 -0.994,0.369 -1.778,0.369 h -0.793 c -0.841,0 -1.518,-0.071 -2.033,-0.213 -0.515,-0.142 -0.905,-0.345 -1.169,-0.609 -0.265,-0.264 -0.442,-0.576 -0.531,-0.935 -0.09,-0.359 -0.135,-0.798 -0.135,-1.318 v -1.305 z m 2.635,1.077 c 0,0.454 0.087,0.777 0.262,0.971 0.175,0.194 0.565,0.291 1.169,0.291 h 1.601 c 0.576,0 0.994,-0.092 1.254,-0.276 0.26,-0.184 0.39,-0.536 0.39,-1.056 v -0.708 c 0,-0.52 -0.13,-0.871 -0.39,-1.056 -0.26,-0.184 -0.678,-0.276 -1.254,-0.276 h -1.601 c -0.604,0 -0.994,0.097 -1.169,0.29 -0.175,0.194 -0.262,0.517 -0.262,0.971 z"
|
1079 |
-
id="path44"
|
1080 |
-
inkscape:connector-curvature="0"
|
1081 |
-
style="fill:#e52d27" /><path
|
1082 |
-
d="m 215.082,77.729 h 9.493 c 0.595,0 1.091,0.071 1.488,0.213 0.397,0.142 0.711,0.345 0.942,0.609 0.231,0.264 0.397,0.581 0.496,0.949 0.099,0.368 0.149,0.793 0.149,1.275 v 0.652 c 0,0.737 -0.12,1.301 -0.361,1.693 -0.241,0.392 -0.706,0.669 -1.396,0.829 v 0.029 c 0.264,0.047 0.496,0.116 0.694,0.205 0.198,0.09 0.376,0.215 0.531,0.376 0.156,0.161 0.276,0.38 0.361,0.659 0.085,0.279 0.128,0.621 0.128,1.027 v 1.743 h -3.146 v -1.233 c 0,-0.539 -0.092,-0.911 -0.276,-1.119 -0.184,-0.208 -0.522,-0.312 -1.013,-0.312 h -4.945 v 2.664 h -3.145 z m 3.145,5.045 h 5.2 c 0.416,0 0.713,-0.085 0.893,-0.255 0.179,-0.17 0.269,-0.444 0.269,-0.822 v -0.34 c 0,-0.434 -0.109,-0.722 -0.326,-0.864 -0.217,-0.142 -0.59,-0.213 -1.119,-0.213 h -4.917 z"
|
1083 |
-
id="path46"
|
1084 |
-
inkscape:connector-curvature="0"
|
1085 |
-
style="filter:url(#filter33080)" /><path
|
1086 |
-
d="m 229.308,83.978 c 0,-0.661 0.078,-1.212 0.234,-1.651 0.156,-0.439 0.38,-0.779 0.673,-1.02 0.293,-0.241 0.64,-0.411 1.042,-0.51 0.401,-0.099 0.866,-0.149 1.396,-0.149 h 1.899 c 0.755,0 1.386,0.048 1.891,0.142 0.505,0.094 0.919,0.255 1.24,0.482 0.321,0.227 0.56,0.541 0.716,0.942 0.156,0.402 0.234,0.919 0.234,1.551 v 1.219 h -6.603 v 0.439 c 0,0.368 0.13,0.624 0.39,0.765 0.26,0.142 0.687,0.213 1.282,0.213 h 0.836 c 0.359,0 0.642,-0.021 0.85,-0.064 0.208,-0.042 0.361,-0.101 0.461,-0.177 0.099,-0.076 0.163,-0.158 0.191,-0.248 0.028,-0.089 0.042,-0.2 0.042,-0.333 h 2.551 v 0.312 c 0,0.435 -0.09,0.799 -0.269,1.091 -0.18,0.293 -0.432,0.52 -0.758,0.68 -0.326,0.161 -0.701,0.274 -1.126,0.34 -0.425,0.066 -0.902,0.099 -1.431,0.099 h -2.04 c -0.52,0 -0.99,-0.038 -1.41,-0.114 -0.421,-0.075 -0.806,-0.231 -1.155,-0.468 -0.349,-0.236 -0.626,-0.586 -0.829,-1.049 -0.203,-0.463 -0.305,-1.063 -0.305,-1.8 v -0.692 z m 6.688,-0.609 c 0,-0.425 -0.127,-0.702 -0.383,-0.829 -0.255,-0.128 -0.789,-0.192 -1.601,-0.192 -0.473,0 -0.834,0.014 -1.084,0.042 -0.25,0.029 -0.442,0.076 -0.574,0.142 -0.133,0.066 -0.22,0.163 -0.262,0.291 -0.042,0.127 -0.064,0.309 -0.064,0.546 z"
|
1087 |
-
id="path48"
|
1088 |
-
inkscape:connector-curvature="0"
|
1089 |
-
style="filter:url(#filter33032)" /><path
|
1090 |
-
d="m 242.698,85.735 c 0,0.113 0.016,0.208 0.049,0.283 0.033,0.075 0.106,0.142 0.22,0.198 0.113,0.057 0.286,0.102 0.517,0.135 0.231,0.033 0.532,0.05 0.9,0.05 h 0.964 c 0.652,0 1.084,-0.036 1.296,-0.107 0.212,-0.071 0.319,-0.215 0.319,-0.432 0,-0.217 -0.08,-0.37 -0.241,-0.461 -0.161,-0.09 -0.472,-0.134 -0.935,-0.134 h -2.55 c -0.652,-0.01 -1.186,-0.055 -1.601,-0.135 -0.416,-0.08 -0.746,-0.215 -0.992,-0.404 -0.246,-0.189 -0.423,-0.444 -0.531,-0.765 -0.109,-0.321 -0.163,-0.737 -0.163,-1.247 0,-0.435 0.082,-0.791 0.248,-1.07 0.165,-0.279 0.394,-0.489 0.687,-0.631 0.293,-0.142 0.633,-0.238 1.02,-0.29 0.387,-0.052 0.841,-0.078 1.361,-0.078 h 1.898 c 0.907,0 1.632,0.036 2.175,0.107 0.543,0.071 0.961,0.189 1.254,0.354 0.293,0.165 0.494,0.383 0.602,0.652 0.108,0.269 0.167,0.63 0.177,1.084 h -2.72 c -0.038,-0.114 -0.09,-0.201 -0.156,-0.262 -0.066,-0.062 -0.168,-0.111 -0.305,-0.149 -0.137,-0.038 -0.324,-0.062 -0.559,-0.071 -0.237,-0.009 -0.572,-0.014 -1.006,-0.014 -0.803,0 -1.315,0.029 -1.537,0.085 -0.222,0.056 -0.333,0.208 -0.333,0.453 0,0.161 0.101,0.272 0.305,0.333 0.203,0.062 0.645,0.092 1.325,0.092 h 1.885 c 0.784,0 1.414,0.062 1.892,0.184 0.477,0.123 0.829,0.29 1.056,0.503 0.227,0.212 0.375,0.451 0.446,0.715 0.071,0.265 0.106,0.591 0.106,0.978 0,0.491 -0.059,0.89 -0.177,1.197 -0.118,0.307 -0.316,0.548 -0.595,0.722 -0.279,0.175 -0.664,0.3 -1.155,0.376 -0.491,0.075 -1.139,0.114 -1.941,0.114 h -2.579 c -1.266,0 -2.154,-0.172 -2.664,-0.517 -0.51,-0.345 -0.765,-0.961 -0.765,-1.849 h 2.803 z"
|
1091 |
-
id="path50"
|
1092 |
-
inkscape:connector-curvature="0"
|
1093 |
-
style="filter:url(#filter33048)" /><path
|
1094 |
-
d="m 251.37,80.762 h 2.635 v 1.077 h 0.029 c 0.198,-0.368 0.491,-0.659 0.878,-0.871 0.387,-0.212 0.945,-0.319 1.672,-0.319 h 0.779 c 0.841,0 1.518,0.071 2.034,0.213 0.515,0.142 0.904,0.345 1.169,0.609 0.264,0.264 0.441,0.576 0.531,0.935 0.09,0.359 0.135,0.799 0.135,1.318 v 1.304 c 0,0.52 -0.045,0.959 -0.135,1.318 -0.09,0.359 -0.267,0.671 -0.531,0.935 -0.265,0.265 -0.654,0.468 -1.169,0.609 -0.515,0.142 -1.193,0.213 -2.034,0.213 h -0.552 c -0.406,0 -0.742,-0.019 -1.006,-0.057 -0.264,-0.038 -0.496,-0.104 -0.694,-0.198 -0.198,-0.094 -0.375,-0.229 -0.531,-0.404 -0.156,-0.175 -0.31,-0.409 -0.461,-0.702 h -0.028 v 3.769 h -2.721 z m 2.72,3.967 c 0,0.52 0.13,0.871 0.39,1.056 0.26,0.184 0.678,0.276 1.254,0.276 h 1.431 c 0.604,0 0.994,-0.097 1.169,-0.291 0.175,-0.193 0.262,-0.517 0.262,-0.971 v -0.85 c 0,-0.453 -0.088,-0.777 -0.262,-0.971 -0.175,-0.193 -0.565,-0.29 -1.169,-0.29 h -1.431 c -0.576,0 -0.994,0.092 -1.254,0.276 -0.26,0.184 -0.39,0.536 -0.39,1.056 z"
|
1095 |
-
id="path52"
|
1096 |
-
inkscape:connector-curvature="0"
|
1097 |
-
style="filter:url(#filter33016)" /><path
|
1098 |
-
d="m 262.733,83.511 c 0,-0.567 0.085,-1.039 0.255,-1.417 0.17,-0.378 0.399,-0.673 0.687,-0.886 0.288,-0.213 0.604,-0.359 0.949,-0.439 0.345,-0.08 0.711,-0.12 1.098,-0.12 h 4.067 c 0.387,0 0.753,0.04 1.098,0.12 0.345,0.081 0.661,0.227 0.949,0.439 0.288,0.212 0.517,0.508 0.687,0.886 0.17,0.378 0.255,0.85 0.255,1.417 v 1.729 c 0,0.567 -0.085,1.039 -0.255,1.417 -0.17,0.378 -0.399,0.673 -0.687,0.886 -0.288,0.212 -0.604,0.359 -0.949,0.439 -0.345,0.08 -0.711,0.12 -1.098,0.12 h -4.067 c -0.387,0 -0.754,-0.04 -1.098,-0.12 -0.345,-0.08 -0.662,-0.227 -0.949,-0.439 -0.289,-0.213 -0.517,-0.508 -0.687,-0.886 -0.17,-0.378 -0.255,-0.85 -0.255,-1.417 z m 2.721,1.204 c 0,0.501 0.146,0.85 0.439,1.049 0.293,0.198 0.765,0.298 1.417,0.298 h 0.652 c 0.453,0 0.815,-0.019 1.084,-0.057 0.269,-0.038 0.477,-0.099 0.624,-0.184 0.146,-0.085 0.248,-0.201 0.305,-0.347 0.057,-0.146 0.085,-0.347 0.085,-0.602 V 83.88 c 0,-0.255 -0.028,-0.458 -0.085,-0.609 -0.057,-0.151 -0.158,-0.269 -0.305,-0.354 -0.146,-0.085 -0.354,-0.144 -0.624,-0.177 -0.269,-0.033 -0.63,-0.05 -1.084,-0.05 h -0.652 c -0.652,0 -1.124,0.099 -1.417,0.298 -0.293,0.199 -0.439,0.548 -0.439,1.049 z"
|
1099 |
-
id="path54"
|
1100 |
-
inkscape:connector-curvature="0"
|
1101 |
-
style="filter:url(#filter32984)" /><path
|
1102 |
-
d="m 274.465,80.762 h 2.721 v 1.162 h 0.028 c 0.227,-0.482 0.572,-0.815 1.034,-0.999 0.463,-0.184 1.082,-0.276 1.856,-0.276 0.567,0 1.063,0.026 1.488,0.078 0.425,0.052 0.834,0.177 1.226,0.376 0.392,0.198 0.711,0.52 0.956,0.963 0.246,0.444 0.368,1.034 0.368,1.771 v 4.152 h -2.72 v -4.152 c 0,-0.708 -0.586,-1.063 -1.757,-1.063 h -0.624 c -0.586,0 -1.041,0.135 -1.367,0.404 -0.326,0.269 -0.489,0.659 -0.489,1.169 v 3.642 h -2.721 v -7.227 z"
|
1103 |
-
id="path56"
|
1104 |
-
inkscape:connector-curvature="0"
|
1105 |
-
style="filter:url(#filter33000)" /><path
|
1106 |
-
d="m 288.55,85.735 c 0,0.113 0.016,0.208 0.049,0.283 0.033,0.075 0.106,0.142 0.22,0.198 0.113,0.057 0.286,0.102 0.517,0.135 0.231,0.033 0.532,0.05 0.9,0.05 h 0.964 c 0.652,0 1.084,-0.036 1.297,-0.107 0.212,-0.071 0.319,-0.215 0.319,-0.432 0,-0.217 -0.08,-0.37 -0.241,-0.461 -0.161,-0.09 -0.472,-0.134 -0.935,-0.134 h -2.551 c -0.652,-0.01 -1.186,-0.055 -1.601,-0.135 -0.416,-0.08 -0.746,-0.215 -0.992,-0.404 -0.246,-0.189 -0.423,-0.444 -0.531,-0.765 -0.109,-0.321 -0.163,-0.737 -0.163,-1.247 0,-0.435 0.082,-0.791 0.248,-1.07 0.165,-0.279 0.394,-0.489 0.687,-0.631 0.293,-0.142 0.633,-0.238 1.02,-0.29 0.387,-0.052 0.841,-0.078 1.361,-0.078 h 1.898 c 0.907,0 1.632,0.036 2.175,0.107 0.543,0.071 0.961,0.189 1.254,0.354 0.293,0.165 0.494,0.383 0.602,0.652 0.108,0.269 0.167,0.63 0.177,1.084 h -2.72 c -0.038,-0.114 -0.09,-0.201 -0.156,-0.262 -0.066,-0.062 -0.168,-0.111 -0.305,-0.149 -0.137,-0.038 -0.324,-0.062 -0.559,-0.071 -0.237,-0.009 -0.572,-0.014 -1.006,-0.014 -0.803,0 -1.316,0.029 -1.537,0.085 -0.222,0.056 -0.333,0.208 -0.333,0.453 0,0.161 0.101,0.272 0.305,0.333 0.203,0.062 0.645,0.092 1.325,0.092 h 1.885 c 0.784,0 1.414,0.062 1.892,0.184 0.477,0.123 0.829,0.29 1.056,0.503 0.227,0.212 0.375,0.451 0.446,0.715 0.071,0.265 0.106,0.591 0.106,0.978 0,0.491 -0.059,0.89 -0.177,1.197 -0.118,0.307 -0.316,0.548 -0.595,0.722 -0.279,0.175 -0.664,0.3 -1.155,0.376 -0.491,0.075 -1.139,0.114 -1.941,0.114 h -2.579 c -1.266,0 -2.154,-0.172 -2.664,-0.517 -0.51,-0.345 -0.765,-0.961 -0.765,-1.849 h 2.803 z"
|
1107 |
-
id="path58"
|
1108 |
-
inkscape:connector-curvature="0"
|
1109 |
-
style="filter:url(#filter32968)" /><path
|
1110 |
-
d="m 300.097,79.855 h -2.72 V 77.73 h 2.72 z m 0,8.133 h -2.72 v -7.226 h 2.72 z"
|
1111 |
-
id="path60"
|
1112 |
-
inkscape:connector-curvature="0"
|
1113 |
-
style="filter:url(#filter32920)" /><path
|
1114 |
-
d="m 301.274,80.762 h 2.962 l 2.21,5.101 2.21,-5.101 h 2.961 l -3.471,7.226 h -3.401 z"
|
1115 |
-
id="path62"
|
1116 |
-
inkscape:connector-curvature="0"
|
1117 |
-
style="filter:url(#filter32952)" /><path
|
1118 |
-
d="m 312.298,83.978 c 0,-0.661 0.078,-1.212 0.234,-1.651 0.156,-0.439 0.38,-0.779 0.673,-1.02 0.293,-0.241 0.64,-0.411 1.042,-0.51 0.401,-0.099 0.866,-0.149 1.396,-0.149 h 1.899 c 0.755,0 1.386,0.048 1.891,0.142 0.505,0.094 0.919,0.255 1.24,0.482 0.321,0.227 0.56,0.541 0.716,0.942 0.156,0.402 0.234,0.919 0.234,1.551 v 1.219 h -6.603 v 0.439 c 0,0.368 0.13,0.624 0.39,0.765 0.26,0.142 0.687,0.213 1.282,0.213 h 0.836 c 0.359,0 0.642,-0.021 0.85,-0.064 0.208,-0.042 0.361,-0.101 0.461,-0.177 0.099,-0.076 0.163,-0.158 0.191,-0.248 0.028,-0.089 0.042,-0.2 0.042,-0.333 h 2.55 v 0.312 c 0,0.435 -0.09,0.799 -0.269,1.091 -0.18,0.293 -0.432,0.52 -0.758,0.68 -0.326,0.161 -0.701,0.274 -1.126,0.34 -0.425,0.066 -0.902,0.099 -1.431,0.099 h -2.04 c -0.52,0 -0.99,-0.038 -1.41,-0.114 -0.421,-0.075 -0.805,-0.231 -1.155,-0.468 -0.349,-0.236 -0.626,-0.586 -0.829,-1.049 -0.203,-0.463 -0.305,-1.063 -0.305,-1.8 v -0.692 z m 6.688,-0.609 c 0,-0.425 -0.127,-0.702 -0.383,-0.829 -0.255,-0.128 -0.789,-0.192 -1.601,-0.192 -0.473,0 -0.834,0.014 -1.084,0.042 -0.25,0.029 -0.442,0.076 -0.574,0.142 -0.133,0.066 -0.22,0.163 -0.262,0.291 -0.042,0.127 -0.064,0.309 -0.064,0.546 z"
|
1119 |
-
id="path64"
|
1120 |
-
inkscape:connector-curvature="0"
|
1121 |
-
style="filter:url(#filter32936)" /><path
|
1122 |
-
d="m 329.287,77.729 h 3.443 l 4.01,7.623 4.01,-7.623 h 3.443 l -5.512,10.259 h -3.883 z"
|
1123 |
-
id="path66"
|
1124 |
-
inkscape:connector-curvature="0"
|
1125 |
-
style="fill:#e52d27" /><path
|
1126 |
-
d="m 347.551,79.855 h -2.72 V 77.73 h 2.72 z m 0,8.133 h -2.72 v -7.226 h 2.72 z"
|
1127 |
-
id="path68"
|
1128 |
-
inkscape:connector-curvature="0"
|
1129 |
-
style="fill:#e52d27" /><path
|
1130 |
-
d="m 349.393,83.723 c 0,-0.519 0.045,-0.959 0.135,-1.318 0.09,-0.359 0.267,-0.671 0.531,-0.935 0.264,-0.264 0.654,-0.468 1.169,-0.609 0.515,-0.142 1.193,-0.213 2.033,-0.213 h 0.808 c 0.302,0 0.586,0.024 0.85,0.071 0.264,0.047 0.51,0.125 0.737,0.234 0.227,0.109 0.416,0.258 0.567,0.446 0.151,0.189 0.245,0.421 0.283,0.695 h 0.028 V 77.73 h 2.72 v 10.259 h -2.55 v -1.332 h -0.028 c -0.161,0.473 -0.442,0.831 -0.843,1.077 -0.402,0.246 -0.994,0.369 -1.778,0.369 h -0.793 c -0.841,0 -1.518,-0.071 -2.033,-0.213 -0.515,-0.142 -0.905,-0.345 -1.169,-0.609 -0.265,-0.264 -0.442,-0.576 -0.531,-0.935 -0.09,-0.359 -0.135,-0.798 -0.135,-1.318 v -1.305 z m 2.635,1.077 c 0,0.454 0.087,0.777 0.262,0.971 0.175,0.194 0.565,0.291 1.169,0.291 h 1.601 c 0.576,0 0.994,-0.092 1.254,-0.276 0.26,-0.184 0.39,-0.536 0.39,-1.056 v -0.708 c 0,-0.52 -0.13,-0.871 -0.39,-1.056 -0.26,-0.184 -0.678,-0.276 -1.254,-0.276 h -1.601 c -0.604,0 -0.994,0.097 -1.169,0.29 -0.175,0.194 -0.262,0.517 -0.262,0.971 z"
|
1131 |
-
id="path70"
|
1132 |
-
inkscape:connector-curvature="0"
|
1133 |
-
style="fill:#e52d27" /><path
|
1134 |
-
d="m 360.785,83.978 c 0,-0.661 0.078,-1.212 0.234,-1.651 0.156,-0.439 0.38,-0.779 0.673,-1.02 0.293,-0.241 0.64,-0.411 1.042,-0.51 0.401,-0.099 0.866,-0.149 1.396,-0.149 h 1.899 c 0.755,0 1.386,0.048 1.891,0.142 0.505,0.094 0.919,0.255 1.24,0.482 0.321,0.227 0.56,0.541 0.716,0.942 0.156,0.402 0.234,0.919 0.234,1.551 v 1.219 h -6.603 v 0.439 c 0,0.368 0.13,0.624 0.39,0.765 0.26,0.142 0.687,0.213 1.282,0.213 h 0.836 c 0.359,0 0.642,-0.021 0.85,-0.064 0.208,-0.042 0.361,-0.101 0.461,-0.177 0.099,-0.076 0.163,-0.158 0.191,-0.248 0.028,-0.089 0.042,-0.2 0.042,-0.333 h 2.55 v 0.312 c 0,0.435 -0.09,0.799 -0.269,1.091 -0.18,0.293 -0.432,0.52 -0.758,0.68 -0.326,0.161 -0.701,0.274 -1.126,0.34 -0.425,0.066 -0.902,0.099 -1.431,0.099 h -2.041 c -0.52,0 -0.99,-0.038 -1.41,-0.114 -0.421,-0.075 -0.805,-0.231 -1.155,-0.468 -0.349,-0.236 -0.626,-0.586 -0.829,-1.049 -0.203,-0.463 -0.305,-1.063 -0.305,-1.8 z m 6.688,-0.609 c 0,-0.425 -0.127,-0.702 -0.383,-0.829 -0.255,-0.128 -0.789,-0.192 -1.601,-0.192 -0.473,0 -0.834,0.014 -1.084,0.042 -0.25,0.029 -0.442,0.076 -0.574,0.142 -0.133,0.066 -0.22,0.163 -0.262,0.291 -0.042,0.127 -0.064,0.309 -0.064,0.546 z"
|
1135 |
-
id="path72"
|
1136 |
-
inkscape:connector-curvature="0"
|
1137 |
-
style="fill:#e52d27" /><path
|
1138 |
-
d="m 371.455,83.511 c 0,-0.567 0.085,-1.039 0.255,-1.417 0.17,-0.378 0.399,-0.673 0.687,-0.886 0.288,-0.213 0.604,-0.359 0.949,-0.439 0.345,-0.08 0.711,-0.12 1.098,-0.12 h 4.067 c 0.387,0 0.753,0.04 1.098,0.12 0.345,0.081 0.661,0.227 0.949,0.439 0.288,0.212 0.517,0.508 0.687,0.886 0.17,0.378 0.255,0.85 0.255,1.417 v 1.729 c 0,0.567 -0.085,1.039 -0.255,1.417 -0.17,0.378 -0.399,0.673 -0.687,0.886 -0.288,0.212 -0.604,0.359 -0.949,0.439 -0.345,0.08 -0.711,0.12 -1.098,0.12 h -4.067 c -0.387,0 -0.754,-0.04 -1.098,-0.12 -0.345,-0.08 -0.662,-0.227 -0.949,-0.439 -0.289,-0.213 -0.517,-0.508 -0.687,-0.886 -0.17,-0.378 -0.255,-0.85 -0.255,-1.417 z m 2.72,1.204 c 0,0.501 0.146,0.85 0.439,1.049 0.293,0.198 0.765,0.298 1.417,0.298 h 0.652 c 0.453,0 0.815,-0.019 1.084,-0.057 0.269,-0.038 0.477,-0.099 0.624,-0.184 0.146,-0.085 0.248,-0.201 0.305,-0.347 0.057,-0.146 0.085,-0.347 0.085,-0.602 V 83.88 c 0,-0.255 -0.028,-0.458 -0.085,-0.609 -0.057,-0.151 -0.158,-0.269 -0.305,-0.354 -0.146,-0.085 -0.354,-0.144 -0.624,-0.177 -0.269,-0.033 -0.63,-0.05 -1.084,-0.05 h -0.652 c -0.652,0 -1.124,0.099 -1.417,0.298 -0.293,0.199 -0.439,0.548 -0.439,1.049 z"
|
1139 |
-
id="path74"
|
1140 |
-
inkscape:connector-curvature="0"
|
1141 |
-
style="fill:#e52d27" /><path
|
1142 |
-
d="m 390.314,77.729 h 11.222 v 2.381 h -8.077 v 1.644 h 7.651 v 2.125 h -7.651 v 1.644 h 8.261 v 2.466 h -11.406 z"
|
1143 |
-
id="path76"
|
1144 |
-
inkscape:connector-curvature="0"
|
1145 |
-
style="filter:url(#filter32904)" /><path
|
1146 |
-
d="m 403.364,80.762 h 2.593 v 1.417 h 0.028 c 0.066,-0.5 0.312,-0.881 0.737,-1.141 0.425,-0.26 0.982,-0.39 1.672,-0.39 h 1.034 c 1.275,0 2.168,0.562 2.678,1.686 0.227,-0.652 0.52,-1.096 0.878,-1.332 0.359,-0.236 0.926,-0.354 1.7,-0.354 h 0.836 c 1.199,0 2.062,0.276 2.586,0.829 0.524,0.553 0.786,1.368 0.786,2.444 v 4.067 h -2.72 v -3.883 c 0,-0.264 -0.024,-0.479 -0.071,-0.645 -0.047,-0.165 -0.132,-0.295 -0.255,-0.39 -0.246,-0.198 -0.751,-0.298 -1.516,-0.298 -0.671,0 -1.146,0.09 -1.424,0.269 -0.279,0.179 -0.418,0.5 -0.418,0.963 v 3.982 h -2.721 v -4.095 c 0,-0.236 -0.026,-0.425 -0.078,-0.567 -0.052,-0.142 -0.149,-0.253 -0.291,-0.333 -0.142,-0.08 -0.338,-0.137 -0.588,-0.17 -0.25,-0.033 -0.588,-0.05 -1.013,-0.05 -0.604,0 -1.041,0.099 -1.311,0.298 -0.269,0.198 -0.404,0.567 -0.404,1.105 v 3.811 h -2.72 v -7.223 z"
|
1147 |
-
id="path78"
|
1148 |
-
inkscape:connector-curvature="0"
|
1149 |
-
style="filter:url(#filter32888)" /><path
|
1150 |
-
d="m 420.636,77.729 h 2.721 v 4.364 h 0.028 c 0.038,-0.274 0.132,-0.505 0.283,-0.695 0.151,-0.189 0.338,-0.338 0.56,-0.446 0.222,-0.108 0.468,-0.186 0.737,-0.234 0.269,-0.048 0.555,-0.071 0.857,-0.071 h 0.807 c 0.841,0 1.518,0.071 2.034,0.213 0.515,0.142 0.904,0.345 1.169,0.609 0.264,0.264 0.441,0.576 0.531,0.935 0.09,0.359 0.135,0.799 0.135,1.318 v 1.304 c 0,0.52 -0.045,0.959 -0.135,1.318 -0.09,0.359 -0.267,0.671 -0.531,0.935 -0.265,0.265 -0.654,0.468 -1.169,0.609 -0.515,0.142 -1.193,0.213 -2.034,0.213 h -0.793 c -0.784,0 -1.377,-0.123 -1.778,-0.369 -0.402,-0.245 -0.682,-0.604 -0.843,-1.077 h -0.029 v 1.332 h -2.55 z m 2.551,7 c 0,0.52 0.13,0.871 0.39,1.056 0.26,0.184 0.677,0.276 1.254,0.276 h 1.601 c 0.604,0 0.994,-0.097 1.169,-0.291 0.175,-0.193 0.262,-0.517 0.262,-0.971 v -0.85 c 0,-0.453 -0.087,-0.777 -0.262,-0.971 -0.175,-0.193 -0.565,-0.29 -1.169,-0.29 h -1.601 c -0.576,0 -0.994,0.092 -1.254,0.276 -0.26,0.184 -0.39,0.536 -0.39,1.056 z"
|
1151 |
-
id="path80"
|
1152 |
-
inkscape:connector-curvature="0"
|
1153 |
-
style="filter:url(#filter32872)" /><path
|
1154 |
-
d="m 431.844,83.978 c 0,-0.661 0.078,-1.212 0.234,-1.651 0.156,-0.439 0.38,-0.779 0.673,-1.02 0.293,-0.241 0.64,-0.411 1.042,-0.51 0.401,-0.099 0.866,-0.149 1.396,-0.149 h 1.899 c 0.755,0 1.386,0.048 1.891,0.142 0.505,0.094 0.919,0.255 1.24,0.482 0.321,0.227 0.56,0.541 0.716,0.942 0.156,0.402 0.234,0.919 0.234,1.551 v 1.219 h -6.603 v 0.439 c 0,0.368 0.13,0.624 0.39,0.765 0.26,0.142 0.687,0.213 1.282,0.213 h 0.836 c 0.359,0 0.642,-0.021 0.85,-0.064 0.208,-0.042 0.361,-0.101 0.461,-0.177 0.099,-0.076 0.163,-0.158 0.191,-0.248 0.028,-0.089 0.042,-0.2 0.042,-0.333 h 2.55 v 0.312 c 0,0.435 -0.09,0.799 -0.269,1.091 -0.18,0.293 -0.432,0.52 -0.758,0.68 -0.326,0.161 -0.701,0.274 -1.126,0.34 -0.425,0.066 -0.902,0.099 -1.431,0.099 h -2.04 c -0.52,0 -0.99,-0.038 -1.41,-0.114 -0.421,-0.075 -0.805,-0.231 -1.155,-0.468 -0.349,-0.236 -0.626,-0.586 -0.829,-1.049 -0.203,-0.463 -0.305,-1.063 -0.305,-1.8 v -0.692 z m 6.688,-0.609 c 0,-0.425 -0.127,-0.702 -0.383,-0.829 -0.255,-0.128 -0.789,-0.192 -1.601,-0.192 -0.473,0 -0.834,0.014 -1.084,0.042 -0.25,0.029 -0.442,0.076 -0.574,0.142 -0.133,0.066 -0.22,0.163 -0.262,0.291 -0.042,0.127 -0.064,0.309 -0.064,0.546 z"
|
1155 |
-
id="path82"
|
1156 |
-
inkscape:connector-curvature="0"
|
1157 |
-
style="filter:url(#filter32856)" /><path
|
1158 |
-
d="m 442.514,83.723 c 0,-0.519 0.045,-0.959 0.135,-1.318 0.09,-0.359 0.267,-0.671 0.531,-0.935 0.264,-0.264 0.654,-0.468 1.169,-0.609 0.515,-0.142 1.193,-0.213 2.033,-0.213 h 0.808 c 0.302,0 0.586,0.024 0.85,0.071 0.264,0.047 0.51,0.125 0.737,0.234 0.227,0.109 0.416,0.258 0.567,0.446 0.151,0.189 0.245,0.421 0.283,0.695 h 0.028 V 77.73 h 2.72 v 10.259 h -2.55 v -1.332 h -0.028 c -0.161,0.473 -0.442,0.831 -0.843,1.077 -0.402,0.246 -0.994,0.369 -1.778,0.369 h -0.793 c -0.841,0 -1.518,-0.071 -2.033,-0.213 -0.515,-0.142 -0.905,-0.345 -1.169,-0.609 -0.265,-0.264 -0.442,-0.576 -0.531,-0.935 -0.09,-0.359 -0.135,-0.798 -0.135,-1.318 v -1.305 z m 2.635,1.077 c 0,0.454 0.087,0.777 0.262,0.971 0.175,0.194 0.565,0.291 1.169,0.291 h 1.601 c 0.576,0 0.994,-0.092 1.254,-0.276 0.26,-0.184 0.39,-0.536 0.39,-1.056 v -0.708 c 0,-0.52 -0.13,-0.871 -0.39,-1.056 -0.26,-0.184 -0.678,-0.276 -1.254,-0.276 h -1.601 c -0.604,0 -0.994,0.097 -1.169,0.29 -0.175,0.194 -0.262,0.517 -0.262,0.971 z"
|
1159 |
-
id="path84"
|
1160 |
-
inkscape:connector-curvature="0"
|
1161 |
-
style="filter:url(#filter32840)" /><path
|
1162 |
-
d="m 454.062,83.723 c 0,-0.519 0.045,-0.959 0.135,-1.318 0.09,-0.359 0.267,-0.671 0.531,-0.935 0.264,-0.264 0.654,-0.468 1.169,-0.609 0.515,-0.142 1.193,-0.213 2.033,-0.213 h 0.808 c 0.302,0 0.586,0.024 0.85,0.071 0.264,0.047 0.51,0.125 0.737,0.234 0.227,0.109 0.416,0.258 0.567,0.446 0.151,0.189 0.245,0.421 0.283,0.695 h 0.028 V 77.73 h 2.72 v 10.259 h -2.55 v -1.332 h -0.028 c -0.161,0.473 -0.442,0.831 -0.843,1.077 -0.402,0.246 -0.994,0.369 -1.778,0.369 h -0.793 c -0.841,0 -1.518,-0.071 -2.033,-0.213 -0.515,-0.142 -0.905,-0.345 -1.169,-0.609 -0.265,-0.264 -0.442,-0.576 -0.531,-0.935 -0.09,-0.359 -0.135,-0.798 -0.135,-1.318 v -1.305 z m 2.635,1.077 c 0,0.454 0.088,0.777 0.262,0.971 0.175,0.194 0.565,0.291 1.169,0.291 h 1.601 c 0.576,0 0.994,-0.092 1.254,-0.276 0.26,-0.184 0.39,-0.536 0.39,-1.056 v -0.708 c 0,-0.52 -0.13,-0.871 -0.39,-1.056 -0.26,-0.184 -0.678,-0.276 -1.254,-0.276 h -1.601 c -0.604,0 -0.994,0.097 -1.169,0.29 -0.175,0.194 -0.262,0.517 -0.262,0.971 z"
|
1163 |
-
id="path86"
|
1164 |
-
inkscape:connector-curvature="0"
|
1165 |
-
style="filter:url(#filter32824)" /><path
|
1166 |
-
d="m 465.454,83.978 c 0,-0.661 0.078,-1.212 0.234,-1.651 0.156,-0.439 0.38,-0.779 0.673,-1.02 0.293,-0.241 0.64,-0.411 1.042,-0.51 0.401,-0.099 0.866,-0.149 1.396,-0.149 h 1.899 c 0.755,0 1.386,0.048 1.891,0.142 0.505,0.094 0.919,0.255 1.24,0.482 0.321,0.227 0.56,0.541 0.716,0.942 0.156,0.402 0.234,0.919 0.234,1.551 v 1.219 h -6.603 v 0.439 c 0,0.368 0.13,0.624 0.39,0.765 0.26,0.142 0.687,0.213 1.282,0.213 h 0.836 c 0.359,0 0.642,-0.021 0.85,-0.064 0.208,-0.042 0.361,-0.101 0.461,-0.177 0.099,-0.076 0.163,-0.158 0.191,-0.248 0.028,-0.089 0.042,-0.2 0.042,-0.333 h 2.551 v 0.312 c 0,0.435 -0.09,0.799 -0.269,1.091 -0.18,0.293 -0.432,0.52 -0.758,0.68 -0.326,0.161 -0.701,0.274 -1.126,0.34 -0.425,0.066 -0.902,0.099 -1.431,0.099 h -2.04 c -0.52,0 -0.99,-0.038 -1.41,-0.114 -0.421,-0.075 -0.806,-0.231 -1.155,-0.468 -0.349,-0.236 -0.626,-0.586 -0.829,-1.049 -0.203,-0.463 -0.305,-1.063 -0.305,-1.8 v -0.692 z m 6.688,-0.609 c 0,-0.425 -0.127,-0.702 -0.383,-0.829 -0.255,-0.128 -0.789,-0.192 -1.601,-0.192 -0.473,0 -0.834,0.014 -1.084,0.042 -0.25,0.029 -0.442,0.076 -0.574,0.142 -0.133,0.066 -0.22,0.163 -0.262,0.291 -0.042,0.127 -0.064,0.309 -0.064,0.546 z"
|
1167 |
-
id="path88"
|
1168 |
-
inkscape:connector-curvature="0"
|
1169 |
-
style="filter:url(#filter32808)" /><path
|
1170 |
-
d="m 476.307,80.762 h 2.551 v 1.374 h 0.029 c 0.142,-0.539 0.448,-0.921 0.921,-1.148 0.472,-0.227 1.049,-0.34 1.729,-0.34 0.982,0 1.688,0.224 2.118,0.673 0.43,0.448 0.645,1.174 0.645,2.175 0,0.104 0,0.269 -0.014,0.496 -0.01,0.056 -0.014,0.104 -0.014,0.142 h -2.352 c 0,-0.491 -0.088,-0.841 -0.262,-1.049 -0.175,-0.208 -0.522,-0.312 -1.042,-0.312 -0.491,0 -0.878,0.099 -1.162,0.298 -0.283,0.198 -0.425,0.506 -0.425,0.921 v 3.996 h -2.721 v -7.226 z"
|
1171 |
-
id="path90"
|
1172 |
-
inkscape:connector-curvature="0"
|
1173 |
-
style="filter:url(#filter32792)" /><g
|
1174 |
-
id="g98"
|
1175 |
-
transform="translate(-557.291,-552.87)"
|
1176 |
-
style="filter:url(#filter32776)"><g
|
1177 |
-
id="g96"><rect
|
1178 |
-
id="rect94"
|
1179 |
-
height="1.5"
|
1180 |
-
width="372.21399"
|
1181 |
-
y="645.63"
|
1182 |
-
x="670.49597" /></g></g><path
|
1183 |
-
style="fill:#e52d27"
|
1184 |
-
inkscape:connector-curvature="0"
|
1185 |
-
id="path104"
|
1186 |
-
d="M 0,0 V 94.219 H 94.219 V 0 Z m 69.557,53.611 -38,21.635 c -4.582,2.609 -8.331,0.429 -8.331,-4.844 v -43.07 c 0,-5.273 3.749,-7.452 8.331,-4.844 l 38,21.635 c 4.582,2.61 4.582,6.879 0,9.488 z" /><g
|
1187 |
-
id="g116"
|
1188 |
-
transform="translate(-557.291,-552.87)"><path
|
1189 |
-
style="fill:#e52d27"
|
1190 |
-
inkscape:connector-curvature="0"
|
1191 |
-
id="path106"
|
1192 |
-
d="m 589.951,590.727 c -4.731,0 -1.304,0 -6.035,0 -2.84,0 -2.84,4.404 0,4.404 4.731,0 1.304,0 6.035,0 2.84,0 2.84,-4.404 0,-4.404 z" /><path
|
1193 |
-
style="fill:#e52d27"
|
1194 |
-
inkscape:connector-curvature="0"
|
1195 |
-
id="path108"
|
1196 |
-
d="m 589.951,599.535 c -4.731,0 -1.304,0 -6.035,0 -2.84,0 -2.84,4.404 0,4.404 4.731,0 1.304,0 6.035,0 2.84,0.001 2.84,-4.404 0,-4.404 z" /><path
|
1197 |
-
style="fill:#e52d27"
|
1198 |
-
inkscape:connector-curvature="0"
|
1199 |
-
id="path110"
|
1200 |
-
d="m 589.951,617.153 c -4.731,0 -1.304,0 -6.035,0 -2.84,0 -2.84,4.404 0,4.404 4.731,0 1.304,0 6.035,0 2.84,0 2.84,-4.404 0,-4.404 z" /><path
|
1201 |
-
style="fill:#e52d27"
|
1202 |
-
inkscape:connector-curvature="0"
|
1203 |
-
id="path112"
|
1204 |
-
d="m 589.951,608.344 c -4.731,0 -1.304,0 -6.035,0 -2.84,0 -2.84,4.404 0,4.404 4.731,0 1.304,0 6.035,0 2.84,0 2.84,-4.404 0,-4.404 z" /><path
|
1205 |
-
style="fill:#e52d27"
|
1206 |
-
inkscape:connector-curvature="0"
|
1207 |
-
id="path114"
|
1208 |
-
d="m 589.951,581.918 c -4.731,0 -1.304,0 -6.035,0 -2.84,0 -2.84,4.404 0,4.404 4.731,0 1.304,0 6.035,0 2.84,0 2.84,-4.404 0,-4.404 z" /></g><path
|
1209 |
-
style="fill:none"
|
1210 |
-
inkscape:connector-curvature="0"
|
1211 |
-
id="path118"
|
1212 |
-
d="M 59.488,23.077 C 55.255,15.941 47.465,11.072 38.705,11.072 c -13.16,0 -24.142,10.982 -24.142,24.142 0,3.537 0.798,6.913 2.214,9.964 -4.157,4.353 -6.741,10.214 -6.741,16.592 0,13.16 10.982,24.142 24.142,24.142 0.474,0 0.943,-0.019 1.411,-0.047 l -4.873,-4.844 -5.805,-5.805 0.011,-0.006 c 1.524,1.448 3.931,1.587 6.636,0.047 l 38,-21.635 c 2.797,-1.593 3.877,-3.803 3.259,-5.878 l 0.005,-0.003 4.581,4.604 1.834,1.787 C 79.958,51.866 80.35,49.464 80.35,46.983 80.349,34.934 71.142,24.718 59.488,23.077 Z" /><g
|
1213 |
-
id="g127"
|
1214 |
-
transform="translate(-557.291,-552.87)"><linearGradient
|
1215 |
-
y2="637.09222"
|
1216 |
-
x2="624.36292"
|
1217 |
-
y1="748.50519"
|
1218 |
-
x1="692.52698"
|
1219 |
-
gradientUnits="userSpaceOnUse"
|
1220 |
-
id="SVGID_1_"><stop
|
1221 |
-
id="stop120"
|
1222 |
-
style="stop-color:#231F20;stop-opacity:0"
|
1223 |
-
offset="0" /><stop
|
1224 |
-
id="stop122"
|
1225 |
-
style="stop-color:#231F20"
|
1226 |
-
offset="1" /></linearGradient><path
|
1227 |
-
style="opacity:0.4;fill:url(#SVGID_1_)"
|
1228 |
-
inkscape:connector-curvature="0"
|
1229 |
-
id="path125"
|
1230 |
-
d="m 636.527,607.001 -1.834,-1.787 -4.581,-4.604 -0.005,0.003 c 0.618,2.075 -0.462,4.285 -3.259,5.878 l -38,21.635 c -2.704,1.54 -5.111,1.401 -6.636,-0.047 l -0.011,0.006 5.805,5.805 4.873,4.844 8.511,8.395 50.118,-0.041 v -25.532 z" /></g></svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
advanced-responsive-video-embedder.php
CHANGED
@@ -3,103 +3,129 @@
|
|
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:
|
7 |
* Author: Nicolas Jonas
|
8 |
* Author URI: https://nextgenthemes.com
|
9 |
* License: GPL-3.0
|
10 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
* Text Domain: advanced-responsive-video-embedder
|
12 |
* Domain Path: /languages
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
*/
|
14 |
|
15 |
-
|
16 |
-
die;
|
17 |
-
}
|
18 |
-
|
19 |
-
define( 'ARVE_SLUG', 'advanced-responsive-video-embedder' );
|
20 |
-
define( 'ARVE_VERSION', '8.10.23' );
|
21 |
-
define( 'ARVE_PRO_VERSION_REQUIRED', '4.2.5' );
|
22 |
-
|
23 |
-
define( 'ARVE_URL', plugin_dir_url( __FILE__ ) );
|
24 |
-
define( 'ARVE_PUBLIC_URL', ARVE_URL . 'public/' );
|
25 |
-
define( 'ARVE_ADMIN_URL', ARVE_URL . 'admin/' );
|
26 |
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
|
32 |
-
function
|
33 |
|
34 |
-
add_option( 'arve_install_date',
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
add_action( 'admin_init', 'arve_php_outdated_message' );
|
40 |
-
return;
|
41 |
}
|
42 |
|
43 |
-
require_once
|
44 |
-
require_once
|
45 |
-
require_once
|
46 |
-
require_once
|
47 |
-
require_once
|
48 |
-
require_once
|
49 |
-
require_once
|
50 |
-
require_once
|
51 |
-
require_once
|
52 |
-
require_once
|
53 |
-
require_once
|
54 |
-
require_once
|
55 |
-
require_once
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
add_action( '
|
62 |
-
add_action( '
|
63 |
-
|
64 |
-
add_action( '
|
65 |
-
add_action( '
|
66 |
-
add_action( '
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
add_filter( '
|
71 |
-
add_filter( '
|
72 |
-
add_filter( '
|
73 |
-
add_filter( '
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
|
97 |
-
|
|
|
98 |
|
99 |
-
$
|
100 |
-
__( 'ARVE requres at least PHP version 5.3! Your PHP version is %s and has reached End Of Life (insecure and slow). You should ask your host to update it for you not only to make ARVE work but to make your site faster and more secure. Wordpress.org recommends PHP 7.0, I use 7.1 at nextgenthemes.com', ARVE_SLUG ),
|
101 |
-
PHP_VERSION
|
102 |
-
);
|
103 |
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
}
|
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.0.0-beta5
|
7 |
* Author: Nicolas Jonas
|
8 |
* Author URI: https://nextgenthemes.com
|
9 |
* License: GPL-3.0
|
10 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
* Text Domain: advanced-responsive-video-embedder
|
12 |
* Domain Path: /languages
|
13 |
+
* GitHub Plugin URI: https://github.com/nextgenthemes/advanced-responsive-video-embedder
|
14 |
+
* GitHub Branch: beta
|
15 |
+
*
|
16 |
+
* @package Nextgenthemes/ARVE
|
17 |
+
* @author Nicolas Jonas
|
18 |
+
* @license GPL 3.0
|
19 |
+
* @link https://nextgenthemes.com
|
20 |
*/
|
21 |
|
22 |
+
namespace Nextgenthemes\ARVE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
+
const VERSION = '9.0.0-beta5';
|
25 |
+
const PRO_VERSION_REQUIRED = '5.0.0-beta5';
|
26 |
+
const NUM_TRACKS = 3;
|
27 |
+
const PLUGIN_FILE = __FILE__;
|
28 |
+
const PLUGIN_DIR = __DIR__;
|
29 |
+
const VIDEO_FILE_EXTENSIONS = [ 'av1mp4', 'mp4', 'm4v', 'webm', 'ogv' ];
|
30 |
+
const DEFAULT_MAXWIDTH = 900;
|
31 |
|
32 |
+
init();
|
33 |
|
34 |
+
function init() {
|
35 |
|
36 |
+
add_option( 'arve_install_date', time() );
|
37 |
|
38 |
+
if ( version_compare( get_option( 'arve_version'), VERSION, '<' ) ) {
|
39 |
+
update_option( 'nextgenthemes_arve_oembed_recache', time() );
|
40 |
+
update_option( 'arve_version', VERSION );
|
|
|
|
|
41 |
}
|
42 |
|
43 |
+
require_once PLUGIN_DIR . '/php/Common/init.php';
|
44 |
+
require_once PLUGIN_DIR . '/php/EmbedChecker.php';
|
45 |
+
require_once PLUGIN_DIR . '/php/functions-deprecated.php';
|
46 |
+
require_once PLUGIN_DIR . '/php/functions-assets.php';
|
47 |
+
require_once PLUGIN_DIR . '/php/functions-html-output.php';
|
48 |
+
require_once PLUGIN_DIR . '/php/functions-misc.php';
|
49 |
+
require_once PLUGIN_DIR . '/php/functions-oembed.php';
|
50 |
+
require_once PLUGIN_DIR . '/php/functions-shortcode-data.php';
|
51 |
+
require_once PLUGIN_DIR . '/php/functions-shortcode-filters.php';
|
52 |
+
require_once PLUGIN_DIR . '/php/functions-shortcodes.php';
|
53 |
+
require_once PLUGIN_DIR . '/php/functions-url-handlers.php';
|
54 |
+
require_once PLUGIN_DIR . '/php/functions-validation.php';
|
55 |
+
require_once PLUGIN_DIR . '/php/functions-host-properties.php';
|
56 |
+
require_once PLUGIN_DIR . '/php/functions-settings.php';
|
57 |
+
require_once PLUGIN_DIR . '/php/Admin/functions-admin.php';
|
58 |
+
require_once PLUGIN_DIR . '/php/Admin/functions-settings-page.php';
|
59 |
+
|
60 |
+
// Public hooks
|
61 |
+
add_action( 'init', __NAMESPACE__ . '\add_oembed_providers' );
|
62 |
+
add_action( 'init', __NAMESPACE__ . '\register_assets' );
|
63 |
+
add_filter( 'oembed_remote_get_args', __NAMESPACE__ . '\vimeo_referer', 10, 2 );
|
64 |
+
add_action( 'plugins_loaded', __NAMESPACE__ . '\create_shortcodes', 999 );
|
65 |
+
add_action( 'plugins_loaded', __NAMESPACE__ . '\create_url_handlers', 999 );
|
66 |
+
add_action( 'plugins_loaded', __NAMESPACE__ . '\load_textdomain' );
|
67 |
+
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\action_wp_enqueue_scripts' );
|
68 |
+
add_action( 'wp_video_shortcode_override', __NAMESPACE__ . '\wp_video_shortcode_override', 10, 4 );
|
69 |
+
add_filter( 'language_attributes', __NAMESPACE__ . '\html_id' );
|
70 |
+
add_filter( 'oembed_dataparse', __NAMESPACE__ . '\filter_oembed_dataparse', 11, 3 );
|
71 |
+
add_filter( 'embed_oembed_html', __NAMESPACE__ . '\maybe_enqueue_assets', 99 );
|
72 |
+
add_filter( 'oembed_ttl', __NAMESPACE__ . '\trigger_cache_rebuild', 10, 4 );
|
73 |
+
add_filter( 'embed_oembed_discover', __NAMESPACE__ . '\reenable_oembed_cache' );
|
74 |
+
|
75 |
+
foreach ( [
|
76 |
+
'missing_attribute_check' => -100,
|
77 |
+
'validate' => -99,
|
78 |
+
'detect_html5' => -35,
|
79 |
+
'detect_provider_and_id_from_url' => -30,
|
80 |
+
'aspect_ratio' => -10,
|
81 |
+
'thumbnail' => 10,
|
82 |
+
'video' => 10,
|
83 |
+
'liveleak_id_fix' => 10,
|
84 |
+
'maxwidth' => 10,
|
85 |
+
'dimensions' => 12,
|
86 |
+
'mode' => 14,
|
87 |
+
'autoplay' => 15,
|
88 |
+
'iframe_src' => 20,
|
89 |
+
// Maybe validate_again ?
|
90 |
+
'set_uid' => 90,
|
91 |
+
] as $filter => $priority ) {
|
92 |
+
add_filter( 'shortcode_atts_arve', __NAMESPACE__ . "\\sc_filter_{$filter}", $priority );
|
93 |
+
};
|
94 |
+
unset( $filter );
|
95 |
+
unset( $priority );
|
96 |
+
|
97 |
+
// Admin Hooks
|
98 |
+
add_action( 'nextgenthemes/arve/admin/settings_header', __NAMESPACE__ . '\Admin\settings_header' );
|
99 |
+
add_action( 'nextgenthemes/arve/admin/settings_sidebar', __NAMESPACE__ . '\Admin\settings_sidebar' );
|
100 |
+
|
101 |
+
add_action( 'admin_bar_menu', __NAMESPACE__ . '\Admin\action_admin_bar_menu', 100 );
|
102 |
+
add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\Admin\admin_enqueue_scripts' );
|
103 |
+
add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\Admin\admin_enqueue_styles', 99 );
|
104 |
+
add_action( 'admin_init', __NAMESPACE__ . '\Admin\action_admin_init_setup_messages' );
|
105 |
+
add_action( 'media_buttons', __NAMESPACE__ . '\Admin\add_media_button', 11 );
|
106 |
+
add_action( 'register_shortcode_ui', __NAMESPACE__ . '\Admin\register_shortcode_ui' );
|
107 |
+
add_action( 'wp_dashboard_setup', __NAMESPACE__ . '\Admin\add_dashboard_widget' );
|
108 |
+
|
109 |
+
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), __NAMESPACE__ . '\Admin\add_action_links' );
|
110 |
+
add_filter( 'nextgenthemes_arve_save_options', __NAMESPACE__ . '\Admin\filter_save_options' );
|
111 |
+
|
112 |
+
}//end init()
|
113 |
+
|
114 |
+
register_activation_hook( __FILE__, __NAMESPACE__ . '\activation_hook' );
|
115 |
+
function activation_hook() {
|
116 |
+
update_option( 'nextgenthemes_arve_oembed_recache', time() );
|
117 |
}
|
118 |
|
119 |
+
register_uninstall_hook( __FILE__, __NAMESPACE__ . '\uninstall_hook' );
|
120 |
+
function uninstall_hook() {
|
121 |
|
122 |
+
global $wpdb;
|
|
|
|
|
|
|
123 |
|
124 |
+
$wpdb->query(
|
125 |
+
$wpdb->prepare(
|
126 |
+
"DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE %s AND meta_value LIKE %s",
|
127 |
+
'%_oembed_%',
|
128 |
+
'%' . $wpdb->esc_like( 'id="arve-' ) . '%'
|
129 |
+
)
|
130 |
+
);
|
131 |
}
|
build/admin.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '02ffd20fde4e1bfe6dcd5dcef372e786');
|
build/admin.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.arve-license-input{width:280px}.arve-btn{padding-left:3px}.arve-icon::before{content:"\f236" !important}.edit-shortcode-form-fields.shortcode-ui-edit-arve .field-block{padding-top:.4em;padding-bottom:.4em}.edit-shortcode-form-fields.shortcode-ui-edit-arve .field-block label{display:inline-block;margin:0}.edit-shortcode-form-fields.shortcode-ui-edit-arve .field-block label:first-child{width:110px}.edit-shortcode-form-fields.shortcode-ui-edit-arve .shortcode-ui-attribute-upload_date input,.edit-shortcode-form-fields.shortcode-ui-edit-arve .shortcode-ui-attribute-aspect_ratio input,.edit-shortcode-form-fields.shortcode-ui-edit-arve .shortcode-ui-attribute-url input,.edit-shortcode-form-fields.shortcode-ui-edit-arve .shortcode-ui-attribute-title input,.edit-shortcode-form-fields.shortcode-ui-edit-arve .shortcode-ui-attribute-description input{width:700px}.arve-list-small{padding-left:20px;font-size:.85em;list-style:square}.arve-list-small li{margin-bottom:2px}.arve-settings-page-ad{padding-right:.7rem !important;margin:0}.arve-corner-spacer{float:right;width:20px;height:38px}@media all and (min-width: 1400px){.arve-settings-page-ad{position:absolute !important;right:0;width:320px}.arve-options-wrap{position:relative;padding-right:350px}}
|
2 |
+
|
build/admin.js
ADDED
@@ -0,0 +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){}});
|
build/block.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('wp-block-editor', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-server-side-render'), 'version' => '8ca43d8d928fe8d1df6d6cf4d5e353d8');
|
build/block.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var l=t[r]={i:r,l:!1,exports:{}};return e[r].call(l.exports,l,l.exports,n),l.l=!0,l.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 l in e)n.d(r,l,function(t){return e[t]}.bind(null,l));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=9)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},,function(e,t){!function(){e.exports=this.wp.serverSideRender}()},,,,function(e,t,n){"use strict";n.r(t);var r=n(2),l=n(5),a=n.n(l),o=n(0),i=n(3),c=n(1);const s=window.ARVEsettings,u=window.wp,b=new DOMParser;function d(e){const t=[];return Object.entries(e).forEach(([e,n])=>{const r={label:n,value:e};t.push(r)}),t}function p(e){const t=[],n={},l=Object(o.createElement)("p",null,Object(r.__)("To edit the featured image, you need permission to upload media."));let a=!1;Object.values(s).forEach(e=>{n[e.tag]=[]}),Object.entries(s).forEach(([t,s])=>{let u=e.attributes[t],p="";switch(s.type){case"boolean":"sandbox"===t&&void 0===u&&(u=!0),n[s.tag].push(Object(o.createElement)(c.ToggleControl,{key:t,label:s.label,help:m(s),checked:!!u,onChange:n=>e.setAttributes({[t]:n})}));break;case"select":n[s.tag].push(Object(o.createElement)(c.SelectControl,{key:t,value:u,label:s.label,help:m(s),options:d(s.options),onChange:n=>e.setAttributes({[t]:n})}));break;case"string":n[s.tag].push(Object(o.createElement)(c.TextControl,{key:t,label:s.label,placeholder:s.placeholder,help:m(s),value:u,onChange:n=>(function(e,t,n){if("url"===e){const e=b.parseFromString(t,"text/html").querySelector("iframe");if(e&&e.getAttribute("src")){t=e.src;const r=e.width,l=e.height;r&&l&&n.setAttributes({aspect_ratio:h(r,l)})}}}(t,n,e),e.setAttributes({[t]:n}))}));break;case"attachment_old":p=e.attributes[t+"_url"],n[s.tag].push(Object(o.createElement)("div",null,Object(o.createElement)(i.MediaUploadCheck,null,Object(o.createElement)(i.MediaUpload,{onSelect:n=>e.setAttributes({[t]:n.id.toString(),[t+"_url"]:n.url}),allowedTypes:"image",render:({open:e})=>Object(o.createElement)(c.Button,{className:"components-button--arve-thumbnail",onClick:e,"aria-label":Object(r.__)("Edit or update the image")},!!p&&Object(o.createElement)("div",null,Object(o.createElement)("img",{src:p,alt:Object(r.__)("Selected Thumbnail")})),Object(r.__)("Edit or update the image"))})),!!u&&Object(o.createElement)(c.Button,{onClick:()=>e.setAttributes({[t]:"",[t+"_url"]:""})},Object(r.__)("Remove Custom Thumbnail")),Object(o.createElement)(c.TextControl,{label:s.label,placeholder:s.placeholder,help:m(s),value:u,onChange:n=>e.setAttributes({[t]:n})})));break;case"attachment":p=e.attributes[t+"_url"],n[s.tag].push(Object(o.createElement)("div",{className:"editor-post-featured-image"},Object(o.createElement)(i.MediaUploadCheck,{fallback:l},Object(o.createElement)(i.MediaUpload,{title:Object(r.__)("Thumbnail"),onSelect:n=>(a=n,console.log(a),e.setAttributes({[t]:n.id.toString(),[t+"_url"]:n.url})),unstableFeaturedImageFlow:!0,allowedTypes:"Image",modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>Object(o.createElement)("div",{className:"editor-post-featured-image__container"},Object(o.createElement)(c.Button,{className:u?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":u?Object(r.__)("Edit or update the image"):null,"aria-describedby":u?`editor-post-featured-image-${u}-describedby`:""},!!u&&!!p&&Object(o.createElement)(c.ResponsiveWrapper,{naturalWidth:640,naturalHeight:380},Object(o.createElement)("img",{src:p,alt:""})),!u&&Object(r.__)("Set Thumbnail")),Object(o.createElement)(c.DropZone,null)),value:u})),!!u&&!!p&&Object(o.createElement)(i.MediaUploadCheck,null,Object(o.createElement)(i.MediaUpload,{title:Object(r.__)("Thumbnail"),onSelect:n=>(a=n,console.log(a),e.setAttributes({[t]:n.id.toString(),[t+"_url"]:n.url})),unstableFeaturedImageFlow:!0,allowedTypes:"image",modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>Object(o.createElement)(c.Button,{onClick:e,isSecondary:!0},Object(r.__)("Replace Thumbnail"))})),!!u&&Object(o.createElement)(i.MediaUploadCheck,null,Object(o.createElement)(c.Button,{onClick:()=>e.setAttributes({[t]:"",[t+"_url"]:""}),isLink:!0,isDestructive:!0},Object(r.__)("Remove Thumbnail"))),Object(o.createElement)(c.TextControl,{label:s.label,placeholder:s.placeholder,help:m(s),value:u,onChange:n=>e.setAttributes({[t]:n})})))}});let u=!0;return Object.keys(n).forEach(e=>{var r;t.push(Object(o.createElement)(c.PanelBody,{key:e,title:(r=e,r.charAt(0).toUpperCase()+r.slice(1)),initialOpen:u},n[e])),u=!1}),t}function m(e){if("string"!=typeof e.description)return"";if("string"==typeof e.descriptionlinktext){const t=e.description.split(e.descriptionlinktext);return Object(o.createElement)("span",null,Object(o.createElement)("span",null,t[0]),Object(o.createElement)("a",{href:e.descriptionlink},e.descriptionlinktext),",",Object(o.createElement)("span",null,t[1]))}return e.description}function h(e,t){const n=function e(t,n){if(!n)return t;return e(n,t%n)}(e,t);return e/n+":"+t/n}u.blocks.registerBlockType("nextgenthemes/arve-block",{title:"Video Embed (ARVE)",description:"You can disable help texts on the ARVE settings page to clean up the UI",icon:"video-alt3",category:"embed",supports:{AlignWide:!0,align:["left","right","center","wide","full"]},edit:e=>{const t=p(e);return[Object(o.createElement)(a.a,{key:"ssr",block:"nextgenthemes/arve-block",attributes:e.attributes}),Object(o.createElement)(i.InspectorControls,{key:"insp"},t)]},save:()=>null})}]);
|
build/common/notice-ajax.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'e7f40d785f127c1f9969bbca0cad8bde');
|
build/common/notice-ajax.js
ADDED
@@ -0,0 +1 @@
|
|
|
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=18)}({18:function(e,t,n){"use strict";function r(e){if(!e||!e.target)return;const t=e.target.closest("[data-nextgenthemes-notice-id]");t&&window.jQuery.ajax({url:window.ajaxurl,data:{action:t.dataset.nextgenthemesNoticeId}})}n.r(t),document.addEventListener("DOMContentLoaded",(function(){const e=document.querySelector("[data-nextgenthemes-notice-id] .notice-dismiss");e&&e.addEventListener("click",r,!1)}))}});
|
build/common/settings.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'ba9f52f1068ad404fe66864a29de3433');
|
build/common/settings.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.wrap--nextgenthemes{max-width:1100px;margin-right:auto;margin-left:auto}.wp-core-ui .button-primary--ngt-small{height:18px;padding-right:5px;padding-left:5px;line-height:12px}.nextgenthemes-label-text{display:block;margin-bottom:3px;font-weight:600}[type="checkbox"]+.nextgenthemes-label-text{display:inline}.wrap--nextgenthemes__loading-indicator{width:16px;height:16px}.ngt-settings-grid{display:-ms-grid;display:grid;grid-column-gap:1rem;grid-template-areas:"content" "sidebar"}@media (min-width: 750px){.ngt-settings-grid{grid-column-gap:2rem;grid-template-areas:"content sidebar";-ms-grid-columns:1fr 2rem 300px;grid-template-columns:1fr 300px}}@media (min-width: 1200px){.ngt-settings-grid{grid-column-gap:3rem;-ms-grid-columns:1fr 420px;grid-template-columns:1fr 420px}}.ngt-settings-grid__content{-ms-grid-row:1;-ms-grid-column:1;grid-area:content}.ngt-settings-grid__sidebar{-ms-grid-row:2;-ms-grid-column:1;grid-area:sidebar}@media (min-width: 750px){.ngt-settings-grid__content{-ms-grid-row:1;-ms-grid-column:1}.ngt-settings-grid__sidebar{-ms-grid-row:1;-ms-grid-column:3}}.ngt-sidebar-box{background:#fff;border-left:4px solid #46b450;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);margin-bottom:1rem;padding:1rem}.ngt-sidebar-box h3:first-child{margin-top:0}.ngt-sidebar-box ul{list-style:square;padding-left:1em}.ngt-sidebar-box li{padding-left:.7em;margin-bottom:1em}@media (min-width: 1200px){.ngt-sidebar-box{padding:3rem}}
|
2 |
+
|
build/common/settings.js
ADDED
@@ -0,0 +1 @@
|
|
|
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=13)}([,,,,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},,function(e,t,n){(function(t,n){var r;r=function(){"use strict";var e=Object.freeze({});function r(e){return null==e}function o(e){return null!=e}function i(e){return!0===e}function a(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function s(e){return null!==e&&"object"==typeof e}var c=Object.prototype.toString;function l(e){return c.call(e).slice(8,-1)}function u(e){return"[object Object]"===c.call(e)}function f(e){return"[object RegExp]"===c.call(e)}function d(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function p(e){return o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function v(e){return null==e?"":Array.isArray(e)||u(e)&&e.toString===c?JSON.stringify(e,null,2):String(e)}function h(e){var t=parseFloat(e);return isNaN(t)?e:t}function m(e,t){for(var n=Object.create(null),r=e.split(","),o=0;o<r.length;o++)n[r[o]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var g=m("slot,component",!0),y=m("key,ref,slot,slot-scope,is");function b(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var _=Object.prototype.hasOwnProperty;function w(e,t){return _.call(e,t)}function $(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var x=/-(\w)/g,A=$((function(e){return e.replace(x,(function(e,t){return t?t.toUpperCase():""}))})),k=$((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),C=/\B([A-Z])/g,S=$((function(e){return e.replace(C,"-$1").toLowerCase()})),O=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function T(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function M(e,t){for(var n in t)e[n]=t[n];return e}function j(e){for(var t={},n=0;n<e.length;n++)e[n]&&M(t,e[n]);return t}function I(e,t,n){}var E=function(e,t,n){return!1},N=function(e){return e};function D(e,t){if(e===t)return!0;var n=s(e),r=s(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var o=Array.isArray(e),i=Array.isArray(t);if(o&&i)return e.length===t.length&&e.every((function(e,n){return D(e,t[n])}));if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(o||i)return!1;var a=Object.keys(e),c=Object.keys(t);return a.length===c.length&&a.every((function(n){return D(e[n],t[n])}))}catch(e){return!1}}function L(e,t){for(var n=0;n<e.length;n++)if(D(e[n],t))return n;return-1}function P(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var F=["component","directive","filter"],R=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],H={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!0,devtools:!0,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:E,isReservedAttr:E,isUnknownElement:E,getTagNamespace:I,parsePlatformTagName:N,mustUseProp:E,async:!0,_lifecycleHooks:R},U=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function V(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function B(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var z,q=new RegExp("[^"+U.source+".$_\\d]"),J="__proto__"in{},K="undefined"!=typeof window,W="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,Z=W&&WXEnvironment.platform.toLowerCase(),G=K&&window.navigator.userAgent.toLowerCase(),Y=G&&/msie|trident/.test(G),X=G&&G.indexOf("msie 9.0")>0,Q=G&&G.indexOf("edge/")>0,ee=(G&&G.indexOf("android"),G&&/iphone|ipad|ipod|ios/.test(G)||"ios"===Z),te=(G&&/chrome\/\d+/.test(G),G&&/phantomjs/.test(G),G&&G.match(/firefox\/(\d+)/)),ne={}.watch,re=!1;if(K)try{var oe={};Object.defineProperty(oe,"passive",{get:function(){re=!0}}),window.addEventListener("test-passive",null,oe)}catch(e){}var ie=function(){return void 0===z&&(z=!K&&!W&&void 0!==t&&t.process&&"server"===t.process.env.VUE_ENV),z},ae=K&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function se(e){return"function"==typeof e&&/native code/.test(e.toString())}var ce,le="undefined"!=typeof Symbol&&se(Symbol)&&"undefined"!=typeof Reflect&&se(Reflect.ownKeys);ce="undefined"!=typeof Set&&se(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ue,fe,de,pe=I,ve="undefined"!=typeof console,he=/(?:^|[-_])(\w)/g;ue=function(e,t){var n=t?pe(t):"";H.warnHandler?H.warnHandler.call(null,e,t,n):ve&&!H.silent&&console.error("[Vue warn]: "+e+n)},fe=function(e,t){ve&&!H.silent&&console.warn("[Vue tip]: "+e+(t?pe(t):""))},de=function(e,t){if(e.$root===e)return"<Root>";var n="function"==typeof e&&null!=e.cid?e.options:e._isVue?e.$options||e.constructor.options:e,r=n.name||n._componentTag,o=n.__file;if(!r&&o){var i=o.match(/([^/\\]+)\.vue$/);r=i&&i[1]}return(r?"<"+function(e){return e.replace(he,(function(e){return e.toUpperCase()})).replace(/[-_]/g,"")}(r)+">":"<Anonymous>")+(o&&!1!==t?" at "+o:"")},pe=function(e){if(e._isVue&&e.$parent){for(var t=[],n=0;e;){if(t.length>0){var r=t[t.length-1];if(r.constructor===e.constructor){n++,e=e.$parent;continue}n>0&&(t[t.length-1]=[r,n],n=0)}t.push(e),e=e.$parent}return"\n\nfound in\n\n"+t.map((function(e,t){return""+(0===t?"---\x3e ":function(e,t){for(var n="";t;)t%2==1&&(n+=e),t>1&&(e+=e),t>>=1;return n}(" ",5+2*t))+(Array.isArray(e)?de(e[0])+"... ("+e[1]+" recursive calls)":de(e))})).join("\n")}return"\n\n(found in "+de(e)+")"};var me=0,ge=function(){this.id=me++,this.subs=[]};ge.prototype.addSub=function(e){this.subs.push(e)},ge.prototype.removeSub=function(e){b(this.subs,e)},ge.prototype.depend=function(){ge.target&&ge.target.addDep(this)},ge.prototype.notify=function(){var e=this.subs.slice();H.async||e.sort((function(e,t){return e.id-t.id}));for(var t=0,n=e.length;t<n;t++)e[t].update()},ge.target=null;var ye=[];function be(e){ye.push(e),ge.target=e}function _e(){ye.pop(),ge.target=ye[ye.length-1]}var we=function(e,t,n,r,o,i,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},$e={child:{configurable:!0}};$e.child.get=function(){return this.componentInstance},Object.defineProperties(we.prototype,$e);var xe=function(e){void 0===e&&(e="");var t=new we;return t.text=e,t.isComment=!0,t};function Ae(e){return new we(void 0,void 0,void 0,String(e))}function ke(e){var t=new we(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var Ce=Array.prototype,Se=Object.create(Ce);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(e){var t=Ce[e];B(Se,e,(function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var o,i=t.apply(this,n),a=this.__ob__;switch(e){case"push":case"unshift":o=n;break;case"splice":o=n.slice(2)}return o&&a.observeArray(o),a.dep.notify(),i}))}));var Oe=Object.getOwnPropertyNames(Se),Te=!0;function Me(e){Te=e}var je=function(e){this.value=e,this.dep=new ge,this.vmCount=0,B(e,"__ob__",this),Array.isArray(e)?(J?function(e,t){e.__proto__=t}(e,Se):function(e,t,n){for(var r=0,o=n.length;r<o;r++){var i=n[r];B(e,i,t[i])}}(e,Se,Oe),this.observeArray(e)):this.walk(e)};function Ie(e,t){var n;if(s(e)&&!(e instanceof we))return w(e,"__ob__")&&e.__ob__ instanceof je?n=e.__ob__:Te&&!ie()&&(Array.isArray(e)||u(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new je(e)),t&&n&&n.vmCount++,n}function Ee(e,t,n,r,o){var i=new ge,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var l=!o&&Ie(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return ge.target&&(i.depend(),l&&(l.dep.depend(),Array.isArray(t)&&Le(t))),t},set:function(t){var a=s?s.call(e):n;t===a||t!=t&&a!=a||(r&&r(),s&&!c||(c?c.call(e,t):n=t,l=!o&&Ie(t),i.notify()))}})}}function Ne(e,t,n){if((r(e)||a(e))&&ue("Cannot set reactive property on undefined, null, or primitive value: "+e),Array.isArray(e)&&d(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var o=e.__ob__;return e._isVue||o&&o.vmCount?(ue("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."),n):o?(Ee(o.value,t,n),o.dep.notify(),n):(e[t]=n,n)}function De(e,t){if((r(e)||a(e))&&ue("Cannot delete reactive property on undefined, null, or primitive value: "+e),Array.isArray(e)&&d(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount?ue("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):w(e,t)&&(delete e[t],n&&n.dep.notify())}}function Le(e){for(var t=void 0,n=0,r=e.length;n<r;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&Le(t)}je.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)Ee(e,t[n])},je.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Ie(e[t])};var Pe=H.optionMergeStrategies;function Fe(e,t){if(!t)return e;for(var n,r,o,i=le?Reflect.ownKeys(t):Object.keys(t),a=0;a<i.length;a++)"__ob__"!==(n=i[a])&&(r=e[n],o=t[n],w(e,n)?r!==o&&u(r)&&u(o)&&Fe(r,o):Ne(e,n,o));return e}function Re(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,o="function"==typeof e?e.call(n,n):e;return r?Fe(r,o):o}:t?e?function(){return Fe("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function He(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}function Ue(e,t,n,r){var o=Object.create(e||null);return t?(ze(r,t,n),M(o,t)):o}Pe.el=Pe.propsData=function(e,t,n,r){return n||ue('option "'+r+'" can only be used during instance creation with the `new` keyword.'),Ve(e,t)},Pe.data=function(e,t,n){return n?Re(e,t,n):t&&"function"!=typeof t?(ue('The "data" option should be a function that returns a per-instance value in component definitions.',n),e):Re(e,t)},R.forEach((function(e){Pe[e]=He})),F.forEach((function(e){Pe[e+"s"]=Ue})),Pe.watch=function(e,t,n,r){if(e===ne&&(e=void 0),t===ne&&(t=void 0),!t)return Object.create(e||null);if(ze(r,t,n),!e)return t;var o={};for(var i in M(o,e),t){var a=o[i],s=t[i];a&&!Array.isArray(a)&&(a=[a]),o[i]=a?a.concat(s):Array.isArray(s)?s:[s]}return o},Pe.props=Pe.methods=Pe.inject=Pe.computed=function(e,t,n,r){if(t&&ze(r,t,n),!e)return t;var o=Object.create(null);return M(o,e),t&&M(o,t),o},Pe.provide=Re;var Ve=function(e,t){return void 0===t?e:t};function Be(e){new RegExp("^[a-zA-Z][\\-\\.0-9_"+U.source+"]*$").test(e)||ue('Invalid component name: "'+e+'". Component names should conform to valid custom element name in html5 specification.'),(g(e)||H.isReservedTag(e))&&ue("Do not use built-in or reserved HTML elements as component id: "+e)}function ze(e,t,n){u(t)||ue('Invalid value for option "'+e+'": expected an Object, but got '+l(t)+".",n)}function qe(e,t,n){if(function(e){for(var t in e.components)Be(t)}(t),"function"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var r,o,i={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(o=n[r])?i[A(o)]={type:null}:ue("props must be strings when using array syntax.");else if(u(n))for(var a in n)o=n[a],i[A(a)]=u(o)?o:{type:o};else ue('Invalid value for option "props": expected an Array or an Object, but got '+l(n)+".",t);e.props=i}}(t,n),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var o=0;o<n.length;o++)r[n[o]]={from:n[o]};else if(u(n))for(var i in n){var a=n[i];r[i]=u(a)?M({from:i},a):{from:a}}else ue('Invalid value for option "inject": expected an Array or an Object, but got '+l(n)+".",t)}}(t,n),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}(t),!t._base&&(t.extends&&(e=qe(e,t.extends,n)),t.mixins))for(var r=0,o=t.mixins.length;r<o;r++)e=qe(e,t.mixins[r],n);var i,a={};for(i in e)s(i);for(i in t)w(e,i)||s(i);function s(r){var o=Pe[r]||Ve;a[r]=o(e[r],t[r],n,r)}return a}function Je(e,t,n,r){if("string"==typeof n){var o=e[t];if(w(o,n))return o[n];var i=A(n);if(w(o,i))return o[i];var a=k(i);if(w(o,a))return o[a];var s=o[n]||o[i]||o[a];return r&&!s&&ue("Failed to resolve "+t.slice(0,-1)+": "+n,e),s}}function Ke(e,t,n,r){var o=t[e],i=!w(n,e),a=n[e],c=Xe(Boolean,o.type);if(c>-1)if(i&&!w(o,"default"))a=!1;else if(""===a||a===S(e)){var u=Xe(String,o.type);(u<0||c<u)&&(a=!0)}if(void 0===a){a=function(e,t,n){if(w(t,"default")){var r=t.default;return s(r)&&ue('Invalid default value for prop "'+n+'": Props with type Object/Array must use a factory function to return the default value.',e),e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n]?e._props[n]:"function"==typeof r&&"Function"!==Ge(t.type)?r.call(e):r}}(r,o,e);var f=Te;Me(!0),Ie(a),Me(f)}return function(e,t,n,r,o){if(e.required&&o)ue('Missing required prop: "'+t+'"',r);else if(null!=n||e.required){var i=e.type,a=!i||!0===i,s=[];if(i){Array.isArray(i)||(i=[i]);for(var c=0;c<i.length&&!a;c++){var u=Ze(n,i[c]);s.push(u.expectedType||""),a=u.valid}}if(a){var f=e.validator;f&&(f(n)||ue('Invalid prop: custom validator check failed for prop "'+t+'".',r))}else ue(function(e,t,n){var r='Invalid prop: type check failed for prop "'+e+'". Expected '+n.map(k).join(", "),o=n[0],i=l(t),a=Qe(t,o),s=Qe(t,i);return 1===n.length&&et(o)&&!function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.some((function(e){return"boolean"===e.toLowerCase()}))}(o,i)&&(r+=" with value "+a),r+=", got "+i+" ",et(i)&&(r+="with value "+s+"."),r}(t,n,s),r)}}(o,e,a,r,i),a}var We=/^(String|Number|Boolean|Function|Symbol)$/;function Ze(e,t){var n,r=Ge(t);if(We.test(r)){var o=typeof e;(n=o===r.toLowerCase())||"object"!==o||(n=e instanceof t)}else n="Object"===r?u(e):"Array"===r?Array.isArray(e):e instanceof t;return{valid:n,expectedType:r}}function Ge(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function Ye(e,t){return Ge(e)===Ge(t)}function Xe(e,t){if(!Array.isArray(t))return Ye(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(Ye(t[n],e))return n;return-1}function Qe(e,t){return"String"===t?'"'+e+'"':"Number"===t?""+Number(e):""+e}function et(e){return["string","number","boolean"].some((function(t){return e.toLowerCase()===t}))}function tt(e,t,n){be();try{if(t)for(var r=t;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i<o.length;i++)try{if(!1===o[i].call(r,e,t,n))return}catch(e){rt(e,r,"errorCaptured hook")}}rt(e,t,n)}finally{_e()}}function nt(e,t,n,r,o){var i;try{(i=n?e.apply(t,n):e.call(t))&&!i._isVue&&p(i)&&!i._handled&&(i.catch((function(e){return tt(e,r,o+" (Promise/async)")})),i._handled=!0)}catch(e){tt(e,r,o)}return i}function rt(e,t,n){if(H.errorHandler)try{return H.errorHandler.call(null,e,t,n)}catch(t){t!==e&&ot(t,null,"config.errorHandler")}ot(e,t,n)}function ot(e,t,n){if(ue("Error in "+n+': "'+e.toString()+'"',t),!K&&!W||"undefined"==typeof console)throw e;console.error(e)}var it,at,st,ct=!1,lt=[],ut=!1;function ft(){ut=!1;var e=lt.slice(0);lt.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&se(Promise)){var dt=Promise.resolve();it=function(){dt.then(ft),ee&&setTimeout(I)},ct=!0}else if(Y||"undefined"==typeof MutationObserver||!se(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())it=void 0!==n&&se(n)?function(){n(ft)}:function(){setTimeout(ft,0)};else{var pt=1,vt=new MutationObserver(ft),ht=document.createTextNode(String(pt));vt.observe(ht,{characterData:!0}),it=function(){pt=(pt+1)%2,ht.data=String(pt)},ct=!0}function mt(e,t){var n;if(lt.push((function(){if(e)try{e.call(t)}catch(e){tt(e,t,"nextTick")}else n&&n(t)})),ut||(ut=!0,it()),!e&&"undefined"!=typeof Promise)return new Promise((function(e){n=e}))}var gt,yt=K&&window.performance;yt&&yt.mark&&yt.measure&&yt.clearMarks&&yt.clearMeasures&&(at=function(e){return yt.mark(e)},st=function(e,t,n){yt.measure(e,t,n),yt.clearMarks(t),yt.clearMarks(n)});var bt=m("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,require"),_t=function(e,t){ue('Property or method "'+t+'" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',e)},wt=function(e,t){ue('Property "'+t+'" must be accessed with "$data.'+t+'" because properties starting with "$" or "_" are not proxied in the Vue instance to prevent conflicts with Vue internals. See: https://vuejs.org/v2/api/#data',e)},$t="undefined"!=typeof Proxy&&se(Proxy);if($t){var xt=m("stop,prevent,self,ctrl,shift,alt,meta,exact");H.keyCodes=new Proxy(H.keyCodes,{set:function(e,t,n){return xt(t)?(ue("Avoid overwriting built-in modifier in config.keyCodes: ."+t),!1):(e[t]=n,!0)}})}var At={has:function(e,t){var n=t in e,r=bt(t)||"string"==typeof t&&"_"===t.charAt(0)&&!(t in e.$data);return n||r||(t in e.$data?wt(e,t):_t(e,t)),n||!r}},kt={get:function(e,t){return"string"!=typeof t||t in e||(t in e.$data?wt(e,t):_t(e,t)),e[t]}};gt=function(e){if($t){var t=e.$options,n=t.render&&t.render._withStripped?kt:At;e._renderProxy=new Proxy(e,n)}else e._renderProxy=e};var Ct=new ce;function St(e){!function e(t,n){var r,o,i=Array.isArray(t);if(!(!i&&!s(t)||Object.isFrozen(t)||t instanceof we)){if(t.__ob__){var a=t.__ob__.dep.id;if(n.has(a))return;n.add(a)}if(i)for(r=t.length;r--;)e(t[r],n);else for(o=Object.keys(t),r=o.length;r--;)e(t[o[r]],n)}}(e,Ct),Ct.clear()}var Ot=$((function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}}));function Tt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return nt(r,null,arguments,t,"v-on handler");for(var o=r.slice(),i=0;i<o.length;i++)nt(o[i],null,e,t,"v-on handler")}return n.fns=e,n}function Mt(e,t,n,o,a,s){var c,l,u,f;for(c in e)l=e[c],u=t[c],f=Ot(c),r(l)?ue('Invalid handler for event "'+f.name+'": got '+String(l),s):r(u)?(r(l.fns)&&(l=e[c]=Tt(l,s)),i(f.once)&&(l=e[c]=a(f.name,l,f.capture)),n(f.name,l,f.capture,f.passive,f.params)):l!==u&&(u.fns=l,e[c]=u);for(c in t)r(e[c])&&o((f=Ot(c)).name,t[c],f.capture)}function jt(e,t,n){var a;e instanceof we&&(e=e.data.hook||(e.data.hook={}));var s=e[t];function c(){n.apply(this,arguments),b(a.fns,c)}r(s)?a=Tt([c]):o(s.fns)&&i(s.merged)?(a=s).fns.push(c):a=Tt([s,c]),a.merged=!0,e[t]=a}function It(e,t,n,r,i){if(o(t)){if(w(t,n))return e[n]=t[n],i||delete t[n],!0;if(w(t,r))return e[n]=t[r],i||delete t[r],!0}return!1}function Et(e){return a(e)?[Ae(e)]:Array.isArray(e)?function e(t,n){var s,c,l,u,f=[];for(s=0;s<t.length;s++)r(c=t[s])||"boolean"==typeof c||(l=f.length-1,u=f[l],Array.isArray(c)?c.length>0&&(Nt((c=e(c,(n||"")+"_"+s))[0])&&Nt(u)&&(f[l]=Ae(u.text+c[0].text),c.shift()),f.push.apply(f,c)):a(c)?Nt(u)?f[l]=Ae(u.text+c):""!==c&&f.push(Ae(c)):Nt(c)&&Nt(u)?f[l]=Ae(u.text+c.text):(i(t._isVList)&&o(c.tag)&&r(c.key)&&o(n)&&(c.key="__vlist"+n+"_"+s+"__"),f.push(c)));return f}(e):void 0}function Nt(e){return o(e)&&o(e.text)&&!1===e.isComment}function Dt(e,t){if(e){for(var n=Object.create(null),r=le?Reflect.ownKeys(e):Object.keys(e),o=0;o<r.length;o++){var i=r[o];if("__ob__"!==i){for(var a=e[i].from,s=t;s;){if(s._provided&&w(s._provided,a)){n[i]=s._provided[a];break}s=s.$parent}if(!s)if("default"in e[i]){var c=e[i].default;n[i]="function"==typeof c?c.call(t):c}else ue('Injection "'+i+'" not found',t)}}return n}}function Lt(e,t){if(!e||!e.length)return{};for(var n={},r=0,o=e.length;r<o;r++){var i=e[r],a=i.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,i.context!==t&&i.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(i);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===i.tag?c.push.apply(c,i.children||[]):c.push(i)}}for(var l in n)n[l].every(Pt)&&delete n[l];return n}function Pt(e){return e.isComment&&!e.asyncFactory||" "===e.text}function Ft(t,n,r){var o,i=Object.keys(n).length>0,a=t?!!t.$stable:!i,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!i&&!r.$hasNormal)return r;for(var c in o={},t)t[c]&&"$"!==c[0]&&(o[c]=Rt(n,c,t[c]))}else o={};for(var l in n)l in o||(o[l]=Ht(n,l));return t&&Object.isExtensible(t)&&(t._normalized=o),B(o,"$stable",a),B(o,"$key",s),B(o,"$hasNormal",i),o}function Rt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:Et(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function Ht(e,t){return function(){return e[t]}}function Ut(e,t){var n,r,i,a,c;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),r=0,i=e.length;r<i;r++)n[r]=t(e[r],r);else if("number"==typeof e)for(n=new Array(e),r=0;r<e;r++)n[r]=t(r+1,r);else if(s(e))if(le&&e[Symbol.iterator]){n=[];for(var l=e[Symbol.iterator](),u=l.next();!u.done;)n.push(t(u.value,n.length)),u=l.next()}else for(a=Object.keys(e),n=new Array(a.length),r=0,i=a.length;r<i;r++)c=a[r],n[r]=t(e[c],c,r);return o(n)||(n=[]),n._isVList=!0,n}function Vt(e,t,n,r){var o,i=this.$scopedSlots[e];i?(n=n||{},r&&(s(r)||ue("slot v-bind without argument expects an Object",this),n=M(M({},r),n)),o=i(n)||t):o=this.$slots[e]||t;var a=n&&n.slot;return a?this.$createElement("template",{slot:a},o):o}function Bt(e){return Je(this.$options,"filters",e,!0)||N}function zt(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function qt(e,t,n,r,o){var i=H.keyCodes[t]||n;return o&&r&&!H.keyCodes[t]?zt(o,r):i?zt(i,e):r?S(r)!==t:void 0}function Jt(e,t,n,r,o){if(n)if(s(n)){var i;Array.isArray(n)&&(n=j(n));var a=function(a){if("class"===a||"style"===a||y(a))i=e;else{var s=e.attrs&&e.attrs.type;i=r||H.mustUseProp(t,s,a)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=A(a),l=S(a);c in i||l in i||(i[a]=n[a],o&&((e.on||(e.on={}))["update:"+a]=function(e){n[a]=e}))};for(var c in n)a(c)}else ue("v-bind without argument expects an Object or Array value",this);return e}function Kt(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t||Zt(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r}function Wt(e,t,n){return Zt(e,"__once__"+t+(n?"_"+n:""),!0),e}function Zt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&Gt(e[r],t+"_"+r,n);else Gt(e,t,n)}function Gt(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function Yt(e,t){if(t)if(u(t)){var n=e.on=e.on?M({},e.on):{};for(var r in t){var o=n[r],i=t[r];n[r]=o?[].concat(o,i):i}}else ue("v-on without argument expects an Object value",this);return e}function Xt(e,t,n,r){t=t||{$stable:!n};for(var o=0;o<e.length;o++){var i=e[o];Array.isArray(i)?Xt(i,t,n):i&&(i.proxy&&(i.fn.proxy=!0),t[i.key]=i.fn)}return r&&(t.$key=r),t}function Qt(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r?e[t[n]]=t[n+1]:""!==r&&null!==r&&ue("Invalid value for dynamic directive argument (expected string or null): "+r,this)}return e}function en(e,t){return"string"==typeof e?t+e:e}function tn(e){e._o=Wt,e._n=h,e._s=v,e._l=Ut,e._t=Vt,e._q=D,e._i=L,e._m=Kt,e._f=Bt,e._k=qt,e._b=Jt,e._v=Ae,e._e=xe,e._u=Xt,e._g=Yt,e._d=Qt,e._p=en}function nn(t,n,r,o,a){var s,c=this,l=a.options;w(o,"_uid")?(s=Object.create(o))._original=o:(s=o,o=o._original);var u=i(l._compiled),f=!u;this.data=t,this.props=n,this.children=r,this.parent=o,this.listeners=t.on||e,this.injections=Dt(l.inject,o),this.slots=function(){return c.$slots||Ft(t.scopedSlots,c.$slots=Lt(r,o)),c.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return Ft(t.scopedSlots,this.slots())}}),u&&(this.$options=l,this.$slots=this.slots(),this.$scopedSlots=Ft(t.scopedSlots,this.$slots)),l._scopeId?this._c=function(e,t,n,r){var i=un(s,e,t,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=l._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return un(s,e,t,n,r,f)}}function rn(e,t,n,r,o){var i=ke(e);return i.fnContext=n,i.fnOptions=r,(i.devtoolsMeta=i.devtoolsMeta||{}).renderContext=o,t.slot&&((i.data||(i.data={})).slot=t.slot),i}function on(e,t){for(var n in t)e[A(n)]=t[n]}tn(nn.prototype);var an={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var n=e;an.prepatch(n,n)}else(e.componentInstance=function(e,t){var n={_isComponent:!0,_parentVnode:e,parent:t},r=e.data.inlineTemplate;return o(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns),new e.componentOptions.Ctor(n)}(e,_n)).$mount(t?e.elm:void 0,t)},prepatch:function(t,n){var r=n.componentOptions;!function(t,n,r,o,i){wn=!0;var a=o.data.scopedSlots,s=t.$scopedSlots,c=!!(a&&!a.$stable||s!==e&&!s.$stable||a&&t.$scopedSlots.$key!==a.$key),l=!!(i||t.$options._renderChildren||c);if(t.$options._parentVnode=o,t.$vnode=o,t._vnode&&(t._vnode.parent=o),t.$options._renderChildren=i,t.$attrs=o.data.attrs||e,t.$listeners=r||e,n&&t.$options.props){Me(!1);for(var u=t._props,f=t.$options._propKeys||[],d=0;d<f.length;d++){var p=f[d],v=t.$options.props;u[p]=Ke(p,v,n,t)}Me(!0),t.$options.propsData=n}r=r||e;var h=t.$options._parentListeners;t.$options._parentListeners=r,bn(t,r,h),l&&(t.$slots=Lt(i,o.context),t.$forceUpdate()),wn=!1}(n.componentInstance=t.componentInstance,r.propsData,r.listeners,n,r.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,kn(r,"mounted")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,Sn.push(t)):An(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?function e(t,n){if(!(n&&(t._directInactive=!0,xn(t))||t._inactive)){t._inactive=!0;for(var r=0;r<t.$children.length;r++)e(t.$children[r]);kn(t,"deactivated")}}(t,!0):t.$destroy())}},sn=Object.keys(an);function cn(t,n,a,c,l){if(!r(t)){var u=a.$options._base;if(s(t)&&(t=u.extend(t)),"function"==typeof t){var f;if(r(t.cid)&&void 0===(t=function(e,t){if(i(e.error)&&o(e.errorComp))return e.errorComp;if(o(e.resolved))return e.resolved;var n=dn;if(n&&o(e.owners)&&-1===e.owners.indexOf(n)&&e.owners.push(n),i(e.loading)&&o(e.loadingComp))return e.loadingComp;if(n&&!o(e.owners)){var a=e.owners=[n],c=!0,l=null,u=null;n.$on("hook:destroyed",(function(){return b(a,n)}));var f=function(e){for(var t=0,n=a.length;t<n;t++)a[t].$forceUpdate();e&&(a.length=0,null!==l&&(clearTimeout(l),l=null),null!==u&&(clearTimeout(u),u=null))},d=P((function(n){e.resolved=pn(n,t),c?a.length=0:f(!0)})),v=P((function(t){ue("Failed to resolve async component: "+String(e)+(t?"\nReason: "+t:"")),o(e.errorComp)&&(e.error=!0,f(!0))})),h=e(d,v);return s(h)&&(p(h)?r(e.resolved)&&h.then(d,v):p(h.component)&&(h.component.then(d,v),o(h.error)&&(e.errorComp=pn(h.error,t)),o(h.loading)&&(e.loadingComp=pn(h.loading,t),0===h.delay?e.loading=!0:l=setTimeout((function(){l=null,r(e.resolved)&&r(e.error)&&(e.loading=!0,f(!1))}),h.delay||200)),o(h.timeout)&&(u=setTimeout((function(){u=null,r(e.resolved)&&v("timeout ("+h.timeout+"ms)")}),h.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}(f=t,u)))return function(e,t,n,r,o){var i=xe();return i.asyncFactory=e,i.asyncMeta={data:t,context:n,children:r,tag:o},i}(f,n,a,c,l);n=n||{},Wn(t),o(n.model)&&function(e,t){var n=e.model&&e.model.prop||"value",r=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[n]=t.model.value;var i=t.on||(t.on={}),a=i[r],s=t.model.callback;o(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(i[r]=[s].concat(a)):i[r]=s}(t.options,n);var d=function(e,t,n){var i=t.options.props;if(!r(i)){var a={},s=e.attrs,c=e.props;if(o(s)||o(c))for(var l in i){var u=S(l),f=l.toLowerCase();l!==f&&s&&w(s,f)&&fe('Prop "'+f+'" is passed to component '+de(n||t)+', but the declared prop name is "'+l+'". Note that HTML attributes are case-insensitive and camelCased props need to use their kebab-case equivalents when using in-DOM templates. You should probably use "'+u+'" instead of "'+l+'".'),It(a,c,l,u,!0)||It(a,s,l,u,!1)}return a}}(n,t,l);if(i(t.options.functional))return function(t,n,r,i,a){var s=t.options,c={},l=s.props;if(o(l))for(var u in l)c[u]=Ke(u,l,n||e);else o(r.attrs)&&on(c,r.attrs),o(r.props)&&on(c,r.props);var f=new nn(r,c,a,i,t),d=s.render.call(null,f._c,f);if(d instanceof we)return rn(d,r,f.parent,s,f);if(Array.isArray(d)){for(var p=Et(d)||[],v=new Array(p.length),h=0;h<p.length;h++)v[h]=rn(p[h],r,f.parent,s,f);return v}}(t,d,n,a,c);var v=n.on;if(n.on=n.nativeOn,i(t.options.abstract)){var h=n.slot;n={},h&&(n.slot=h)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<sn.length;n++){var r=sn[n],o=t[r],i=an[r];o===i||o&&o._merged||(t[r]=o?ln(i,o):i)}}(n);var m=t.options.name||l;return new we("vue-component-"+t.cid+(m?"-"+m:""),n,void 0,void 0,void 0,a,{Ctor:t,propsData:d,listeners:v,tag:l,children:c},f)}ue("Invalid Component definition: "+String(t),a)}}function ln(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}function un(e,t,n,c,l,u){return(Array.isArray(n)||a(n))&&(l=c,c=n,n=void 0),i(u)&&(l=2),function(e,t,n,c,l){if(o(n)&&o(n.__ob__))return ue("Avoid using observed data object as vnode data: "+JSON.stringify(n)+"\nAlways create fresh vnode data objects in each render!",e),xe();if(o(n)&&o(n.is)&&(t=n.is),!t)return xe();var u,f,d;(o(n)&&o(n.key)&&!a(n.key)&&ue("Avoid using non-primitive value as key, use string/number value instead.",e),Array.isArray(c)&&"function"==typeof c[0]&&((n=n||{}).scopedSlots={default:c[0]},c.length=0),2===l?c=Et(c):1===l&&(c=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(c)),"string"==typeof t)?(f=e.$vnode&&e.$vnode.ns||H.getTagNamespace(t),H.isReservedTag(t)?(o(n)&&o(n.nativeOn)&&ue("The .native modifier for v-on is only valid on components but it was used on <"+t+">.",e),u=new we(H.parsePlatformTagName(t),n,c,void 0,void 0,e)):u=n&&n.pre||!o(d=Je(e.$options,"components",t))?new we(t,n,c,void 0,void 0,e):cn(d,n,e,c,t)):u=cn(t,n,e,c);return Array.isArray(u)?u:o(u)?(o(f)&&function e(t,n,a){if(t.ns=n,"foreignObject"===t.tag&&(n=void 0,a=!0),o(t.children))for(var s=0,c=t.children.length;s<c;s++){var l=t.children[s];o(l.tag)&&(r(l.ns)||i(a)&&"svg"!==l.tag)&&e(l,n,a)}}(u,f),o(n)&&function(e){s(e.style)&&St(e.style),s(e.class)&&St(e.class)}(n),u):xe()}(e,t,n,c,l)}var fn,dn=null;function pn(e,t){return(e.__esModule||le&&"Module"===e[Symbol.toStringTag])&&(e=e.default),s(e)?t.extend(e):e}function vn(e){return e.isComment&&e.asyncFactory}function hn(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];if(o(n)&&(o(n.componentOptions)||vn(n)))return n}}function mn(e,t){fn.$on(e,t)}function gn(e,t){fn.$off(e,t)}function yn(e,t){var n=fn;return function r(){var o=t.apply(null,arguments);null!==o&&n.$off(e,r)}}function bn(e,t,n){fn=e,Mt(t,n||{},mn,gn,yn,e),fn=void 0}var _n=null,wn=!1;function $n(e){var t=_n;return _n=e,function(){_n=t}}function xn(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function An(e,t){if(t){if(e._directInactive=!1,xn(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)An(e.$children[n]);kn(e,"activated")}}function kn(e,t){be();var n=e.$options[t],r=t+" hook";if(n)for(var o=0,i=n.length;o<i;o++)nt(n[o],e,null,e,r);e._hasHookEvent&&e.$emit("hook:"+t),_e()}var Cn=[],Sn=[],On={},Tn={},Mn=!1,jn=!1,In=0,En=0,Nn=Date.now;if(K&&!Y){var Dn=window.performance;Dn&&"function"==typeof Dn.now&&Nn()>document.createEvent("Event").timeStamp&&(Nn=function(){return Dn.now()})}function Ln(){var e,t;for(En=Nn(),jn=!0,Cn.sort((function(e,t){return e.id-t.id})),In=0;In<Cn.length;In++)if((e=Cn[In]).before&&e.before(),t=e.id,On[t]=null,e.run(),null!=On[t]&&(Tn[t]=(Tn[t]||0)+1,Tn[t]>100)){ue("You may have an infinite update loop "+(e.user?'in watcher with expression "'+e.expression+'"':"in a component render function."),e.vm);break}var n=Sn.slice(),r=Cn.slice();In=Cn.length=Sn.length=0,On={},Tn={},Mn=jn=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,An(e[t],!0)}(n),function(e){for(var t=e.length;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&kn(r,"updated")}}(r),ae&&H.devtools&&ae.emit("flush")}var Pn=0,Fn=function(e,t,n,r,o){this.vm=e,o&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Pn,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ce,this.newDepIds=new ce,this.expression=t.toString(),"function"==typeof t?this.getter=t:(this.getter=function(e){if(!q.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=I,ue('Failed watching path: "'+t+'" Watcher only accepts simple dot-delimited paths. For full control, use a function instead.',e))),this.value=this.lazy?void 0:this.get()};Fn.prototype.get=function(){var e;be(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;tt(e,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&St(e),_e(),this.cleanupDeps()}return e},Fn.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},Fn.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},Fn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==On[t]){if(On[t]=!0,jn){for(var n=Cn.length-1;n>In&&Cn[n].id>e.id;)n--;Cn.splice(n+1,0,e)}else Cn.push(e);if(!Mn){if(Mn=!0,!H.async)return void Ln();mt(Ln)}}}(this)},Fn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||s(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){tt(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Fn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Fn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Fn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||b(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Rn={enumerable:!0,configurable:!0,get:I,set:I};function Hn(e,t,n){Rn.get=function(){return this[t][n]},Rn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Rn)}function Un(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},o=e.$options._propKeys=[],i=!e.$parent;i||Me(!1);var a=function(a){o.push(a);var s=Ke(a,t,n,e),c=S(a);(y(c)||H.isReservedAttr(c))&&ue('"'+c+'" is a reserved attribute and cannot be used as component prop.',e),Ee(r,a,s,(function(){i||wn||ue("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: \""+a+'"',e)})),a in e||Hn(e,"_props",a)};for(var s in t)a(s);Me(!0)}(e,t.props),t.methods&&function(e,t){var n=e.$options.props;for(var r in t)"function"!=typeof t[r]&&ue('Method "'+r+'" has type "'+typeof t[r]+'" in the component definition. Did you reference the function correctly?',e),n&&w(n,r)&&ue('Method "'+r+'" has already been defined as a prop.',e),r in e&&V(r)&&ue('Method "'+r+'" conflicts with an existing Vue instance method. Avoid defining component methods that start with _ or $.'),e[r]="function"!=typeof t[r]?I:O(t[r],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;u(t=e._data="function"==typeof t?function(e,t){be();try{return e.call(t,t)}catch(e){return tt(e,t,"data()"),{}}finally{_e()}}(t,e):t||{})||(t={},ue("data functions should return an object:\nhttps://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",e));for(var n=Object.keys(t),r=e.$options.props,o=e.$options.methods,i=n.length;i--;){var a=n[i];o&&w(o,a)&&ue('Method "'+a+'" has already been defined as a data property.',e),r&&w(r,a)?ue('The data property "'+a+'" is already declared as a prop. Use prop default value instead.',e):V(a)||Hn(e,"_data",a)}Ie(t,!0)}(e):Ie(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=ie();for(var o in t){var i=t[o],a="function"==typeof i?i:i.get;null==a&&ue('Getter is missing for computed property "'+o+'".',e),r||(n[o]=new Fn(e,a||I,I,Vn)),o in e?o in e.$data?ue('The computed property "'+o+'" is already defined in data.',e):e.$options.props&&o in e.$options.props&&ue('The computed property "'+o+'" is already defined as a prop.',e):Bn(e,o,i)}}(e,t.computed),t.watch&&t.watch!==ne&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var o=0;o<r.length;o++)Jn(e,n,r[o]);else Jn(e,n,r)}}(e,t.watch)}var Vn={lazy:!0};function Bn(e,t,n){var r=!ie();"function"==typeof n?(Rn.get=r?zn(t):qn(n),Rn.set=I):(Rn.get=n.get?r&&!1!==n.cache?zn(t):qn(n.get):I,Rn.set=n.set||I),Rn.set===I&&(Rn.set=function(){ue('Computed property "'+t+'" was assigned to but it has no setter.',this)}),Object.defineProperty(e,t,Rn)}function zn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),ge.target&&t.depend(),t.value}}function qn(e){return function(){return e.call(this,this)}}function Jn(e,t,n,r){return u(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var Kn=0;function Wn(e){var t=e.options;if(e.super){var n=Wn(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var o in n)n[o]!==r[o]&&(t||(t={}),t[o]=n[o]);return t}(e);r&&M(e.extendOptions,r),(t=e.options=qe(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function Zn(e){this instanceof Zn||ue("Vue is a constructor and should be called with the `new` keyword"),this._init(e)}function Gn(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,o=e._Ctor||(e._Ctor={});if(o[r])return o[r];var i=e.name||n.options.name;i&&Be(i);var a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=qe(n.options,e),a.super=n,a.options.props&&function(e){var t=e.options.props;for(var n in t)Hn(e.prototype,"_props",n)}(a),a.options.computed&&function(e){var t=e.options.computed;for(var n in t)Bn(e.prototype,n,t[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,F.forEach((function(e){a[e]=n[e]})),i&&(a.options.components[i]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=M({},a.options),o[r]=a,a}}function Yn(e){return e&&(e.Ctor.options.name||e.tag)}function Xn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function Qn(e,t){var n=e.cache,r=e.keys,o=e._vnode;for(var i in n){var a=n[i];if(a){var s=Yn(a.componentOptions);s&&!t(s)&&er(n,i,r,o)}}}function er(e,t,n,r){var o=e[t];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),e[t]=null,b(n,t)}!function(t){t.prototype._init=function(t){var n,r,o=this;o._uid=Kn++,H.performance&&at&&(n="vue-perf-start:"+o._uid,r="vue-perf-end:"+o._uid,at(n)),o._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(o,t):o.$options=qe(Wn(o.constructor),t||{},o),gt(o),o._self=o,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(o),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&bn(e,t)}(o),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,o=r&&r.context;t.$slots=Lt(n._renderChildren,o),t.$scopedSlots=e,t._c=function(e,n,r,o){return un(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return un(t,e,n,r,o,!0)};var i=r&&r.data;Ee(t,"$attrs",i&&i.attrs||e,(function(){!wn&&ue("$attrs is readonly.",t)}),!0),Ee(t,"$listeners",n._parentListeners||e,(function(){!wn&&ue("$listeners is readonly.",t)}),!0)}(o),kn(o,"beforeCreate"),function(e){var t=Dt(e.$options.inject,e);t&&(Me(!1),Object.keys(t).forEach((function(n){Ee(e,n,t[n],(function(){ue('Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. injection being mutated: "'+n+'"',e)}))})),Me(!0))}(o),Un(o),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(o),kn(o,"created"),H.performance&&at&&(o._name=de(o,!1),at(r),st("vue "+o._name+" init",n,r)),o.$options.el&&o.$mount(o.$options.el)}}(Zn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};t.set=function(){ue("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){ue("$props is readonly.",this)},Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Ne,e.prototype.$delete=De,e.prototype.$watch=function(e,t,n){if(u(t))return Jn(this,e,t,n);(n=n||{}).user=!0;var r=new Fn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){tt(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(Zn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var o=0,i=e.length;o<i;o++)r.$on(e[o],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,o=e.length;r<o;r++)n.$off(e[r],t);return n}var i,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((i=a[s])===t||i.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this,n=e.toLowerCase();n!==e&&t._events[n]&&fe('Event "'+n+'" is emitted in component '+de(t)+' but the handler is registered for "'+e+'". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "'+S(e)+'" instead of "'+e+'".');var r=t._events[e];if(r){r=r.length>1?T(r):r;for(var o=T(arguments,1),i='event handler for "'+e+'"',a=0,s=r.length;a<s;a++)nt(r[a],t,o,t,i)}return t}}(Zn),function(e){e.prototype._update=function(e,t){var n=this,r=n.$el,o=n._vnode,i=$n(n);n._vnode=e,n.$el=o?n.__patch__(o,e):n.__patch__(n.$el,e,t,!1),i(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){kn(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||b(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),kn(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(Zn),function(e){tn(e.prototype),e.prototype.$nextTick=function(e){return mt(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,o=n._parentVnode;o&&(t.$scopedSlots=Ft(o.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=o;try{dn=t,e=r.call(t._renderProxy,t.$createElement)}catch(n){if(tt(n,t,"render"),t.$options.renderError)try{e=t.$options.renderError.call(t._renderProxy,t.$createElement,n)}catch(n){tt(n,t,"renderError"),e=t._vnode}else e=t._vnode}finally{dn=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof we||(Array.isArray(e)&&ue("Multiple root nodes returned from render function. Render function should return a single root node.",t),e=xe()),e.parent=o,e}}(Zn);var tr=[String,RegExp,Array],nr={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:tr,exclude:tr,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)er(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",(function(t){Qn(e,(function(e){return Xn(t,e)}))})),this.$watch("exclude",(function(t){Qn(e,(function(e){return!Xn(t,e)}))}))},render:function(){var e=this.$slots.default,t=hn(e),n=t&&t.componentOptions;if(n){var r=Yn(n),o=this.include,i=this.exclude;if(o&&(!r||!Xn(o,r))||i&&r&&Xn(i,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,b(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&er(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return H},set:function(){ue("Do not replace the Vue.config object, set individual fields instead.")}};Object.defineProperty(e,"config",t),e.util={warn:ue,extend:M,mergeOptions:qe,defineReactive:Ee},e.set=Ne,e.delete=De,e.nextTick=mt,e.observable=function(e){return Ie(e),e},e.options=Object.create(null),F.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,M(e.options.components,nr),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=T(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=qe(this.options,e),this}}(e),Gn(e),function(e){F.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&Be(e),"component"===t&&u(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Zn),Object.defineProperty(Zn.prototype,"$isServer",{get:ie}),Object.defineProperty(Zn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Zn,"FunctionalRenderContext",{value:nn}),Zn.version="2.6.12";var rr=m("style,class"),or=m("input,textarea,option,select,progress"),ir=function(e,t,n){return"value"===n&&or(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},ar=m("contenteditable,draggable,spellcheck"),sr=m("events,caret,typing,plaintext-only"),cr=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),lr="http://www.w3.org/1999/xlink",ur=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},fr=function(e){return ur(e)?e.slice(6,e.length):""},dr=function(e){return null==e||!1===e};function pr(e){for(var t=e.data,n=e,r=e;o(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=vr(r.data,t));for(;o(n=n.parent);)n&&n.data&&(t=vr(t,n.data));return i=t.staticClass,a=t.class,o(i)||o(a)?hr(i,mr(a)):"";var i,a}function vr(e,t){return{staticClass:hr(e.staticClass,t.staticClass),class:o(e.class)?[e.class,t.class]:t.class}}function hr(e,t){return e?t?e+" "+t:e:t||""}function mr(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,i=e.length;r<i;r++)o(t=mr(e[r]))&&""!==t&&(n&&(n+=" "),n+=t);return n}(e):s(e)?function(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}(e):"string"==typeof e?e:""}var gr={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},yr=m("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),br=m("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),_r=function(e){return yr(e)||br(e)};function wr(e){return br(e)?"svg":"math"===e?"math":void 0}var $r=Object.create(null),xr=m("text,number,password,search,email,tel,url");function Ar(e){if("string"==typeof e){var t=document.querySelector(e);return t||(ue("Cannot find element: "+e),document.createElement("div"))}return e}var kr=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e||t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(e,t){return document.createElementNS(gr[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,"")}}),Cr={create:function(e,t){Sr(t)},update:function(e,t){e.data.ref!==t.data.ref&&(Sr(e,!0),Sr(t))},destroy:function(e){Sr(e,!0)}};function Sr(e,t){var n=e.data.ref;if(o(n)){var r=e.context,i=e.componentInstance||e.elm,a=r.$refs;t?Array.isArray(a[n])?b(a[n],i):a[n]===i&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])?a[n].indexOf(i)<0&&a[n].push(i):a[n]=[i]:a[n]=i}}var Or=new we("",{},[]),Tr=["create","activate","update","remove","destroy"];function Mr(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&o(e.data)===o(t.data)&&function(e,t){if("input"!==e.tag)return!0;var n,r=o(n=e.data)&&o(n=n.attrs)&&n.type,i=o(n=t.data)&&o(n=n.attrs)&&n.type;return r===i||xr(r)&&xr(i)}(e,t)||i(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&r(t.asyncFactory.error))}function jr(e,t,n){var r,i,a={};for(r=t;r<=n;++r)o(i=e[r].key)&&(a[i]=r);return a}var Ir={create:Er,update:Er,destroy:function(e){Er(e,Or)}};function Er(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,o,i=e===Or,a=t===Or,s=Dr(e.data.directives,e.context),c=Dr(t.data.directives,t.context),l=[],u=[];for(n in c)r=s[n],o=c[n],r?(o.oldValue=r.value,o.oldArg=r.arg,Pr(o,"update",t,e),o.def&&o.def.componentUpdated&&u.push(o)):(Pr(o,"bind",t,e),o.def&&o.def.inserted&&l.push(o));if(l.length){var f=function(){for(var n=0;n<l.length;n++)Pr(l[n],"inserted",t,e)};i?jt(t,"insert",f):f()}if(u.length&&jt(t,"postpatch",(function(){for(var n=0;n<u.length;n++)Pr(u[n],"componentUpdated",t,e)})),!i)for(n in s)c[n]||Pr(s[n],"unbind",e,e,a)}(e,t)}var Nr=Object.create(null);function Dr(e,t){var n,r,o=Object.create(null);if(!e)return o;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=Nr),o[Lr(r)]=r,r.def=Je(t.$options,"directives",r.name,!0);return o}function Lr(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function Pr(e,t,n,r,o){var i=e.def&&e.def[t];if(i)try{i(n.elm,e,n,r,o)}catch(r){tt(r,n.context,"directive "+e.name+" "+t+" hook")}}var Fr=[Cr,Ir];function Rr(e,t){var n=t.componentOptions;if(!(o(n)&&!1===n.Ctor.options.inheritAttrs||r(e.data.attrs)&&r(t.data.attrs))){var i,a,s=t.elm,c=e.data.attrs||{},l=t.data.attrs||{};for(i in o(l.__ob__)&&(l=t.data.attrs=M({},l)),l)a=l[i],c[i]!==a&&Hr(s,i,a);for(i in(Y||Q)&&l.value!==c.value&&Hr(s,"value",l.value),c)r(l[i])&&(ur(i)?s.removeAttributeNS(lr,fr(i)):ar(i)||s.removeAttribute(i))}}function Hr(e,t,n){e.tagName.indexOf("-")>-1?Ur(e,t,n):cr(t)?dr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):ar(t)?e.setAttribute(t,function(e,t){return dr(t)||"false"===t?"false":"contenteditable"===e&&sr(t)?t:"true"}(t,n)):ur(t)?dr(n)?e.removeAttributeNS(lr,fr(t)):e.setAttributeNS(lr,t,n):Ur(e,t,n)}function Ur(e,t,n){if(dr(n))e.removeAttribute(t);else{if(Y&&!X&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Vr={create:Rr,update:Rr};function Br(e,t){var n=t.elm,i=t.data,a=e.data;if(!(r(i.staticClass)&&r(i.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var s=pr(t),c=n._transitionClasses;o(c)&&(s=hr(s,mr(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var zr,qr,Jr,Kr,Wr,Zr,Gr,Yr,Xr={create:Br,update:Br},Qr=/[\w).+\-_$\]]/;function eo(e){var t,n,r,o,i,a=!1,s=!1,c=!1,l=!1,u=0,f=0,d=0,p=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(l)47===t&&92!==n&&(l=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||u||f||d){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:d++;break;case 41:d--;break;case 91:f++;break;case 93:f--;break;case 123:u++;break;case 125:u--}if(47===t){for(var v=r-1,h=void 0;v>=0&&" "===(h=e.charAt(v));v--);h&&Qr.test(h)||(l=!0)}}else void 0===o?(p=r+1,o=e.slice(0,r).trim()):m();function m(){(i||(i=[])).push(e.slice(p,r).trim()),p=r+1}if(void 0===o?o=e.slice(0,r).trim():0!==p&&m(),i)for(r=0;r<i.length;r++)o=to(o,i[r]);return o}function to(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),o=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==o?","+o:o)}function no(e,t){console.error("[Vue compiler]: "+e)}function ro(e,t){return e?e.map((function(e){return e[t]})).filter((function(e){return e})):[]}function oo(e,t,n,r,o){(e.props||(e.props=[])).push(ho({name:t,value:n,dynamic:o},r)),e.plain=!1}function io(e,t,n,r,o){(o?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(ho({name:t,value:n,dynamic:o},r)),e.plain=!1}function ao(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(ho({name:t,value:n},r))}function so(e,t,n,r,o,i,a,s){(e.directives||(e.directives=[])).push(ho({name:t,rawName:n,value:r,arg:o,isDynamicArg:i,modifiers:a},s)),e.plain=!1}function co(e,t,n){return n?"_p("+t+',"'+e+'")':e+t}function lo(t,n,r,o,i,a,s,c){var l;o=o||e,a&&o.prevent&&o.passive&&a("passive and prevent can't be used together. Passive handler can't prevent default event.",s),o.right?c?n="("+n+")==='click'?'contextmenu':("+n+")":"click"===n&&(n="contextmenu",delete o.right):o.middle&&(c?n="("+n+")==='click'?'mouseup':("+n+")":"click"===n&&(n="mouseup")),o.capture&&(delete o.capture,n=co("!",n,c)),o.once&&(delete o.once,n=co("~",n,c)),o.passive&&(delete o.passive,n=co("&",n,c)),o.native?(delete o.native,l=t.nativeEvents||(t.nativeEvents={})):l=t.events||(t.events={});var u=ho({value:r.trim(),dynamic:c},s);o!==e&&(u.modifiers=o);var f=l[n];Array.isArray(f)?i?f.unshift(u):f.push(u):l[n]=f?i?[u,f]:[f,u]:u,t.plain=!1}function uo(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}function fo(e,t,n){var r=po(e,":"+t)||po(e,"v-bind:"+t);if(null!=r)return eo(r);if(!1!==n){var o=po(e,t);if(null!=o)return JSON.stringify(o)}}function po(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var o=e.attrsList,i=0,a=o.length;i<a;i++)if(o[i].name===t){o.splice(i,1);break}return n&&delete e.attrsMap[t],r}function vo(e,t){for(var n=e.attrsList,r=0,o=n.length;r<o;r++){var i=n[r];if(t.test(i.name))return n.splice(r,1),i}}function ho(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function mo(e,t,n){var r=n||{},o=r.number,i="$$v";r.trim&&(i="(typeof $$v === 'string'? $$v.trim(): $$v)"),o&&(i="_n("+i+")");var a=go(t,i);e.model={value:"("+t+")",expression:JSON.stringify(t),callback:"function ($$v) {"+a+"}"}}function go(e,t){var n=function(e){if(e=e.trim(),zr=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<zr-1)return(Kr=e.lastIndexOf("."))>-1?{exp:e.slice(0,Kr),key:'"'+e.slice(Kr+1)+'"'}:{exp:e,key:null};for(qr=e,Kr=Wr=Zr=0;!bo();)_o(Jr=yo())?$o(Jr):91===Jr&&wo(Jr);return{exp:e.slice(0,Wr),key:e.slice(Wr+1,Zr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function yo(){return qr.charCodeAt(++Kr)}function bo(){return Kr>=zr}function _o(e){return 34===e||39===e}function wo(e){var t=1;for(Wr=Kr;!bo();)if(_o(e=yo()))$o(e);else if(91===e&&t++,93===e&&t--,0===t){Zr=Kr;break}}function $o(e){for(var t=e;!bo()&&(e=yo())!==t;);}function xo(e,t,n){var r=Yr;return function o(){var i=t.apply(null,arguments);null!==i&&Co(e,o,n,r)}}var Ao=ct&&!(te&&Number(te[1])<=53);function ko(e,t,n,r){if(Ao){var o=En,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=o||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Yr.addEventListener(e,t,re?{capture:n,passive:r}:n)}function Co(e,t,n,r){(r||Yr).removeEventListener(e,t._wrapper||t,n)}function So(e,t){if(!r(e.data.on)||!r(t.data.on)){var n=t.data.on||{},i=e.data.on||{};Yr=t.elm,function(e){if(o(e.__r)){var t=Y?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}o(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),Mt(n,i,ko,Co,xo,t.context),Yr=void 0}}var Oo,To={create:So,update:So};function Mo(e,t){if(!r(e.data.domProps)||!r(t.data.domProps)){var n,i,a=t.elm,s=e.data.domProps||{},c=t.data.domProps||{};for(n in o(c.__ob__)&&(c=t.data.domProps=M({},c)),s)n in c||(a[n]="");for(n in c){if(i=c[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),i===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=i;var l=r(i)?"":String(i);jo(a,l)&&(a.value=l)}else if("innerHTML"===n&&br(a.tagName)&&r(a.innerHTML)){(Oo=Oo||document.createElement("div")).innerHTML="<svg>"+i+"</svg>";for(var u=Oo.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;u.firstChild;)a.appendChild(u.firstChild)}else if(i!==s[n])try{a[n]=i}catch(e){}}}}function jo(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(o(r)){if(r.number)return h(n)!==h(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var Io={create:Mo,update:Mo},Eo=$((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function No(e){var t=Do(e.style);return e.staticStyle?M(e.staticStyle,t):t}function Do(e){return Array.isArray(e)?j(e):"string"==typeof e?Eo(e):e}var Lo,Po=/^--/,Fo=/\s*!important$/,Ro=function(e,t,n){if(Po.test(t))e.style.setProperty(t,n);else if(Fo.test(n))e.style.setProperty(S(t),n.replace(Fo,""),"important");else{var r=Uo(t);if(Array.isArray(n))for(var o=0,i=n.length;o<i;o++)e.style[r]=n[o];else e.style[r]=n}},Ho=["Webkit","Moz","ms"],Uo=$((function(e){if(Lo=Lo||document.createElement("div").style,"filter"!==(e=A(e))&&e in Lo)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Ho.length;n++){var r=Ho[n]+t;if(r in Lo)return r}}));function Vo(e,t){var n=t.data,i=e.data;if(!(r(n.staticStyle)&&r(n.style)&&r(i.staticStyle)&&r(i.style))){var a,s,c=t.elm,l=i.staticStyle,u=i.normalizedStyle||i.style||{},f=l||u,d=Do(t.data.style)||{};t.data.normalizedStyle=o(d.__ob__)?M({},d):d;var p=function(e,t){var n,r={};if(t)for(var o=e;o.componentInstance;)(o=o.componentInstance._vnode)&&o.data&&(n=No(o.data))&&M(r,n);(n=No(e.data))&&M(r,n);for(var i=e;i=i.parent;)i.data&&(n=No(i.data))&&M(r,n);return r}(t,!0);for(s in f)r(p[s])&&Ro(c,s,"");for(s in p)(a=p[s])!==f[s]&&Ro(c,s,null==a?"":a)}}var Bo={create:Vo,update:Vo},zo=/\s+/;function qo(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(zo).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Jo(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(zo).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function Ko(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&M(t,Wo(e.name||"v")),M(t,e),t}return"string"==typeof e?Wo(e):void 0}}var Wo=$((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),Zo=K&&!X,Go="transition",Yo="transitionend",Xo="animation",Qo="animationend";Zo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Go="WebkitTransition",Yo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Xo="WebkitAnimation",Qo="webkitAnimationEnd"));var ei=K?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function ti(e){ei((function(){ei(e)}))}function ni(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),qo(e,t))}function ri(e,t){e._transitionClasses&&b(e._transitionClasses,t),Jo(e,t)}function oi(e,t,n){var r=ai(e,t),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s="transition"===o?Yo:Qo,c=0,l=function(){e.removeEventListener(s,u),n()},u=function(t){t.target===e&&++c>=a&&l()};setTimeout((function(){c<a&&l()}),i+1),e.addEventListener(s,u)}var ii=/\b(transform|all)(,|$)/;function ai(e,t){var n,r=window.getComputedStyle(e),o=(r[Go+"Delay"]||"").split(", "),i=(r[Go+"Duration"]||"").split(", "),a=si(o,i),s=(r[Xo+"Delay"]||"").split(", "),c=(r[Xo+"Duration"]||"").split(", "),l=si(s,c),u=0,f=0;return"transition"===t?a>0&&(n="transition",u=a,f=i.length):"animation"===t?l>0&&(n="animation",u=l,f=c.length):f=(n=(u=Math.max(a,l))>0?a>l?"transition":"animation":null)?"transition"===n?i.length:c.length:0,{type:n,timeout:u,propCount:f,hasTransform:"transition"===n&&ii.test(r[Go+"Property"])}}function si(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map((function(t,n){return ci(t)+ci(e[n])})))}function ci(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function li(e,t){var n=e.elm;o(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var i=Ko(e.data.transition);if(!r(i)&&!o(n._enterCb)&&1===n.nodeType){for(var a=i.css,c=i.type,l=i.enterClass,u=i.enterToClass,f=i.enterActiveClass,d=i.appearClass,p=i.appearToClass,v=i.appearActiveClass,m=i.beforeEnter,g=i.enter,y=i.afterEnter,b=i.enterCancelled,_=i.beforeAppear,w=i.appear,$=i.afterAppear,x=i.appearCancelled,A=i.duration,k=_n,C=_n.$vnode;C&&C.parent;)k=C.context,C=C.parent;var S=!k._isMounted||!e.isRootInsert;if(!S||w||""===w){var O=S&&d?d:l,T=S&&v?v:f,M=S&&p?p:u,j=S&&_||m,I=S&&"function"==typeof w?w:g,E=S&&$||y,N=S&&x||b,D=h(s(A)?A.enter:A);null!=D&&fi(D,"enter",e);var L=!1!==a&&!X,F=pi(I),R=n._enterCb=P((function(){L&&(ri(n,M),ri(n,T)),R.cancelled?(L&&ri(n,O),N&&N(n)):E&&E(n),n._enterCb=null}));e.data.show||jt(e,"insert",(function(){var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),I&&I(n,R)})),j&&j(n),L&&(ni(n,O),ni(n,T),ti((function(){ri(n,O),R.cancelled||(ni(n,M),F||(di(D)?setTimeout(R,D):oi(n,c,R)))}))),e.data.show&&(t&&t(),I&&I(n,R)),L||F||R()}}}function ui(e,t){var n=e.elm;o(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var i=Ko(e.data.transition);if(r(i)||1!==n.nodeType)return t();if(!o(n._leaveCb)){var a=i.css,c=i.type,l=i.leaveClass,u=i.leaveToClass,f=i.leaveActiveClass,d=i.beforeLeave,p=i.leave,v=i.afterLeave,m=i.leaveCancelled,g=i.delayLeave,y=i.duration,b=!1!==a&&!X,_=pi(p),w=h(s(y)?y.leave:y);o(w)&&fi(w,"leave",e);var $=n._leaveCb=P((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[e.key]=null),b&&(ri(n,u),ri(n,f)),$.cancelled?(b&&ri(n,l),m&&m(n)):(t(),v&&v(n)),n._leaveCb=null}));g?g(x):x()}function x(){$.cancelled||(!e.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[e.key]=e),d&&d(n),b&&(ni(n,l),ni(n,f),ti((function(){ri(n,l),$.cancelled||(ni(n,u),_||(di(w)?setTimeout($,w):oi(n,c,$)))}))),p&&p(n,$),b||_||$())}}function fi(e,t,n){"number"!=typeof e?ue("<transition> explicit "+t+" duration is not a valid number - got "+JSON.stringify(e)+".",n.context):isNaN(e)&&ue("<transition> explicit "+t+" duration is NaN - the duration expression might be incorrect.",n.context)}function di(e){return"number"==typeof e&&!isNaN(e)}function pi(e){if(r(e))return!1;var t=e.fns;return o(t)?pi(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function vi(e,t){!0!==t.data.show&&li(t)}var hi=function(e){var t,n,s={},c=e.modules,l=e.nodeOps;for(t=0;t<Tr.length;++t)for(s[Tr[t]]=[],n=0;n<c.length;++n)o(c[n][Tr[t]])&&s[Tr[t]].push(c[n][Tr[t]]);function u(e){var t=l.parentNode(e);o(t)&&l.removeChild(t,e)}function d(e,t){return!t&&!e.ns&&!(H.ignoredElements.length&&H.ignoredElements.some((function(t){return f(t)?t.test(e.tag):t===e.tag})))&&H.isUnknownElement(e.tag)}var p=0;function v(e,t,n,r,a,c,u){if(o(e.elm)&&o(c)&&(e=c[u]=ke(e)),e.isRootInsert=!a,!function(e,t,n,r){var a=e.data;if(o(a)){var c=o(e.componentInstance)&&a.keepAlive;if(o(a=a.hook)&&o(a=a.init)&&a(e,!1),o(e.componentInstance))return h(e,t),g(n,e.elm,r),i(c)&&function(e,t,n,r){for(var i,a=e;a.componentInstance;)if(a=a.componentInstance._vnode,o(i=a.data)&&o(i=i.transition)){for(i=0;i<s.activate.length;++i)s.activate[i](Or,a);t.push(a);break}g(n,e.elm,r)}(e,t,n,r),!0}}(e,t,n,r)){var f=e.data,v=e.children,m=e.tag;o(m)?(f&&f.pre&&p++,d(e,p)&&ue("Unknown custom element: <"+m+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',e.context),e.elm=e.ns?l.createElementNS(e.ns,m):l.createElement(m,e),w(e),y(e,v,t),o(f)&&_(e,t),g(n,e.elm,r),f&&f.pre&&p--):i(e.isComment)?(e.elm=l.createComment(e.text),g(n,e.elm,r)):(e.elm=l.createTextNode(e.text),g(n,e.elm,r))}}function h(e,t){o(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,b(e)?(_(e,t),w(e)):(Sr(e),t.push(e))}function g(e,t,n){o(e)&&(o(n)?l.parentNode(n)===e&&l.insertBefore(e,t,n):l.appendChild(e,t))}function y(e,t,n){if(Array.isArray(t)){C(t);for(var r=0;r<t.length;++r)v(t[r],n,e.elm,null,!0,t,r)}else a(e.text)&&l.appendChild(e.elm,l.createTextNode(String(e.text)))}function b(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return o(e.tag)}function _(e,n){for(var r=0;r<s.create.length;++r)s.create[r](Or,e);o(t=e.data.hook)&&(o(t.create)&&t.create(Or,e),o(t.insert)&&n.push(e))}function w(e){var t;if(o(t=e.fnScopeId))l.setStyleScope(e.elm,t);else for(var n=e;n;)o(t=n.context)&&o(t=t.$options._scopeId)&&l.setStyleScope(e.elm,t),n=n.parent;o(t=_n)&&t!==e.context&&t!==e.fnContext&&o(t=t.$options._scopeId)&&l.setStyleScope(e.elm,t)}function $(e,t,n,r,o,i){for(;r<=o;++r)v(n[r],i,e,t,!1,n,r)}function x(e){var t,n,r=e.data;if(o(r))for(o(t=r.hook)&&o(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(o(t=e.children))for(n=0;n<e.children.length;++n)x(e.children[n])}function A(e,t,n){for(;t<=n;++t){var r=e[t];o(r)&&(o(r.tag)?(k(r),x(r)):u(r.elm))}}function k(e,t){if(o(t)||o(e.data)){var n,r=s.remove.length+1;for(o(t)?t.listeners+=r:t=function(e,t){function n(){0==--n.listeners&&u(e)}return n.listeners=t,n}(e.elm,r),o(n=e.componentInstance)&&o(n=n._vnode)&&o(n.data)&&k(n,t),n=0;n<s.remove.length;++n)s.remove[n](e,t);o(n=e.data.hook)&&o(n=n.remove)?n(e,t):t()}else u(e.elm)}function C(e){for(var t={},n=0;n<e.length;n++){var r=e[n],i=r.key;o(i)&&(t[i]?ue("Duplicate keys detected: '"+i+"'. This may cause an update error.",r.context):t[i]=!0)}}function S(e,t,n,r){for(var i=n;i<r;i++){var a=t[i];if(o(a)&&Mr(e,a))return i}}function O(e,t,n,a,c,u){if(e!==t){o(t.elm)&&o(a)&&(t=a[c]=ke(t));var f=t.elm=e.elm;if(i(e.isAsyncPlaceholder))o(t.asyncFactory.resolved)?I(e.elm,t,n):t.isAsyncPlaceholder=!0;else if(i(t.isStatic)&&i(e.isStatic)&&t.key===e.key&&(i(t.isCloned)||i(t.isOnce)))t.componentInstance=e.componentInstance;else{var d,p=t.data;o(p)&&o(d=p.hook)&&o(d=d.prepatch)&&d(e,t);var h=e.children,m=t.children;if(o(p)&&b(t)){for(d=0;d<s.update.length;++d)s.update[d](e,t);o(d=p.hook)&&o(d=d.update)&&d(e,t)}r(t.text)?o(h)&&o(m)?h!==m&&function(e,t,n,i,a){var s,c,u,f=0,d=0,p=t.length-1,h=t[0],m=t[p],g=n.length-1,y=n[0],b=n[g],_=!a;for(C(n);f<=p&&d<=g;)r(h)?h=t[++f]:r(m)?m=t[--p]:Mr(h,y)?(O(h,y,i,n,d),h=t[++f],y=n[++d]):Mr(m,b)?(O(m,b,i,n,g),m=t[--p],b=n[--g]):Mr(h,b)?(O(h,b,i,n,g),_&&l.insertBefore(e,h.elm,l.nextSibling(m.elm)),h=t[++f],b=n[--g]):Mr(m,y)?(O(m,y,i,n,d),_&&l.insertBefore(e,m.elm,h.elm),m=t[--p],y=n[++d]):(r(s)&&(s=jr(t,f,p)),r(c=o(y.key)?s[y.key]:S(y,t,f,p))?v(y,i,e,h.elm,!1,n,d):Mr(u=t[c],y)?(O(u,y,i,n,d),t[c]=void 0,_&&l.insertBefore(e,u.elm,h.elm)):v(y,i,e,h.elm,!1,n,d),y=n[++d]);f>p?$(e,r(n[g+1])?null:n[g+1].elm,n,d,g,i):d>g&&A(t,f,p)}(f,h,m,n,u):o(m)?(C(m),o(e.text)&&l.setTextContent(f,""),$(f,null,m,0,m.length-1,n)):o(h)?A(h,0,h.length-1):o(e.text)&&l.setTextContent(f,""):e.text!==t.text&&l.setTextContent(f,t.text),o(p)&&o(d=p.hook)&&o(d=d.postpatch)&&d(e,t)}}}function T(e,t,n){if(i(n)&&o(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r<t.length;++r)t[r].data.hook.insert(t[r])}var M=!1,j=m("attrs,class,staticClass,staticStyle,key");function I(e,t,n,r){var a,s=t.tag,c=t.data,l=t.children;if(r=r||c&&c.pre,t.elm=e,i(t.isComment)&&o(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(!function(e,t,n){return o(t.tag)?0===t.tag.indexOf("vue-component")||!d(t,n)&&t.tag.toLowerCase()===(e.tagName&&e.tagName.toLowerCase()):e.nodeType===(t.isComment?8:3)}(e,t,r))return!1;if(o(c)&&(o(a=c.hook)&&o(a=a.init)&&a(t,!0),o(a=t.componentInstance)))return h(t,n),!0;if(o(s)){if(o(l))if(e.hasChildNodes())if(o(a=c)&&o(a=a.domProps)&&o(a=a.innerHTML)){if(a!==e.innerHTML)return"undefined"==typeof console||M||(M=!0,console.warn("Parent: ",e),console.warn("server innerHTML: ",a),console.warn("client innerHTML: ",e.innerHTML)),!1}else{for(var u=!0,f=e.firstChild,p=0;p<l.length;p++){if(!f||!I(f,l[p],n,r)){u=!1;break}f=f.nextSibling}if(!u||f)return"undefined"==typeof console||M||(M=!0,console.warn("Parent: ",e),console.warn("Mismatching childNodes vs. VNodes: ",e.childNodes,l)),!1}else y(t,l,n);if(o(c)){var v=!1;for(var m in c)if(!j(m)){v=!0,_(t,n);break}!v&&c.class&&St(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,t,n,a){if(!r(t)){var c,u=!1,f=[];if(r(e))u=!0,v(t,f);else{var d=o(e.nodeType);if(!d&&Mr(e,t))O(e,t,f,null,null,a);else{if(d){if(1===e.nodeType&&e.hasAttribute("data-server-rendered")&&(e.removeAttribute("data-server-rendered"),n=!0),i(n)){if(I(e,t,f))return T(t,f,!0),e;ue("The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.")}c=e,e=new we(l.tagName(c).toLowerCase(),{},[],void 0,c)}var p=e.elm,h=l.parentNode(p);if(v(t,f,p._leaveCb?null:h,l.nextSibling(p)),o(t.parent))for(var m=t.parent,g=b(t);m;){for(var y=0;y<s.destroy.length;++y)s.destroy[y](m);if(m.elm=t.elm,g){for(var _=0;_<s.create.length;++_)s.create[_](Or,m);var w=m.data.hook.insert;if(w.merged)for(var $=1;$<w.fns.length;$++)w.fns[$]()}else Sr(m);m=m.parent}o(h)?A([e],0,0):o(e.tag)&&x(e)}}return T(t,f,u),t.elm}o(e)&&x(e)}}({nodeOps:kr,modules:[Vr,Xr,To,Io,Bo,K?{create:vi,activate:vi,remove:function(e,t){!0!==e.data.show?ui(e,t):t()}}:{}].concat(Fr)});X&&document.addEventListener("selectionchange",(function(){var e=document.activeElement;e&&e.vmodel&&xi(e,"input")}));var mi={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?jt(n,"postpatch",(function(){mi.componentUpdated(e,t,n)})):gi(e,t,n.context),e._vOptions=[].map.call(e.options,_i)):("textarea"===n.tag||xr(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",wi),e.addEventListener("compositionend",$i),e.addEventListener("change",$i),X&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){gi(e,t,n.context);var r=e._vOptions,o=e._vOptions=[].map.call(e.options,_i);o.some((function(e,t){return!D(e,r[t])}))&&(e.multiple?t.value.some((function(e){return bi(e,o)})):t.value!==t.oldValue&&bi(t.value,o))&&xi(e,"change")}}};function gi(e,t,n){yi(e,t,n),(Y||Q)&&setTimeout((function(){yi(e,t,n)}),0)}function yi(e,t,n){var r=t.value,o=e.multiple;if(!o||Array.isArray(r)){for(var i,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],o)i=L(r,_i(a))>-1,a.selected!==i&&(a.selected=i);else if(D(_i(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));o||(e.selectedIndex=-1)}else ue('<select multiple v-model="'+t.expression+'"> expects an Array value for its binding, but got '+Object.prototype.toString.call(r).slice(8,-1),n)}function bi(e,t){return t.every((function(t){return!D(t,e)}))}function _i(e){return"_value"in e?e._value:e.value}function wi(e){e.target.composing=!0}function $i(e){e.target.composing&&(e.target.composing=!1,xi(e.target,"input"))}function xi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ai(e){return!e.componentInstance||e.data&&e.data.transition?e:Ai(e.componentInstance._vnode)}var ki={model:mi,show:{bind:function(e,t,n){var r=t.value,o=(n=Ai(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&o?(n.data.show=!0,li(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Ai(n)).data&&n.data.transition?(n.data.show=!0,r?li(n,(function(){e.style.display=e.__vOriginalDisplay})):ui(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,o){o||(e.style.display=e.__vOriginalDisplay)}}},Ci={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Si(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Si(hn(t.children)):e}function Oi(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var o=n._parentListeners;for(var i in o)t[A(i)]=o[i];return t}function Ti(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Mi=function(e){return e.tag||vn(e)},ji=function(e){return"show"===e.name},Ii={name:"transition",props:Ci,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Mi)).length){n.length>1&&ue("<transition> can only be used on a single element. Use <transition-group> for lists.",this.$parent);var r=this.mode;r&&"in-out"!==r&&"out-in"!==r&&ue("invalid <transition> mode: "+r,this.$parent);var o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var i=Si(o);if(!i)return o;if(this._leaving)return Ti(e,o);var s="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?s+"comment":s+i.tag:a(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var c=(i.data||(i.data={})).transition=Oi(this),l=this._vnode,u=Si(l);if(i.data.directives&&i.data.directives.some(ji)&&(i.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,u)&&!vn(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var f=u.data.transition=M({},c);if("out-in"===r)return this._leaving=!0,jt(f,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),Ti(e,o);if("in-out"===r){if(vn(i))return l;var d,p=function(){d()};jt(c,"afterEnter",p),jt(c,"enterCancelled",p),jt(f,"delayLeave",(function(e){d=e}))}}return o}}},Ei=M({tag:String,moveClass:String},Ci);function Ni(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Di(e){e.data.newPos=e.elm.getBoundingClientRect()}function Li(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,o=t.top-n.top;if(r||o){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate("+r+"px,"+o+"px)",i.transitionDuration="0s"}}delete Ei.mode;var Pi={Transition:Ii,TransitionGroup:{props:Ei,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var o=$n(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,o(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=Oi(this),s=0;s<o.length;s++){var c=o[s];if(c.tag)if(null!=c.key&&0!==String(c.key).indexOf("__vlist"))i.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a;else{var l=c.componentOptions,u=l?l.Ctor.options.name||l.tag||"":c.tag;ue("<transition-group> children must be keyed: <"+u+">")}}if(r){for(var f=[],d=[],p=0;p<r.length;p++){var v=r[p];v.data.transition=a,v.data.pos=v.elm.getBoundingClientRect(),n[v.key]?f.push(v):d.push(v)}this.kept=e(t,null,f),this.removed=d}return e(t,null,i)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(Ni),e.forEach(Di),e.forEach(Li),this._reflow=document.body.offsetHeight,e.forEach((function(e){if(e.data.moved){var n=e.elm,r=n.style;ni(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Yo,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Yo,e),n._moveCb=null,ri(n,t))})}})))},methods:{hasMove:function(e,t){if(!Zo)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach((function(e){Jo(n,e)})),qo(n,t),n.style.display="none",this.$el.appendChild(n);var r=ai(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};Zn.config.mustUseProp=ir,Zn.config.isReservedTag=_r,Zn.config.isReservedAttr=rr,Zn.config.getTagNamespace=wr,Zn.config.isUnknownElement=function(e){if(!K)return!0;if(_r(e))return!1;if(e=e.toLowerCase(),null!=$r[e])return $r[e];var t=document.createElement(e);return e.indexOf("-")>-1?$r[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:$r[e]=/HTMLUnknownElement/.test(t.toString())},M(Zn.options.directives,ki),M(Zn.options.components,Pi),Zn.prototype.__patch__=K?hi:I,Zn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=xe,e.$options.template&&"#"!==e.$options.template.charAt(0)||e.$options.el||t?ue("You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.",e):ue("Failed to mount component: template or render function not defined.",e)),kn(e,"beforeMount"),r=H.performance&&at?function(){var t=e._name,r=e._uid,o="vue-perf-start:"+r,i="vue-perf-end:"+r;at(o);var a=e._render();at(i),st("vue "+t+" render",o,i),at(o),e._update(a,n),at(i),st("vue "+t+" patch",o,i)}:function(){e._update(e._render(),n)},new Fn(e,r,I,{before:function(){e._isMounted&&!e._isDestroyed&&kn(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,kn(e,"mounted")),e}(this,e=e&&K?Ar(e):void 0,t)},K&&setTimeout((function(){H.devtools&&(ae?ae.emit("init",Zn):console[console.info?"info":"log"]("Download the Vue Devtools extension for a better development experience:\nhttps://github.com/vuejs/vue-devtools")),!1!==H.productionTip&&"undefined"!=typeof console&&console[console.info?"info":"log"]("You are running Vue in development mode.\nMake sure to turn on production mode when deploying for production.\nSee more tips at https://vuejs.org/guide/deployment.html")}),0);var Fi=/\{\{((?:.|\r?\n)+?)\}\}/g,Ri=/[-.*+?^${}()|[\]\/\\]/g,Hi=$((function(e){var t=e[0].replace(Ri,"\\$&"),n=e[1].replace(Ri,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}));function Ui(e,t){var n=t?Hi(t):Fi;if(n.test(e)){for(var r,o,i,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(o=r.index)>c&&(s.push(i=e.slice(c,o)),a.push(JSON.stringify(i)));var l=eo(r[1].trim());a.push("_s("+l+")"),s.push({"@binding":l}),c=o+r[0].length}return c<e.length&&(s.push(i=e.slice(c)),a.push(JSON.stringify(i))),{expression:a.join("+"),tokens:s}}}var Vi,Bi={staticKeys:["staticClass"],transformNode:function(e,t){var n=t.warn||no,r=po(e,"class");r&&Ui(r,t.delimiters)&&n('class="'+r+'": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div class="{{ val }}">, use <div :class="val">.',e.rawAttrsMap.class),r&&(e.staticClass=JSON.stringify(r));var o=fo(e,"class",!1);o&&(e.classBinding=o)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}},zi={staticKeys:["staticStyle"],transformNode:function(e,t){var n=t.warn||no,r=po(e,"style");r&&(Ui(r,t.delimiters)&&n('style="'+r+'": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div style="{{ val }}">, use <div :style="val">.',e.rawAttrsMap.style),e.staticStyle=JSON.stringify(Eo(r)));var o=fo(e,"style",!1);o&&(e.styleBinding=o)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},qi=function(e){return(Vi=Vi||document.createElement("div")).innerHTML=e,Vi.textContent},Ji=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Ki=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Wi=m("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Zi=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Gi=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Yi="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+U.source+"]*",Xi="((?:"+Yi+"\\:)?"+Yi+")",Qi=new RegExp("^<"+Xi),ea=/^\s*(\/?)>/,ta=new RegExp("^<\\/"+Xi+"[^>]*>"),na=/^<!DOCTYPE [^>]+>/i,ra=/^<!\--/,oa=/^<!\[/,ia=m("script,style,textarea",!0),aa={},sa={"<":"<",">":">",""":'"',"&":"&"," ":"\n","	":"\t","'":"'"},ca=/&(?:lt|gt|quot|amp|#39);/g,la=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,ua=m("pre,textarea",!0),fa=function(e,t){return e&&ua(e)&&"\n"===t[0]};function da(e,t){var n=t?la:ca;return e.replace(n,(function(e){return sa[e]}))}var pa,va,ha,ma,ga,ya,ba,_a,wa,$a=/^@|^v-on:/,xa=/^v-|^@|^:|^#/,Aa=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,ka=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Ca=/^\(|\)$/g,Sa=/^\[.*\]$/,Oa=/:(.*)$/,Ta=/^:|^\.|^v-bind:/,Ma=/\.[^.\]]+(?=[^\]]*$)/g,ja=/^v-slot(:|$)|^#/,Ia=/[\r\n]/,Ea=/\s+/g,Na=/[\s"'<>\/=]/,Da=$(qi);function La(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:Ba(t),rawAttrsMap:{},parent:n,children:[]}}function Pa(e,t){pa=t.warn||no,ya=t.isPreTag||E,ba=t.mustUseProp||E,_a=t.getTagNamespace||E;var n=t.isReservedTag||E;wa=function(e){return!!e.component||!n(e.tag)},ha=ro(t.modules,"transformNode"),ma=ro(t.modules,"preTransformNode"),ga=ro(t.modules,"postTransformNode"),va=t.delimiters;var r,o,i=[],a=!1!==t.preserveWhitespace,s=t.whitespace,c=!1,l=!1,u=!1;function f(e,t){u||(u=!0,pa(e,t))}function d(e){if(p(e),c||e.processed||(e=Fa(e,t)),i.length||e===r||(r.if&&(e.elseif||e.else)?(v(e),Ha(r,{exp:e.elseif,block:e})):f("Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.",{start:e.start})),o&&!e.forbidden)if(e.elseif||e.else)a=e,(s=function(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];" "!==e[t].text&&pa('text "'+e[t].text.trim()+'" between v-if and v-else(-if) will be ignored.',e[t]),e.pop()}}(o.children))&&s.if?Ha(s,{exp:a.elseif,block:a}):pa("v-"+(a.elseif?'else-if="'+a.elseif+'"':"else")+" used on element <"+a.tag+"> without corresponding v-if.",a.rawAttrsMap[a.elseif?"v-else-if":"v-else"]);else{if(e.slotScope){var n=e.slotTarget||'"default"';(o.scopedSlots||(o.scopedSlots={}))[n]=e}o.children.push(e),e.parent=o}var a,s;e.children=e.children.filter((function(e){return!e.slotScope})),p(e),e.pre&&(c=!1),ya(e.tag)&&(l=!1);for(var u=0;u<ga.length;u++)ga[u](e,t)}function p(e){if(!l)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&" "===t.text;)e.children.pop()}function v(e){"slot"!==e.tag&&"template"!==e.tag||f("Cannot use <"+e.tag+"> as component root element because it may contain multiple nodes.",{start:e.start}),e.attrsMap.hasOwnProperty("v-for")&&f("Cannot use v-for on stateful component root element because it renders multiple elements.",e.rawAttrsMap["v-for"])}return function(e,t){for(var n,r,o=[],i=t.expectHTML,a=t.isUnaryTag||E,s=t.canBeLeftOpenTag||E,c=0;e;){if(n=e,r&&ia(r)){var l=0,u=r.toLowerCase(),f=aa[u]||(aa[u]=new RegExp("([\\s\\S]*?)(</"+u+"[^>]*>)","i")),d=e.replace(f,(function(e,n,r){return l=r.length,ia(u)||"noscript"===u||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),fa(u,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));c+=e.length-d.length,e=d,C(u,c-l,c)}else{var p=e.indexOf("<");if(0===p){if(ra.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),x(v+3);continue}}if(oa.test(e)){var h=e.indexOf("]>");if(h>=0){x(h+2);continue}}var m=e.match(na);if(m){x(m[0].length);continue}var g=e.match(ta);if(g){var y=c;x(g[0].length),C(g[1],y,c);continue}var b=A();if(b){k(b),fa(b.tagName,e)&&x(1);continue}}var _=void 0,w=void 0,$=void 0;if(p>=0){for(w=e.slice(p);!(ta.test(w)||Qi.test(w)||ra.test(w)||oa.test(w)||($=w.indexOf("<",1))<0);)p+=$,w=e.slice(p);_=e.substring(0,p)}p<0&&(_=e),_&&x(_.length),t.chars&&_&&t.chars(_,c-_.length,c)}if(e===n){t.chars&&t.chars(e),!o.length&&t.warn&&t.warn('Mal-formatted tag at end of template: "'+e+'"',{start:c+e.length});break}}function x(t){c+=t,e=e.substring(t)}function A(){var t=e.match(Qi);if(t){var n,r,o={tagName:t[1],attrs:[],start:c};for(x(t[0].length);!(n=e.match(ea))&&(r=e.match(Gi)||e.match(Zi));)r.start=c,x(r[0].length),r.end=c,o.attrs.push(r);if(n)return o.unarySlash=n[1],x(n[0].length),o.end=c,o}}function k(e){var n=e.tagName,c=e.unarySlash;i&&("p"===r&&Wi(n)&&C(r),s(n)&&r===n&&C(n));for(var l=a(n)||!!c,u=e.attrs.length,f=new Array(u),d=0;d<u;d++){var p=e.attrs[d],v=p[3]||p[4]||p[5]||"",h="a"===n&&"href"===p[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[d]={name:p[1],value:da(v,h)},t.outputSourceRange&&(f[d].start=p.start+p[0].match(/^\s*/).length,f[d].end=p.end)}l||(o.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,l,e.start,e.end)}function C(e,n,i){var a,s;if(null==n&&(n=c),null==i&&(i=c),e)for(s=e.toLowerCase(),a=o.length-1;a>=0&&o[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var l=o.length-1;l>=a;l--)(l>a||!e&&t.warn)&&t.warn("tag <"+o[l].tag+"> has no matching end tag.",{start:o[l].start,end:o[l].end}),t.end&&t.end(o[l].tag,n,i);o.length=a,r=a&&o[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,i):"p"===s&&(t.start&&t.start(e,[],!1,n,i),t.end&&t.end(e,n,i))}C()}(e,{warn:pa,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,n,a,s,u){var f=o&&o.ns||_a(e);Y&&"svg"===f&&(n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];za.test(r.name)||(r.name=r.name.replace(qa,""),t.push(r))}return t}(n));var p,h=La(e,n,o);f&&(h.ns=f),t.outputSourceRange&&(h.start=s,h.end=u,h.rawAttrsMap=h.attrsList.reduce((function(e,t){return e[t.name]=t,e}),{})),n.forEach((function(e){Na.test(e.name)&&pa("Invalid dynamic argument expression: attribute names cannot contain spaces, quotes, <, >, / or =.",{start:e.start+e.name.indexOf("["),end:e.start+e.name.length})})),"style"!==(p=h).tag&&("script"!==p.tag||p.attrsMap.type&&"text/javascript"!==p.attrsMap.type)||ie()||(h.forbidden=!0,pa("Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <"+e+">, as they will not be parsed.",{start:h.start}));for(var m=0;m<ma.length;m++)h=ma[m](h,t)||h;c||(function(e){null!=po(e,"v-pre")&&(e.pre=!0)}(h),h.pre&&(c=!0)),ya(h.tag)&&(l=!0),c?function(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),o=0;o<n;o++)r[o]={name:t[o].name,value:JSON.stringify(t[o].value)},null!=t[o].start&&(r[o].start=t[o].start,r[o].end=t[o].end);else e.pre||(e.plain=!0)}(h):h.processed||(Ra(h),function(e){var t=po(e,"v-if");if(t)e.if=t,Ha(e,{exp:t,block:e});else{null!=po(e,"v-else")&&(e.else=!0);var n=po(e,"v-else-if");n&&(e.elseif=n)}}(h),function(e){null!=po(e,"v-once")&&(e.once=!0)}(h)),r||v(r=h),a?d(h):(o=h,i.push(h))},end:function(e,n,r){var a=i[i.length-1];i.length-=1,o=i[i.length-1],t.outputSourceRange&&(a.end=r),d(a)},chars:function(n,r,i){if(o){if(!Y||"textarea"!==o.tag||o.attrsMap.placeholder!==n){var u,d,p,v=o.children;(n=l||n.trim()?"script"===(u=o).tag||"style"===u.tag?n:Da(n):v.length?s?"condense"===s&&Ia.test(n)?"":" ":a?" ":"":"")&&(l||"condense"!==s||(n=n.replace(Ea," ")),!c&&" "!==n&&(d=Ui(n,va))?p={type:2,expression:d.expression,tokens:d.tokens,text:n}:" "===n&&v.length&&" "===v[v.length-1].text||(p={type:3,text:n}),p&&(t.outputSourceRange&&(p.start=r,p.end=i),v.push(p)))}}else n===e?f("Component template requires a root element, rather than just text.",{start:r}):(n=n.trim())&&f('text "'+n+'" outside root element will be ignored.',{start:r})},comment:function(e,n,r){if(o){var i={type:3,text:e,isComment:!0};t.outputSourceRange&&(i.start=n,i.end=r),o.children.push(i)}}}),r}function Fa(e,t){var n;!function(e){var t=fo(e,"key");if(t){if("template"===e.tag&&pa("<template> cannot be keyed. Place the key on real elements instead.",uo(e,"key")),e.for){var n=e.iterator2||e.iterator1,r=e.parent;n&&n===t&&r&&"transition-group"===r.tag&&pa("Do not use v-for index as key on <transition-group> children, this is the same as not using keys.",uo(e,"key"),!0)}e.key=t}}(e),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=fo(e,"ref");t&&(e.ref=t,e.refInFor=function(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;"template"===e.tag?((t=po(e,"scope"))&&pa('the "scope" attribute for scoped slots have been deprecated and replaced by "slot-scope" since 2.5. The new "slot-scope" attribute can also be used on plain elements in addition to <template> to denote scoped slots.',e.rawAttrsMap.scope,!0),e.slotScope=t||po(e,"slot-scope")):(t=po(e,"slot-scope"))&&(e.attrsMap["v-for"]&&pa("Ambiguous combined usage of slot-scope and v-for on <"+e.tag+"> (v-for takes higher priority). Use a wrapper <template> for the scoped slot to make it clearer.",e.rawAttrsMap["slot-scope"],!0),e.slotScope=t);var n=fo(e,"slot");if(n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||io(e,"slot",n,uo(e,"slot"))),"template"===e.tag){var r=vo(e,ja);if(r){(e.slotTarget||e.slotScope)&&pa("Unexpected mixed usage of different slot syntaxes.",e),e.parent&&!wa(e.parent)&&pa("<template v-slot> can only appear at the root level inside the receiving component",e);var o=Ua(r),i=o.name,a=o.dynamic;e.slotTarget=i,e.slotTargetDynamic=a,e.slotScope=r.value||"_empty_"}}else{var s=vo(e,ja);if(s){wa(e)||pa("v-slot can only be used on components or <template>.",s),(e.slotScope||e.slotTarget)&&pa("Unexpected mixed usage of different slot syntaxes.",e),e.scopedSlots&&pa("To avoid scope ambiguity, the default slot should also use <template> syntax when there are other named slots.",s);var c=e.scopedSlots||(e.scopedSlots={}),l=Ua(s),u=l.name,f=l.dynamic,d=c[u]=La("template",[],e);d.slotTarget=u,d.slotTargetDynamic=f,d.children=e.children.filter((function(e){if(!e.slotScope)return e.parent=d,!0})),d.slotScope=s.value||"_empty_",e.children=[],e.plain=!1}}}(e),"slot"===(n=e).tag&&(n.slotName=fo(n,"name"),n.key&&pa("`key` does not work on <slot> because slots are abstract outlets and can possibly expand into multiple elements. Use the key on a wrapping element instead.",uo(n,"key"))),function(e){var t;(t=fo(e,"is"))&&(e.component=t),null!=po(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(var r=0;r<ha.length;r++)e=ha[r](e,t)||e;return function(e){var t,n,r,o,i,a,s,c,l=e.attrsList;for(t=0,n=l.length;t<n;t++)if(r=o=l[t].name,i=l[t].value,xa.test(r))if(e.hasBindings=!0,(a=Va(r.replace(xa,"")))&&(r=r.replace(Ma,"")),Ta.test(r))r=r.replace(Ta,""),i=eo(i),(c=Sa.test(r))&&(r=r.slice(1,-1)),0===i.trim().length&&pa('The value for a v-bind expression cannot be empty. Found in "v-bind:'+r+'"'),a&&(a.prop&&!c&&"innerHtml"===(r=A(r))&&(r="innerHTML"),a.camel&&!c&&(r=A(r)),a.sync&&(s=go(i,"$event"),c?lo(e,'"update:"+('+r+")",s,null,!1,pa,l[t],!0):(lo(e,"update:"+A(r),s,null,!1,pa,l[t]),S(r)!==A(r)&&lo(e,"update:"+S(r),s,null,!1,pa,l[t])))),a&&a.prop||!e.component&&ba(e.tag,e.attrsMap.type,r)?oo(e,r,i,l[t],c):io(e,r,i,l[t],c);else if($a.test(r))r=r.replace($a,""),(c=Sa.test(r))&&(r=r.slice(1,-1)),lo(e,r,i,a,!1,pa,l[t],c);else{var u=(r=r.replace(xa,"")).match(Oa),f=u&&u[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),Sa.test(f)&&(f=f.slice(1,-1),c=!0)),so(e,r,o,i,f,c,a,l[t]),"model"===r&&Ja(e,i)}else Ui(i,va)&&pa(r+'="'+i+'": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.',l[t]),io(e,r,JSON.stringify(i),l[t]),!e.component&&"muted"===r&&ba(e.tag,e.attrsMap.type,r)&&oo(e,r,"true",l[t])}(e),e}function Ra(e){var t;if(t=po(e,"v-for")){var n=function(e){var t=e.match(Aa);if(t){var n={};n.for=t[2].trim();var r=t[1].trim().replace(Ca,""),o=r.match(ka);return o?(n.alias=r.replace(ka,"").trim(),n.iterator1=o[1].trim(),o[2]&&(n.iterator2=o[2].trim())):n.alias=r,n}}(t);n?M(e,n):pa("Invalid v-for expression: "+t,e.rawAttrsMap["v-for"])}}function Ha(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function Ua(e){var t=e.name.replace(ja,"");return t||("#"!==e.name[0]?t="default":pa("v-slot shorthand syntax requires a slot name.",e)),Sa.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'"'+t+'"',dynamic:!1}}function Va(e){var t=e.match(Ma);if(t){var n={};return t.forEach((function(e){n[e.slice(1)]=!0})),n}}function Ba(e){for(var t={},n=0,r=e.length;n<r;n++)!t[e[n].name]||Y||Q||pa("duplicate attribute: "+e[n].name,e[n]),t[e[n].name]=e[n].value;return t}var za=/^xmlns:NS\d+/,qa=/^NS\d+:/;function Ja(e,t){for(var n=e;n;)n.for&&n.alias===t&&pa("<"+e.tag+' v-model="'+t+'">: You are binding v-model directly to a v-for iteration alias. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable. Consider using an array of objects and use v-model on an object property instead.',e.rawAttrsMap["v-model"]),n=n.parent}function Ka(e){return La(e.tag,e.attrsList.slice(),e.parent)}var Wa,Za,Ga=[Bi,zi,{preTransformNode:function(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=fo(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var o=po(e,"v-if",!0),i=o?"&&("+o+")":"",a=null!=po(e,"v-else",!0),s=po(e,"v-else-if",!0),c=Ka(e);Ra(c),ao(c,"type","checkbox"),Fa(c,t),c.processed=!0,c.if="("+n+")==='checkbox'"+i,Ha(c,{exp:c.if,block:c});var l=Ka(e);po(l,"v-for",!0),ao(l,"type","radio"),Fa(l,t),Ha(c,{exp:"("+n+")==='radio'"+i,block:l});var u=Ka(e);return po(u,"v-for",!0),ao(u,":type",n),Fa(u,t),Ha(c,{exp:o,block:u}),a?c.else=!0:s&&(c.elseif=s),c}}}}],Ya={expectHTML:!0,modules:Ga,directives:{model:function(e,t,n){Gr=n;var r=t.value,o=t.modifiers,i=e.tag,a=e.attrsMap.type;if("input"===i&&"file"===a&&Gr("<"+e.tag+' v-model="'+r+'" type="file">:\nFile inputs are read only. Use a v-on:change listener instead.',e.rawAttrsMap["v-model"]),e.component)return mo(e,r,o),!1;if("select"===i)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"});";r=r+" "+go(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),lo(e,"change",r,null,!0)}(e,r,o);else if("input"===i&&"checkbox"===a)!function(e,t,n){var r=n&&n.number,o=fo(e,"value")||"null",i=fo(e,"true-value")||"true",a=fo(e,"false-value")||"false";oo(e,"checked","Array.isArray("+t+")?_i("+t+","+o+")>-1"+("true"===i?":("+t+")":":_q("+t+","+i+")")),lo(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+i+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+o+")":o)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+go(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+go(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+go(t,"$$c")+"}",null,!0)}(e,r,o);else if("input"===i&&"radio"===a)!function(e,t,n){var r=n&&n.number,o=fo(e,"value")||"null";oo(e,"checked","_q("+t+","+(o=r?"_n("+o+")":o)+")"),lo(e,"change",go(t,o),null,!0)}(e,r,o);else if("input"===i||"textarea"===i)!function(e,t,n){var r=e.attrsMap.type,o=e.attrsMap["v-bind:value"]||e.attrsMap[":value"],i=e.attrsMap["v-bind:type"]||e.attrsMap[":type"];if(o&&!i){var a=e.attrsMap["v-bind:value"]?"v-bind:value":":value";Gr(a+'="'+o+'" conflicts with v-model on the same element because the latter already expands to a value binding internally',e.rawAttrsMap[a])}var s=n||{},c=s.lazy,l=s.number,u=s.trim,f=!c&&"range"!==r,d=c?"change":"range"===r?"__r":"input",p="$event.target.value";u&&(p="$event.target.value.trim()"),l&&(p="_n("+p+")");var v=go(t,p);f&&(v="if($event.target.composing)return;"+v),oo(e,"value","("+t+")"),lo(e,d,v,null,!0),(u||l)&&lo(e,"blur","$forceUpdate()")}(e,r,o);else{if(!H.isReservedTag(i))return mo(e,r,o),!1;Gr("<"+e.tag+' v-model="'+r+"\">: v-model is not supported on this element type. If you are working with contenteditable, it's recommended to wrap a library dedicated for that purpose inside a custom component.",e.rawAttrsMap["v-model"])}return!0},text:function(e,t){t.value&&oo(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&oo(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:Ji,mustUseProp:ir,canBeLeftOpenTag:Ki,isReservedTag:_r,getTagNamespace:wr,staticKeys:function(e){return e.reduce((function(e,t){return e.concat(t.staticKeys||[])}),[]).join(",")}(Ga)},Xa=$((function(e){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));function Qa(e,t){e&&(Wa=Xa(t.staticKeys||""),Za=t.isReservedTag||E,function e(t){if(t.static=function(e){return 2!==e.type&&(3===e.type||!(!e.pre&&(e.hasBindings||e.if||e.for||g(e.tag)||!Za(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(Wa))))}(t),1===t.type){if(!Za(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n<r;n++){var o=t.children[n];e(o),o.static||(t.static=!1)}if(t.ifConditions)for(var i=1,a=t.ifConditions.length;i<a;i++){var s=t.ifConditions[i].block;e(s),s.static||(t.static=!1)}}}(e),function e(t,n){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=n),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var r=0,o=t.children.length;r<o;r++)e(t.children[r],n||!!t.for);if(t.ifConditions)for(var i=1,a=t.ifConditions.length;i<a;i++)e(t.ifConditions[i].block,n)}}(e,!1))}var es=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,ts=/\([^)]*?\);*$/,ns=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,rs={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},os={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},is=function(e){return"if("+e+")return null;"},as={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:is("$event.target !== $event.currentTarget"),ctrl:is("!$event.ctrlKey"),shift:is("!$event.shiftKey"),alt:is("!$event.altKey"),meta:is("!$event.metaKey"),left:is("'button' in $event && $event.button !== 0"),middle:is("'button' in $event && $event.button !== 1"),right:is("'button' in $event && $event.button !== 2")};function ss(e,t){var n=t?"nativeOn:":"on:",r="",o="";for(var i in e){var a=cs(e[i]);e[i]&&e[i].dynamic?o+=i+","+a+",":r+='"'+i+'":'+a+","}return r="{"+r.slice(0,-1)+"}",o?n+"_d("+r+",["+o.slice(0,-1)+"])":n+r}function cs(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return cs(e)})).join(",")+"]";var t=ns.test(e.value),n=es.test(e.value),r=ns.test(e.value.replace(ts,""));if(e.modifiers){var o="",i="",a=[];for(var s in e.modifiers)if(as[s])i+=as[s],rs[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;i+=is(["ctrl","shift","alt","meta"].filter((function(e){return!c[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else a.push(s);return a.length&&(o+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(ls).join("&&")+")return null;"}(a)),i&&(o+=i),"function($event){"+o+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function ls(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=rs[e],r=os[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var us={on:function(e,t){t.modifiers&&ue("v-on without argument does not support modifiers."),e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:I},fs=function(e){this.options=e,this.warn=e.warn||no,this.transforms=ro(e.modules,"transformCode"),this.dataGenFns=ro(e.modules,"genData"),this.directives=M(M({},us),e.directives);var t=e.isReservedTag||E;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ds(e,t){var n=new fs(t);return{render:"with(this){return "+(e?ps(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function ps(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return vs(e,t);if(e.once&&!e.onceProcessed)return hs(e,t);if(e.for&&!e.forProcessed)return gs(e,t);if(e.if&&!e.ifProcessed)return ms(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=ws(e,t),o="_t("+n+(r?","+r:""),i=e.attrs||e.dynamicAttrs?As((e.attrs||[]).concat(e.dynamicAttrs||[]).map((function(e){return{name:A(e.name),value:e.value,dynamic:e.dynamic}}))):null,a=e.attrsMap["v-bind"];return!i&&!a||r||(o+=",null"),i&&(o+=","+i),a&&(o+=(i?"":",null")+","+a),o+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:ws(t,n,!0);return"_c("+e+","+ys(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=ys(e,t));var o=e.inlineTemplate?null:ws(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(o?","+o:"")+")"}for(var i=0;i<t.transforms.length;i++)n=t.transforms[i](e,n);return n}return ws(e,t)||"void 0"}function vs(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push("with(this){return "+ps(e,t)+"}"),t.pre=n,"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function hs(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return ms(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+ps(e,t)+","+t.onceId+++","+n+")":(t.warn("v-once can only be used inside v-for that is keyed. ",e.rawAttrsMap["v-once"]),ps(e,t))}return vs(e,t)}function ms(e,t,n,r){return e.ifProcessed=!0,function e(t,n,r,o){if(!t.length)return o||"_e()";var i=t.shift();return i.exp?"("+i.exp+")?"+a(i.block)+":"+e(t,n,r,o):""+a(i.block);function a(e){return r?r(e,n):e.once?hs(e,n):ps(e,n)}}(e.ifConditions.slice(),t,n,r)}function gs(e,t,n,r){var o=e.for,i=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return t.maybeComponent(e)&&"slot"!==e.tag&&"template"!==e.tag&&!e.key&&t.warn("<"+e.tag+' v-for="'+i+" in "+o+'">: component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info.',e.rawAttrsMap["v-for"],!0),e.forProcessed=!0,(r||"_l")+"(("+o+"),function("+i+a+s+"){return "+(n||ps)(e,t)+"})"}function ys(e,t){var n="{",r=function(e,t){var n=e.directives;if(n){var r,o,i,a,s="directives:[",c=!1;for(r=0,o=n.length;r<o;r++){i=n[r],a=!0;var l=t.directives[i.name];l&&(a=!!l(e,i,t.warn)),a&&(c=!0,s+='{name:"'+i.name+'",rawName:"'+i.rawName+'"'+(i.value?",value:("+i.value+"),expression:"+JSON.stringify(i.value):"")+(i.arg?",arg:"+(i.isDynamicArg?i.arg:'"'+i.arg+'"'):"")+(i.modifiers?",modifiers:"+JSON.stringify(i.modifiers):"")+"},")}return c?s.slice(0,-1)+"]":void 0}}(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var o=0;o<t.dataGenFns.length;o++)n+=t.dataGenFns[o](e);if(e.attrs&&(n+="attrs:"+As(e.attrs)+","),e.props&&(n+="domProps:"+As(e.props)+","),e.events&&(n+=ss(e.events,!1)+","),e.nativeEvents&&(n+=ss(e.nativeEvents,!0)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=function(e,t,n){var r=e.for||Object.keys(t).some((function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||bs(n)})),o=!!e.if;if(!r)for(var i=e.parent;i;){if(i.slotScope&&"_empty_"!==i.slotScope||i.for){r=!0;break}i.if&&(o=!0),i=i.parent}var a=Object.keys(t).map((function(e){return _s(t[e],n)})).join(",");return"scopedSlots:_u(["+a+"]"+(r?",null,true":"")+(!r&&o?",null,false,"+function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0}(a):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var i=function(e,t){var n=e.children[0];if(1===e.children.length&&1===n.type||t.warn("Inline-template components must have exactly one child element.",{start:e.start}),n&&1===n.type){var r=ds(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(e){return"function(){"+e+"}"})).join(",")+"]}"}}(e,t);i&&(n+=i+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+As(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function bs(e){return 1===e.type&&("slot"===e.tag||e.children.some(bs))}function _s(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return ms(e,t,_s,"null");if(e.for&&!e.forProcessed)return gs(e,t,_s);var r="_empty_"===e.slotScope?"":String(e.slotScope),o="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(ws(e,t)||"undefined")+":undefined":ws(e,t)||"undefined":ps(e,t))+"}",i=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+o+i+"}"}function ws(e,t,n,r,o){var i=e.children;if(i.length){var a=i[0];if(1===i.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||ps)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var o=e[r];if(1===o.type){if($s(o)||o.ifConditions&&o.ifConditions.some((function(e){return $s(e.block)}))){n=2;break}(t(o)||o.ifConditions&&o.ifConditions.some((function(e){return t(e.block)})))&&(n=1)}}return n}(i,t.maybeComponent):0,l=o||xs;return"["+i.map((function(e){return l(e,t)})).join(",")+"]"+(c?","+c:"")}}function $s(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function xs(e,t){return 1===e.type?ps(e,t):3===e.type&&e.isComment?function(e){return"_e("+JSON.stringify(e.text)+")"}(e):function(e){return"_v("+(2===e.type?e.expression:ks(JSON.stringify(e.text)))+")"}(e)}function As(e){for(var t="",n="",r=0;r<e.length;r++){var o=e[r],i=ks(o.value);o.dynamic?n+=o.name+","+i+",":t+='"'+o.name+'":'+i+","}return t="{"+t.slice(0,-1)+"}",n?"_d("+t+",["+n.slice(0,-1)+"])":t}function ks(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var Cs=new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),Ss=new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),Os=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function Ts(e,t){e&&function e(t,n){if(1===t.type){for(var r in t.attrsMap)if(xa.test(r)){var o=t.attrsMap[r];if(o){var i=t.rawAttrsMap[r];"v-for"===r?js(t,'v-for="'+o+'"',n,i):"v-slot"===r||"#"===r[0]?Ns(o,r+'="'+o+'"',n,i):$a.test(r)?Ms(o,r+'="'+o+'"',n,i):Es(o,r+'="'+o+'"',n,i)}}if(t.children)for(var a=0;a<t.children.length;a++)e(t.children[a],n)}else 2===t.type&&Es(t.expression,t.text,n,t)}(e,t)}function Ms(e,t,n,r){var o=e.replace(Os,""),i=o.match(Ss);i&&"$"!==o.charAt(i.index-1)&&n('avoid using JavaScript unary operator as property name: "'+i[0]+'" in expression '+t.trim(),r),Es(e,t,n,r)}function js(e,t,n,r){Es(e.for||"",t,n,r),Is(e.alias,"v-for alias",t,n,r),Is(e.iterator1,"v-for iterator",t,n,r),Is(e.iterator2,"v-for iterator",t,n,r)}function Is(e,t,n,r,o){if("string"==typeof e)try{new Function("var "+e+"=_")}catch(i){r("invalid "+t+' "'+e+'" in expression: '+n.trim(),o)}}function Es(e,t,n,r){try{new Function("return "+e)}catch(i){var o=e.replace(Os,"").match(Cs);n(o?'avoid using JavaScript keyword as property name: "'+o[0]+'"\n Raw expression: '+t.trim():"invalid expression: "+i.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}function Ns(e,t,n,r){try{new Function(e,"")}catch(o){n("invalid function parameter expression: "+o.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}function Ds(e,t){var n="";if(t>0)for(;1&t&&(n+=e),!((t>>>=1)<=0);)e+=e;return n}function Ls(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),I}}function Ps(e){var t=Object.create(null);return function(n,r,o){var i=(r=M({},r)).warn||ue;delete r.warn;try{new Function("return 1")}catch(e){e.toString().match(/unsafe-eval|CSP/)&&i("It seems you are using the standalone build of Vue.js in an environment with Content Security Policy that prohibits unsafe-eval. The template compiler cannot work in this environment. Consider relaxing the policy to allow unsafe-eval or pre-compiling your templates into render functions.")}var a=r.delimiters?String(r.delimiters)+n:n;if(t[a])return t[a];var s=e(n,r);s.errors&&s.errors.length&&(r.outputSourceRange?s.errors.forEach((function(e){i("Error compiling template:\n\n"+e.msg+"\n\n"+function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.length);for(var r=e.split(/\r?\n/),o=0,i=[],a=0;a<r.length;a++)if((o+=r[a].length+1)>=t){for(var s=a-2;s<=a+2||n>o;s++)if(!(s<0||s>=r.length)){i.push(""+(s+1)+Ds(" ",3-String(s+1).length)+"| "+r[s]);var c=r[s].length;if(s===a){var l=t-(o-c)+1,u=n>o?c-l:n-t;i.push(" | "+Ds(" ",l)+Ds("^",u))}else if(s>a){if(n>o){var f=Math.min(n-o,c);i.push(" | "+Ds("^",f))}o+=c+1}}break}return i.join("\n")}(n,e.start,e.end),o)})):i("Error compiling template:\n\n"+n+"\n\n"+s.errors.map((function(e){return"- "+e})).join("\n")+"\n",o)),s.tips&&s.tips.length&&(r.outputSourceRange?s.tips.forEach((function(e){return fe(e.msg,o)})):s.tips.forEach((function(e){return fe(e,o)})));var c={},l=[];return c.render=Ls(s.render,l),c.staticRenderFns=s.staticRenderFns.map((function(e){return Ls(e,l)})),s.errors&&s.errors.length||!l.length||i("Failed to generate render function:\n\n"+l.map((function(e){var t=e.err,n=e.code;return t.toString()+" in\n\n"+n+"\n"})).join("\n"),o),t[a]=c}}var Fs,Rs,Hs=(Fs=function(e,t){var n=Pa(e.trim(),t);!1!==t.optimize&&Qa(n,t);var r=ds(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),o=[],i=[],a=function(e,t,n){(n?i:o).push(e)};if(n){if(n.outputSourceRange){var s=t.match(/^\s*/)[0].length;a=function(e,t,n){var r={msg:e};t&&(null!=t.start&&(r.start=t.start+s),null!=t.end&&(r.end=t.end+s)),(n?i:o).push(r)}}for(var c in n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=M(Object.create(e.directives||null),n.directives)),n)"modules"!==c&&"directives"!==c&&(r[c]=n[c])}r.warn=a;var l=Fs(t.trim(),r);return Ts(l.ast,a),l.errors=o,l.tips=i,l}return{compile:t,compileToFunctions:Ps(t)}})(Ya),Us=(Hs.compile,Hs.compileToFunctions);function Vs(e){return(Rs=Rs||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',Rs.innerHTML.indexOf(" ")>0}var Bs=!!K&&Vs(!1),zs=!!K&&Vs(!0),qs=$((function(e){var t=Ar(e);return t&&t.innerHTML})),Js=Zn.prototype.$mount;return Zn.prototype.$mount=function(e,t){if((e=e&&Ar(e))===document.body||e===document.documentElement)return ue("Do not mount Vue to <html> or <body> - mount to normal elements instead."),this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&((r=qs(r))||ue("Template element not found or is empty: "+n.template,this));else{if(!r.nodeType)return ue("invalid template option:"+r,this),this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){H.performance&&at&&at("compile");var o=Us(r,{outputSourceRange:!0,shouldDecodeNewlines:Bs,shouldDecodeNewlinesForHref:zs,delimiters:n.delimiters,comments:n.comments},this),i=o.render,a=o.staticRenderFns;n.render=i,n.staticRenderFns=a,H.performance&&at&&(at("compile end"),st("vue "+this._name+" compile","compile","compile end"))}}return Js.call(this,e,t)},Zn.compile=Us,Zn},e.exports=r()}).call(this,n(4),n(15).setImmediate)},,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(6),o=n.n(r);n(14);const i=new URL(window.location.href).searchParams.get("page");if(!i)throw"Need page url arg";const a=window[i];function s(e,t){Object.keys(e).forEach(n=>{e[n]=t})}new o.a({el:"#nextgenthemes-vue",data:{isSaving:!1,refreshAfterSave:!1,sectionsDisplayed:{main:!0,html5:!0,pro:!0,videojs:!0,randomvideo:!0,debug:!1,urlparams:!1},message:"",vm:a.options},methods:{saveOptions(){this.isSaving=!0,window.jQuery.ajax({url:a.rest_url+"/save",method:"POST",data:this.vm,beforeSend(e){e.setRequestHeader("X-WP-Nonce",a.nonce)},success:()=>{this.message="Options saved",setTimeout(()=>this.message="",1e3)},error:e=>{this.message=e.responseText,this.refreshAfterSave=!1},complete:()=>{this.isSaving=!1,this.refreshAfterSave&&(this.refreshAfterSave=!1,window.location.reload())}})},licenseAPI(e,t,n){this.isSaving=!0,window.jQuery.ajax({url:"https://nextgenthemes.com",method:"POST",crossDomain:!0,data:{edd_action:e+"_license",license:this.vm[n],item_id:t,url:a.home_url},success:e=>{console.log("response",e),this.message="License API call saved",setTimeout(()=>this.message="",1e3)},error:e=>this.message=e.responseText,complete:()=>this.isSaving=!1})},licenseAPI_native(e,t,n){const r=new XMLHttpRequest;r.onreadystatechange=function(){if(console.log("xhttp.readyState",r.readyState),console.log("xhttp.status",r.status),4===r.readyState&&200===r.status){const e=JSON.parse(r.responseText);console.log("slData",e)}};const o={edd_action:e+"_license",license:this.vm[n],item_id:t,url:a.home_url};r.open("POST","https://nextgenthemes.com",!0),r.setRequestHeader("Content-type","application/json; charset=utf-8"),r.setRequestHeader("Access-Control-Allow-Origin",a.home_url);let i="";for(const e in o)i+=e+"="+a[e]+"&";i=i.substring(0,i.length-1),r.send(i)},showSection(e){s(this.sectionsDisplayed,!1),this.sectionsDisplayed[e]=!0},showAllSectionsButDebug(){s(this.sectionsDisplayed,!0),this.sectionsDisplayed.debug=!1},uploadImage(e){const t=this,n=window.wp.media({title:"Upload Image",multiple:!1}).open().on("select",(function(){const r=n.state().get("selection").first().toJSON().id;t.vm[e]=r}))},action(e,t){this.vm.action=JSON.stringify({action:e,product:t}),this.refreshAfterSave=!0,this.saveOptions()}}})},function(e,t,n){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(16),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(4))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,c=1,l={},u=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){v(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){v(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){v(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(v,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&v(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return l[c]=o,r(c),c++},d.clearImmediate=p}function p(e){delete l[e]}function v(e){if(u)setTimeout(v,0,e);else{var t=l[e];if(t){u=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),u=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(4),n(17))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,l=[],u=!1,f=-1;function d(){u&&c&&(u=!1,c.length?l=c.concat(l):f=-1,l.length&&p())}function p(){if(!u){var e=s(d);u=!0;for(var t=l.length;t;){for(c=l,l=[];++f<t;)c&&c[f].run();f=-1,t=l.length}c=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function v(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new v(e,t)),1!==l.length||u||s(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}}]);
|
build/main.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '20a7427231af6b4b05c5e7bcc6c1982d');
|
build/main.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.arve,#html .arve{display:block;width:100%;margin-bottom:1.5em}.arve::after,#html .arve::after{display:table;clear:both;content:""}.arve.alignleft,#html .arve.alignleft{margin-top:.4em;margin-right:1.5em}.arve.alignright,#html .arve.alignright{margin-top:.4em;margin-left:1.5em}.arve-embed,#html .arve-embed{position:relative;display:block;width:100%;max-height:100vh;padding:0;margin:0;overflow:hidden}.arve-ar,#html .arve-ar{display:block}.arve-embed--has-aspect-ratio,#html .arve-embed--has-aspect-ratio{overflow:hidden}.arve-embed--16by9::before,#html .arve-embed--16by9::before{display:block;padding-top:56.25%;content:""}.arve-thumbnail,.arve-play-btn,.arve-iframe,#html .arve-thumbnail,#html .arve-play-btn,#html .arve-iframe{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;padding:0;margin:0;border:0}.arve-video,#html .arve-video{width:100%;height:auto;padding:0;margin:0}.arve-promote-link,#html .arve-promote-link{float:right;font-family:"Open Sans", "Sagoe UI", Arvo, Lato, arial, sans-serif;font-size:.8em}.arve-hidden{display:none !important}.components-button--arve-thumbnail{display:block;height:auto}
|
2 |
+
|
build/main.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},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=7)}({7:function(e,t,r){"use strict";r.r(t);r(8);const o=document.querySelectorAll.bind(document);function n(){o(".arve p, .arve .video-wrap, .arve .fluid-width-video-wrapper, .arve .fluid-vids").forEach(e=>{u(e)}),o(".arve br").forEach(e=>{e.remove()}),o(".arve-iframe, .arve-video").forEach(e=>{e.removeAttribute("width"),e.removeAttribute("height"),e.removeAttribute("style")}),o(".wp-block-embed").forEach(e=>{if(e.querySelector(".arve")){e.classList.remove("wp-embed-aspect-16-9","wp-has-aspect-ratio");const t=e.querySelector(".wp-block-embed__wrapper");t&&u(t)}})}function i(){"html"!==document.documentElement.id&&(document.documentElement.id?document.body.id||(document.body.id="html"):document.documentElement.id="html")}function u(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}n(),i(),document.addEventListener("DOMContentLoaded",()=>{n(),i()})},8:function(e,t,r){}});
|
build/shortcode-ui.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '475be3a638ba114f54bb275d56713a08');
|
build/shortcode-ui.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}({12:function(t,e,r){"use strict";r.r(e);const n=window._,o=new DOMParser;window.wp.shortcake.hooks.addAction("arve.url",(function(t,e,r){function i(t){return n.find(e,(function(e){return t===e.model.get("attr")}))}const u=t.value;if(void 0===u)return;const c=i("url").$el.find("input"),f=i("aspect_ratio").$el.find("input"),l=o.parseFromString(u,"text/html").querySelector("iframe");if(l&&l.hasAttribute("src")){c.val(l.src).trigger("input");const t=l.width,e=l.height;t&&e&&f.val(t+":"+e).trigger("input")}}))}});
|
php/Admin/functions-admin.php
ADDED
@@ -0,0 +1,383 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Admin;
|
3 |
+
|
4 |
+
use \Nextgenthemes\ARVE;
|
5 |
+
use \Nextgenthemes\ARVE\Common;
|
6 |
+
|
7 |
+
function action_admin_init_setup_messages() {
|
8 |
+
|
9 |
+
$pro_version = false;
|
10 |
+
|
11 |
+
if ( defined( 'ARVE_PRO_VERSION' ) ) {
|
12 |
+
$pro_version = ARVE_PRO_VERSION;
|
13 |
+
|
14 |
+
} elseif ( defined( '\Nextgenthemes\ARVE\Pro\VERSION' ) ) {
|
15 |
+
$pro_version = \Nextgenthemes\ARVE\Pro\VERSION;
|
16 |
+
}
|
17 |
+
|
18 |
+
if ( $pro_version && version_compare( ARVE\PRO_VERSION_REQUIRED, $pro_version, '>' ) ) {
|
19 |
+
|
20 |
+
$msg = sprintf(
|
21 |
+
// Translators: %1$s Version
|
22 |
+
__( 'Your ARVE Pro Addon is outdated, you need version %1$s or later. If you have setup your license <a href="%2$s">here</a> semi auto updates should work (Admin panel notice and auto install on confirmation). If not please <a href="%3$s">report it</a> and manually update as <a href="%4$s">described here.</a>', 'advanced-responsive-video-embedder' ),
|
23 |
+
ARVE\PRO_VERSION_REQUIRED,
|
24 |
+
esc_url( get_admin_url() . 'options-general.php?page=nextgenthemes' ),
|
25 |
+
'https://nextgenthemes.com/support/',
|
26 |
+
'https://nextgenthemes.com/plugins/arve/documentation/installing-and-license-management/'
|
27 |
+
);
|
28 |
+
|
29 |
+
new Common\Admin\NoticeFactory( 'arve-pro-outdated', "<p>$msg</p>", false );
|
30 |
+
}
|
31 |
+
|
32 |
+
$update_msg = sprintf(
|
33 |
+
// Translators: %1$s Version
|
34 |
+
__( '<p>Your ARVE version was just updated. This was a <a href="%1$s"><strong>major update</strong></a>. If you experience any urgent breaking issues please <a href="%2$s">report them</a> and <a href="%3$s">downgrade</a> short term. I tried my best to have other beta testers over many months. Thanks to everyone who did test. But 9.0 has lots of code changed, I am afraid the update will trigger some issues we could not test for.</p>', 'advanced-responsive-video-embedder' ),
|
35 |
+
'https://nextgenthemes.com/improvements-in-arve-9-0-and-arve-pro-5-0/',
|
36 |
+
'https://nextgenthemes.com/support/',
|
37 |
+
'https://nextgenthemes.com/plugins/arve/documentation/how-to-downgrade/'
|
38 |
+
);
|
39 |
+
|
40 |
+
new Common\Admin\NoticeFactory( 'arve9', $update_msg, true );
|
41 |
+
|
42 |
+
if ( display_pro_ad() ) {
|
43 |
+
|
44 |
+
$pro_ad_message = __( '<p>Hi, this is Nico(las Jonas) the author of the ARVE - Advanced Responsive Video Embedder plugin. If you are interrested in additional features and/or want to support the work I do on this plugin please consider buying the Pro Addon.</p>', 'advanced-responsive-video-embedder' );
|
45 |
+
|
46 |
+
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
|
47 |
+
$pro_ad_message .= file_get_contents( __DIR__ . '/partials/pro-ad.html' );
|
48 |
+
|
49 |
+
new Common\Admin\NoticeFactory( 'arve_dismiss_pro_notice', $pro_ad_message, true );
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
function display_pro_ad() {
|
54 |
+
|
55 |
+
$inst = (int) get_option( 'arve_install_date' );
|
56 |
+
|
57 |
+
if ( ! current_user_can( 'update_plugins' )
|
58 |
+
|| ! apply_filters( 'nextgenthemes/arve/pro_ad', true )
|
59 |
+
|| time() < strtotime( '+3 weeks', $inst )
|
60 |
+
) {
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
|
64 |
+
return true;
|
65 |
+
}
|
66 |
+
|
67 |
+
function widget_text() {
|
68 |
+
|
69 |
+
echo '<p>';
|
70 |
+
printf( '<a href="%s">Documentation</a>, ', 'https://nextgenthemes.com/plugins/arve/documentation/' );
|
71 |
+
printf( '<a href="%s">Support</a>, ', 'https://nextgenthemes.com/support/' );
|
72 |
+
printf(
|
73 |
+
'<a href="%s">%s</a>',
|
74 |
+
esc_url( admin_url( 'admin.php?page=advanced-responsive-video-embedder' ) ),
|
75 |
+
esc_html__( 'Settings', 'advanced-responsive-video-embedder' )
|
76 |
+
);
|
77 |
+
echo '</p>';
|
78 |
+
|
79 |
+
printf( '<a href="%s">ARVE Pro Addon Features</a>:', 'https://nextgenthemes.com/plugins/arve-pro/' );
|
80 |
+
|
81 |
+
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_readfile
|
82 |
+
readfile( __DIR__ . '/partials/pro-ad.html' );
|
83 |
+
}
|
84 |
+
|
85 |
+
function add_dashboard_widget() {
|
86 |
+
|
87 |
+
if ( ! display_pro_ad() ) {
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
|
91 |
+
wp_add_dashboard_widget(
|
92 |
+
'arve_dashboard_widget', // Widget slug.
|
93 |
+
'Advanced Responsive Video Embedder', // Title.
|
94 |
+
__NAMESPACE__ . '\widget_text' // Display function.
|
95 |
+
);
|
96 |
+
|
97 |
+
if ( 'index.php' === $GLOBALS['pagenow'] ) {
|
98 |
+
// Get the regular dashboard widgets array.
|
99 |
+
// (which has our new widget already but at the end).
|
100 |
+
$normal_dashboard = $GLOBALS['wp_meta_boxes']['dashboard']['normal']['core'];
|
101 |
+
// Backup and delete our new dashboard widget from the end of the array.
|
102 |
+
$arve_widget_backup = [ 'arve_dashboard_widget' => $normal_dashboard['arve_dashboard_widget'] ];
|
103 |
+
unset( $normal_dashboard['arve_dashboard_widget'] );
|
104 |
+
// Merge the two arrays together so our widget is at the beginning.
|
105 |
+
$sorted_dashboard = array_merge( $arve_widget_backup, $normal_dashboard );
|
106 |
+
// Save the sorted array back into the original metaboxes.
|
107 |
+
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
108 |
+
$GLOBALS['wp_meta_boxes']['dashboard']['normal']['core'] = $sorted_dashboard;
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
function add_action_links( $links ) {
|
113 |
+
|
114 |
+
if ( ! is_plugin_active( 'arve-pro/arve-pro.php' ) ) {
|
115 |
+
|
116 |
+
$extra_links['buy_pro_addon'] = sprintf(
|
117 |
+
'<a href="%s"><strong style="display: inline;">%s</strong></a>',
|
118 |
+
'https://nextgenthemes.com/plugins/arve-pro/',
|
119 |
+
__( 'Buy Pro Addon', 'advanced-responsive-video-embedder' )
|
120 |
+
);
|
121 |
+
}
|
122 |
+
|
123 |
+
$extra_links['donate'] = sprintf(
|
124 |
+
'<a href="https://nextgenthemes.com/donate/"><strong style="display: inline;">%s</strong></a>',
|
125 |
+
esc_html__( 'Donate', 'advanced-responsive-video-embedder' )
|
126 |
+
);
|
127 |
+
|
128 |
+
$extra_links['settings'] = sprintf(
|
129 |
+
'<a href="%s">%s</a>',
|
130 |
+
esc_url( admin_url( 'options-general.php?page=nextgenthemes_arve' ) ),
|
131 |
+
esc_html__( 'Settings', 'advanced-responsive-video-embedder' )
|
132 |
+
);
|
133 |
+
|
134 |
+
return array_merge( $extra_links, $links );
|
135 |
+
}
|
136 |
+
|
137 |
+
function add_media_button() {
|
138 |
+
|
139 |
+
$options = ARVE\options();
|
140 |
+
|
141 |
+
add_thickbox();
|
142 |
+
|
143 |
+
echo '<div id="arve-thickbox" style="display:none;">';
|
144 |
+
// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
|
145 |
+
printf(
|
146 |
+
__( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
147 |
+
'<p>This button can open a optional ARVE a Shortcode creation dialog. ARVE needs the <a href="%1$s">Shortcode UI plugin</a> active for this fuctionality.</p>
|
148 |
+
|
149 |
+
<p>The "Shortcake (Shortcode UI)" plugin also adds What You See Is What You Get functionality for ARVE Shortcodes to WordPress visual post editor. It is perfectly fine to pass on this and <a href="%2$s">manually</a> write shortcodes or don\'t use shortcodes at all, but it makes things easier.</p>',
|
150 |
+
'advanced-responsive-video-embedder'
|
151 |
+
),
|
152 |
+
esc_url( network_admin_url( 'plugin-install.php?s=Shortcode+UI&tab=search&type=term' ) ),
|
153 |
+
esc_url( 'https://nextgenthemes.com/plugins/arve/documentation/' )
|
154 |
+
);
|
155 |
+
// phpcs:enable WordPress.WP.I18n.MissingTranslatorsComment
|
156 |
+
|
157 |
+
echo '</div>';
|
158 |
+
|
159 |
+
printf(
|
160 |
+
'<button id="arve-btn" title="%s" data-mode="%s" class="arve-btn button add_media" type="button"><span class="wp-media-buttons-icon arve-icon"></span> %s</button>',
|
161 |
+
esc_attr__( 'ARVE Advanced Responsive Video Embedder', 'advanced-responsive-video-embedder' ),
|
162 |
+
esc_attr( $options['mode'] ),
|
163 |
+
esc_html__( 'Embed Video (ARVE)', 'advanced-responsive-video-embedder' )
|
164 |
+
);
|
165 |
+
}
|
166 |
+
|
167 |
+
function register_shortcode_ui() {
|
168 |
+
|
169 |
+
$settings = ARVE\shortcode_settings();
|
170 |
+
|
171 |
+
foreach ( $settings as $k => $v ) :
|
172 |
+
|
173 |
+
if ( 'boolean' === $v['type'] ) {
|
174 |
+
$v['type'] = 'select';
|
175 |
+
|
176 |
+
if ( isset($v['option']) && true === $v['option'] ) {
|
177 |
+
$v['options'] = [
|
178 |
+
[ 'value' => '', 'label' => esc_html__( 'Default (settings page)', 'advanced-responsive-video-embedder' ) ],
|
179 |
+
[ 'value' => 'yes', 'label' => esc_html__( 'Yes', 'advanced-responsive-video-embedder' ) ],
|
180 |
+
[ 'value' => 'no', 'label' => esc_html__( 'No', 'advanced-responsive-video-embedder' ) ],
|
181 |
+
];
|
182 |
+
} else {
|
183 |
+
$v['options'] = [
|
184 |
+
[ 'value' => 'no', 'label' => esc_html__( 'No', 'advanced-responsive-video-embedder' ) ],
|
185 |
+
[ 'value' => 'yes', 'label' => esc_html__( 'Yes', 'advanced-responsive-video-embedder' ) ],
|
186 |
+
];
|
187 |
+
}
|
188 |
+
}
|
189 |
+
if ( 'string' === $v['type'] ) {
|
190 |
+
$v['type'] = 'text';
|
191 |
+
}
|
192 |
+
if ( 'integer' === $v['type'] ) {
|
193 |
+
$v['type'] = 'number';
|
194 |
+
}
|
195 |
+
if ( ! empty( $v['placeholder'] ) ) {
|
196 |
+
$v['meta']['placeholder'] = $v['placeholder'];
|
197 |
+
}
|
198 |
+
|
199 |
+
$v['attr'] = $k;
|
200 |
+
$attrs[] = $v;
|
201 |
+
endforeach;
|
202 |
+
|
203 |
+
shortcode_ui_register_for_shortcode(
|
204 |
+
'arve',
|
205 |
+
[
|
206 |
+
'label' => esc_html( 'ARVE' ),
|
207 |
+
'listItemImage' => 'dashicons-format-video',
|
208 |
+
'attrs' => $attrs,
|
209 |
+
]
|
210 |
+
);
|
211 |
+
}
|
212 |
+
|
213 |
+
function input( $args ) {
|
214 |
+
|
215 |
+
$out = sprintf( '<input%s>', Common\attr( $args['input_attr'] ) );
|
216 |
+
|
217 |
+
if ( ! empty( $args['option_values']['attr'] ) && 'thumbnail_fallback' === $args['option_values']['attr'] ) {
|
218 |
+
|
219 |
+
// jQuery
|
220 |
+
wp_enqueue_script( 'jquery' );
|
221 |
+
// This will enqueue the Media Uploader script
|
222 |
+
wp_enqueue_media();
|
223 |
+
|
224 |
+
$out .= sprintf(
|
225 |
+
'<a %s>%s</a>',
|
226 |
+
Common\attr(
|
227 |
+
[
|
228 |
+
'data-image-upload' => sprintf( '[name="%s"]', $args['input_attr']['name'] ),
|
229 |
+
'class' => 'button-secondary',
|
230 |
+
]
|
231 |
+
),
|
232 |
+
__( 'Upload Image', 'advanced-responsive-video-embedder' )
|
233 |
+
);
|
234 |
+
}
|
235 |
+
|
236 |
+
if ( ! empty( $args['description'] ) ) {
|
237 |
+
$out = $out . '<p class="description">' . $args['description'] . '</p>';
|
238 |
+
}
|
239 |
+
|
240 |
+
echo $out; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
241 |
+
}
|
242 |
+
|
243 |
+
function textarea( $args ) {
|
244 |
+
|
245 |
+
unset( $args['input_attr']['type'] );
|
246 |
+
|
247 |
+
$out = sprintf( '<textarea%s></textarea>', Common\attr( $args['input_attr'] ) );
|
248 |
+
|
249 |
+
if ( ! empty( $args['description'] ) ) {
|
250 |
+
$out = $out . '<p class="description">' . $args['description'] . '</p>';
|
251 |
+
}
|
252 |
+
|
253 |
+
echo $out; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
254 |
+
}
|
255 |
+
|
256 |
+
function select( $args ) {
|
257 |
+
|
258 |
+
unset( $args['input_attr']['type'] );
|
259 |
+
|
260 |
+
foreach ( $args['option_values']['options'] as $key => $value ) {
|
261 |
+
|
262 |
+
if ( 2 === count( $args['option_values']['options'] )
|
263 |
+
&& array_key_exists( 'yes', $args['option_values']['options'] )
|
264 |
+
&& array_key_exists( 'no', $args['option_values']['options'] )
|
265 |
+
) {
|
266 |
+
$current_option = $args['input_attr']['value'] ? 'yes' : 'no';
|
267 |
+
} else {
|
268 |
+
$current_option = $args['input_attr']['value'];
|
269 |
+
}
|
270 |
+
|
271 |
+
$options[] = sprintf(
|
272 |
+
'<option value="%s" %s>%s</option>',
|
273 |
+
esc_attr( $key ),
|
274 |
+
selected( $current_option, $key, false ),
|
275 |
+
esc_html( $value )
|
276 |
+
);
|
277 |
+
}
|
278 |
+
|
279 |
+
$select_attr = $args['input_attr'];
|
280 |
+
unset( $select_attr['value'] );
|
281 |
+
|
282 |
+
$out = sprintf( '<select%s>%s</select>', Common\attr( $select_attr ), implode( '', $options ) );
|
283 |
+
|
284 |
+
if ( ! empty( $args['description'] ) ) {
|
285 |
+
$out = $out . '<p class="description">' . $args['description'] . '</p>';
|
286 |
+
}
|
287 |
+
|
288 |
+
echo $out; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
289 |
+
}
|
290 |
+
|
291 |
+
function params_section_description() {
|
292 |
+
|
293 |
+
$desc = sprintf(
|
294 |
+
__( // phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
|
295 |
+
'This parameters will be added to the <code>iframe src</code> urls, you can control the video players behavior with them. Please read <a href="%s" target="_blank">the documentation</a> on.',
|
296 |
+
'advanced-responsive-video-embedder'
|
297 |
+
),
|
298 |
+
esc_url( 'https://nextgenthemes.com/arve/documentation' )
|
299 |
+
);
|
300 |
+
|
301 |
+
echo "<p>$desc</p>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
302 |
+
|
303 |
+
?>
|
304 |
+
<p>
|
305 |
+
See
|
306 |
+
<a target="_blank" href="https://developers.google.com/youtube/player_parameters">Youtube Parameters</a>,
|
307 |
+
<a target="_blank" href="http://www.dailymotion.com/doc/api/player.html#parameters">Dailymotion Parameters</a>,
|
308 |
+
<a target="_blank" href="https://developer.vimeo.com/player/embedding">Vimeo Parameters</a>,
|
309 |
+
<a target="_blank" href="https://nextgenthemes.com/arve-pro/documentation">Vimeo Parameters</a>,
|
310 |
+
</p>
|
311 |
+
<?php
|
312 |
+
}
|
313 |
+
|
314 |
+
function plugin_ver_status( $folder_and_filename ) {
|
315 |
+
|
316 |
+
$file = WP_PLUGIN_DIR . '/' . $folder_and_filename;
|
317 |
+
|
318 |
+
if ( ! is_file( $file ) ) {
|
319 |
+
return 'NOT INSTALLED';
|
320 |
+
}
|
321 |
+
|
322 |
+
$data = get_plugin_data( $file );
|
323 |
+
$out = $data['Version'];
|
324 |
+
|
325 |
+
if ( ! is_plugin_active( $folder_and_filename ) ) {
|
326 |
+
$out .= ' INACTIVE';
|
327 |
+
}
|
328 |
+
|
329 |
+
return $out; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
330 |
+
}
|
331 |
+
|
332 |
+
function debug_section_description() {
|
333 |
+
include_once __DIR__ . '/partials/debug-info.php';
|
334 |
+
}
|
335 |
+
|
336 |
+
function admin_enqueue_styles() {
|
337 |
+
|
338 |
+
Common\enqueue_asset(
|
339 |
+
[
|
340 |
+
'handle' => 'advanced-responsive-video-embedder',
|
341 |
+
'src' => plugins_url( 'build/admin.css', ARVE\PLUGIN_FILE ),
|
342 |
+
'ver' => Common\ver( ARVE\VERSION, 'build/admin.css', ARVE\PLUGIN_FILE ),
|
343 |
+
]
|
344 |
+
);
|
345 |
+
}
|
346 |
+
|
347 |
+
function admin_enqueue_scripts() {
|
348 |
+
|
349 |
+
Common\enqueue_asset(
|
350 |
+
[
|
351 |
+
'handle' => 'arve-admin',
|
352 |
+
'path' => ARVE\PLUGIN_DIR . '/build/admin.js',
|
353 |
+
'src' => plugins_url( 'build/admin.js', ARVE\PLUGIN_FILE ),
|
354 |
+
'deps' => [ 'jquery' ],
|
355 |
+
]
|
356 |
+
);
|
357 |
+
|
358 |
+
if ( is_plugin_active( 'shortcode-ui/shortcode-ui.php' ) ) {
|
359 |
+
Common\enqueue_asset(
|
360 |
+
[
|
361 |
+
'handle' => 'arve-admin-sc-ui',
|
362 |
+
'path' => ARVE\PLUGIN_DIR . '/build/shortcode-ui.js',
|
363 |
+
'src' => plugins_url( 'build/shortcode-ui.js', ARVE\PLUGIN_FILE ),
|
364 |
+
'deps' => [ 'shortcode-ui' ],
|
365 |
+
]
|
366 |
+
);
|
367 |
+
}
|
368 |
+
}
|
369 |
+
|
370 |
+
function action_admin_bar_menu( $admin_bar ) {
|
371 |
+
|
372 |
+
if ( ARVE\options()['admin_bar_menu'] ) {
|
373 |
+
|
374 |
+
$admin_bar->add_menu(
|
375 |
+
[
|
376 |
+
'id' => 'arve-settings',
|
377 |
+
'title' => 'ARVE',
|
378 |
+
'href' => get_admin_url() . 'options-general.php?page=nextgenthemes_arve',
|
379 |
+
'meta' => [ 'title' => __( 'Advanced Responsive Video Embedder Settings', 'advanced-responsive-video-embedder' ) ],
|
380 |
+
]
|
381 |
+
);
|
382 |
+
}
|
383 |
+
}
|
php/Admin/functions-settings-page.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Admin;
|
3 |
+
|
4 |
+
use \Nextgenthemes\ARVE;
|
5 |
+
|
6 |
+
function settings_header() {
|
7 |
+
|
8 |
+
$sections = [
|
9 |
+
'main' => __( 'Main', 'advanced-responsive-video-embedder' ),
|
10 |
+
'pro' => __( 'Pro', 'advanced-responsive-video-embedder' ),
|
11 |
+
'videojs' => __( 'Video.js', 'advanced-responsive-video-embedder' ),
|
12 |
+
'randomvideo' => __( 'Random Video', 'advanced-responsive-video-embedder' ),
|
13 |
+
'html5' => __( 'HTML5 Video', 'advanced-responsive-video-embedder' ),
|
14 |
+
'urlparams' => __( 'URL Parameters', 'advanced-responsive-video-embedder' ),
|
15 |
+
'debug' => __( 'Debug', 'advanced-responsive-video-embedder' ),
|
16 |
+
];
|
17 |
+
|
18 |
+
?>
|
19 |
+
<button @click='showAllSectionsButDebug()' class="button-secondary">All Options</button>
|
20 |
+
<?php
|
21 |
+
foreach ( $sections as $slug => $name ) {
|
22 |
+
|
23 |
+
$btn_type = in_array( $slug, [ 'pro', 'videojs', 'randomvideo' ], true ) ? 'primary' : 'secondary';
|
24 |
+
|
25 |
+
printf(
|
26 |
+
' <button @click=\'showSection("%s")\' class="button-%s">%s</button>',
|
27 |
+
esc_attr( $slug ),
|
28 |
+
esc_attr( $btn_type ),
|
29 |
+
esc_html( $name )
|
30 |
+
);
|
31 |
+
}
|
32 |
+
?>
|
33 |
+
|
34 |
+
<div class="ngt-block" v-show="sectionsDisplayed.pro || sectionsDisplayed.videojs || sectionsDisplayed.randomvideo" >
|
35 |
+
<p><?php esc_html_e( 'You may already set options for addons but they will only take effect if the associated addons are installed.', 'advanced-responsive-video-embedder' ); ?></p>
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<div class="ngt-block" v-show="sectionsDisplayed.debug">
|
39 |
+
<?php require_once __DIR__ . '/partials/debug-info.php'; ?>
|
40 |
+
</div>
|
41 |
+
<?php
|
42 |
+
}
|
43 |
+
|
44 |
+
function settings_sidebar() {
|
45 |
+
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_readfile
|
46 |
+
readfile( __DIR__ . '/partials/settings-sidebar.html' );
|
47 |
+
}
|
48 |
+
|
49 |
+
function echo_active_plugins() {
|
50 |
+
$allplugins = get_plugins();
|
51 |
+
$active_plugins = get_option( 'active_plugins', [] );
|
52 |
+
|
53 |
+
echo "ACTIVE PLUGINS:\n";
|
54 |
+
foreach ( $allplugins as $plugin_path => $plugin ) {
|
55 |
+
// If the plugin isn't active, don't show it.
|
56 |
+
if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
|
57 |
+
continue;
|
58 |
+
}
|
59 |
+
echo esc_html( "{$plugin['Name']}: {$plugin['Version']}\n" );
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
function echo_network_active_plugins() {
|
64 |
+
|
65 |
+
if ( ! is_multisite() ) {
|
66 |
+
return;
|
67 |
+
}
|
68 |
+
|
69 |
+
echo "NETWORK ACTIVE PLUGINS: \n";
|
70 |
+
$allplugins = wp_get_active_network_plugins();
|
71 |
+
$active_plugins = get_site_option( 'active_sitewide_plugins', [] );
|
72 |
+
foreach ( $allplugins as $plugin_path ) {
|
73 |
+
$plugin_base = plugin_basename( $plugin_path );
|
74 |
+
// If the plugin isn't active, don't show it.
|
75 |
+
if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
|
76 |
+
continue;
|
77 |
+
}
|
78 |
+
$plugin = get_plugin_data( $plugin_path );
|
79 |
+
echo esc_html( "{$plugin['Name']}: {$plugin['Version']}\n" );
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
function filter_save_options( $options ) {
|
84 |
+
|
85 |
+
update_option( 'nextgenthemes_arve_oembed_recache', time() );
|
86 |
+
|
87 |
+
$action = json_decode( $options['action'] );
|
88 |
+
$options['action'] = '';
|
89 |
+
|
90 |
+
if ( $action ) {
|
91 |
+
$product_id = get_products()[ $action->product ]['id'];
|
92 |
+
$product_key = $options[ $action->product ];
|
93 |
+
|
94 |
+
$options[ $action->product . '_status' ] = api_action( $product_id, $product_key, $action->action );
|
95 |
+
}
|
96 |
+
|
97 |
+
return $option;
|
98 |
+
}
|
99 |
+
|
100 |
+
// unused, trigger recaching is rebuild is probably better, also there this leaves the times in the DB so will this even work?
|
101 |
+
function delete_oembed_caches() {
|
102 |
+
|
103 |
+
global $wpdb;
|
104 |
+
|
105 |
+
$wpdb->query(
|
106 |
+
$wpdb->prepare(
|
107 |
+
"DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE %s AND meta_value LIKE %s",
|
108 |
+
'%_oembed_%',
|
109 |
+
'%' . $wpdb->esc_like( 'id="arve-' ) . '%'
|
110 |
+
)
|
111 |
+
);
|
112 |
+
}
|
php/Admin/partials/debug-info.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Admin;
|
3 |
+
?>
|
4 |
+
<textarea style="font-family: monospace; width: 100%" rows="25">
|
5 |
+
ARVE Version: <?= esc_html( plugin_ver_status( 'advanced-responsive-video-embedder/advanced-responsive-video-embedder.php' ) . "\n" ); ?>
|
6 |
+
ARVE Pro Version: <?= esc_html( plugin_ver_status( 'arve-pro/arve-pro.php' ) . "\n" ); ?>
|
7 |
+
ARVE AMP Version: <?= esc_html( plugin_ver_status( 'arve-amp/arve-amp.php' ) . "\n" ); ?>
|
8 |
+
ARVE Random Video: <?= esc_html( plugin_ver_status( 'arve-random-video/arve-random-video.php' ) . "\n" ); ?>
|
9 |
+
WordPress Version: <?= esc_html( $GLOBALS['wp_version'] . "\n" ); ?>
|
10 |
+
PHP Version: <?= esc_html( phpversion() . "\n" ); ?>
|
11 |
+
|
12 |
+
<?php echo_active_plugins(); ?>
|
13 |
+
|
14 |
+
<?php echo_network_active_plugins(); ?>
|
15 |
+
|
16 |
+
ARVE OPTIONS:
|
17 |
+
<?php var_dump( get_option( 'nextgenthemes_arve' ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_dump ?>
|
18 |
+
</textarea>
|
php/Admin/partials/pro-ad.html
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<ul>
|
2 |
+
<li><strong>Disable links in embeds</strong>
|
3 |
+
For example: Clicking on a title in a YouTube embed will not open a new popup/tab/window. <strong>Prevent video hosts to lead your visitors away from your site!</strong></li>
|
4 |
+
<li><strong>Lazyload mode</strong><br>Make your site load <strong>faster</strong> by loading only a image instead of the entire video player on pageload.</li>
|
5 |
+
<li><strong>Lazyload -> Lightbox</strong><br>Shows the Video in a Lightbox after clicking a preview image</li>
|
6 |
+
<li><strong>Link -> Lightbox</strong><br>Use simple links as triggers for lightboxed videos</li>
|
7 |
+
<li>Automatic or custom titles and thumbnails images</li>
|
8 |
+
<li>'Expand on click' feature</li>
|
9 |
+
<li>And more, for a <strong><a href="https://nextgenthemes.com/plugins/arve-pro/">complete feature list</a></strong> and purchase please visit the <strong><a href="https://nextgenthemes.com/plugins/arve-pro/">official site</a></strong></li>
|
10 |
+
</ul>
|
php/Admin/partials/pro-ad.md
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
* **Disable links in embeds**
|
2 |
+
For example: Clicking on a title in a YouTube embed will not open a new popup/tab/window. **Prevent video hosts to lead your visitors away from your site!**
|
3 |
+
* **Lazyload mode**
|
4 |
+
Make your site load **faster** by loading only a image instead of the entire video player on pageload.
|
5 |
+
* **Lazyload -> Lightbox**
|
6 |
+
Shows the Video in a Lightbox after clicking a preview image
|
7 |
+
* **Link -> Lightbox**
|
8 |
+
Use simple links as triggers for lightboxed videos
|
9 |
+
* Automatic or custom titles and thumbnails images
|
10 |
+
* 'Expand on click' feature
|
11 |
+
* And more, for a **[complete feature list](https://nextgenthemes.com/plugins/arve-pro/)** and purchase please visit the **[official site](https://nextgenthemes.com/plugins/arve-pro/)**
|
php/Admin/partials/settings-sidebar.html
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="ngt-sidebar-box">
|
2 |
+
|
3 |
+
<h3 id="please-rate">Please rate</h3>
|
4 |
+
<p>It would really help to get a <a href="https://wordpress.org/support/plugin/advanced-responsive-video-embedder/reviews/#new-post">5 star rating from you.</a></p>
|
5 |
+
<h3 id="pro-addon"><a href="https://nextgenthemes.com/plugins/arve-pro/">Pro Addon</a></h3>
|
6 |
+
<p><strong><big>10% off</big></strong> first year with discount code <code style="font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;">settingspage</code>.</p>
|
7 |
+
<p>This plugin is financed by purchases of the <a href="https://nextgenthemes.com/plugins/arve-pro/">Pro Addon</a>. The development and support of this plugins has become a job for me so I hope you understand that I can not make all features gratis and that you <a href="https://nextgenthemes.com/plugins/arve-pro/">purchase it</a> to get extra features and support the development.</p>
|
8 |
+
<ul>
|
9 |
+
<li><strong>Disable links in embeds (killer feature!)</strong><br>For example: Clicking on a title in a YouTube embed will not open a new tab. <strong>Prevent video hosts to lead your visitors away from your site!</strong></li>
|
10 |
+
<li><strong>Lazyload mode</strong><br>Make your site load <strong>faster</strong> by loading only a image instead of the entire video player on pageload.</li>
|
11 |
+
<li><strong>Lazyload -> Lightbox</strong><br>Shows the Video in a Lightbox after clicking a preview image</li>
|
12 |
+
<li><strong>Link -> Lightbox</strong><br>Use simple links as triggers for lightboxed videos</li>
|
13 |
+
<li>Automatic or custom thumbnail images</li>
|
14 |
+
<li>Automatic or custom titles on top of your thumbnails</li>
|
15 |
+
<li>'Expand on click' feature</li>
|
16 |
+
<li>2 hover & 2 icon styles</li>
|
17 |
+
<li>Responsive thumbnails (srcset)</li>
|
18 |
+
<li><strong>Feel good about yourself</strong><br>for supporting my 5+ years work on this plugin. Tons of hours, weekends … always worked on improving it.</li>
|
19 |
+
<li>Show the latest video of a YouTube channel by using the channel URL (updated/cached hourly)</li>
|
20 |
+
<li><strong><a href="https://nextgenthemes.com/plugins/arve-pro/">Get the ARVE Pro Addon</a></strong></li>
|
21 |
+
</ul>
|
22 |
+
</div>
|
php/Admin/partials/settings-sidebar.md
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="ngt-sidebar-box">
|
2 |
+
|
3 |
+
### Please rate
|
4 |
+
|
5 |
+
It would really help to get a [5 star rating from you.](https://wordpress.org/support/plugin/advanced-responsive-video-embedder/reviews/#new-post)
|
6 |
+
|
7 |
+
### [Pro Addon][1]
|
8 |
+
|
9 |
+
**<big>10% off</big>** first year with discount code `settingspage`.
|
10 |
+
|
11 |
+
This plugin is financed by purchases of the [Pro Addon][1]. The development and support of this plugins has become a job for me so I hope you understand that I can not make all features gratis and that you [purchase it][1] to get extra features and support the development.
|
12 |
+
|
13 |
+
* **Disable links in embeds (killer feature!)**
|
14 |
+
For example: Clicking on a title in a YouTube embed will not open a new tab. **Prevent video hosts to lead your visitors away from your site!**
|
15 |
+
* **Lazyload mode**
|
16 |
+
Make your site load **faster** by loading only a image instead of the entire video player on pageload.
|
17 |
+
* **Lazyload -> Lightbox**
|
18 |
+
Shows the Video in a Lightbox after clicking a preview image
|
19 |
+
* **Link -> Lightbox**
|
20 |
+
Use simple links as triggers for lightboxed videos
|
21 |
+
* Automatic or custom thumbnail images
|
22 |
+
* Automatic or custom titles on top of your thumbnails
|
23 |
+
* 'Expand on click' feature
|
24 |
+
* 2 hover & 2 icon styles
|
25 |
+
* Responsive thumbnails (srcset)
|
26 |
+
* **Feel good about yourself**
|
27 |
+
for supporting my 5+ years work on this plugin. Tons of hours, weekends … always worked on improving it.
|
28 |
+
* Show the latest video of a YouTube channel by using the channel URL (updated/cached hourly)
|
29 |
+
* **[Get the ARVE Pro Addon][1]**
|
30 |
+
|
31 |
+
</div>
|
32 |
+
|
33 |
+
[1]: https://nextgenthemes.com/plugins/arve-pro/
|
admin/class-nextgenthemes-plugin-updater.php → php/Common/Admin/EDD/PluginUpdater.php
RENAMED
@@ -1,6 +1,7 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
|
|
|
4 |
// Exit if accessed directly
|
5 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
6 |
|
@@ -10,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
10 |
* @author Easy Digital Downloads
|
11 |
* @version 1.6.19
|
12 |
*/
|
13 |
-
class
|
14 |
|
15 |
private $api_url = '';
|
16 |
private $api_data = array();
|
@@ -96,7 +97,7 @@ class Nextgenthemes_Plugin_Updater {
|
|
96 |
global $pagenow;
|
97 |
|
98 |
if ( ! is_object( $_transient_data ) ) {
|
99 |
-
$_transient_data = new stdClass;
|
100 |
}
|
101 |
|
102 |
if ( 'plugins.php' == $pagenow && is_multisite() ) {
|
@@ -164,7 +165,7 @@ class Nextgenthemes_Plugin_Updater {
|
|
164 |
|
165 |
$update_cache = get_site_transient( 'update_plugins' );
|
166 |
|
167 |
-
$update_cache = is_object( $update_cache ) ? $update_cache : new stdClass();
|
168 |
|
169 |
if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
|
170 |
|
1 |
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common\Admin\EDD;
|
3 |
|
4 |
+
// phpcs:disable
|
5 |
// Exit if accessed directly
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
11 |
* @author Easy Digital Downloads
|
12 |
* @version 1.6.19
|
13 |
*/
|
14 |
+
class PluginUpdater {
|
15 |
|
16 |
private $api_url = '';
|
17 |
private $api_data = array();
|
97 |
global $pagenow;
|
98 |
|
99 |
if ( ! is_object( $_transient_data ) ) {
|
100 |
+
$_transient_data = new \stdClass();
|
101 |
}
|
102 |
|
103 |
if ( 'plugins.php' == $pagenow && is_multisite() ) {
|
165 |
|
166 |
$update_cache = get_site_transient( 'update_plugins' );
|
167 |
|
168 |
+
$update_cache = is_object( $update_cache ) ? $update_cache : new \stdClass();
|
169 |
|
170 |
if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
|
171 |
|
php/Common/Admin/EDD/ThemeUpdater.php
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common\Admin\EDD;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Theme updater class.
|
6 |
+
*
|
7 |
+
* @package EDD Sample Theme
|
8 |
+
*/
|
9 |
+
|
10 |
+
class ThemeUpdater {
|
11 |
+
|
12 |
+
private $remote_api_url;
|
13 |
+
private $request_data;
|
14 |
+
private $response_key;
|
15 |
+
private $theme_slug;
|
16 |
+
private $license_key;
|
17 |
+
private $version;
|
18 |
+
private $author;
|
19 |
+
protected $strings = null;
|
20 |
+
|
21 |
+
function __construct( $args = array(), $strings = array() ) {
|
22 |
+
|
23 |
+
$args = wp_parse_args(
|
24 |
+
$args,
|
25 |
+
array(
|
26 |
+
'remote_api_url' => 'http://easydigitaldownloads.com',
|
27 |
+
'request_data' => array(),
|
28 |
+
'theme_slug' => get_template(),
|
29 |
+
'item_name' => '',
|
30 |
+
'license' => '',
|
31 |
+
'version' => '',
|
32 |
+
'author' => '',
|
33 |
+
)
|
34 |
+
);
|
35 |
+
extract( $args );
|
36 |
+
|
37 |
+
$this->license = $license;
|
38 |
+
$this->item_name = $item_name;
|
39 |
+
$this->version = $version;
|
40 |
+
$this->theme_slug = sanitize_key( $theme_slug );
|
41 |
+
$this->author = $author;
|
42 |
+
$this->remote_api_url = $remote_api_url;
|
43 |
+
$this->response_key = $this->theme_slug . '-update-response';
|
44 |
+
$this->strings = $strings;
|
45 |
+
|
46 |
+
add_filter( 'site_transient_update_themes', array( &$this, 'theme_update_transient' ) );
|
47 |
+
add_filter( 'delete_site_transient_update_themes', array( &$this, 'delete_theme_update_transient' ) );
|
48 |
+
add_action( 'load-update-core.php', array( &$this, 'delete_theme_update_transient' ) );
|
49 |
+
add_action( 'load-themes.php', array( &$this, 'delete_theme_update_transient' ) );
|
50 |
+
add_action( 'load-themes.php', array( &$this, 'load_themes_screen' ) );
|
51 |
+
}
|
52 |
+
|
53 |
+
function load_themes_screen() {
|
54 |
+
add_thickbox();
|
55 |
+
add_action( 'admin_notices', array( &$this, 'update_nag' ) );
|
56 |
+
}
|
57 |
+
|
58 |
+
function update_nag() {
|
59 |
+
|
60 |
+
$strings = $this->strings;
|
61 |
+
|
62 |
+
$theme = wp_get_theme( $this->theme_slug );
|
63 |
+
|
64 |
+
$api_response = get_transient( $this->response_key );
|
65 |
+
|
66 |
+
if ( false === $api_response ) {
|
67 |
+
return;
|
68 |
+
}
|
69 |
+
|
70 |
+
$update_url = wp_nonce_url( 'update.php?action=upgrade-theme&theme=' . urlencode( $this->theme_slug ), 'upgrade-theme_' . $this->theme_slug );
|
71 |
+
$update_onclick = ' onclick="if ( confirm(\'' . esc_js( $strings['update-notice'] ) . '\') ) {return true;}return false;"';
|
72 |
+
|
73 |
+
if ( version_compare( $this->version, $api_response->new_version, '<' ) ) {
|
74 |
+
|
75 |
+
echo '<div id="update-nag">';
|
76 |
+
printf(
|
77 |
+
$strings['update-available'],
|
78 |
+
$theme->get( 'Name' ),
|
79 |
+
$api_response->new_version,
|
80 |
+
'#TB_inline?width=640&inlineId=' . $this->theme_slug . '_changelog',
|
81 |
+
$theme->get( 'Name' ),
|
82 |
+
$update_url,
|
83 |
+
$update_onclick
|
84 |
+
);
|
85 |
+
echo '</div>';
|
86 |
+
echo '<div id="' . $this->theme_slug . '_' . 'changelog" style="display:none;">';
|
87 |
+
echo wpautop( $api_response->sections['changelog'] );
|
88 |
+
echo '</div>';
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
function theme_update_transient( $value ) {
|
93 |
+
$update_data = $this->check_for_update();
|
94 |
+
if ( $update_data ) {
|
95 |
+
$value->response[ $this->theme_slug ] = $update_data;
|
96 |
+
}
|
97 |
+
return $value;
|
98 |
+
}
|
99 |
+
|
100 |
+
function delete_theme_update_transient() {
|
101 |
+
delete_transient( $this->response_key );
|
102 |
+
}
|
103 |
+
|
104 |
+
function check_for_update() {
|
105 |
+
|
106 |
+
$update_data = get_transient( $this->response_key );
|
107 |
+
|
108 |
+
if ( false === $update_data ) {
|
109 |
+
$failed = false;
|
110 |
+
|
111 |
+
$api_params = array(
|
112 |
+
'edd_action' => 'get_version',
|
113 |
+
'license' => $this->license,
|
114 |
+
'name' => $this->item_name,
|
115 |
+
'slug' => $this->theme_slug,
|
116 |
+
'author' => $this->author,
|
117 |
+
);
|
118 |
+
|
119 |
+
$response = wp_remote_post(
|
120 |
+
$this->remote_api_url,
|
121 |
+
array(
|
122 |
+
'timeout' => 15,
|
123 |
+
'body' => $api_params,
|
124 |
+
)
|
125 |
+
);
|
126 |
+
|
127 |
+
// Make sure the response was successful
|
128 |
+
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
|
129 |
+
$failed = true;
|
130 |
+
}
|
131 |
+
|
132 |
+
$update_data = json_decode( wp_remote_retrieve_body( $response ) );
|
133 |
+
|
134 |
+
if ( ! is_object( $update_data ) ) {
|
135 |
+
$failed = true;
|
136 |
+
}
|
137 |
+
|
138 |
+
// If the response failed, try again in 30 minutes
|
139 |
+
if ( $failed ) {
|
140 |
+
$data = new \stdClass();
|
141 |
+
$data->new_version = $this->version;
|
142 |
+
set_transient( $this->response_key, $data, strtotime( '+30 minutes' ) );
|
143 |
+
return false;
|
144 |
+
}
|
145 |
+
|
146 |
+
// If the status is 'ok', return the update arguments
|
147 |
+
if ( ! $failed ) {
|
148 |
+
$update_data->sections = maybe_unserialize( $update_data->sections );
|
149 |
+
set_transient( $this->response_key, $update_data, strtotime( '+12 hours' ) );
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
if ( version_compare( $this->version, $update_data->new_version, '>=' ) ) {
|
154 |
+
return false;
|
155 |
+
}
|
156 |
+
|
157 |
+
return (array) $update_data;
|
158 |
+
}
|
159 |
+
|
160 |
+
}
|
php/Common/Admin/NoticeFactory.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common\Admin;
|
3 |
+
|
4 |
+
use \Nextgenthemes\ARVE\Common;
|
5 |
+
|
6 |
+
class NoticeFactory {
|
7 |
+
|
8 |
+
public $slug;
|
9 |
+
public $notice;
|
10 |
+
public $dismiss_forever;
|
11 |
+
|
12 |
+
public function __construct( $slug, $notice, $dismiss_forever = true, $capabilities = 'activate_plugins' ) {
|
13 |
+
|
14 |
+
if ( ! current_user_can( $capabilities ) ) {
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
|
18 |
+
$this->notice_id = "admin-notice-factory-$slug";
|
19 |
+
$this->notice = (string) $notice;
|
20 |
+
$this->dismiss_forever = (bool) $dismiss_forever;
|
21 |
+
|
22 |
+
if ( 'admin-notice-factory-arve_dismiss_pro_notice' === $this->notice_id ) {
|
23 |
+
$this->notice_id = 'arve_dismiss_pro_notice';
|
24 |
+
}
|
25 |
+
|
26 |
+
add_action( 'admin_notices', [ $this, 'action_admin_notices' ] );
|
27 |
+
add_action( "wp_ajax_{$this->notice_id}", [ $this, 'ajax_call' ] );
|
28 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'assets' ] );
|
29 |
+
}
|
30 |
+
|
31 |
+
public function action_admin_notices() {
|
32 |
+
|
33 |
+
$user_id = get_current_user_id();
|
34 |
+
$user_meta = get_user_meta( $user_id, $this->notice_id );
|
35 |
+
|
36 |
+
if ( $this->dismiss_forever && ! empty( $user_meta ) ) {
|
37 |
+
return;
|
38 |
+
} elseif ( get_transient( $this->notice_id ) ) {
|
39 |
+
return;
|
40 |
+
}
|
41 |
+
|
42 |
+
printf(
|
43 |
+
'<div class="notice is-dismissible updated" data-nextgenthemes-notice-id="%s">%s</div>',
|
44 |
+
esc_attr( $this->notice_id ),
|
45 |
+
$this->notice // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
46 |
+
);
|
47 |
+
}
|
48 |
+
|
49 |
+
public function assets() {
|
50 |
+
|
51 |
+
Common\enqueue_asset(
|
52 |
+
[
|
53 |
+
'handle' => 'nextgenthemes-notice-ajax',
|
54 |
+
'deps' => [ 'jquery' ],
|
55 |
+
'path' => dirname( dirname( dirname( __DIR__ ) ) ) . '/build/common/notice-ajax.js',
|
56 |
+
'src' => Common\plugin_or_theme_src( 'build/common/notice-ajax.js' ),
|
57 |
+
]
|
58 |
+
);
|
59 |
+
}
|
60 |
+
|
61 |
+
public function ajax_call() {
|
62 |
+
|
63 |
+
$user_id = get_current_user_id();
|
64 |
+
|
65 |
+
if ( $this->dismiss_forever ) {
|
66 |
+
add_user_meta( $user_id, $this->notice_id, true );
|
67 |
+
} else {
|
68 |
+
set_transient( $this->notice_id, true, HOUR_IN_SECONDS );
|
69 |
+
}
|
70 |
+
|
71 |
+
wp_die();
|
72 |
+
}
|
73 |
+
}
|
php/Common/Admin/functions-licensing.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common\Admin;
|
3 |
+
|
4 |
+
use \Nextgenthemes\ARVE\Common;
|
5 |
+
|
6 |
+
function init_edd_updaters() {
|
7 |
+
|
8 |
+
$products = Common\get_products();
|
9 |
+
|
10 |
+
foreach ( $products as $product ) {
|
11 |
+
|
12 |
+
if ( 'plugin' === $product['type'] && ! empty( $product['file'] ) ) {
|
13 |
+
init_plugin_updater( $product );
|
14 |
+
} elseif ( 'theme' === $product['type'] ) {
|
15 |
+
init_theme_updater( $product );
|
16 |
+
}
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
function init_plugin_updater( $product ) {
|
21 |
+
|
22 |
+
// setup the updater
|
23 |
+
new EDD\PluginUpdater(
|
24 |
+
'https://nextgenthemes.com',
|
25 |
+
$product['file'],
|
26 |
+
[
|
27 |
+
'version' => $product['version'],
|
28 |
+
'license' => Common\ngt_options()[ $product['slug'] ],
|
29 |
+
'item_id' => $product['id'],
|
30 |
+
'author' => $product['author'],
|
31 |
+
'beta' => Common\ngt_options()[ $product['slug'] . '_beta' ],
|
32 |
+
]
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
function init_theme_updater( $product ) {
|
37 |
+
|
38 |
+
new EDD\ThemeUpdater(
|
39 |
+
[
|
40 |
+
'remote_api_url' => 'https://nextgenthemes.com',
|
41 |
+
'version' => $product['version'],
|
42 |
+
'license' => Common\ngt_options()[ $product['slug'] ],
|
43 |
+
'item_id' => $product['id'],
|
44 |
+
'author' => $product['author'],
|
45 |
+
'theme_slug' => $product['slug'],
|
46 |
+
'download_id' => $product['download_id'], // Optional, used for generating a license renewal link
|
47 |
+
#'renew_url' => $product['renew_link'], // Optional, allows for a custom license renewal link
|
48 |
+
],
|
49 |
+
[
|
50 |
+
'theme-license' => __( 'Theme License', 'advanced-responsive-video-embedder' ),
|
51 |
+
'enter-key' => __( 'Enter your theme license key.', 'advanced-responsive-video-embedder' ),
|
52 |
+
'license-key' => __( 'License Key', 'advanced-responsive-video-embedder' ),
|
53 |
+
'license-action' => __( 'License Action', 'advanced-responsive-video-embedder' ),
|
54 |
+
'deactivate-license' => __( 'Deactivate License', 'advanced-responsive-video-embedder' ),
|
55 |
+
'activate-license' => __( 'Activate License', 'advanced-responsive-video-embedder' ),
|
56 |
+
'status-unknown' => __( 'License status is unknown.', 'advanced-responsive-video-embedder' ),
|
57 |
+
'renew' => __( 'Renew?', 'advanced-responsive-video-embedder' ),
|
58 |
+
'unlimited' => __( 'unlimited', 'advanced-responsive-video-embedder' ),
|
59 |
+
'license-key-is-active' => __( 'License key is active.', 'advanced-responsive-video-embedder' ),
|
60 |
+
// Translators: Date
|
61 |
+
'expires%s' => __( 'Expires %s.', 'advanced-responsive-video-embedder' ),
|
62 |
+
'expires-never' => __( 'Lifetime License.', 'advanced-responsive-video-embedder' ),
|
63 |
+
// Translators: x of x sites activated
|
64 |
+
'%1$s/%2$-sites' => __( 'You have %1$s / %2$s sites activated.', 'advanced-responsive-video-embedder' ),
|
65 |
+
// Translators: Date
|
66 |
+
'license-key-expired-%s' => __( 'License key expired %s.', 'advanced-responsive-video-embedder' ),
|
67 |
+
'license-key-expired' => __( 'License key has expired.', 'advanced-responsive-video-embedder' ),
|
68 |
+
'license-keys-do-not-match' => __( 'License keys do not match.', 'advanced-responsive-video-embedder' ),
|
69 |
+
'license-is-inactive' => __( 'License is inactive.', 'advanced-responsive-video-embedder' ),
|
70 |
+
'license-key-is-disabled' => __( 'License key is disabled.', 'advanced-responsive-video-embedder' ),
|
71 |
+
'site-is-inactive' => __( 'Site is inactive.', 'advanced-responsive-video-embedder' ),
|
72 |
+
'license-status-unknown' => __( 'License status is unknown.', 'advanced-responsive-video-embedder' ),
|
73 |
+
'update-notice' => __( "Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.", 'advanced-responsive-video-embedder' ),
|
74 |
+
// phpcs:ignore
|
75 |
+
'update-available' => __( '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.', 'advanced-responsive-video-embedder' ),
|
76 |
+
]
|
77 |
+
);
|
78 |
+
}
|
php/Common/Admin/functions-notices.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
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 |
+
$products = Common\get_products();
|
10 |
+
|
11 |
+
foreach ( $products as $key => $value ) :
|
12 |
+
|
13 |
+
if ( $value['active'] && ! $value['valid_key'] ) {
|
14 |
+
$msg = sprintf(
|
15 |
+
// Translators: First %1$s is product name.
|
16 |
+
__( 'Hi there, thanks for your purchase. One last step, please activate your %1$s <a href="%2$s">here now</a>.', 'advanced-responsive-video-embedder' ),
|
17 |
+
$value['name'],
|
18 |
+
get_admin_url() . 'options-general.php?page=nextgenthemes'
|
19 |
+
);
|
20 |
+
new NoticeFactory( $key . '-activation-notice', "<p>$msg</p>", HOUR_IN_SECONDS );
|
21 |
+
}
|
22 |
+
endforeach;
|
23 |
+
}
|
php/Common/Admin/functions-settings.php
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common\Admin;
|
3 |
+
|
4 |
+
use \Nextgenthemes\ARVE\Common;
|
5 |
+
|
6 |
+
function label_text( $option ) {
|
7 |
+
?>
|
8 |
+
<span class="nextgenthemes-label-text">
|
9 |
+
<?php
|
10 |
+
echo esc_html( $option['label'] );
|
11 |
+
|
12 |
+
if (
|
13 |
+
Common\contains( __NAMESPACE__, 'ARVE' ) &&
|
14 |
+
! in_array( $option['tag'], [ 'main', 'html5', 'urlparams' ], true )
|
15 |
+
) {
|
16 |
+
|
17 |
+
printf(
|
18 |
+
' <a href="https://nextgenthemes.com/plugins/arve-%s">(%s)</a>',
|
19 |
+
esc_attr( $option['tag'] ),
|
20 |
+
esc_html( ucfirst( $option['tag'] ) . ' Addon' )
|
21 |
+
);
|
22 |
+
}
|
23 |
+
|
24 |
+
if ( ! empty( $option['tag'] ) && 'not' === $option['tag'] ) : ?>
|
25 |
+
|
26 |
+
<span class="button-primary button-primary--ngt-small">
|
27 |
+
<?= esc_html( $option['tag'] ); ?>
|
28 |
+
</span>
|
29 |
+
<?php endif; ?>
|
30 |
+
</span>
|
31 |
+
<?php
|
32 |
+
}
|
33 |
+
|
34 |
+
function print_boolean_field( $key, $option ) {
|
35 |
+
?>
|
36 |
+
<p>
|
37 |
+
<label>
|
38 |
+
<input
|
39 |
+
type="checkbox"
|
40 |
+
v-model="<?= esc_attr( "vm.$key" ); ?>"
|
41 |
+
name="<?= esc_attr( "vm.$key" ); ?>"
|
42 |
+
>
|
43 |
+
{{ vm.$key }} <?php label_text( $option ); ?>
|
44 |
+
</label>
|
45 |
+
</p>
|
46 |
+
<?php
|
47 |
+
}
|
48 |
+
|
49 |
+
function print_boolean_radio_field( $key, $option ) {
|
50 |
+
?>
|
51 |
+
<p>
|
52 |
+
<?php label_text( $option ); ?>
|
53 |
+
<label>
|
54 |
+
<input
|
55 |
+
type="radio"
|
56 |
+
v-model="<?= esc_attr( "vm.$key" ); ?>"
|
57 |
+
v-bind:value="true"
|
58 |
+
name="<?= esc_attr( "vm.$key" ); ?>"
|
59 |
+
>
|
60 |
+
Yes
|
61 |
+
</label>
|
62 |
+
|
63 |
+
<label>
|
64 |
+
<input
|
65 |
+
type="radio"
|
66 |
+
v-model="<?= esc_attr( "vm.$key" ); ?>"
|
67 |
+
v-bind:value="false"
|
68 |
+
name="<?= esc_attr( "vm.$key" ); ?>"
|
69 |
+
>
|
70 |
+
No
|
71 |
+
</label>
|
72 |
+
</p>
|
73 |
+
<?php
|
74 |
+
}
|
75 |
+
|
76 |
+
function print_string_field( $key, $option ) {
|
77 |
+
?>
|
78 |
+
<p>
|
79 |
+
<label>
|
80 |
+
<?php label_text( $option ); ?>
|
81 |
+
<input v-model="<?= esc_attr( "vm.$key" ); ?>" type="text" class="large-text" />
|
82 |
+
</label>
|
83 |
+
</p>
|
84 |
+
<?php
|
85 |
+
}
|
86 |
+
|
87 |
+
function print_hidden_field( $key, $option ) {} // yes we need this nothing function
|
88 |
+
|
89 |
+
function print_old_hidden_field( $key, $option ) {
|
90 |
+
?>
|
91 |
+
<input v-model="<?= esc_attr( "vm.$key" ); ?>" type="hidden" />
|
92 |
+
<?php
|
93 |
+
}
|
94 |
+
|
95 |
+
function print_licensekey_field( $key, $option ) {
|
96 |
+
|
97 |
+
$readonly = Common\get_defined_key( $key ) ? 'readonly' : '';
|
98 |
+
?>
|
99 |
+
<p>
|
100 |
+
<label>
|
101 |
+
<?php label_text( $option ); ?>
|
102 |
+
<input v-model="<?= esc_attr( "vm.$key" ); ?>" type="text" class="medium-text" style="width: 350px;" <?= esc_attr( $readonly ); ?> />
|
103 |
+
<?php if ( Common\has_valid_key( $key ) ) : ?>
|
104 |
+
<button @click="action( 'deactivate', '<?= esc_attr( $key ); ?>' )">Deactivate</button>
|
105 |
+
<?php else : ?>
|
106 |
+
<button @click="action( 'activate', '<?= esc_attr( $key ); ?>' )">Activate</button>
|
107 |
+
<?php endif; ?>
|
108 |
+
<br>
|
109 |
+
Status: <?= esc_html( "{{ vm.{$key}_status }}" ); ?>
|
110 |
+
</label>
|
111 |
+
</p>
|
112 |
+
<?php
|
113 |
+
}
|
114 |
+
|
115 |
+
function print_image_upload_field( $key, $option ) {
|
116 |
+
wp_enqueue_script( 'jquery' );
|
117 |
+
wp_enqueue_media();
|
118 |
+
?>
|
119 |
+
<p>
|
120 |
+
<label>
|
121 |
+
<?php label_text( $option ); ?>
|
122 |
+
<input v-model="<?= esc_attr( "vm.$key" ); ?>" type="text" class="large-text" />
|
123 |
+
<a class="button-secondary" @click="<?= esc_attr( "uploadImage('$key')" ); ?>">
|
124 |
+
<?php esc_html_e( 'Upload Image', 'advanced-responsive-video-embedder' ); ?>
|
125 |
+
</a>
|
126 |
+
</label>
|
127 |
+
</p>
|
128 |
+
<?php
|
129 |
+
}
|
130 |
+
|
131 |
+
function print_integer_field( $key, $option ) {
|
132 |
+
?>
|
133 |
+
<p>
|
134 |
+
<label>
|
135 |
+
<?php label_text( $option ); ?>
|
136 |
+
<input v-model="<?= esc_attr( "vm.$key" ); ?>" type="number" />
|
137 |
+
</label>
|
138 |
+
</p>
|
139 |
+
<?php
|
140 |
+
}
|
141 |
+
|
142 |
+
function print_select_field( $key, $option ) {
|
143 |
+
|
144 |
+
unset( $option['options'][''] );
|
145 |
+
?>
|
146 |
+
<p>
|
147 |
+
<label>
|
148 |
+
<?php label_text( $option ); ?>
|
149 |
+
<select v-model="<?= esc_attr( "vm.$key" ); ?>">
|
150 |
+
<option disabled value="">Please select one</option>
|
151 |
+
<?php foreach ( $option['options'] as $k => $v ) : ?>
|
152 |
+
<option value="<?= esc_attr( $k ); ?>"><?= esc_html( $v ); ?></option>
|
153 |
+
<?php endforeach; ?>
|
154 |
+
</select>
|
155 |
+
</label>
|
156 |
+
</p>
|
157 |
+
<?php
|
158 |
+
}
|
159 |
+
|
160 |
+
function block_attr( $key, $option ) {
|
161 |
+
|
162 |
+
if ( empty( $option['tag'] ) ) {
|
163 |
+
$block_attr['class'] = "ngt-option-block ngt-option-block--$key";
|
164 |
+
} else {
|
165 |
+
$block_attr = [
|
166 |
+
'class' => "ngt-option-block ngt-option-block--$key ngt-option-block--{$option['tag']}",
|
167 |
+
'v-show' => 'sectionsDisplayed.' . $option['tag'],
|
168 |
+
];
|
169 |
+
}
|
170 |
+
|
171 |
+
return Common\attr( $block_attr );
|
172 |
+
}
|
php/Common/Settings.php
ADDED
@@ -0,0 +1,227 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common;
|
3 |
+
|
4 |
+
class Settings {
|
5 |
+
|
6 |
+
private $menu_title = '';
|
7 |
+
private $option_key = '';
|
8 |
+
private $slugged_namspace = '';
|
9 |
+
private $slashed_namspace = '';
|
10 |
+
private $rest_namespace = '';
|
11 |
+
private $rest_url = '';
|
12 |
+
private $settings = [];
|
13 |
+
private $settings_page_title = '';
|
14 |
+
private $options_defaults = [];
|
15 |
+
|
16 |
+
public function __construct( $args ) {
|
17 |
+
|
18 |
+
$defaults = [
|
19 |
+
'menu_parent_slug' => 'options-general.php',
|
20 |
+
];
|
21 |
+
|
22 |
+
$args = wp_parse_args( $args, $defaults );
|
23 |
+
|
24 |
+
$this->settings = $args['settings'];
|
25 |
+
$this->menu_title = $args['menu_title'];
|
26 |
+
$this->settings_page_title = $args['settings_page_title'];
|
27 |
+
$this->slugged_namespace = sanitize_key( str_replace( '\\', '_', $args['namespace'] ) );
|
28 |
+
$this->slashed_namespace = str_replace( '_', '/', $this->slugged_namespace );
|
29 |
+
$this->rest_namespace = $this->slugged_namespace . '/v1';
|
30 |
+
$this->rest_url = get_home_url() . '/wp-json/' . $this->rest_namespace;
|
31 |
+
$this->menu_parent_slug = $args['menu_parent_slug'];
|
32 |
+
|
33 |
+
foreach ( $this->settings as $key => $value ) {
|
34 |
+
$this->options_defaults[ $key ] = $value['default'];
|
35 |
+
}
|
36 |
+
|
37 |
+
$this->options = (array) get_option( $this->slugged_namespace, [] );
|
38 |
+
$this->options = $this->options + $this->options_defaults;
|
39 |
+
|
40 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'assets' ] );
|
41 |
+
add_action( 'rest_api_init', [ $this, 'register_rest_route' ] );
|
42 |
+
add_action( 'admin_menu', [ $this, 'register_setting_page' ] );
|
43 |
+
}
|
44 |
+
|
45 |
+
public function set_defined_product_keys() {
|
46 |
+
|
47 |
+
$products = get_products();
|
48 |
+
foreach ( $products as $p => $value ) {
|
49 |
+
$defined_key = get_defined_key( $p );
|
50 |
+
if ( $defined_key ) {
|
51 |
+
$this->options[ $p ] = $defined_key;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
public function get_options() {
|
57 |
+
$options = (array) get_option( $this->slugged_namespace, [] );
|
58 |
+
$options = $options + $this->options_defaults;
|
59 |
+
return $options;
|
60 |
+
}
|
61 |
+
|
62 |
+
public function get_options_defaults() {
|
63 |
+
return $this->options_defaults;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function save_options( $options ) {
|
67 |
+
|
68 |
+
if ( 'nextgenthemes' === $this->slugged_namespace ) {
|
69 |
+
|
70 |
+
$action = json_decode( $options['action'] );
|
71 |
+
$options['action'] = '';
|
72 |
+
|
73 |
+
if ( $action ) {
|
74 |
+
$product_id = get_products()[ $action->product ]['id'];
|
75 |
+
$product_key = $options[ $action->product ];
|
76 |
+
|
77 |
+
$options[ $action->product . '_status' ] = api_action( $product_id, $product_key, $action->action );
|
78 |
+
}
|
79 |
+
} elseif ( 'nextgenthemes_arve' === $this->slugged_namespace ) {
|
80 |
+
update_option( 'nextgenthemes_arve_oembed_recache', time() );
|
81 |
+
}
|
82 |
+
|
83 |
+
// remove all items from options that are not also in defaults.
|
84 |
+
$options = array_diff_assoc( $options, $this->options_defaults );
|
85 |
+
// store only the options that differ from the defaults.
|
86 |
+
$options = array_intersect_key( $options, $this->options_defaults );
|
87 |
+
|
88 |
+
update_option( $this->slugged_namespace, $options );
|
89 |
+
}
|
90 |
+
|
91 |
+
public function register_rest_route() {
|
92 |
+
|
93 |
+
register_rest_route(
|
94 |
+
$this->rest_namespace,
|
95 |
+
'/save',
|
96 |
+
[
|
97 |
+
'methods' => 'POST',
|
98 |
+
'args' => $this->settings,
|
99 |
+
'permission_callback' => function() {
|
100 |
+
return current_user_can( 'manage_options' );
|
101 |
+
},
|
102 |
+
'callback' => function( \WP_REST_Request $request ) {
|
103 |
+
$this->save_options( $request->get_params() );
|
104 |
+
die( '1' );
|
105 |
+
},
|
106 |
+
]
|
107 |
+
);
|
108 |
+
}
|
109 |
+
|
110 |
+
public function assets( $page ) {
|
111 |
+
|
112 |
+
// Check if we are currently viewing our setting page
|
113 |
+
if ( ! ends_with( $page, $this->slugged_namespace ) ) {
|
114 |
+
return;
|
115 |
+
}
|
116 |
+
|
117 |
+
enqueue_asset(
|
118 |
+
[
|
119 |
+
'handle' => 'nextgenthemes-settings',
|
120 |
+
'src' => plugin_or_theme_src( 'build/common/settings.css' ),
|
121 |
+
'ver' => plugin_or_theme_ver( \Nextgenthemes\ARVE\VERSION, 'build/common/settings.css' ),
|
122 |
+
]
|
123 |
+
);
|
124 |
+
|
125 |
+
enqueue_asset(
|
126 |
+
[
|
127 |
+
'handle' => 'nextgenthemes-settings',
|
128 |
+
'path' => dirname( dirname( __DIR__ ) ) . '/build/common/settings.js',
|
129 |
+
'src' => plugin_or_theme_src( 'build/common/settings.js' ),
|
130 |
+
'deps' => [ 'jquery' ],
|
131 |
+
]
|
132 |
+
);
|
133 |
+
|
134 |
+
// Sending data to our plugin settings JS file
|
135 |
+
wp_localize_script(
|
136 |
+
'nextgenthemes-settings',
|
137 |
+
$this->slugged_namespace,
|
138 |
+
[
|
139 |
+
'nonce' => wp_create_nonce( 'wp_rest' ),
|
140 |
+
'rest_url' => $this->rest_url,
|
141 |
+
'home_url' => get_home_url(),
|
142 |
+
'options' => $this->options,
|
143 |
+
]
|
144 |
+
);
|
145 |
+
}
|
146 |
+
|
147 |
+
public function print_settings_blocks() {
|
148 |
+
|
149 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
150 |
+
foreach ( $this->settings as $key => $option ) {
|
151 |
+
|
152 |
+
$field_type = isset( $option['ui'] ) ? $option['ui'] : $option['type'];
|
153 |
+
|
154 |
+
if ( 'hidden' !== $field_type ) :
|
155 |
+
?>
|
156 |
+
<div <?php echo Admin\block_attr( $key, $option ); ?>>
|
157 |
+
<?php
|
158 |
+
|
159 |
+
$function = __NAMESPACE__ . "\\Admin\\print_{$field_type}_field";
|
160 |
+
|
161 |
+
$function( $key, $option );
|
162 |
+
|
163 |
+
if ( ! empty( $option['description'] ) ) {
|
164 |
+
printf( '<p>%s</p>', $option['description'] );
|
165 |
+
}
|
166 |
+
?>
|
167 |
+
<hr>
|
168 |
+
</div>
|
169 |
+
<?php
|
170 |
+
endif;
|
171 |
+
}
|
172 |
+
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
|
173 |
+
}
|
174 |
+
|
175 |
+
public function print_admin_page() {
|
176 |
+
?>
|
177 |
+
<div class='wrap wrap--nextgenthemes'>
|
178 |
+
<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
|
179 |
+
<div class="ngt-settings-grid">
|
180 |
+
<div class="ngt-settings-grid__content" id='nextgenthemes-vue'>
|
181 |
+
<?php
|
182 |
+
|
183 |
+
do_action( $this->slashed_namespace . '/admin/settings_header', $this );
|
184 |
+
|
185 |
+
$this->print_settings_blocks();
|
186 |
+
|
187 |
+
?>
|
188 |
+
<p>
|
189 |
+
<button
|
190 |
+
@click='saveOptions'
|
191 |
+
:disabled='isSaving'
|
192 |
+
id='vpsp-submit-settings'
|
193 |
+
class='button button-primary'>Save</button>
|
194 |
+
<img
|
195 |
+
v-if='isSaving == true'
|
196 |
+
id='loading-indicator'
|
197 |
+
class="wrap--nextgenthemes__loading-indicator"
|
198 |
+
src='<?php echo esc_url( get_admin_url() . '/images/wpspin_light-2x.gif' ); ?>'
|
199 |
+
alt='Loading indicator' />
|
200 |
+
</p>
|
201 |
+
<p v-if='message'>{{ message }}</p>
|
202 |
+
</div>
|
203 |
+
<div class="ngt-settings-grid__sidebar">
|
204 |
+
<?php do_action( $this->slashed_namespace . '/admin/settings_sidebar', $this ); ?>
|
205 |
+
</div>
|
206 |
+
</div>
|
207 |
+
</div>
|
208 |
+
<?php
|
209 |
+
}
|
210 |
+
|
211 |
+
public function register_setting_page() {
|
212 |
+
|
213 |
+
// The HTML Document title for our settings page.
|
214 |
+
$page_title = $this->settings_page_title;
|
215 |
+
// The menu item title for our settings page.
|
216 |
+
$menu_title = $this->menu_title;
|
217 |
+
// The user permission required to view our settings page.
|
218 |
+
$capability = 'manage_options';
|
219 |
+
// The URL slug for our settings page.
|
220 |
+
$menu_slug = $this->slugged_namespace;
|
221 |
+
// The callback function for rendering our settings page HTML.
|
222 |
+
$callback = [ $this, 'print_admin_page' ];
|
223 |
+
$parent_slug = $this->menu_parent_slug;
|
224 |
+
|
225 |
+
add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $callback );
|
226 |
+
}
|
227 |
+
}
|
php/Common/functions-assets.php
ADDED
@@ -0,0 +1,268 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 ) {
|
10 |
+
$src_without_query = strtok( $src, '?' );
|
11 |
+
return '.js' === substr( $src_without_query, -3 ) ? true : false;
|
12 |
+
}
|
13 |
+
|
14 |
+
function asset_info( $path ) {
|
15 |
+
|
16 |
+
if ( ! $path || ! is_file( $path ) ) {
|
17 |
+
return [ 'dependencies' => [], 'version' => null ];
|
18 |
+
}
|
19 |
+
|
20 |
+
$info = pathinfo( $path );
|
21 |
+
|
22 |
+
if ( 'js' === $info['extension'] ) {
|
23 |
+
$asset_info_php = $info['dirname'] . DIRECTORY_SEPARATOR . $info['filename'] . '.asset.php';
|
24 |
+
|
25 |
+
if ( is_file( $asset_info_php ) ) {
|
26 |
+
return require( $asset_info_php );
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
return [ 'dependencies' => [], 'version' => filemtime( $path ) ];
|
31 |
+
}
|
32 |
+
|
33 |
+
function replace_extension($filename, $new_extension) {
|
34 |
+
$info = pathinfo($filename);
|
35 |
+
$dir = $info['dirname'] ? $info['dirname'] . DIRECTORY_SEPARATOR : '';
|
36 |
+
|
37 |
+
return $dir . $info['filename'] . '.' . $new_extension;
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
function asset( array $args ) {
|
42 |
+
|
43 |
+
$defaults = [
|
44 |
+
'path' => '',
|
45 |
+
'async' => false,
|
46 |
+
'cdn_src' => '',
|
47 |
+
'defer' => false,
|
48 |
+
'deps' => [],
|
49 |
+
'enqueue' => false,
|
50 |
+
'enqueue_hooks' => [],
|
51 |
+
'handle' => '',
|
52 |
+
'in_footer' => true,
|
53 |
+
'integrity' => '',
|
54 |
+
'media' => 'all',
|
55 |
+
'src' => '',
|
56 |
+
'ver' => null,
|
57 |
+
'mce' => false,
|
58 |
+
];
|
59 |
+
|
60 |
+
$args = wp_parse_args( $args, $defaults );
|
61 |
+
$info = asset_info( $args['path'] );
|
62 |
+
$args['deps'] = $args['deps'] + $info['dependencies'];
|
63 |
+
|
64 |
+
if ( ! $args['ver'] ) {
|
65 |
+
$args['ver'] = $info['version'];
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( ! empty( $args['cdn_src'] ) && nextgenthemes_settings_instance()->options['cdn'] ) {
|
69 |
+
$args['src'] = $args['cdn_src'];
|
70 |
+
$args['ver'] = null;
|
71 |
+
}
|
72 |
+
|
73 |
+
if ( is_script( $args['src'] ) ) {
|
74 |
+
|
75 |
+
wp_register_script( $args['handle'], $args['src'], $args['deps'], $args['ver'], $args['in_footer'] );
|
76 |
+
|
77 |
+
if ( $args['integrity'] || $args['async'] || $args['defer'] ) {
|
78 |
+
add_attr_to_asset( 'script', $args );
|
79 |
+
}
|
80 |
+
|
81 |
+
if ( $args['enqueue'] ) {
|
82 |
+
wp_enqueue_script( $args['handle'] );
|
83 |
+
}
|
84 |
+
|
85 |
+
foreach ( $args['enqueue_hooks'] as $hook ) {
|
86 |
+
enqueue_script( $args['handle'], $hook );
|
87 |
+
}
|
88 |
+
} else {
|
89 |
+
wp_register_style( $args['handle'], $args['src'], $args['deps'], $args['ver'], $args['media'] );
|
90 |
+
|
91 |
+
if ( $args['integrity'] ) {
|
92 |
+
add_attr_to_asset( 'style', $args );
|
93 |
+
}
|
94 |
+
|
95 |
+
if ( $args['enqueue'] ) {
|
96 |
+
wp_enqueue_style( $args['handle'] );
|
97 |
+
}
|
98 |
+
|
99 |
+
foreach ( $args['enqueue_hooks'] as $hook ) {
|
100 |
+
enqueue_style( $args['handle'], $hook );
|
101 |
+
}
|
102 |
+
|
103 |
+
if ( $args['mce'] ) {
|
104 |
+
add_filter(
|
105 |
+
'mce_css',
|
106 |
+
function( $mce_css ) use ( $args ) {
|
107 |
+
if ( ! empty( $mce_css ) ) {
|
108 |
+
$mce_css .= ',';
|
109 |
+
}
|
110 |
+
$mce_css .= $args['src'];
|
111 |
+
return $mce_css;
|
112 |
+
}
|
113 |
+
);
|
114 |
+
}
|
115 |
+
}//end if
|
116 |
+
}
|
117 |
+
|
118 |
+
function enqueue_style( $handle, $hook ) {
|
119 |
+
|
120 |
+
add_filter(
|
121 |
+
$hook,
|
122 |
+
function() use ( $handle ) {
|
123 |
+
wp_enqueue_style( $handle );
|
124 |
+
}
|
125 |
+
);
|
126 |
+
}
|
127 |
+
|
128 |
+
function enqueue_script( $handle, $hook ) {
|
129 |
+
|
130 |
+
add_filter(
|
131 |
+
$hook,
|
132 |
+
function() use ( $handle ) {
|
133 |
+
wp_enqueue_script( $handle );
|
134 |
+
}
|
135 |
+
);
|
136 |
+
}
|
137 |
+
|
138 |
+
function add_attr_to_asset( $type, array $args ) {
|
139 |
+
|
140 |
+
if ( ! in_array( $type, [ 'script', 'style' ], true ) ) {
|
141 |
+
wp_die( 'first arg needs to be script or style' );
|
142 |
+
}
|
143 |
+
|
144 |
+
add_filter(
|
145 |
+
"{$type}_loader_tag",
|
146 |
+
function( $html, $handle ) use ( $type, $args ) {
|
147 |
+
|
148 |
+
if ( $args['handle'] !== $handle ) {
|
149 |
+
return $html;
|
150 |
+
}
|
151 |
+
|
152 |
+
$tag = ( 'style' === $type ) ? 'link' : 'script';
|
153 |
+
$tag_open = sprintf( '<%s ', tag_escape( $tag ) );
|
154 |
+
|
155 |
+
if ( $args['integrity'] ) {
|
156 |
+
$html = str_replace(
|
157 |
+
$tag_open,
|
158 |
+
sprintf( $tag_open . 'integrity="%s" crossorigin="anonymous" ', esc_attr( $args['integrity'] ) ),
|
159 |
+
$html
|
160 |
+
);
|
161 |
+
}
|
162 |
+
if ( $args['async'] ) {
|
163 |
+
$html = str_replace(
|
164 |
+
$tag_open,
|
165 |
+
$tag_open . 'async="async" ',
|
166 |
+
$html
|
167 |
+
);
|
168 |
+
}
|
169 |
+
if ( $args['defer'] ) {
|
170 |
+
$html = str_replace(
|
171 |
+
$tag_open,
|
172 |
+
$tag_open . 'defer="defer" ',
|
173 |
+
$html
|
174 |
+
);
|
175 |
+
}
|
176 |
+
|
177 |
+
return $html;
|
178 |
+
},
|
179 |
+
10,
|
180 |
+
2
|
181 |
+
);
|
182 |
+
}
|
183 |
+
|
184 |
+
function add_mce_css() {
|
185 |
+
|
186 |
+
add_filter(
|
187 |
+
'mce_css',
|
188 |
+
function( $mce_css ) {
|
189 |
+
if ( ! empty( $mce_css ) ) {
|
190 |
+
$mce_css .= ',';
|
191 |
+
}
|
192 |
+
$mce_css .= plugins_url( 'build/arve.css', ARVE\PLUGIN_FILE );
|
193 |
+
return $mce_css;
|
194 |
+
}
|
195 |
+
);
|
196 |
+
}
|
197 |
+
|
198 |
+
function add_dep_to_script( $handle, $dep ) {
|
199 |
+
|
200 |
+
$asset = $GLOBALS['wp_scripts']->query( $handle, 'registered' );
|
201 |
+
|
202 |
+
return add_dep_to_asset( $handle, $dep, $asset );
|
203 |
+
}
|
204 |
+
|
205 |
+
function add_dep_to_style( $handle, $dep ) {
|
206 |
+
|
207 |
+
$asset = $GLOBALS['wp_styles']->query( $handle, 'registered' );
|
208 |
+
|
209 |
+
return add_dep_to_asset( $handle, $dep, $asset );
|
210 |
+
}
|
211 |
+
|
212 |
+
function add_dep_to_asset( $handle, $dep, $asset ) {
|
213 |
+
|
214 |
+
if ( ! $asset ) {
|
215 |
+
return false;
|
216 |
+
}
|
217 |
+
|
218 |
+
if ( ! in_array( $dep, $asset->deps, true ) ) {
|
219 |
+
$asset->deps[] = $dep;
|
220 |
+
}
|
221 |
+
|
222 |
+
return true;
|
223 |
+
}
|
224 |
+
|
225 |
+
function plugin_file() {
|
226 |
+
return get_constant( '\Nextgenthemes\ARVE\PLUGIN_FILE' );
|
227 |
+
}
|
228 |
+
|
229 |
+
function plugin_or_theme_src( $path ) {
|
230 |
+
|
231 |
+
$plugin_file = plugin_file();
|
232 |
+
|
233 |
+
if ( $plugin_file ) {
|
234 |
+
return plugins_url( $path, $plugin_file );
|
235 |
+
} else {
|
236 |
+
return get_theme_file_uri( $path );
|
237 |
+
}
|
238 |
+
}
|
239 |
+
|
240 |
+
function plugin_or_theme_ver( $ver, $path ) {
|
241 |
+
|
242 |
+
$plugin_file = plugin_file();
|
243 |
+
|
244 |
+
if ( $plugin_file ) {
|
245 |
+
return ver( $ver, $path, $plugin_file );
|
246 |
+
} else {
|
247 |
+
return ver( $ver, get_parent_theme_file_path( $path ) );
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Much like Much like plugins_url( $path, __FILE__ );
|
253 |
+
*/
|
254 |
+
function ver( $ver, $path, $file = false ) {
|
255 |
+
|
256 |
+
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
257 |
+
|
258 |
+
if ( $file ) {
|
259 |
+
$path = trailingslashit( dirname( $file ) ) . $path;
|
260 |
+
}
|
261 |
+
|
262 |
+
if ( is_file( $path ) ) { // When CI testing for only PHP
|
263 |
+
$ver = filemtime( $path );
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
return $ver;
|
268 |
+
}
|
php/Common/functions-attr.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common;
|
3 |
+
|
4 |
+
function attr( array $attr = [] ) {
|
5 |
+
|
6 |
+
$html = '';
|
7 |
+
|
8 |
+
foreach ( $attr as $key => $value ) {
|
9 |
+
|
10 |
+
if ( false === $value || null === $value ) {
|
11 |
+
|
12 |
+
continue;
|
13 |
+
|
14 |
+
} elseif ( '' === $value || true === $value ) {
|
15 |
+
|
16 |
+
$html .= sprintf( ' %s', esc_html( $key ) );
|
17 |
+
|
18 |
+
} elseif ( is_array( $value ) || is_object( $value ) ) {
|
19 |
+
|
20 |
+
$html .= sprintf( " %s='%s'", esc_html( $key ), wp_json_encode( $value ) );
|
21 |
+
|
22 |
+
} elseif ( in_array( $key, [ 'href', 'data-href', 'src', 'data-src' ], true ) ) {
|
23 |
+
|
24 |
+
$html .= sprintf( ' %s="%s"', esc_html( $key ), esc_url( $value ) );
|
25 |
+
|
26 |
+
} else {
|
27 |
+
|
28 |
+
$html .= sprintf( ' %s="%s"', esc_html( $key ), esc_attr( $value ) );
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
return $html;
|
33 |
+
}
|
php/Common/functions-license.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common;
|
3 |
+
|
4 |
+
function has_valid_key( $product ) {
|
5 |
+
$o = (array) get_option( 'nextgenthemes' );
|
6 |
+
|
7 |
+
return ( ! empty( $o[ "{$product}_status" ] ) && 'valid' === $o[ "{$product}_status" ] );
|
8 |
+
}
|
9 |
+
|
10 |
+
function get_defined_key( $slug ) {
|
11 |
+
|
12 |
+
$constant_name = str_replace( '-', '_', strtoupper( $slug . '_KEY' ) );
|
13 |
+
|
14 |
+
if ( defined( $constant_name ) && constant( $constant_name ) ) {
|
15 |
+
return constant( $constant_name );
|
16 |
+
} else {
|
17 |
+
return false;
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
function activate_product_key( $product, $key ) {
|
22 |
+
|
23 |
+
$product_id = get_products()[ $product ]['id'];
|
24 |
+
|
25 |
+
$options = (array) get_option( 'nextgenthemes' );
|
26 |
+
$options[ $product . '_status' ] = api_action( $product_id, $key, 'activate' );
|
27 |
+
|
28 |
+
update_option( 'nextgenthemes', $options );
|
29 |
+
}
|
30 |
+
|
31 |
+
function api_action( $item_id, $key, $action = 'check' ) {
|
32 |
+
|
33 |
+
if ( ! in_array( $action, [ 'activate', 'deactivate', 'check' ], true ) ) {
|
34 |
+
wp_die( 'invalid action' );
|
35 |
+
}
|
36 |
+
|
37 |
+
// Call the custom API.
|
38 |
+
$response = remote_get_json(
|
39 |
+
'https://nextgenthemes.com',
|
40 |
+
[
|
41 |
+
'timeout' => 10,
|
42 |
+
'body' => [
|
43 |
+
'edd_action' => $action . '_license',
|
44 |
+
'license' => sanitize_text_field( $key ),
|
45 |
+
'item_id' => $item_id,
|
46 |
+
'url' => home_url(),
|
47 |
+
],
|
48 |
+
]
|
49 |
+
);
|
50 |
+
|
51 |
+
// make sure the response came back okay
|
52 |
+
if ( is_wp_error( $response ) ) {
|
53 |
+
$message = $response->get_error_message();
|
54 |
+
} else {
|
55 |
+
$message = get_api_error_message( $response );
|
56 |
+
}
|
57 |
+
|
58 |
+
if ( empty( $message ) ) {
|
59 |
+
|
60 |
+
if ( empty( $response->license ) ) {
|
61 |
+
|
62 |
+
$textarea_dump = textarea_dump( $response );
|
63 |
+
|
64 |
+
$message = sprintf(
|
65 |
+
// Translators: Error message
|
66 |
+
__( 'Error. Please report the following:<br>%s', 'advanced-responsive-video-embedder' ),
|
67 |
+
$textarea_dump
|
68 |
+
);
|
69 |
+
} else {
|
70 |
+
$message = $response->license;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
return $message;
|
75 |
+
}
|
76 |
+
|
77 |
+
function get_api_error_message( $license_data ) {
|
78 |
+
|
79 |
+
if ( false !== $license_data->success ) {
|
80 |
+
return '';
|
81 |
+
}
|
82 |
+
|
83 |
+
switch ( $license_data->error ) {
|
84 |
+
case 'expired':
|
85 |
+
$message = sprintf(
|
86 |
+
// Translators: Date
|
87 |
+
__( 'Your license key expired on %s.', 'advanced-responsive-video-embedder' ),
|
88 |
+
date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, time() ) )
|
89 |
+
);
|
90 |
+
break;
|
91 |
+
|
92 |
+
case 'revoked':
|
93 |
+
$message = __( 'Your license key has been disabled.', 'advanced-responsive-video-embedder' );
|
94 |
+
break;
|
95 |
+
|
96 |
+
case 'missing':
|
97 |
+
$message = __( 'Invalid license.', 'advanced-responsive-video-embedder' );
|
98 |
+
break;
|
99 |
+
|
100 |
+
case 'invalid':
|
101 |
+
case 'site_inactive':
|
102 |
+
$message = __( 'Your license is not active for this URL.', 'advanced-responsive-video-embedder' );
|
103 |
+
break;
|
104 |
+
|
105 |
+
case 'item_name_mismatch':
|
106 |
+
// Translators: Product Name
|
107 |
+
$message = sprintf( __( 'This appears to be an invalid license key for %s.', 'advanced-responsive-video-embedder' ), 'advanced-responsive-video-embedder' );
|
108 |
+
break;
|
109 |
+
|
110 |
+
case 'no_activations_left':
|
111 |
+
$message = __( 'Your license key has reached its activation limit.', 'advanced-responsive-video-embedder' );
|
112 |
+
break;
|
113 |
+
|
114 |
+
default:
|
115 |
+
$message = __( 'An error occurred, please try again.', 'advanced-responsive-video-embedder' );
|
116 |
+
break;
|
117 |
+
}//end switch
|
118 |
+
}
|
119 |
+
|
120 |
+
function dump( $var ) {
|
121 |
+
ob_start();
|
122 |
+
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_dump
|
123 |
+
var_dump( $var );
|
124 |
+
return ob_get_clean();
|
125 |
+
}
|
126 |
+
|
127 |
+
function textarea_dump( $var ) {
|
128 |
+
return sprintf( '<textarea style="width: 100%; height: 70vh;">%s</textarea>', esc_textarea( dump( $var ) ) );
|
129 |
+
}
|
php/Common/functions-misc.php
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common;
|
3 |
+
|
4 |
+
function first_array_value( array $array ) {
|
5 |
+
reset( $array );
|
6 |
+
$key = key( $array );
|
7 |
+
return $array[ $key ];
|
8 |
+
}
|
9 |
+
|
10 |
+
function prefix_array_keys( $keyprefix, array $array ) {
|
11 |
+
|
12 |
+
foreach ( $array as $key => $value ) {
|
13 |
+
$array[ $keyprefix . $key ] = $value;
|
14 |
+
unset( $array[ $key ] );
|
15 |
+
}
|
16 |
+
|
17 |
+
return $array;
|
18 |
+
}
|
19 |
+
|
20 |
+
function get_url_arg( $url, $arg ) {
|
21 |
+
|
22 |
+
$parsed_url = wp_parse_url( $url );
|
23 |
+
|
24 |
+
if ( ! empty( $parsed_url['query'] ) ) {
|
25 |
+
|
26 |
+
parse_str( $parsed_url['query'], $url_query );
|
27 |
+
|
28 |
+
if ( isset( $url_query[ $arg ] ) ) {
|
29 |
+
return $url_query[ $arg ];
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
return false;
|
34 |
+
}
|
35 |
+
|
36 |
+
function get_var_dump( $var ) {
|
37 |
+
ob_start();
|
38 |
+
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_dump
|
39 |
+
var_dump( $var );
|
40 |
+
return ob_get_clean();
|
41 |
+
};
|
42 |
+
|
43 |
+
function get_constant( $const_name ) {
|
44 |
+
return defined( $const_name ) ? constant( $const_name ) : false;
|
45 |
+
}
|
46 |
+
|
47 |
+
function is_wp_debug() {
|
48 |
+
return get_constant( 'WP_DEBUG' );
|
49 |
+
}
|
50 |
+
|
51 |
+
function get_array_key_by_value( $array, $field, $value ) {
|
52 |
+
|
53 |
+
foreach ( $array as $key => $array_value ) {
|
54 |
+
|
55 |
+
if ( $array_value[ $field ] === $value ) {
|
56 |
+
return $key;
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
return false;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Inserts a new key/value before the key in the array.
|
65 |
+
*
|
66 |
+
* @param $key
|
67 |
+
* The key to insert before.
|
68 |
+
* @param $array
|
69 |
+
* An array to insert in to.
|
70 |
+
* @param $new_key
|
71 |
+
* The key to insert.
|
72 |
+
* @param $new_value
|
73 |
+
* An value to insert.
|
74 |
+
*
|
75 |
+
* @return
|
76 |
+
* The new array if the key exists, FALSE otherwise.
|
77 |
+
*
|
78 |
+
* @see array_insert_after()
|
79 |
+
*/
|
80 |
+
function array_insert_before($key, array &$array, $new_key, $new_value) {
|
81 |
+
if (array_key_exists($key, $array)) {
|
82 |
+
$new = array();
|
83 |
+
foreach ($array as $k => $value) {
|
84 |
+
if ($k === $key) {
|
85 |
+
$new[$new_key] = $new_value;
|
86 |
+
}
|
87 |
+
$new[$k] = $value;
|
88 |
+
}
|
89 |
+
return $new;
|
90 |
+
}
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Inserts a new key/value after the key in the array.
|
96 |
+
*
|
97 |
+
* @param $key
|
98 |
+
* The key to insert after.
|
99 |
+
* @param $array
|
100 |
+
* An array to insert in to.
|
101 |
+
* @param $new_key
|
102 |
+
* The key to insert.
|
103 |
+
* @param $new_value
|
104 |
+
* An value to insert.
|
105 |
+
*
|
106 |
+
* @return
|
107 |
+
* The new array if the key exists, FALSE otherwise.
|
108 |
+
*
|
109 |
+
* @see array_insert_before()
|
110 |
+
*/
|
111 |
+
function array_insert_after($key, array &$array, $new_key, $new_value) {
|
112 |
+
if (array_key_exists($key, $array)) {
|
113 |
+
$new = array();
|
114 |
+
foreach ($array as $k => $value) {
|
115 |
+
$new[$k] = $value;
|
116 |
+
if ($k === $key) {
|
117 |
+
$new[$new_key] = $new_value;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
return $new;
|
121 |
+
}
|
122 |
+
return false;
|
123 |
+
}
|
php/Common/functions-remote-get.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common;
|
3 |
+
|
4 |
+
// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralDomain
|
5 |
+
|
6 |
+
function remote_get_json( $url, array $args = [], $json_name = false ) {
|
7 |
+
|
8 |
+
$response = remote_get_body( $url, $args );
|
9 |
+
|
10 |
+
if ( is_wp_error( $response ) ) {
|
11 |
+
return $response;
|
12 |
+
}
|
13 |
+
|
14 |
+
$response = json_decode( $response );
|
15 |
+
|
16 |
+
if ( null === $response ) {
|
17 |
+
return new \WP_Error(
|
18 |
+
'json-null',
|
19 |
+
sprintf(
|
20 |
+
// Translators: URL.
|
21 |
+
__( 'url: %s json_decode returned null.', 'advanced-responsive-video-embedder' ),
|
22 |
+
esc_url( $url )
|
23 |
+
)
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
if ( $json_name ) {
|
28 |
+
|
29 |
+
if ( empty( $response->$json_name ) ) {
|
30 |
+
return new \WP_Error(
|
31 |
+
'json-value-empty',
|
32 |
+
sprintf(
|
33 |
+
// Translators: 1 URL 2 JSON value
|
34 |
+
__( 'url: %1$s JSON value <code>%2$s</code> does not exist or is empty', 'advanced-responsive-video-embedder' ),
|
35 |
+
esc_url( $url ),
|
36 |
+
esc_html( $json_name )
|
37 |
+
)
|
38 |
+
);
|
39 |
+
} else {
|
40 |
+
return $response->$json_name;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
return $response;
|
45 |
+
}
|
46 |
+
|
47 |
+
function remote_get_body( $url, array $args = [] ) {
|
48 |
+
|
49 |
+
$response = wp_safe_remote_get( $url, $args );
|
50 |
+
$response_code = wp_remote_retrieve_response_code( $response );
|
51 |
+
|
52 |
+
if ( is_wp_error( $response ) ) {
|
53 |
+
return $response;
|
54 |
+
}
|
55 |
+
|
56 |
+
if ( 200 !== $response_code ) {
|
57 |
+
|
58 |
+
return new \WP_Error(
|
59 |
+
$response_code,
|
60 |
+
sprintf(
|
61 |
+
// Translators: 1 URL 2 HTTP presponse code.
|
62 |
+
__( 'url: %1$s Status code 200 expected but was %2$s.', 'advanced-responsive-video-embedder' ),
|
63 |
+
$url,
|
64 |
+
$response_code
|
65 |
+
)
|
66 |
+
);
|
67 |
+
}
|
68 |
+
|
69 |
+
$response = wp_remote_retrieve_body( $response );
|
70 |
+
|
71 |
+
if ( '' === $response ) {
|
72 |
+
return new \WP_Error(
|
73 |
+
'empty-body',
|
74 |
+
sprintf(
|
75 |
+
// Translators: URL.
|
76 |
+
__( 'url: %s Empty Body.', 'advanced-responsive-video-embedder' ),
|
77 |
+
$url
|
78 |
+
)
|
79 |
+
);
|
80 |
+
}
|
81 |
+
|
82 |
+
return $response;
|
83 |
+
};
|
84 |
+
|
85 |
+
function remote_get_body_cached( $url, array $args = [], $time = DAY_IN_SECONDS ) {
|
86 |
+
|
87 |
+
$transient_name = 'nextgenthemes_remote_get_body_' . $url . wp_json_encode( $args );
|
88 |
+
$response = get_transient( $transient_name );
|
89 |
+
|
90 |
+
if ( false === $response ) {
|
91 |
+
$response = remote_get_body( $url, $args );
|
92 |
+
|
93 |
+
set_transient( $transient_name, $response, $time );
|
94 |
+
}
|
95 |
+
|
96 |
+
return $response;
|
97 |
+
}
|
php/Common/functions-settings.php
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common;
|
3 |
+
|
4 |
+
function nextgenthemes_settings_instance() {
|
5 |
+
|
6 |
+
static $inst = null;
|
7 |
+
|
8 |
+
if ( null === $inst ) {
|
9 |
+
|
10 |
+
$inst = new Settings(
|
11 |
+
[
|
12 |
+
'namespace' => 'nextgenthemes',
|
13 |
+
'settings' => nextgenthemes_settings(),
|
14 |
+
'menu_title' => esc_html__( 'NextGenThemes Settings', 'advanced-responsive-video-embedder' ),
|
15 |
+
'settings_page_title' => esc_html__( 'NextGenThemes Settings', 'advanced-responsive-video-embedder' ),
|
16 |
+
]
|
17 |
+
);
|
18 |
+
$inst->set_defined_product_keys();
|
19 |
+
}
|
20 |
+
|
21 |
+
return $inst;
|
22 |
+
}
|
23 |
+
|
24 |
+
function ngt_options() {
|
25 |
+
$o = nextgenthemes_settings_instance()->options;
|
26 |
+
return apply_filters( 'nextgenthemes/settings', $o );
|
27 |
+
}
|
28 |
+
|
29 |
+
function migrate_old_licenses() {
|
30 |
+
|
31 |
+
$products = get_products();
|
32 |
+
foreach ( $products as $p => $value ) {
|
33 |
+
|
34 |
+
$old_key = get_option( "nextgenthemes_{$p}_key" );
|
35 |
+
$old_key_status = get_option( "nextgenthemes_{$p}_key_status" );
|
36 |
+
|
37 |
+
if ( $old_key ) {
|
38 |
+
$options = (array) get_option( 'nextgenthemes' );
|
39 |
+
$options[ $p ] = $old_key;
|
40 |
+
update_option( 'nextgenthemes', $options );
|
41 |
+
delete_option( "nextgenthemes_{$p}_key" );
|
42 |
+
}
|
43 |
+
|
44 |
+
if ( $old_key_status ) {
|
45 |
+
$options = (array) get_option( 'nextgenthemes' );
|
46 |
+
$options[ $p . '_status' ] = $old_key_status;
|
47 |
+
update_option( 'nextgenthemes', $options );
|
48 |
+
delete_option( "nextgenthemes_{$p}_key_status" );
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
function nextgenthemes_settings() {
|
54 |
+
|
55 |
+
$products = get_products();
|
56 |
+
|
57 |
+
foreach ( $products as $p => $value ) {
|
58 |
+
$settings[ $p ] = [
|
59 |
+
'default' => '',
|
60 |
+
'option' => true,
|
61 |
+
'tag' => 'main',
|
62 |
+
// translators: %s is Product name
|
63 |
+
'label' => sprintf( esc_html__( '%s license Key', 'advanced-responsive-video-embedder' ), $value['name'] ),
|
64 |
+
'type' => 'string',
|
65 |
+
'ui' => 'licensekey',
|
66 |
+
];
|
67 |
+
|
68 |
+
$settings[ $p . '_status' ] = [
|
69 |
+
'default' => '',
|
70 |
+
'option' => true,
|
71 |
+
'tag' => 'main',
|
72 |
+
// translators: %s is Product name
|
73 |
+
'label' => sprintf( esc_html__( '%s license Key Status', 'advanced-responsive-video-embedder' ), $value['name'] ),
|
74 |
+
'type' => 'string',
|
75 |
+
'ui' => 'hidden',
|
76 |
+
];
|
77 |
+
}
|
78 |
+
|
79 |
+
foreach ( $products as $key => $value ) {
|
80 |
+
$settings[ $key . '_beta' ] = [
|
81 |
+
'default' => false,
|
82 |
+
'option' => true,
|
83 |
+
'tag' => 'main',
|
84 |
+
// translators: Product name
|
85 |
+
'label' => sprintf( esc_html__( '%s beta updates', 'advanced-responsive-video-embedder' ), $value['name'] ),
|
86 |
+
'type' => 'boolean',
|
87 |
+
];
|
88 |
+
}
|
89 |
+
|
90 |
+
$settings['cdn'] = [
|
91 |
+
'default' => false,
|
92 |
+
'option' => true,
|
93 |
+
'tag' => 'main',
|
94 |
+
'label' => esc_html__( 'Use jsDelivr CDN for some assets', 'advanced-responsive-video-embedder' ),
|
95 |
+
'type' => 'boolean',
|
96 |
+
];
|
97 |
+
|
98 |
+
$settings['action'] = [
|
99 |
+
'default' => '',
|
100 |
+
'option' => true,
|
101 |
+
'tag' => 'main',
|
102 |
+
'label' => esc_html__( 'Action', 'advanced-responsive-video-embedder' ),
|
103 |
+
'type' => 'string',
|
104 |
+
'ui' => 'hidden',
|
105 |
+
];
|
106 |
+
|
107 |
+
return $settings;
|
108 |
+
}
|
109 |
+
|
110 |
+
function get_products() {
|
111 |
+
|
112 |
+
$products = [
|
113 |
+
'arve_pro' => [
|
114 |
+
'namespace' => 'ARVE\Pro',
|
115 |
+
'name' => 'ARVE Pro',
|
116 |
+
'id' => 1253,
|
117 |
+
'type' => 'plugin',
|
118 |
+
'author' => 'Nicolas Jonas',
|
119 |
+
'url' => 'https://nextgenthemes.com/plugins/arve-pro/',
|
120 |
+
],
|
121 |
+
'arve_amp' => [
|
122 |
+
'namespace' => 'ARVE\AMP',
|
123 |
+
'name' => 'ARVE AMP',
|
124 |
+
'id' => 16941,
|
125 |
+
'type' => 'plugin',
|
126 |
+
'author' => 'Nicolas Jonas',
|
127 |
+
'url' => 'https://nextgenthemes.com/plugins/arve-amp/',
|
128 |
+
],
|
129 |
+
'arve_random_video' => [
|
130 |
+
'namespace' => 'ARVE\RandomVideo',
|
131 |
+
'name' => 'ARVE Random Video',
|
132 |
+
'id' => 31933,
|
133 |
+
'type' => 'plugin',
|
134 |
+
'author' => 'Nicolas Jonas',
|
135 |
+
'url' => 'https://nextgenthemes.com/plugins/arve-random-video/',
|
136 |
+
],
|
137 |
+
];
|
138 |
+
|
139 |
+
$products = apply_filters( 'nextgenthemes_products', $products );
|
140 |
+
|
141 |
+
foreach ( $products as $key => $value ) :
|
142 |
+
|
143 |
+
$products[ $key ]['active'] = false;
|
144 |
+
$products[ $key ]['file'] = false;
|
145 |
+
$products[ $key ]['installed'] = false;
|
146 |
+
$products[ $key ]['slug'] = $key;
|
147 |
+
$products[ $key ]['valid_key'] = has_valid_key( $key );
|
148 |
+
|
149 |
+
$version_define = strtoupper( $key ) . '_VERSION';
|
150 |
+
$file_define = strtoupper( $key ) . '_FILE';
|
151 |
+
|
152 |
+
if ( defined( $version_define ) ) {
|
153 |
+
$products[ $key ]['version'] = constant( $version_define );
|
154 |
+
}
|
155 |
+
|
156 |
+
if ( defined( $file_define ) ) {
|
157 |
+
$products[ $key ]['file'] = constant( $file_define );
|
158 |
+
}
|
159 |
+
|
160 |
+
$version = "\\Nextgenthemes\\{$value['namespace']}\\VERSION";
|
161 |
+
$file = "\\Nextgenthemes\\{$value['namespace']}\\PLUGIN_FILE";
|
162 |
+
|
163 |
+
if ( defined( $version ) ) {
|
164 |
+
$products[ $key ]['version'] = constant( $version );
|
165 |
+
}
|
166 |
+
|
167 |
+
if ( defined( $file ) ) {
|
168 |
+
$products[ $key ]['file'] = constant( $file );
|
169 |
+
$products[ $key ]['active'] = true;
|
170 |
+
}
|
171 |
+
endforeach;
|
172 |
+
|
173 |
+
return $products;
|
174 |
+
}
|
php/Common/functions-string.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common;
|
3 |
+
|
4 |
+
function contains_any( $haystack, array $needles ) {
|
5 |
+
|
6 |
+
foreach ( $needles as $needle ) {
|
7 |
+
|
8 |
+
if ( contains( $haystack, $needle ) ) {
|
9 |
+
return true;
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
return false;
|
14 |
+
}
|
15 |
+
|
16 |
+
function contains( $haystack, $needle ) {
|
17 |
+
return false !== strpos( $haystack, $needle );
|
18 |
+
}
|
19 |
+
|
20 |
+
function starts_with( $haystack, $needle ) {
|
21 |
+
return $haystack[0] === $needle[0] ? strncmp( $haystack, $needle, strlen( $needle ) ) === 0 : false;
|
22 |
+
}
|
23 |
+
|
24 |
+
function ends_with( $haystack, $needle ) {
|
25 |
+
// search forward starting from end minus needle length characters
|
26 |
+
if ( '' === $needle ) {
|
27 |
+
return true;
|
28 |
+
}
|
29 |
+
|
30 |
+
$diff = strlen( $haystack ) - strlen( $needle );
|
31 |
+
|
32 |
+
return $diff >= 0 && strpos( $haystack, $needle, $diff ) !== false;
|
33 |
+
}
|
php/Common/init.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE\Common;
|
3 |
+
|
4 |
+
const VERSION = '1.0.0';
|
5 |
+
|
6 |
+
// phpcs:disable WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
7 |
+
require_once __DIR__ . '/Settings.php';
|
8 |
+
require_once __DIR__ . '/functions-settings.php';
|
9 |
+
require_once __DIR__ . '/functions-license.php';
|
10 |
+
require_once __DIR__ . '/functions-misc.php';
|
11 |
+
require_once __DIR__ . '/functions-assets.php';
|
12 |
+
require_once __DIR__ . '/functions-attr.php';
|
13 |
+
require_once __DIR__ . '/functions-string.php';
|
14 |
+
require_once __DIR__ . '/functions-remote-get.php';
|
15 |
+
require_once __DIR__ . '/Admin/EDD/PluginUpdater.php';
|
16 |
+
require_once __DIR__ . '/Admin/EDD/ThemeUpdater.php';
|
17 |
+
require_once __DIR__ . '/Admin/NoticeFactory.php';
|
18 |
+
require_once __DIR__ . '/Admin/functions-licensing.php';
|
19 |
+
require_once __DIR__ . '/Admin/functions-settings.php';
|
20 |
+
require_once __DIR__ . '/Admin/functions-notices.php';
|
21 |
+
// phpcs:enable WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
|
22 |
+
|
23 |
+
if ( ! defined( 'NGT_COMMON_INIT' ) ) {
|
24 |
+
|
25 |
+
migrate_old_licenses();
|
26 |
+
|
27 |
+
add_action( 'init', __NAMESPACE__ . '\nextgenthemes_settings_instance' );
|
28 |
+
add_action( 'admin_init', __NAMESPACE__ . '\Admin\init_edd_updaters', 0 );
|
29 |
+
add_action( 'admin_init', __NAMESPACE__ . '\Admin\activation_notices' );
|
30 |
+
|
31 |
+
define( 'NGT_COMMON_INIT', true );
|
32 |
+
}
|
php/EmbedChecker.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
class EmbedChecker {
|
5 |
+
|
6 |
+
public $shortcode_args = [];
|
7 |
+
|
8 |
+
public function __construct( array $shortcode_args ) {
|
9 |
+
$this->shortcode_args = $shortcode_args;
|
10 |
+
}
|
11 |
+
|
12 |
+
public function check() {
|
13 |
+
|
14 |
+
add_filter( 'nextgenthemes/arve/oembed2args', [ $this, 'oembed2args' ] );
|
15 |
+
$maybe_arve_html = $GLOBALS['wp_embed']->shortcode( $this->shortcode_args, $this->shortcode_args['url'] );
|
16 |
+
remove_filter( 'nextgenthemes/arve/oembed2args', [ $this, 'oembed2args' ] );
|
17 |
+
|
18 |
+
if ( false !== strpos( $maybe_arve_html, 'class="arve' ) ) {
|
19 |
+
return $maybe_arve_html;
|
20 |
+
};
|
21 |
+
|
22 |
+
return false;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function oembed2args( array $shortcode_args ) {
|
26 |
+
$shortcode_args = array_merge( $shortcode_args, $this->shortcode_args );
|
27 |
+
return $shortcode_args;
|
28 |
+
}
|
29 |
+
}
|
php/functions-assets.php
ADDED
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
function register_assets() {
|
5 |
+
|
6 |
+
Common\asset(
|
7 |
+
[
|
8 |
+
'handle' => 'arve-main',
|
9 |
+
'src' => plugins_url( 'build/main.css', PLUGIN_FILE ),
|
10 |
+
'ver' => Common\ver( VERSION, 'build/main.css', PLUGIN_FILE ),
|
11 |
+
'mce' => true,
|
12 |
+
]
|
13 |
+
);
|
14 |
+
|
15 |
+
Common\asset(
|
16 |
+
[
|
17 |
+
'handle' => 'arve-main',
|
18 |
+
'path' => PLUGIN_DIR . '/build/main.js',
|
19 |
+
'src' => plugins_url( 'build/main.js', PLUGIN_FILE ),
|
20 |
+
]
|
21 |
+
);
|
22 |
+
|
23 |
+
// phpcs:disable WordPress.WP.EnqueuedResourceParameters.MissingVersion
|
24 |
+
wp_register_script( 'arve', null, [ 'arve-main' ], null, true );
|
25 |
+
wp_register_style( 'arve', null, [ 'arve-main' ], null, true );
|
26 |
+
// phpcs:enable WordPress.WP.EnqueuedResourceParameters.MissingVersion
|
27 |
+
|
28 |
+
if ( function_exists( 'register_block_type' ) ) :
|
29 |
+
|
30 |
+
$sc_settings = shortcode_settings();
|
31 |
+
$options = options();
|
32 |
+
|
33 |
+
foreach ( $sc_settings as $key => $v ) {
|
34 |
+
|
35 |
+
$attr[ $key ] = [ 'type' => $v['type'] ];
|
36 |
+
|
37 |
+
if ( $options['gutenberg_help'] && ! empty( $v['description'] ) ) {
|
38 |
+
$sc_settings[ $key ]['description'] = wp_strip_all_tags( $v['description'] );
|
39 |
+
} else {
|
40 |
+
unset( $sc_settings[ $key ]['description'] );
|
41 |
+
unset( $sc_settings[ $key ]['descriptionlink'] );
|
42 |
+
unset( $sc_settings[ $key ]['descriptionlinktext'] );
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
$attr['thumbnail'] = [ 'type' => 'string' ];
|
47 |
+
$attr['thumbnail_url'] = [ 'type' => 'string' ];
|
48 |
+
|
49 |
+
Common\asset(
|
50 |
+
[
|
51 |
+
'handle' => 'arve-block',
|
52 |
+
'path' => PLUGIN_DIR . '/build/block.js',
|
53 |
+
'src' => plugins_url( 'build/block.js', PLUGIN_FILE ),
|
54 |
+
'deps' => [ 'arve' ],
|
55 |
+
'footer' => false,
|
56 |
+
]
|
57 |
+
);
|
58 |
+
wp_localize_script( 'arve-block', 'ARVEsettings', $sc_settings );
|
59 |
+
|
60 |
+
// Register our block, and explicitly define the attributes we accept.
|
61 |
+
register_block_type(
|
62 |
+
'nextgenthemes/arve-block',
|
63 |
+
[
|
64 |
+
'attributes' => $attr,
|
65 |
+
'editor_script' => 'arve-block',
|
66 |
+
'editor_style' => 'arve',
|
67 |
+
'render_callback' => __NAMESPACE__ . '\gutenberg_block',
|
68 |
+
]
|
69 |
+
);
|
70 |
+
|
71 |
+
endif;
|
72 |
+
}
|
73 |
+
|
74 |
+
function action_wp_enqueue_scripts() {
|
75 |
+
|
76 |
+
$options = options();
|
77 |
+
|
78 |
+
wp_enqueue_style( 'arve' );
|
79 |
+
|
80 |
+
if ( $options['always_enqueue_assets'] ) {
|
81 |
+
wp_enqueue_script( 'arve' );
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
function gutenberg_block( $args ) {
|
86 |
+
|
87 |
+
if ( empty( $args['url'] ) ) {
|
88 |
+
\ob_start();
|
89 |
+
?>
|
90 |
+
<div class="components-placeholder wp-block-embed">
|
91 |
+
<div class="components-placeholder__label">
|
92 |
+
<span class="editor-block-icon block-editor-block-icon has-colors">
|
93 |
+
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img" aria-hidden="true" focusable="false"><path d="M0,0h24v24H0V0z" fill="none"></path><path d="M19,4H5C3.89,4,3,4.9,3,6v12c0,1.1,0.89,2,2,2h14c1.1,0,2-0.9,2-2V6C21,4.9,20.11,4,19,4z M19,18H5V8h14V18z"></path></svg>
|
94 |
+
</span>ARVE Video Embed
|
95 |
+
</div>
|
96 |
+
<div class="components-placeholder__instructions">Please paste Video URL / iframe Embed Code in the Sidebar for this Block.</div>
|
97 |
+
</div>
|
98 |
+
<?php
|
99 |
+
return \ob_get_clean();
|
100 |
+
}
|
101 |
+
|
102 |
+
foreach ( $args as $key => $value ) {
|
103 |
+
|
104 |
+
if ( is_bool( $value ) ) {
|
105 |
+
$args[ $key ] = $value ? 'true' : 'false';
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
$args['gutenberg'] = 'true';
|
110 |
+
|
111 |
+
if ( isset( $args['align'] ) && in_array( $args['align'], [ 'wide', 'full' ], true ) ) {
|
112 |
+
$args['align'] = null;
|
113 |
+
}
|
114 |
+
|
115 |
+
return shortcode( $args );
|
116 |
+
}
|
117 |
+
|
118 |
+
function maybe_enqueue_assets( $html ) {
|
119 |
+
|
120 |
+
// Doing this because of embed caching the actual functions and filters generating the videos may not be called, if the Block or Shortcode is not used the styles would never get loaded but we micro optimize and load them only when needed this way.
|
121 |
+
if ( Common\contains( $html, 'class="arve' ) ) {
|
122 |
+
wp_enqueue_style( 'arve' );
|
123 |
+
wp_enqueue_script( 'arve' );
|
124 |
+
}
|
125 |
+
|
126 |
+
return $html;
|
127 |
+
}
|
php/functions-deprecated.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php
|
php/functions-host-properties.php
ADDED
@@ -0,0 +1,874 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
function get_host_properties() {
|
5 |
+
|
6 |
+
$properties = [
|
7 |
+
'alugha' => [
|
8 |
+
'name' => 'Alugha',
|
9 |
+
'regex' => '#https?://(www\.)?alugha\.com/(1/)?videos/(?<id>[a-z0-9_\-]+)#i',
|
10 |
+
'oembed' => false,
|
11 |
+
'embed_url' => 'https://alugha.com/embed/web-player/?v=%s',
|
12 |
+
'default_params' => 'nologo=1',
|
13 |
+
'auto_thumbnail' => true,
|
14 |
+
'tests' => [
|
15 |
+
[
|
16 |
+
'url' => 'https://alugha.com/videos/e269333a-579b-11e5-aa10-8587cc892389/share',
|
17 |
+
'id' => 'e269333a-579b-11e5-aa10-8587cc892389',
|
18 |
+
],
|
19 |
+
[
|
20 |
+
'url' => 'https://alugha.com/1/videos/youtube-54m1YfEuYU8',
|
21 |
+
'id' => 'youtube-54m1YfEuYU8',
|
22 |
+
],
|
23 |
+
[
|
24 |
+
'url' => 'https://alugha.com/videos/7cab9cd7-f64a-11e5-939b-c39074d29b86',
|
25 |
+
'id' => '7cab9cd7-f64a-11e5-939b-c39074d29b86',
|
26 |
+
],
|
27 |
+
],
|
28 |
+
],
|
29 |
+
'archiveorg' => [
|
30 |
+
'name' => 'Archive.org',
|
31 |
+
'oembed' => false,
|
32 |
+
'regex' => '#https?://(www\.)?archive\.org/(details|embed)/(?<id>[0-9a-z\-]+)#i',
|
33 |
+
'embed_url' => 'https://www.archive.org/embed/%s/',
|
34 |
+
'default_params' => '',
|
35 |
+
'auto_thumbnail' => false,
|
36 |
+
'tests' => [
|
37 |
+
[
|
38 |
+
'url' => 'https://archive.org/details/arashyekt4_gmail_Cat',
|
39 |
+
'id' => 'arashyekt4',
|
40 |
+
],
|
41 |
+
],
|
42 |
+
],
|
43 |
+
'bitchute' => [
|
44 |
+
'name' => 'Bitchute',
|
45 |
+
'oembed' => false,
|
46 |
+
'regex' => '#https?://www\.bitchute\.com/(video|embed)/(?<id>[0-9a-z\-]+)#i',
|
47 |
+
'embed_url' => 'https://www.bitchute.com/embed/%s/',
|
48 |
+
'rebuild_url' => 'https://www.bitchute.com/video/%s/',
|
49 |
+
'default_params' => '',
|
50 |
+
'auto_thumbnail' => false,
|
51 |
+
'tests' => [
|
52 |
+
[
|
53 |
+
'url' => 'https://www.bitchute.com/video/eCctkmPpK8tq/',
|
54 |
+
'id' => 'eCctkmPpK8tq',
|
55 |
+
],
|
56 |
+
],
|
57 |
+
],
|
58 |
+
'break' => [
|
59 |
+
'name' => 'Break',
|
60 |
+
'regex' => '#https?://(www\.|view\.)break\.com/(video/|embed/)?[-a-z0-9]*?(?<id>[0-9]+)#i',
|
61 |
+
'oembed' => false,
|
62 |
+
'embed_url' => 'http://break.com/embed/%s',
|
63 |
+
'default_params' => 'embed=1',
|
64 |
+
'auto_thumbnail' => false,
|
65 |
+
'tests' => [
|
66 |
+
[
|
67 |
+
'url' => 'https://www.break.com/video/first-person-pov-of-tornado-strike-2542591-test',
|
68 |
+
'id' => 2542591,
|
69 |
+
],
|
70 |
+
[
|
71 |
+
'url' => 'http://view.break.com/2542591-test',
|
72 |
+
'id' => 2542591,
|
73 |
+
],
|
74 |
+
[
|
75 |
+
'url' => 'http://www.break.com/embed/2542591?embed=1',
|
76 |
+
'id' => 2542591,
|
77 |
+
],
|
78 |
+
],
|
79 |
+
],
|
80 |
+
'brightcove' => [
|
81 |
+
'name' => 'Brightcove',
|
82 |
+
'regex' => '#https?://(players|link)\.brightcove\.net/(?<account_id>[0-9]+)/(?<brightcove_player>[a-z0-9]+)_(?<brightcove_embed>[a-z0-9]+)/index\.html\?videoId=(?<id>[0-9]+)#i',
|
83 |
+
'oembed' => false,
|
84 |
+
# 1) account_id
|
85 |
+
# 2) player id
|
86 |
+
# 3) embed_id
|
87 |
+
# 4) id
|
88 |
+
'embed_url' => 'https://players.brightcove.net/%s/%s_%s/index.html?videoId=%s',
|
89 |
+
'requires_src' => true,
|
90 |
+
'tests' => [
|
91 |
+
[
|
92 |
+
'url' => 'https://players.brightcove.net/624246174001/BJXA5Px6f_default/index.html?videoId=5809251338001',
|
93 |
+
'account_id' => 624246174001,
|
94 |
+
'brightcove_player' => 'BJXA5Px6f',
|
95 |
+
'brightcove_embed' => 'default',
|
96 |
+
'id' => 5809251338001,
|
97 |
+
],
|
98 |
+
[
|
99 |
+
'url' => 'http://players.brightcove.net/1160438696001/default_default/index.html?videoId=4587535845001',
|
100 |
+
'account_id' => 1160438696001,
|
101 |
+
'brightcove_player' => 'default',
|
102 |
+
'brightcove_embed' => 'default',
|
103 |
+
'id' => 4587535845001,
|
104 |
+
],
|
105 |
+
[
|
106 |
+
'url' => 'http://players.brightcove.net/5107476400001/B1xUkhW8i_default/index.html?videoId=5371391223001',
|
107 |
+
'account_id' => 5107476400001,
|
108 |
+
'brightcove_player' => 'B1xUkhW8i',
|
109 |
+
'brightcove_embed' => 'default',
|
110 |
+
'id' => 5371391223001,
|
111 |
+
],
|
112 |
+
],
|
113 |
+
],
|
114 |
+
'comedycentral' => [
|
115 |
+
'name' => 'Comedy Central',
|
116 |
+
'regex' => '#https?://media\.mtvnservices\.com/embed/mgid:arc:video:comedycentral\.com:(?<id>[-a-z0-9]{36})#i',
|
117 |
+
'embed_url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:%s',
|
118 |
+
'requires_src' => true,
|
119 |
+
'auto_thumbnail' => false,
|
120 |
+
'tests' => [
|
121 |
+
[
|
122 |
+
'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:c80adf02-3e24-437a-8087-d6b77060571c',
|
123 |
+
'id' => 'c80adf02-3e24-437a-8087-d6b77060571c',
|
124 |
+
],
|
125 |
+
[
|
126 |
+
'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:c3c1da76-96c2-48b4-b38d-8bb16fbf7a58',
|
127 |
+
'id' => 'c3c1da76-96c2-48b4-b38d-8bb16fbf7a58',
|
128 |
+
],
|
129 |
+
],
|
130 |
+
],
|
131 |
+
'dailymotion' => [
|
132 |
+
'name' => 'Dailymotion',
|
133 |
+
'oembed' => true,
|
134 |
+
'regex' => '#https?://(www\.)?(dai\.ly|dailymotion\.com/video)/(?<id>[a-z0-9]+)#i',
|
135 |
+
'embed_url' => 'https://www.dailymotion.com/embed/video/%s',
|
136 |
+
'rebuild_url' => 'https://www.dailymotion.com/video/%s',
|
137 |
+
'default_params' => 'logo=0&hideInfos=1&related=0',
|
138 |
+
'auto_thumbnail' => true,
|
139 |
+
'auto_title' => true,
|
140 |
+
'tests' => [
|
141 |
+
[
|
142 |
+
'url' => 'http://www.dailymotion.com/video/x41ia79_mass-effect-andromeda-gameplay-alpha_videogames',
|
143 |
+
'id' => 'x41ia79',
|
144 |
+
],
|
145 |
+
[
|
146 |
+
'url' => 'http://dai.ly/x3cwlqz',
|
147 |
+
'id' => 'x3cwlqz',
|
148 |
+
],
|
149 |
+
],
|
150 |
+
],
|
151 |
+
'dailymotion_playlist' => [
|
152 |
+
'name' => 'Dailymotion Playlist',
|
153 |
+
'regex' => '#https?://(www\.)?dailymotion\.com/playlist/(?<id>[a-z0-9]+)#i',
|
154 |
+
'embed_url' => 'https://www.dailymotion.com/embed/playlist/%s',
|
155 |
+
'auto_thumbnail' => false,
|
156 |
+
'tests' => [
|
157 |
+
[
|
158 |
+
'url' => 'http://www.dailymotion.com/playlist/x3yk8p_PHIL-MDS_nature-et-environnement-2011/1#video=xm3x45',
|
159 |
+
'id' => 'x3yk8p',
|
160 |
+
],
|
161 |
+
],
|
162 |
+
],
|
163 |
+
'dtube' => [
|
164 |
+
'name' => 'DTube',
|
165 |
+
'oembed' => true,
|
166 |
+
'regex' => '%https?://d\.tube(/#!)?/v/(?<id>[^"]+)%i',
|
167 |
+
'embed_url' => 'https://emb.d.tube/#!/%s',
|
168 |
+
'tests' => [
|
169 |
+
[
|
170 |
+
'url' => 'https://d.tube/#!/v/exyle/bgc244pb',
|
171 |
+
'id' => 'exyle/bgc244pb',
|
172 |
+
],
|
173 |
+
],
|
174 |
+
],
|
175 |
+
'facebook' => [
|
176 |
+
'name' => 'Facebook',
|
177 |
+
'oembed' => true,
|
178 |
+
'regex' => '#(?<id>https?://([a-z]+\.)?facebook\.com/[-.a-z0-9]+/videos/[^\s]+)#i',
|
179 |
+
'url_encode_id' => true,
|
180 |
+
'embed_url' => 'https://www.facebook.com/plugins/video.php?href=%s',
|
181 |
+
'auto_thumbnail' => true,
|
182 |
+
'tests' => [
|
183 |
+
[
|
184 |
+
'url' => 'https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/?type=2&theater',
|
185 |
+
'id' => 'https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/',
|
186 |
+
],
|
187 |
+
[
|
188 |
+
'url' => 'https://web.facebook.com/XTvideo/videos/10153906059711871/',
|
189 |
+
'id' => 'https://web.facebook.com/XTvideo/videos/10153906059711871/',
|
190 |
+
],
|
191 |
+
],
|
192 |
+
],
|
193 |
+
'funnyordie' => [
|
194 |
+
'oembed' => true,
|
195 |
+
'name' => 'Funny or Die',
|
196 |
+
'regex' => '#https?://(www\.)?funnyordie\.com/videos/(?<id>[a-z0-9_]+)#i',
|
197 |
+
'embed_url' => 'https://www.funnyordie.com/embed/%s',
|
198 |
+
'rebuild_url' => 'https://www.funnyordie.com/videos/%s',
|
199 |
+
'auto_thumbnail' => true,
|
200 |
+
'auto_title' => true,
|
201 |
+
'aspect_ratio' => '640:400',
|
202 |
+
'tests' => [
|
203 |
+
[
|
204 |
+
'url' => 'http://www.funnyordie.com/videos/76585438d8/sarah-silverman-s-we-are-miracles-hbo-special',
|
205 |
+
'id' => '76585438d8',
|
206 |
+
'oembed_title' => "Sarah Silverman's - We Are Miracles HBO Special",
|
207 |
+
],
|
208 |
+
],
|
209 |
+
],
|
210 |
+
'ign' => [
|
211 |
+
'name' => 'IGN',
|
212 |
+
'regex' => '#(?<id>https?://(www\.)?ign\.com/videos/[0-9]{4}/[0-9]{2}/[0-9]{2}/[0-9a-z\-]+)#i',
|
213 |
+
'embed_url' => 'https://widgets.ign.com/video/embed/content.html?url=%s',
|
214 |
+
'auto_thumbnail' => false,
|
215 |
+
'tests' => [
|
216 |
+
[
|
217 |
+
'url' => 'https://www.ign.com/videos/2012/03/06/mass-effect-3-video-review',
|
218 |
+
'id' => 'https://www.ign.com/videos/2012/03/06/mass-effect-3-video-review',
|
219 |
+
],
|
220 |
+
],
|
221 |
+
],
|
222 |
+
'kickstarter' => [
|
223 |
+
'name' => 'Kickstarter',
|
224 |
+
'oembed' => true,
|
225 |
+
'regex' => '#https?://(www\.)?kickstarter\.com/projects/(?<id>[0-9a-z\-]+/[-0-9a-z\-]+)#i',
|
226 |
+
'embed_url' => 'https://www.kickstarter.com/projects/%s/widget/video.html',
|
227 |
+
'auto_thumbnail' => false,
|
228 |
+
'tests' => [
|
229 |
+
[
|
230 |
+
'url' => 'https://www.kickstarter.com/projects/obsidian/project-eternity?ref=discovery',
|
231 |
+
'id' => 'obsidian/project-eternity',
|
232 |
+
],
|
233 |
+
[
|
234 |
+
'url' => 'https://www.kickstarter.com/projects/trinandtonic/friendship-postcards?ref=category_featured',
|
235 |
+
'id' => 'trinandtonic/friendship-postcards',
|
236 |
+
],
|
237 |
+
],
|
238 |
+
],
|
239 |
+
'liveleak' => [
|
240 |
+
'name' => 'LiveLeak',
|
241 |
+
'regex' => '#https?://(www\.)?liveleak\.com/(view|ll_embed)\?(?<id>(f|i|t)=[0-9a-z\_]+)#i',
|
242 |
+
'embed_url' => 'https://www.liveleak.com/ll_embed?%s',
|
243 |
+
'default_params' => '',
|
244 |
+
'auto_thumbnail' => true,
|
245 |
+
'tests' => [
|
246 |
+
[ # Page/item 'i=' URL
|
247 |
+
'url' => 'http://www.liveleak.com/view?i=703_1385224413',
|
248 |
+
'id' => 'i=703_1385224413',
|
249 |
+
],
|
250 |
+
[ #File f= URL
|
251 |
+
'url' => 'http://www.liveleak.com/view?f=c85bdf5e45b2',
|
252 |
+
'id' => 'f=c85bdf5e45b2',
|
253 |
+
],
|
254 |
+
[ #No clue new t= url
|
255 |
+
'url' => 'https://www.liveleak.com/view?t=uGBX9_1579730411',
|
256 |
+
'id' => 't=uGBX9_1579730411',
|
257 |
+
],
|
258 |
+
],
|
259 |
+
'test_ids' => [
|
260 |
+
'f=c85bdf5e45b2',
|
261 |
+
'c85bdf5e45b2',
|
262 |
+
],
|
263 |
+
],
|
264 |
+
'livestream' => [
|
265 |
+
'name' => 'Livestream.com',
|
266 |
+
'regex' => '#https?://(www\.)?livestream\.com/accounts/(?<id>[0-9]+/events/[0-9]+(/videos/[0-9]+)?)#i',
|
267 |
+
'embed_url' => 'https://livestream.com/accounts/%s/player',
|
268 |
+
'default_params' => 'width=1280&height=720&enableInfoAndActivity=true&defaultDrawer=&mute=false',
|
269 |
+
'auto_thumbnail' => false,
|
270 |
+
'tests' => [
|
271 |
+
[
|
272 |
+
'url' => 'https://livestream.com/accounts/23470201/events/7021166',
|
273 |
+
'id' => '23470201/events/7021166',
|
274 |
+
],
|
275 |
+
[
|
276 |
+
'url' => 'https://livestream.com/accounts/467901/events/2015991/videos/17500857/player?width=640&height=360&enableInfo=true&defaultDrawer=&autoPlay=true&mute=false',
|
277 |
+
'id' => '467901/events/2015991/videos/17500857',
|
278 |
+
],
|
279 |
+
],
|
280 |
+
],
|
281 |
+
'klatv' => [
|
282 |
+
'name' => 'Klagemauer TV',
|
283 |
+
'regex' => '#https?://(www\.)?kla(gemauer)?.tv/(?<id>[0-9]+)#i',
|
284 |
+
'embed_url' => 'https://www.kla.tv/index.php?a=showembed&vidid=%s',
|
285 |
+
'name' => 'kla.tv',
|
286 |
+
'url' => true,
|
287 |
+
'auto_thumbnail' => false,
|
288 |
+
'tests' => [
|
289 |
+
[
|
290 |
+
'url' => 'http://www.klagemauer.tv/9106',
|
291 |
+
'id' => 9106,
|
292 |
+
],
|
293 |
+
[
|
294 |
+
'url' => 'http://www.kla.tv/9122',
|
295 |
+
'id' => 9122,
|
296 |
+
],
|
297 |
+
],
|
298 |
+
],
|
299 |
+
'metacafe' => [
|
300 |
+
'name' => 'Metacafe',
|
301 |
+
'regex' => '#https?://(www\.)?metacafe\.com/(watch|fplayer)/(?<id>[0-9]+)#i',
|
302 |
+
'embed_url' => 'http://www.metacafe.com/embed/%s/',
|
303 |
+
'auto_thumbnail' => false,
|
304 |
+
'tests' => [
|
305 |
+
[
|
306 |
+
'url' => 'http://www.metacafe.com/watch/11433151/magical-handheld-fireballs/',
|
307 |
+
'id' => 11433151,
|
308 |
+
],
|
309 |
+
[
|
310 |
+
'url' => 'http://www.metacafe.com/watch/11322264/everything_wrong_with_robocop_in_7_minutes/',
|
311 |
+
'id' => 11322264,
|
312 |
+
],
|
313 |
+
],
|
314 |
+
],
|
315 |
+
'myspace' => [
|
316 |
+
'name' => 'myspace',
|
317 |
+
'regex' => '#https?://(www\.)?myspace\.com/.+/(?<id>[0-9]+)#i',
|
318 |
+
'embed_url' => 'https://media.myspace.com/play/video/%s',
|
319 |
+
'auto_thumbnail' => false,
|
320 |
+
'tests' => [
|
321 |
+
[
|
322 |
+
'url' => 'https://myspace.com/myspace/video/dark-rooms-the-shadow-that-looms-o-er-my-heart-live-/109471212',
|
323 |
+
'id' => 109471212,
|
324 |
+
],
|
325 |
+
],
|
326 |
+
],
|
327 |
+
'snotr' => [
|
328 |
+
'name' => 'Snotr',
|
329 |
+
'regex' => '#https?://(www\.)?snotr\.com/(video|embed)/(?<id>[0-9]+)#i',
|
330 |
+
'embed_url' => 'https://www.snotr.com/embed/%s',
|
331 |
+
'rebuild_url' => 'https://www.snotr.com/video/%s',
|
332 |
+
'auto_thumbnail' => false,
|
333 |
+
'tests' => [
|
334 |
+
[
|
335 |
+
'url' => 'https://www.snotr.com/video/12314/How_big_a_truck_blind_spot_really_is',
|
336 |
+
'id' => 12314,
|
337 |
+
],
|
338 |
+
],
|
339 |
+
],
|
340 |
+
'spike' => [
|
341 |
+
'name' => 'Spike',
|
342 |
+
'regex' => '#https?://media.mtvnservices.com/embed/mgid:arc:video:spike\.com:(?<id>[a-z0-9\-]{36})#i',
|
343 |
+
'embed_url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:spike.com:%s',
|
344 |
+
'requires_src' => true,
|
345 |
+
'auto_thumbnail' => false,
|
346 |
+
'tests' => [
|
347 |
+
[
|
348 |
+
'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:spike.com:6a219882-c412-46ce-a8c9-32e043396621',
|
349 |
+
'id' => '6a219882-c412-46ce-a8c9-32e043396621',
|
350 |
+
],
|
351 |
+
],
|
352 |
+
],
|
353 |
+
'ted' => [
|
354 |
+
'name' => 'TED Talks',
|
355 |
+
'oembed' => true,
|
356 |
+
'regex' => '#https?://(www\.)?ted\.com/talks/(?<id>[a-z0-9_]+)#i',
|
357 |
+
'embed_url' => 'https://embed.ted.com/talks/%s',
|
358 |
+
'rebuild_url' => 'https://www.ted.com/talks/%s.html',
|
359 |
+
'auto_thumbnail' => true,
|
360 |
+
'auto_title' => true,
|
361 |
+
'tests' => [
|
362 |
+
[
|
363 |
+
'url' => 'https://www.ted.com/talks/sam_harris_can_we_build_ai_without_losing_control_over_it',
|
364 |
+
'id' => 'sam_harris_can_we_build_ai_without_losing_control_over_it',
|
365 |
+
],
|
366 |
+
],
|
367 |
+
],
|
368 |
+
'twitch' => [
|
369 |
+
'name' => 'Twitch',
|
370 |
+
'oembed' => true,
|
371 |
+
'regex' => '#https?://(www\.)?twitch.tv/(?!directory)(?|[a-z0-9_]+/v/(?<id>[0-9]+)|(?<id>[a-z0-9_]+))#i',
|
372 |
+
'embed_url' => 'https://player.twitch.tv/?channel=%s', # if numeric id https://player.twitch.tv/?video=v%s
|
373 |
+
'auto_thumbnail' => true,
|
374 |
+
'tests' => [
|
375 |
+
[
|
376 |
+
'url' => 'https://www.twitch.tv/whiskeyexperts',
|
377 |
+
'id' => 'whiskeyexperts',
|
378 |
+
'api_img_contains' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/whiskyexperts',
|
379 |
+
],
|
380 |
+
[
|
381 |
+
'url' => 'https://www.twitch.tv/imaqtpie',
|
382 |
+
'id' => 'imaqtpie',
|
383 |
+
'api_img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/imaqtpie',
|
384 |
+
],
|
385 |
+
[
|
386 |
+
'url' => 'https://www.twitch.tv/imaqtpie/v/95318019',
|
387 |
+
'id' => 95318019,
|
388 |
+
'api_img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/imaqtpie',
|
389 |
+
],
|
390 |
+
],
|
391 |
+
],
|
392 |
+
'ustream' => [
|
393 |
+
'name' => 'Ustream',
|
394 |
+
'regex' => '#https?://(www\.)?ustream\.tv/(embed/|channel/)?(?<id>[0-9]{8}|recorded/[0-9]{8}(/highlight/[0-9]+)?)#i',
|
395 |
+
'embed_url' => 'http://www.ustream.tv/embed/%s',
|
396 |
+
'default_params' => 'html5ui',
|
397 |
+
'auto_thumbnail' => false,
|
398 |
+
'aspect_ratio' => '480:270',
|
399 |
+
'tests' => [
|
400 |
+
[
|
401 |
+
'url' => 'http://www.ustream.tv/recorded/59999872?utm_campaign=ustre.am&utm_source=ustre.am/:43KHS&utm_medium=social&utm_content=20170405204127',
|
402 |
+
'id' => 'recorded/59999872',
|
403 |
+
],
|
404 |
+
[
|
405 |
+
'url' => 'http://www.ustream.tv/embed/17074538?wmode=transparent&v=3&autoplay=false',
|
406 |
+
'id' => '17074538',
|
407 |
+
],
|
408 |
+
],
|
409 |
+
],
|
410 |
+
'rutube' => [
|
411 |
+
'name' => 'RuTube.ru',
|
412 |
+
'regex' => '#https?://(www\.)?rutube\.ru/play/embed/(?<id>[0-9]+)#i',
|
413 |
+
'embed_url' => 'https://rutube.ru/play/embed/%s',
|
414 |
+
'tests' => [
|
415 |
+
[
|
416 |
+
'url' => 'https://rutube.ru/play/embed/9822149',
|
417 |
+
'id' => '9822149',
|
418 |
+
],
|
419 |
+
],
|
420 |
+
'embed_codes' => [
|
421 |
+
[
|
422 |
+
'url' => 'https://rutube.ru/video/0c24c646267beb3091a52c43a46214b5/',
|
423 |
+
'code' => '<iframe width="720" height="405" src="//rutube.ru/play/embed/9822149" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen></iframe>',
|
424 |
+
],
|
425 |
+
],
|
426 |
+
],
|
427 |
+
'viddler' => [
|
428 |
+
'name' => 'Viddler',
|
429 |
+
'regex' => '#https?://(www\.)?viddler\.com/(embed|v)/(?<id>[a-z0-9]{8})#i',
|
430 |
+
'embed_url' => 'https://www.viddler.com/embed/%s/',
|
431 |
+
'rebuild_url' => 'https://www.viddler.com/v/%s/',
|
432 |
+
'default_params' => 'f=1&player=full&disablebackwardseek=false&disableseek=false&disableforwardseek=false&make_responsive=true&loop=false&nologo=true',
|
433 |
+
'auto_thumbnail' => true,
|
434 |
+
'auto_title' => true,
|
435 |
+
'aspect_ratio' => '545:349',
|
436 |
+
'tests' => [
|
437 |
+
[
|
438 |
+
'url' => 'https://www.viddler.com/v/a695c468',
|
439 |
+
'id' => 'a695c468',
|
440 |
+
],
|
441 |
+
],
|
442 |
+
],
|
443 |
+
'vidspot' => [
|
444 |
+
'name' => 'vidspot.net',
|
445 |
+
'regex' => '#https?://(www\.)?vidspot\.net/(embed-)?(?<id>[a-z0-9]+)#i',
|
446 |
+
'embed_url' => 'http://vidspot.net/embed-%s.html',
|
447 |
+
'tests' => [
|
448 |
+
[
|
449 |
+
'url' => 'http://vidspot.net/285wf9uk3rry',
|
450 |
+
'id' => '285wf9uk3rry',
|
451 |
+
],
|
452 |
+
[
|
453 |
+
'url' => 'http://vidspot.net/embed-285wf9uk3rry.html',
|
454 |
+
'id' => '285wf9uk3rry',
|
455 |
+
],
|
456 |
+
],
|
457 |
+
],
|
458 |
+
'vimeo' => [
|
459 |
+
'name' => 'Vimeo',
|
460 |
+
'oembed' => true,
|
461 |
+
'regex' => '#https?://(player\.)?vimeo\.com/((video/)|(channels/[a-z]+/)|(groups/[a-z]+/videos/))?(?<id>[0-9]+)(?<vimeo_secret>/[0-9a-z]+)?#i',
|
462 |
+
'embed_url' => 'https://player.vimeo.com/video/%s',
|
463 |
+
'rebuild_url' => 'https://vimeo.com/%s',
|
464 |
+
'default_params' => 'html5=1&title=1&byline=0&portrait=0',
|
465 |
+
'auto_thumbnail' => true,
|
466 |
+
'auto_title' => true,
|
467 |
+
'tests' => [
|
468 |
+
[
|
469 |
+
'url' => 'https://vimeo.com/124400795',
|
470 |
+
'id' => 124400795,
|
471 |
+
],
|
472 |
+
[
|
473 |
+
'url' => 'https://player.vimeo.com/124400795',
|
474 |
+
'id' => 124400795,
|
475 |
+
],
|
476 |
+
],
|
477 |
+
],
|
478 |
+
'vk' => [
|
479 |
+
'name' => 'VK',
|
480 |
+
'regex' => '#https?://(www\.)?vk\.com/video_ext\.php\?(?<id>[^ ]+)#i',
|
481 |
+
'embed_url' => 'https://vk.com/video_ext.php?%s',
|
482 |
+
'rebuild_url' => 'https://vk.com/video_ext.php?%s',
|
483 |
+
'requires_src' => true,
|
484 |
+
'auto_thumbnail' => false,
|
485 |
+
'tests' => [
|
486 |
+
[
|
487 |
+
'url' => 'https://vk.com/video_ext.php?oid=162756656&id=171388096&hash=b82cc24232fe7f9f&hd=1',
|
488 |
+
'id' => 'oid=162756656&id=171388096&hash=b82cc24232fe7f9f&hd=1',
|
489 |
+
],
|
490 |
+
],
|
491 |
+
'embed_codes' => [
|
492 |
+
[
|
493 |
+
'url' => 'https://vk.com/just_vid?z=video-51189706_456247608%2Fe148d26229c2e82bd9%2Fpl_wall_-51189706',
|
494 |
+
'code' => '<iframe src="https://vk.com/video_ext.php?oid=-51189706&id=456247608&hash=8256b948f3f020fd" width="640" height="360" frameborder="0" allowfullscreen></iframe>',
|
495 |
+
],
|
496 |
+
],
|
497 |
+
],
|
498 |
+
'vzaar' => [
|
499 |
+
'name' => 'vzaar',
|
500 |
+
'regex' => '#https?://(www\.)?vzaar.(com|tv)/(videos/)?(?<id>[0-9]+)#i',
|
501 |
+
'embed_url' => 'https://view.vzaar.com/%s/player',
|
502 |
+
'tests' => [
|
503 |
+
[
|
504 |
+
'url' => 'https://vzaar.com/videos/993324',
|
505 |
+
'id' => 993324,
|
506 |
+
],
|
507 |
+
[
|
508 |
+
'url' => 'https://vzaar.com/videos/1515906',
|
509 |
+
'id' => 1515906,
|
510 |
+
],
|
511 |
+
],
|
512 |
+
],
|
513 |
+
'wistia' => [
|
514 |
+
'name' => 'Wistia',
|
515 |
+
'oembed' => true,
|
516 |
+
'regex' => '#https?://([a-z0-9.-]+)wistia\.(net|com)/(medias|embed/iframe)/(?<id>[a-z0-9]+)#i',
|
517 |
+
'embed_url' => 'https://fast.wistia.net/embed/iframe/%s',
|
518 |
+
'default_params' => '',
|
519 |
+
'tests' => [
|
520 |
+
[
|
521 |
+
'url' => 'https://fast.wistia.net/embed/iframe/g5pnf59ala',
|
522 |
+
'id' => 'g5pnf59ala',
|
523 |
+
],
|
524 |
+
[
|
525 |
+
'url' => 'https://how-2-drive.wistia.com/medias/fi1rqe3kiy',
|
526 |
+
'id' => 'fi1rqe3kiy',
|
527 |
+
],
|
528 |
+
],
|
529 |
+
],
|
530 |
+
'xtube' => [
|
531 |
+
'name' => 'XTube',
|
532 |
+
'oembed' => false,
|
533 |
+
'regex' => '#https?://(www\.)?xtube\.com/watch\.php\?v=(?<id>[a-z0-9_\-]+)#i',
|
534 |
+
'embed_url' => 'http://www.xtube.com/embedded/user/play.php?v=%s',
|
535 |
+
'auto_thumbnail' => false,
|
536 |
+
'tests' => [
|
537 |
+
[
|
538 |
+
'url' => 'http://www.xtube.com/watch.php?v=1234',
|
539 |
+
'id' => 1234,
|
540 |
+
],
|
541 |
+
],
|
542 |
+
],
|
543 |
+
'yahoo' => [
|
544 |
+
'name' => 'Yahoo',
|
545 |
+
'regex' => '#(?<id>https?://([a-z.]+)yahoo\.com/[/-a-z0-9öäü]+\.html)#i',
|
546 |
+
'embed_url' => '%s',
|
547 |
+
'default_params' => 'format=embed',
|
548 |
+
'auto_thumbnail' => true,
|
549 |
+
'auto_title' => true,
|
550 |
+
'tests' => [
|
551 |
+
[
|
552 |
+
'url' => 'https://de.sports.yahoo.com/video/krasse-vorher-nachher-bilder-mann-094957265.html?format=embed&player_autoplay=false',
|
553 |
+
'id' => 'https://de.sports.yahoo.com/video/krasse-vorher-nachher-bilder-mann-094957265.html',
|
554 |
+
],
|
555 |
+
[
|
556 |
+
'url' => 'https://www.yahoo.com/movies/sully-trailer-4-211012511.html?format=embed',
|
557 |
+
'id' => 'https://www.yahoo.com/movies/sully-trailer-4-211012511.html',
|
558 |
+
],
|
559 |
+
],
|
560 |
+
],
|
561 |
+
'youku' => [
|
562 |
+
'name' => 'Youku',
|
563 |
+
'regex' => '#https?://([a-z.]+)?\.youku.com/(embed/|v_show/id_)(?<id>[a-z0-9]+)#i',
|
564 |
+
'oembed' => false,
|
565 |
+
'embed_url' => 'https://player.youku.com/embed/%s',
|
566 |
+
'auto_thumbnail' => false,
|
567 |
+
'aspect_ratio' => '450:292.5',
|
568 |
+
'tests' => [
|
569 |
+
[
|
570 |
+
'url' => 'http://v.youku.com/v_show/id_XMTczMDAxMjIyNA==.html?f=27806190',
|
571 |
+
'id' => 'XMTczMDAxMjIyNA',
|
572 |
+
],
|
573 |
+
[
|
574 |
+
'url' => 'http://player.youku.com/embed/XMTUyODYwOTc4OA==',
|
575 |
+
'id' => 'XMTUyODYwOTc4OA',
|
576 |
+
],
|
577 |
+
],
|
578 |
+
],
|
579 |
+
'youtube' => [
|
580 |
+
'oembed' => true,
|
581 |
+
'name' => 'YouTube',
|
582 |
+
'regex' => '#https?://(www\.)?(youtube\.com\/\S*((\/e(mbed))?\/|watch\?(\S*?&?v\=))|youtu\.be\/)(?<id>[a-zA-Z0-9_-]{6,11})#i',
|
583 |
+
'embed_url' => 'https://www.youtube.com/embed/%s',
|
584 |
+
'rebuild_url' => 'https://www.youtube.com/watch?v=%s',
|
585 |
+
'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=0',
|
586 |
+
'auto_thumbnail' => true,
|
587 |
+
'auto_title' => true,
|
588 |
+
'tests' => [
|
589 |
+
[
|
590 |
+
'url' => 'https://youtu.be/dqLyB5srdGI',
|
591 |
+
'id' => 'dqLyB5srdGI',
|
592 |
+
],
|
593 |
+
[
|
594 |
+
'url' => 'https://www.youtube.com/watch?v=-fEo3kgHFaw',
|
595 |
+
'id' => '-fEo3kgHFaw',
|
596 |
+
],
|
597 |
+
[
|
598 |
+
'url' => 'http://www.youtube.com/watch?v=vrXgLhkv21Y',
|
599 |
+
'id' => 'vrXgLhkv21Y',
|
600 |
+
'oembed_title' => 'TerrorStorm Full length version',
|
601 |
+
],
|
602 |
+
[
|
603 |
+
'url' => 'https://youtu.be/hRonZ4wP8Ys',
|
604 |
+
'id' => 'hRonZ4wP8Ys',
|
605 |
+
'oembed_title' => 'One Bright Dot',
|
606 |
+
],
|
607 |
+
[
|
608 |
+
'url' => 'http://www.youtube.com/watch?v=GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA&index=10', # The index part will be ignored
|
609 |
+
'id' => 'GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA',
|
610 |
+
],
|
611 |
+
[
|
612 |
+
'url' => 'https://youtu.be/b8m9zhNAgKs?list=PLI_7Mg2Z_-4I-W_lI55D9lBUkC66ftHMg',
|
613 |
+
'id' => 'b8m9zhNAgKs?list=PLI_7Mg2Z_-4I-W_lI55D9lBUkC66ftHMg',
|
614 |
+
],
|
615 |
+
],
|
616 |
+
'specific_tests' => [
|
617 |
+
__( 'URL from youtu.be shortener', 'advanced-responsive-video-embedder' ),
|
618 |
+
'http://youtu.be/3Y8B93r2gKg',
|
619 |
+
__( 'Youtube playlist URL inlusive the video to start at. The index part will be ignored and is not needed', 'advanced-responsive-video-embedder' ),
|
620 |
+
'http://www.youtube.com/watch?v=GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA&index=10',
|
621 |
+
__( 'Loop a YouTube video', 'advanced-responsive-video-embedder' ),
|
622 |
+
'[youtube id="FKkejo2dMV4" parameters="playlist=FKkejo2dMV4&loop=1"]',
|
623 |
+
__( 'Enable annotations and related video at the end (disable by default with this plugin)', 'advanced-responsive-video-embedder' ),
|
624 |
+
'[youtube id="uCQXKYPiz6M" parameters="iv_load_policy=1"]',
|
625 |
+
__( 'Testing Youtube Starttimes', 'advanced-responsive-video-embedder' ),
|
626 |
+
'http://youtu.be/vrXgLhkv21Y?t=1h19m14s',
|
627 |
+
'http://youtu.be/vrXgLhkv21Y?t=19m14s',
|
628 |
+
'http://youtu.be/vrXgLhkv21Y?t=1h',
|
629 |
+
'http://youtu.be/vrXgLhkv21Y?t=5m',
|
630 |
+
'http://youtu.be/vrXgLhkv21Y?t=30s',
|
631 |
+
__( 'The Parameter start only takes values in seconds, this will start the video at 1 minute and 1 second', 'advanced-responsive-video-embedder' ),
|
632 |
+
'[youtube id="uCQXKYPiz6M" parameters="start=61"]',
|
633 |
+
],
|
634 |
+
],
|
635 |
+
'youtubelist' => [
|
636 |
+
'oembed' => true,
|
637 |
+
'regex' => '#https?://(www\.)?youtube\.com/(embed/videoseries|playlist)\?list=(?<id>[-_a-z0-9]+)#i',
|
638 |
+
'name' => 'YouTube Playlist',
|
639 |
+
'embed_url' => 'https://www.youtube.com/embed/videoseries?list=%s',
|
640 |
+
'rebuild_url' => 'https://www.youtube.com/watch?list=%s',
|
641 |
+
'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=0',
|
642 |
+
'auto_thumbnail' => true,
|
643 |
+
'tests' => [
|
644 |
+
[
|
645 |
+
'url' => 'https://www.youtube.com/playlist?list=PL3Esg-ZzbiUmeSKBAQ3ej1hQxDSsmnp-7',
|
646 |
+
'id' => 'PL3Esg-ZzbiUmeSKBAQ3ej1hQxDSsmnp-7',
|
647 |
+
],
|
648 |
+
[
|
649 |
+
'url' => 'https://www.youtube.com/embed/videoseries?list=PLMUvgtCRyn-6obmhiDS4n5vYQN3bJRduk',
|
650 |
+
'id' => 'PLMUvgtCRyn-6obmhiDS4n5vYQN3bJRduk',
|
651 |
+
],
|
652 |
+
],
|
653 |
+
],
|
654 |
+
'html5' => [
|
655 |
+
'name' => 'mp4 or webm video files',
|
656 |
+
'aspect_ratio' => false,
|
657 |
+
],
|
658 |
+
'iframe' => [
|
659 |
+
'name' => 'ARVE general iframe embed',
|
660 |
+
'embed_url' => '%s',
|
661 |
+
'default_params' => '',
|
662 |
+
'auto_thumbnail' => false,
|
663 |
+
'tests' => [
|
664 |
+
[
|
665 |
+
'url' => 'https://example.com/',
|
666 |
+
'id' => 'https://example.com/',
|
667 |
+
],
|
668 |
+
],
|
669 |
+
],
|
670 |
+
'googledrive' => [
|
671 |
+
'name' => 'Google Drive',
|
672 |
+
'regex' => '#https?://drive\.google\.com/file/d/(?<id>[^\s/]+)#i',
|
673 |
+
'embed_url' => 'https://drive.google.com/file/d/%s/preview',
|
674 |
+
'tests' => [
|
675 |
+
[
|
676 |
+
'url' => 'https://drive.google.com/file/d/0BymXD1aD6QzJWkh4Q0hPRWlPYkk/edit',
|
677 |
+
'id' => '0BymXD1aD6QzJWkh4Q0hPRWlPYkk',
|
678 |
+
],
|
679 |
+
],
|
680 |
+
],
|
681 |
+
'ooyala' => [
|
682 |
+
'name' => 'ooyala',
|
683 |
+
'requires_src' => true,
|
684 |
+
],
|
685 |
+
'imdb' => [
|
686 |
+
'name' => 'IMDB',
|
687 |
+
'requires_src' => true,
|
688 |
+
],
|
689 |
+
];
|
690 |
+
|
691 |
+
return $properties;
|
692 |
+
}
|
693 |
+
|
694 |
+
function query_args() {
|
695 |
+
|
696 |
+
$hosts = [
|
697 |
+
'dailymotion' => [
|
698 |
+
'query_args' => [
|
699 |
+
'api' => [ 0, 1 ],
|
700 |
+
'autoplay' => [ 0, 1 ],
|
701 |
+
'chromeless' => [ 0, 1 ],
|
702 |
+
'highlight' => [ 0, 1 ],
|
703 |
+
'html' => [ 0, 1 ],
|
704 |
+
'id' => 'int',
|
705 |
+
'info' => [ 0, 1 ],
|
706 |
+
'logo' => [ 0, 1 ],
|
707 |
+
'network' => [ 'dsl', 'cellular' ],
|
708 |
+
'origin' => [ 0, 1 ],
|
709 |
+
'quality' => [ 240, 380, 480, 720, 1080, 1440, 2160 ],
|
710 |
+
'related' => [ 0, 1 ],
|
711 |
+
'start' => 'int',
|
712 |
+
'startscreen' => [ 0, 1 ],
|
713 |
+
'syndication' => 'int',
|
714 |
+
'webkit-playsinline' => [ 0, 1 ],
|
715 |
+
'wmode' => [ 'direct', 'opaque' ],
|
716 |
+
],
|
717 |
+
],
|
718 |
+
'vimeo' => [
|
719 |
+
'query_args' => [
|
720 |
+
'autoplay' => [ 'bool', __( 'Autoplay', 'advanced-responsive-video-embedder' ) ],
|
721 |
+
'badge' => [ 'bool', __( 'Badge', 'advanced-responsive-video-embedder' ) ],
|
722 |
+
'byline' => [ 'bool', __( 'Byline', 'advanced-responsive-video-embedder' ) ],
|
723 |
+
'color' => 'string',
|
724 |
+
'loop' => [ 0, 1 ],
|
725 |
+
'player_id' => 'int',
|
726 |
+
'portrait' => [ 0, 1 ],
|
727 |
+
'title' => [ 0, 1 ],
|
728 |
+
],
|
729 |
+
],
|
730 |
+
'youtube' => [
|
731 |
+
'query_args' => [
|
732 |
+
[
|
733 |
+
'attr' => 'autohide',
|
734 |
+
'type' => 'bool',
|
735 |
+
'name' => __( 'Autohide', 'advanced-responsive-video-embedder' ),
|
736 |
+
],
|
737 |
+
[
|
738 |
+
'attr' => 'autoplay',
|
739 |
+
'type' => 'bool',
|
740 |
+
'name' => __( 'Autoplay', 'advanced-responsive-video-embedder' ),
|
741 |
+
],
|
742 |
+
[
|
743 |
+
'attr' => 'cc_load_policy',
|
744 |
+
'type' => 'bool',
|
745 |
+
'name' => __( 'cc_load_policy', 'advanced-responsive-video-embedder' ),
|
746 |
+
],
|
747 |
+
[
|
748 |
+
'attr' => 'color',
|
749 |
+
'type' => [
|
750 |
+
'' => __( 'Default', 'advanced-responsive-video-embedder' ),
|
751 |
+
'red' => __( 'Red', 'advanced-responsive-video-embedder' ),
|
752 |
+
'white' => __( 'White', 'advanced-responsive-video-embedder' ),
|
753 |
+
],
|
754 |
+
'name' => __( 'Color', 'advanced-responsive-video-embedder' ),
|
755 |
+
],
|
756 |
+
[
|
757 |
+
'attr' => 'controls',
|
758 |
+
'type' => [
|
759 |
+
'' => __( 'Default', 'advanced-responsive-video-embedder' ),
|
760 |
+
0 => __( 'None', 'advanced-responsive-video-embedder' ),
|
761 |
+
1 => __( 'Yes', 'advanced-responsive-video-embedder' ),
|
762 |
+
2 => __( 'Yes load after click', 'advanced-responsive-video-embedder' ),
|
763 |
+
],
|
764 |
+
'name' => __( 'Controls', 'advanced-responsive-video-embedder' ),
|
765 |
+
],
|
766 |
+
[
|
767 |
+
'attr' => 'disablekb',
|
768 |
+
'type' => 'bool',
|
769 |
+
'name' => __( 'disablekb', 'advanced-responsive-video-embedder' ),
|
770 |
+
],
|
771 |
+
[
|
772 |
+
'attr' => 'enablejsapi',
|
773 |
+
'type' => 'bool',
|
774 |
+
'name' => __( 'JavaScript API', 'advanced-responsive-video-embedder' ),
|
775 |
+
],
|
776 |
+
[
|
777 |
+
'attr' => 'end',
|
778 |
+
'type' => 'number',
|
779 |
+
'name' => __( 'End', 'advanced-responsive-video-embedder' ),
|
780 |
+
],
|
781 |
+
[
|
782 |
+
'attr' => 'fs',
|
783 |
+
'type' => 'bool',
|
784 |
+
'name' => __( 'Fullscreen', 'advanced-responsive-video-embedder' ),
|
785 |
+
],
|
786 |
+
[
|
787 |
+
'attr' => 'hl',
|
788 |
+
'type' => 'text',
|
789 |
+
'name' => __( 'Language???', 'advanced-responsive-video-embedder' ),
|
790 |
+
],
|
791 |
+
[
|
792 |
+
'attr' => 'iv_load_policy',
|
793 |
+
'type' => [
|
794 |
+
'' => __( 'Default', 'advanced-responsive-video-embedder' ),
|
795 |
+
1 => __( 'Show annotations', 'advanced-responsive-video-embedder' ),
|
796 |
+
3 => __( 'Do not show annotations', 'advanced-responsive-video-embedder' ),
|
797 |
+
],
|
798 |
+
'name' => __( 'iv_load_policy', 'advanced-responsive-video-embedder' ),
|
799 |
+
],
|
800 |
+
[
|
801 |
+
'attr' => 'list',
|
802 |
+
'type' => 'medium-text',
|
803 |
+
'name' => __( 'Language???', 'advanced-responsive-video-embedder' ),
|
804 |
+
],
|
805 |
+
[
|
806 |
+
'attr' => 'listType',
|
807 |
+
'type' => [
|
808 |
+
'' => __( 'Default', 'advanced-responsive-video-embedder' ),
|
809 |
+
'playlist' => __( 'Playlist', 'advanced-responsive-video-embedder' ),
|
810 |
+
'search' => __( 'Search', 'advanced-responsive-video-embedder' ),
|
811 |
+
'user_uploads' => __( 'User Uploads', 'advanced-responsive-video-embedder' ),
|
812 |
+
],
|
813 |
+
'name' => __( 'List Type', 'advanced-responsive-video-embedder' ),
|
814 |
+
],
|
815 |
+
[
|
816 |
+
'attr' => 'loop',
|
817 |
+
'type' => 'bool',
|
818 |
+
'name' => __( 'Loop', 'advanced-responsive-video-embedder' ),
|
819 |
+
],
|
820 |
+
[
|
821 |
+
'attr' => 'modestbranding',
|
822 |
+
'type' => 'bool',
|
823 |
+
'name' => __( 'Modestbranding', 'advanced-responsive-video-embedder' ),
|
824 |
+
],
|
825 |
+
[
|
826 |
+
'attr' => 'origin',
|
827 |
+
'type' => 'bool',
|
828 |
+
'name' => __( 'Origin', 'advanced-responsive-video-embedder' ),
|
829 |
+
],
|
830 |
+
[
|
831 |
+
'attr' => 'playerapiid',
|
832 |
+
'type' => 'bool',
|
833 |
+
'name' => __( 'playerapiid', 'advanced-responsive-video-embedder' ),
|
834 |
+
],
|
835 |
+
[
|
836 |
+
'attr' => 'playlist',
|
837 |
+
'type' => 'bool',
|
838 |
+
'name' => __( 'Playlist', 'advanced-responsive-video-embedder' ),
|
839 |
+
],
|
840 |
+
[
|
841 |
+
'attr' => 'playsinline',
|
842 |
+
'type' => 'bool',
|
843 |
+
'name' => __( 'playsinline', 'advanced-responsive-video-embedder' ),
|
844 |
+
],
|
845 |
+
[
|
846 |
+
'attr' => 'rel',
|
847 |
+
'type' => 'bool',
|
848 |
+
'name' => __( 'Related Videos at End', 'advanced-responsive-video-embedder' ),
|
849 |
+
],
|
850 |
+
[
|
851 |
+
'attr' => 'showinfo',
|
852 |
+
'type' => 'bool',
|
853 |
+
'name' => __( 'Show Info', 'advanced-responsive-video-embedder' ),
|
854 |
+
],
|
855 |
+
[
|
856 |
+
'attr' => 'start',
|
857 |
+
'type' => 'number',
|
858 |
+
'name' => __( 'Start', 'advanced-responsive-video-embedder' ),
|
859 |
+
],
|
860 |
+
[
|
861 |
+
'attr' => 'theme',
|
862 |
+
'type' => [
|
863 |
+
'' => __( 'Default', 'advanced-responsive-video-embedder' ),
|
864 |
+
'dark' => __( 'Dark', 'advanced-responsive-video-embedder' ),
|
865 |
+
'light' => __( 'Light', 'advanced-responsive-video-embedder' ),
|
866 |
+
],
|
867 |
+
'name' => __( 'Theme', 'advanced-responsive-video-embedder' ),
|
868 |
+
],
|
869 |
+
],
|
870 |
+
],
|
871 |
+
];
|
872 |
+
|
873 |
+
return $hosts;
|
874 |
+
}
|
php/functions-html-output.php
ADDED
@@ -0,0 +1,381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
function build_html( array $a ) {
|
5 |
+
|
6 |
+
$options = options();
|
7 |
+
|
8 |
+
return build_tag(
|
9 |
+
[
|
10 |
+
'name' => 'arve',
|
11 |
+
'tag' => 'div',
|
12 |
+
'inner_html' => arve_embed( arve_embed_inner_html( $a ), $a ) . promote_link( $a['arve_link'] ),
|
13 |
+
'attr' => [
|
14 |
+
'class' => $a['align'] ? 'arve align' . $a['align'] : 'arve',
|
15 |
+
'data-mode' => $a['mode'],
|
16 |
+
'data-provider' => $a['provider'],
|
17 |
+
'id' => $a['uid'],
|
18 |
+
'style' => $a['maxwidth'] ? sprintf( 'max-width:%dpx;', $a['maxwidth'] ) : false,
|
19 |
+
|
20 |
+
// Schema.org
|
21 |
+
'itemscope' => $options['seo_data'] ? '' : false,
|
22 |
+
'itemtype' => $options['seo_data'] ? 'http://schema.org/VideoObject' : false,
|
23 |
+
],
|
24 |
+
],
|
25 |
+
$a
|
26 |
+
);
|
27 |
+
}
|
28 |
+
|
29 |
+
function build_iframe_tag( array $a ) {
|
30 |
+
|
31 |
+
$allow = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture';
|
32 |
+
$class = 'arve-iframe fitvidsignore';
|
33 |
+
$sandbox = 'allow-scripts allow-same-origin allow-presentation allow-popups allow-popups-to-escape-sandbox';
|
34 |
+
|
35 |
+
if ( 'vimeo' === $a['provider'] ) {
|
36 |
+
$sandbox .= ' allow-forms';
|
37 |
+
}
|
38 |
+
|
39 |
+
if ( ! $a['sandbox'] ) {
|
40 |
+
$sandbox = false;
|
41 |
+
}
|
42 |
+
|
43 |
+
if ( 'wistia' === $a['provider'] ) {
|
44 |
+
$class .= ' wistia_embed';
|
45 |
+
}
|
46 |
+
|
47 |
+
if ( 'zoom' === $a['provider'] ) {
|
48 |
+
$allow .= '; microphone; camera';
|
49 |
+
$sandbox .= ' allow-forms';
|
50 |
+
}
|
51 |
+
|
52 |
+
return build_tag(
|
53 |
+
[
|
54 |
+
'name' => 'iframe',
|
55 |
+
'tag' => 'iframe',
|
56 |
+
'inner_html' => '',
|
57 |
+
'attr' => [
|
58 |
+
'allow' => $allow,
|
59 |
+
'allowfullscreen' => '',
|
60 |
+
'class' => $class,
|
61 |
+
'data-arve' => $a['uid'],
|
62 |
+
'data-src-no-ap' => iframe_src_autoplay_args( $a['src'], false, $a ),
|
63 |
+
'frameborder' => '0',
|
64 |
+
'height' => $a['height'],
|
65 |
+
'name' => $a['iframe_name'],
|
66 |
+
'sandbox' => $sandbox,
|
67 |
+
'scrolling' => 'no',
|
68 |
+
'src' => $a['src'],
|
69 |
+
'width' => $a['width'],
|
70 |
+
],
|
71 |
+
],
|
72 |
+
$a
|
73 |
+
);
|
74 |
+
}
|
75 |
+
|
76 |
+
function build_video_tag( array $a ) {
|
77 |
+
|
78 |
+
$autoplay = in_array( $a['mode'], [ 'lazyload', 'lightbox', 'link-lightbox' ], true ) ? false : $a['autoplay'];
|
79 |
+
|
80 |
+
return build_tag(
|
81 |
+
[
|
82 |
+
'name' => 'video',
|
83 |
+
'tag' => 'video',
|
84 |
+
'inner_html' => $a['video_sources_html'] . build_tracks_html( $a ),
|
85 |
+
'attr' => [
|
86 |
+
// WPmaster
|
87 |
+
'autoplay' => $autoplay,
|
88 |
+
'controls' => $a['controls'],
|
89 |
+
'controlslist' => $a['controlslist'],
|
90 |
+
'loop' => $a['loop'],
|
91 |
+
'preload' => 'metadata',
|
92 |
+
'width' => is_feed() ? $a['width'] : false,
|
93 |
+
'poster' => empty( $a['img_src'] ) ? false : $a['img_src'],
|
94 |
+
// ARVE only
|
95 |
+
'data-arve' => $a['uid'],
|
96 |
+
'class' => 'arve-video fitvidsignore',
|
97 |
+
'muted' => $autoplay ? 'muted by ARVE because autoplay is on' : $a['muted'],
|
98 |
+
'playsinline' => in_array( $a['mode'], [ 'lightbox', 'link-lightbox' ], true ) ? '' : false,
|
99 |
+
'webkit-playsinline' => in_array( $a['mode'], [ 'lightbox', 'link-lightbox' ], true ) ? '' : false,
|
100 |
+
],
|
101 |
+
],
|
102 |
+
$a
|
103 |
+
);
|
104 |
+
}
|
105 |
+
|
106 |
+
function build_tracks_html( array $a ) {
|
107 |
+
|
108 |
+
$tracks_html = '';
|
109 |
+
|
110 |
+
for ( $n = 1; $n <= NUM_TRACKS; $n++ ) {
|
111 |
+
|
112 |
+
if ( empty( $a[ "track_{$n}" ] ) ) {
|
113 |
+
return '';
|
114 |
+
}
|
115 |
+
|
116 |
+
preg_match(
|
117 |
+
'#-(?<type>captions|chapters|descriptions|metadata|subtitles)-(?<lang>[a-z]{2}).vtt$#i',
|
118 |
+
$a[ "track_{$n}" ],
|
119 |
+
$matches
|
120 |
+
);
|
121 |
+
|
122 |
+
$label = empty( $a[ "track_{$n}_label" ] ) ?
|
123 |
+
get_language_name_from_code( $matches['lang'] ) :
|
124 |
+
$a[ "track_{$n}_label" ];
|
125 |
+
|
126 |
+
$attr = [
|
127 |
+
'default' => ( 1 === $n ) ? true : false,
|
128 |
+
'kind' => $matches['type'],
|
129 |
+
'label' => $label,
|
130 |
+
'src' => $a[ "track_{$n}" ],
|
131 |
+
'srclang' => $matches['lang'],
|
132 |
+
];
|
133 |
+
|
134 |
+
$tracks_html .= sprintf( '<track%s>', Common\attr( $attr ) );
|
135 |
+
}//end for
|
136 |
+
|
137 |
+
return $tracks_html;
|
138 |
+
}
|
139 |
+
|
140 |
+
function html_id( $html_attr ) {
|
141 |
+
|
142 |
+
if ( false === strpos( $html_attr, 'id=' ) ) {
|
143 |
+
$html_attr .= ' id="html"';
|
144 |
+
}
|
145 |
+
|
146 |
+
return $html_attr;
|
147 |
+
}
|
148 |
+
|
149 |
+
function get_debug_info( $input_html, array $a, array $input_atts ) {
|
150 |
+
|
151 |
+
$html = '';
|
152 |
+
|
153 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
154 |
+
if ( isset( $_GET['arve-debug-options'] ) ) {
|
155 |
+
static $show_options_debug = true;
|
156 |
+
|
157 |
+
if ( $show_options_debug ) {
|
158 |
+
$html .= sprintf( 'Options: <pre>%s</pre>', get_var_dump( options() ) );
|
159 |
+
}
|
160 |
+
|
161 |
+
$show_options_debug = false;
|
162 |
+
}
|
163 |
+
|
164 |
+
$pre_style = ''
|
165 |
+
. 'background-color: #111;'
|
166 |
+
. 'color: #eee;'
|
167 |
+
. 'font-size: 15px;'
|
168 |
+
. 'white-space: pre-wrap;'
|
169 |
+
. 'word-wrap: break-word;';
|
170 |
+
|
171 |
+
if ( ! empty( $_GET['arve-debug-attr'] ) ) {
|
172 |
+
$debug_attr = sanitize_text_field( wp_unslash( $_GET['arve-debug-attr'] ) );
|
173 |
+
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r
|
174 |
+
$input_attr = isset( $input_atts[ $debug_attr ] ) ? print_r( $input_atts[ $debug_attr ], true ) : 'not set';
|
175 |
+
$html .= sprintf(
|
176 |
+
'<pre style="%1$s">in %2$s: %3$s%2$s: %4$s</pre>',
|
177 |
+
esc_attr( $pre_style ),
|
178 |
+
esc_html( $debug_attr ),
|
179 |
+
esc_html( $input_attr ) . PHP_EOL,
|
180 |
+
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r
|
181 |
+
esc_html( print_r( $a[ $debug_attr ], true ) )
|
182 |
+
);
|
183 |
+
}
|
184 |
+
|
185 |
+
if ( isset( $_GET['arve-debug-atts'] ) ) {
|
186 |
+
$html .= sprintf( '<pre style="%s">in: %s</pre>', esc_attr( $pre_style ), get_var_dump( array_filter( $input_atts ) ) );
|
187 |
+
$html .= sprintf( '<pre style="%s">$a: %s</pre>', esc_attr( $pre_style ), get_var_dump( array_filter( $a ) ) );
|
188 |
+
}
|
189 |
+
|
190 |
+
if ( isset( $_GET['arve-debug-html'] ) ) {
|
191 |
+
$html .= sprintf( '<pre style="%s">%s</pre>', esc_attr( $pre_style ), esc_html( $input_html ) );
|
192 |
+
}
|
193 |
+
// phpcs:enable WordPress.Security.NonceVerification.Recommended
|
194 |
+
|
195 |
+
return $html;
|
196 |
+
}
|
197 |
+
|
198 |
+
function arve_embed_inner_html( array $a ) {
|
199 |
+
|
200 |
+
$html = '';
|
201 |
+
$options = options();
|
202 |
+
|
203 |
+
if ( $options['seo_data'] ) :
|
204 |
+
|
205 |
+
$a['first_source'] = empty( $a['sources'] ) ? '' : Common\first_array_value( $a['sources'] );
|
206 |
+
|
207 |
+
$metas = [
|
208 |
+
'first_source' => 'contentURL',
|
209 |
+
'src' => 'embedURL',
|
210 |
+
'upload_date' => 'uploadDate',
|
211 |
+
'author_name' => 'author',
|
212 |
+
'duration' => 'duration',
|
213 |
+
];
|
214 |
+
|
215 |
+
foreach ( $metas as $key => $itemprop ) {
|
216 |
+
|
217 |
+
if ( ! empty( $a[ $key ] ) ) {
|
218 |
+
if ( 'duration' === $key && \is_numeric( $a[ $key ] ) ) {
|
219 |
+
$a[ $key ] = seconds_to_iso8601_duration( $a[ $key ] );
|
220 |
+
}
|
221 |
+
$html .= sprintf( PHP_EOL . '<meta itemprop="%s" content="%s">' . PHP_EOL, esc_attr( $itemprop ), esc_attr( $a[ $key ] ) );
|
222 |
+
}
|
223 |
+
}
|
224 |
+
|
225 |
+
$html .= build_rating_meta( $a );
|
226 |
+
endif;
|
227 |
+
|
228 |
+
if ( 'html5' === $a['provider'] ) {
|
229 |
+
$html .= build_video_tag( $a );
|
230 |
+
} else {
|
231 |
+
$html .= build_iframe_tag( $a );
|
232 |
+
}
|
233 |
+
|
234 |
+
if ( ! empty( $a['img_src'] ) ) {
|
235 |
+
|
236 |
+
$tag = [ 'name' => 'thumbnail' ];
|
237 |
+
|
238 |
+
if ( $options['seo_data'] ) {
|
239 |
+
|
240 |
+
$tag = [
|
241 |
+
'name' => 'thumbnail',
|
242 |
+
'tag' => 'meta',
|
243 |
+
'attr' => [
|
244 |
+
'itemprop' => 'thumbnailUrl',
|
245 |
+
'content' => $a['img_src'],
|
246 |
+
],
|
247 |
+
];
|
248 |
+
}
|
249 |
+
|
250 |
+
$html .= build_tag( $tag, $a );
|
251 |
+
}
|
252 |
+
|
253 |
+
if ( $a['title'] ) {
|
254 |
+
|
255 |
+
$tag = [ 'name' => 'title' ];
|
256 |
+
|
257 |
+
if ( $options['seo_data'] ) {
|
258 |
+
$tag = [
|
259 |
+
'name' => 'title',
|
260 |
+
'tag' => 'meta',
|
261 |
+
'attr' => [
|
262 |
+
'itemprop' => 'name',
|
263 |
+
'content' => trim( $a['title'] ),
|
264 |
+
],
|
265 |
+
];
|
266 |
+
}
|
267 |
+
|
268 |
+
$html .= build_tag( $tag, $a );
|
269 |
+
}
|
270 |
+
|
271 |
+
if ( $a['description'] ) {
|
272 |
+
|
273 |
+
$tag = [ 'name' => 'description' ];
|
274 |
+
|
275 |
+
if ( $options['seo_data'] ) {
|
276 |
+
$tag = [
|
277 |
+
'name' => 'description',
|
278 |
+
'tag' => 'meta',
|
279 |
+
'attr' => [
|
280 |
+
'itemprop' => 'description',
|
281 |
+
'content' => trim( $a['description'] ),
|
282 |
+
],
|
283 |
+
];
|
284 |
+
}
|
285 |
+
|
286 |
+
$html .= build_tag( $tag, $a );
|
287 |
+
}
|
288 |
+
|
289 |
+
$html .= build_tag( [ 'name' => 'button' ], $a );
|
290 |
+
|
291 |
+
return $html;
|
292 |
+
}
|
293 |
+
|
294 |
+
function build_rating_meta( array $a ) {
|
295 |
+
|
296 |
+
if ( empty( $a['rating'] ) ) {
|
297 |
+
return '';
|
298 |
+
}
|
299 |
+
|
300 |
+
$html .= '<span itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">';
|
301 |
+
$html .= sprintf( '<meta itemprop="ratingValue" content="%s">', esc_attr( $a['rating'] ) );
|
302 |
+
|
303 |
+
if ( ! empty( $a['review_count'] ) ) {
|
304 |
+
$html .= sprintf( '<meta itemprop="reviewCount" content="%s">', esc_attr( $a['review_count'] ) );
|
305 |
+
}
|
306 |
+
|
307 |
+
$html .= '</span>';
|
308 |
+
|
309 |
+
return $html;
|
310 |
+
}
|
311 |
+
|
312 |
+
function build_tag( array $tag, array $a ) {
|
313 |
+
|
314 |
+
$tag = apply_filters( "nextgenthemes/arve/{$tag['name']}", $tag, $a );
|
315 |
+
|
316 |
+
if ( empty( $tag['tag'] ) ) {
|
317 |
+
|
318 |
+
$html = '';
|
319 |
+
|
320 |
+
} else {
|
321 |
+
|
322 |
+
if ( ! empty( $tag['inner_html'] )
|
323 |
+
|| ( isset( $tag['inner_html'] ) && '' === $tag['inner_html'] )
|
324 |
+
) {
|
325 |
+
$html = sprintf(
|
326 |
+
PHP_EOL . '<%1$s%2$s>%3$s</%1$s>' . PHP_EOL,
|
327 |
+
esc_html( $tag['tag'] ),
|
328 |
+
Common\attr( $tag['attr'] ),
|
329 |
+
$tag['inner_html']
|
330 |
+
);
|
331 |
+
} else {
|
332 |
+
$html = sprintf(
|
333 |
+
PHP_EOL . '<%s%s>' . PHP_EOL,
|
334 |
+
esc_html( $tag['tag'] ),
|
335 |
+
Common\attr( $tag['attr'] )
|
336 |
+
);
|
337 |
+
}
|
338 |
+
}
|
339 |
+
|
340 |
+
return apply_filters( "nextgenthemes/arve/{$tag['name']}_html", $html, $a );
|
341 |
+
}
|
342 |
+
|
343 |
+
function promote_link( $arve_link ) {
|
344 |
+
|
345 |
+
if ( $arve_link ) {
|
346 |
+
return sprintf(
|
347 |
+
'<a href="%s" title="%s" class="arve-promote-link" target="_blank">%s</a>',
|
348 |
+
esc_url( 'https://nextgenthemes.com/plugins/arve-pro/' ),
|
349 |
+
esc_attr( __( 'Embedded with ARVE Advanced Responsive Video Embedder WordPress plugin', 'advanced-responsive-video-embedder' ) ),
|
350 |
+
esc_html__( 'ARVE', 'advanced-responsive-video-embedder' )
|
351 |
+
);
|
352 |
+
}
|
353 |
+
|
354 |
+
return '';
|
355 |
+
}
|
356 |
+
|
357 |
+
function arve_embed( $html, array $a ) {
|
358 |
+
|
359 |
+
$class = 'arve-embed';
|
360 |
+
$ratio_span = '';
|
361 |
+
|
362 |
+
if ( $a['aspect_ratio'] ) {
|
363 |
+
$class .= ' arve-embed--has-aspect-ratio';
|
364 |
+
}
|
365 |
+
|
366 |
+
if ( '16:9' === $a['aspect_ratio'] ) {
|
367 |
+
$class .= ' arve-embed--16by9';
|
368 |
+
} elseif ( $a['aspect_ratio'] ) {
|
369 |
+
$ratio_span = sprintf( '<span class="arve-ar" style="padding-top:%F%%"></span>', aspect_ratio_to_percentage( $a['aspect_ratio'] ) );
|
370 |
+
}
|
371 |
+
|
372 |
+
return build_tag(
|
373 |
+
[
|
374 |
+
'name' => 'embed',
|
375 |
+
'tag' => 'span', // so we output it within <p>
|
376 |
+
'inner_html' => $ratio_span . $html,
|
377 |
+
'attr' => [ 'class' => $class ],
|
378 |
+
],
|
379 |
+
$a
|
380 |
+
);
|
381 |
+
}
|
php/functions-misc.php
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
function aspect_ratio_gcd( $aspect_ratio ) {
|
5 |
+
|
6 |
+
list( $width, $height ) = explode( ':', $aspect_ratio );
|
7 |
+
$gcd = gcd( $width, $height );
|
8 |
+
|
9 |
+
$aspect_ratio = $width / $gcd . ':' . $height / $gcd;
|
10 |
+
|
11 |
+
return $aspect_ratio;
|
12 |
+
}
|
13 |
+
|
14 |
+
function gcd( $a, $b ) {
|
15 |
+
return $b ? gcd( $b, $a % $b ) : $a;
|
16 |
+
}
|
17 |
+
|
18 |
+
function load_textdomain() {
|
19 |
+
|
20 |
+
\load_plugin_textdomain(
|
21 |
+
'advanced-responsive-video-embedder',
|
22 |
+
false,
|
23 |
+
dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
function check_filetype( $url, $ext ) {
|
28 |
+
|
29 |
+
$check = wp_check_filetype( $url, wp_get_mime_types() );
|
30 |
+
|
31 |
+
if ( strtolower( $check['ext'] ) === $ext ) {
|
32 |
+
return $check['type'];
|
33 |
+
} else {
|
34 |
+
return false;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Calculates seconds based on youtube times
|
40 |
+
*
|
41 |
+
* @param string $yttime The '1h25m13s' part of youtube URLs.
|
42 |
+
*
|
43 |
+
* @return int Starttime in seconds.
|
44 |
+
*/
|
45 |
+
function youtube_time_to_seconds( $yttime ) {
|
46 |
+
|
47 |
+
$matches['h'] = 0;
|
48 |
+
$matches['m'] = 0;
|
49 |
+
$matches['s'] = 0;
|
50 |
+
|
51 |
+
$pattern = '/' .
|
52 |
+
'(?<h>[0-9]+h)?' .
|
53 |
+
'(?<m>[0-9]+m)?' .
|
54 |
+
'(?<s>[0-9]+s)?/';
|
55 |
+
|
56 |
+
preg_match( $pattern, $yttime, $matches );
|
57 |
+
|
58 |
+
return ( (int) $matches['h'] * 60 * 60 ) +
|
59 |
+
( (int) $matches['m'] * 60 ) +
|
60 |
+
(int) $matches['s'];
|
61 |
+
}
|
62 |
+
|
63 |
+
function new_height( $old_width, $old_height, $new_width ) {
|
64 |
+
|
65 |
+
$aspect_num = $old_width / $old_height;
|
66 |
+
$new_height = $new_width / $aspect_num;
|
67 |
+
|
68 |
+
return $new_height;
|
69 |
+
}
|
70 |
+
|
71 |
+
function new_height_from_aspect_ratio( $new_width, $aspect_ratio ) {
|
72 |
+
|
73 |
+
list( $old_width, $old_height ) = explode( ':', $aspect_ratio );
|
74 |
+
|
75 |
+
return new_height( $old_width, $old_height, $new_width );
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Calculates padding percentage value for a particular aspect ratio
|
80 |
+
*
|
81 |
+
* @param string $aspect_ratio example '4:3'
|
82 |
+
*
|
83 |
+
* @since 4.2.0
|
84 |
+
*
|
85 |
+
* @return float
|
86 |
+
*/
|
87 |
+
function aspect_ratio_to_percentage( $aspect_ratio ) {
|
88 |
+
|
89 |
+
list( $width, $height ) = explode( ':', $aspect_ratio );
|
90 |
+
$percentage = ( $height / $width ) * 100;
|
91 |
+
|
92 |
+
return $percentage;
|
93 |
+
}
|
94 |
+
|
95 |
+
function disabled_on_feeds() {
|
96 |
+
return is_feed() && ! options()['feed'] ? true : false;
|
97 |
+
}
|
98 |
+
|
99 |
+
function seconds_to_iso8601_duration( $time ) {
|
100 |
+
$units = array(
|
101 |
+
'Y' => 365*24*3600,
|
102 |
+
'D' => 24*3600,
|
103 |
+
'H' => 3600,
|
104 |
+
'M' => 60,
|
105 |
+
'S' => 1,
|
106 |
+
);
|
107 |
+
|
108 |
+
$str = 'P';
|
109 |
+
$istime = false;
|
110 |
+
|
111 |
+
foreach ( $units as $unitName => &$unit ) {
|
112 |
+
$quot = intval($time / $unit);
|
113 |
+
$time -= $quot * $unit;
|
114 |
+
$unit = $quot;
|
115 |
+
if ( $unit > 0 ) {
|
116 |
+
if ( ! $istime && in_array($unitName, array('H', 'M', 'S'))) { // There may be a better way to do this
|
117 |
+
$str .= 'T';
|
118 |
+
$istime = true;
|
119 |
+
}
|
120 |
+
$str .= strval($unit) . $unitName;
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
return $str;
|
125 |
+
}
|
php/functions-oembed.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
7 |
+
*/
|
8 |
+
function add_oembed_providers() {
|
9 |
+
wp_oembed_add_provider( 'http://clips.twitch.tv/*', 'https://api.twitch.tv/v5/oembed' );
|
10 |
+
wp_oembed_add_provider( 'https://clips.twitch.tv/*', 'https://api.twitch.tv/v5/oembed' );
|
11 |
+
wp_oembed_add_provider( 'http://www.twitch.tv/*', 'https://api.twitch.tv/v5/oembed' );
|
12 |
+
wp_oembed_add_provider( 'https://www.twitch.tv/*', 'https://api.twitch.tv/v5/oembed' );
|
13 |
+
wp_oembed_add_provider( 'http://twitch.tv/*', 'https://api.twitch.tv/v5/oembed' );
|
14 |
+
wp_oembed_add_provider( 'https://twitch.tv/*', 'https://api.twitch.tv/v5/oembed' );
|
15 |
+
wp_oembed_add_provider( 'https://fast.wistia.com/embed/iframe/*', 'https://fast.wistia.com/oembed.json' );
|
16 |
+
wp_oembed_add_provider( 'https://fast.wistia.com/embed/playlists/*', 'https://fast.wistia.com/oembed.json' );
|
17 |
+
wp_oembed_add_provider( 'https://*.wistia.com/medias/*', 'https://fast.wistia.com/oembed.json' );
|
18 |
+
wp_oembed_add_provider( 'https://d.tube/v/*', 'https://api.d.tube/oembed' );
|
19 |
+
}
|
20 |
+
|
21 |
+
function filter_oembed_dataparse( $result, $data, $url ) {
|
22 |
+
|
23 |
+
$a = oembed2args( $data, $url );
|
24 |
+
|
25 |
+
if ( $a ) {
|
26 |
+
return build_video( $a );
|
27 |
+
}
|
28 |
+
|
29 |
+
return $result;
|
30 |
+
}
|
31 |
+
|
32 |
+
function oembed2args( $data, $url ) {
|
33 |
+
|
34 |
+
if ( false === $data || 'video' !== $data->type || disabled_on_feeds() ) {
|
35 |
+
return false;
|
36 |
+
}
|
37 |
+
|
38 |
+
$provider = strtolower( $data->provider_name );
|
39 |
+
$provider = str_replace( 'wistia, inc.', 'wistia', $provider );
|
40 |
+
|
41 |
+
if ( 'facebook' === $provider ) {
|
42 |
+
preg_match( '/class="fb-video" data-href="([^"]+)"/', $data->html, $matches );
|
43 |
+
} else {
|
44 |
+
preg_match( '/<iframe [^>]*src="([^"]+)"/', $data->html, $matches );
|
45 |
+
}
|
46 |
+
|
47 |
+
if ( empty( $matches[1] ) ) {
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
|
51 |
+
if ( 'facebook' === $provider ) {
|
52 |
+
$src = 'https://www.facebook.com/plugins/video.php?href=' . rawurlencode( $matches[1] );
|
53 |
+
} else {
|
54 |
+
$src = $matches[1];
|
55 |
+
}
|
56 |
+
|
57 |
+
$a = [
|
58 |
+
'oembed_data' => $data,
|
59 |
+
'provider' => $provider,
|
60 |
+
'src' => $src,
|
61 |
+
'url' => $url,
|
62 |
+
];
|
63 |
+
|
64 |
+
return apply_filters( 'nextgenthemes/arve/oembed2args', $a );
|
65 |
+
}
|
66 |
+
|
67 |
+
// needed for private videos
|
68 |
+
function vimeo_referer( $args, $url ) {
|
69 |
+
|
70 |
+
if ( Common\contains( $url, 'vimeo' ) ) {
|
71 |
+
$args['headers']['Referer'] = site_url();
|
72 |
+
}
|
73 |
+
|
74 |
+
return $args;
|
75 |
+
}
|
76 |
+
|
77 |
+
function trigger_cache_rebuild( $ttl, $url, $attr, $post_id ) {
|
78 |
+
|
79 |
+
if ( ! did_action( 'nextgenthemes/arve/oembed_recache' ) ) {
|
80 |
+
// Get the time when oEmbed HTML was last cached (based on the WP_Embed class)
|
81 |
+
$key_suffix = md5( $url . serialize( $attr ) ); // phpcs:ignore
|
82 |
+
$cachekey_time = '_oembed_time_' . $key_suffix;
|
83 |
+
$cache_time = get_post_meta( $post_id, $cachekey_time, true );
|
84 |
+
|
85 |
+
// Get the cached HTML
|
86 |
+
$cachekey = '_oembed_' . $key_suffix;
|
87 |
+
$cache_html = strtolower( get_post_meta( $post_id, $cachekey, true ) );
|
88 |
+
|
89 |
+
// time after a recache should be done
|
90 |
+
$trigger_time = get_option( 'nextgenthemes_arve_oembed_recache' );
|
91 |
+
|
92 |
+
// Check if we need to regenerate the oEmbed HTML:
|
93 |
+
if ( $cache_time < $trigger_time &&
|
94 |
+
Common\contains_any( $cache_html, [ 'video', 'tube', 'dailymotion', 'vimeo', 'twitch', 'ted.com', 'wistia' ] ) &&
|
95 |
+
$GLOBALS['wp_embed']->usecache
|
96 |
+
) {
|
97 |
+
// What we need to skip the oembed cache part
|
98 |
+
$GLOBALS['wp_embed']->usecache = false;
|
99 |
+
$ttl = 0;
|
100 |
+
|
101 |
+
do_action( 'nextgenthemes/arve/oembed_recache' );
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
return $ttl;
|
106 |
+
}
|
107 |
+
|
108 |
+
function reenable_oembed_cache( $discover ) {
|
109 |
+
|
110 |
+
if ( did_action( 'nextgenthemes/arve/oembed_recache' ) ) {
|
111 |
+
$GLOBALS['wp_embed']->usecache = true;
|
112 |
+
}
|
113 |
+
|
114 |
+
return $discover;
|
115 |
+
}
|
php/functions-settings.php
ADDED
@@ -0,0 +1,771 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
function setup_settings() {
|
5 |
+
settings_instance();
|
6 |
+
upgrade_options();
|
7 |
+
}
|
8 |
+
|
9 |
+
function options() {
|
10 |
+
$i = settings_instance();
|
11 |
+
return $i->get_options();
|
12 |
+
}
|
13 |
+
|
14 |
+
function default_options() {
|
15 |
+
$i = settings_instance();
|
16 |
+
return $i->get_options_defaults();
|
17 |
+
}
|
18 |
+
|
19 |
+
function settings_instance() {
|
20 |
+
|
21 |
+
static $inst = null;
|
22 |
+
|
23 |
+
if ( null === $inst ) {
|
24 |
+
|
25 |
+
$inst = new Common\Settings(
|
26 |
+
[
|
27 |
+
'namespace' => __NAMESPACE__,
|
28 |
+
'settings' => settings(),
|
29 |
+
'menu_parent_slug' => 'options-general.php',
|
30 |
+
'menu_title' => __( 'ARVE', 'advanced-responsive-video-embedder' ),
|
31 |
+
'settings_page_title' => __( 'ARVE Settings', 'advanced-responsive-video-embedder' ),
|
32 |
+
]
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
return $inst;
|
37 |
+
}
|
38 |
+
|
39 |
+
function has_bool_default_options( $array ) {
|
40 |
+
|
41 |
+
return ! array_diff_key(
|
42 |
+
$array,
|
43 |
+
[
|
44 |
+
'' => true,
|
45 |
+
'true' => true,
|
46 |
+
'false' => true,
|
47 |
+
]
|
48 |
+
);
|
49 |
+
}
|
50 |
+
|
51 |
+
function settings() {
|
52 |
+
|
53 |
+
$settings = all_settings();
|
54 |
+
|
55 |
+
foreach ( $settings as $k => $v ) {
|
56 |
+
|
57 |
+
if ( ! $v['option'] ) {
|
58 |
+
unset( $settings[ $k ] );
|
59 |
+
}
|
60 |
+
|
61 |
+
if ( 'select' === $v['type'] && has_bool_default_options( $v['options'] ) ) {
|
62 |
+
$settings[ $k ]['type'] = 'boolean';
|
63 |
+
unset( $settings[ $k ]['options'] );
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
return $settings;
|
68 |
+
}
|
69 |
+
|
70 |
+
function shortcode_settings() {
|
71 |
+
|
72 |
+
$settings = all_settings();
|
73 |
+
|
74 |
+
foreach ( $settings as $k => $v ) {
|
75 |
+
|
76 |
+
if ( ! $v['shortcode'] ) {
|
77 |
+
unset( $settings[ $k ] );
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
return $settings;
|
82 |
+
}
|
83 |
+
|
84 |
+
// TODO this is unused
|
85 |
+
function gutenberg_ui_settings( $html5 = false ) {
|
86 |
+
|
87 |
+
$settings = all_settings();
|
88 |
+
|
89 |
+
foreach ( $settings as $k => $v ) {
|
90 |
+
|
91 |
+
if ( $html5 && isset( $v['html5'] ) && ! $v['html5'] ) {
|
92 |
+
unset( $settings[ $k ] );
|
93 |
+
} elseif ( 'html5' === $v['tag'] ) {
|
94 |
+
unset( $settings[ $k ] );
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
return $settings;
|
99 |
+
}
|
100 |
+
|
101 |
+
function bool_shortcode_args() {
|
102 |
+
|
103 |
+
$settings = all_settings();
|
104 |
+
|
105 |
+
foreach ( $settings as $k => $v ) {
|
106 |
+
|
107 |
+
if ( $v['shortcode'] &&
|
108 |
+
(
|
109 |
+
'boolean' === $v['type'] ||
|
110 |
+
( 'select' === $v['type'] && has_bool_default_options( $v['options'] ) )
|
111 |
+
)
|
112 |
+
) {
|
113 |
+
$bool_attr[] = $k;
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
return $bool_attr;
|
118 |
+
}
|
119 |
+
|
120 |
+
function shortcode_pairs() {
|
121 |
+
|
122 |
+
$options = options();
|
123 |
+
$settings = shortcode_settings();
|
124 |
+
|
125 |
+
foreach ( $settings as $k => $v ) :
|
126 |
+
if ( 'select' === $v['type'] && has_bool_default_options( $v['options'] ) ) {
|
127 |
+
$pairs[ $k ] = bool_to_shortcode_string( $options[ $k ] );
|
128 |
+
} elseif ( $v['option'] ) {
|
129 |
+
$pairs[ $k ] = (string) $options[ $k ];
|
130 |
+
} else {
|
131 |
+
$pairs[ $k ] = $v['default'];
|
132 |
+
}
|
133 |
+
endforeach;
|
134 |
+
|
135 |
+
$pairs = array_merge(
|
136 |
+
$pairs,
|
137 |
+
[
|
138 |
+
'errors' => new \WP_Error(),
|
139 |
+
'id' => null,
|
140 |
+
'provider' => null,
|
141 |
+
'url_handler' => null,
|
142 |
+
'legacy_sc' => null,
|
143 |
+
'gutenberg' => null,
|
144 |
+
'src' => null,
|
145 |
+
'img_srcset' => null,
|
146 |
+
'maxwidth' => null, # Overwriting the option value ON PURPOSE here, see sc_filter_maxwidth
|
147 |
+
'av1mp4' => null,
|
148 |
+
'mp4' => null,
|
149 |
+
'm4v' => null,
|
150 |
+
'webm' => null,
|
151 |
+
'ogv' => null,
|
152 |
+
'oembed_data' => null,
|
153 |
+
'account_id' => null,
|
154 |
+
'iframe_name' => null,
|
155 |
+
'brightcove_player' => null,
|
156 |
+
'brightcove_embed' => null,
|
157 |
+
'video_sources_html' => null,
|
158 |
+
]
|
159 |
+
);
|
160 |
+
|
161 |
+
for ( $n = 1; $n <= NUM_TRACKS; $n++ ) {
|
162 |
+
$pairs[ "track_{$n}" ] = null;
|
163 |
+
$pairs[ "track_{$n}_label" ] = null;
|
164 |
+
}
|
165 |
+
|
166 |
+
return apply_filters( 'nextgenthemes/arve/shortcode_pairs', $pairs );
|
167 |
+
}
|
168 |
+
|
169 |
+
function upgrade_options() {
|
170 |
+
|
171 |
+
$options_ver = get_option( 'nextgenthemes_arve_options_ver' );
|
172 |
+
|
173 |
+
if ( \version_compare( $options_ver, '9.0', '>=' ) ) {
|
174 |
+
return;
|
175 |
+
}
|
176 |
+
|
177 |
+
$new_options = options();
|
178 |
+
$old_options = get_option( 'arve_options_main' );
|
179 |
+
$old_params = get_option( 'arve_options_params' );
|
180 |
+
$old_pro_options = get_option( 'arve_options_pro' );
|
181 |
+
|
182 |
+
if ( ! empty( $old_pro_options ) && is_array( $old_pro_options ) ) {
|
183 |
+
$old_options = array_merge( $old_options, $old_pro_options );
|
184 |
+
}
|
185 |
+
|
186 |
+
if ( ! empty( $old_params ) && is_array( $old_params ) ) {
|
187 |
+
|
188 |
+
foreach ( $old_params as $provider => $params ) {
|
189 |
+
$old_options[ 'url_params_' . $provider ] = $params;
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
if ( ! empty( $old_options ) && is_array( $old_options ) ) {
|
194 |
+
|
195 |
+
if ( isset( $old_options['promote_link'] ) ) {
|
196 |
+
$old_options['arve_link'] = $old_options['promote_link'];
|
197 |
+
}
|
198 |
+
|
199 |
+
if ( isset( $old_options['video_maxwidth'] ) ) {
|
200 |
+
$old_options['maxwidth'] = $old_options['video_maxwidth'];
|
201 |
+
}
|
202 |
+
|
203 |
+
$new_options = array_diff_assoc( $old_options, default_options() );
|
204 |
+
update_option( 'nextgenthemes_arve', $new_options );
|
205 |
+
update_option( 'nextgenthemes_arve_options_ver', '9.0' );
|
206 |
+
}
|
207 |
+
}
|
208 |
+
|
209 |
+
function get_supported_modes() {
|
210 |
+
return apply_filters( 'nextgenthemes/arve/modes', [ 'normal' => esc_html__( 'Normal', 'advanced-responsive-video-embedder' ) ] );
|
211 |
+
}
|
212 |
+
|
213 |
+
function all_settings() {
|
214 |
+
|
215 |
+
$properties = get_host_properties();
|
216 |
+
|
217 |
+
foreach ( $properties as $provider => $values ) {
|
218 |
+
|
219 |
+
if ( ! empty( $values['auto_thumbnail'] ) ) {
|
220 |
+
$auto_thumbs[] = $values['name'];
|
221 |
+
}
|
222 |
+
|
223 |
+
if ( ! empty( $values['auto_title'] ) ) {
|
224 |
+
$auto_title[] = $values['name'];
|
225 |
+
}
|
226 |
+
|
227 |
+
if ( ! empty( $values['requires_src'] ) ) {
|
228 |
+
$embed_code_only[] = $values['name'];
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
$auto_thumbs = implode( ', ', $auto_thumbs );
|
233 |
+
$auto_title = implode( ', ', $auto_title );
|
234 |
+
$embed_code_only = implode( ', ', $embed_code_only );
|
235 |
+
$def_bool_options = [
|
236 |
+
'' => __( 'Default (settings page)', 'advanced-responsive-video-embedder' ),
|
237 |
+
'true' => __( 'True', 'advanced-responsive-video-embedder' ),
|
238 |
+
'false' => __( 'False', 'advanced-responsive-video-embedder' ),
|
239 |
+
];
|
240 |
+
|
241 |
+
$provider_list_link = 'https://nextgenthemes.com/plugins/arve-pro/#video-host-support';
|
242 |
+
$pro_addon_link = 'https://nextgenthemes.com/plugins/arve-pro/';
|
243 |
+
|
244 |
+
$settings = [
|
245 |
+
'url' => [
|
246 |
+
'default' => null,
|
247 |
+
'option' => false,
|
248 |
+
'label' => __( 'Video URL / iframe Embed Code', 'advanced-responsive-video-embedder' ),
|
249 |
+
'type' => 'string',
|
250 |
+
'placeholder' => esc_attr__( 'Video URL / iframe Embed Code', 'advanced-responsive-video-embedder' ),
|
251 |
+
'description' => sprintf(
|
252 |
+
// Translators: %1$s Providers
|
253 |
+
__( 'Post the URL of the video here. For %1$s and any <a href="%2$s">unlisted</a> video hosts paste their iframe embed codes.', 'advanced-responsive-video-embedder' ),
|
254 |
+
esc_html( $embed_code_only ),
|
255 |
+
esc_url( $provider_list_link )
|
256 |
+
),
|
257 |
+
'descriptionlink' => esc_url( $provider_list_link ),
|
258 |
+
'descriptionlinktext' => esc_html__( 'unlisted', 'advanced-responsive-video-embedder' ),
|
259 |
+
],
|
260 |
+
'title' => [
|
261 |
+
'default' => null,
|
262 |
+
'option' => false,
|
263 |
+
'label' => __( 'Title', 'advanced-responsive-video-embedder' ),
|
264 |
+
'type' => 'string',
|
265 |
+
'description' => sprintf(
|
266 |
+
// Translators: Provider list
|
267 |
+
__( 'Used for SEO, is visible on top of thumbnails in Lazyload modes, is used as link text in link-lightbox mode. <a href="%1$s">ARVE Pro</a> is able to get them from %2$s automatically.', 'advanced-responsive-video-embedder' ),
|
268 |
+
esc_url( $pro_addon_link ),
|
269 |
+
esc_html( $auto_title )
|
270 |
+
),
|
271 |
+
'descriptionlink' => esc_url( $pro_addon_link ),
|
272 |
+
'descriptionlinktext' => esc_html__( 'ARVE Pro', 'advanced-responsive-video-embedder' ),
|
273 |
+
],
|
274 |
+
'description' => [
|
275 |
+
'default' => null,
|
276 |
+
'option' => false,
|
277 |
+
'label' => __( 'Description', 'advanced-responsive-video-embedder' ),
|
278 |
+
'type' => 'string',
|
279 |
+
'placeholder' => __( 'Used for SEO (needed, ARVE Pro auto fills this)', 'advanced-responsive-video-embedder' ),
|
280 |
+
'description' => sprintf( __( '<a href="%s">ARVE Pro</a> fills this automatically', 'advanced-responsive-video-embedder' ), esc_url( $pro_addon_link ) ), // phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
|
281 |
+
'descriptionlink' => esc_url( $pro_addon_link ),
|
282 |
+
'descriptionlinktext' => esc_html__( 'ARVE Pro', 'advanced-responsive-video-embedder' ),
|
283 |
+
],
|
284 |
+
'upload_date' => [
|
285 |
+
'default' => null,
|
286 |
+
'option' => false,
|
287 |
+
'label' => __( 'Upload Date', 'advanced-responsive-video-embedder' ),
|
288 |
+
'type' => 'string',
|
289 |
+
'placeholder' => __( '2019-09-29 (ARVE Pro fills this with post date)', 'advanced-responsive-video-embedder' ),
|
290 |
+
'description' => sprintf( __( '<a href="%s">ARVE Pro</a> fills this automatically', 'advanced-responsive-video-embedder' ), esc_url( $pro_addon_link ) ), // phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
|
291 |
+
'descriptionlink' => esc_url( $pro_addon_link ),
|
292 |
+
'descriptionlinktext' => esc_html__( 'ARVE Pro', 'advanced-responsive-video-embedder' ),
|
293 |
+
],
|
294 |
+
'mode' => [
|
295 |
+
'tag' => 'pro',
|
296 |
+
'default' => 'normal',
|
297 |
+
'label' => __( 'Mode', 'advanced-responsive-video-embedder' ),
|
298 |
+
'type' => 'select',
|
299 |
+
'options' =>
|
300 |
+
[ '' => __( 'Default (settings page)', 'advanced-responsive-video-embedder' ) ]
|
301 |
+
+ get_supported_modes(),
|
302 |
+
'description' => sprintf(
|
303 |
+
__( 'For Lazyload, Lightbox and Link mode check out <a href="%s">ARVE Pro</a>.', 'advanced-responsive-video-embedder' ), // phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
|
304 |
+
'https://nextgenthemes.com/plugins/arve-pro/'
|
305 |
+
),
|
306 |
+
'descriptionlink' => esc_url( $pro_addon_link ),
|
307 |
+
'descriptionlinktext' => esc_html__( 'ARVE Pro', 'advanced-responsive-video-embedder' ),
|
308 |
+
],
|
309 |
+
'thumbnail_fallback' => [
|
310 |
+
'tag' => 'pro',
|
311 |
+
'default' => '',
|
312 |
+
'ui' => 'image_upload',
|
313 |
+
'shortcode' => false,
|
314 |
+
'label' => __( 'Thumbnail Fallback', 'advanced-responsive-video-embedder' ),
|
315 |
+
'type' => 'string',
|
316 |
+
'placeholder' => __( 'URL or media gallery image ID used for thumbnail', 'advanced-responsive-video-embedder' ),
|
317 |
+
'description' => __( 'URL or media gallery image ID used for thumbnail', 'advanced-responsive-video-embedder' ),
|
318 |
+
],
|
319 |
+
'thumbnail_post_image_fallback' => [
|
320 |
+
'tag' => 'pro',
|
321 |
+
'default' => false,
|
322 |
+
'shortcode' => false,
|
323 |
+
'label' => __( 'Thumbnail Featured Image Fallback', 'advanced-responsive-video-embedder' ),
|
324 |
+
'type' => 'boolean',
|
325 |
+
],
|
326 |
+
'thumbnail' => [
|
327 |
+
'default' => null,
|
328 |
+
'shortcode' => true,
|
329 |
+
'option' => false,
|
330 |
+
'label' => __( 'Thumbnail', 'advanced-responsive-video-embedder' ),
|
331 |
+
'type' => 'attachment',
|
332 |
+
'libraryType' => [ 'image' ],
|
333 |
+
'addButton' => __( 'Select Image', 'advanced-responsive-video-embedder' ),
|
334 |
+
'frameTitle' => __( 'Select Image', 'advanced-responsive-video-embedder' ),
|
335 |
+
'placeholder' => __( 'Media library image ID or image URL', 'advanced-responsive-video-embedder' ),
|
336 |
+
'description' => sprintf(
|
337 |
+
// Translators: 1 Link, 2 Provider list
|
338 |
+
__( 'Media library image ID (Select above in Gutenberg) or image URL for preview image for Lazyload modes, always used for SEO. <a href="%1$s">ARVE Pro</a> is able to get them from %2$s automatically.', 'advanced-responsive-video-embedder' ),
|
339 |
+
esc_url( $pro_addon_link ),
|
340 |
+
esc_html( $auto_thumbs )
|
341 |
+
),
|
342 |
+
'descriptionlink' => esc_url( $pro_addon_link ),
|
343 |
+
'descriptionlinktext' => esc_html__( 'ARVE Pro', 'advanced-responsive-video-embedder' ),
|
344 |
+
],
|
345 |
+
'hide_title' => [
|
346 |
+
'default' => false,
|
347 |
+
'shortcode' => true,
|
348 |
+
'tag' => 'pro',
|
349 |
+
'label' => __( 'Hide Title (Lazyload & Lightbox only)', 'advanced-responsive-video-embedder' ),
|
350 |
+
'type' => 'boolean',
|
351 |
+
'description' => __( 'Usefull when the thumbnail image already displays the video title (Lazyload & Lightbox modes).', 'advanced-responsive-video-embedder' ),
|
352 |
+
],
|
353 |
+
'grow' => [
|
354 |
+
'tag' => 'pro',
|
355 |
+
'default' => true,
|
356 |
+
'type' => 'boolean',
|
357 |
+
'label' => __( 'Expand on play? (Lazyload only)', 'advanced-responsive-video-embedder' ),
|
358 |
+
'description' => __( 'Expands video size after clicking the thumbnail (Lazyload Mode)', 'advanced-responsive-video-embedder' ),
|
359 |
+
],
|
360 |
+
'fullscreen' => [
|
361 |
+
'tag' => 'pro',
|
362 |
+
'default' => 'disabled',
|
363 |
+
'type' => 'select',
|
364 |
+
'label' => __( 'Go Fullscreen on opening Lightbox?', 'advanced-responsive-video-embedder' ),
|
365 |
+
'desc_detail' => __( 'Makes the Browser go fullscreen when opening the Lighbox. Optionally stay in Fullscreen mode even after the Lightbox is closed', 'advanced-responsive-video-embedder' ),
|
366 |
+
'options' => [
|
367 |
+
'' => __( 'Default (settings page)', 'advanced-responsive-video-embedder' ),
|
368 |
+
'enabled-exit' => __( 'Enabled, exit FS on lightbox close', 'advanced-responsive-video-embedder' ),
|
369 |
+
'enabled-stick' => __( 'Enabled, stay FS on lightbox close', 'advanced-responsive-video-embedder' ),
|
370 |
+
'disabled' => __( 'Disabled', 'advanced-responsive-video-embedder' ),
|
371 |
+
],
|
372 |
+
],
|
373 |
+
'play_icon_style' => [
|
374 |
+
'tag' => 'pro',
|
375 |
+
'default' => 'youtube',
|
376 |
+
'label' => __( 'Play Button', 'advanced-responsive-video-embedder' ),
|
377 |
+
'type' => 'select',
|
378 |
+
'options' => [
|
379 |
+
// Translators: 1 %s is play icon style.
|
380 |
+
'' => __( 'Default (settings page)', 'advanced-responsive-video-embedder' ),
|
381 |
+
'youtube' => __( 'Youtube', 'advanced-responsive-video-embedder' ),
|
382 |
+
'youtube-red-diamond' => __( 'Youtube Red Diamond', 'advanced-responsive-video-embedder' ),
|
383 |
+
'circle' => __( 'Circle', 'advanced-responsive-video-embedder' ),
|
384 |
+
'none' => __( 'No play image', 'advanced-responsive-video-embedder' ),
|
385 |
+
'custom' => __( 'Custom (for PHP filter)', 'advanced-responsive-video-embedder' ),
|
386 |
+
],
|
387 |
+
],
|
388 |
+
'hover_effect' => [
|
389 |
+
'tag' => 'pro',
|
390 |
+
'default' => 'zoom',
|
391 |
+
'label' => __( 'Hover Effect (Lazyload/Lightbox only)', 'advanced-responsive-video-embedder' ),
|
392 |
+
'type' => 'select',
|
393 |
+
'options' => [
|
394 |
+
'' => __( 'Default (settings page)', 'advanced-responsive-video-embedder' ),
|
395 |
+
'zoom' => __( 'Zoom Thumbnail', 'advanced-responsive-video-embedder' ),
|
396 |
+
'rectangle' => __( 'Move Rectangle in', 'advanced-responsive-video-embedder' ),
|
397 |
+
'none' => __( 'None', 'advanced-responsive-video-embedder' ),
|
398 |
+
],
|
399 |
+
],
|
400 |
+
'disable_links' => [
|
401 |
+
'tag' => 'pro',
|
402 |
+
'default' => false,
|
403 |
+
'label' => __( 'Disable links', 'advanced-responsive-video-embedder' ),
|
404 |
+
'type' => 'select',
|
405 |
+
'options' => $def_bool_options,
|
406 |
+
'description' => __( 'Prevent embeds to open new popups/tabs from links inside video embeds. Note: breaks functionality like sharing.', 'advanced-responsive-video-embedder' ),
|
407 |
+
],
|
408 |
+
// 'mobile_inview' => [
|
409 |
+
// 'tag' => 'pro',
|
410 |
+
// 'default' => true,
|
411 |
+
// 'shortcode' => false,
|
412 |
+
// 'label' => __( 'Mobile Inview Fallback', 'advanced-responsive-video-embedder' ),
|
413 |
+
// 'type' => 'boolean',
|
414 |
+
// 'description' => __( 'This is not needed/used for YouTube and Vimeo. On mobiles fallback Lazyload mode to Lazyload Inview as workarround for the problem that it otherwise needs two touches to play a lazyloaded video because mobile browsers prevent autoplay. Note that this will prevent users to see your custom thumbnails or titles!', 'advanced-responsive-video-embedder' ),
|
415 |
+
// ],
|
416 |
+
'align' => [
|
417 |
+
'default' => 'none',
|
418 |
+
'shortcode' => true,
|
419 |
+
'label' => __( 'Alignment', 'advanced-responsive-video-embedder' ),
|
420 |
+
'type' => 'select',
|
421 |
+
'options' => [
|
422 |
+
'' => __( 'Default (settings page)', 'advanced-responsive-video-embedder' ),
|
423 |
+
'none' => __( 'None', 'advanced-responsive-video-embedder' ),
|
424 |
+
'left' => __( 'Left', 'advanced-responsive-video-embedder' ),
|
425 |
+
'right' => __( 'Right', 'advanced-responsive-video-embedder' ),
|
426 |
+
'center' => __( 'Center', 'advanced-responsive-video-embedder' ),
|
427 |
+
],
|
428 |
+
],
|
429 |
+
'lightbox_script' => [
|
430 |
+
'tag' => 'pro',
|
431 |
+
'default' => 'bigpicture',
|
432 |
+
'shortcode' => false,
|
433 |
+
'label' => __( 'Lightbox Script', 'advanced-responsive-video-embedder' ),
|
434 |
+
'type' => 'select',
|
435 |
+
'options' => [
|
436 |
+
'bigpicture' => __( 'BigPicture', 'advanced-responsive-video-embedder' ),
|
437 |
+
'lity' => __( 'Lity', 'advanced-responsive-video-embedder' ),
|
438 |
+
],
|
439 |
+
'description' => __( 'Only use Lity if you have issues with Big Picture', 'advanced-responsive-video-embedder' ),
|
440 |
+
],
|
441 |
+
'arve_link' => [
|
442 |
+
'default' => false,
|
443 |
+
'label' => __( 'ARVE Link', 'advanced-responsive-video-embedder' ),
|
444 |
+
'type' => 'select',
|
445 |
+
'options' => $def_bool_options,
|
446 |
+
'description' => __( "Shows a small 'ARVE' link below the videos. Be the most awesome person and help promoting this plugin.", 'advanced-responsive-video-embedder' ),
|
447 |
+
],
|
448 |
+
'duration' => [
|
449 |
+
'default' => null,
|
450 |
+
'option' => false,
|
451 |
+
'label' => __( 'Duration', 'advanced-responsive-video-embedder' ),
|
452 |
+
'type' => 'string',
|
453 |
+
'placeholder' => '1H2M3S',
|
454 |
+
'description' => __( '`1H2M3S` for 1 hour, 2 minutes and 3 seconds. `5M` for 5 minutes.', 'advanced-responsive-video-embedder' ),
|
455 |
+
],
|
456 |
+
'autoplay' => [
|
457 |
+
'default' => false,
|
458 |
+
'shortcode' => true,
|
459 |
+
'label' => __( 'Autoplay', 'advanced-responsive-video-embedder' ),
|
460 |
+
'type' => 'select',
|
461 |
+
'options' => $def_bool_options,
|
462 |
+
'description' => __( 'Do not expect this to work! Browsers (especially mobile) or user settings prevent it, some video hosts do not support it at all. Only used in normal mode. ARVE will mute HTML5 video playback in case to make autoplay work for the broadest audience.', 'advanced-responsive-video-embedder' ),
|
463 |
+
],
|
464 |
+
'maxwidth' => [
|
465 |
+
'default' => 0,
|
466 |
+
'label' => __( 'Maximal Width', 'advanced-responsive-video-embedder' ),
|
467 |
+
'type' => 'integer',
|
468 |
+
'description' => sprintf(
|
469 |
+
// Translators: $content_width value.
|
470 |
+
__( 'In pixels. If set to 0 (default) the $content_width value from your theme is used if present, otherwise the default is %s.', 'advanced-responsive-video-embedder' ),
|
471 |
+
DEFAULT_MAXWIDTH
|
472 |
+
),
|
473 |
+
],
|
474 |
+
'lightbox_maxwidth' => [
|
475 |
+
'tag' => 'pro',
|
476 |
+
'default' => 1174,
|
477 |
+
'label' => __( 'Lightbox Maximal Width', 'advanced-responsive-video-embedder' ),
|
478 |
+
'type' => 'integer',
|
479 |
+
'placeholder' => __( 'Leave empty for default from settings page', 'advanced-responsive-video-embedder' ),
|
480 |
+
'description' => __( 'default 1174', 'advanced-responsive-video-embedder' ),
|
481 |
+
],
|
482 |
+
'align_maxwidth' => [
|
483 |
+
'default' => 400,
|
484 |
+
'shortcode' => false,
|
485 |
+
'label' => __( 'Align Maximal Width', 'advanced-responsive-video-embedder' ),
|
486 |
+
'type' => 'integer',
|
487 |
+
'description' => esc_attr__( 'In px, Needed! Must be 100+ to work.', 'advanced-responsive-video-embedder' ),
|
488 |
+
],
|
489 |
+
'aspect_ratio' => [
|
490 |
+
'default' => null,
|
491 |
+
'option' => false,
|
492 |
+
'label' => __( 'Aspect Ratio', 'advanced-responsive-video-embedder' ),
|
493 |
+
'type' => 'string',
|
494 |
+
'description' => __( 'E.g. 4:3, 21:9. Only needed in rare cases. ARVE is usually smart enough to figure this out on its own.', 'advanced-responsive-video-embedder' ),
|
495 |
+
'placeholder' => __( '4:3, 21:9 ...', 'advanced-responsive-video-embedder' ),
|
496 |
+
],
|
497 |
+
'parameters' => [
|
498 |
+
'default' => null,
|
499 |
+
'html5' => false,
|
500 |
+
'option' => false,
|
501 |
+
'label' => __( 'Parameters', 'advanced-responsive-video-embedder' ),
|
502 |
+
'type' => 'string',
|
503 |
+
'placeholder' => __( 'example=1&foo=bar', 'advanced-responsive-video-embedder' ),
|
504 |
+
'description' => sprintf(
|
505 |
+
__( 'Provider specific player settings on iframe src. See <a href="%s">documentation.</a>', 'advanced-responsive-video-embedder' ), // phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
|
506 |
+
esc_url( 'https://nextgenthemes.com/plugins/arve/documentation/#parematers' )
|
507 |
+
),
|
508 |
+
],
|
509 |
+
'wp_video_override' => [
|
510 |
+
'tag' => 'html5',
|
511 |
+
'default' => true,
|
512 |
+
'shortcode' => false,
|
513 |
+
'label' => __( 'Use ARVE for video files?', 'advanced-responsive-video-embedder' ),
|
514 |
+
'type' => 'boolean',
|
515 |
+
'description' => __( 'Use ARVE to embed HTML5 video files. ARVE uses the browsers players instead of loading the mediaelement player that WP uses.', 'advanced-responsive-video-embedder' ),
|
516 |
+
],
|
517 |
+
'controlslist' => [
|
518 |
+
'tag' => 'html5',
|
519 |
+
'default' => '',
|
520 |
+
'label' => __( 'Chrome HTML5 Player controls', 'advanced-responsive-video-embedder' ),
|
521 |
+
'type' => 'string',
|
522 |
+
'placeholder' => 'nodownload nofullscreen noremoteplayback',
|
523 |
+
'description' => __( 'controlsList attribute on <video> for example use <code>nodownload nofullscreen noremoteplayback</code> to hide the download and the fullscreen button on the chrome HTML5 video player and disable remote playback.', 'advanced-responsive-video-embedder' ),
|
524 |
+
],
|
525 |
+
'controls' => [
|
526 |
+
'tag' => 'html5',
|
527 |
+
'default' => true,
|
528 |
+
'label' => __( 'Show Controls? (Video file only)', 'advanced-responsive-video-embedder' ),
|
529 |
+
'type' => 'select',
|
530 |
+
'options' => $def_bool_options,
|
531 |
+
'description' => __( 'Show controls on HTML5 video.', 'advanced-responsive-video-embedder' ),
|
532 |
+
],
|
533 |
+
'loop' => [
|
534 |
+
'tag' => 'html5',
|
535 |
+
'default' => 'n',
|
536 |
+
'shortcode' => true,
|
537 |
+
'option' => false,
|
538 |
+
'label' => __( 'Loop?', 'advanced-responsive-video-embedder' ),
|
539 |
+
'type' => 'boolean',
|
540 |
+
'description' => __( 'Loop HTML5 video.', 'advanced-responsive-video-embedder' ),
|
541 |
+
],
|
542 |
+
'muted' => [
|
543 |
+
'tag' => 'html5',
|
544 |
+
'default' => 'n',
|
545 |
+
'shortcode' => true,
|
546 |
+
'option' => false,
|
547 |
+
'label' => __( 'Mute?', 'advanced-responsive-video-embedder' ),
|
548 |
+
'type' => 'boolean',
|
549 |
+
'description' => __( 'Mute HTML5 video.', 'advanced-responsive-video-embedder' ),
|
550 |
+
],
|
551 |
+
'volume' => [
|
552 |
+
'tag' => 'pro',
|
553 |
+
'default' => 100,
|
554 |
+
'shortcode' => true,
|
555 |
+
'label' => __( 'Volume?', 'advanced-responsive-video-embedder' ),
|
556 |
+
'placeholder' => '100',
|
557 |
+
'type' => 'integer',
|
558 |
+
'description' => __( 'Works with video files only.', 'advanced-responsive-video-embedder' ),
|
559 |
+
],
|
560 |
+
'always_enqueue_assets' => [
|
561 |
+
'shortcode' => false,
|
562 |
+
'default' => false,
|
563 |
+
'label' => __( 'Always load assets', 'advanced-responsive-video-embedder' ),
|
564 |
+
'type' => 'boolean',
|
565 |
+
'description' => __( 'Default=No ARVE will loads its scripts and styles only when the posts content contains a arve video. In case your content is loaded via AJAX at a later stage this detection will not work or the styles are not loaded for another reason you may have to enable this option', 'advanced-responsive-video-embedder' ),
|
566 |
+
],
|
567 |
+
'youtube_nocookie' => [
|
568 |
+
'default' => true,
|
569 |
+
'shortcode' => false,
|
570 |
+
'label' => __( 'Use youtube-nocookie.com url?', 'advanced-responsive-video-embedder' ),
|
571 |
+
'type' => 'boolean',
|
572 |
+
'description' => __( 'Privacy enhanced mode, will NOT disable cookies but only sets them when a user starts to play a video. There is currently a youtube bug that opens highlighed video boxes with a wrong -nocookie.com url so you need to disble this if you need those.', 'advanced-responsive-video-embedder' ),
|
573 |
+
],
|
574 |
+
'vimeo_api_id' => [
|
575 |
+
'tag' => 'randomvideo',
|
576 |
+
'default' => '',
|
577 |
+
'shortcode' => false,
|
578 |
+
'label' => __( 'Vimeo client identifier', 'advanced-responsive-video-embedder' ),
|
579 |
+
'type' => 'string',
|
580 |
+
'description' => sprintf(
|
581 |
+
// Translators: URL
|
582 |
+
__( 'Needed for <a href="%s">Random Video Addon</a>.', 'advanced-responsive-video-embedder' ),
|
583 |
+
esc_url( 'https://nextgenthemes.com/plugins/arve-random-video/' )
|
584 |
+
),
|
585 |
+
'descriptionlink' => esc_url( 'https://nextgenthemes.com/plugins/arve-random-video/' ),
|
586 |
+
'descriptionlinktext' => esc_html__( 'Random Video Addon', 'advanced-responsive-video-embedder' ),
|
587 |
+
],
|
588 |
+
'vimeo_api_secret' => [
|
589 |
+
'tag' => 'randomvideo',
|
590 |
+
'default' => '',
|
591 |
+
'shortcode' => false,
|
592 |
+
'label' => __( 'Vimeo client secret', 'advanced-responsive-video-embedder' ),
|
593 |
+
'type' => 'string',
|
594 |
+
'description' => sprintf(
|
595 |
+
// Translators: URL
|
596 |
+
__( 'Needed for <a href="%s">Random Video Addon</a>.', 'advanced-responsive-video-embedder' ),
|
597 |
+
esc_url( 'https://nextgenthemes.com/plugins/arve-random-video/' )
|
598 |
+
),
|
599 |
+
'descriptionlink' => esc_url( 'https://nextgenthemes.com/plugins/arve-random-video/' ),
|
600 |
+
'descriptionlinktext' => esc_html__( 'Random Video Addon', 'advanced-responsive-video-embedder' ),
|
601 |
+
],
|
602 |
+
'vimeo_api_token' => [
|
603 |
+
'tag' => 'randomvideo',
|
604 |
+
'default' => '',
|
605 |
+
'shortcode' => false,
|
606 |
+
'label' => __( 'Vimeo API Token', 'advanced-responsive-video-embedder' ),
|
607 |
+
'type' => 'string',
|
608 |
+
'description' => sprintf(
|
609 |
+
// Translators: URL
|
610 |
+
__( 'Needed for <a href="%s">Random Video Addon</a>.', 'advanced-responsive-video-embedder' ),
|
611 |
+
esc_url( 'https://nextgenthemes.com/plugins/arve-random-video/' )
|
612 |
+
),
|
613 |
+
'descriptionlink' => esc_url( 'https://nextgenthemes.com/plugins/arve-random-video/' ),
|
614 |
+
'descriptionlinktext' => esc_html__( 'Random Video Addon', 'advanced-responsive-video-embedder' ),
|
615 |
+
],
|
616 |
+
'random_video_url' => [
|
617 |
+
'tag' => 'randomvideo',
|
618 |
+
'default' => null,
|
619 |
+
'option' => false,
|
620 |
+
'shortcode' => true,
|
621 |
+
'label' => esc_html__( 'Random Video URL', 'advanced-responsive-video-embedder' ),
|
622 |
+
'type' => 'string',
|
623 |
+
'description' => sprintf(
|
624 |
+
// Translators: URL
|
625 |
+
__( 'Vimeo showcase URL <a href="%s">(Random Video Addon)</a>.', 'advanced-responsive-video-embedder' ),
|
626 |
+
esc_url( 'https://nextgenthemes.com/plugins/arve-random-video/' )
|
627 |
+
),
|
628 |
+
'descriptionlink' => esc_url( 'https://nextgenthemes.com/plugins/arve-random-video/' ),
|
629 |
+
'descriptionlinktext' => esc_html__( 'Random Video Addon', 'advanced-responsive-video-embedder' ),
|
630 |
+
],
|
631 |
+
'random_video_urls' => [
|
632 |
+
'tag' => 'randomvideo',
|
633 |
+
'default' => null,
|
634 |
+
'option' => false,
|
635 |
+
'shortcode' => true,
|
636 |
+
'label' => esc_html__( 'Random Video URL', 'advanced-responsive-video-embedder' ),
|
637 |
+
'type' => 'string',
|
638 |
+
'description' => sprintf(
|
639 |
+
// Translators: URL
|
640 |
+
__( 'Video URLs seperated by commas. <a href="%s">(Random Video Addon)</a>.', 'advanced-responsive-video-embedder' ),
|
641 |
+
esc_url( 'https://nextgenthemes.com/plugins/arve-random-video/' )
|
642 |
+
),
|
643 |
+
'descriptionlink' => esc_url( 'https://nextgenthemes.com/plugins/arve-random-video/' ),
|
644 |
+
'descriptionlinktext' => esc_html__( 'Random Video Addon', 'advanced-responsive-video-embedder' ),
|
645 |
+
],
|
646 |
+
'legacy_shortcodes' => [
|
647 |
+
'default' => true,
|
648 |
+
'shortcode' => false,
|
649 |
+
'label' => __( 'Enable lagacy shortcodes', 'advanced-responsive-video-embedder' ),
|
650 |
+
'type' => 'boolean',
|
651 |
+
'description' => __( 'Enable the old and deprected <code>[youtube id="abcde" /]</code> or <code>[vimeo id="abcde" /]</code> ... style shortcodes. Only enable if you have them in your content.', 'advanced-responsive-video-embedder' ),
|
652 |
+
],
|
653 |
+
'sandbox' => [
|
654 |
+
'default' => true,
|
655 |
+
'shortcode' => true,
|
656 |
+
'label' => __( 'Sandbox', 'advanced-responsive-video-embedder' ),
|
657 |
+
'type' => 'boolean',
|
658 |
+
'description' => __( "Only disable if you have to. If you embed encrypted media you have to disable this. 'Disable Links' feature from ARVE Pro will not work when without sandbox.", 'advanced-responsive-video-embedder' ),
|
659 |
+
],
|
660 |
+
'seo_data' => [
|
661 |
+
'tag' => 'main',
|
662 |
+
'default' => true,
|
663 |
+
'shortcode' => false,
|
664 |
+
'label' => __( 'Enable structured data (schema.org)', 'advanced-responsive-video-embedder' ),
|
665 |
+
'type' => 'boolean',
|
666 |
+
'description' => __( 'Disable if you use Yoast Video SEO or another plugin that generates the data already.', 'advanced-responsive-video-embedder' ),
|
667 |
+
],
|
668 |
+
'gutenberg_help' => [
|
669 |
+
'default' => true,
|
670 |
+
'shortcode' => false,
|
671 |
+
'label' => __( 'Enable help text in the Block sidebar?', 'advanced-responsive-video-embedder' ),
|
672 |
+
'type' => 'boolean',
|
673 |
+
'description' => __( 'Makes the interface much cleaner.', 'advanced-responsive-video-embedder' ),
|
674 |
+
],
|
675 |
+
'feed' => [
|
676 |
+
'default' => true,
|
677 |
+
'shortcode' => false,
|
678 |
+
'option' => true,
|
679 |
+
'label' => __( 'Use in RSS/Atom Feeds?', 'advanced-responsive-video-embedder' ),
|
680 |
+
'type' => 'boolean',
|
681 |
+
'description' => __( 'Enable the plugin in RSS/Atom feeds? Disabling will not completely diable everything but it will use native WP behavior in feeds where possible.', 'advanced-responsive-video-embedder' ),
|
682 |
+
],
|
683 |
+
/*
|
684 |
+
'videojs_theme' => [
|
685 |
+
'tag' => 'videojs',
|
686 |
+
'default' => 'default',
|
687 |
+
'shortcode' => false,
|
688 |
+
'label' => __( 'Video.js Theme', 'advanced-responsive-video-embedder' ),
|
689 |
+
'type' => 'select',
|
690 |
+
'options' => [
|
691 |
+
'default' => __( 'Default', 'advanced-responsive-video-embedder' ),
|
692 |
+
'netfoutube' => __( 'Netfoutube', 'advanced-responsive-video-embedder' ),
|
693 |
+
'city' => __( 'City', 'advanced-responsive-video-embedder' ),
|
694 |
+
'forest' => __( 'Forest', 'advanced-responsive-video-embedder' ),
|
695 |
+
'fantasy' => __( 'Fantasy', 'advanced-responsive-video-embedder' ),
|
696 |
+
'sea' => __( 'Sea', 'advanced-responsive-video-embedder' ),
|
697 |
+
],
|
698 |
+
],
|
699 |
+
'videojs_youtube' => [
|
700 |
+
'tag' => 'videojs',
|
701 |
+
'default' => false,
|
702 |
+
'shortcode' => false,
|
703 |
+
'label' => __( 'Use Video.js for YouTube', 'advanced-responsive-video-embedder' ),
|
704 |
+
'type' => 'boolean',
|
705 |
+
],
|
706 |
+
*/
|
707 |
+
'admin_bar_menu' => [
|
708 |
+
'default' => false,
|
709 |
+
'shortcode' => false,
|
710 |
+
'option' => true,
|
711 |
+
'label' => __( 'Admin bar ARVE button', 'advanced-responsive-video-embedder' ),
|
712 |
+
'type' => 'boolean',
|
713 |
+
'description' => __( 'For quickly accessing the ARVE settings page.', 'advanced-responsive-video-embedder' ),
|
714 |
+
],
|
715 |
+
];
|
716 |
+
|
717 |
+
$settings = apply_filters( 'nextgenthemes/arve/settings', $settings );
|
718 |
+
|
719 |
+
foreach ( $properties as $provider => $v ) {
|
720 |
+
|
721 |
+
if ( isset( $v['default_params'] ) ) {
|
722 |
+
|
723 |
+
$settings[ 'url_params_' . $provider ] = [
|
724 |
+
'tag' => 'urlparams',
|
725 |
+
'default' => $v['default_params'],
|
726 |
+
'option' => true,
|
727 |
+
'shortcode' => false,
|
728 |
+
// Translators: %s is Provider
|
729 |
+
'label' => sprintf( __( '%s url parameters', 'advanced-responsive-video-embedder' ), $provider ),
|
730 |
+
'type' => 'string',
|
731 |
+
];
|
732 |
+
}
|
733 |
+
}
|
734 |
+
|
735 |
+
$settings = missing_settings_defaults( $settings );
|
736 |
+
|
737 |
+
return $settings;
|
738 |
+
}
|
739 |
+
|
740 |
+
function missing_settings_defaults( $settings ) {
|
741 |
+
|
742 |
+
foreach ( $settings as $key => $value ) :
|
743 |
+
|
744 |
+
if ( ! isset( $value['shortcode'] ) ) {
|
745 |
+
$settings[ $key ]['shortcode'] = true;
|
746 |
+
}
|
747 |
+
if ( ! isset( $value['option'] ) ) {
|
748 |
+
$settings[ $key ]['option'] = true;
|
749 |
+
}
|
750 |
+
|
751 |
+
if ( empty( $settings[ $key ]['tag'] ) ) {
|
752 |
+
$settings[ $key ]['tag'] = 'main';
|
753 |
+
}
|
754 |
+
|
755 |
+
if ( empty( $settings[ $key ]['sanitze_callback'] ) ) {
|
756 |
+
|
757 |
+
switch ( $value['type'] ) {
|
758 |
+
case 'integer':
|
759 |
+
$settings[ $key ]['sanitze_callback'] = 'absint';
|
760 |
+
break;
|
761 |
+
|
762 |
+
case 'string':
|
763 |
+
default:
|
764 |
+
$settings[ $key ]['sanitze_callback'] = 'sanitize_text_field';
|
765 |
+
break;
|
766 |
+
}
|
767 |
+
}
|
768 |
+
endforeach;
|
769 |
+
|
770 |
+
return $settings;
|
771 |
+
}
|
php/functions-shortcode-data.php
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
function url_query_array( $url ) {
|
5 |
+
|
6 |
+
$url = wp_parse_url( $url );
|
7 |
+
|
8 |
+
if ( empty( $url['query'] ) ) {
|
9 |
+
return [];
|
10 |
+
}
|
11 |
+
|
12 |
+
parse_str( $url['query'], $url_params );
|
13 |
+
|
14 |
+
return $url_params;
|
15 |
+
}
|
16 |
+
|
17 |
+
// phpcs:ignore
|
18 |
+
function get_language_name_from_code( $lang_code ) {
|
19 |
+
// This list is based on languages available from localize.drupal.org. See
|
20 |
+
// http://localize.drupal.org/issues for information on how to add languages
|
21 |
+
// there.
|
22 |
+
//
|
23 |
+
// The "Left-to-right marker" comments and the enclosed UTF-8 markers are to
|
24 |
+
// make otherwise strange looking PHP syntax natural (to not be displayed in
|
25 |
+
// right to left). See https://www.drupal.org/node/128866#comment-528929.
|
26 |
+
$lang = [
|
27 |
+
'af' => [ 'Afrikaans', 'Afrikaans' ],
|
28 |
+
'am' => [ 'Amharic', 'አማርኛ' ],
|
29 |
+
'ar' => [ 'Arabic', /* Left-to-right marker "" */ 'العربية', 'RTL' ],
|
30 |
+
'ast' => [ 'Asturian', 'Asturianu' ],
|
31 |
+
'az' => [ 'Azerbaijani', 'Azərbaycanca' ],
|
32 |
+
'be' => [ 'Belarusian', 'Беларуская' ],
|
33 |
+
'bg' => [ 'Bulgarian', 'Български' ],
|
34 |
+
'bn' => [ 'Bengali', 'বাংলা' ],
|
35 |
+
'bo' => [ 'Tibetan', 'བོད་སྐད་' ],
|
36 |
+
'bs' => [ 'Bosnian', 'Bosanski' ],
|
37 |
+
'ca' => [ 'Catalan', 'Català' ],
|
38 |
+
'cs' => [ 'Czech', 'Čeština' ],
|
39 |
+
'cy' => [ 'Welsh', 'Cymraeg' ],
|
40 |
+
'da' => [ 'Danish', 'Dansk' ],
|
41 |
+
'de' => [ 'German', 'Deutsch' ],
|
42 |
+
'dz' => [ 'Dzongkha', 'རྫོང་ཁ' ],
|
43 |
+
'el' => [ 'Greek', 'Ελληνικά' ],
|
44 |
+
'en' => [ 'English', 'English' ],
|
45 |
+
'en-x-simple' => [ 'Simple English', 'Simple English' ],
|
46 |
+
'eo' => [ 'Esperanto', 'Esperanto' ],
|
47 |
+
'es' => [ 'Spanish', 'Español' ],
|
48 |
+
'et' => [ 'Estonian', 'Eesti' ],
|
49 |
+
'eu' => [ 'Basque', 'Euskera' ],
|
50 |
+
'fa' => [ 'Persian, Farsi', /* Left-to-right marker "" */ 'فارسی', 'RTL' ],
|
51 |
+
'fi' => [ 'Finnish', 'Suomi' ],
|
52 |
+
'fil' => [ 'Filipino', 'Filipino' ],
|
53 |
+
'fo' => [ 'Faeroese', 'Føroyskt' ],
|
54 |
+
'fr' => [ 'French', 'Français' ],
|
55 |
+
'fy' => [ 'Frisian, Western', 'Frysk' ],
|
56 |
+
'ga' => [ 'Irish', 'Gaeilge' ],
|
57 |
+
'gd' => [ 'Scots Gaelic', 'Gàidhlig' ],
|
58 |
+
'gl' => [ 'Galician', 'Galego' ],
|
59 |
+
'gsw-berne' => [ 'Swiss German', 'Schwyzerdütsch' ],
|
60 |
+
'gu' => [ 'Gujarati', 'ગુજરાતી' ],
|
61 |
+
'he' => [ 'Hebrew', /* Left-to-right marker "" */ 'עברית', 'RTL' ],
|
62 |
+
'hi' => [ 'Hindi', 'हिन्दी' ],
|
63 |
+
'hr' => [ 'Croatian', 'Hrvatski' ],
|
64 |
+
'ht' => [ 'Haitian Creole', 'Kreyòl ayisyen' ],
|
65 |
+
'hu' => [ 'Hungarian', 'Magyar' ],
|
66 |
+
'hy' => [ 'Armenian', 'Հայերեն' ],
|
67 |
+
'id' => [ 'Indonesian', 'Bahasa Indonesia' ],
|
68 |
+
'is' => [ 'Icelandic', 'Íslenska' ],
|
69 |
+
'it' => [ 'Italian', 'Italiano' ],
|
70 |
+
'ja' => [ 'Japanese', '日本語' ],
|
71 |
+
'jv' => [ 'Javanese', 'Basa Java' ],
|
72 |
+
'ka' => [ 'Georgian', 'ქართული ენა' ],
|
73 |
+
'kk' => [ 'Kazakh', 'Қазақ' ],
|
74 |
+
'km' => [ 'Khmer', 'ភាសាខ្មែរ' ],
|
75 |
+
'kn' => [ 'Kannada', 'ಕನ್ನಡ' ],
|
76 |
+
'ko' => [ 'Korean', '한국어' ],
|
77 |
+
'ku' => [ 'Kurdish', 'Kurdî' ],
|
78 |
+
'ky' => [ 'Kyrgyz', 'Кыргызча' ],
|
79 |
+
'lo' => [ 'Lao', 'ພາສາລາວ' ],
|
80 |
+
'lt' => [ 'Lithuanian', 'Lietuvių' ],
|
81 |
+
'lv' => [ 'Latvian', 'Latviešu' ],
|
82 |
+
'mg' => [ 'Malagasy', 'Malagasy' ],
|
83 |
+
'mk' => [ 'Macedonian', 'Македонски' ],
|
84 |
+
'ml' => [ 'Malayalam', 'മലയാളം' ],
|
85 |
+
'mn' => [ 'Mongolian', 'монгол' ],
|
86 |
+
'mr' => [ 'Marathi', 'मराठी' ],
|
87 |
+
'ms' => [ 'Bahasa Malaysia', 'بهاس ملايو' ],
|
88 |
+
'my' => [ 'Burmese', 'ဗမာစကား' ],
|
89 |
+
'ne' => [ 'Nepali', 'नेपाली' ],
|
90 |
+
'nl' => [ 'Dutch', 'Nederlands' ],
|
91 |
+
'nb' => [ 'Norwegian Bokmål', 'Norsk, bokmål' ],
|
92 |
+
'nn' => [ 'Norwegian Nynorsk', 'Norsk, nynorsk' ],
|
93 |
+
'oc' => [ 'Occitan', 'Occitan' ],
|
94 |
+
'pa' => [ 'Punjabi', 'ਪੰਜਾਬੀ' ],
|
95 |
+
'pl' => [ 'Polish', 'Polski' ],
|
96 |
+
'pt-pt' => [ 'Portuguese, Portugal', 'Português, Portugal' ],
|
97 |
+
'pt-br' => [ 'Portuguese, Brazil', 'Português, Brasil' ],
|
98 |
+
'ro' => [ 'Romanian', 'Română' ],
|
99 |
+
'ru' => [ 'Russian', 'Русский' ],
|
100 |
+
'sco' => [ 'Scots', 'Scots' ],
|
101 |
+
'se' => [ 'Northern Sami', 'Sámi' ],
|
102 |
+
'si' => [ 'Sinhala', 'සිංහල' ],
|
103 |
+
'sk' => [ 'Slovak', 'Slovenčina' ],
|
104 |
+
'sl' => [ 'Slovenian', 'Slovenščina' ],
|
105 |
+
'sq' => [ 'Albanian', 'Shqip' ],
|
106 |
+
'sr' => [ 'Serbian', 'Српски' ],
|
107 |
+
'sv' => [ 'Swedish', 'Svenska' ],
|
108 |
+
'sw' => [ 'Swahili', 'Kiswahili' ],
|
109 |
+
'ta' => [ 'Tamil', 'தமிழ்' ],
|
110 |
+
'ta-lk' => [ 'Tamil, Sri Lanka', 'தமிழ், இலங்கை' ],
|
111 |
+
'te' => [ 'Telugu', 'తెలుగు' ],
|
112 |
+
'th' => [ 'Thai', 'ภาษาไทย' ],
|
113 |
+
'tr' => [ 'Turkish', 'Türkçe' ],
|
114 |
+
'tyv' => [ 'Tuvan', 'Тыва дыл' ],
|
115 |
+
'ug' => [ 'Uyghur', 'Уйғур' ],
|
116 |
+
'uk' => [ 'Ukrainian', 'Українська' ],
|
117 |
+
'ur' => [ 'Urdu', /* Left-to-right marker "" */ 'اردو', 'RTL' ],
|
118 |
+
'vi' => [ 'Vietnamese', 'Tiếng Việt' ],
|
119 |
+
'xx-lolspeak' => [ 'Lolspeak', 'Lolspeak' ],
|
120 |
+
'zh-hans' => [ 'Chinese, Simplified', '简体中文' ],
|
121 |
+
'zh-hant' => [ 'Chinese, Traditional', '繁體中文' ],
|
122 |
+
];
|
123 |
+
|
124 |
+
return $lang[ $lang_code ][1];
|
125 |
+
}
|
126 |
+
// phpcs:enable
|
php/functions-shortcode-filters.php
ADDED
@@ -0,0 +1,688 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
function sc_filter_set_uid( array $a ) {
|
5 |
+
|
6 |
+
static $i = 1;
|
7 |
+
|
8 |
+
$a['uid'] = sanitize_key( uniqid( "arve-{$a['provider']}-{$a['id']}-$i", true) );
|
9 |
+
|
10 |
+
$i++;
|
11 |
+
|
12 |
+
return $a;
|
13 |
+
}
|
14 |
+
|
15 |
+
function sc_filter_aspect_ratio( array $a ) {
|
16 |
+
|
17 |
+
if ( ! empty( $a['aspect_ratio'] ) ) {
|
18 |
+
return $a;
|
19 |
+
}
|
20 |
+
|
21 |
+
if ( ! empty( $a['oembed_data']->width ) && ! empty( $a['oembed_data']->height ) ) {
|
22 |
+
|
23 |
+
$a['aspect_ratio'] = $a['oembed_data']->width . ':' . $a['oembed_data']->height;
|
24 |
+
|
25 |
+
} else {
|
26 |
+
$properties = get_host_properties();
|
27 |
+
|
28 |
+
if ( isset( $properties[ $a['provider'] ]['aspect_ratio'] ) ) {
|
29 |
+
$a['aspect_ratio'] = $properties[ $a['provider'] ]['aspect_ratio'];
|
30 |
+
} else {
|
31 |
+
$a['aspect_ratio'] = '16:9';
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
if ( $a['aspect_ratio'] ) {
|
36 |
+
$a['aspect_ratio'] = aspect_ratio_gcd( $a['aspect_ratio'] );
|
37 |
+
}
|
38 |
+
|
39 |
+
return $a;
|
40 |
+
}
|
41 |
+
|
42 |
+
function sc_filter_dimensions( array $a ) {
|
43 |
+
|
44 |
+
$a['width'] = $a['maxwidth'];
|
45 |
+
|
46 |
+
if ( $a['aspect_ratio'] ) {
|
47 |
+
$a['height'] = new_height_from_aspect_ratio( $a['width'], $a['aspect_ratio'] );
|
48 |
+
}
|
49 |
+
|
50 |
+
return $a;
|
51 |
+
}
|
52 |
+
|
53 |
+
function sc_filter_maxwidth( array $a ) {
|
54 |
+
|
55 |
+
$options = options();
|
56 |
+
|
57 |
+
if ( empty( $a['maxwidth'] ) ) {
|
58 |
+
|
59 |
+
if ( in_array( $a['align'], [ 'left', 'right', 'center' ], true ) ) {
|
60 |
+
$a['maxwidth'] = (int) $options['align_maxwidth'];
|
61 |
+
} elseif ( empty( $options['maxwidth'] ) ) {
|
62 |
+
$a['maxwidth'] = (int) empty( $GLOBALS['content_width'] ) ? DEFAULT_MAXWIDTH : $GLOBALS['content_width'];
|
63 |
+
} else {
|
64 |
+
$a['maxwidth'] = (int) $options['maxwidth'];
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( $a['maxwidth'] < 50 ) {
|
69 |
+
$a['errors']->add( 'no-maxwidth', __( 'Maxwidth needs to be 50+', 'advanced-responsive-video-embedder' ) );
|
70 |
+
}
|
71 |
+
|
72 |
+
return $a;
|
73 |
+
}
|
74 |
+
|
75 |
+
function sc_filter_liveleak_id_fix( array $a ) {
|
76 |
+
|
77 |
+
if ( 'liveleak' !== $a['provider'] ) {
|
78 |
+
return $a;
|
79 |
+
}
|
80 |
+
|
81 |
+
if ( Common\starts_with( $a['id'], 't=' ) ) {
|
82 |
+
$a['id'][0] = 'i';
|
83 |
+
} elseif ( ! Common\starts_with( $a['id'], 'i=' )
|
84 |
+
&& ! Common\starts_with( $a['id'], 'f=' )
|
85 |
+
) {
|
86 |
+
$a['id'] = 'i=' . $a['id'];
|
87 |
+
}
|
88 |
+
|
89 |
+
return $a;
|
90 |
+
}
|
91 |
+
|
92 |
+
function sc_filter_mode( array $a ) {
|
93 |
+
|
94 |
+
if ( in_array( $a['mode'], [ 'lazyload-lightbox', 'thumbnail' ], true ) ) {
|
95 |
+
$a['mode'] = 'lightbox';
|
96 |
+
}
|
97 |
+
|
98 |
+
$supported_modes = get_supported_modes();
|
99 |
+
|
100 |
+
if ( ! array_key_exists( $a['mode'], $supported_modes ) ) {
|
101 |
+
|
102 |
+
$err_msg = sprintf(
|
103 |
+
// Translators: Mode
|
104 |
+
__( 'Mode: %s not available (ARVE Pro not active?), switching to normal mode', 'advanced-responsive-video-embedder' ),
|
105 |
+
$a['mode']
|
106 |
+
);
|
107 |
+
$a['errors']->add( 'mode-not-avail', $err_msg );
|
108 |
+
$a['mode'] = 'normal';
|
109 |
+
}
|
110 |
+
|
111 |
+
return apply_filters( 'nextgenthemes/arve/sc_filter/mode', $a );
|
112 |
+
}
|
113 |
+
|
114 |
+
function sc_filter_validate( array $a ) {
|
115 |
+
|
116 |
+
foreach ( $a as $key => $value ) {
|
117 |
+
|
118 |
+
switch ( $key ) {
|
119 |
+
case 'errors':
|
120 |
+
break;
|
121 |
+
case 'url_handler':
|
122 |
+
if ( null !== $value && ! is_array( $value ) ) {
|
123 |
+
$a['errors']->add( 2, 'url_handler needs to be null or array' . $value );
|
124 |
+
}
|
125 |
+
break;
|
126 |
+
case 'oembed_data':
|
127 |
+
if ( null !== $value && ! is_object( $value ) ) {
|
128 |
+
$a['errors']->add( 'oembed_data', 'oembed_data needs to be null or a object' );
|
129 |
+
}
|
130 |
+
break;
|
131 |
+
default:
|
132 |
+
if ( null !== $value && ! is_string( $value ) ) {
|
133 |
+
$a['errors']->add( 2, "$key must be null or string" );
|
134 |
+
}
|
135 |
+
break;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
foreach ( bool_shortcode_args() as $boolattr ) {
|
140 |
+
$a = validate_bool( $a, $boolattr );
|
141 |
+
};
|
142 |
+
unset( $boolattr );
|
143 |
+
|
144 |
+
$url_args = VIDEO_FILE_EXTENSIONS;
|
145 |
+
$url_args[] = 'url';
|
146 |
+
|
147 |
+
foreach ( $url_args as $urlattr ) {
|
148 |
+
$a = validate_url( $a, $urlattr );
|
149 |
+
};
|
150 |
+
unset( $urlattr );
|
151 |
+
|
152 |
+
$a = validate_align( $a );
|
153 |
+
$a = validate_aspect_ratio( $a );
|
154 |
+
|
155 |
+
return apply_filters( 'nextgenthemes/arve/sc_filter/validate', $a );
|
156 |
+
}
|
157 |
+
|
158 |
+
function sc_filter_validate_again( array $a ) {
|
159 |
+
|
160 |
+
if ( 'html5' !== $a['provider'] ) {
|
161 |
+
|
162 |
+
if ( ! is_int( $a['width'] ) ) {
|
163 |
+
$a['width'] = (int) $a['width'];
|
164 |
+
$a['errors']->add( 'width', '<code>width</code> must be int' );
|
165 |
+
}
|
166 |
+
|
167 |
+
if ( ! is_int( $a['height'] ) ) {
|
168 |
+
$a['height'] = (int) $a['height'];
|
169 |
+
$a['errors']->add( 'height', '<code>height</code> must be int' );
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
foreach ( $a as $key => $val ) {
|
174 |
+
|
175 |
+
if ( 'oembed_data' === $key && ! is_object( $a[ $attr ] ) && ! is_null( $a[ $attr ] ) ) {
|
176 |
+
$a['errors']->add( 'not bool', $attr . ' must be object' );
|
177 |
+
}
|
178 |
+
|
179 |
+
if ( in_array( $key, bool_shortcode_args(), true ) && ! is_bool( $a[ $attr ] ) ) {
|
180 |
+
$a['errors']->add( 'not bool', $attr . ' must be bool' );
|
181 |
+
}
|
182 |
+
}
|
183 |
+
unset( $attr );
|
184 |
+
|
185 |
+
return $a;
|
186 |
+
}
|
187 |
+
|
188 |
+
function sc_filter_autoplay( array $a ) {
|
189 |
+
|
190 |
+
if ( 'normal' === $a['mode'] ) { // Prevent more then one vid autoplaying
|
191 |
+
|
192 |
+
static $did_run = false;
|
193 |
+
|
194 |
+
if ( $did_run ) {
|
195 |
+
$a['autoplay'] = false;
|
196 |
+
}
|
197 |
+
|
198 |
+
if ( ! $did_run && $a['autoplay'] ) {
|
199 |
+
$did_run = true;
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
return apply_filters( 'nextgenthemes/arve/sc_filter/autoplay', $a );
|
204 |
+
}
|
205 |
+
|
206 |
+
function sc_filter_missing_attribute_check( array $a ) {
|
207 |
+
|
208 |
+
// Old shortcodes
|
209 |
+
if ( $a['legacy_sc'] ) {
|
210 |
+
|
211 |
+
if ( ! $a['id'] || ! $a['provider'] ) {
|
212 |
+
$a['errors']->add( 'fatal', 'need id and provider' );
|
213 |
+
remove_all_filters( 'shortcode_atts_arve' );
|
214 |
+
}
|
215 |
+
|
216 |
+
return $a;
|
217 |
+
}
|
218 |
+
|
219 |
+
$error = true;
|
220 |
+
$required_attributes = VIDEO_FILE_EXTENSIONS;
|
221 |
+
$required_attributes[] = 'url';
|
222 |
+
|
223 |
+
foreach ( $required_attributes as $req_attr ) {
|
224 |
+
|
225 |
+
if ( $a[ $req_attr ] ) {
|
226 |
+
$error = false;
|
227 |
+
break;
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
if ( $error ) {
|
232 |
+
|
233 |
+
$msg = sprintf(
|
234 |
+
// Translators: Attributes.
|
235 |
+
esc_html__( 'The [[arve]] shortcode needs one of this attributes %s', 'advanced-responsive-video-embedder' ),
|
236 |
+
implode( ', ', $required_attributes )
|
237 |
+
);
|
238 |
+
|
239 |
+
$a['errors']->add( 'fatal', $msg );
|
240 |
+
}
|
241 |
+
|
242 |
+
return $a;
|
243 |
+
}
|
244 |
+
|
245 |
+
function sc_filter_thumbnail( array $a ) {
|
246 |
+
|
247 |
+
$a = apply_filters( 'nextgenthemes/arve/sc_filter/thumbnail', $a );
|
248 |
+
|
249 |
+
if ( $a['thumbnail'] ) :
|
250 |
+
|
251 |
+
if ( is_numeric( $a['thumbnail'] ) ) {
|
252 |
+
|
253 |
+
$a['img_src'] = wp_get_attachment_image_url( $a['thumbnail'], 'small' );
|
254 |
+
$a['img_srcset'] = wp_get_attachment_image_srcset( $a['thumbnail'], 'small' );
|
255 |
+
|
256 |
+
if ( empty( $a['img_src'] ) ) {
|
257 |
+
$a['errors']->add( 'wp thumbnail', __( 'No attachment with that ID', 'advanced-responsive-video-embedder' ) );
|
258 |
+
}
|
259 |
+
} elseif ( valid_url( $a['thumbnail'] ) ) {
|
260 |
+
|
261 |
+
$a['img_src'] = $a['thumbnail'];
|
262 |
+
|
263 |
+
} else {
|
264 |
+
|
265 |
+
$a['errors']->add( 'thumbnail', __( 'Not a valid thumbnail URL or Media ID given', 'advanced-responsive-video-embedder' ) );
|
266 |
+
}
|
267 |
+
endif;
|
268 |
+
|
269 |
+
$a = apply_filters( 'nextgenthemes/arve/sc_filter/img_src', $a );
|
270 |
+
$a = apply_filters( 'nextgenthemes/arve/sc_filter/img_srcset', $a );
|
271 |
+
|
272 |
+
return $a;
|
273 |
+
}
|
274 |
+
|
275 |
+
function sc_filter_video( array $a ) {
|
276 |
+
|
277 |
+
foreach ( VIDEO_FILE_EXTENSIONS as $ext ) {
|
278 |
+
|
279 |
+
if ( ! empty( $a[ $ext ] ) && is_numeric( $a[ $ext ] ) ) {
|
280 |
+
$a[ $ext ] = wp_get_attachment_url( $a[ $ext ] );
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
return apply_filters( 'nextgenthemes/arve/sc_filter/video', $a );
|
285 |
+
}
|
286 |
+
|
287 |
+
function sc_filter_detect_provider_and_id_from_url( array $a ) {
|
288 |
+
|
289 |
+
if ( 'html5' === $a['provider'] ||
|
290 |
+
( $a['provider'] && $a['id'] )
|
291 |
+
) {
|
292 |
+
return $a;
|
293 |
+
}
|
294 |
+
|
295 |
+
if ( ! $a['url'] && ! $a['src'] ) {
|
296 |
+
$a['errors']->add(
|
297 |
+
'fatal',
|
298 |
+
__( 'sc_filter_detect_provider_and_id_from_url function needs url.', 'advanced-responsive-video-embedder' )
|
299 |
+
);
|
300 |
+
remove_all_filters( 'shortcode_atts_arve' );
|
301 |
+
return $a;
|
302 |
+
}
|
303 |
+
|
304 |
+
$options = options();
|
305 |
+
$properties = get_host_properties();
|
306 |
+
$input_provider = $a['provider'];
|
307 |
+
|
308 |
+
foreach ( $properties as $host_id => $host ) :
|
309 |
+
|
310 |
+
if ( empty( $host['regex'] ) ) {
|
311 |
+
continue;
|
312 |
+
}
|
313 |
+
|
314 |
+
$preg_match = preg_match( $host['regex'], $a['url'], $matches );
|
315 |
+
|
316 |
+
if ( 1 !== $preg_match ) {
|
317 |
+
continue;
|
318 |
+
}
|
319 |
+
|
320 |
+
foreach ( $matches as $key => $value ) {
|
321 |
+
|
322 |
+
if ( is_string( $key ) ) {
|
323 |
+
$a['provider'] = $host_id;
|
324 |
+
$a[ $key ] = $matches[ $key ];
|
325 |
+
}
|
326 |
+
}
|
327 |
+
endforeach;
|
328 |
+
|
329 |
+
if ( $input_provider &&
|
330 |
+
( $input_provider !== $a['provider'] ) &&
|
331 |
+
! ( 'youtube' === $input_provider && 'youtubelist' === $a['provider'] )
|
332 |
+
) {
|
333 |
+
$a['errors']->add( 'detect!=oembed', "Regex detected provider <code>{$a['provider']}</code> did not match given provider <code>$input_provider</code>" );
|
334 |
+
}
|
335 |
+
|
336 |
+
if ( ! $a['provider'] ) {
|
337 |
+
$a['provider'] = 'iframe';
|
338 |
+
$a['src'] = $a['src'] ? $a['src'] : $a['url'];
|
339 |
+
$a['id'] = $a['src'];
|
340 |
+
}
|
341 |
+
|
342 |
+
return $a;
|
343 |
+
}
|
344 |
+
|
345 |
+
function special_iframe_src_mods( array $a ) {
|
346 |
+
|
347 |
+
switch ( $a['provider'] ) {
|
348 |
+
case 'youtube':
|
349 |
+
$yt_v = Common\get_url_arg( $a['url'], 'v' );
|
350 |
+
$yt_list = Common\get_url_arg( $a['url'], 'list' );
|
351 |
+
|
352 |
+
if ( Common\contains( $a['src'], '/embed/videoseries?' ) &&
|
353 |
+
$yt_v
|
354 |
+
) {
|
355 |
+
$a['src'] = str_replace( '/embed/videoseries?', "/embed/$yt_v?", $a['src'] );
|
356 |
+
}
|
357 |
+
|
358 |
+
if ( $yt_list ) {
|
359 |
+
$a['src'] = remove_query_arg( 'feature', $a['src'] );
|
360 |
+
$a['src'] = add_query_arg( 'list', $yt_list, $a['src'] );
|
361 |
+
$a['src_gen'] = add_query_arg( 'list', $yt_list, $a['src_gen'] );
|
362 |
+
}
|
363 |
+
break;
|
364 |
+
case 'vimeo':
|
365 |
+
$parsed_url = wp_parse_url( $a['url'] );
|
366 |
+
$vimeo_appid = Common\get_url_arg( $a['src'], 'app_id' ); // TODO check why vimeo adds it and it can be removed,
|
367 |
+
|
368 |
+
if ( $vimeo_appid ) {
|
369 |
+
$a['src_gen'] = add_query_arg( 'app_id', $vimeo_appid, $a['src_gen'] );
|
370 |
+
}
|
371 |
+
|
372 |
+
if ( ! empty( $parsed_url['fragment'] ) && Common\starts_with( $parsed_url['fragment'], 't' ) ) {
|
373 |
+
$a['src'] .= '#' . $parsed_url['fragment'];
|
374 |
+
$a['src_gen'] .= '#' . $parsed_url['fragment'];
|
375 |
+
}
|
376 |
+
break;
|
377 |
+
}
|
378 |
+
|
379 |
+
return $a;
|
380 |
+
}
|
381 |
+
|
382 |
+
function sc_filter_iframe_src( array $a ) {
|
383 |
+
|
384 |
+
if ( 'html5' === $a['provider'] ) {
|
385 |
+
return $a;
|
386 |
+
}
|
387 |
+
|
388 |
+
if ( ! $a['provider'] || ! $a['id'] ) {
|
389 |
+
$a['errors']->add( 'no-provider-and-id', 'Need Provider and ID to build iframe src' );
|
390 |
+
return $a;
|
391 |
+
}
|
392 |
+
|
393 |
+
$options = options();
|
394 |
+
$a['src_gen'] = build_iframe_src( $a );
|
395 |
+
$a = special_iframe_src_mods( $a );
|
396 |
+
|
397 |
+
if ( $a['src'] &&
|
398 |
+
( $a['src'] !== $a['src_gen'] )
|
399 |
+
) {
|
400 |
+
$msg = sprintf(
|
401 |
+
'src mismatch <br>url: %s<br>src in: %s<br>src gen: %s',
|
402 |
+
$a['url'],
|
403 |
+
$a['src'],
|
404 |
+
$a['src_gen']
|
405 |
+
);
|
406 |
+
|
407 |
+
$a['errors']->add( 'info', $msg );
|
408 |
+
}
|
409 |
+
|
410 |
+
if ( ! $a['src'] ) {
|
411 |
+
$a['src'] = $a['src_gen'];
|
412 |
+
}
|
413 |
+
|
414 |
+
$a['src'] = iframe_src_args( $a['src'], $a );
|
415 |
+
$a['src'] = iframe_src_autoplay_args( $a['src'], $a['autoplay'], $a );
|
416 |
+
|
417 |
+
if ( 'youtube' === $a['provider'] && $options['youtube_nocookie'] ) {
|
418 |
+
$a['src'] = str_replace( 'https://www.youtube.com', 'https://www.youtube-nocookie.com', $a['src'] );
|
419 |
+
}
|
420 |
+
|
421 |
+
$a = apply_filters( 'nextgenthemes/arve/sc_filter/src', $a );
|
422 |
+
|
423 |
+
return $a;
|
424 |
+
}
|
425 |
+
|
426 |
+
function build_iframe_src( array $a ) {
|
427 |
+
|
428 |
+
$options = options();
|
429 |
+
$properties = get_host_properties();
|
430 |
+
|
431 |
+
if ( isset( $properties[ $a['provider'] ]['embed_url'] ) ) {
|
432 |
+
$pattern = $properties[ $a['provider'] ]['embed_url'];
|
433 |
+
} else {
|
434 |
+
$pattern = '%s';
|
435 |
+
}
|
436 |
+
|
437 |
+
if ( 'facebook' === $a['provider'] && is_numeric( $a['id'] ) ) {
|
438 |
+
|
439 |
+
$a['id'] = "https://www.facebook.com/facebook/videos/{$a['id']}/";
|
440 |
+
|
441 |
+
} elseif ( 'twitch' === $a['provider'] && is_numeric( $a['id'] ) ) {
|
442 |
+
|
443 |
+
$pattern = 'https://player.twitch.tv/?video=v%s';
|
444 |
+
}
|
445 |
+
|
446 |
+
if ( isset( $properties[ $a['provider'] ]['url_encode_id'] ) && $properties[ $a['provider'] ]['url_encode_id'] ) {
|
447 |
+
$a['id'] = rawurlencode( str_replace( '&', '&', $a['id'] ) );
|
448 |
+
}
|
449 |
+
|
450 |
+
if ( 'brightcove' === $a['provider'] ) {
|
451 |
+
$src = sprintf( $pattern, $a['account_id'], $a['brightcove_player'], $a['brightcove_embed'], $a['id'] );
|
452 |
+
} else {
|
453 |
+
$src = sprintf( $pattern, $a['id'] );
|
454 |
+
}
|
455 |
+
|
456 |
+
switch ( $a['provider'] ) {
|
457 |
+
|
458 |
+
case 'youtube':
|
459 |
+
$t_arg = Common\get_url_arg( $a['url'], 't' );
|
460 |
+
$list_arg = Common\get_url_arg( $a['url'], 'list' );
|
461 |
+
|
462 |
+
if ( $t_arg ) {
|
463 |
+
$src = add_query_arg( 'start', youtube_time_to_seconds( $t_arg ), $src );
|
464 |
+
}
|
465 |
+
|
466 |
+
if ( $list_arg ) {
|
467 |
+
$src = add_query_arg( 'list', $list_arg, $src );
|
468 |
+
} else {
|
469 |
+
$src = add_query_arg( 'feature', 'oembed', $src );
|
470 |
+
}
|
471 |
+
|
472 |
+
break;
|
473 |
+
case 'vimeo':
|
474 |
+
$src = add_query_arg( 'dnt', 1, $src );
|
475 |
+
if ( $a['src'] ) {
|
476 |
+
$a['src'] = str_replace( '&', '&', $a['src'] );
|
477 |
+
$vimeo_appid = Common\get_url_arg( $a['src'], 'app_id' );
|
478 |
+
if ( $vimeo_appid ) {
|
479 |
+
$src = add_query_arg( 'app_id', $vimeo_appid, $src );
|
480 |
+
$src = str_replace( '&', '&', $a['src'] );
|
481 |
+
|
482 |
+
}
|
483 |
+
}
|
484 |
+
break;
|
485 |
+
case 'wistia':
|
486 |
+
$src = add_query_arg( 'dnt', 1, $src );
|
487 |
+
break;
|
488 |
+
case 'ted':
|
489 |
+
$lang = Common\get_url_arg( $a['url'], 'language' );
|
490 |
+
if ( $lang ) {
|
491 |
+
$src = str_replace( 'ted.com/talks/', "ted.com/talks/lang/{$lang}/", $src );
|
492 |
+
}
|
493 |
+
break;
|
494 |
+
}
|
495 |
+
|
496 |
+
return $src;
|
497 |
+
}
|
498 |
+
|
499 |
+
function iframe_src_args( $src, array $a ) {
|
500 |
+
|
501 |
+
$options = options();
|
502 |
+
|
503 |
+
$parameters = wp_parse_args( preg_replace( '!\s+!', '&', $a['parameters'] ) );
|
504 |
+
$option_parameters = [];
|
505 |
+
|
506 |
+
if ( isset( $options['params'][ $a['provider'] ] ) ) {
|
507 |
+
$option_parameters = wp_parse_args( preg_replace( '!\s+!', '&', $options['params'][ $a['provider'] ] ) );
|
508 |
+
}
|
509 |
+
|
510 |
+
$parameters = wp_parse_args( $parameters, $option_parameters );
|
511 |
+
$src = add_query_arg( $parameters, $src );
|
512 |
+
|
513 |
+
if ( 'youtube' === $a['provider'] && in_array( $a['mode'], [ 'lightbox', 'link-lightbox' ], true ) ) {
|
514 |
+
$src = add_query_arg( 'playsinline', '1', $src );
|
515 |
+
}
|
516 |
+
|
517 |
+
if ( 'twitch' === $a['provider'] ) {
|
518 |
+
$domain = wp_parse_url( home_url(), PHP_URL_HOST );
|
519 |
+
$src = add_query_arg( 'parent', $domain, $src );
|
520 |
+
}
|
521 |
+
|
522 |
+
return $src;
|
523 |
+
}
|
524 |
+
|
525 |
+
// phpcs:ignore Generic.Metrics.CyclomaticComplexity.MaxExceeded
|
526 |
+
function iframe_src_autoplay_args( $src, $autoplay, array $a ) {
|
527 |
+
|
528 |
+
switch ( $a['provider'] ) {
|
529 |
+
case 'alugha':
|
530 |
+
case 'archiveorg':
|
531 |
+
case 'dailymotion':
|
532 |
+
case 'dailymotionlist':
|
533 |
+
case 'facebook':
|
534 |
+
case 'vevo':
|
535 |
+
case 'viddler':
|
536 |
+
case 'vimeo':
|
537 |
+
case 'youtube':
|
538 |
+
case 'youtubelist':
|
539 |
+
$on = add_query_arg( 'autoplay', 1, $a['src'] );
|
540 |
+
$off = add_query_arg( 'autoplay', 0, $a['src'] );
|
541 |
+
break;
|
542 |
+
case 'twitch':
|
543 |
+
case 'ustream':
|
544 |
+
$on = add_query_arg( 'autoplay', 'true', $a['src'] );
|
545 |
+
$off = add_query_arg( 'autoplay', 'false', $a['src'] );
|
546 |
+
break;
|
547 |
+
case 'livestream':
|
548 |
+
case 'Wistia':
|
549 |
+
$on = add_query_arg( 'autoPlay', 'true', $a['src'] );
|
550 |
+
$off = add_query_arg( 'autoPlay', 'false', $a['src'] );
|
551 |
+
break;
|
552 |
+
case 'metacafe':
|
553 |
+
$on = add_query_arg( 'ap', 1, $a['src'] );
|
554 |
+
$off = remove_query_arg( 'ap', $a['src'] );
|
555 |
+
break;
|
556 |
+
case 'brightcove':
|
557 |
+
case 'snotr':
|
558 |
+
$on = add_query_arg( 'autoplay', 1, $a['src'] );
|
559 |
+
$off = remove_query_arg( 'autoplay', $a['src'] );
|
560 |
+
break;
|
561 |
+
case 'yahoo':
|
562 |
+
$on = add_query_arg( 'player_autoplay', 'true', $a['src'] );
|
563 |
+
$off = add_query_arg( 'player_autoplay', 'false', $a['src'] );
|
564 |
+
break;
|
565 |
+
default:
|
566 |
+
// Do nothing for providers that to not support autoplay or fail with parameters
|
567 |
+
$on = $src;
|
568 |
+
$off = $src;
|
569 |
+
break;
|
570 |
+
/*
|
571 |
+
case 'videojug':
|
572 |
+
$on = add_query_arg( 'ap', 1, $a['src'] );
|
573 |
+
$off = add_query_arg( 'ap', 0, $a['src'] );
|
574 |
+
break;
|
575 |
+
case 'veoh':
|
576 |
+
$on = add_query_arg( 'videoAutoPlay', 1, $a['src'] );
|
577 |
+
$off = add_query_arg( 'videoAutoPlay', 0, $a['src'] );
|
578 |
+
break;
|
579 |
+
case 'iframe':
|
580 |
+
$on = add_query_arg(
|
581 |
+
[
|
582 |
+
'ap' => '1',
|
583 |
+
'autoplay' => '1',
|
584 |
+
'autoStart' => 'true',
|
585 |
+
'player_autoStart' => 'true',
|
586 |
+
],
|
587 |
+
$a['src']
|
588 |
+
);
|
589 |
+
$off = add_query_arg(
|
590 |
+
[
|
591 |
+
'ap' => '0',
|
592 |
+
'autoplay' => '0',
|
593 |
+
'autoStart' => 'false',
|
594 |
+
'player_autoStart' => 'false',
|
595 |
+
],
|
596 |
+
$a['src']
|
597 |
+
);
|
598 |
+
break;
|
599 |
+
*/
|
600 |
+
}
|
601 |
+
|
602 |
+
if ( $autoplay ) {
|
603 |
+
$src = $on;
|
604 |
+
} else {
|
605 |
+
$src = $off;
|
606 |
+
}
|
607 |
+
|
608 |
+
return $src;
|
609 |
+
}
|
610 |
+
|
611 |
+
function sc_filter_detect_query_args( array $a ) {
|
612 |
+
|
613 |
+
if ( empty( $a['url'] ) ) {
|
614 |
+
return $a;
|
615 |
+
}
|
616 |
+
|
617 |
+
$to_extract = [
|
618 |
+
'brightcove' => [ 'videoId', 'something' ],
|
619 |
+
];
|
620 |
+
|
621 |
+
foreach ( $to_extract as $provider => $parameters ) {
|
622 |
+
|
623 |
+
if ( $provider !== $a['provider'] ) {
|
624 |
+
return $a;
|
625 |
+
}
|
626 |
+
|
627 |
+
$query_array = url_query_array( $a['url'] );
|
628 |
+
|
629 |
+
foreach ( $parameters as $key => $parameter ) {
|
630 |
+
|
631 |
+
$att_name = $a['provider'] . "_$parameter";
|
632 |
+
|
633 |
+
if ( empty( $query_array[ $parameter ] ) ) {
|
634 |
+
$a[ $att_name ] = new \WP_Error( $att_name, "$parameter not found in URL" );
|
635 |
+
} else {
|
636 |
+
$a[ $att_name ] = $query_array[ $parameter ];
|
637 |
+
}
|
638 |
+
}
|
639 |
+
}
|
640 |
+
|
641 |
+
return $a;
|
642 |
+
}
|
643 |
+
|
644 |
+
function get_video_type( $ext ) {
|
645 |
+
|
646 |
+
switch ( $ext ) {
|
647 |
+
case 'ogv':
|
648 |
+
case 'ogm':
|
649 |
+
return 'video/ogg';
|
650 |
+
case 'av1mp4':
|
651 |
+
return 'video/mp4; codecs=av01.0.05M.08';
|
652 |
+
default:
|
653 |
+
return 'video/' . $ext;
|
654 |
+
}
|
655 |
+
}
|
656 |
+
|
657 |
+
function sc_filter_detect_html5( array $a ) {
|
658 |
+
|
659 |
+
if ( $a['provider'] && 'html5' !== $a['provider'] ) {
|
660 |
+
return $a;
|
661 |
+
}
|
662 |
+
|
663 |
+
foreach ( VIDEO_FILE_EXTENSIONS as $ext ) :
|
664 |
+
|
665 |
+
if ( Common\ends_with( $a['url'], ".$ext" ) &&
|
666 |
+
! $a[ $ext ]
|
667 |
+
) {
|
668 |
+
$a[ $ext ] = $a['url'];
|
669 |
+
}
|
670 |
+
|
671 |
+
if ( 'av1mp4' === $ext &&
|
672 |
+
Common\ends_with( $a['url'], 'av1.mp4' ) &&
|
673 |
+
! $a[ $ext ]
|
674 |
+
) {
|
675 |
+
$a[ $ext ] = $a['url'];
|
676 |
+
}
|
677 |
+
|
678 |
+
if ( $a[ $ext ] ) {
|
679 |
+
$a['video_sources_html'] .= sprintf( '<source type="%s" src="%s">', get_video_type( $ext ), $a[ $ext ] );
|
680 |
+
}
|
681 |
+
endforeach;
|
682 |
+
|
683 |
+
if ( $a['video_sources_html'] ) {
|
684 |
+
$a['provider'] = 'html5';
|
685 |
+
}
|
686 |
+
|
687 |
+
return $a;
|
688 |
+
}
|
php/functions-shortcodes.php
ADDED
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
use function Nextgenthemes\ARVE\Common\starts_with;
|
5 |
+
|
6 |
+
function shortcode( $a, $content = null ) {
|
7 |
+
|
8 |
+
$a = (array) $a;
|
9 |
+
|
10 |
+
foreach ( $a as $k => $v ) {
|
11 |
+
if ( '' === $v ) {
|
12 |
+
unset( $a[ $k ] );
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
$override = apply_filters( 'nextgenthemes/arve/shortcode_override', '', $a, $content );
|
17 |
+
|
18 |
+
if ( '' !== $override ) {
|
19 |
+
return $override;
|
20 |
+
}
|
21 |
+
|
22 |
+
$a['errors'] = new \WP_Error();
|
23 |
+
$a = apply_filters( 'nextgenthemes/arve/shortcode_args', $a );
|
24 |
+
|
25 |
+
if ( ! empty( $a['url'] ) ) {
|
26 |
+
|
27 |
+
$embed_check = new EmbedChecker( $a );
|
28 |
+
$mayme_arve_html = $embed_check->check();
|
29 |
+
|
30 |
+
if ( $mayme_arve_html ) {
|
31 |
+
return $mayme_arve_html;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
return build_video( $a, $content );
|
36 |
+
}
|
37 |
+
|
38 |
+
function test_shortcode( $atts = null, $content = null ) {
|
39 |
+
|
40 |
+
$html = '';
|
41 |
+
$providers = get_host_properties();
|
42 |
+
$get_provider = sanitize_text_field( wp_unslash( empty( $_GET['arve-provider-test'] ) ? '' : $_GET['arve-provider-test'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
43 |
+
|
44 |
+
if ( $get_provider ) {
|
45 |
+
|
46 |
+
if ( empty( $providers[ $get_provider ]['tests'] ) ) {
|
47 |
+
$html .= 'no tests for ' . $get_provider;
|
48 |
+
} else {
|
49 |
+
$html .= basic_tests( $providers[ $get_provider ]['tests'] );
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
$html .= '<ul>';
|
54 |
+
foreach ( $providers as $provider => $v ) {
|
55 |
+
|
56 |
+
$url = add_query_arg( $GLOBALS['wp']->query_vars, home_url( $GLOBALS['wp']->request ) );
|
57 |
+
$url = add_query_arg( 'arve-provider-test', $provider, $url );
|
58 |
+
$html .= sprintf( '<li><a href="%s">Test %s</a></li>', $url, $provider );
|
59 |
+
}
|
60 |
+
$html .= '</ul>';
|
61 |
+
|
62 |
+
return $html;
|
63 |
+
}
|
64 |
+
|
65 |
+
function basic_tests( $tests ) {
|
66 |
+
|
67 |
+
$html = '';
|
68 |
+
$modes = [ 'normal', 'lazyload', 'lightbox' ];
|
69 |
+
|
70 |
+
foreach ( $tests as $key => $value ) {
|
71 |
+
$sc = sprintf( '[arve url="%s" mode="lazyload" maxwidth="300" /]', $value['url'], $modes[ array_rand( $modes ) ] );
|
72 |
+
$html .= do_shortcode( $sc );
|
73 |
+
}
|
74 |
+
|
75 |
+
$html .= "<code>[$sc]</code><br>";
|
76 |
+
$html .= do_shortcode( $sc );
|
77 |
+
$html .= '<br>';
|
78 |
+
|
79 |
+
return $html;
|
80 |
+
}
|
81 |
+
|
82 |
+
function build_video( array $input_atts ) {
|
83 |
+
|
84 |
+
for ( $n = 1; $n <= NUM_TRACKS; $n++ ) {
|
85 |
+
$pairs[ "track_{$n}" ] = null;
|
86 |
+
$pairs[ "track_{$n}_label" ] = null;
|
87 |
+
}
|
88 |
+
|
89 |
+
$a = shortcode_atts( shortcode_pairs(), $input_atts, 'arve' );
|
90 |
+
$html = '';
|
91 |
+
|
92 |
+
ksort( $a );
|
93 |
+
ksort( $input_atts );
|
94 |
+
|
95 |
+
if ( ! empty( $a['errors'] ) ) {
|
96 |
+
|
97 |
+
foreach ( $a['errors']->get_error_messages() as $key => $message ) {
|
98 |
+
$html .= sprintf(
|
99 |
+
'%s %s<br>',
|
100 |
+
__( '<abbr title="Advanced Responsive Video Embedder">ARVE</abbr> Error:', 'advanced-responsive-video-embedder' ),
|
101 |
+
$message
|
102 |
+
);
|
103 |
+
}
|
104 |
+
|
105 |
+
if ( '' !== $a['errors']->get_error_message( 'fatal' ) ) {
|
106 |
+
$html .= get_debug_info( $html, $a, $input_atts );
|
107 |
+
return $html;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
$html .= build_html( $a );
|
112 |
+
$html .= get_debug_info( $html, $a, $input_atts );
|
113 |
+
|
114 |
+
wp_enqueue_script( 'arve' );
|
115 |
+
|
116 |
+
return apply_filters( 'nextgenthemes/arve/html', $html, $a );
|
117 |
+
}
|
118 |
+
|
119 |
+
function shortcode_option_defaults() {
|
120 |
+
|
121 |
+
$properties = get_host_properties();
|
122 |
+
unset( $properties['video'] );
|
123 |
+
|
124 |
+
foreach ( $properties as $provider => $values ) {
|
125 |
+
|
126 |
+
if ( ! empty( $values['embed_url'] ) ) {
|
127 |
+
$shortcodes[ $provider ] = $provider;
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
return $shortcodes;
|
132 |
+
}
|
133 |
+
|
134 |
+
function create_shortcodes() {
|
135 |
+
|
136 |
+
$options = options();
|
137 |
+
$properties = get_host_properties();
|
138 |
+
|
139 |
+
if ( $options['legacy_shortcodes'] ) {
|
140 |
+
|
141 |
+
$shortcode_options = wp_parse_args( get_option( 'arve_options_shortcodes', [] ), shortcode_option_defaults() );
|
142 |
+
|
143 |
+
foreach ( $shortcode_options as $provider => $shortcode ) {
|
144 |
+
|
145 |
+
$function = function( $a ) use ( $provider, $properties ) {
|
146 |
+
|
147 |
+
$a['provider'] = $provider;
|
148 |
+
|
149 |
+
if ( ! empty( $properties[ $provider ]['rebuild_url'] ) && ! empty( $a['id'] ) ) {
|
150 |
+
$a['url'] = sprintf( $properties[ $provider ]['rebuild_url'], $a['id'] );
|
151 |
+
unset( $a['id'] );
|
152 |
+
return shortcode( $a );
|
153 |
+
} else {
|
154 |
+
$a['legacy_sc'] = 'Legacy Shortcode';
|
155 |
+
return build_video( $a );
|
156 |
+
}
|
157 |
+
};
|
158 |
+
|
159 |
+
add_shortcode( $shortcode, $function );
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
add_shortcode( 'arve', __NAMESPACE__ . '\shortcode' );
|
164 |
+
add_shortcode( 'arve_test', __NAMESPACE__ . '\test_shortcode' );
|
165 |
+
}
|
166 |
+
|
167 |
+
function wp_video_shortcode_override( $out, $attr ) {
|
168 |
+
|
169 |
+
$options = options();
|
170 |
+
|
171 |
+
if ( ! $options['wp_video_override'] ||
|
172 |
+
! empty( $attr['wmv'] ) ||
|
173 |
+
! empty( $attr['flv'] ) ||
|
174 |
+
disabled_on_feeds()
|
175 |
+
) {
|
176 |
+
return $out;
|
177 |
+
}
|
178 |
+
|
179 |
+
if ( ! empty( $attr['url'] )
|
180 |
+
&& ! empty( $attr['src'] )
|
181 |
+
) {
|
182 |
+
unset( $attr['src'] );
|
183 |
+
}
|
184 |
+
|
185 |
+
if ( isset( $attr['loop'] ) ) {
|
186 |
+
$attr['loop'] = bool_to_shortcode_string( $attr['loop'] );
|
187 |
+
}
|
188 |
+
|
189 |
+
if ( ! empty( $attr['poster'] ) ) {
|
190 |
+
$attr['thumbnail'] = $attr['poster'];
|
191 |
+
}
|
192 |
+
|
193 |
+
return build_video( $attr );
|
194 |
+
}
|
php/functions-url-handlers.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
use \Nextgenthemes\ARVE\Common\starts_with;
|
5 |
+
|
6 |
+
function create_url_handlers() {
|
7 |
+
|
8 |
+
$properties = get_host_properties();
|
9 |
+
|
10 |
+
foreach ( $properties as $provider => $values ) {
|
11 |
+
|
12 |
+
$function = function( $matches, $attr, $url, $rawattr ) use ( $provider ) {
|
13 |
+
return url_handler( $provider, $matches, $attr, $url, $rawattr );
|
14 |
+
};
|
15 |
+
|
16 |
+
if ( ! empty( $values['regex'] ) && empty( $values['oembed'] ) ) {
|
17 |
+
wp_embed_register_handler( 'arve_' . $provider, $values['regex'], $function );
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
function url_handler( $provider, array $matches, array $attr, $url, $rawattr ) {
|
23 |
+
|
24 |
+
$info = [
|
25 |
+
'matches' => $matches,
|
26 |
+
'attr' => $attr,
|
27 |
+
'rawattr' => $rawattr,
|
28 |
+
];
|
29 |
+
|
30 |
+
if ( is_array( $rawattr ) ) {
|
31 |
+
$a = $rawattr;
|
32 |
+
}
|
33 |
+
|
34 |
+
$a['provider'] = $provider;
|
35 |
+
$a['url_handler'] = $info;
|
36 |
+
$a['url'] = $url;
|
37 |
+
|
38 |
+
return build_video( $a );
|
39 |
+
}
|
php/functions-validation.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Nextgenthemes\ARVE;
|
3 |
+
|
4 |
+
function valid_url( $url ) {
|
5 |
+
|
6 |
+
if ( Common\starts_with( $url, '//' ) ) {
|
7 |
+
$url = 'https:' . $url;
|
8 |
+
}
|
9 |
+
|
10 |
+
if ( filter_var( $url, FILTER_VALIDATE_URL ) !== false ) {
|
11 |
+
return true;
|
12 |
+
}
|
13 |
+
|
14 |
+
return false;
|
15 |
+
}
|
16 |
+
|
17 |
+
function validate_url( $a, $attr_name ) {
|
18 |
+
|
19 |
+
if ( ! empty( $a[ $attr_name ] ) && ! valid_url( $a[ $attr_name ] ) ) {
|
20 |
+
|
21 |
+
$error_msg = sprintf(
|
22 |
+
// Translators: 1 URL 2 Attr name
|
23 |
+
__( 'Invalid URL <code>%1$s</code> in <code>%2$s</code>', 'advanced-responsive-video-embedder' ),
|
24 |
+
esc_html( $a[ $attr_name ] ),
|
25 |
+
esc_html( $attr_name )
|
26 |
+
);
|
27 |
+
|
28 |
+
$a['errors']->add( $attr_name, $error_msg );
|
29 |
+
}
|
30 |
+
|
31 |
+
return $a;
|
32 |
+
}
|
33 |
+
|
34 |
+
function validate_aspect_ratio( $a ) {
|
35 |
+
|
36 |
+
if ( empty( $a['aspect_ratio'] ) ) {
|
37 |
+
return $a;
|
38 |
+
}
|
39 |
+
|
40 |
+
$ratio = explode( ':', $a['aspect_ratio'] );
|
41 |
+
|
42 |
+
if ( empty( $ratio[0] ) || ! is_numeric( $ratio[0] ) ||
|
43 |
+
empty( $ratio[1] ) || ! is_numeric( $ratio[1] )
|
44 |
+
) {
|
45 |
+
$a['errors']->add(
|
46 |
+
'aspect_ratio',
|
47 |
+
// Translators: attribute
|
48 |
+
sprintf( __( 'Aspect ratio <code>%s</code> is not valid', 'advanced-responsive-video-embedder' ), $a['aspect_ratio'] )
|
49 |
+
);
|
50 |
+
|
51 |
+
$a['aspect_ratio'] = null;
|
52 |
+
}
|
53 |
+
|
54 |
+
return $a;
|
55 |
+
}
|
56 |
+
|
57 |
+
function bool_to_shortcode_string( $val ) {
|
58 |
+
|
59 |
+
if ( false === $val ) {
|
60 |
+
return 'n';
|
61 |
+
}
|
62 |
+
|
63 |
+
return (string) $val;
|
64 |
+
}
|
65 |
+
|
66 |
+
// phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh
|
67 |
+
function validate_bool( array $a, $attr_name ) {
|
68 |
+
|
69 |
+
switch ( $a[ $attr_name ] ) {
|
70 |
+
case 'true':
|
71 |
+
case '1':
|
72 |
+
case 'y':
|
73 |
+
case 'yes':
|
74 |
+
case 'on':
|
75 |
+
$a[ $attr_name ] = true;
|
76 |
+
break;
|
77 |
+
case '':
|
78 |
+
case null:
|
79 |
+
$a[ $attr_name ] = null;
|
80 |
+
break;
|
81 |
+
case 'false':
|
82 |
+
case '0':
|
83 |
+
case 'n':
|
84 |
+
case 'no':
|
85 |
+
case 'off':
|
86 |
+
$a[ $attr_name ] = false;
|
87 |
+
break;
|
88 |
+
default:
|
89 |
+
$a['errors']->add(
|
90 |
+
$attr_name,
|
91 |
+
// Translators: %1$s = Attr Name, %2$s = Attribute array
|
92 |
+
sprintf(
|
93 |
+
// Translators: Attribute Name
|
94 |
+
__( '%1$s <code>%2$s</code> not valid', 'advanced-responsive-video-embedder' ),
|
95 |
+
esc_html( $attr_name ),
|
96 |
+
esc_html( $a[ $attr_name ] )
|
97 |
+
)
|
98 |
+
);
|
99 |
+
break;
|
100 |
+
}//end switch
|
101 |
+
|
102 |
+
return $a;
|
103 |
+
}
|
104 |
+
|
105 |
+
function validate_align( $a ) {
|
106 |
+
|
107 |
+
switch ( $a['align'] ) {
|
108 |
+
case null:
|
109 |
+
case '':
|
110 |
+
case 'none':
|
111 |
+
$a['align'] = null;
|
112 |
+
break;
|
113 |
+
case 'left':
|
114 |
+
case 'right':
|
115 |
+
case 'center':
|
116 |
+
break;
|
117 |
+
default:
|
118 |
+
$a['errors']->add(
|
119 |
+
'align',
|
120 |
+
// Translators: Alignment
|
121 |
+
sprintf( __( 'Align <code>%s</code> not valid', 'advanced-responsive-video-embedder' ), esc_html( $a['align'] ) )
|
122 |
+
);
|
123 |
+
$a['align'] = null;
|
124 |
+
break;
|
125 |
+
}
|
126 |
+
|
127 |
+
return $a;
|
128 |
+
}
|
public/arve.css
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
#arve .arve-wrapper,
|
2 |
-
#tinymce .arve-wrapper {
|
3 |
-
display: block;
|
4 |
-
margin-bottom: 1.5em;
|
5 |
-
width: 100%;
|
6 |
-
}
|
7 |
-
|
8 |
-
#arve .arve-wrapper::after,
|
9 |
-
#tinymce .arve-wrapper::after {
|
10 |
-
content: "";
|
11 |
-
display: table;
|
12 |
-
clear: both;
|
13 |
-
}
|
14 |
-
|
15 |
-
#arve .arve-wrapper.alignright,
|
16 |
-
#tinymce .arve-wrapper.alignright {
|
17 |
-
margin-top: .4em;
|
18 |
-
margin-left: 1.5em;
|
19 |
-
}
|
20 |
-
|
21 |
-
#arve .arve-wrapper.alignleft,
|
22 |
-
#tinymce .arve-wrapper.alignleft {
|
23 |
-
margin-top: .4em;
|
24 |
-
margin-right: 1.5em;
|
25 |
-
}
|
26 |
-
|
27 |
-
#arve .arve-embed-container,
|
28 |
-
#tinymce .arve-embed-container {
|
29 |
-
position: relative;
|
30 |
-
display: block;
|
31 |
-
padding: 0;
|
32 |
-
padding-bottom: 56.25%;
|
33 |
-
margin: 0;
|
34 |
-
height: 0;
|
35 |
-
overflow: hidden;
|
36 |
-
}
|
37 |
-
|
38 |
-
#arve .arve-thumbnail,
|
39 |
-
#tinymce .arve-thumbnail,
|
40 |
-
#arve .arve-play-btn,
|
41 |
-
#tinymce .arve-play-btn,
|
42 |
-
#arve .arve-iframe,
|
43 |
-
#tinymce .arve-iframe {
|
44 |
-
position: absolute;
|
45 |
-
padding: 0;
|
46 |
-
margin: 0;
|
47 |
-
top: 0;
|
48 |
-
left: 0;
|
49 |
-
bottom: 0;
|
50 |
-
height: 100%;
|
51 |
-
width: 100%;
|
52 |
-
border: 0;
|
53 |
-
}
|
54 |
-
|
55 |
-
#arve .arve-video,
|
56 |
-
#tinymce .arve-video {
|
57 |
-
padding: 0;
|
58 |
-
margin: 0;
|
59 |
-
width: 100%;
|
60 |
-
}
|
61 |
-
|
62 |
-
#arve .arve-promote-link,
|
63 |
-
#tinymce .arve-promote-link {
|
64 |
-
float: right;
|
65 |
-
font-family: "Open Sans", "Sagoe UI", "Arvo", "Lato", Arial, sans-serif;
|
66 |
-
font-size: .8em;
|
67 |
-
}
|
68 |
-
|
69 |
-
.arve-hidden {
|
70 |
-
display: none !important;
|
71 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/arve.js
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
(function ($) {
|
2 |
-
'use strict';
|
3 |
-
|
4 |
-
function remove_unwanted_stuff() {
|
5 |
-
$('.arve-wrapper').find('p, .video-wrap, .fluid-width-video-wrapper, .fluid-vids').contents().unwrap();
|
6 |
-
$('.arve-wrapper br').remove();
|
7 |
-
$('.arve-iframe, .arve-video').removeAttr('width height style');
|
8 |
-
|
9 |
-
$('.wp-block-embed').each( function( index ) {
|
10 |
-
|
11 |
-
if ( $(this).has('.arve-wrapper') ) {
|
12 |
-
|
13 |
-
$(this).removeClass( 'wp-embed-aspect-16-9 wp-has-aspect-ratio' );
|
14 |
-
|
15 |
-
if ( $(this).has('.wp-block-embed__wrapper') ) {
|
16 |
-
$(this).find('.wp-block-embed__wrapper').contents().unwrap();
|
17 |
-
}
|
18 |
-
}
|
19 |
-
} );
|
20 |
-
};
|
21 |
-
|
22 |
-
function global_id() {
|
23 |
-
|
24 |
-
if ( $( 'html[id="arve"]' ).length ) {
|
25 |
-
return;
|
26 |
-
}
|
27 |
-
|
28 |
-
if ( $( 'html[id]' ).length <= 0 ) {
|
29 |
-
|
30 |
-
$( 'html' ).attr( 'id', 'arve' );
|
31 |
-
|
32 |
-
} else if ( $( 'body[id]' ).length <= 0 ) {
|
33 |
-
|
34 |
-
$( 'body' ).attr( 'id', 'arve' );
|
35 |
-
|
36 |
-
} else {
|
37 |
-
|
38 |
-
$( 'body' ).wrapInner( '<div id="arve">' );
|
39 |
-
}
|
40 |
-
}
|
41 |
-
|
42 |
-
remove_unwanted_stuff();
|
43 |
-
global_id();
|
44 |
-
|
45 |
-
$( document ).ready( function() {
|
46 |
-
remove_unwanted_stuff();
|
47 |
-
global_id();
|
48 |
-
} );
|
49 |
-
|
50 |
-
}(jQuery));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/arve.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
#arve .arve-wrapper,#tinymce .arve-wrapper{display:block;margin-bottom:1.5em;width:100%}#arve .arve-wrapper::after,#tinymce .arve-wrapper::after{content:"";display:table;clear:both}#arve .arve-wrapper.alignright,#tinymce .arve-wrapper.alignright{margin-top:.4em;margin-left:1.5em}#arve .arve-wrapper.alignleft,#tinymce .arve-wrapper.alignleft{margin-top:.4em;margin-right:1.5em}#arve .arve-embed-container,#tinymce .arve-embed-container{position:relative;display:block;padding:0;padding-bottom:56.25%;margin:0;height:0;overflow:hidden}#arve .arve-iframe,#arve .arve-play-btn,#arve .arve-thumbnail,#tinymce .arve-iframe,#tinymce .arve-play-btn,#tinymce .arve-thumbnail{position:absolute;padding:0;margin:0;top:0;left:0;bottom:0;height:100%;width:100%;border:0}#arve .arve-video,#tinymce .arve-video{padding:0;margin:0;width:100%}#arve .arve-promote-link,#tinymce .arve-promote-link{float:right;font-family:"Open Sans","Sagoe UI",Arvo,Lato,Arial,sans-serif;font-size:.8em}.arve-hidden{display:none!important}
|
|
public/arve.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function(r){"use strict";function e(){r(".arve-wrapper").find("p, .video-wrap, .fluid-width-video-wrapper, .fluid-vids").contents().unwrap(),r(".arve-wrapper br").remove(),r(".arve-iframe, .arve-video").removeAttr("width height style"),r(".wp-block-embed").each(function(e){r(this).has(".arve-wrapper")&&(r(this).removeClass("wp-embed-aspect-16-9 wp-has-aspect-ratio"),r(this).has(".wp-block-embed__wrapper")&&r(this).find(".wp-block-embed__wrapper").contents().unwrap())})}function t(){r('html[id="arve"]').length||(r("html[id]").length<=0?r("html").attr("id","arve"):r("body[id]").length<=0?r("body").attr("id","arve"):r("body").wrapInner('<div id="arve">'))}e(),t(),r(document).ready(function(){e(),t()})}(jQuery);
|
|
public/functions-enqueue.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_register_styles() {
|
4 |
-
|
5 |
-
$min = arve_get_min_suffix();
|
6 |
-
|
7 |
-
wp_register_style(
|
8 |
-
ARVE_SLUG,
|
9 |
-
ARVE_PUBLIC_URL . "arve$min.css",
|
10 |
-
array(),
|
11 |
-
ARVE_VERSION
|
12 |
-
);
|
13 |
-
}
|
14 |
-
|
15 |
-
function arve_register_scripts() {
|
16 |
-
|
17 |
-
$min = arve_get_min_suffix();
|
18 |
-
|
19 |
-
wp_register_script(
|
20 |
-
ARVE_SLUG,
|
21 |
-
ARVE_PUBLIC_URL . "arve$min.js",
|
22 |
-
array( 'jquery' ),
|
23 |
-
ARVE_VERSION,
|
24 |
-
true
|
25 |
-
);
|
26 |
-
}
|
27 |
-
|
28 |
-
function arve_maybe_enqueue_assets() {
|
29 |
-
|
30 |
-
$options = arve_get_options();
|
31 |
-
|
32 |
-
if ( $options['always_enqueue_assets'] ) {
|
33 |
-
wp_enqueue_style( ARVE_SLUG );
|
34 |
-
wp_enqueue_script( ARVE_SLUG );
|
35 |
-
|
36 |
-
wp_enqueue_style( 'arve-pro' );
|
37 |
-
wp_enqueue_script( 'arve-pro' );
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/functions-html-output.php
DELETED
@@ -1,253 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_html_id( $html_attr ) {
|
4 |
-
|
5 |
-
if ( ! arve_contains( $html_attr, 'id=' ) ) {
|
6 |
-
$html_attr .= ' id="arve"';
|
7 |
-
}
|
8 |
-
|
9 |
-
return $html_attr;
|
10 |
-
}
|
11 |
-
|
12 |
-
function arve_get_var_dump( $var ) {
|
13 |
-
ob_start();
|
14 |
-
var_dump( $var ); // phpcs:ignore
|
15 |
-
return ob_get_clean();
|
16 |
-
};
|
17 |
-
|
18 |
-
function arve_get_debug_info( $input_html, $atts, $input_atts ) {
|
19 |
-
|
20 |
-
$html = '';
|
21 |
-
|
22 |
-
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
23 |
-
if ( isset( $_GET['arve-debug-options'] ) ) {
|
24 |
-
|
25 |
-
static $show_options_debug = true;
|
26 |
-
|
27 |
-
$options = get_option( 'arve_options_main' );
|
28 |
-
$options['shortcodes'] = get_option( 'arve_options_shortcodes' );
|
29 |
-
$options['params'] = get_option( 'arve_options_params' );
|
30 |
-
|
31 |
-
if ( $show_options_debug ) {
|
32 |
-
$html .= sprintf( 'Options: <pre>%s</pre>', arve_get_var_dump( $options ) );
|
33 |
-
}
|
34 |
-
$show_options_debug = false;
|
35 |
-
}
|
36 |
-
|
37 |
-
$pre_style = ''
|
38 |
-
. 'background-color: #111;'
|
39 |
-
. 'color: #eee;'
|
40 |
-
. 'font-size: 15px;'
|
41 |
-
. 'white-space: pre-wrap;'
|
42 |
-
. 'word-wrap: break-word;';
|
43 |
-
|
44 |
-
if ( ! empty( $_GET['arve-debug-attr'] ) ) {
|
45 |
-
$html .= sprintf(
|
46 |
-
'<pre style="%s">attr[%s]: %s</pre>',
|
47 |
-
esc_attr( $pre_style ),
|
48 |
-
esc_html( $_GET['arve-debug-attr'] ),
|
49 |
-
arve_get_var_dump( $atts[ $_GET['arve-debug-attr'] ] )
|
50 |
-
);
|
51 |
-
}
|
52 |
-
|
53 |
-
if ( isset( $_GET['arve-debug-atts'] ) ) {
|
54 |
-
$html .= sprintf( '<pre style="%s">$atts: %s</pre>', esc_attr( $pre_style ), arve_get_var_dump( $input_atts ) );
|
55 |
-
$html .= sprintf( '<pre style="%s">$arve: %s</pre>', esc_attr( $pre_style ), arve_get_var_dump( $atts ) );
|
56 |
-
}
|
57 |
-
|
58 |
-
if ( isset( $_GET['arve-debug-html'] ) ) {
|
59 |
-
$html .= sprintf( '<pre style="%s"">%s</pre>', esc_attr( $pre_style ), esc_html( $input_html ) );
|
60 |
-
}
|
61 |
-
|
62 |
-
// phpcs:enable WordPress.Security.NonceVerification.Recommended
|
63 |
-
return $html;
|
64 |
-
}
|
65 |
-
|
66 |
-
function arve_build_meta_html( $a ) {
|
67 |
-
|
68 |
-
$meta = '';
|
69 |
-
|
70 |
-
if ( ! empty( $a['sources'] ) ) {
|
71 |
-
|
72 |
-
$first_source = arve_get_first_array_value( $a['sources'] );
|
73 |
-
|
74 |
-
$meta .= sprintf( '<meta itemprop="contentURL" content="%s">', esc_attr( $first_source['src'] ) );
|
75 |
-
}
|
76 |
-
|
77 |
-
if ( ! empty( $a['iframe_attr']['src'] ) ) {
|
78 |
-
$meta .= sprintf( '<meta itemprop="embedURL" content="%s">', esc_attr( $a['iframe_attr']['src'] ) );
|
79 |
-
}
|
80 |
-
|
81 |
-
if ( ! empty( $a['upload_date'] ) ) {
|
82 |
-
$meta .= sprintf( '<meta itemprop="uploadDate" content="%s">', esc_attr( $a['upload_date'] ) );
|
83 |
-
}
|
84 |
-
|
85 |
-
if ( ! empty( $a['duration'] ) ) {
|
86 |
-
$meta .= sprintf( '<meta itemprop="duration" content="PT%s">', esc_attr( $a['duration'] ) );
|
87 |
-
}
|
88 |
-
|
89 |
-
if ( ! empty( $a['img_src'] ) ) :
|
90 |
-
|
91 |
-
$thumbnail = sprintf( '<meta itemprop="thumbnailUrl" content="%s">', esc_attr( $a['img_src'] ) );
|
92 |
-
|
93 |
-
$meta .= arve_build_tag(
|
94 |
-
array(
|
95 |
-
'name' => 'thumbnail',
|
96 |
-
'tag' => 'meta',
|
97 |
-
'attr' => array(
|
98 |
-
'itemprop' => 'thumbnailUrl',
|
99 |
-
'content' => $a['img_src'],
|
100 |
-
),
|
101 |
-
),
|
102 |
-
$a
|
103 |
-
);
|
104 |
-
|
105 |
-
endif;
|
106 |
-
|
107 |
-
if ( ! empty( $a['title'] ) ) {
|
108 |
-
|
109 |
-
$meta .= arve_build_tag(
|
110 |
-
array(
|
111 |
-
'name' => 'title',
|
112 |
-
'tag' => 'meta',
|
113 |
-
'attr' => array(
|
114 |
-
'itemprop' => 'name',
|
115 |
-
'content' => trim( $a['title'] ),
|
116 |
-
)
|
117 |
-
),
|
118 |
-
$a
|
119 |
-
);
|
120 |
-
}
|
121 |
-
|
122 |
-
if ( ! empty( $a['description'] ) ) {
|
123 |
-
$meta .= sprintf( '<span itemprop="description" class="arve-description arve-hidden">%s</span>', esc_html( trim( $a['description'] ) ) );
|
124 |
-
}
|
125 |
-
|
126 |
-
return $meta;
|
127 |
-
}
|
128 |
-
|
129 |
-
function arve_build_tag( $args, $a ) {
|
130 |
-
|
131 |
-
$args = apply_filters( "nextgenthemes/arve/{$args['name']}", $args, $a );
|
132 |
-
|
133 |
-
if ( ! empty( $args['content'] ) ) {
|
134 |
-
$out = sprintf(
|
135 |
-
'<%1$s%2$s>%3$s</%1$s>',
|
136 |
-
esc_html( $args['tag'] ),
|
137 |
-
arve_attr( $args['attr'] ),
|
138 |
-
$args['content']
|
139 |
-
);
|
140 |
-
} else {
|
141 |
-
$out = sprintf(
|
142 |
-
'<%s%s>',
|
143 |
-
esc_html( $args['tag'] ),
|
144 |
-
arve_attr( $args['attr'] )
|
145 |
-
);
|
146 |
-
}
|
147 |
-
|
148 |
-
return $out;
|
149 |
-
}
|
150 |
-
|
151 |
-
function arve_build_promote_link_html( $arve_link ) {
|
152 |
-
|
153 |
-
if ( $arve_link ) {
|
154 |
-
return sprintf(
|
155 |
-
'<a href="%s" title="%s" class="arve-promote-link" target="_blank">%s</a>',
|
156 |
-
esc_url( 'https://nextgenthemes.com/plugins/arve-pro/' ),
|
157 |
-
esc_attr( __( 'Embedded with ARVE Advanced Responsive Video Embedder WordPress plugin', ARVE_SLUG ) ),
|
158 |
-
esc_html__( 'ARVE', ARVE_SLUG )
|
159 |
-
);
|
160 |
-
}
|
161 |
-
|
162 |
-
return '';
|
163 |
-
}
|
164 |
-
|
165 |
-
function arve_arve_embed_container( $html, $atts ) {
|
166 |
-
|
167 |
-
$attr['class'] = 'arve-embed-container';
|
168 |
-
|
169 |
-
if ( false === $atts['aspect_ratio'] ) {
|
170 |
-
$attr['style'] = 'height:auto;padding:0';
|
171 |
-
} else {
|
172 |
-
$attr['style'] = sprintf( 'padding-bottom:%F%%', arve_aspect_ratio_to_percentage( $atts['aspect_ratio'] ) );
|
173 |
-
}
|
174 |
-
|
175 |
-
return sprintf( '<div%s>%s</div>', arve_attr( $attr ), $html );
|
176 |
-
}
|
177 |
-
|
178 |
-
function arve_arve_wrapper( $html, $atts ) {
|
179 |
-
|
180 |
-
$element = ( 'link-lightbox' === $atts['mode'] ) ? 'span' : 'div';
|
181 |
-
|
182 |
-
return sprintf(
|
183 |
-
'<%s%s>%s</%s>',
|
184 |
-
$element,
|
185 |
-
arve_attr( $atts['wrapper_attr'] ),
|
186 |
-
$html,
|
187 |
-
$element
|
188 |
-
);
|
189 |
-
}
|
190 |
-
|
191 |
-
function arve_video_or_iframe( $atts ) {
|
192 |
-
|
193 |
-
switch ( $atts['provider'] ) {
|
194 |
-
|
195 |
-
case 'html5':
|
196 |
-
return arve_create_video_tag( $atts );
|
197 |
-
default:
|
198 |
-
return arve_create_iframe_tag( $atts );
|
199 |
-
}
|
200 |
-
}
|
201 |
-
|
202 |
-
/**
|
203 |
-
*
|
204 |
-
*
|
205 |
-
* @since 2.6.0
|
206 |
-
*/
|
207 |
-
function arve_create_iframe_tag( $a ) {
|
208 |
-
|
209 |
-
if ( in_array( $a['mode'], array( 'lazyload', 'lazyload-lightbox', 'link-lightbox' ), true ) ) {
|
210 |
-
$html = sprintf(
|
211 |
-
'<span class="arve-lazyload"%s></span>',
|
212 |
-
arve_attr( arve_prefix_array_keys( 'data-', $a['iframe_attr'] ) )
|
213 |
-
);
|
214 |
-
} else {
|
215 |
-
$html = sprintf( '<iframe%s></iframe>', arve_attr( $a['iframe_attr'] ) );
|
216 |
-
}
|
217 |
-
|
218 |
-
return apply_filters( 'arve_iframe_tag', $html, $a, $a['iframe_attr'] );
|
219 |
-
}
|
220 |
-
|
221 |
-
function arve_create_video_tag( $a ) {
|
222 |
-
|
223 |
-
$html = sprintf(
|
224 |
-
'<video%s>%s%s</video>',
|
225 |
-
arve_attr( $a['video_attr'] ),
|
226 |
-
$a['video_sources_html'],
|
227 |
-
$a['video_tracks_html']
|
228 |
-
);
|
229 |
-
|
230 |
-
return apply_filters( 'arve_video_tag', $html, $a, $a['video_attr'] );
|
231 |
-
}
|
232 |
-
|
233 |
-
function arve_error( $message ) {
|
234 |
-
|
235 |
-
return sprintf(
|
236 |
-
'<p><strong>%s</strong> %s</p>',
|
237 |
-
__( '<abbr title="Advanced Responsive Video Embedder">ARVE</abbr> Error:', ARVE_SLUG ),
|
238 |
-
$message
|
239 |
-
);
|
240 |
-
}
|
241 |
-
|
242 |
-
function arve_output_errors( $atts ) {
|
243 |
-
|
244 |
-
$errors = '';
|
245 |
-
|
246 |
-
foreach ( $atts as $key => $value ) {
|
247 |
-
if ( is_wp_error( $value ) ) {
|
248 |
-
$errors .= arve_error( $value->get_error_message() );
|
249 |
-
}
|
250 |
-
}
|
251 |
-
|
252 |
-
return $errors;
|
253 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/functions-misc.php
DELETED
@@ -1,152 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_is_bool_option( $array ) {
|
4 |
-
|
5 |
-
$yes_no = array(
|
6 |
-
'' => 1,
|
7 |
-
'yes' => 1,
|
8 |
-
'no' => 1
|
9 |
-
);
|
10 |
-
|
11 |
-
$check = array_diff_key( $array, $yes_no );
|
12 |
-
|
13 |
-
if ( empty( $check ) ) {
|
14 |
-
return 'bool';
|
15 |
-
} else {
|
16 |
-
return $array;
|
17 |
-
}
|
18 |
-
}
|
19 |
-
|
20 |
-
function arve_get_pre_style() {
|
21 |
-
return '';
|
22 |
-
}
|
23 |
-
|
24 |
-
function arve_load_plugin_textdomain() {
|
25 |
-
|
26 |
-
load_plugin_textdomain(
|
27 |
-
ARVE_SLUG,
|
28 |
-
false,
|
29 |
-
dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
|
30 |
-
);
|
31 |
-
}
|
32 |
-
|
33 |
-
function arve_get_first_array_value( $array ) {
|
34 |
-
reset( $array );
|
35 |
-
$key = key( $array );
|
36 |
-
return $array[ $key ];
|
37 |
-
}
|
38 |
-
|
39 |
-
function arve_prefix_array_keys( $keyprefix, $array ) {
|
40 |
-
|
41 |
-
foreach ( $array as $key => $value ) {
|
42 |
-
$array[ $keyprefix . $key ] = $value;
|
43 |
-
unset( $array[ $key ] );
|
44 |
-
}
|
45 |
-
|
46 |
-
return $array;
|
47 |
-
}
|
48 |
-
|
49 |
-
function arve_check_filetype( $url, $ext ) {
|
50 |
-
|
51 |
-
$check = wp_check_filetype( $url, wp_get_mime_types() );
|
52 |
-
|
53 |
-
if ( strtolower( $check['ext'] ) === $ext ) {
|
54 |
-
return $check['type'];
|
55 |
-
} else {
|
56 |
-
return false;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Calculates seconds based on youtube times
|
62 |
-
*
|
63 |
-
* @param string $yttime The '1h25m13s' part of youtube URLs
|
64 |
-
*
|
65 |
-
* @return int Starttime in seconds
|
66 |
-
*/
|
67 |
-
function arve_youtube_time_to_seconds( $yttime ) {
|
68 |
-
|
69 |
-
$format = false;
|
70 |
-
$hours = 0;
|
71 |
-
$minutes = 0;
|
72 |
-
$seconds = 0;
|
73 |
-
|
74 |
-
$pattern['hms'] = '/([0-9]+)h([0-9]+)m([0-9]+)s/'; // hours, minutes, seconds
|
75 |
-
$pattern['ms'] = '/([0-9]+)m([0-9]+)s/'; // minutes, seconds
|
76 |
-
$pattern['h'] = '/([0-9]+)h/';
|
77 |
-
$pattern['m'] = '/([0-9]+)m/';
|
78 |
-
$pattern['s'] = '/([0-9]+)s/';
|
79 |
-
|
80 |
-
foreach ( $pattern as $key => $value ) {
|
81 |
-
|
82 |
-
preg_match( $value, $yttime, $result );
|
83 |
-
|
84 |
-
if ( ! empty( $result ) ) {
|
85 |
-
$format = $key;
|
86 |
-
break;
|
87 |
-
}
|
88 |
-
}
|
89 |
-
|
90 |
-
switch ( $format ) {
|
91 |
-
case 'hms':
|
92 |
-
$hours = $result[1];
|
93 |
-
$minutes = $result[2];
|
94 |
-
$seconds = $result[3];
|
95 |
-
break;
|
96 |
-
case 'ms':
|
97 |
-
$minutes = $result[1];
|
98 |
-
$seconds = $result[2];
|
99 |
-
break;
|
100 |
-
case 'h':
|
101 |
-
$hours = $result[1];
|
102 |
-
break;
|
103 |
-
case 'm':
|
104 |
-
$minutes = $result[1];
|
105 |
-
break;
|
106 |
-
case 's':
|
107 |
-
$seconds = $result[1];
|
108 |
-
break;
|
109 |
-
default:
|
110 |
-
return false;
|
111 |
-
}
|
112 |
-
|
113 |
-
return ( $hours * 60 * 60 ) + ( $minutes * 60 ) + $seconds;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Calculates padding percentage value for a particular aspect ratio
|
118 |
-
*
|
119 |
-
* @since 4.2.0
|
120 |
-
*
|
121 |
-
* @param string $aspect_ratio '4:3' or percentage value with percent sign
|
122 |
-
*
|
123 |
-
* @return float
|
124 |
-
*/
|
125 |
-
function arve_aspect_ratio_to_percentage( $aspect_ratio ) {
|
126 |
-
|
127 |
-
if ( is_wp_error( $aspect_ratio ) ) {
|
128 |
-
return 52.25;
|
129 |
-
}
|
130 |
-
|
131 |
-
$a = explode( ':', $aspect_ratio );
|
132 |
-
|
133 |
-
return ( ( $a[1] / $a[0] ) * 100 );
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* Calculates
|
138 |
-
*
|
139 |
-
* @since 8.2.0
|
140 |
-
*/
|
141 |
-
function arve_calculate_height( $width, $aspect_ratio ) {
|
142 |
-
|
143 |
-
$width = (int) $width;
|
144 |
-
$aspect_ratio = empty( $aspect_ratio ) ? '16:9' : $aspect_ratio;
|
145 |
-
$percent = arve_aspect_ratio_to_percentage( $aspect_ratio );
|
146 |
-
|
147 |
-
if ( $width > 100 && $percent ) {
|
148 |
-
return ( ( $width / 100 ) * $percent );
|
149 |
-
}
|
150 |
-
|
151 |
-
return false;
|
152 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/functions-shortcode-data.php
DELETED
@@ -1,298 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_get_default_aspect_ratio( $aspect_ratio, $provider ) {
|
4 |
-
$properties = arve_get_host_properties();
|
5 |
-
if ( empty( $aspect_ratio ) ) {
|
6 |
-
return $properties[ $provider ]['aspect_ratio'];
|
7 |
-
}
|
8 |
-
return $aspect_ratio;
|
9 |
-
}
|
10 |
-
|
11 |
-
function arve_get_html5_attributes() {
|
12 |
-
|
13 |
-
return array( 'mp4', 'm4v', 'webm', 'ogv', 'ogg', 'ogm' );
|
14 |
-
}
|
15 |
-
|
16 |
-
function arve_url_query_array( $url ) {
|
17 |
-
|
18 |
-
$url = wp_parse_url( $url );
|
19 |
-
|
20 |
-
if ( empty( $url['query'] ) ) {
|
21 |
-
return array();
|
22 |
-
}
|
23 |
-
|
24 |
-
parse_str( $url['query'], $url_params );
|
25 |
-
|
26 |
-
return $url_params;
|
27 |
-
}
|
28 |
-
|
29 |
-
function arve_build_iframe_src( $atts ) {
|
30 |
-
|
31 |
-
$id = $atts['id'];
|
32 |
-
$lang = $atts['lang'];
|
33 |
-
$provider = $atts['provider'];
|
34 |
-
$options = arve_get_options();
|
35 |
-
$properties = arve_get_host_properties();
|
36 |
-
|
37 |
-
if ( $options['youtube_nocookie'] ) {
|
38 |
-
$properties['youtube']['embed_url'] = 'https://www.youtube-nocookie.com/embed/%s';
|
39 |
-
$properties['youtubelist']['embed_url'] = 'https://www.youtube-nocookie.com/embed/videoseries?list=%s';
|
40 |
-
}
|
41 |
-
|
42 |
-
if ( isset( $properties[ $provider ]['embed_url'] ) ) {
|
43 |
-
$pattern = $properties[ $provider ]['embed_url'];
|
44 |
-
} else {
|
45 |
-
$pattern = '%s';
|
46 |
-
}
|
47 |
-
|
48 |
-
if ( 'facebook' === $provider && is_numeric( $id ) ) {
|
49 |
-
|
50 |
-
$id = "https://www.facebook.com/facebook/videos/$id/";
|
51 |
-
|
52 |
-
} elseif ( 'twitch' === $provider && is_numeric( $id ) ) {
|
53 |
-
|
54 |
-
$pattern = 'https://player.twitch.tv/?video=v%s';
|
55 |
-
|
56 |
-
} elseif ( 'ted' === $provider && preg_match( '/^[a-z]{2}$/', $lang ) === 1 ) {
|
57 |
-
|
58 |
-
$pattern = 'https://embed-ssl.ted.com/talks/lang/' . $lang . '/%s.html';
|
59 |
-
}
|
60 |
-
|
61 |
-
if ( isset( $properties[ $provider ]['url_encode_id'] ) && $properties[ $provider ]['url_encode_id'] ) {
|
62 |
-
$id = rawurlencode( $id );
|
63 |
-
}
|
64 |
-
|
65 |
-
if ( 'brightcove' === $provider ) {
|
66 |
-
$src = sprintf( $pattern, $atts['brightcove_account'], $atts['brightcove_player'], $atts['brightcove_embed'], $id );
|
67 |
-
} else {
|
68 |
-
$src = sprintf( $pattern, $id );
|
69 |
-
}
|
70 |
-
|
71 |
-
return $src;
|
72 |
-
}
|
73 |
-
|
74 |
-
function arve_id_fixes( $id, $provider ) {
|
75 |
-
|
76 |
-
if (
|
77 |
-
'liveleak' === $provider &&
|
78 |
-
! arve_starts_with( $id, 'i=' ) &&
|
79 |
-
! arve_starts_with( $id, 'f=' )
|
80 |
-
) {
|
81 |
-
$id = 'i=' . $id;
|
82 |
-
}
|
83 |
-
|
84 |
-
return $id;
|
85 |
-
}
|
86 |
-
|
87 |
-
function arve_aspect_ratio_fixes( $aspect_ratio, $provider, $mode ) {
|
88 |
-
|
89 |
-
if ( 'dailymotionlist' === $provider ) {
|
90 |
-
switch ( $mode ) {
|
91 |
-
case 'normal':
|
92 |
-
case 'lazyload':
|
93 |
-
$aspect_ratio = '640:370';
|
94 |
-
break;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
return $aspect_ratio;
|
99 |
-
}
|
100 |
-
|
101 |
-
function arve_add_autoplay_query_arg( $src, $a ) {
|
102 |
-
|
103 |
-
switch ( $a['provider'] ) {
|
104 |
-
case 'alugha':
|
105 |
-
case 'archiveorg':
|
106 |
-
case 'dailymotion':
|
107 |
-
case 'dailymotionlist':
|
108 |
-
case 'facebook':
|
109 |
-
case 'vevo':
|
110 |
-
case 'viddler':
|
111 |
-
case 'vimeo':
|
112 |
-
case 'youtube':
|
113 |
-
case 'youtubelist':
|
114 |
-
$on = add_query_arg( 'autoplay', 1, $src );
|
115 |
-
$off = add_query_arg( 'autoplay', 0, $src );
|
116 |
-
break;
|
117 |
-
case 'twitch':
|
118 |
-
case 'ustream':
|
119 |
-
$on = add_query_arg( 'autoplay', 'true', $src );
|
120 |
-
$off = add_query_arg( 'autoplay', 'false', $src );
|
121 |
-
break;
|
122 |
-
case 'livestream':
|
123 |
-
case 'wistia':
|
124 |
-
$on = add_query_arg( 'autoPlay', 'true', $src );
|
125 |
-
$off = add_query_arg( 'autoPlay', 'false', $src );
|
126 |
-
break;
|
127 |
-
case 'metacafe':
|
128 |
-
$on = add_query_arg( 'ap', 1, $src );
|
129 |
-
$off = remove_query_arg( 'ap', $src );
|
130 |
-
break;
|
131 |
-
case 'videojug':
|
132 |
-
$on = add_query_arg( 'ap', 1, $src );
|
133 |
-
$off = add_query_arg( 'ap', 0, $src );
|
134 |
-
break;
|
135 |
-
case 'veoh':
|
136 |
-
$on = add_query_arg( 'videoAutoPlay', 1, $src );
|
137 |
-
$off = add_query_arg( 'videoAutoPlay', 0, $src );
|
138 |
-
break;
|
139 |
-
case 'brightcove':
|
140 |
-
case 'snotr':
|
141 |
-
$on = add_query_arg( 'autoplay', 1, $src );
|
142 |
-
$off = remove_query_arg( 'autoplay', $src );
|
143 |
-
break;
|
144 |
-
case 'yahoo':
|
145 |
-
$on = add_query_arg( 'player_autoplay', 'true', $src );
|
146 |
-
$off = add_query_arg( 'player_autoplay', 'false', $src );
|
147 |
-
break;
|
148 |
-
default:
|
149 |
-
# Do nothing for providers that to not support autoplay or fail with parameters
|
150 |
-
$on = $src;
|
151 |
-
$off = $src;
|
152 |
-
break;
|
153 |
-
}
|
154 |
-
|
155 |
-
if ( $a['autoplay'] ) {
|
156 |
-
return $on;
|
157 |
-
} else {
|
158 |
-
return $off;
|
159 |
-
}
|
160 |
-
}
|
161 |
-
|
162 |
-
function arve_add_query_args_to_iframe_src( $src, $atts ) {
|
163 |
-
|
164 |
-
$options = arve_get_options();
|
165 |
-
|
166 |
-
$host = $atts['provider'];
|
167 |
-
|
168 |
-
$parameters = wp_parse_args( preg_replace( '!\s+!', '&', trim( $atts['parameters'] ) ) );
|
169 |
-
$option_parameters = array();
|
170 |
-
|
171 |
-
if ( isset( $options['params'][ $host ] ) ) {
|
172 |
-
$option_parameters = wp_parse_args( preg_replace( '!\s+!', '&', trim( $options['params'][ $host ] ) ) );
|
173 |
-
}
|
174 |
-
|
175 |
-
$parameters = wp_parse_args( $parameters, $option_parameters );
|
176 |
-
|
177 |
-
return add_query_arg( $parameters, $src );
|
178 |
-
}
|
179 |
-
|
180 |
-
function arve_maxwidth_when_aligned( $maxwidth, $align ) {
|
181 |
-
|
182 |
-
$options = arve_get_options();
|
183 |
-
|
184 |
-
if ( $maxwidth < 100 && in_array( $align, array( 'left', 'right', 'center' ), true ) ) {
|
185 |
-
$maxwidth = (int) $options['align_maxwidth'];
|
186 |
-
}
|
187 |
-
|
188 |
-
return $maxwidth;
|
189 |
-
}
|
190 |
-
|
191 |
-
function arve_get_language_name_from_code( $lang_code ) {
|
192 |
-
// This list is based on languages available from localize.drupal.org. See
|
193 |
-
// http://localize.drupal.org/issues for information on how to add languages
|
194 |
-
// there.
|
195 |
-
//
|
196 |
-
// The "Left-to-right marker" comments and the enclosed UTF-8 markers are to
|
197 |
-
// make otherwise strange looking PHP syntax natural (to not be displayed in
|
198 |
-
// right to left). See https://www.drupal.org/node/128866#comment-528929.
|
199 |
-
$lang = array(
|
200 |
-
'af' => array( 'Afrikaans', 'Afrikaans' ),
|
201 |
-
'am' => array( 'Amharic', 'አማርኛ' ),
|
202 |
-
'ar' => array( 'Arabic', /* Left-to-right marker "" */ 'العربية', 'RTL' ),
|
203 |
-
'ast' => array( 'Asturian', 'Asturianu' ),
|
204 |
-
'az' => array( 'Azerbaijani', 'Azərbaycanca' ),
|
205 |
-
'be' => array( 'Belarusian', 'Беларуская' ),
|
206 |
-
'bg' => array( 'Bulgarian', 'Български' ),
|
207 |
-
'bn' => array( 'Bengali', 'বাংলা' ),
|
208 |
-
'bo' => array( 'Tibetan', 'བོད་སྐད་' ),
|
209 |
-
'bs' => array( 'Bosnian', 'Bosanski' ),
|
210 |
-
'ca' => array( 'Catalan', 'Català' ),
|
211 |
-
'cs' => array( 'Czech', 'Čeština' ),
|
212 |
-
'cy' => array( 'Welsh', 'Cymraeg' ),
|
213 |
-
'da' => array( 'Danish', 'Dansk' ),
|
214 |
-
'de' => array( 'German', 'Deutsch' ),
|
215 |
-
'dz' => array( 'Dzongkha', 'རྫོང་ཁ' ),
|
216 |
-
'el' => array( 'Greek', 'Ελληνικά' ),
|
217 |
-
'en' => array( 'English', 'English' ),
|
218 |
-
'en-x-simple' => array( 'Simple English', 'Simple English' ),
|
219 |
-
'eo' => array( 'Esperanto', 'Esperanto' ),
|
220 |
-
'es' => array( 'Spanish', 'Español' ),
|
221 |
-
'et' => array( 'Estonian', 'Eesti' ),
|
222 |
-
'eu' => array( 'Basque', 'Euskera' ),
|
223 |
-
'fa' => array( 'Persian, Farsi', /* Left-to-right marker "" */ 'فارسی', 'RTL' ),
|
224 |
-
'fi' => array( 'Finnish', 'Suomi' ),
|
225 |
-
'fil' => array( 'Filipino', 'Filipino' ),
|
226 |
-
'fo' => array( 'Faeroese', 'Føroyskt' ),
|
227 |
-
'fr' => array( 'French', 'Français' ),
|
228 |
-
'fy' => array( 'Frisian, Western', 'Frysk' ),
|
229 |
-
'ga' => array( 'Irish', 'Gaeilge' ),
|
230 |
-
'gd' => array( 'Scots Gaelic', 'Gàidhlig' ),
|
231 |
-
'gl' => array( 'Galician', 'Galego' ),
|
232 |
-
'gsw-berne' => array( 'Swiss German', 'Schwyzerdütsch' ),
|
233 |
-
'gu' => array( 'Gujarati', 'ગુજરાતી' ),
|
234 |
-
'he' => array( 'Hebrew', /* Left-to-right marker "" */ 'עברית', 'RTL' ),
|
235 |
-
'hi' => array( 'Hindi', 'हिन्दी' ),
|
236 |
-
'hr' => array( 'Croatian', 'Hrvatski' ),
|
237 |
-
'ht' => array( 'Haitian Creole', 'Kreyòl ayisyen' ),
|
238 |
-
'hu' => array( 'Hungarian', 'Magyar' ),
|
239 |
-
'hy' => array( 'Armenian', 'Հայերեն' ),
|
240 |
-
'id' => array( 'Indonesian', 'Bahasa Indonesia' ),
|
241 |
-
'is' => array( 'Icelandic', 'Íslenska' ),
|
242 |
-
'it' => array( 'Italian', 'Italiano' ),
|
243 |
-
'ja' => array( 'Japanese', '日本語' ),
|
244 |
-
'jv' => array( 'Javanese', 'Basa Java' ),
|
245 |
-
'ka' => array( 'Georgian', 'ქართული ენა' ),
|
246 |
-
'kk' => array( 'Kazakh', 'Қазақ' ),
|
247 |
-
'km' => array( 'Khmer', 'ភាសាខ្មែរ' ),
|
248 |
-
'kn' => array( 'Kannada', 'ಕನ್ನಡ' ),
|
249 |
-
'ko' => array( 'Korean', '한국어' ),
|
250 |
-
'ku' => array( 'Kurdish', 'Kurdî' ),
|
251 |
-
'ky' => array( 'Kyrgyz', 'Кыргызча' ),
|
252 |
-
'lo' => array( 'Lao', 'ພາສາລາວ' ),
|
253 |
-
'lt' => array( 'Lithuanian', 'Lietuvių' ),
|
254 |
-
'lv' => array( 'Latvian', 'Latviešu' ),
|
255 |
-
'mg' => array( 'Malagasy', 'Malagasy' ),
|
256 |
-
'mk' => array( 'Macedonian', 'Македонски' ),
|
257 |
-
'ml' => array( 'Malayalam', 'മലയാളം' ),
|
258 |
-
'mn' => array( 'Mongolian', 'монгол' ),
|
259 |
-
'mr' => array( 'Marathi', 'मराठी' ),
|
260 |
-
'ms' => array( 'Bahasa Malaysia', 'بهاس ملايو' ),
|
261 |
-
'my' => array( 'Burmese', 'ဗမာစကား' ),
|
262 |
-
'ne' => array( 'Nepali', 'नेपाली' ),
|
263 |
-
'nl' => array( 'Dutch', 'Nederlands' ),
|
264 |
-
'nb' => array( 'Norwegian Bokmål', 'Norsk, bokmål' ),
|
265 |
-
'nn' => array( 'Norwegian Nynorsk', 'Norsk, nynorsk' ),
|
266 |
-
'oc' => array( 'Occitan', 'Occitan' ),
|
267 |
-
'pa' => array( 'Punjabi', 'ਪੰਜਾਬੀ' ),
|
268 |
-
'pl' => array( 'Polish', 'Polski' ),
|
269 |
-
'pt-pt' => array( 'Portuguese, Portugal', 'Português, Portugal' ),
|
270 |
-
'pt-br' => array( 'Portuguese, Brazil', 'Português, Brasil' ),
|
271 |
-
'ro' => array( 'Romanian', 'Română' ),
|
272 |
-
'ru' => array( 'Russian', 'Русский' ),
|
273 |
-
'sco' => array( 'Scots', 'Scots' ),
|
274 |
-
'se' => array( 'Northern Sami', 'Sámi' ),
|
275 |
-
'si' => array( 'Sinhala', 'සිංහල' ),
|
276 |
-
'sk' => array( 'Slovak', 'Slovenčina' ),
|
277 |
-
'sl' => array( 'Slovenian', 'Slovenščina' ),
|
278 |
-
'sq' => array( 'Albanian', 'Shqip' ),
|
279 |
-
'sr' => array( 'Serbian', 'Српски' ),
|
280 |
-
'sv' => array( 'Swedish', 'Svenska' ),
|
281 |
-
'sw' => array( 'Swahili', 'Kiswahili' ),
|
282 |
-
'ta' => array( 'Tamil', 'தமிழ்' ),
|
283 |
-
'ta-lk' => array( 'Tamil, Sri Lanka', 'தமிழ், இலங்கை' ),
|
284 |
-
'te' => array( 'Telugu', 'తెలుగు' ),
|
285 |
-
'th' => array( 'Thai', 'ภาษาไทย' ),
|
286 |
-
'tr' => array( 'Turkish', 'Türkçe' ),
|
287 |
-
'tyv' => array( 'Tuvan', 'Тыва дыл' ),
|
288 |
-
'ug' => array( 'Uyghur', 'Уйғур' ),
|
289 |
-
'uk' => array( 'Ukrainian', 'Українська' ),
|
290 |
-
'ur' => array( 'Urdu', /* Left-to-right marker "" */ 'اردو', 'RTL' ),
|
291 |
-
'vi' => array( 'Vietnamese', 'Tiếng Việt' ),
|
292 |
-
'xx-lolspeak' => array( 'Lolspeak', 'Lolspeak' ),
|
293 |
-
'zh-hans' => array( 'Chinese, Simplified', '简体中文' ),
|
294 |
-
'zh-hant' => array( 'Chinese, Traditional', '繁體中文' ),
|
295 |
-
);
|
296 |
-
|
297 |
-
return $lang[ $lang_code ][1];
|
298 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/functions-shortcode-filters.php
DELETED
@@ -1,437 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_load_vimeo_api( $a ) {
|
4 |
-
|
5 |
-
require_once ARVE_PATH . '/vendor/autoload.php';
|
6 |
-
|
7 |
-
return $a;
|
8 |
-
}
|
9 |
-
|
10 |
-
function arve_get_wrapper_id( $a ) {
|
11 |
-
|
12 |
-
static $wrapper_ids = array();
|
13 |
-
$wrapper_id = null;
|
14 |
-
|
15 |
-
foreach ( array( 'id', 'mp4', 'm4v', 'webm', 'ogv', 'url', 'random_video_url', 'webtorrent' ) as $att ) {
|
16 |
-
|
17 |
-
if ( ! empty( $a[ $att ] ) && is_string( $a[ $att ] ) ) {
|
18 |
-
$wrapper_id = 'arve-' . $a[ $att ];
|
19 |
-
$wrapper_id = preg_replace( '/[^a-zA-Z0-9-]/', '', $wrapper_id );
|
20 |
-
break;
|
21 |
-
}
|
22 |
-
}
|
23 |
-
|
24 |
-
if ( empty( $wrapper_id ) ) {
|
25 |
-
return null;
|
26 |
-
} else {
|
27 |
-
$wrapper_ids[] = $wrapper_id;
|
28 |
-
}
|
29 |
-
|
30 |
-
if ( in_array( $wrapper_id, $wrapper_ids, true ) ) {
|
31 |
-
$id_counts = array_count_values( $wrapper_ids );
|
32 |
-
$id_count = $id_counts[ $wrapper_id ];
|
33 |
-
|
34 |
-
if ( $id_count >= 2 ) {
|
35 |
-
$wrapper_id .= '-' . $id_count;
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
return $wrapper_id;
|
40 |
-
}
|
41 |
-
|
42 |
-
function arve_sc_filter_attr( $a ) {
|
43 |
-
|
44 |
-
$wrapper_id = arve_get_wrapper_id( $a );
|
45 |
-
|
46 |
-
if ( empty( $wrapper_id ) ) {
|
47 |
-
$a['wrapper_id_error'] = new WP_Error( 'wrapper_id', __( 'Wrapper ID could not be build, please report this bug.', ARVE_SLUG ) );
|
48 |
-
}
|
49 |
-
|
50 |
-
$align_class = empty( $a['align'] ) ? '' : ' align' . $a['align'];
|
51 |
-
|
52 |
-
$a['wrapper_attr'] = array(
|
53 |
-
'class' => "arve-wrapper$align_class",
|
54 |
-
'data-mode' => $a['mode'],
|
55 |
-
'data-provider' => $a['provider'],
|
56 |
-
'id' => $wrapper_id,
|
57 |
-
'style' => empty( $a['maxwidth'] ) ? false : sprintf( 'max-width:%dpx;', $a['maxwidth'] ),
|
58 |
-
// Schema.org
|
59 |
-
'itemscope' => '',
|
60 |
-
'itemtype' => 'http://schema.org/VideoObject',
|
61 |
-
);
|
62 |
-
|
63 |
-
if ( 'html5' === $a['provider'] ) {
|
64 |
-
|
65 |
-
$autoplay = in_array( $a['mode'], array( 'lazyload', 'lazyload-lightbox', 'link-lightbox' ), true ) ? false : $a['autoplay'];
|
66 |
-
|
67 |
-
$a['video_attr'] = array(
|
68 |
-
# WP
|
69 |
-
'autoplay' => $autoplay,
|
70 |
-
'controls' => $a['controls'],
|
71 |
-
'controlslist' => $a['controlslist'],
|
72 |
-
'loop' => $a['loop'],
|
73 |
-
'preload' => $a['preload'],
|
74 |
-
'width' => empty( $a['width'] ) ? false : $a['width'],
|
75 |
-
'height' => empty( $a['height'] ) ? false : $a['height'],
|
76 |
-
'poster' => empty( $a['img_src'] ) ? false : $a['img_src'],
|
77 |
-
'src' => empty( $a['video_src'] ) ? false : $a['video_src'],
|
78 |
-
# ARVE only
|
79 |
-
'class' => 'arve-video fitvidsignore',
|
80 |
-
'muted' => $autoplay ? 'automuted' : $a['muted'],
|
81 |
-
'playsinline' => $a['playsinline'],
|
82 |
-
'webkit-playsinline' => $a['playsinline'],
|
83 |
-
);
|
84 |
-
|
85 |
-
} else {
|
86 |
-
|
87 |
-
$properties = arve_get_host_properties();
|
88 |
-
$options = arve_get_options();
|
89 |
-
$iframe_src = arve_build_iframe_src( $a );
|
90 |
-
$iframe_src = arve_add_query_args_to_iframe_src( $iframe_src, $a );
|
91 |
-
$iframe_src = arve_add_autoplay_query_arg( $iframe_src, $a );
|
92 |
-
|
93 |
-
if ( 'vimeo' === $a['provider'] && ! empty( $a['start'] ) ) {
|
94 |
-
$iframe_src .= '#t=' . (int) $a['start'];
|
95 |
-
}
|
96 |
-
|
97 |
-
$a['iframe_attr'] = array(
|
98 |
-
'allow' => 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture',
|
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 allow-popups-to-escape-sandbox',
|
104 |
-
'scrolling' => 'no',
|
105 |
-
'src' => $iframe_src,
|
106 |
-
'width' => empty( $a['width'] ) ? false : $a['width'],
|
107 |
-
'height' => empty( $a['height'] ) ? false : $a['height'],
|
108 |
-
);
|
109 |
-
|
110 |
-
if ( 'vimeo' === $a['provider'] ) {
|
111 |
-
$a['iframe_attr']['sandbox'] .= ' allow-forms';
|
112 |
-
}
|
113 |
-
|
114 |
-
if ( false === $a['sandbox'] ) {
|
115 |
-
$a['iframe_attr']['sandbox'] = false;
|
116 |
-
}
|
117 |
-
}
|
118 |
-
|
119 |
-
return $a;
|
120 |
-
}
|
121 |
-
|
122 |
-
function arve_sc_filter_validate( $a ) {
|
123 |
-
|
124 |
-
$a['align'] = arve_validate_align( $a['align'], $a['provider'] );
|
125 |
-
|
126 |
-
$a['mode'] = arve_validate_mode( $a['mode'], $a['provider'] );
|
127 |
-
|
128 |
-
$a['autoplay'] = arve_validate_bool( $a['autoplay'], 'autoplay' );
|
129 |
-
$a['arve_link'] = arve_validate_bool( $a['arve_link'], 'arve_link' );
|
130 |
-
$a['loop'] = arve_validate_bool( $a['loop'], 'loop' );
|
131 |
-
$a['controls'] = arve_validate_bool( $a['controls'], 'controls' );
|
132 |
-
$a['sandbox'] = arve_validate_bool( $a['sandbox'], 'sandbox' );
|
133 |
-
$a['muted'] = arve_validate_bool( $a['muted'], 'muted' );
|
134 |
-
$a['playsinline'] = arve_validate_bool( $a['playsinline'], 'playsinline' );
|
135 |
-
|
136 |
-
$a['maxwidth'] = (int) $a['maxwidth'];
|
137 |
-
$a['maxwidth'] = (int) arve_maxwidth_when_aligned( $a['maxwidth'], $a['align'] );
|
138 |
-
|
139 |
-
$a['id'] = arve_id_fixes( $a['id'], $a['provider'] );
|
140 |
-
|
141 |
-
$a['aspect_ratio'] = arve_get_default_aspect_ratio( $a['aspect_ratio'], $a['provider'] );
|
142 |
-
$a['aspect_ratio'] = arve_aspect_ratio_fixes( $a['aspect_ratio'], $a['provider'], $a['mode'] );
|
143 |
-
$a['aspect_ratio'] = arve_validate_aspect_ratio( $a['aspect_ratio'] );
|
144 |
-
|
145 |
-
return $a;
|
146 |
-
}
|
147 |
-
|
148 |
-
function arve_sc_filter_set_fixed_dimensions( $a ) {
|
149 |
-
|
150 |
-
$width = 480;
|
151 |
-
|
152 |
-
$a['width'] = $width;
|
153 |
-
$a['height'] = arve_calculate_height( $width, $a['aspect_ratio'] );
|
154 |
-
|
155 |
-
return $a;
|
156 |
-
}
|
157 |
-
|
158 |
-
function arve_sc_filter_sanitise( $atts ) {
|
159 |
-
|
160 |
-
if ( ! empty( $atts['src'] ) ) {
|
161 |
-
$atts['url'] = $atts['src'];
|
162 |
-
}
|
163 |
-
|
164 |
-
foreach ( $atts as $key => $value ) {
|
165 |
-
|
166 |
-
$atts[ $key ] = (string) $value;
|
167 |
-
|
168 |
-
if ( '' === $value ) {
|
169 |
-
$atts[ $key ] = null;
|
170 |
-
}
|
171 |
-
}
|
172 |
-
|
173 |
-
return $atts;
|
174 |
-
}
|
175 |
-
|
176 |
-
function arve_sc_filter_missing_attribute_check( $atts ) {
|
177 |
-
|
178 |
-
# Old shortcodes
|
179 |
-
if ( ! array_key_exists( 'url', $atts ) ) {
|
180 |
-
return $atts;
|
181 |
-
}
|
182 |
-
|
183 |
-
$required_attributes = arve_get_html5_attributes();
|
184 |
-
$required_attributes[] = 'url';
|
185 |
-
|
186 |
-
$array = array_intersect_key( $atts, array_flip( $required_attributes ) );
|
187 |
-
|
188 |
-
if ( count( array_filter( $array ) ) !== count( $array ) ) {
|
189 |
-
|
190 |
-
$atts['missing_atts_error'] = arve_error(
|
191 |
-
sprintf(
|
192 |
-
esc_html__( 'The [arve] shortcode needs one of this attributes %s', ARVE_SLUG ),
|
193 |
-
implode( $required_attributes )
|
194 |
-
)
|
195 |
-
);
|
196 |
-
}
|
197 |
-
|
198 |
-
return $atts;
|
199 |
-
}
|
200 |
-
|
201 |
-
function arve_sc_filter_get_media_gallery_thumbnail( $atts ) {
|
202 |
-
|
203 |
-
if ( empty( $atts['thumbnail'] ) ) {
|
204 |
-
return $atts;
|
205 |
-
}
|
206 |
-
|
207 |
-
if ( is_numeric( $atts['thumbnail'] ) ) {
|
208 |
-
|
209 |
-
$attchment_id = $atts['thumbnail'];
|
210 |
-
|
211 |
-
$atts['img_src'] = arve_get_attachment_image_url_or_srcset( 'url', $attchment_id );
|
212 |
-
$atts['img_srcset'] = arve_get_attachment_image_url_or_srcset( 'srcset', $attchment_id );
|
213 |
-
|
214 |
-
} elseif ( arve_validate_url( $atts['thumbnail'] ) ) {
|
215 |
-
|
216 |
-
$atts['img_src'] = $atts['thumbnail'];
|
217 |
-
|
218 |
-
} else {
|
219 |
-
|
220 |
-
$atts['img_src'] = new WP_Error( 'thumbnail', __( 'Not a valid thumbnail URL or Media ID given', ARVE_SLUG ) );
|
221 |
-
}
|
222 |
-
|
223 |
-
return $atts;
|
224 |
-
}
|
225 |
-
|
226 |
-
function arve_sc_filter_get_media_gallery_video( $atts ) {
|
227 |
-
|
228 |
-
$html5_ext = arve_get_html5_attributes();
|
229 |
-
|
230 |
-
foreach ( $html5_ext as $ext ) {
|
231 |
-
|
232 |
-
if ( ! empty( $atts[ $ext ] ) && is_numeric( $atts[ $ext ] ) ) {
|
233 |
-
$atts[ $ext ] = wp_get_attachment_url( $atts[ $ext ] );
|
234 |
-
}
|
235 |
-
}
|
236 |
-
|
237 |
-
return $atts;
|
238 |
-
}
|
239 |
-
|
240 |
-
function arve_sc_filter_detect_provider_and_id_from_url( $atts ) {
|
241 |
-
|
242 |
-
$properties = arve_get_host_properties();
|
243 |
-
|
244 |
-
if ( ! empty( $atts['provider'] ) || empty( $atts['url'] ) ) {
|
245 |
-
return $atts;
|
246 |
-
}
|
247 |
-
|
248 |
-
foreach ( $properties as $host_id => $host ) :
|
249 |
-
|
250 |
-
if ( empty( $host['regex'] ) ) {
|
251 |
-
continue;
|
252 |
-
}
|
253 |
-
|
254 |
-
$preg_match = preg_match( '#' . $host['regex'] . '#i', $atts['url'], $matches );
|
255 |
-
|
256 |
-
if ( 1 !== $preg_match ) {
|
257 |
-
continue;
|
258 |
-
}
|
259 |
-
|
260 |
-
foreach ( $matches as $key => $value ) {
|
261 |
-
|
262 |
-
if ( is_string( $key ) ) {
|
263 |
-
$atts['provider'] = $host_id;
|
264 |
-
$atts[ $key ] = $matches[ $key ];
|
265 |
-
}
|
266 |
-
}
|
267 |
-
|
268 |
-
endforeach;
|
269 |
-
|
270 |
-
return $atts;
|
271 |
-
}
|
272 |
-
|
273 |
-
function arve_sc_filter_detect_query_args( $atts ) {
|
274 |
-
|
275 |
-
if ( empty( $atts['url'] ) ) {
|
276 |
-
return $atts;
|
277 |
-
}
|
278 |
-
|
279 |
-
$to_extract = array(
|
280 |
-
'brightcove' => array( 'videoId', 'something' ),
|
281 |
-
);
|
282 |
-
|
283 |
-
foreach ( $to_extract as $provider => $parameters ) {
|
284 |
-
|
285 |
-
if ( $provider !== $atts['provider'] ) {
|
286 |
-
return $atts;
|
287 |
-
}
|
288 |
-
|
289 |
-
$query_array = arve_url_query_array( $atts['url'] );
|
290 |
-
|
291 |
-
foreach ( $parameters as $key => $parameter ) {
|
292 |
-
|
293 |
-
$att_name = $atts['provider'] . "_$parameter";
|
294 |
-
|
295 |
-
if ( empty( $query_array[ $parameter ] ) ) {
|
296 |
-
$atts[ $att_name ] = new WP_Error( $att_name, "$parameter not found in URL" );
|
297 |
-
} else {
|
298 |
-
$atts[ $att_name ] = $query_array[ $parameter ];
|
299 |
-
}
|
300 |
-
}
|
301 |
-
}
|
302 |
-
|
303 |
-
return $atts;
|
304 |
-
}
|
305 |
-
|
306 |
-
function arve_sc_filter_detect_youtube_playlist( $atts ) {
|
307 |
-
|
308 |
-
if (
|
309 |
-
'youtube' !== $atts['provider'] ||
|
310 |
-
( empty( $atts['url'] ) && empty( $atts['id'] ) )
|
311 |
-
) {
|
312 |
-
return $atts;
|
313 |
-
}
|
314 |
-
|
315 |
-
if ( empty( $atts['url'] ) ) {
|
316 |
-
# Not a url but it will work
|
317 |
-
$url = str_replace( array( '&list=', '&list=' ), '?list=', $atts['id'] );
|
318 |
-
} else {
|
319 |
-
$url = $atts['url'];
|
320 |
-
}
|
321 |
-
|
322 |
-
$query_array = arve_url_query_array( $url );
|
323 |
-
|
324 |
-
if ( empty( $query_array['list'] ) ) {
|
325 |
-
return $atts;
|
326 |
-
}
|
327 |
-
|
328 |
-
$atts['id'] = strtok( $atts['id'], '?' );
|
329 |
-
$atts['id'] = strtok( $atts['id'], '&' );
|
330 |
-
|
331 |
-
$atts['youtube_playlist_id'] = $query_array['list'];
|
332 |
-
$atts['parameters'] .= 'list=' . $query_array['list'];
|
333 |
-
|
334 |
-
return $atts;
|
335 |
-
}
|
336 |
-
|
337 |
-
function arve_get_video_type( $ext ) {
|
338 |
-
|
339 |
-
switch ( $ext ) {
|
340 |
-
case 'ogv':
|
341 |
-
case 'ogm':
|
342 |
-
return 'video/ogg';
|
343 |
-
default:
|
344 |
-
return 'video/' . $ext;
|
345 |
-
}
|
346 |
-
}
|
347 |
-
|
348 |
-
function arve_sc_filter_detect_html5( $atts ) {
|
349 |
-
|
350 |
-
if ( ! empty( $atts['provider'] ) && 'html5' !== $atts['provider'] ) {
|
351 |
-
return $atts;
|
352 |
-
}
|
353 |
-
|
354 |
-
$html5_extensions = arve_get_html5_attributes();
|
355 |
-
$atts['video_sources_html'] = '';
|
356 |
-
|
357 |
-
foreach ( $html5_extensions as $ext ) :
|
358 |
-
|
359 |
-
if ( ! empty( $atts[ $ext ] ) ) {
|
360 |
-
|
361 |
-
if ( arve_starts_with( $atts[ $ext ], 'https://www.dropbox.com' ) ) {
|
362 |
-
$atts[ $ext ] = add_query_arg( 'dl', 1, $atts[ $ext ] );
|
363 |
-
}
|
364 |
-
|
365 |
-
$atts['video_sources_html'] .= sprintf( '<source type="%s" src="%s">', arve_get_video_type( $ext ), $atts[ $ext ] );
|
366 |
-
}
|
367 |
-
|
368 |
-
if ( ! empty( $atts['url'] ) && arve_ends_with( $atts['url'], ".$ext" ) ) {
|
369 |
-
|
370 |
-
if ( arve_starts_with( $atts['url'], 'https://www.dropbox.com' ) ) {
|
371 |
-
$atts['url'] = add_query_arg( 'dl', 1, $atts['url'] );
|
372 |
-
}
|
373 |
-
|
374 |
-
$atts['video_src'] = $atts['url'];
|
375 |
-
}
|
376 |
-
|
377 |
-
endforeach;
|
378 |
-
|
379 |
-
if ( empty( $atts['video_src'] ) && empty( $atts['video_sources_html'] ) ) {
|
380 |
-
return $atts;
|
381 |
-
}
|
382 |
-
|
383 |
-
$atts['provider'] = 'html5';
|
384 |
-
|
385 |
-
return $atts;
|
386 |
-
}
|
387 |
-
|
388 |
-
function arve_sc_filter_iframe_fallback( $atts ) {
|
389 |
-
|
390 |
-
if ( empty( $atts['provider'] ) ) {
|
391 |
-
|
392 |
-
$atts['provider'] = 'iframe';
|
393 |
-
|
394 |
-
if ( empty( $atts['id'] ) && ! empty( $atts['url'] ) ) {
|
395 |
-
$atts['id'] = $atts['url'];
|
396 |
-
}
|
397 |
-
}
|
398 |
-
|
399 |
-
return $atts;
|
400 |
-
}
|
401 |
-
|
402 |
-
function arve_sc_filter_build_tracks_html( $atts ) {
|
403 |
-
|
404 |
-
if ( 'html5' !== $atts['provider'] ) {
|
405 |
-
return $atts;
|
406 |
-
}
|
407 |
-
|
408 |
-
$atts['video_tracks_html'] = '';
|
409 |
-
|
410 |
-
for ( $n = 1; $n <= ARVE_NUM_TRACKS; $n++ ) {
|
411 |
-
|
412 |
-
if ( empty( $atts[ "track_{$n}" ] ) ) {
|
413 |
-
return $atts;
|
414 |
-
}
|
415 |
-
|
416 |
-
preg_match( '#-(?<type>captions|chapters|descriptions|metadata|subtitles)-(?<lang>[a-z]{2}).vtt$#i', $atts[ "track_{$n}" ], $matches );
|
417 |
-
|
418 |
-
if ( empty( $matches[1] ) ) {
|
419 |
-
$atts[ "track_{$n}" ] = new WP_Error( 'track', __( 'Track kind or language code could not detected from filename', ARVE_SLUG ) );
|
420 |
-
return $atts;
|
421 |
-
}
|
422 |
-
|
423 |
-
$label = empty( $atts[ "track_{$n}_label" ] ) ? arve_get_language_name_from_code( $matches['lang'] ) : $atts[ "track_{$n}_label" ];
|
424 |
-
|
425 |
-
$attr = array(
|
426 |
-
'default' => ( 1 === $n ) ? true : false,
|
427 |
-
'kind' => $matches['type'],
|
428 |
-
'label' => $label,
|
429 |
-
'src' => $atts[ "track_{$n}" ],
|
430 |
-
'srclang' => $matches['lang'],
|
431 |
-
);
|
432 |
-
|
433 |
-
$atts['video_tracks_html'] .= sprintf( '<track%s>', arve_attr( $attr ) );
|
434 |
-
}
|
435 |
-
|
436 |
-
return $atts;
|
437 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/functions-shortcodes.php
DELETED
@@ -1,286 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_shortcode( $a, $content = null ) {
|
4 |
-
|
5 |
-
$a = (array) $a;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Filters the default arve shortcode output.
|
9 |
-
*
|
10 |
-
* If the filtered output isn't empty, it will be used instead of generating
|
11 |
-
* the default video template.
|
12 |
-
*
|
13 |
-
* @since 8.8.2
|
14 |
-
*
|
15 |
-
* @param string $html Empty variable to be replaced with shortcode markup.
|
16 |
-
* @param array $atts Attributes of the shortcode.
|
17 |
-
* @param string $content Video shortcode content.
|
18 |
-
*/
|
19 |
-
$override = apply_filters( 'arve_shortcode_overwride', '', $a, $content );
|
20 |
-
if ( '' !== $override ) {
|
21 |
-
return $override;
|
22 |
-
}
|
23 |
-
|
24 |
-
return arve_shortcode_arve( $a, $content );
|
25 |
-
}
|
26 |
-
|
27 |
-
function arve_default_maxwidth() {
|
28 |
-
|
29 |
-
$options = arve_get_options();
|
30 |
-
|
31 |
-
if ( empty( $options['video_maxwidth'] ) ) {
|
32 |
-
return empty( $GLOBALS['content_width'] ) ? 900 : $GLOBALS['content_width'];
|
33 |
-
}
|
34 |
-
|
35 |
-
return $options['video_maxwidth'];
|
36 |
-
}
|
37 |
-
|
38 |
-
function arve_shortcode_arve( $input_atts, $content = null, $arve_shortcode = true ) {
|
39 |
-
|
40 |
-
$errors = '';
|
41 |
-
$options = arve_get_options();
|
42 |
-
$properties = arve_get_host_properties();
|
43 |
-
$input_atts = (array) $input_atts;
|
44 |
-
|
45 |
-
$pairs = array(
|
46 |
-
'align' => $options['align'],
|
47 |
-
'arve_link' => arve_bool_to_shortcode_string( $options['promote_link'] ),
|
48 |
-
'aspect_ratio' => null,
|
49 |
-
'autoplay' => arve_bool_to_shortcode_string( $options['autoplay'] ),
|
50 |
-
'description' => null,
|
51 |
-
'duration' => null,
|
52 |
-
'sandbox' => 'y',
|
53 |
-
'iframe_name' => null,
|
54 |
-
'maxwidth' => (string) arve_default_maxwidth(),
|
55 |
-
'mode' => $options['mode'],
|
56 |
-
'parameters' => null,
|
57 |
-
'src' => null, // Just a alias for url to make it simple
|
58 |
-
'thumbnail' => null,
|
59 |
-
'title' => null,
|
60 |
-
'upload_date' => null,
|
61 |
-
// <video>
|
62 |
-
'm4v' => null,
|
63 |
-
'mp4' => null,
|
64 |
-
'ogv' => null,
|
65 |
-
'webm' => null,
|
66 |
-
'preload' => 'metadata',
|
67 |
-
'playsinline' => null,
|
68 |
-
'muted' => null,
|
69 |
-
'controls' => 'y',
|
70 |
-
'controlslist' => empty( $options['controlslist'] ) ? null : (string) $options['controlslist'],
|
71 |
-
'loop' => 'n',
|
72 |
-
// TED only
|
73 |
-
'lang' => null,
|
74 |
-
// Vimeo only
|
75 |
-
'start' => null,
|
76 |
-
// Old Shortcodes / URL embeds
|
77 |
-
'id' => null,
|
78 |
-
'provider' => null,
|
79 |
-
// deprecated, title should be used
|
80 |
-
'link_text' => null,
|
81 |
-
);
|
82 |
-
|
83 |
-
for ( $n = 1; $n <= ARVE_NUM_TRACKS; $n++ ) {
|
84 |
-
$pairs[ "track_{$n}" ] = null;
|
85 |
-
$pairs[ "track_{$n}_label" ] = null;
|
86 |
-
}
|
87 |
-
|
88 |
-
if ( $arve_shortcode ) {
|
89 |
-
$pairs['url'] = null;
|
90 |
-
} else {
|
91 |
-
$pairs['provider'] = null;
|
92 |
-
$pairs['id'] = null;
|
93 |
-
|
94 |
-
if ( empty( $input_atts['provider'] ) || empty( $input_atts['id'] ) ) {
|
95 |
-
return arve_error( __( 'id and provider shortcodes attributes are mandatory for old shortcodes. It is recommended to switch to new shortcodes that need only url', ARVE_SLUG ) );
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
$atts = shortcode_atts( apply_filters( 'arve_shortcode_pairs', $pairs ), $input_atts, 'arve' );
|
100 |
-
$errors = arve_output_errors( $atts );
|
101 |
-
|
102 |
-
if ( $errors ) {
|
103 |
-
return $errors . arve_get_debug_info( '', $atts, $input_atts );
|
104 |
-
}
|
105 |
-
|
106 |
-
$html['video'] = arve_video_or_iframe( $atts );
|
107 |
-
$html['meta'] = arve_build_meta_html( $atts );
|
108 |
-
$html['ad_link'] = arve_build_promote_link_html( $atts['arve_link'] );
|
109 |
-
$html['embed_container'] = arve_arve_embed_container( $html['meta'] . $html['video'], $atts );
|
110 |
-
|
111 |
-
$normal_embed = arve_arve_wrapper( $html['embed_container'] . $html['ad_link'], $atts );
|
112 |
-
|
113 |
-
$output = apply_filters( 'arve_output', $normal_embed, $html, $atts );
|
114 |
-
|
115 |
-
if ( empty( $output ) ) {
|
116 |
-
return arve_error( 'The output is empty, this should not happen', ARVE_SLUG );
|
117 |
-
} elseif ( is_wp_error( $output ) ) {
|
118 |
-
return arve_error( $output->get_error_message() );
|
119 |
-
}
|
120 |
-
|
121 |
-
wp_enqueue_style( ARVE_SLUG );
|
122 |
-
wp_enqueue_script( ARVE_SLUG );
|
123 |
-
|
124 |
-
return arve_get_debug_info( $output, $atts, $input_atts ) . $output;
|
125 |
-
}
|
126 |
-
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Create all shortcodes at a late stage because people over and over again using this plugin toghter with jetback or
|
130 |
-
* other plugins that handle shortcodes we will now overwrite all this suckers.
|
131 |
-
*
|
132 |
-
* @since 2.6.2
|
133 |
-
*
|
134 |
-
* @uses Advanced_Responsive_Video_Embedder_Create_Shortcodes()
|
135 |
-
*/
|
136 |
-
function arve_create_shortcodes() {
|
137 |
-
|
138 |
-
$options = arve_get_options();
|
139 |
-
|
140 |
-
foreach ( $options['shortcodes'] as $provider => $shortcode ) {
|
141 |
-
|
142 |
-
$function = function( $atts ) use ( $provider ) {
|
143 |
-
$atts['provider'] = $provider;
|
144 |
-
return arve_shortcode_arve( $atts, null, false );
|
145 |
-
};
|
146 |
-
|
147 |
-
add_shortcode( $shortcode, $function );
|
148 |
-
}
|
149 |
-
|
150 |
-
add_shortcode( 'arve', 'arve_shortcode' );
|
151 |
-
add_shortcode( 'arve-supported', 'arve_shortcode_arve_supported' );
|
152 |
-
add_shortcode( 'arve-supported-list', 'arve_shortcode_arve_supported_list' );
|
153 |
-
add_shortcode( 'arve-params', 'arve_shortcode_arve_params' );
|
154 |
-
}
|
155 |
-
|
156 |
-
function arve_shortcode_arve_supported() {
|
157 |
-
|
158 |
-
$providers = arve_get_host_properties();
|
159 |
-
// unset deprecated and doubled
|
160 |
-
unset( $providers['dailymotionlist'] );
|
161 |
-
unset( $providers['iframe'] );
|
162 |
-
|
163 |
-
$out = '<h3 id="video-host-support">Video Host Support</h3>';
|
164 |
-
$out .= '<p>The limiting factor of the following features is not ARVE but what the prividers offer.</p>';
|
165 |
-
$out .= '<table class="table table-sm table-hover">';
|
166 |
-
$out .= '<tr>';
|
167 |
-
$out .= '<th></th>';
|
168 |
-
$out .= '<th>Provider</th>';
|
169 |
-
$out .= '<th>Requires<br>embed code</th>';
|
170 |
-
$out .= '<th>SSL</th>';
|
171 |
-
$out .= '<th>Auto Thumbnail<br>(Pro Addon)</th>';
|
172 |
-
$out .= '<th>Auto Title<br>(Pro Addon)</th>';
|
173 |
-
$out .= '</tr>';
|
174 |
-
$out .= '<tr>';
|
175 |
-
$out .= '<td></td>';
|
176 |
-
$out .= '<td colspan="6"><a href="https://nextgenthemes.com/plugins/arve/documentation/#general-iframe-embedding">All providers with responsive iframe embed codes</a></td>';
|
177 |
-
$out .= '</tr>';
|
178 |
-
|
179 |
-
$count = 1;
|
180 |
-
|
181 |
-
foreach ( $providers as $key => $values ) {
|
182 |
-
|
183 |
-
if ( ! isset( $values['name'] ) ) {
|
184 |
-
$values['name'] = $key;
|
185 |
-
}
|
186 |
-
|
187 |
-
$out .= '<tr>';
|
188 |
-
$out .= sprintf( '<td>%d</td>', $count++ );
|
189 |
-
$out .= sprintf( '<td>%s</td>', esc_html( $values['name'] ) );
|
190 |
-
$out .= sprintf( '<td>%s</td>', ( isset( $values['requires_src'] ) && $values['requires_src'] ) ? '✓' : '' );
|
191 |
-
$out .= sprintf( '<td>%s</td>', ( isset( $values['embed_url'] ) && arve_starts_with( $values['embed_url'], 'https' ) ) ? '✓' : '' );
|
192 |
-
$out .= sprintf( '<td>%s</td>', ( isset( $values['auto_thumbnail'] ) && $values['auto_thumbnail'] ) ? '✓' : '' );
|
193 |
-
$out .= sprintf( '<td>%s</td>', ( isset( $values['auto_title'] ) && $values['auto_title'] ) ? '✓' : '' );
|
194 |
-
$out .= '</tr>';
|
195 |
-
}
|
196 |
-
|
197 |
-
$out .= '<tr>';
|
198 |
-
$out .= '<td></td>';
|
199 |
-
$out .= '<td colspan="6"><a href="https://nextgenthemes.com/plugins/arve/documentation/#general-iframe-embedding">All providers with responsive iframe embed codes</a></td>';
|
200 |
-
$out .= '</tr>';
|
201 |
-
$out .= '</table>';
|
202 |
-
|
203 |
-
return $out;
|
204 |
-
}
|
205 |
-
|
206 |
-
function arve_shortcode_arve_supported_list() {
|
207 |
-
|
208 |
-
$list = '';
|
209 |
-
$providers = arve_get_host_properties();
|
210 |
-
// unset deprecated and doubled
|
211 |
-
unset( $providers['dailymotionlist'] );
|
212 |
-
unset( $providers['iframe'] );
|
213 |
-
|
214 |
-
foreach ( $providers as $key => $values ) {
|
215 |
-
$list .= '* ' . $values['name'] . PHP_EOL;
|
216 |
-
}
|
217 |
-
|
218 |
-
return '<textarea style="width:100%" rows="15">' . $list . '</textarea>';
|
219 |
-
}
|
220 |
-
|
221 |
-
function arve_shortcode_arve_params() {
|
222 |
-
|
223 |
-
$attrs = arve_get_settings_definitions();
|
224 |
-
|
225 |
-
if ( function_exists( 'arve_pro_get_settings_definitions' ) ) {
|
226 |
-
$attrs = array_merge( $attrs, arve_pro_get_settings_definitions() );
|
227 |
-
}
|
228 |
-
|
229 |
-
$out = '<table class="table table-hover table-arve-params">';
|
230 |
-
$out .= '<tr>';
|
231 |
-
$out .= '<th>Parameter</th>';
|
232 |
-
$out .= '<th>Function</th>';
|
233 |
-
$out .= '</tr>';
|
234 |
-
|
235 |
-
foreach ( $attrs as $key => $values ) {
|
236 |
-
|
237 |
-
if ( isset( $values['hide_from_sc'] ) && $values['hide_from_sc'] ) {
|
238 |
-
continue;
|
239 |
-
}
|
240 |
-
|
241 |
-
$desc = '';
|
242 |
-
unset( $values['options'][''] );
|
243 |
-
unset( $choices );
|
244 |
-
|
245 |
-
if ( ! empty( $values['options'] ) ) {
|
246 |
-
|
247 |
-
foreach ( $values['options'] as $key => $value ) {
|
248 |
-
$choices[] = sprintf( '<code>%s</code>', $key );
|
249 |
-
}
|
250 |
-
|
251 |
-
$desc .= __( 'Options: ', ARVE_SLUG ) . implode( ', ', $choices ) . '<br>';
|
252 |
-
}
|
253 |
-
|
254 |
-
if ( ! empty( $values['description'] ) ) {
|
255 |
-
$desc .= $values['description'];
|
256 |
-
}
|
257 |
-
|
258 |
-
if ( ! empty( $values['meta']['placeholder'] ) ) {
|
259 |
-
$desc .= $values['meta']['placeholder'];
|
260 |
-
}
|
261 |
-
|
262 |
-
$out .= '<tr>';
|
263 |
-
$out .= sprintf( '<td>%s</td>', $values['attr'] );
|
264 |
-
$out .= sprintf( '<td>%s</td>', $desc );
|
265 |
-
$out .= '</tr>';
|
266 |
-
}
|
267 |
-
|
268 |
-
$out .= '</table>';
|
269 |
-
|
270 |
-
return $out;
|
271 |
-
}
|
272 |
-
|
273 |
-
function arve_wp_video_shortcode_override( $out, $attr, $content, $instance ) {
|
274 |
-
|
275 |
-
$options = arve_get_options();
|
276 |
-
|
277 |
-
if ( ! $options['wp_video_override'] || ! empty( $attr['wmv'] ) || ! empty( $attr['flv'] ) ) {
|
278 |
-
return $out;
|
279 |
-
}
|
280 |
-
|
281 |
-
if ( ! empty( $attr['poster'] ) ) {
|
282 |
-
$attr['thumbnail'] = $attr['poster'];
|
283 |
-
}
|
284 |
-
|
285 |
-
return arve_shortcode_arve( $attr, null );
|
286 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/functions-thumbnails.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_get_attachment_image_url_or_srcset( $url_or_srcset, $thumbnail ) {
|
4 |
-
|
5 |
-
$found = arve_get_cached_attachment_image_url_or_srcset( $url_or_srcset, $thumbnail );
|
6 |
-
|
7 |
-
if ( $found ) {
|
8 |
-
|
9 |
-
return $found;
|
10 |
-
|
11 |
-
} elseif ( 'url' === $url_or_srcset ) {
|
12 |
-
|
13 |
-
return new WP_Error( 'wp thumbnail', __( 'No attachment with that ID', ARVE_SLUG ) );
|
14 |
-
|
15 |
-
} else {
|
16 |
-
|
17 |
-
return false;
|
18 |
-
}
|
19 |
-
}
|
20 |
-
|
21 |
-
function arve_get_cached_attachment_image_url_or_srcset( $url_or_srcset, $attachment_id ) {
|
22 |
-
|
23 |
-
$options = arve_get_options();
|
24 |
-
$transient_name = "arve_attachment_image_{$url_or_srcset}_{$attachment_id}";
|
25 |
-
$transient = get_transient( $transient_name );
|
26 |
-
$time = (int) $options['wp_image_cache_time'];
|
27 |
-
|
28 |
-
if ( false === $transient || $time <= 0 ) {
|
29 |
-
|
30 |
-
if ( 'srcset' === $url_or_srcset ) {
|
31 |
-
|
32 |
-
$out = wp_get_attachment_image_srcset( $attachment_id, 'small' );
|
33 |
-
|
34 |
-
} elseif ( 'url' === $url_or_srcset ) {
|
35 |
-
|
36 |
-
$out = wp_get_attachment_image_url( $attachment_id, 'small' );
|
37 |
-
}
|
38 |
-
|
39 |
-
set_transient( $transient_name, (string) $out, $time );
|
40 |
-
|
41 |
-
} else {
|
42 |
-
|
43 |
-
$out = $transient;
|
44 |
-
}
|
45 |
-
|
46 |
-
return $out;
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/functions-url-handlers.php
DELETED
@@ -1,140 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_create_url_handlers() {
|
4 |
-
|
5 |
-
$properties = arve_get_host_properties();
|
6 |
-
|
7 |
-
foreach ( $properties as $provider => $values ) {
|
8 |
-
|
9 |
-
$function = function( $matches, $attr, $url, $rawattr ) use ( $provider ) {
|
10 |
-
return arve_url_detection_to_shortcode( $provider, $matches, $attr, $url, $rawattr );
|
11 |
-
};
|
12 |
-
|
13 |
-
if ( ! empty( $values['regex'] ) ) {
|
14 |
-
wp_embed_register_handler( 'arve_' . $provider, '#' . $values['regex'] . '#i', $function );
|
15 |
-
}
|
16 |
-
}
|
17 |
-
}
|
18 |
-
|
19 |
-
function arve_url_detection_to_shortcode( $provider, $matches, $attr, $url, $rawattr ) {
|
20 |
-
|
21 |
-
//* Fix 'Markdown on save enhanced' issue
|
22 |
-
if ( substr( $url, -4 ) === '</p>' ) {
|
23 |
-
$url = substr( $url, 0, -4 );
|
24 |
-
}
|
25 |
-
|
26 |
-
$parsed_url = wp_parse_url( $url );
|
27 |
-
$url_query = array();
|
28 |
-
$old_atts = array();
|
29 |
-
$new_atts = array();
|
30 |
-
|
31 |
-
if ( ! empty( $parsed_url['query'] ) ) {
|
32 |
-
parse_str( $parsed_url['query'], $url_query );
|
33 |
-
}
|
34 |
-
|
35 |
-
foreach ( $url_query as $key => $value ) {
|
36 |
-
|
37 |
-
if ( arve_starts_with( $key, 'arve-' ) ) {
|
38 |
-
$key = substr( $key, 5 );
|
39 |
-
$old_atts[ $key ] = $value;
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
unset( $old_atts['param'] );
|
44 |
-
|
45 |
-
if ( isset( $url_query['arve'] ) ) {
|
46 |
-
$new_atts = $url_query['arve'];
|
47 |
-
}
|
48 |
-
|
49 |
-
if ( isset( $url_query['t'] ) ) {
|
50 |
-
$url_query['start'] = arve_youtube_time_to_seconds( $url_query['t'] );
|
51 |
-
}
|
52 |
-
|
53 |
-
unset( $url_query['arve'] );
|
54 |
-
|
55 |
-
if ( 'youtube' === $provider ) {
|
56 |
-
unset( $url_query['v'] );
|
57 |
-
unset( $url_query['t'] );
|
58 |
-
}
|
59 |
-
|
60 |
-
//* Pure awesomeness!
|
61 |
-
$atts = array_merge( (array) $old_atts, (array) $new_atts );
|
62 |
-
$atts['parameters'] = empty( $url_query ) ? null : build_query( $url_query );
|
63 |
-
$atts['url'] = $url;
|
64 |
-
|
65 |
-
return arve_shortcode_arve( $atts, null );
|
66 |
-
}
|
67 |
-
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Remove the WordPress default Oembed support for video providers that ARVE Supports. Array taken from wp-includes/class-oembed.php __construct
|
71 |
-
*
|
72 |
-
* @since 5.9.9
|
73 |
-
*
|
74 |
-
*/
|
75 |
-
function arve_oembed_remove_providers() {
|
76 |
-
|
77 |
-
// phpcs:disable Squiz.PHP.CommentedOutCode.Found
|
78 |
-
|
79 |
-
$wp_core_oembed_shits = array(
|
80 |
-
'#http://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ),
|
81 |
-
'#https://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
|
82 |
-
#'#http://(www\.)?youtube\.com/playlist.*#i' => array( 'http://www.youtube.com/oembed', true ),
|
83 |
-
#'#https://(www\.)?youtube\.com/playlist.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
|
84 |
-
'#http://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed', true ),
|
85 |
-
'#https://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
|
86 |
-
'#https?://(.+\.)?vimeo\.com/.*#i' => array( 'http://vimeo.com/api/oembed.{format}', true ),
|
87 |
-
'#https?://(www\.)?dailymotion\.com/.*#i' => array( 'http://www.dailymotion.com/services/oembed', true ),
|
88 |
-
'http://dai.ly/*' => array( 'http://www.dailymotion.com/services/oembed', false ),
|
89 |
-
#'#https?://(www\.)?flickr\.com/.*#i' => array( 'https://www.flickr.com/services/oembed/', true ),
|
90 |
-
#'#https?://flic\.kr/.*#i' => array( 'https://www.flickr.com/services/oembed/', true ),
|
91 |
-
#'#https?://(.+\.)?smugmug\.com/.*#i' => array( 'http://api.smugmug.com/services/oembed/', true ),
|
92 |
-
#'#https?://(www\.)?hulu\.com/watch/.*#i' => array( 'http://www.hulu.com/api/oembed.{format}', true ),
|
93 |
-
#'http://revision3.com/*' => array( 'http://revision3.com/api/oembed/', false ),
|
94 |
-
#'http://i*.photobucket.com/albums/*' => array( 'http://photobucket.com/oembed', false ),
|
95 |
-
#'http://gi*.photobucket.com/groups/*' => array( 'http://photobucket.com/oembed', false ),
|
96 |
-
#'#https?://(www\.)?scribd\.com/doc/.*#i' => array( 'http://www.scribd.com/services/oembed', true ),
|
97 |
-
#'#https?://wordpress.tv/.*#i' => array( 'http://wordpress.tv/oembed/', true ),
|
98 |
-
#'#https?://(.+\.)?polldaddy\.com/.*#i' => array( 'https://polldaddy.com/oembed/', true ),
|
99 |
-
#'#https?://poll\.fm/.*#i' => array( 'https://polldaddy.com/oembed/', true ),
|
100 |
-
'#https?://(www\.)?funnyordie\.com/videos/.*#i' => array( 'http://www.funnyordie.com/oembed', true ),
|
101 |
-
#'#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i' => array( 'https://api.twitter.com/1/statuses/oembed.{format}', true ),
|
102 |
-
'#https?://vine.co/v/.*#i' => array( 'https://vine.co/oembed.{format}', true ),
|
103 |
-
#'#https?://(www\.)?soundcloud\.com/.*#i' => array( 'http://soundcloud.com/oembed', true ),
|
104 |
-
#'#https?://(.+?\.)?slideshare\.net/.*#i' => array( 'https://www.slideshare.net/api/oembed/2', true ),
|
105 |
-
#'#http://instagr(\.am|am\.com)/p/.*#i' => array( 'http://api.instagram.com/oembed', true ),
|
106 |
-
#'#https?://(www\.)?rdio\.com/.*#i' => array( 'http://www.rdio.com/api/oembed/', true ),
|
107 |
-
#'#https?://rd\.io/x/.*#i' => array( 'http://www.rdio.com/api/oembed/', true ),
|
108 |
-
#'#https?://(open|play)\.spotify\.com/.*#i' => array( 'https://embed.spotify.com/oembed/', true ),
|
109 |
-
#'#https?://(.+\.)?imgur\.com/.*#i' => array( 'http://api.imgur.com/oembed', true ),
|
110 |
-
#'#https?://(www\.)?meetu(\.ps|p\.com)/.*#i' => array( 'http://api.meetup.com/oembed', true ),
|
111 |
-
#'#https?://(www\.)?issuu\.com/.+/docs/.+#i' => array( 'http://issuu.com/oembed_wp', true ),
|
112 |
-
'#https?://(www\.)?collegehumor\.com/video/.*#i' => array( 'http://www.collegehumor.com/oembed.{format}', true ),
|
113 |
-
#'#https?://(www\.)?mixcloud\.com/.*#i' => array( 'http://www.mixcloud.com/oembed', true ),
|
114 |
-
'#https?://(www\.|embed\.)?ted\.com/talks/.*#i' => array( 'http://www.ted.com/talks/oembed.{format}', true ),
|
115 |
-
#'#https?://(www\.)?(animoto|video214)\.com/play/.*#i' => array( 'http://animoto.com/oembeds/create', true ),
|
116 |
-
);
|
117 |
-
|
118 |
-
foreach ( $wp_core_oembed_shits as $shit => $fuck ) {
|
119 |
-
|
120 |
-
wp_oembed_remove_provider( $shit );
|
121 |
-
}
|
122 |
-
|
123 |
-
// Jetpack shit
|
124 |
-
remove_shortcode( 'dailymotion', 'dailymotion_shortcode' );
|
125 |
-
remove_filter( 'pre_kses', 'jetpack_dailymotion_embed_reversal' );
|
126 |
-
remove_filter( 'pre_kses', 'dailymotion_embed_to_shortcode' );
|
127 |
-
|
128 |
-
remove_shortcode( 'vimeo', 'vimeo_shortcode' );
|
129 |
-
remove_filter( 'pre_kses', 'vimeo_embed_to_shortcode' );
|
130 |
-
|
131 |
-
wp_embed_unregister_handler( 'jetpack_vine' );
|
132 |
-
remove_shortcode( 'vine', 'vine_shortcode' );
|
133 |
-
|
134 |
-
remove_filter( 'pre_kses', 'youtube_embed_to_short_code' );
|
135 |
-
remove_shortcode( 'youtube', 'youtube_shortcode' );
|
136 |
-
|
137 |
-
remove_shortcode( 'ted', 'shortcode_ted' );
|
138 |
-
wp_oembed_remove_provider( '!https?://(www\.)?ted.com/talks/view/id/.+!i' );
|
139 |
-
wp_oembed_remove_provider( '!https?://(www\.)?ted.com/talks/[a-zA-Z\-\_]+\.html!i' );
|
140 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public/functions-validation.php
DELETED
@@ -1,106 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_validate_url( $url ) {
|
4 |
-
|
5 |
-
if ( arve_starts_with( $url, '//' ) ) {
|
6 |
-
$url = 'https:' . $url;
|
7 |
-
}
|
8 |
-
|
9 |
-
if ( arve_starts_with( $url, 'http' ) && filter_var( $url, FILTER_VALIDATE_URL ) !== false ) {
|
10 |
-
return true;
|
11 |
-
}
|
12 |
-
|
13 |
-
return false;
|
14 |
-
}
|
15 |
-
|
16 |
-
function arve_validate_aspect_ratio( $aspect_ratio ) {
|
17 |
-
|
18 |
-
if ( empty( $aspect_ratio ) ) {
|
19 |
-
return $aspect_ratio;
|
20 |
-
}
|
21 |
-
|
22 |
-
$a = explode( ':', $aspect_ratio );
|
23 |
-
|
24 |
-
if ( ! empty( $a[0] ) && is_numeric( $a[0] ) && ! empty( $a[1] ) && is_numeric( $a[1] ) ) {
|
25 |
-
return $aspect_ratio;
|
26 |
-
}
|
27 |
-
|
28 |
-
return new WP_Error(
|
29 |
-
'Aspect ratio',
|
30 |
-
sprintf( __( 'Aspect ratio <code>%s</code> is not valid', ARVE_SLUG ), $aspect_ratio )
|
31 |
-
);
|
32 |
-
}
|
33 |
-
|
34 |
-
function arve_bool_to_shortcode_string( $val ) {
|
35 |
-
|
36 |
-
if ( false === $val ) {
|
37 |
-
return 'n';
|
38 |
-
}
|
39 |
-
|
40 |
-
return (string) $val;
|
41 |
-
}
|
42 |
-
|
43 |
-
function arve_validate_bool( $val, $name ) {
|
44 |
-
|
45 |
-
switch ( $val ) {
|
46 |
-
case 'true':
|
47 |
-
case '1':
|
48 |
-
case 'y':
|
49 |
-
case 'yes':
|
50 |
-
case 'on':
|
51 |
-
return true;
|
52 |
-
case null:
|
53 |
-
return null;
|
54 |
-
case 'false':
|
55 |
-
case '0':
|
56 |
-
case 'n':
|
57 |
-
case 'no':
|
58 |
-
case 'off':
|
59 |
-
return false;
|
60 |
-
default:
|
61 |
-
return new WP_Error(
|
62 |
-
$name,
|
63 |
-
sprintf( __( '%1$s <code>%2$s</code> not valid', ARVE_SLUG ), $name, $val )
|
64 |
-
);
|
65 |
-
}
|
66 |
-
}
|
67 |
-
|
68 |
-
function arve_validate_align( $align ) {
|
69 |
-
|
70 |
-
switch ( $align ) {
|
71 |
-
case null:
|
72 |
-
case '':
|
73 |
-
case 'none':
|
74 |
-
$align = null;
|
75 |
-
break;
|
76 |
-
case 'left':
|
77 |
-
case 'right':
|
78 |
-
case 'center':
|
79 |
-
break;
|
80 |
-
default:
|
81 |
-
$align = new WP_Error( 'align', sprintf( __( 'Align <code>%s</code> not valid', ARVE_SLUG ), esc_html( $align ) ) );
|
82 |
-
break;
|
83 |
-
}
|
84 |
-
|
85 |
-
return $align;
|
86 |
-
}
|
87 |
-
|
88 |
-
function arve_validate_mode( $mode, $provider ) {
|
89 |
-
|
90 |
-
if ( 'thumbnail' === $mode ) {
|
91 |
-
$mode = 'lazyload-lightbox';
|
92 |
-
}
|
93 |
-
|
94 |
-
if ( 'veoh' === $mode ) {
|
95 |
-
$mode = 'normal';
|
96 |
-
}
|
97 |
-
|
98 |
-
$supported_modes = arve_get_supported_modes();
|
99 |
-
|
100 |
-
if ( ! array_key_exists( $mode, $supported_modes ) ) {
|
101 |
-
|
102 |
-
$mode = 'normal';
|
103 |
-
}
|
104 |
-
|
105 |
-
return $mode;
|
106 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.md
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
![CI Build](https://github.com/nextgenthemes/advanced-responsive-video-embedder/workflows/CI%20Build/badge.svg)
|
2 |
+
[![star this repo](http://githubbadges.com/star.svg?user=nextgenthemes&repo=advanced-responsive-video-embedder&style=default)](https://github.com/nextgenthemes/advanced-responsive-video-embedder)
|
3 |
+
[![fork this repo](http://githubbadges.com/fork.svg?user=nextgenthemes&repo=advanced-responsive-video-embedder&style=default)](https://github.com/nextgenthemes/advanced-responsive-video-embedder/fork)
|
4 |
+
|
5 |
+
Please visit the [WP.org plugin page](https://wordpress.org/plugins/advanced-responsive-video-embedder/) for more info.
|
readme.txt
CHANGED
@@ -1,264 +1,61 @@
|
|
1 |
=== ARVE Advanced Responsive Video Embedder (YouTube, Vimeo, HTML5 Video ...) ===
|
2 |
Contributors: nico23
|
3 |
-
Donate link: https://
|
4 |
Tags: YouTube, Vimeo, lazyload, thumbnail, video, responsive, embeds, video-embedder, iframe, lightweight, simplicity, shortcodes
|
5 |
Requires at least: 4.4.0
|
6 |
-
Tested up to: 5.
|
7 |
-
Requires PHP: 5.
|
8 |
-
Stable tag:
|
9 |
License: GPL-3.0
|
10 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
12 |
Easy responsive video embeds via URLs or shortcodes. Perfect drop-in replacement for WordPress' default embeds. Best plugin for videos?
|
13 |
|
14 |
-
## Description ##
|
15 |
-
|
16 |
-
The best WordPress plugin for videos? Supports close to everything you can imagine, still keeping it easy & simple.
|
17 |
-
|
18 |
-
It is very likely the one and only plugin you will ever need to handle video embeds on your WordPress site(s). It goes far beyond just making your videos responsive!
|
19 |
-
|
20 |
-
Especially new users and people who want to use the new Block Editor (Gutenberg):
|
21 |
-
|
22 |
-
### [Please help test the upcoming version](https://nextgenthemes.com/please-help-test-the-beta-version/) ###
|
23 |
-
|
24 |
-
[youtube https://www.youtube.com/watch?v=m6mkA6Zr1vY ]
|
25 |
-
|
26 |
-
* [Documentation](https://nextgenthemes.com/plugins/arve/documentation/)
|
27 |
-
* [GitHub Page](https://github.com/nextgenthemes/advanced-responsive-video-embedder)
|
28 |
-
* [Pro Addon](https://nextgenthemes.com/plugins/arve-pro/)
|
29 |
-
|
30 |
-
### Features ###
|
31 |
-
|
32 |
-
* SEO friendly, lets you specify title, description, upload date to provide search engines with the schema.org data they like to have for better indexing.
|
33 |
-
* <abbr title="What You See Is What You Get">WYSIWYG</abbr> support. No more messing around with shortcodes and previewing.
|
34 |
-
* New improved dialog for embedding videos.
|
35 |
-
* Magically makes those url embedded videos responsive.
|
36 |
-
* No 'lock in' if you do not use shortcodes and use providers WordPress already supports.
|
37 |
-
* Supports [almost every video host](https://nextgenthemes.com/plugins/arve-pro/#support-table) that supports iframe embed codes.
|
38 |
-
* Embeds via pasting the URL in its own line just like WordPress!
|
39 |
-
* Optionally use very powerful Shortcodes instead.
|
40 |
-
* Clean shortcode syntax `[arve url="https://youtu.be/yUCFRL43Zm4" align="left" parameters="start=30" ... /]`, no unnecessary shortcode wrapping.
|
41 |
-
* One single button for all providers.
|
42 |
-
* Responsive embeds with CSS, much better then with JavaScript.
|
43 |
-
* Tries to be as unobtrusive as possible, sets 'hide brand' variables if supported, disables related videos at the end … to help keep people on your site rather then going to YouTube or keep watching videos.
|
44 |
-
* Autostart (for providers that support it, mobile browsers prevent this)
|
45 |
-
* Custom URL parameters to use all options providers offer.
|
46 |
-
* Optional maximal width.
|
47 |
-
* Video alignment.
|
48 |
-
* Detailed description of options in-place.
|
49 |
-
* Automatic detected and custom aspect ratio.
|
50 |
-
|
51 |
-
### [Supported Providers](https://nextgenthemes.com/plugins/arve-pro/#support-table) ###
|
52 |
-
|
53 |
-
allmyvideos.net, Alugha, Archive.org, Break, Brightcove, CollegeHumor, Comedy Central, Dailymotion, Facebook, Funny or Die, IGN, Kickstarter, LiveLeak, Livestream, kla.tv, Metacafe, Movieweb, MPORA, Myspace, Snotr, Spike, TED Talks, Twitch, Ustream, RuTube.ru, Veoh, Vevo, Viddler, vidspot.net, Vine, Vimeo, VK, Vzaar, Wistia, XTube, Yahoo, Youku, YouTube, YouTube Playlist, HTML5 video files directly, Google_drive, Dropbox, Ooyala
|
54 |
-
[All providers with responsive iframe embed codes](https://nextgenthemes.com/plugins/arve/documentation/#general-iframe-embedding)
|
55 |
-
|
56 |
-
### Reviews ###
|
57 |
-
|
58 |
-
#### ★ ★ ★ ★ ★ The best there is – I have tried many… ####
|
59 |
-
Have downloaded and paid for at least 4 other video players that use lightbox. Each one has major flaws. This products works perfectly. If you use the OnSite Editor, then just copy the short code and it works great.
|
60 |
-
|
61 |
-
[arve url="https://www.youtube.com/watch?v=Z7g8-GxLTSc" /]
|
62 |
-
|
63 |
-
For speed, the product uses the thumbnails from the server. So many of the other products do NOT do this and it slows the page rendering. This product should appear first on the WordPress search. Spent 3 days of my life wasted on other products, only to delete each one. [review by jodani](https://wordpress.org/support/plugin/advanced-responsive-video-embedder/reviews/?filter=5)
|
64 |
-
|
65 |
-
#### ★ ★ ★ ★ ★ Finally something that works ####
|
66 |
-
So I have a responsive theme but on pages with you tube videos it wasn't making the you tube videos fit in the mobile screen. I have spent the last hour trying many plugins and researching on google and finally I installed this. And I didn't have to update any settings or anything just refreshed a post with videos and all the sudden it is beautiful and responsive on my mobile phone!!!!!! THANK YOU!!!! [review by happyecho](https://wordpress.org/support/plugin/advanced-responsive-video-embedder/reviews/?filter=5)
|
67 |
-
|
68 |
-
#### ★ ★ ★ ★ ★ Only Plug-in that worked ####
|
69 |
-
I used a lot of high ranking plug-ins but they still broke my design. Downloaded this and worked right away. Thanks! [review by crconnell89](https://wordpress.org/support/plugin/advanced-responsive-video-embedder/reviews/?filter=5)
|
70 |
-
|
71 |
-
This plugin is financed by sales of the [Pro Addon](https://nextgenthemes.com/plugins/arve-pro/). The development and support of this plugins has become a job for me so I hope you understand that I can not make all features gratis and that you [purchase it](https://nextgenthemes.com/plugins/arve-pro/) to get extra features and support the development.
|
72 |
-
|
73 |
-
### [Pro Addon](https://nextgenthemes.com/plugins/arve-pro/) ###
|
74 |
-
|
75 |
-
**10% off** first year with discount code `wporg`
|
76 |
-
|
77 |
-
* **Disable links in embeds (killer feature!)**<br>
|
78 |
-
For example: Clicking on a title in a YouTube embed will not open a new popup/tab/window. **Prevent video hosts to lead your visitors away from your site!** Note this also breaks sharing functionality and is not possible when the provider requires flash. Try it on [this page](https://nextgenthemes.com/plugins/arve-pro/). Right click on links still works.
|
79 |
-
* **Lazyload mode**<br>
|
80 |
-
Make your site load **faster** by loading only a image instead of the entire video player on pageload.
|
81 |
-
* **Lazyload -> Lightbox**<br>
|
82 |
-
Shows the Video in a Lightbox after clicking a preview image
|
83 |
-
* **Link -> Lightbox**<br>
|
84 |
-
Use simple links as triggers for lightboxed videos
|
85 |
-
* Automatic or custom thumbnail images
|
86 |
-
* Automatic or custom titles on top of your thumbnails
|
87 |
-
* 'Expand on click' feature
|
88 |
-
* 3 hover styles
|
89 |
-
* 2 play icon styles to choose from
|
90 |
-
* Responsive thumbnails using cutting edge HTML5 technology
|
91 |
-
* **Feel good about yourself**<br>
|
92 |
-
for supporting my 5+ years work on this plugin. Tons of hours, weekends … always worked on improving it.
|
93 |
-
* Show the latest video of a YouTube channel by using the channel URL (updated/cached hourly)
|
94 |
-
* **[Get the ARVE Pro Addon](https://nextgenthemes.com/plugins/arve-pro/)**
|
95 |
-
|
96 |
-
### ARVE AMP Addon ###
|
97 |
-
|
98 |
-
* Requires the gratis plugins [ARVE](https://wordpress.org/plugins/advanced-responsive-video-embedder/) and [AMP](https://wordpress.org/plugins/amp/)
|
99 |
-
* Makes ARVE ready for Accelerated Mobile Pages (AMP)
|
100 |
-
* It will display videos embedded with ARVE on AMP pages correctly
|
101 |
-
* No options, just works
|
102 |
-
* It creates <amp-brightcove>, <amp-youtube>, <amp-vimeo>, <amp-dailymotion> elements
|
103 |
-
* For all other video hosts supported by ARVE <amp-iframe> element is used
|
104 |
-
* HTML5 video embeds are also supported with <amp-video>
|
105 |
-
* **[Check out the ARVE AMP Addon](https://nextgenthemes.com/plugins/arve-amp/)**
|
106 |
-
|
107 |
-
### Thanks ###
|
108 |
-
|
109 |
-
* Of course all the customers who bought a addon.
|
110 |
-
* Howard Iken of [myfloridalaw.com](https://www.myfloridalaw.com) top donor, super nice to me even if I was rude and not deserved it!
|
111 |
-
* [Ilya Grishkov](https://www.ilyagrishkov.com) for bringing up the idea and the first code to cache thumbnail urls.
|
112 |
-
* Everybody giving constructive feedback, testing beta versions.
|
113 |
-
* Everybody who donated back in the days when this was donation based.
|
114 |
-
|
115 |
-
### Thanks to the developers of the software used in ARVE ###
|
116 |
-
|
117 |
-
* [Shortcode UI](https://wordpress.org/plugins/shortcode-ui/), optional Plugin, utilized by ARVE
|
118 |
-
* [Lity Lightbox](http://sorgalla.com/lity/), used in [Pro Addon](https://nextgenthemes.com/plugins/arve-pro/)
|
119 |
-
|
120 |
-
## Installation ##
|
121 |
-
|
122 |
-
Please refer to [codex.wordpress.org/Managing_Plugins#Automatic_Plugin_Installation](https://codex.wordpress.org/Managing_Plugins#Automatic_Plugin_Installation).
|
123 |
-
|
124 |
-
## Frequently Asked Questions ##
|
125 |
-
|
126 |
-
### I have a problem ... ###
|
127 |
-
|
128 |
-
Please report it on [nextgenthemes.com/support/](https://nextgenthemes.com/support/) **and please do not on the wordpess.org forums, thanks.**
|
129 |
-
|
130 |
-
### How to get the pro version working? ###
|
131 |
-
|
132 |
-
1. Go though the purchase process on [nextgenthemes.com/arve-pro/](https://nextgenthemes.com/arve-pro/)
|
133 |
-
1. Follow the 3 easy steps you get with the purchase receipt. It is basically downloading a arve-pro.zip and installing it through your WordPress Admin panel.
|
134 |
-
|
135 |
-
### Why are my videos not filling their container? ###
|
136 |
-
|
137 |
-
You are most likely use `align`, this plugin has a option for limiting video width with alignment. If you want your videos to fill their containers then you should not use the `align` shortcode attribute. This assumes that you left the 'Video Maximal Width' field on the options page empty.
|
138 |
-
|
139 |
-
### Can you add a video provider? ###
|
140 |
-
|
141 |
-
ARVE Already support all the provider the offer iframe embed codes. Just use the `src="https://this-URL"` url from any iframe embed code on a arve shortcode like this [arve url="https://embed-code-src-url" /]. For well known providers ARVE builds this URL automatically so you just need the video URL on their page. If the ID for a video can be extracted from the URL and is the same in the embed code its easy to add it to the plugin, just asked. For example `https://example.com/video/112233/` and their embed code might be `<iframe src="https://example.com/video/112233/embed" ...><iframe>` in such case or if you not sure just ask.
|
142 |
-
|
143 |
-
### How do I embed videos from a unlisted providers / iframes? ###
|
144 |
-
|
145 |
-
This plugin not changes anything to usual HTML `<iframe>` embed codes you have to use the shortcode creator dialog and paste iframe embed codes there or write them manually. They will become `[arve url="https://..."]`. The url represents what is the `src` in HTML embeds. It works as simple as this, if the [arve] shortcode does not detect a known URL structure then it will treat the URL as a `src` for the iframe.
|
146 |
-
|
147 |
-
### Why does my YouTube video not repeat/loop? ###
|
148 |
-
|
149 |
-
This plugins embed is considered as 'custom player' by YouTube so you have to pass the video ID as playlist parameters to make the loop work.
|
150 |
-
|
151 |
-
`[arve url="https://www.youtube.com/watch?v=pvRqvX413Ik" parameters="loop=1&playlist=pvRqvX413Ik"]`
|
152 |
-
|
153 |
-
## Screenshots ##
|
154 |
-
|
155 |
-
1. Shortcode dialog
|
156 |
-
2. Main Options
|
157 |
-
2. URL Parameter Options
|
158 |
-
3. Pro Options
|
159 |
-
|
160 |
## Changelog ##
|
161 |
|
162 |
* [ARVE Pro addon changelog](https://nextgenthemes.com/plugins/arve-pro/changelog/)
|
163 |
* [ARVE AMP addon changelog](https://nextgenthemes.com/plugins/arve-amp/)
|
164 |
|
165 |
-
###
|
166 |
-
|
167 |
-
This update is very long in the making and I hope it will pay off somehow, hopefully literally. A lot things happened in the code that will not be visible to the end users directly but made the code more modern and easier to maintain.
|
168 |
|
169 |
-
[
|
170 |
|
171 |
-
|
172 |
|
173 |
New:
|
174 |
-
|
175 |
-
*
|
176 |
-
*
|
177 |
-
*
|
178 |
-
*
|
179 |
-
*
|
180 |
-
*
|
181 |
-
* Option to
|
182 |
|
183 |
Fixes:
|
184 |
-
|
185 |
-
*
|
186 |
-
*
|
187 |
-
*
|
188 |
-
* Twitch embeds.
|
189 |
|
190 |
Improved:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
|
192 |
-
|
193 |
-
*
|
194 |
-
*
|
195 |
-
* Embeds work though WPs oembed system now that comes with a more stable codebase and better caching system for embeds.
|
196 |
-
* Aspect ratios are now auto detected for all providers WP supports through oEmbed.
|
197 |
-
* Aspect ratio field is now auto filled when pasting a iframe embed code into the shortcode UI or Gutenberg UI.
|
198 |
-
* Removed jQuery dependency for frontend JavaScript.
|
199 |
-
* Prevent autoplay of multiple videos, only the first video on pageload will be autoplayed.
|
200 |
-
|
201 |
-
Removed:
|
202 |
-
|
203 |
-
* Hack to support direct embedding of Dropbox videos because it no longer works.
|
204 |
-
* Vimeo only `start` shortcode attribute. Use vimeo urls with `#t=30` at the end for starting time in seconds instead.
|
205 |
-
|
206 |
-
Probably things I forgot about, working on this for ~1 year
|
207 |
-
|
208 |
-
### 2020-10-10 - 8.10.28 ###
|
209 |
-
|
210 |
-
* Tested and marked as compatible with WP 5.5.1
|
211 |
-
|
212 |
-
### 2020-08-02 - 8.10.27 ###
|
213 |
-
|
214 |
-
* Fix: **SORRY!** message about beta testing was **not intended** to show hourly it was intended to show only once per user.
|
215 |
-
* Fix: Link in that messages was also to a 404 page, can it get worse?
|
216 |
-
|
217 |
-
### 2020-07-25 - 8.10.24 ###
|
218 |
-
|
219 |
-
* Fix: `embedURL` SEO output.
|
220 |
-
|
221 |
-
### 2020-05-14 - 8.10.23 ###
|
222 |
|
223 |
-
|
224 |
-
|
225 |
-
### 2019-11-05 - 8.10.20 ###
|
226 |
-
|
227 |
-
* Big version update with Gutenberg Block is coming [please help testing](https://nextgenthemes.com/plugins/arve/help-testing-the-beta-version/)
|
228 |
-
|
229 |
-
### 2019-10-18 - 8.10.15 ###
|
230 |
-
|
231 |
-
* Fix: Force shortcode args to be array. To prevent issues.
|
232 |
-
|
233 |
-
### 2019-10-09 - 8.10.13 ###
|
234 |
-
|
235 |
-
* Removed outdated link in widget.
|
236 |
-
|
237 |
-
### 2019-10-01 - 8.10.12 ###
|
238 |
-
|
239 |
-
* Improved: Allow for manually srcset with `img_srcset` with the Pro Addon.
|
240 |
-
|
241 |
-
### 2019-08-29 - 8.10.11 ###
|
242 |
-
|
243 |
-
* Removed vendor dir from Git versioning.
|
244 |
-
|
245 |
-
### 2019-08-29 - 8.10.10 ###
|
246 |
-
|
247 |
-
Just a small readme update and checking new release script, making sure everything works and everyone is on the latest stable version.
|
248 |
-
|
249 |
-
### 2019-08-19 - 8.10.8 ###
|
250 |
-
|
251 |
-
* Improved: Switch Youku embeds to https set to default 16:9 aspect ratio.
|
252 |
-
* Improved: added `allow-popups-to-escape-sandbox` to sandbox attribute. This eliminates the need for `sandbox="false"` for Vimeo action links to work. And just in general I think its a good idea.
|
253 |
-
|
254 |
-
### 2019-07-31 - 8.10.6 ###
|
255 |
-
|
256 |
-
* Fix: Vimeo Action links not working correctly in Chrome when Sandbox is enabled. You can fix this by adding `sandbox="false"` to your shortcodes. But the ARVE Pro "disable links" option will no longer work.
|
257 |
-
* Improved: Deprecated `requires_flash` attribute and `Iframe Flash` option. Replaced is the new `sandbox` shortcode attribute.
|
258 |
|
259 |
### 2019-01-23 - 8.10.4 ###
|
260 |
|
261 |
-
* Fix: PHP compatibility lowered to
|
262 |
|
263 |
### 2019-01-16 - 8.10.2 ###
|
264 |
|
@@ -586,7 +383,7 @@ Just a small readme update and checking new release script, making sure everythi
|
|
586 |
* Improved: New default option for inview lazyload is 'On iOS, Android and Desktops when no thumbnail is found'.
|
587 |
* Improved: New installations will show a message guiding users to activation screen.
|
588 |
|
589 |
-
### 2016-11-29 - 7.9.19
|
590 |
|
591 |
* Fix: 'Embed Video' Button not working with Advanced Custom Fields (Possibly fixed other 3rd party editor plugins compatibility issues as well) Thanks to David Trenear!
|
592 |
* Fix: Facebook URL detection for usernames with dots in them.
|
@@ -1290,6 +1087,148 @@ Please check the [migration guide](https://nextgenthemes.com/?p=1875) about upgr
|
|
1290 |
* Removed Services that went down over the years
|
1291 |
* Changed the way shortcodes were implemented from regexp to wordpress 'add shortcode' function
|
1292 |
|
1293 |
-
### 0.1 ###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1294 |
|
1295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
=== ARVE Advanced Responsive Video Embedder (YouTube, Vimeo, HTML5 Video ...) ===
|
2 |
Contributors: nico23
|
3 |
+
Donate link: https://nextgenthemes.com/donate/
|
4 |
Tags: YouTube, Vimeo, lazyload, thumbnail, video, responsive, embeds, video-embedder, iframe, lightweight, simplicity, shortcodes
|
5 |
Requires at least: 4.4.0
|
6 |
+
Tested up to: 5.4
|
7 |
+
Requires PHP: 5.6
|
8 |
+
Stable tag: 9.0.0-beta5
|
9 |
License: GPL-3.0
|
10 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
12 |
Easy responsive video embeds via URLs or shortcodes. Perfect drop-in replacement for WordPress' default embeds. Best plugin for videos?
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
## Changelog ##
|
15 |
|
16 |
* [ARVE Pro addon changelog](https://nextgenthemes.com/plugins/arve-pro/changelog/)
|
17 |
* [ARVE AMP addon changelog](https://nextgenthemes.com/plugins/arve-amp/)
|
18 |
|
19 |
+
### 9.0.0-beta2 ###
|
|
|
|
|
20 |
|
21 |
+
[More details on this **mayor** update]()
|
22 |
|
23 |
+
This update is very long in the making and I hope it will pay off somehow, hopefully literally. A lot things happened in the code that will not be visible to the end users directly but made the code more modern and easier to maintain.
|
24 |
|
25 |
New:
|
26 |
+
* Minimum PHP required is now 5.6.
|
27 |
+
* Finally the ARVE Gutenberg block is here! Its not polished yet and there is still work to be done.
|
28 |
+
* Optional admin bar button to quick access settings. Disable it in ARVE settings bothers you.
|
29 |
+
* Added Bitchute
|
30 |
+
* `av1mp4` shortcode parameter so serve [AV1](https://en.wikipedia.org/wiki/AV1) encoded files best named .av1.mp4 (to be used together with `mp4` or `webm`)
|
31 |
+
* Settings page overhaul, using my own little settings framework. All addon options can be seen and set (without effect) before actually having the addons installed.
|
32 |
+
* Option to
|
|
|
33 |
|
34 |
Fixes:
|
35 |
+
* YouTube live links are now working correctly.
|
36 |
+
* TED embed url.
|
37 |
+
* Facebook embeds.
|
38 |
+
* Twitch embeds.
|
|
|
39 |
|
40 |
Improved:
|
41 |
+
* Generated iframe src will match what providers send over oembed.
|
42 |
+
* Lots of code improvements that may not be noticeable to users but took a lot of time and will make the plugin more maintainable and easier to extend.
|
43 |
+
* Removed the `lang` shortcode parameter that was only used for TED talks video subtitle display. This is now taken from the `language=x` url query.
|
44 |
+
* Embeds work though WPs oembed system now that comes with a more stable codebase and better caching system for embeds.
|
45 |
+
* Aspect ratios are now auto detected for all providers WP supports through oEmbed.
|
46 |
+
* Aspect ratio field is now auto filled when pasting a iframe embed code into the shortcode UI or Gutenberg UI.
|
47 |
+
* Removed jQuery dependency for frontend JavaScript.
|
48 |
+
* Prevent autoplay of multiple videos, only the first video on pageload will be autoplayed.
|
49 |
|
50 |
+
Removed:
|
51 |
+
* Hack to support direct embedding of Dropbox videos because it no longer works.
|
52 |
+
* Vimeo only `start` shortcode attribute. Use vimeo urls with `#t=30` at the end for starting time in seconds instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
+
Probably things I forgot about, working on this for ~1 year
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
### 2019-01-23 - 8.10.4 ###
|
57 |
|
58 |
+
* Fix: PHP compatibility lowered to offical 5.3 as there was accidentally 5.4+ code used. Make sure you are on PHP 7.3 or at least 5.6 for the upcoming future as WP itself will require 5.6 this year. Its also insecure to run on those outdated versions: https://secure.php.net/supported-versions.php.
|
59 |
|
60 |
### 2019-01-16 - 8.10.2 ###
|
61 |
|
383 |
* Improved: New default option for inview lazyload is 'On iOS, Android and Desktops when no thumbnail is found'.
|
384 |
* Improved: New installations will show a message guiding users to activation screen.
|
385 |
|
386 |
+
### 2016-11-29 - 7.9.19 ###
|
387 |
|
388 |
* Fix: 'Embed Video' Button not working with Advanced Custom Fields (Possibly fixed other 3rd party editor plugins compatibility issues as well) Thanks to David Trenear!
|
389 |
* Fix: Facebook URL detection for usernames with dots in them.
|
1087 |
* Removed Services that went down over the years
|
1088 |
* Changed the way shortcodes were implemented from regexp to wordpress 'add shortcode' function
|
1089 |
|
1090 |
+
### 2012-02-03 0.1 ###
|
1091 |
+
|
1092 |
+
* Started by improving the WordPress 'Video Embedder Plugin' but now complete new code `svn log --stop-on-copy --quiet https://plugins.svn.wordpress.org/advanced-responsive-video-embedder/ | tail -2` seems this plugins was submitted and approved in 2012, seems I have been working on this longer then I thought.
|
1093 |
+
|
1094 |
+
## Description ##
|
1095 |
+
|
1096 |
+
The best WordPress plugin for videos? Supports close to everything you can imagine, still keeping it easy & simple.
|
1097 |
+
|
1098 |
+
It is very likely the one and only plugin you will ever need to handle video embeds on your WordPress site(s). It goes far beyond just making your videos responsive!
|
1099 |
+
|
1100 |
+
[youtube https://www.youtube.com/watch?v=m6mkA6Zr1vY ]
|
1101 |
+
|
1102 |
+
* [Documentation](https://nextgenthemes.com/plugins/arve/documentation/)
|
1103 |
+
* [GitHub Page](https://github.com/nextgenthemes/advanced-responsive-video-embedder)
|
1104 |
+
* [Pro Addon](https://nextgenthemes.com/plugins/arve-pro/)
|
1105 |
+
|
1106 |
+
### Features ###
|
1107 |
+
|
1108 |
+
* SEO friendly, lets you specify title, description, upload date to provide search engines with the schema.org data they like to have for better indexing.
|
1109 |
+
* <abbr title="What You See Is What You Get">WYSIWYG</abbr> support. No more messing around with shortcodes and previewing.
|
1110 |
+
* New improved dialog for embedding videos.
|
1111 |
+
* Magically makes videos responsive you already embedded with WordPress default features.
|
1112 |
+
* No 'lock in' if you do not use the ARVE Gutenberg Block or shortcodes.
|
1113 |
+
* Supports [almost every video host](https://nextgenthemes.com/plugins/arve-pro/#support-table) that supports iframe embed codes.
|
1114 |
+
* Embeds via pasting the URL in its own line just like WordPress!
|
1115 |
+
* Optionally use very powerful Shortcodes instead.
|
1116 |
+
* Clean shortcode syntax `[arve url="https://youtu.be/yUCFRL43Zm4" align="left" parameters="start=30" ... /]`, no unnecessary shortcode wrapping.
|
1117 |
+
* One single button for all providers.
|
1118 |
+
* Responsive embeds with CSS, much better then with JavaScript.
|
1119 |
+
* Tries to be as unobtrusive as possible, sets 'hide brand' variables if supported, disables related videos at the end … to help keep people on your site rather then going to YouTube or keep watching videos.
|
1120 |
+
* Limited Autostart (for providers that support it, mobile browsers prevent this)
|
1121 |
+
* Custom URL parameters to use all options providers offer.
|
1122 |
+
* Optional maximal width.
|
1123 |
+
* Video alignment.
|
1124 |
+
* Detailed description of options in-place.
|
1125 |
+
* Automatic detected and custom aspect ratio.
|
1126 |
+
|
1127 |
+
### [Supported Providers](https://nextgenthemes.com/plugins/arve-pro/#support-table) ###
|
1128 |
+
|
1129 |
+
allmyvideos.net, Alugha, Archive.org, Break, Brightcove, CollegeHumor, Comedy Central, Dailymotion, Facebook, Funny or Die, IGN, Kickstarter, LiveLeak, Livestream, kla.tv, Metacafe, Movieweb, MPORA, Myspace, Snotr, Spike, TED Talks, Twitch, Veoh, Vevo, Viddler, vidspot.net, Vine, Vimeo, VK, Vzaar, Wistia, XTube, Yahoo, Youku, YouTube, YouTube Playlist, HTML5 video files directly, Google_drive, Dropbox, Ooyala
|
1130 |
+
[All providers with responsive iframe embed codes](https://nextgenthemes.com/plugins/arve/documentation/#general-iframe-embedding)
|
1131 |
+
|
1132 |
+
### Reviews ###
|
1133 |
+
|
1134 |
+
#### ★ ★ ★ ★ ★ The best there is – I have tried many… ####
|
1135 |
+
Have downloaded and paid for at least 4 other video players that use lightbox. Each one has major flaws. This products works perfectly. If you use the OnSite Editor, then just copy the short code and it works great.
|
1136 |
+
|
1137 |
+
[arve url="https://www.youtube.com/watch?v=Z7g8-GxLTSc" /]
|
1138 |
+
|
1139 |
+
For speed, the product uses the thumbnails from the server. So many of the other products do NOT do this and it slows the page rendering. This product should appear first on the WordPress search. Spent 3 days of my life wasted on other products, only to delete each one. [review by jodani](https://wordpress.org/support/plugin/advanced-responsive-video-embedder/reviews/?filter=5)
|
1140 |
+
|
1141 |
+
#### ★ ★ ★ ★ ★ Finally something that works ####
|
1142 |
+
So I have a responsive theme but on pages with you tube videos it wasn't making the you tube videos fit in the mobile screen. I have spent the last hour trying many plugins and researching on google and finally I installed this. And I didn't have to update any settings or anything just refreshed a post with videos and all the sudden it is beautiful and responsive on my mobile phone!!!!!! THANK YOU!!!! [review by happyecho](https://wordpress.org/support/plugin/advanced-responsive-video-embedder/reviews/?filter=5)
|
1143 |
+
|
1144 |
+
#### ★ ★ ★ ★ ★ Only Plug-in that worked ####
|
1145 |
+
I used a lot of high ranking plug-ins but they still broke my design. Downloaded this and worked right away. Thanks! [review by crconnell89](https://wordpress.org/support/plugin/advanced-responsive-video-embedder/reviews/?filter=5)
|
1146 |
+
|
1147 |
+
This plugin is financed by sales of the [Pro Addon](https://nextgenthemes.com/plugins/arve-pro/). The development and support of this plugins has become a job for me so I hope you understand that I can not make all features gratis and that you [purchase it](https://nextgenthemes.com/plugins/arve-pro/) to get extra features and support the development.
|
1148 |
+
|
1149 |
+
### [Pro Addon](https://nextgenthemes.com/plugins/arve-pro/) ###
|
1150 |
+
|
1151 |
+
Limited time price experiment: **44% off** first year with discount code `wporg`
|
1152 |
+
|
1153 |
+
* **Disable links in embeds (killer feature!)**<br>
|
1154 |
+
For example: Clicking on a title in a YouTube embed will not open a new popup/tab/window. **Prevent video hosts to lead your visitors away from your site!** Note this also breaks sharing functionality and is not possible when the provider requires flash. Try it on [this page](https://nextgenthemes.com/plugins/arve-pro/). Right click on links still works.
|
1155 |
+
* **Lazyload mode**<br>
|
1156 |
+
Make your site load **faster** by loading only a image instead of the entire video player on pageload.
|
1157 |
+
* **Lazyload -> Lightbox**<br>
|
1158 |
+
Shows the Video in a Lightbox after clicking a preview image
|
1159 |
+
* **Link -> Lightbox**<br>
|
1160 |
+
Use simple links as triggers for lightboxed videos
|
1161 |
+
* Automatic or custom thumbnail images
|
1162 |
+
* Automatic or custom titles on top of your thumbnails
|
1163 |
+
* 'Expand on click' feature
|
1164 |
+
* 3 hover styles
|
1165 |
+
* 2 play icon styles to choose from
|
1166 |
+
* Responsive thumbnails using cutting edge HTML5 technology
|
1167 |
+
* **Feel good about yourself**<br>
|
1168 |
+
for supporting my 5+ years work on this plugin. Tons of hours, weekends … always worked on improving it.
|
1169 |
+
* Show the latest video of a YouTube channel by using the channel URL (updated/cached hourly)
|
1170 |
+
* **[Get the ARVE Pro Addon](https://nextgenthemes.com/plugins/arve-pro/)**
|
1171 |
+
|
1172 |
+
### ARVE AMP Addon ###
|
1173 |
+
|
1174 |
+
* Requires the gratis plugins [ARVE](https://wordpress.org/plugins/advanced-responsive-video-embedder/) and [AMP](https://wordpress.org/plugins/amp/)
|
1175 |
+
* Makes ARVE ready for Accelerated Mobile Pages (AMP)
|
1176 |
+
* It will display videos embedded with ARVE on AMP pages correctly
|
1177 |
+
* No options, just works
|
1178 |
+
* It creates <amp-brightcove>, <amp-youtube>, <amp-vimeo>, <amp-dailymotion> elements
|
1179 |
+
* For all other video hosts supported by ARVE <amp-iframe> element is used
|
1180 |
+
* HTML5 video embeds are also supported with <amp-video>
|
1181 |
+
* **[Check out the ARVE AMP Addon](https://nextgenthemes.com/plugins/arve-amp/)**
|
1182 |
+
|
1183 |
+
### Thanks ###
|
1184 |
+
|
1185 |
+
* Of course all the customers who bought a addon.
|
1186 |
+
* Howard Iken of [myfloridalaw.com](https://www.myfloridalaw.com) top donor, super nice to me even if I was rude and not deserved it!
|
1187 |
+
* [Ilya Grishkov](https://www.ilyagrishkov.com) for bringing up the idea and the first code to cache thumbnail urls.
|
1188 |
+
* Everybody giving constructive feedback, testing beta versions.
|
1189 |
+
* Everybody who donated back in the days when this was donation based.
|
1190 |
+
|
1191 |
+
### Thanks to the developers of the software used in ARVE ###
|
1192 |
+
|
1193 |
+
* [Shortcode UI](https://wordpress.org/plugins/shortcode-ui/), optional Plugin, utilized by ARVE
|
1194 |
+
* [Lity Lightbox](http://sorgalla.com/lity/), used in [Pro Addon](https://nextgenthemes.com/plugins/arve-pro/)
|
1195 |
+
|
1196 |
+
## Installation ##
|
1197 |
+
|
1198 |
+
Please refer to [codex.wordpress.org/Managing_Plugins#Automatic_Plugin_Installation](https://codex.wordpress.org/Managing_Plugins#Automatic_Plugin_Installation).
|
1199 |
+
|
1200 |
+
## Frequently Asked Questions ##
|
1201 |
+
|
1202 |
+
### I have a problem ... ###
|
1203 |
+
|
1204 |
+
Please report it on [nextgenthemes.com/support/](https://nextgenthemes.com/support/) **and please do not on the wordpess.org forums, thanks.**
|
1205 |
+
|
1206 |
+
### How to get the pro version working? ###
|
1207 |
+
|
1208 |
+
1. Go though the purchase process on [nextgenthemes.com/arve-pro/](https://nextgenthemes.com/arve-pro/)
|
1209 |
+
1. Follow the 3 easy steps you get with the purchase receipt. It is basically downloading a arve-pro.zip and installing it through your WordPress Admin panel.
|
1210 |
+
|
1211 |
+
### Why are my videos not filling their container? ###
|
1212 |
+
|
1213 |
+
You are most likely use `align`, this plugin has a option for limiting video width with alignment. If you want your videos to fill their containers then you should not use the `align` shortcode attribute. This assumes that you left the 'Video Maximal Width' field on the options page empty.
|
1214 |
+
|
1215 |
+
### Can you add a video provider? ###
|
1216 |
+
|
1217 |
+
I have no plans on implementing providers that include videos via JavaScript such as www.nicovideo.jp. I also will not implement video services from mainstream media news organizations. For others, feel free to ask.
|
1218 |
+
|
1219 |
+
### How do I embed videos from a unlisted providers / iframes? ###
|
1220 |
+
|
1221 |
+
This plugin not changes anything to usual HTML `<iframe>` embed codes you have to use the shortcode creator dialog and paste iframe embed codes there or write them manually. They will become `[arve url="https://..."]`. The url represents what is the `src` in HTML embeds. It works as simple as this, if the [arve] shortcode does not detect a known URL structure then it will treat the URL as a `src` for the iframe.
|
1222 |
|
1223 |
+
### Why does my YouTube video not repeat/loop? ###
|
1224 |
+
|
1225 |
+
This plugins embed is considered as 'custom player' by YouTube so you have to pass the video ID as playlist parameters to make the loop work.
|
1226 |
+
|
1227 |
+
`[arve url="https://www.youtube.com/watch?v=pvRqvX413Ik" parameters="loop=1&playlist=pvRqvX413Ik"]`
|
1228 |
+
|
1229 |
+
## Screenshots ##
|
1230 |
+
|
1231 |
+
1. Shortcode dialog
|
1232 |
+
2. Main Options
|
1233 |
+
2. URL Parameter Options
|
1234 |
+
3. Pro Options
|
shared/functions-shared.php
DELETED
@@ -1,1187 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function arve_get_options_defaults( $section ) {
|
4 |
-
|
5 |
-
$options['main'] = array(
|
6 |
-
'align_maxwidth' => 400,
|
7 |
-
'align' => 'none',
|
8 |
-
'always_enqueue_assets' => false,
|
9 |
-
'autoplay' => false,
|
10 |
-
'mode' => 'normal',
|
11 |
-
'promote_link' => false,
|
12 |
-
'video_maxwidth' => 0,
|
13 |
-
'wp_image_cache_time' => 18000,
|
14 |
-
'last_settings_tab' => '',
|
15 |
-
'wp_video_override' => true,
|
16 |
-
'controlslist' => 'nodownload',
|
17 |
-
'vimeo_api_token' => '',
|
18 |
-
'youtube_nocookie' => true,
|
19 |
-
);
|
20 |
-
|
21 |
-
$properties = arve_get_host_properties();
|
22 |
-
unset( $properties['video'] );
|
23 |
-
|
24 |
-
foreach ( $properties as $provider => $values ) {
|
25 |
-
|
26 |
-
if ( ! empty( $values['embed_url'] ) ) {
|
27 |
-
$options['shortcodes'][ $provider ] = $provider;
|
28 |
-
}
|
29 |
-
if ( isset( $values['default_params'] ) ) {
|
30 |
-
$options['params'][ $provider ] = $values['default_params'];
|
31 |
-
}
|
32 |
-
}
|
33 |
-
|
34 |
-
return $options[ $section ];
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Get options by merging possibly existing options with defaults
|
39 |
-
*/
|
40 |
-
function arve_get_options() {
|
41 |
-
|
42 |
-
$options = wp_parse_args( get_option( 'arve_options_main', array() ), arve_get_options_defaults( 'main' ) );
|
43 |
-
|
44 |
-
$supported_modes = arve_get_supported_modes();
|
45 |
-
|
46 |
-
# legacy mode name
|
47 |
-
if ( 'thumbnail' === $options['mode'] ) {
|
48 |
-
|
49 |
-
$options['mode'] = 'lazyload';
|
50 |
-
update_option( 'arve_options_main', $options );
|
51 |
-
}
|
52 |
-
|
53 |
-
if ( ! in_array( $options['mode'], array( 'normal', 'lazyload', 'lazyload-lightbox', 'link-lightbox' ), true ) ) {
|
54 |
-
|
55 |
-
$options['mode'] = 'lazyload';
|
56 |
-
update_option( 'arve_options_main', $options );
|
57 |
-
}
|
58 |
-
|
59 |
-
$options['shortcodes'] = wp_parse_args( get_option( 'arve_options_shortcodes', array() ), arve_get_options_defaults( 'shortcodes' ) );
|
60 |
-
$options['params'] = wp_parse_args( get_option( 'arve_options_params', array() ), arve_get_options_defaults( 'params' ) );
|
61 |
-
|
62 |
-
return $options;
|
63 |
-
}
|
64 |
-
|
65 |
-
function arve_get_settings_definitions() {
|
66 |
-
|
67 |
-
$options = arve_get_options();
|
68 |
-
$supported_modes = arve_get_supported_modes();
|
69 |
-
$properties = arve_get_host_properties();
|
70 |
-
|
71 |
-
foreach ( $properties as $provider => $values ) {
|
72 |
-
|
73 |
-
if ( ! empty( $values['auto_thumbnail'] ) ) {
|
74 |
-
$auto_thumbs[] = $values['name'];
|
75 |
-
}
|
76 |
-
if ( ! empty( $values['auto_title'] ) ) {
|
77 |
-
$auto_title[] = $values['name'];
|
78 |
-
}
|
79 |
-
if ( ! empty( $values['requires_src'] ) ) {
|
80 |
-
$embed_code_only[] = $values['name'];
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
$auto_thumbs = implode( ', ', $auto_thumbs );
|
85 |
-
$auto_title = implode( ', ', $auto_title );
|
86 |
-
$embed_code_only = implode( ', ', $embed_code_only );
|
87 |
-
|
88 |
-
if ( in_array( $options['mode'], $supported_modes, true ) ) {
|
89 |
-
$current_mode_name = $supported_modes[ $options['mode'] ];
|
90 |
-
} else {
|
91 |
-
$current_mode_name = $options['mode'];
|
92 |
-
}
|
93 |
-
|
94 |
-
$definitions = array(
|
95 |
-
array(
|
96 |
-
'hide_from_settings' => true,
|
97 |
-
'attr' => 'url',
|
98 |
-
'label' => esc_html__( 'URL / Embed Code', ARVE_SLUG ),
|
99 |
-
'type' => 'text',
|
100 |
-
'meta' => array(
|
101 |
-
'placeholder' => esc_attr__( 'Video URL / iframe Embed Code', ARVE_SLUG ),
|
102 |
-
),
|
103 |
-
'description' => sprintf(
|
104 |
-
__( 'Post the URL of the video here. For %1$s and any <a href="%2$s">unlisted</a> video hosts paste their iframe embed codes or its src URL in here (providers embeds need to be responsive).', ARVE_SLUG ),
|
105 |
-
$embed_code_only,
|
106 |
-
'https://nextgenthemes.com/arve-pro/#video-host-support'
|
107 |
-
)
|
108 |
-
),
|
109 |
-
array(
|
110 |
-
'attr' => 'mode',
|
111 |
-
'label' => esc_html__( 'Mode', ARVE_SLUG ),
|
112 |
-
'type' => 'select',
|
113 |
-
'options' =>
|
114 |
-
array( '' => sprintf( esc_html__( 'Default (current setting: %s)', ARVE_SLUG ), $current_mode_name ) ) +
|
115 |
-
arve_get_supported_modes(),
|
116 |
-
),
|
117 |
-
array(
|
118 |
-
'attr' => 'align',
|
119 |
-
'label' => esc_html__( 'Alignment', ARVE_SLUG ),
|
120 |
-
'type' => 'select',
|
121 |
-
'options' => array(
|
122 |
-
'' => sprintf( esc_html__( 'Default (current setting: %s)', ARVE_SLUG ), $options['align'] ),
|
123 |
-
'none' => esc_html__( 'None', ARVE_SLUG ),
|
124 |
-
'left' => esc_html__( 'Left', ARVE_SLUG ),
|
125 |
-
'right' => esc_html__( 'Right', ARVE_SLUG ),
|
126 |
-
'center' => esc_html__( 'center', ARVE_SLUG ),
|
127 |
-
),
|
128 |
-
),
|
129 |
-
array(
|
130 |
-
'attr' => 'promote_link',
|
131 |
-
'label' => esc_html__( 'ARVE Link', ARVE_SLUG ),
|
132 |
-
'type' => 'select',
|
133 |
-
'options' => array(
|
134 |
-
'' => sprintf(
|
135 |
-
__( 'Default (current setting: %s)', ARVE_SLUG ),
|
136 |
-
( $options['promote_link'] ) ? esc_html__( 'Yes', ARVE_SLUG ) : esc_html__( 'No', ARVE_SLUG )
|
137 |
-
),
|
138 |
-
'yes' => esc_html__( 'Yes', ARVE_SLUG ),
|
139 |
-
'no' => esc_html__( 'No', ARVE_SLUG ),
|
140 |
-
),
|
141 |
-
'description' => esc_html__( "Shows a small 'ARVE' link below the videos. Be the most awesome person and help promoting this plugin.", ARVE_SLUG ),
|
142 |
-
),
|
143 |
-
array(
|
144 |
-
'hide_from_settings' => true,
|
145 |
-
'attr' => 'thumbnail',
|
146 |
-
'label' => esc_html__( 'Thumbnail', ARVE_SLUG ),
|
147 |
-
'type' => 'attachment',
|
148 |
-
'libraryType' => array( 'image' ),
|
149 |
-
'addButton' => esc_html__( 'Select Image', ARVE_SLUG ),
|
150 |
-
'frameTitle' => esc_html__( 'Select Image', ARVE_SLUG ),
|
151 |
-
'description' => sprintf( esc_html__( 'Preview image for Lazyload modes, always used for SEO. The Pro Addon is able to get them from %s automatically.', ARVE_SLUG ), $auto_thumbs ),
|
152 |
-
),
|
153 |
-
array(
|
154 |
-
'hide_from_settings' => true,
|
155 |
-
'attr' => 'title',
|
156 |
-
'label' => esc_html__( 'Title', ARVE_SLUG ),
|
157 |
-
'type' => 'text',
|
158 |
-
'description' => sprintf( esc_html__( 'Used for SEO, is visible on top of thumbnails in Lazyload modes, is used as link text in link-lightbox mode. The Pro Addon is able to get them from %s automatically.', ARVE_SLUG ), $auto_title ),
|
159 |
-
),
|
160 |
-
array(
|
161 |
-
'hide_from_settings' => true,
|
162 |
-
'attr' => 'description',
|
163 |
-
'label' => esc_html__( 'Description', ARVE_SLUG ),
|
164 |
-
'type' => 'text',
|
165 |
-
'meta' => array(
|
166 |
-
'placeholder' => __( 'Description for SEO', ARVE_SLUG ),
|
167 |
-
)
|
168 |
-
),
|
169 |
-
array(
|
170 |
-
'hide_from_settings' => true,
|
171 |
-
'attr' => 'upload_date',
|
172 |
-
'label' => esc_html__( 'Upload Date', ARVE_SLUG ),
|
173 |
-
'type' => 'text',
|
174 |
-
'meta' => array(
|
175 |
-
'placeholder' => __( 'Upload Date for SEO, ISO 8601 format', ARVE_SLUG ),
|
176 |
-
)
|
177 |
-
),
|
178 |
-
array(
|
179 |
-
'hide_from_settings' => true,
|
180 |
-
'attr' => 'duration',
|
181 |
-
'label' => esc_html__( 'Duration', ARVE_SLUG ),
|
182 |
-
'type' => 'text',
|
183 |
-
'description' => __( 'Duration in this format. <code>1HJ2M3S</code> for 1 hour, 2 minutes and 3 seconds. <code>5M</code> for 5 minutes.', ARVE_SLUG ),
|
184 |
-
),
|
185 |
-
array(
|
186 |
-
'attr' => 'autoplay',
|
187 |
-
'label' => esc_html__( 'Autoplay', ARVE_SLUG ),
|
188 |
-
'type' => 'select',
|
189 |
-
'options' => array(
|
190 |
-
'' => sprintf(
|
191 |
-
__( 'Default (current setting: %s)', ARVE_SLUG ),
|
192 |
-
( $options['autoplay'] ) ? esc_html__( 'Yes', ARVE_SLUG ) : esc_html__( 'No', ARVE_SLUG )
|
193 |
-
),
|
194 |
-
'yes' => esc_html__( 'Yes', ARVE_SLUG ),
|
195 |
-
'no' => esc_html__( 'No', ARVE_SLUG ),
|
196 |
-
),
|
197 |
-
'description' => esc_html__( 'Autoplay videos in normal mode, has no effect on lazyload modes.', ARVE_SLUG ),
|
198 |
-
),
|
199 |
-
array(
|
200 |
-
'hide_from_sc' => true,
|
201 |
-
'attr' => 'video_maxwidth',
|
202 |
-
'label' => esc_html__( 'Maximal Width', ARVE_SLUG ),
|
203 |
-
'type' => 'number',
|
204 |
-
'description' => __( 'Maximal size your videos can be displayed, if set to 0 it will default to your themes <code>$content_width</code>.', ARVE_SLUG ),
|
205 |
-
),
|
206 |
-
array(
|
207 |
-
'hide_from_settings' => true,
|
208 |
-
'attr' => 'maxwidth',
|
209 |
-
'label' => esc_html__( 'Maximal Width', ARVE_SLUG ),
|
210 |
-
'type' => 'number',
|
211 |
-
'meta' => array(
|
212 |
-
'placeholder' => esc_attr__( 'in px - leave empty to use settings', ARVE_SLUG ),
|
213 |
-
),
|
214 |
-
),
|
215 |
-
array(
|
216 |
-
'hide_from_sc' => true,
|
217 |
-
'attr' => 'align_maxwidth',
|
218 |
-
'label' => esc_html__( 'Align Maximal Width', ARVE_SLUG ),
|
219 |
-
'type' => 'number',
|
220 |
-
'description' => esc_attr__( 'In px, Needed! Must be 100+ to work.', ARVE_SLUG ),
|
221 |
-
),
|
222 |
-
array(
|
223 |
-
'hide_from_settings' => true,
|
224 |
-
'attr' => 'aspect_ratio',
|
225 |
-
'label' => __( 'Aspect Ratio', ARVE_SLUG ),
|
226 |
-
'type' => 'text',
|
227 |
-
'meta' => array(
|
228 |
-
'placeholder' => __( 'Custom aspect ratio like 4:3, 21:9 ... Leave empty for default.', ARVE_SLUG ),
|
229 |
-
),
|
230 |
-
),
|
231 |
-
array(
|
232 |
-
'hide_from_settings' => true,
|
233 |
-
'attr' => 'parameters',
|
234 |
-
'label' => esc_html__( 'Parameters', ARVE_SLUG ),
|
235 |
-
'type' => 'text',
|
236 |
-
'meta' => array(
|
237 |
-
'placeholder' => __( 'provider specific parameters', ARVE_SLUG ),
|
238 |
-
),
|
239 |
-
'description' => sprintf(
|
240 |
-
__(
|
241 |
-
'Note this values get merged with values set on the <a target="_blank" href="%1$s">ARVE setting page</a>. Example for YouTube <code>fs=0&start=30</code>. For reference: <a target="_blank" href="%2$s">Youtube Parameters</a>, <a target="_blank" href="%3$s">Dailymotion Parameters</a>, <a target="_blank" href="%4$s">Vimeo Parameters</a>.',
|
242 |
-
ARVE_SLUG
|
243 |
-
),
|
244 |
-
admin_url( 'admin.php?page=advanced-responsive-video-embedder' ),
|
245 |
-
'https://developers.google.com/youtube/player_parameters',
|
246 |
-
'http://www.dailymotion.com/doc/api/player.html#parameters',
|
247 |
-
'https://developer.vimeo.com/player/embedding',
|
248 |
-
'TODO settings page link'
|
249 |
-
),
|
250 |
-
),
|
251 |
-
array(
|
252 |
-
'hide_from_sc' => true,
|
253 |
-
'attr' => 'wp_image_cache_time',
|
254 |
-
'label' => esc_html__( 'Image Cache Time', ARVE_SLUG ),
|
255 |
-
'type' => 'number',
|
256 |
-
'description' => __( '(seconds) This plugin uses WordPress transients to cache video thumbnail URLS. This setting defines how long image URLs from the media Gallery are being stored before running WPs fuctions again to request them. For example: hour - 3600, day - 86400, week - 604800.', ARVE_SLUG ),
|
257 |
-
),
|
258 |
-
array(
|
259 |
-
'hide_from_sc' => true,
|
260 |
-
'attr' => 'wp_video_override',
|
261 |
-
'label' => esc_html__( 'Use ARVE for HTML5 video embeds', ARVE_SLUG ),
|
262 |
-
'type' => 'select',
|
263 |
-
'options' => array(
|
264 |
-
'yes' => esc_html__( 'Yes', ARVE_SLUG ),
|
265 |
-
'no' => esc_html__( 'No', ARVE_SLUG ),
|
266 |
-
),
|
267 |
-
'description' => esc_html__( 'Use ARVE to embed HTML5 video files. ARVE uses the browsers players instead of loading the mediaelement player that WP uses.', ARVE_SLUG ),
|
268 |
-
),
|
269 |
-
array(
|
270 |
-
'attr' => 'controlslist',
|
271 |
-
'label' => esc_html__( 'Chrome HTML5 Player controls', ARVE_SLUG ),
|
272 |
-
'type' => 'text',
|
273 |
-
'description' => __( 'controlsList attribute on <video> for example use <code>nodownload nofullscreen noremoteplayback</code> to hide the download and the fullscreen button on the chrome HTML5 video player and disable remote playback.', ARVE_SLUG ),
|
274 |
-
),
|
275 |
-
array(
|
276 |
-
'hide_from_settings' => true,
|
277 |
-
'attr' => 'mp4',
|
278 |
-
'label' => esc_html__( 'mp4 file', ARVE_SLUG ),
|
279 |
-
'type' => 'url',
|
280 |
-
'meta' => array(
|
281 |
-
'placeholder' => __( '.mp4 file url for HTML5 video', ARVE_SLUG ),
|
282 |
-
),
|
283 |
-
),
|
284 |
-
array(
|
285 |
-
'hide_from_settings' => true,
|
286 |
-
'attr' => 'webm',
|
287 |
-
'label' => esc_html__( 'webm file', ARVE_SLUG ),
|
288 |
-
'type' => 'url',
|
289 |
-
'meta' => array(
|
290 |
-
'placeholder' => __( '.webm file url for HTML5 video', ARVE_SLUG ),
|
291 |
-
),
|
292 |
-
),
|
293 |
-
array(
|
294 |
-
'hide_from_settings' => true,
|
295 |
-
'attr' => 'ogv',
|
296 |
-
'label' => esc_html__( 'ogv file', ARVE_SLUG ),
|
297 |
-
'type' => 'url',
|
298 |
-
// phpcs:disable Squiz.PHP.CommentedOutCode.Found
|
299 |
-
#'type' => 'attachment',
|
300 |
-
#'libraryType' => array( 'video' ),
|
301 |
-
#'addButton' => esc_html__( 'Select .ogv file', ARVE_SLUG ),
|
302 |
-
#'frameTitle' => esc_html__( 'Select .ogv file', ARVE_SLUG ),
|
303 |
-
// phpcs:enable Squiz.PHP.CommentedOutCode.Found
|
304 |
-
'meta' => array(
|
305 |
-
'placeholder' => __( '.ogv file url for HTML5 video', ARVE_SLUG ),
|
306 |
-
),
|
307 |
-
),
|
308 |
-
array(
|
309 |
-
'hide_from_settings' => true,
|
310 |
-
'attr' => 'controls',
|
311 |
-
'label' => esc_html__( 'Show Controls?', ARVE_SLUG ),
|
312 |
-
'type' => 'select',
|
313 |
-
'options' => array(
|
314 |
-
'' => esc_html__( 'Yes', ARVE_SLUG ),
|
315 |
-
'no' => esc_html__( 'No', ARVE_SLUG ),
|
316 |
-
),
|
317 |
-
'description' => esc_html__( 'Show controls on HTML5 video.', ARVE_SLUG ),
|
318 |
-
),
|
319 |
-
array(
|
320 |
-
'hide_from_settings' => true,
|
321 |
-
'attr' => 'loop',
|
322 |
-
'label' => esc_html__( 'Loop?', ARVE_SLUG ),
|
323 |
-
'type' => 'select',
|
324 |
-
'options' => array(
|
325 |
-
'' => esc_html__( 'No', ARVE_SLUG ),
|
326 |
-
'yes' => esc_html__( 'Yes', ARVE_SLUG ),
|
327 |
-
),
|
328 |
-
'description' => esc_html__( 'Loop HTML5 video.', ARVE_SLUG ),
|
329 |
-
),
|
330 |
-
array(
|
331 |
-
'hide_from_settings' => true,
|
332 |
-
'attr' => 'muted',
|
333 |
-
'label' => esc_html__( 'Mute?', ARVE_SLUG ),
|
334 |
-
'type' => 'select',
|
335 |
-
'options' => array(
|
336 |
-
'' => esc_html__( 'No', ARVE_SLUG ),
|
337 |
-
'yes' => esc_html__( 'Yes', ARVE_SLUG ),
|
338 |
-
),
|
339 |
-
'description' => esc_html__( 'Mute HTML5 video.', ARVE_SLUG ),
|
340 |
-
),
|
341 |
-
array(
|
342 |
-
'hide_from_sc' => true,
|
343 |
-
'attr' => 'always_enqueue_assets',
|
344 |
-
'label' => esc_html__( 'Assent loading', ARVE_SLUG ),
|
345 |
-
'type' => 'select',
|
346 |
-
'options' => array(
|
347 |
-
'no' => esc_html__( 'When ARVE video is detected', ARVE_SLUG ),
|
348 |
-
'yes' => esc_html__( 'Always', ARVE_SLUG ),
|
349 |
-
),
|
350 |
-
'description' => sprintf(
|
351 |
-
__( 'Usually ARVE will loads its scripts and styles only on pages what need them. In case your content is loaded via AJAX or the styles are not loaded for another reason you may have to enable this option', ARVE_SLUG ),
|
352 |
-
'https://nextgenthemes.com/plugins/arve-pro/#support-table'
|
353 |
-
),
|
354 |
-
),
|
355 |
-
array(
|
356 |
-
'hide_from_sc' => true,
|
357 |
-
'attr' => 'youtube_nocookie',
|
358 |
-
'label' => esc_html__( 'Use youtube-nocookie.com url?', ARVE_SLUG ),
|
359 |
-
'type' => 'select',
|
360 |
-
'options' => array(
|
361 |
-
'yes' => esc_html__( 'Yes', ARVE_SLUG ),
|
362 |
-
'no' => esc_html__( 'No', ARVE_SLUG ),
|
363 |
-
),
|
364 |
-
'description' => esc_html__( 'Privacy enhanced mode, will NOT disable cookies but only sets them when a user starts to play a video. There is currently a youtube bug that opens highlighed video boxes with a wrong -nocookie.com url so you need to disble this if you need those.', ARVE_SLUG ),
|
365 |
-
),
|
366 |
-
array(
|
367 |
-
'hide_from_sc' => true,
|
368 |
-
'attr' => 'vimeo_api_token',
|
369 |
-
'label' => esc_html__( 'Video API Token', ARVE_SLUG ),
|
370 |
-
'type' => 'text',
|
371 |
-
'description' => sprintf(
|
372 |
-
__( 'Needed for <a href="%s">Random Video Addon</a>.', ARVE_SLUG ),
|
373 |
-
'https://nextgenthemes.local/plugins/arve-random-video/'
|
374 |
-
),
|
375 |
-
),
|
376 |
-
);
|
377 |
-
|
378 |
-
$definitions = apply_filters( 'arve_settings_definitions', $definitions );
|
379 |
-
|
380 |
-
return $definitions;
|
381 |
-
}
|
382 |
-
|
383 |
-
/**
|
384 |
-
*
|
385 |
-
*
|
386 |
-
* @since 5.4.0
|
387 |
-
*/
|
388 |
-
function arve_get_mode_options( $selected ) {
|
389 |
-
|
390 |
-
$modes = arve_get_supported_modes();
|
391 |
-
|
392 |
-
$out = '';
|
393 |
-
|
394 |
-
foreach ( $modes as $mode => $desc ) {
|
395 |
-
|
396 |
-
$out .= sprintf(
|
397 |
-
'<option value="%s" %s>%s</option>',
|
398 |
-
esc_attr( $mode ),
|
399 |
-
selected( $selected, $mode, false ),
|
400 |
-
$desc
|
401 |
-
);
|
402 |
-
}
|
403 |
-
|
404 |
-
return $out;
|
405 |
-
}
|
406 |
-
|
407 |
-
function arve_get_supported_modes() {
|
408 |
-
return apply_filters( 'arve_modes', array( 'normal' => __( 'Normal', ARVE_SLUG ) ) );
|
409 |
-
}
|
410 |
-
|
411 |
-
function arve_get_iframe_providers() {
|
412 |
-
|
413 |
-
}
|
414 |
-
|
415 |
-
function arve_get_host_properties() {
|
416 |
-
|
417 |
-
$s = 'https?://(www\.)?';
|
418 |
-
|
419 |
-
$properties = array(
|
420 |
-
'allmyvideos' => array(
|
421 |
-
'name' => 'allmyvideos.net',
|
422 |
-
'regex' => $s . 'allmyvideos\.net/(embed-)?(?<id>[a-z0-9]+)',
|
423 |
-
'embed_url' => 'https://allmyvideos.net/embed-%s.html',
|
424 |
-
'tests' => array(
|
425 |
-
array(
|
426 |
-
'url' => 'https://allmyvideos.net/1bno5g9il7ha',
|
427 |
-
'id' => '1bno5g9il7ha',
|
428 |
-
),
|
429 |
-
array(
|
430 |
-
'url' => 'https://allmyvideos.net/embed-1bno5g9il7ha.html',
|
431 |
-
'id' => '1bno5g9il7ha',
|
432 |
-
),
|
433 |
-
)
|
434 |
-
),
|
435 |
-
'alugha' => array(
|
436 |
-
'regex' => $s . 'alugha\.com/(1/)?videos/(?<id>[a-z0-9_\-]+)',
|
437 |
-
'embed_url' => 'https://alugha.com/embed/web-player/?v=%s',
|
438 |
-
'default_params' => 'nologo=1',
|
439 |
-
'auto_thumbnail' => true,
|
440 |
-
'tests' => array(
|
441 |
-
array(
|
442 |
-
'url' => 'https://alugha.com/1/videos/youtube-54m1YfEuYU8',
|
443 |
-
'id' => 'youtube-54m1YfEuYU8',
|
444 |
-
),
|
445 |
-
array(
|
446 |
-
'url' => 'https://alugha.com/videos/7cab9cd7-f64a-11e5-939b-c39074d29b86',
|
447 |
-
'id' => '7cab9cd7-f64a-11e5-939b-c39074d29b86',
|
448 |
-
),
|
449 |
-
)
|
450 |
-
),
|
451 |
-
'archiveorg' => array(
|
452 |
-
'name' => 'Archive.org',
|
453 |
-
'regex' => $s . 'archive\.org/(details|embed)/(?<id>[0-9a-z\-]+)',
|
454 |
-
'embed_url' => 'https://www.archive.org/embed/%s/',
|
455 |
-
'default_params' => '',
|
456 |
-
'auto_thumbnail' => false,
|
457 |
-
'tests' => array(
|
458 |
-
array(
|
459 |
-
'url' => 'https://archive.org/details/arashyekt4_gmail_Cat',
|
460 |
-
'id' => 'arashyekt4'
|
461 |
-
),
|
462 |
-
)
|
463 |
-
),
|
464 |
-
'break' => array(
|
465 |
-
'regex' => 'https?://(www\.|view\.)break\.com/(video/|embed/)?[-a-z0-9]*?(?<id>[0-9]+)',
|
466 |
-
'embed_url' => 'http://break.com/embed/%s',
|
467 |
-
'default_params' => 'embed=1',
|
468 |
-
'auto_thumbnail' => false,
|
469 |
-
'tests' => array(
|
470 |
-
array(
|
471 |
-
'url' => 'http://www.break.com/video/first-person-pov-of-tornado-strike-2542591-test',
|
472 |
-
'id' => 2542591,
|
473 |
-
),
|
474 |
-
array(
|
475 |
-
'url' => 'http://view.break.com/2542591-test',
|
476 |
-
'id' => 2542591,
|
477 |
-
),
|
478 |
-
array(
|
479 |
-
'url' => 'http://www.break.com/embed/2542591?embed=1',
|
480 |
-
'id' => 2542591,
|
481 |
-
),
|
482 |
-
)
|
483 |
-
),
|
484 |
-
'brightcove' => array(
|
485 |
-
'regex' => 'https?://(players|link)\.brightcove\.net/(?<brightcove_account>[0-9]+)/(?<brightcove_player>[a-z0-9]+)_(?<brightcove_embed>[a-z0-9]+)/index\.html\?videoId=(?<id>[0-9]+)',
|
486 |
-
'embed_url' => 'https://players.brightcove.net/%s/%s_%s/index.html?videoId=%s',
|
487 |
-
'requires_src' => true,
|
488 |
-
'tests' => array(
|
489 |
-
array(
|
490 |
-
'url' => 'http://players.brightcove.net/1160438696001/default_default/index.html?videoId=4587535845001',
|
491 |
-
'brightcove_account' => 1160438696001,
|
492 |
-
'brightcove_player' => 'default',
|
493 |
-
'brightcove_embed' => 'default',
|
494 |
-
'id' => 4587535845001,
|
495 |
-
),
|
496 |
-
array(
|
497 |
-
'url' => 'http://players.brightcove.net/5107476400001/B1xUkhW8i_default/index.html?videoId=5371391223001',
|
498 |
-
'brightcove_account' => 5107476400001,
|
499 |
-
'brightcove_player' => 'B1xUkhW8i',
|
500 |
-
'brightcove_embed' => 'default',
|
501 |
-
'id' => 5371391223001,
|
502 |
-
),
|
503 |
-
),
|
504 |
-
),
|
505 |
-
'collegehumor' => array(
|
506 |
-
'name' => 'CollegeHumor',
|
507 |
-
'regex' => $s . 'collegehumor\.com/video/(?<id>[0-9]+)',
|
508 |
-
'embed_url' => 'http://www.collegehumor.com/e/%s',
|
509 |
-
'auto_thumbnail' => true,
|
510 |
-
'auto_title' => true,
|
511 |
-
'aspect_ratio' => '600:369',
|
512 |
-
'tests' => array(
|
513 |
-
array(
|
514 |
-
'url' => 'http://www.collegehumor.com/video/6854928/troopers-holopad',
|
515 |
-
'id' => 6854928,
|
516 |
-
'oembed_title' => 'Troopers Holopad',
|
517 |
-
),
|
518 |
-
)
|
519 |
-
),
|
520 |
-
'comedycentral' => array(
|
521 |
-
'name' => 'Comedy Central',
|
522 |
-
'regex' => 'https?://media\.mtvnservices\.com/embed/mgid:arc:video:comedycentral\.com:(?<id>[-a-z0-9]{36})',
|
523 |
-
'embed_url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:%s',
|
524 |
-
'requires_src' => true,
|
525 |
-
'auto_thumbnail' => false,
|
526 |
-
'tests' => array(
|
527 |
-
array(
|
528 |
-
'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:c80adf02-3e24-437a-8087-d6b77060571c',
|
529 |
-
'id' => 'c80adf02-3e24-437a-8087-d6b77060571c',
|
530 |
-
),
|
531 |
-
array(
|
532 |
-
'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:comedycentral.com:c3c1da76-96c2-48b4-b38d-8bb16fbf7a58',
|
533 |
-
'id' => 'c3c1da76-96c2-48b4-b38d-8bb16fbf7a58',
|
534 |
-
),
|
535 |
-
)
|
536 |
-
),
|
537 |
-
'dailymotion' => array(
|
538 |
-
'regex' => $s . '(dai\.ly|dailymotion\.com/video)/(?<id>[a-z0-9]+)',
|
539 |
-
'embed_url' => 'https://www.dailymotion.com/embed/video/%s',
|
540 |
-
'default_params' => 'logo=0&hideInfos=1&related=0',
|
541 |
-
'auto_thumbnail' => true,
|
542 |
-
'auto_title' => true,
|
543 |
-
'tests' => array(
|
544 |
-
array(
|
545 |
-
'url' => 'http://www.dailymotion.com/video/x41ia79_mass-effect-andromeda-gameplay-alpha_videogames',
|
546 |
-
'id' => 'x41ia79',
|
547 |
-
'oembed_title' => 'Mass Effect Andromeda - Gameplay Alpha',
|
548 |
-
),
|
549 |
-
array(
|
550 |
-
'url' => 'http://dai.ly/x3cwlqz',
|
551 |
-
'id' => 'x3cwlqz',
|
552 |
-
'oembed_title' => 'Mass Effect Andromeda',
|
553 |
-
),
|
554 |
-
),
|
555 |
-
'query_args' => array(
|
556 |
-
'api' => array(
|
557 |
-
'name' => __( 'API', ARVE_SLUG ),
|
558 |
-
'type' => 'bool',
|
559 |
-
),
|
560 |
-
),
|
561 |
-
'query_argss' => array(
|
562 |
-
'api' => array( 0, 1 ),
|
563 |
-
'autoplay' => array( 0, 1 ),
|
564 |
-
'chromeless' => array( 0, 1 ),
|
565 |
-
'highlight' => array( 0, 1 ),
|
566 |
-
'html' => array( 0, 1 ),
|
567 |
-
'id' => 'int',
|
568 |
-
'info' => array( 0, 1 ),
|
569 |
-
'logo' => array( 0, 1 ),
|
570 |
-
'network' => array( 'dsl', 'cellular' ),
|
571 |
-
'origin' => array( 0, 1 ),
|
572 |
-
'quality' => array( 240, 380, 480, 720, 1080, 1440, 2160 ),
|
573 |
-
'related' => array( 0, 1 ),
|
574 |
-
'start' => 'int',
|
575 |
-
'startscreen' => array( 0, 1 ),
|
576 |
-
'syndication' => 'int',
|
577 |
-
'webkit-playsinline' => array( 0, 1 ),
|
578 |
-
'wmode' => array( 'direct', 'opaque' ),
|
579 |
-
),
|
580 |
-
),
|
581 |
-
'dailymotionlist' => array(
|
582 |
-
# http://www.dailymotion.com/playlist/x3yk8p_PHIL-MDS_nature-et-environnement-2011/1#video=xm3x45
|
583 |
-
# http://www.dailymotion.com/widget/jukebox?list[]=%2Fplaylist%2Fx3yk8p_PHIL-MDS_nature-et-environnement-2011%2F1&&autoplay=0&mute=0
|
584 |
-
|
585 |
-
'regex' => $s . 'dailymotion\.com/playlist/(?<id>[a-z0-9]+)',
|
586 |
-
'embed_url' => 'https://www.dailymotion.com/widget/jukebox?list[]=%2Fplaylist%2F%s%2F1&',
|
587 |
-
'auto_thumbnail' => false,
|
588 |
-
'tests' => array(
|
589 |
-
array(
|
590 |
-
'url' => 'http://www.dailymotion.com/playlist/x3yk8p_PHIL-MDS_nature-et-environnement-2011/1#video=xm3x45',
|
591 |
-
'id' => 'x3yk8p',
|
592 |
-
)
|
593 |
-
)
|
594 |
-
),
|
595 |
-
'facebook' => array(
|
596 |
-
# https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/?type=2&theater
|
597 |
-
#<iframe src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2FTheKillingsOfTonyBlair%2Fvideos%2Fvb.551089058285349%2F562955837098671%2F%3Ftype%3D2%26theater&width=500&show_text=false&height=280&appId" width="500" height="280" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
|
598 |
-
'regex' => '(?<id>https?://([a-z]+\.)?facebook\.com/[-.a-z0-9]+/videos/[a-z.0-9/]+)',
|
599 |
-
'url_encode_id' => true,
|
600 |
-
'embed_url' => 'https://www.facebook.com/plugins/video.php?href=%s',
|
601 |
-
'auto_thumbnail' => true,
|
602 |
-
'tests' => array(
|
603 |
-
array(
|
604 |
-
'url' => 'https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/?type=2&theater',
|
605 |
-
'id' => 'https://www.facebook.com/TheKillingsOfTonyBlair/videos/vb.551089058285349/562955837098671/',
|
606 |
-
),
|
607 |
-
array(
|
608 |
-
'url' => 'https://web.facebook.com/XTvideo/videos/10153906059711871/',
|
609 |
-
'id' => 'https://web.facebook.com/XTvideo/videos/10153906059711871/',
|
610 |
-
),
|
611 |
-
),
|
612 |
-
),
|
613 |
-
'funnyordie' => array(
|
614 |
-
'name' => 'Funny or Die',
|
615 |
-
'regex' => $s . 'funnyordie\.com/videos/(?<id>[a-z0-9_]+)',
|
616 |
-
'embed_url' => 'https://www.funnyordie.com/embed/%s',
|
617 |
-
'auto_thumbnail' => true,
|
618 |
-
'auto_title' => true,
|
619 |
-
'aspect_ratio' => '640:400',
|
620 |
-
'tests' => array(
|
621 |
-
array(
|
622 |
-
'url' => 'http://www.funnyordie.com/videos/76585438d8/sarah-silverman-s-we-are-miracles-hbo-special',
|
623 |
-
'id' => '76585438d8',
|
624 |
-
'oembed_title' => "Sarah Silverman's - We Are Miracles HBO Special",
|
625 |
-
),
|
626 |
-
)
|
627 |
-
),
|
628 |
-
'ign' => array(
|
629 |
-
'name' => 'IGN',
|
630 |
-
'regex' => '(?<id>' . $s . 'ign\.com/videos/[0-9]{4}/[0-9]{2}/[0-9]{2}/[0-9a-z\-]+)',
|
631 |
-
'embed_url' => 'http://widgets.ign.com/video/embed/content.html?url=%s',
|
632 |
-
'auto_thumbnail' => false,
|
633 |
-
'tests' => array(
|
634 |
-
array(
|
635 |
-
'url' => 'http://www.ign.com/videos/2012/03/06/mass-effect-3-video-review',
|
636 |
-
'id' => 'http://www.ign.com/videos/2012/03/06/mass-effect-3-video-review',
|
637 |
-
),
|
638 |
-
)
|
639 |
-
),
|
640 |
-
#https://cdnapisec.kaltura.com/p/243342/sp/24334200/embedIframeJs/uiconf_id/20540612/partner_id/243342?iframeembed=true&playerId=kaltura_player&entry_id=1_sf5ovm7u&flashvars[streamerType]=auto" width="560" height="395" allowfullscreen webkitallowfullscreen mozAllowFullScreen frameborder="0"></iframe>
|
641 |
-
'kickstarter' => array(
|
642 |
-
'regex' => $s . 'kickstarter\.com/projects/(?<id>[0-9a-z\-]+/[-0-9a-z\-]+)',
|
643 |
-
'embed_url' => 'https://www.kickstarter.com/projects/%s/widget/video.html',
|
644 |
-
'auto_thumbnail' => false,
|
645 |
-
'tests' => array(
|
646 |
-
array(
|
647 |
-
'url' => 'https://www.kickstarter.com/projects/obsidian/project-eternity?ref=discovery',
|
648 |
-
'id' => 'obsidian/project-eternity'
|
649 |
-
),
|
650 |
-
array(
|
651 |
-
'url' => 'https://www.kickstarter.com/projects/trinandtonic/friendship-postcards?ref=category_featured',
|
652 |
-
'id' => 'trinandtonic/friendship-postcards'
|
653 |
-
),
|
654 |
-
)
|
655 |
-
),
|
656 |
-
'liveleak' => array(
|
657 |
-
'name' => 'LiveLeak',
|
658 |
-
'regex' => $s . 'liveleak\.com/(view|ll_embed)\?(?<id>(f|i)=[0-9a-z\_]+)',
|
659 |
-
'embed_url' => 'https://www.liveleak.com/ll_embed?%s',
|
660 |
-
'default_params' => '',
|
661 |
-
'auto_thumbnail' => true,
|
662 |
-
'tests' => array(
|
663 |
-
array(
|
664 |
-
'url' => 'http://www.liveleak.com/view?i=703_1385224413',
|
665 |
-
'id' => 'i=703_1385224413'
|
666 |
-
), # Page/item 'i=' URL
|
667 |
-
array(
|
668 |
-
'url' => 'http://www.liveleak.com/view?f=c85bdf5e45b2',
|
669 |
-
'id' => 'f=c85bdf5e45b2'
|
670 |
-
), #File f= URL
|
671 |
-
),
|
672 |
-
'test_ids' => array(
|
673 |
-
'f=c85bdf5e45b2',
|
674 |
-
'c85bdf5e45b2'
|
675 |
-
),
|
676 |
-
),
|
677 |
-
'livestream' => array(
|
678 |
-
'regex' => $s . 'livestream\.com/accounts/(?<id>[0-9]+/events/[0-9]+(/videos/[0-9]+)?)',
|
679 |
-
'embed_url' => 'https://livestream.com/accounts/%s/player',
|
680 |
-
'default_params' => 'width=1280&height=720&enableInfoAndActivity=true&defaultDrawer=&mute=false',
|
681 |
-
'auto_thumbnail' => false,
|
682 |
-
'tests' => array(
|
683 |
-
# https://livestream.com/accounts/23470201/events/7021166
|
684 |
-
# <iframe id="ls_embed_1491401341" src="https://livestream.com/accounts/4683311/events/3747538/player?width=640&height=360&enableInfoAndActivity=true&defaultDrawer=&autoPlay=true&mute=false" width="640" height="360" frameborder="0" scrolling="no" allowfullscreen> </iframe>
|
685 |
-
# https://livestream.com/DemocracyNow/dirtywars/videos/17500857
|
686 |
-
# <iframe id="ls_embed_1491412166" src="https://livestream.com/accounts/467901/events/2015991/videos/17500857/player?width=640&height=360&enableInfo=true&defaultDrawer=&autoPlay=true&mute=false" width="640" height="360" frameborder="0" scrolling="no" allowfullscreen> </iframe>
|
687 |
-
array(
|
688 |
-
'url' => 'https://livestream.com/accounts/23470201/events/7021166',
|
689 |
-
'id' => '23470201/events/7021166'
|
690 |
-
),
|
691 |
-
array(
|
692 |
-
'url' => 'https://livestream.com/accounts/467901/events/2015991/videos/17500857/player?width=640&height=360&enableInfo=true&defaultDrawer=&autoPlay=true&mute=false',
|
693 |
-
'id' => '467901/events/2015991/videos/17500857'
|
694 |
-
),
|
695 |
-
),
|
696 |
-
),
|
697 |
-
'klatv' => array(
|
698 |
-
'regex' => $s . 'kla(gemauer)?.tv/(?<id>[0-9]+)',
|
699 |
-
'embed_url' => 'https://www.kla.tv/index.php?a=showembed&vidid=%s',
|
700 |
-
'name' => 'kla.tv',
|
701 |
-
'url' => true,
|
702 |
-
'auto_thumbnail' => false,
|
703 |
-
'tests' => array(
|
704 |
-
array(
|
705 |
-
'url' => 'http://www.klagemauer.tv/9106',
|
706 |
-
'id' => 9106
|
707 |
-
),
|
708 |
-
array(
|
709 |
-
'url' => 'http://www.kla.tv/9122',
|
710 |
-
'id' => 9122
|
711 |
-
),
|
712 |
-
),
|
713 |
-
),
|
714 |
-
'metacafe' => array(
|
715 |
-
'regex' => $s . 'metacafe\.com/(watch|fplayer)/(?<id>[0-9]+)',
|
716 |
-
'embed_url' => 'http://www.metacafe.com/embed/%s/',
|
717 |
-
'auto_thumbnail' => false,
|
718 |
-
'tests' => array(
|
719 |
-
array(
|
720 |
-
'url' => 'http://www.metacafe.com/watch/11433151/magical-handheld-fireballs/',
|
721 |
-
'id' => 11433151
|
722 |
-
),
|
723 |
-
array(
|
724 |
-
'url' => 'http://www.metacafe.com/watch/11322264/everything_wrong_with_robocop_in_7_minutes/',
|
725 |
-
'id' => 11322264
|
726 |
-
),
|
727 |
-
),
|
728 |
-
),
|
729 |
-
'movieweb' => array(
|
730 |
-
'regex' => $s . 'movieweb\.com/v/(?<id>[a-z0-9]{14})',
|
731 |
-
'embed_url' => 'http://movieweb.com/v/%s/embed',
|
732 |
-
'auto_thumbnail' => false,
|
733 |
-
'requires_src' => true,
|
734 |
-
'tests' => array(
|
735 |
-
array(
|
736 |
-
'url' => 'http://movieweb.com/v/VIOF6ytkiMEMSR/embed',
|
737 |
-
'id' => 'VIOF6ytkiMEMSR'
|
738 |
-
),
|
739 |
-
),
|
740 |
-
),
|
741 |
-
'myspace' => array(
|
742 |
-
#<iframe width="480" height="270" src="//media.myspace.com/play/video/house-of-lies-season-5-premiere-109903807-112606834" frameborder="0" allowtransparency="true" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe><p><a href="https://media.myspace.com/showtime/video/house-of-lies-season-5-premiere/109903807">House of Lies Season 5 Premiere</a> from <a href="https://media.myspace.com/Showtime">Showtime</a> on <a href="https://media.myspace.com">Myspace</a>.</p>
|
743 |
-
'regex' => $s . 'myspace\.com/.+/(?<id>[0-9]+)',
|
744 |
-
'embed_url' => 'https://media.myspace.com/play/video/%s',
|
745 |
-
'auto_thumbnail' => false,
|
746 |
-
'tests' => array(
|
747 |
-
array(
|
748 |
-
'url' => 'https://myspace.com/myspace/video/dark-rooms-the-shadow-that-looms-o-er-my-heart-live-/109471212',
|
749 |
-
'id' => 109471212
|
750 |
-
),
|
751 |
-
)
|
752 |
-
),
|
753 |
-
'snotr' => array(
|
754 |
-
'regex' => $s . 'snotr\.com/(video|embed)/(?<id>[0-9]+)',
|
755 |
-
'embed_url' => 'http://www.snotr.com/embed/%s',
|
756 |
-
'auto_thumbnail' => false,
|
757 |
-
'tests' => array(
|
758 |
-
array(
|
759 |
-
'url' => 'http://www.snotr.com/video/12314/How_big_a_truck_blind_spot_really_is',
|
760 |
-
'id' => 12314,
|
761 |
-
),
|
762 |
-
)
|
763 |
-
),
|
764 |
-
'spike' => array(
|
765 |
-
'regex' => 'https?://media.mtvnservices.com/embed/mgid:arc:video:spike\.com:(?<id>[a-z0-9\-]{36})',
|
766 |
-
'embed_url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:spike.com:%s',
|
767 |
-
'requires_src' => true,
|
768 |
-
'auto_thumbnail' => false,
|
769 |
-
'tests' => array(
|
770 |
-
array(
|
771 |
-
'url' => 'http://media.mtvnservices.com/embed/mgid:arc:video:spike.com:6a219882-c412-46ce-a8c9-32e043396621',
|
772 |
-
'id' => '6a219882-c412-46ce-a8c9-32e043396621',
|
773 |
-
),
|
774 |
-
),
|
775 |
-
),
|
776 |
-
'ted' => array(
|
777 |
-
'name' => 'TED Talks',
|
778 |
-
'regex' => $s . 'ted\.com/talks/(?<id>[a-z0-9_]+)',
|
779 |
-
'embed_url' => 'https://embed-ssl.ted.com/talks/%s.html',
|
780 |
-
'auto_thumbnail' => true,
|
781 |
-
'auto_title' => true,
|
782 |
-
'tests' => array(
|
783 |
-
array(
|
784 |
-
'url' => 'https://www.ted.com/talks/margaret_stewart_how_youtube_thinks_about_copyright',
|
785 |
-
'id' => 'margaret_stewart_how_youtube_thinks_about_copyright'
|
786 |
-
),
|
787 |
-
),
|
788 |
-
),
|
789 |
-
'twitch' => array(
|
790 |
-
'regex' => $s . 'twitch.tv/(?!directory)(?|[a-z0-9_]+/v/(?<id>[0-9]+)|(?<id>[a-z0-9_]+))',
|
791 |
-
'embed_url' => 'https://player.twitch.tv/?channel=%s', # if numeric id https://player.twitch.tv/?video=v%s
|
792 |
-
'auto_thumbnail' => true,
|
793 |
-
'tests' => array(
|
794 |
-
array(
|
795 |
-
'url' => 'https://www.twitch.tv/whiskeyexperts',
|
796 |
-
'id' => 'whiskeyexperts',
|
797 |
-
'api_img_contains' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/whiskyexperts',
|
798 |
-
),
|
799 |
-
array(
|
800 |
-
'url' => 'https://www.twitch.tv/imaqtpie',
|
801 |
-
'id' => 'imaqtpie',
|
802 |
-
'api_img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/imaqtpie',
|
803 |
-
),
|
804 |
-
array(
|
805 |
-
'url' => 'https://www.twitch.tv/imaqtpie/v/95318019',
|
806 |
-
'id' => 95318019,
|
807 |
-
'api_img' => 'https://static-cdn.jtvnw.net/jtv_user_pictures/imaqtpie',
|
808 |
-
),
|
809 |
-
),
|
810 |
-
),
|
811 |
-
'ustream' => array(
|
812 |
-
'regex' => $s . 'ustream\.tv/(embed/)?(channel/)?(?<id>[0-9]+|recorded/[0-9]+(/highlight/[0-9]+)?)',
|
813 |
-
'embed_url' => 'http://www.ustream.tv/embed/%s',
|
814 |
-
'default_params' => 'html5ui',
|
815 |
-
'auto_thumbnail' => false,
|
816 |
-
'aspect_ratio' => '480:270',
|
817 |
-
'tests' => array(
|
818 |
-
array(
|
819 |
-
'url' => 'http://www.ustream.tv/recorded/59999872?utm_campaign=ustre.am&utm_source=ustre.am/:43KHS&utm_medium=social&utm_content=20170405204127',
|
820 |
-
'id' => 'recorded/59999872'
|
821 |
-
),
|
822 |
-
array(
|
823 |
-
'url' => 'http://www.ustream.tv/embed/17074538?wmode=transparent&v=3&autoplay=false',
|
824 |
-
'id' => '17074538'
|
825 |
-
),
|
826 |
-
),
|
827 |
-
),
|
828 |
-
'rutube' => array(
|
829 |
-
'name' => 'RuTube.ru',
|
830 |
-
'regex' => $s . 'rutube\.ru/play/embed/(?<id>[0-9]+)',
|
831 |
-
'embed_url' => 'https://rutube.ru/play/embed/%s',
|
832 |
-
'tests' => array(
|
833 |
-
array(
|
834 |
-
'url' => 'https://rutube.ru/play/embed/9822149',
|
835 |
-
'id' => '9822149'
|
836 |
-
),
|
837 |
-
),
|
838 |
-
),
|
839 |
-
'veoh' => array(
|
840 |
-
'regex' => $s . 'veoh\.com/watch/(?<id>[a-z0-9]+)',
|
841 |
-
'embed_url' => 'http://www.veoh.com/swf/webplayer/WebPlayer.swf?version=AFrontend.5.7.0.1396&permalinkId=%s',
|
842 |
-
'default_params' => 'player=videodetailsembedded&id=anonymous',
|
843 |
-
'auto_thumbnail' => false,
|
844 |
-
'tests' => array(
|
845 |
-
array(
|
846 |
-
'url' => 'http://www.veoh.com/watch/v19866882CAdjNF9b',
|
847 |
-
'id' => 'v19866882CAdjNF9b'
|
848 |
-
),
|
849 |
-
)
|
850 |
-
),
|
851 |
-
'vevo' => array(
|
852 |
-
'regex' => $s . 'vevo\.com/watch/([^\/]+/[^\/]+/)?(?<id>[a-z0-9]+)',
|
853 |
-
'embed_url' => 'https://scache.vevo.com/assets/html/embed.html?video=%s',
|
854 |
-
'default_params' => 'playlist=false&playerType=embedded&env=0',
|
855 |
-
'auto_thumbnail' => false,
|
856 |
-
'tests' => array(
|
857 |
-
array(
|
858 |
-
'url' => 'https://www.vevo.com/watch/the-offspring/the-kids-arent-alright/USSM20100649',
|
859 |
-
'id' => 'USSM20100649'
|
860 |
-
),
|
861 |
-
),
|
862 |
-
),
|
863 |
-
'viddler' => array(
|
864 |
-
'regex' => $s . 'viddler\.com/(embed|v)/(?<id>[a-z0-9]{8})',
|
865 |
-
'embed_url' => 'https://www.viddler.com/embed/%s/',
|
866 |
-
'default_params' => '?f=1&player=full&secret=59822701&disablebackwardseek=false&disableseek=false&disableforwardseek=false&make_responsive=false&loop=false&nologo=false&hd=false',
|
867 |
-
'auto_thumbnail' => false,
|
868 |
-
'auto_title' => false,
|
869 |
-
'aspect_ratio' => '545:349',
|
870 |
-
'tests' => array(
|
871 |
-
array(
|
872 |
-
'url' => 'https://www.viddler.com/v/a695c468',
|
873 |
-
'id' => 'a695c468'
|
874 |
-
),
|
875 |
-
),
|
876 |
-
),
|
877 |
-
'vidspot' => array(
|
878 |
-
'name' => 'vidspot.net',
|
879 |
-
'regex' => $s . 'vidspot\.net/(embed-)?(?<id>[a-z0-9]+)',
|
880 |
-
'embed_url' => 'http://vidspot.net/embed-%s.html',
|
881 |
-
'tests' => array(
|
882 |
-
array(
|
883 |
-
'url' => 'http://vidspot.net/285wf9uk3rry',
|
884 |
-
'id' => '285wf9uk3rry'
|
885 |
-
),
|
886 |
-
array(
|
887 |
-
'url' => 'http://vidspot.net/embed-285wf9uk3rry.html',
|
888 |
-
'id' => '285wf9uk3rry'
|
889 |
-
),
|
890 |
-
),
|
891 |
-
),
|
892 |
-
'vine' => array(
|
893 |
-
'regex' => $s . 'vine\.co/v/(?<id>[a-z0-9]+)',
|
894 |
-
'embed_url' => 'https://vine.co/v/%s/embed/simple',
|
895 |
-
'default_params' => '', //* audio=1 supported
|
896 |
-
'auto_thumbnail' => false,
|
897 |
-
'aspect_ratio' => '1:1',
|
898 |
-
'tests' => array(
|
899 |
-
array(
|
900 |
-
'url' => 'https://vine.co/v/bjAaLxQvOnQ',
|
901 |
-
'id' => 'bjAaLxQvOnQ'
|
902 |
-
),
|
903 |
-
array(
|
904 |
-
'url' => 'https://vine.co/v/MbrreglaFrA',
|
905 |
-
'id' => 'MbrreglaFrA'
|
906 |
-
),
|
907 |
-
array(
|
908 |
-
'url' => 'https://vine.co/v/bjHh0zHdgZT/embed',
|
909 |
-
'id' => 'bjHh0zHdgZT'
|
910 |
-
),
|
911 |
-
),
|
912 |
-
),
|
913 |
-
'vimeo' => array(
|
914 |
-
'regex' => 'https?://(player\.)?vimeo\.com/((video/)|(channels/[a-z]+/)|(groups/[a-z]+/videos/))?(?<id>[0-9]+)(?<vimeo_secret>/[0-9a-z]+)?',
|
915 |
-
'embed_url' => 'https://player.vimeo.com/video/%s',
|
916 |
-
'default_params' => 'html5=1&title=1&byline=0&portrait=0',
|
917 |
-
'auto_thumbnail' => true,
|
918 |
-
'auto_title' => true,
|
919 |
-
'tests' => array(
|
920 |
-
array(
|
921 |
-
'url' => 'https://vimeo.com/124400795',
|
922 |
-
'id' => 124400795
|
923 |
-
),
|
924 |
-
array(
|
925 |
-
'url' => 'https://player.vimeo.com/124400795',
|
926 |
-
'id' => 124400795
|
927 |
-
),
|
928 |
-
),
|
929 |
-
),
|
930 |
-
'vk' => array(
|
931 |
-
'name' => 'VK',
|
932 |
-
'regex' => $s . 'vk\.com/video_ext\.php\?(?<id>[^ ]+)',
|
933 |
-
'embed_url' => 'https://vk.com/video_ext.php?%s',
|
934 |
-
'requires_src' => true,
|
935 |
-
'auto_thumbnail' => false,
|
936 |
-
'tests' => array(
|
937 |
-
array(
|
938 |
-
'url' => 'https://vk.com/video_ext.php?oid=162756656&id=171388096&hash=b82cc24232fe7f9f&hd=1',
|
939 |
-
'id' => 'oid=162756656&id=171388096&hash=b82cc24232fe7f9f&hd=1'
|
940 |
-
),
|
941 |
-
),
|
942 |
-
),
|
943 |
-
'vzaar' => array(
|
944 |
-
'regex' => $s . 'vzaar.(com|tv)/(videos/)?(?<id>[0-9]+)',
|
945 |
-
'embed_url' => 'https://view.vzaar.com/%s/player',
|
946 |
-
'tests' => array(
|
947 |
-
array(
|
948 |
-
'url' => 'https://vzaar.com/videos/993324',
|
949 |
-
'id' => 993324
|
950 |
-
),
|
951 |
-
array(
|
952 |
-
'url' => 'https://vzaar.com/videos/1515906',
|
953 |
-
'id' => 1515906
|
954 |
-
),
|
955 |
-
),
|
956 |
-
),
|
957 |
-
'wistia' => array(
|
958 |
-
'regex' => 'https?://fast\.wistia\.net/embed/iframe/(?<id>[a-z0-9]+)',
|
959 |
-
'embed_url' => 'https://fast.wistia.net/embed/iframe/%s',
|
960 |
-
'default_params' => 'videoFoam=true',
|
961 |
-
'tests' => array(
|
962 |
-
array(
|
963 |
-
'url' => 'https://fast.wistia.net/embed/iframe/g5pnf59ala?videoFoam=true',
|
964 |
-
'id' => 'g5pnf59ala'
|
965 |
-
),
|
966 |
-
),
|
967 |
-
),
|
968 |
-
'xtube' => array(
|
969 |
-
'name' => 'XTube',
|
970 |
-
'regex' => $s . 'xtube\.com/watch\.php\?v=(?<id>[a-z0-9_\-]+)',
|
971 |
-
'embed_url' => 'http://www.xtube.com/embedded/user/play.php?v=%s',
|
972 |
-
'auto_thumbnail' => false,
|
973 |
-
'tests' => array(
|
974 |
-
array(
|
975 |
-
'url' => 'http://www.xtube.com/watch.php?v=1234',
|
976 |
-
'id' => 1234
|
977 |
-
),
|
978 |
-
),
|
979 |
-
),
|
980 |
-
'yahoo' => array(
|
981 |
-
'regex' => '(?<id>https?://([a-z.]+)yahoo\.com/[/-a-z0-9öäü]+\.html)',
|
982 |
-
'embed_url' => '%s',
|
983 |
-
'default_params' => 'format=embed',
|
984 |
-
'auto_thumbnail' => true,
|
985 |
-
'auto_title' => true,
|
986 |
-
'tests' => array(
|
987 |
-
array(
|
988 |
-
'url' => 'https://de.sports.yahoo.com/video/krasse-vorher-nachher-bilder-mann-094957265.html?format=embed&player_autoplay=false',
|
989 |
-
'id' => 'https://de.sports.yahoo.com/video/krasse-vorher-nachher-bilder-mann-094957265.html'
|
990 |
-
),
|
991 |
-
array(
|
992 |
-
'url' => 'https://www.yahoo.com/movies/sully-trailer-4-211012511.html?format=embed',
|
993 |
-
'id' => 'https://www.yahoo.com/movies/sully-trailer-4-211012511.html'
|
994 |
-
),
|
995 |
-
)
|
996 |
-
),
|
997 |
-
'youku' => array(
|
998 |
-
'regex' => 'https?://([a-z.]+)?\.youku.com/(embed/|v_show/id_)(?<id>[a-z0-9]+)',
|
999 |
-
'embed_url' => 'https://player.youku.com/embed/%s',
|
1000 |
-
'auto_thumbnail' => false,
|
1001 |
-
'tests' => array(
|
1002 |
-
array(
|
1003 |
-
'url' => 'http://v.youku.com/v_show/id_XMTczMDAxMjIyNA==.html?f=27806190',
|
1004 |
-
'id' => 'XMTczMDAxMjIyNA',
|
1005 |
-
),
|
1006 |
-
array(
|
1007 |
-
'url' => 'http://player.youku.com/embed/XMTUyODYwOTc4OA==',
|
1008 |
-
'id' => 'XMTUyODYwOTc4OA',
|
1009 |
-
),
|
1010 |
-
),
|
1011 |
-
),
|
1012 |
-
'youtube' => array(
|
1013 |
-
'name' => 'YouTube',
|
1014 |
-
'regex' => $s . '(youtube\.com\/\S*((\/e(mbed))?\/|watch\?(\S*?&?v\=))|youtu\.be\/)(?<id>[a-zA-Z0-9_-]{6,11}((\?|&)list=[a-z0-9_\-]+)?)',
|
1015 |
-
'embed_url' => 'https://www.youtube.com/embed/%s',
|
1016 |
-
'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1',
|
1017 |
-
'auto_thumbnail' => true,
|
1018 |
-
'auto_title' => true,
|
1019 |
-
'tests' => array(
|
1020 |
-
array(
|
1021 |
-
'url' => 'https://youtu.be/dqLyB5srdGI',
|
1022 |
-
'id' => 'dqLyB5srdGI',
|
1023 |
-
),
|
1024 |
-
array(
|
1025 |
-
'url' => 'https://www.youtube.com/watch?v=-fEo3kgHFaw',
|
1026 |
-
'id' => '-fEo3kgHFaw',
|
1027 |
-
),
|
1028 |
-
array(
|
1029 |
-
'url' => 'http://www.youtube.com/watch?v=vrXgLhkv21Y',
|
1030 |
-
'id' => 'vrXgLhkv21Y',
|
1031 |
-
'oembed_title' => 'TerrorStorm Full length version',
|
1032 |
-
),
|
1033 |
-
array(
|
1034 |
-
'url' => 'https://youtu.be/hRonZ4wP8Ys',
|
1035 |
-
'id' => 'hRonZ4wP8Ys',
|
1036 |
-
'oembed_title' => 'One Bright Dot',
|
1037 |
-
),
|
1038 |
-
array(
|
1039 |
-
'url' => 'http://www.youtube.com/watch?v=GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA&index=10', # The index part will be ignored
|
1040 |
-
'id' => 'GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA'
|
1041 |
-
),
|
1042 |
-
array(
|
1043 |
-
'url' => 'https://youtu.be/b8m9zhNAgKs?list=PLI_7Mg2Z_-4I-W_lI55D9lBUkC66ftHMg',
|
1044 |
-
'id' => 'b8m9zhNAgKs?list=PLI_7Mg2Z_-4I-W_lI55D9lBUkC66ftHMg'
|
1045 |
-
),
|
1046 |
-
),
|
1047 |
-
'specific_tests' => array(
|
1048 |
-
__( 'URL from youtu.be shortener', ARVE_SLUG ),
|
1049 |
-
'http://youtu.be/3Y8B93r2gKg',
|
1050 |
-
__( 'Youtube playlist URL inlusive the video to start at. The index part will be ignored and is not needed', ARVE_SLUG ),
|
1051 |
-
'http://www.youtube.com/watch?v=GjL82KUHVb0&list=PLI46g-I12_9qGBq-4epxOay0hotjys5iA&index=10',
|
1052 |
-
__( 'Loop a YouTube video', ARVE_SLUG ),
|
1053 |
-
'[youtube id="FKkejo2dMV4" parameters="playlist=FKkejo2dMV4&loop=1"]',
|
1054 |
-
__( 'Enable annotations and related video at the end (disable by default with this plugin)', ARVE_SLUG ),
|
1055 |
-
'[youtube id="uCQXKYPiz6M" parameters="iv_load_policy=1"]',
|
1056 |
-
__( 'Testing Youtube Starttimes', ARVE_SLUG ),
|
1057 |
-
'http://youtu.be/vrXgLhkv21Y?t=1h19m14s',
|
1058 |
-
'http://youtu.be/vrXgLhkv21Y?t=19m14s',
|
1059 |
-
'http://youtu.be/vrXgLhkv21Y?t=1h',
|
1060 |
-
'http://youtu.be/vrXgLhkv21Y?t=5m',
|
1061 |
-
'http://youtu.be/vrXgLhkv21Y?t=30s',
|
1062 |
-
__( 'The Parameter start only takes values in seconds, this will start the video at 1 minute and 1 second', ARVE_SLUG ),
|
1063 |
-
'[youtube id="uCQXKYPiz6M" parameters="start=61"]',
|
1064 |
-
),
|
1065 |
-
),
|
1066 |
-
'youtubelist' => array(
|
1067 |
-
'regex' => $s . 'youtube\.com/(embed/videoseries|playlist)\?list=(?<id>[-a-z0-9_]+)',
|
1068 |
-
'name' => 'YouTube Playlist',
|
1069 |
-
'embed_url' => 'https://www.youtube.com/embed/videoseries?list=%s',
|
1070 |
-
'default_params' => 'iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1',
|
1071 |
-
'auto_thumbnail' => true,
|
1072 |
-
'tests' => array(
|
1073 |
-
array(
|
1074 |
-
'url' => 'https://www.youtube.com/playlist?list=PL3Esg-ZzbiUmeSKBAQ3ej1hQxDSsmnp-7',
|
1075 |
-
'id' => 'PL3Esg-ZzbiUmeSKBAQ3ej1hQxDSsmnp-7'
|
1076 |
-
),
|
1077 |
-
array(
|
1078 |
-
'url' => 'https://www.youtube.com/embed/videoseries?list=PLMUvgtCRyn-6obmhiDS4n5vYQN3bJRduk',
|
1079 |
-
'id' => 'PLMUvgtCRyn-6obmhiDS4n5vYQN3bJRduk',
|
1080 |
-
)
|
1081 |
-
)
|
1082 |
-
),
|
1083 |
-
'html5' => array(
|
1084 |
-
'name' => 'HTML5 video files directly',
|
1085 |
-
'aspect_ratio' => false,
|
1086 |
-
),
|
1087 |
-
'iframe' => array(
|
1088 |
-
'embed_url' => '%s',
|
1089 |
-
'default_params' => '',
|
1090 |
-
'auto_thumbnail' => false,
|
1091 |
-
'tests' => array(
|
1092 |
-
array(
|
1093 |
-
'url' => 'https://example.com/',
|
1094 |
-
'id' => 'https://example.com/'
|
1095 |
-
),
|
1096 |
-
),
|
1097 |
-
),
|
1098 |
-
'google_drive' => array( 'name', 'Google Drive' ),
|
1099 |
-
'dropbox' => null,
|
1100 |
-
'ooyala' => null,
|
1101 |
-
);
|
1102 |
-
|
1103 |
-
foreach ( $properties as $key => $value ) {
|
1104 |
-
|
1105 |
-
if ( empty( $value['name'] ) ) {
|
1106 |
-
$properties[ $key ]['name'] = ucfirst( $key );
|
1107 |
-
}
|
1108 |
-
if ( ! isset( $value['aspect_ratio'] ) ) {
|
1109 |
-
$properties[ $key ]['aspect_ratio'] = '16:9';
|
1110 |
-
}
|
1111 |
-
}
|
1112 |
-
|
1113 |
-
return $properties;
|
1114 |
-
}
|
1115 |
-
|
1116 |
-
function arve_attr( $attr = array() ) {
|
1117 |
-
|
1118 |
-
if ( empty( $attr ) ) {
|
1119 |
-
return '';
|
1120 |
-
}
|
1121 |
-
|
1122 |
-
$html = '';
|
1123 |
-
|
1124 |
-
foreach ( $attr as $key => $value ) {
|
1125 |
-
|
1126 |
-
if ( false === $value || null === $value ) {
|
1127 |
-
continue;
|
1128 |
-
} elseif ( '' === $value || true === $value ) {
|
1129 |
-
$html .= sprintf( ' %s', esc_html( $key ) );
|
1130 |
-
} elseif ( in_array( $key, array( 'href', 'data-href', 'src', 'data-src' ), true ) ) {
|
1131 |
-
$html .= sprintf( ' %s="%s"', esc_html( $key ), arve_esc_url( $value ) );
|
1132 |
-
} else {
|
1133 |
-
$html .= sprintf( ' %s="%s"', esc_html( $key ), esc_attr( $value ) );
|
1134 |
-
}
|
1135 |
-
}
|
1136 |
-
|
1137 |
-
return $html;
|
1138 |
-
}
|
1139 |
-
|
1140 |
-
function arve_esc_url( $url ) {
|
1141 |
-
return str_replace( 'jukebox?list%5B0%5D', 'jukebox?list[]', esc_url( $url ) );
|
1142 |
-
}
|
1143 |
-
|
1144 |
-
function arve_starts_with( $haystack, $needle ) {
|
1145 |
-
// search backwards starting from haystack length characters from the end
|
1146 |
-
return $needle === '' || strrpos( $haystack, $needle, -strlen( $haystack ) ) !== false; // phpcs:ignore WordPress.PHP.YodaConditions.NotYoda
|
1147 |
-
}
|
1148 |
-
|
1149 |
-
function arve_ends_with( $haystack, $needle ) {
|
1150 |
-
// search forward starting from end minus needle length characters
|
1151 |
-
return $needle === '' || ( ( $temp = strlen( $haystack ) - strlen( $needle ) ) >= 0 && strpos( $haystack, $needle, $temp ) !== false ); // phpcs:ignore
|
1152 |
-
}
|
1153 |
-
|
1154 |
-
function arve_contains( $haystack, $needle ) {
|
1155 |
-
return strpos( $haystack, $needle ) !== false;
|
1156 |
-
}
|
1157 |
-
|
1158 |
-
function arve_register_asset( $args ) {
|
1159 |
-
|
1160 |
-
$defaults = array(
|
1161 |
-
'handle' => null,
|
1162 |
-
'src' => null,
|
1163 |
-
'deps' => array(),
|
1164 |
-
'in_footer' => true,
|
1165 |
-
'media' => null,
|
1166 |
-
'ver' => ARVE_VERSION,
|
1167 |
-
'automin' => false,
|
1168 |
-
);
|
1169 |
-
|
1170 |
-
$args = wp_parse_args( $args, $defaults );
|
1171 |
-
|
1172 |
-
if ( $args['automin'] && ! defined( 'WP_DEBUG' ) && ! WP_DEBUG ) {
|
1173 |
-
|
1174 |
-
$args['src'] = str_replace( '.css', '.min.css', $args['src'] );
|
1175 |
-
$args['src'] = str_replace( '.js', '.min.js', $args['src'] );
|
1176 |
-
}
|
1177 |
-
|
1178 |
-
if ( arve_ends_with( $args['src'], '.css' ) ) {
|
1179 |
-
wp_register_style( $args['handle'], $args['src'], $args['deps'], $args['ver'], $args['media'] );
|
1180 |
-
} else {
|
1181 |
-
wp_register_script( $args['handle'], $args['src'], $args['deps'], $args['ver'], $args['in_footer'] );
|
1182 |
-
}
|
1183 |
-
}
|
1184 |
-
|
1185 |
-
function arve_get_min_suffix() {
|
1186 |
-
return ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? '' : '.min';
|
1187 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tsconfig.json
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"compileOnSave": false,
|
3 |
+
"compilerOptions": {
|
4 |
+
"noImplicitAny": false,
|
5 |
+
"removeComments": true,
|
6 |
+
"allowUnreachableCode": false,
|
7 |
+
"strictNullChecks": true,
|
8 |
+
"sourceMap": true,
|
9 |
+
"allowJs": false,
|
10 |
+
/* https://github.com/TypeStrong/fork-ts-checker-webpack-plugin says this is needed */
|
11 |
+
"importsNotUsedAsValues": "preserve",
|
12 |
+
/* -- wppack.io (changed) -- */
|
13 |
+
/* Basic Options */
|
14 |
+
"target": "esnext", // we would be compiling with babel, so we can target esnext
|
15 |
+
"module": "esnext", // for import() and es5 import/export
|
16 |
+
"lib": [
|
17 |
+
"esnext",
|
18 |
+
"DOM",
|
19 |
+
"DOM.Iterable",
|
20 |
+
], // include all libraries you need
|
21 |
+
"jsx": "react",
|
22 |
+
"jsxFactory": "createElement",
|
23 |
+
"jsxFragmentFactory": "Fragment",
|
24 |
+
/* Module Resolution Options */
|
25 |
+
"moduleResolution": "node", // because of webpack
|
26 |
+
"allowSyntheticDefaultImports": true, // to make it compatible with babel
|
27 |
+
"esModuleInterop": true, // to make it compatible with babel
|
28 |
+
"isolatedModules": false // to limit implementation
|
29 |
+
},
|
30 |
+
"includes": [
|
31 |
+
"src/ts/**/*.ts"
|
32 |
+
],
|
33 |
+
"exclude": [
|
34 |
+
"node_modules",
|
35 |
+
"dist",
|
36 |
+
"src/**/*.spec.ts"
|
37 |
+
]
|
38 |
+
}
|
uninstall.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Fired when the plugin is uninstalled.
|
5 |
-
*
|
6 |
-
* When populating this file, consider the following flow
|
7 |
-
* of control:
|
8 |
-
*
|
9 |
-
* - This method should be static
|
10 |
-
* - Check if the $_REQUEST content actually is the plugin name
|
11 |
-
* - Run an admin referrer check to make sure it goes through authentication
|
12 |
-
* - Verify the output of $_GET makes sense
|
13 |
-
* - Repeat with other user roles. Best directly by using the links/query string parameters.
|
14 |
-
* - Repeat things for multisite. Once for a single site in the network, once sitewide.
|
15 |
-
*
|
16 |
-
* This file may be updated more in future version of the Boilerplate; however, this is the
|
17 |
-
* general skeleton and outline for how the file should work.
|
18 |
-
*
|
19 |
-
* For more information, see the following discussion:
|
20 |
-
* https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
|
21 |
-
*
|
22 |
-
* @link https://nextgenthemes.com
|
23 |
-
* @since 1.0.0
|
24 |
-
*
|
25 |
-
* @package Advanced_Responsive_Video_Embedder
|
26 |
-
*/
|
27 |
-
|
28 |
-
// If uninstall not called from WordPress, then exit.
|
29 |
-
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
30 |
-
exit;
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|