EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor - Version 3.0.3

Version Description

Download this release

Release Info

Developer wpdevteam
Plugin Icon wp plugin EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor
Version 3.0.3
Comparing to
See all releases

Code changes from version 3.0.2 to 3.0.3

EmbedPress/Ends/Back/Settings/EmbedpressSettings.php CHANGED
@@ -147,6 +147,8 @@ class EmbedpressSettings {
147
  }
148
 
149
  public function render_settings_page( ) {
 
 
150
  $page_slug = $this->page_slug; // make this available for included template
151
  $template = !empty( $_GET['page_type'] ) ? sanitize_text_field( $_GET['page_type']) : 'general';
152
  $nonce_field = wp_nonce_field('ep_settings_nonce', 'ep_settings_nonce', true, false);
147
  }
148
 
149
  public function render_settings_page( ) {
150
+ global $template, $page_slug, $nonce_field, $ep_page, $gen_menu_template_names, $brand_menu_template_names, $pro_active, $coming_soon, $success_message, $error_message;
151
+
152
  $page_slug = $this->page_slug; // make this available for included template
153
  $template = !empty( $_GET['page_type'] ) ? sanitize_text_field( $_GET['page_type']) : 'general';
154
  $nonce_field = wp_nonce_field('ep_settings_nonce', 'ep_settings_nonce', true, false);
EmbedPress/Ends/Back/Settings/assets/css/style.css CHANGED
@@ -2330,7 +2330,38 @@ button.button__instagram.hover__highlight:hover .icon {
2330
 
2331
  .logo__adjust__wrap {
2332
  margin-top: 20px;
2333
- /* display: none; */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2334
  }
2335
 
2336
  .logo__adjust__wrap .logo__upload__wrap {
2330
 
2331
  .logo__adjust__wrap {
2332
  margin-top: 20px;
2333
+ display: none;
2334
+ }
2335
+
2336
+ .form__control__wrap .input__switch .logo__adjust__toggler {
2337
+ position: absolute;
2338
+ top: 2px;
2339
+ left: calc(100% + 15px);
2340
+ background: #5B4E96;
2341
+ color: #fff;
2342
+ border-radius: 5px;
2343
+ padding: 5px 30px 5px 10px;
2344
+ font-size: 14px;
2345
+ opacity: 0;
2346
+ visibility: hidden;
2347
+ transition: all .3s ease;
2348
+ }
2349
+ .form__control__wrap .input__switch .logo__adjust__toggler i {
2350
+ font-size: 10px;
2351
+ margin-left: 8px;
2352
+ position: absolute;
2353
+ top: 11px;
2354
+ right: 10px;
2355
+ transition: all .3s ease;
2356
+ transform: rotate(0);
2357
+ }
2358
+ .form__control__wrap .input__switch .logo__adjust__toggler.show i {
2359
+ transform: rotate(-180deg);
2360
+ }
2361
+
2362
+ .form__control__wrap .input__switch input[type="checkbox"]:checked ~ .logo__adjust__toggler {
2363
+ opacity: 1;
2364
+ visibility: visible;
2365
  }
2366
 
2367
  .logo__adjust__wrap .logo__upload__wrap {
EmbedPress/Ends/Back/Settings/assets/js/settings.js CHANGED
@@ -114,57 +114,67 @@ jQuery(document).ready( function($){
114
  })
115
 
116
  // Logo Remove
117
- $('#yt_preview__remove').on('click', function(e) {
118
  e.preventDefault();
119
- $('.preview__logo__input').val('');
120
- $('#yt_logo_url').val('');
121
- $('#yt_logo_id').val('');
122
- $("#yt_logo_preview").attr('src', '');
123
- $('.preview__box img').attr('src', '');
124
- $("#yt_logo__upload__preview").hide();
125
- $("#yt_logo_upload_wrap").show();
 
 
126
  $settingsForm.find('.embedpress-submit-btn').addClass('ep-settings-form-changed');
127
  formDataChanged = true;
128
  })
129
 
130
  // Logo Controller
131
  let rangeSlider = function(){
132
- let slider = $('.logo__adjust__controller__inputs'),
133
- previewImg = $('.preview__logo'),
134
- opRange = $('.opacity__range'),
135
- xRange = $('.x__range'),
136
- yRange = $('.y__range'),
137
- value = $('.range__value');
138
-
139
- slider.each(function(){
140
-
141
- value.each(function(){
142
- var value = $(this).prev().attr('value');
143
- $(this).html(value);
144
  });
145
 
146
  opRange.on('input', function(){
147
- $(this).next(value).val(this.value);
148
- console.log(this.value / 100);
149
  previewImg.css('opacity', this.value / 100);
150
  });
151
  xRange.on('input', function(){
152
- $(this).next(value).val(this.value);
153
  previewImg.css('right', this.value + "%");
154
  });
155
  yRange.on('input', function(){
156
- $(this).next(value).val(this.value);
157
  previewImg.css('bottom', this.value + "%");
158
  });
159
  });
 
 
 
160
  };
161
 
162
  rangeSlider();
163
 
164
- $('.template__wrapper .input__switch input').on('click', function() {
 
 
 
 
165
  $(this).parents('.form__control__wrap').children('.logo__adjust__wrap').slideToggle();
166
  })
167
 
 
 
 
 
168
  let proFeatureAlert = function() {
169
 
170
  $(document).on('click', '.isPro', function () {
@@ -180,14 +190,16 @@ jQuery(document).ready( function($){
180
  proFeatureAlert();
181
 
182
  // custom logo upload for youtube
183
- $(document).on('click', '#yt_logo_upload_wrap', function(e){
184
  e.preventDefault();
185
- let curElement = $('.preview__logo');
186
- let $yt_logo_upload_wrap = $("#yt_logo_upload_wrap");
187
- let $yt_logo__upload__preview = $("#yt_logo__upload__preview");
188
- let $yt_logo_preview = $("#yt_logo_preview");
189
- let $yt_logo_url = $('#yt_logo_url');
190
- let $yt_logo_id = $('#yt_logo_id');
 
 
191
  let button = $(this),
192
  yt_logo_uploader = wp.media({
193
  title: 'Custom Logo',
@@ -202,7 +214,7 @@ jQuery(document).ready( function($){
202
  }).on('select', function() {
203
  let attachment = yt_logo_uploader.state().get('selection').first().toJSON();
204
  if (attachment && attachment.id && attachment.url){
205
- $yt_logo_upload_wrap.hide();
206
  $yt_logo_url.val(attachment.url);
207
  $yt_logo_id.val(attachment.id);
208
  $yt_logo_preview.attr('src', attachment.url);
114
  })
115
 
116
  // Logo Remove
117
+ $('.preview__remove').on('click', function(e) {
118
  e.preventDefault();
119
+
120
+ let $logo_remove_btn = $(this);
121
+ let $main_adjustment_wrap = $logo_remove_btn.parents('.logo__adjust__wrap');
122
+ $main_adjustment_wrap.find('.preview__logo').attr('src', '');
123
+ $main_adjustment_wrap.find(".logo__upload__preview").hide();
124
+ $main_adjustment_wrap.find(".logo__upload").show();
125
+ $main_adjustment_wrap.find(".instant__preview__img").attr('src', '');
126
+ $main_adjustment_wrap.find('.preview__logo__input').val('');
127
+ $main_adjustment_wrap.find('.preview__logo__input_id').val('');
128
  $settingsForm.find('.embedpress-submit-btn').addClass('ep-settings-form-changed');
129
  formDataChanged = true;
130
  })
131
 
132
  // Logo Controller
133
  let rangeSlider = function(){
134
+ let $slider = $('.logo__adjust');
135
+ $slider.each(function(){
136
+ let $es = $(this),
137
+ previewImg = $es.find('.preview__logo'),
138
+ opRange = $es.find('.opacity__range'),
139
+ xRange = $es.find('.x__range'),
140
+ yRange = $es.find('.y__range'),
141
+ $range__value = $es.find('.range__value');
142
+ $range__value.each(function(){
143
+ $(this).html($(this).prev().attr('value'));
 
 
144
  });
145
 
146
  opRange.on('input', function(){
147
+ $(this).next($range__value).val(this.value);
 
148
  previewImg.css('opacity', this.value / 100);
149
  });
150
  xRange.on('input', function(){
151
+ $(this).next($range__value).val(this.value);
152
  previewImg.css('right', this.value + "%");
153
  });
154
  yRange.on('input', function(){
155
+ $(this).next($range__value).val(this.value);
156
  previewImg.css('bottom', this.value + "%");
157
  });
158
  });
159
+
160
+
161
+
162
  };
163
 
164
  rangeSlider();
165
 
166
+ $('.template__wrapper .input__switch .logo__adjust__toggler').on('click', function(e) {
167
+ e.preventDefault();
168
+ $('.logo__adjust__wrap').not($(this).parents('.form__control__wrap').children('.logo__adjust__wrap')).slideUp();
169
+ $('.template__wrapper .input__switch .logo__adjust__toggler').not($(this)).removeClass('show');
170
+ $(this).toggleClass('show');
171
  $(this).parents('.form__control__wrap').children('.logo__adjust__wrap').slideToggle();
172
  })
173
 
174
+ $('.form__control__wrap .input__switch input').on('click', function() {
175
+ $(this).siblings('.logo__adjust__toggler.show').trigger('click');
176
+ })
177
+
178
  let proFeatureAlert = function() {
179
 
180
  $(document).on('click', '.isPro', function () {
190
  proFeatureAlert();
191
 
192
  // custom logo upload for youtube
193
+ $(document).on('click', '.logo__upload', function(e){
194
  e.preventDefault();
195
+ let $logo_uploader_btn = $(this);
196
+ let $main_adjustment_wrap = $logo_uploader_btn.parent('.logo__adjust__wrap');
197
+ let curElement = $main_adjustment_wrap.find('.preview__logo');
198
+ //let $yt_logo_upload_wrap = $main_adjustment_wrap.find("#yt_logo_upload_wrap");
199
+ let $yt_logo__upload__preview = $main_adjustment_wrap.find(".logo__upload__preview");
200
+ let $yt_logo_preview = $main_adjustment_wrap.find(".instant__preview__img");
201
+ let $yt_logo_url = $main_adjustment_wrap.find('.preview__logo__input');
202
+ let $yt_logo_id = $main_adjustment_wrap.find('.preview__logo__input_id');
203
  let button = $(this),
204
  yt_logo_uploader = wp.media({
205
  title: 'Custom Logo',
214
  }).on('select', function() {
215
  let attachment = yt_logo_uploader.state().get('selection').first().toJSON();
216
  if (attachment && attachment.id && attachment.url){
217
+ $logo_uploader_btn.hide();
218
  $yt_logo_url.val(attachment.url);
219
  $yt_logo_id.val(attachment.id);
220
  $yt_logo_preview.attr('src', attachment.url);
EmbedPress/Ends/Back/Settings/templates/custom-logo.php CHANGED
@@ -18,6 +18,19 @@ $yt_branding = isset( $yt_settings['branding']) ? sanitize_text_field( $yt_setti
18
 
19
 
20
  $embedpress_document_powered_by = isset( $gen_settings['embedpress_document_powered_by']) ? sanitize_text_field( $gen_settings['embedpress_document_powered_by']) : 'yes';
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  ?>
22
 
23
  <div class="embedpress__settings background__white radius-25 p40">
@@ -37,114 +50,139 @@ $embedpress_document_powered_by = isset( $gen_settings['embedpress_document_powe
37
  </div>
38
  </div>
39
  <h3><?php esc_html_e( "Custom Logo", "embedpress" ); ?></h3>
40
- <div class="form__group">
41
- <p class="form__label"><?php esc_html_e( "YouTube Custom Branding", "embedpress" ); echo $pro_active ? '': ' <span class="isPro">Pro</span>'; ?></p>
42
- <div class="form__control__wrap">
43
- <label class="input__switch switch__text <?php echo $pro_active ? '': 'isPro'; ?>">
44
- <input type="checkbox" name="yt_branding" data-default="<?php echo esc_attr( $yt_branding ); ?>" data-value="<?php echo esc_attr( $yt_branding ); ?>" value="yes" <?php checked( 'yes', $yt_branding);?> <?php echo $pro_active ? '': ' disabled'; ?>>
45
- <span></span>
46
- </label>
 
 
 
 
47
 
48
- <div class="logo__adjust__wrap <?php echo $pro_active ? '': 'proOverlay'; ?>" style="<?php if ( ('yes' !== $yt_branding) || !$pro_active ) { echo 'display:none;'; } ?>">
49
- <label class="logo__upload" id="yt_logo_upload_wrap" style="<?php if (!empty( $yt_logo_url)) { echo 'display:none;'; } ?>">
50
- <input type="hidden" class="preview__logo__input" name="yt_logo_url" id="yt_logo_url" data-default="<?php echo esc_attr( $yt_logo_url ); ?>" value="<?php echo $yt_logo_url; ?>">
51
- <input type="hidden" class="preview__logo__input_id" name="yt_logo_id" id="yt_logo_id" data-default="<?php echo esc_attr( $yt_logo_id ); ?>" value="<?php echo $yt_logo_id; ?>">
52
- <span class="icon"><i class="ep-icon ep-upload"></i></span>
53
- <span class="text"><?php esc_html_e( "Click To Upload", "embedpress" ); ?></span>
54
- </label>
55
- <div class="logo__upload__preview" id="yt_logo__upload__preview" style="<?php if ( empty( $yt_logo_url) ) { echo 'display:none'; } ?> ">
56
- <div class="instant__preview">
57
- <a href="#" id="yt_preview__remove" class="preview__remove"><i class="ep-icon ep-cross"></i></a>
58
- <img id="yt_logo_preview" src="<?php echo $yt_logo_url; ?>" alt="">
59
- </div>
60
- </div>
61
 
62
- <div class="logo__adjust">
63
- <div class="logo__adjust__controller">
64
- <div class="logo__adjust__controller__item">
65
- <span class="controller__label">Logo Opacity (%)</span>
66
- <div class="logo__adjust__controller__inputs">
67
- <input type="range" max="100" data-default="<?php echo esc_attr( $yt_logo_opacity ); ?>" value="<?php echo $yt_logo_opacity; ?>" class="opacity__range" name="yt_logo_opacity">
68
- <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $yt_logo_opacity ); ?>" value="<?php echo $yt_logo_opacity; ?>">
69
- </div>
70
- </div>
71
- <div class="logo__adjust__controller__item">
72
- <span class="controller__label">Logo X Position (%)</span>
73
- <div class="logo__adjust__controller__inputs">
74
- <input type="range" max="100" data-default="<?php echo esc_attr( $yt_logo_xpos ); ?>" value="<?php echo $yt_logo_xpos; ?>" class="x__range" name="yt_logo_xpos">
75
- <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $yt_logo_xpos ); ?>" value="<?php echo $yt_logo_xpos; ?>">
76
- </div>
77
- </div>
78
- <div class="logo__adjust__controller__item">
79
- <span class="controller__label">Logo Y Position (%)</span>
80
- <div class="logo__adjust__controller__inputs">
81
- <input type="range" max="100" data-default="<?php echo esc_attr( $yt_logo_ypos ); ?>" value="<?php echo esc_attr( $yt_logo_ypos ); ?>" class="y__range" name="yt_logo_ypos" >
82
- <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $yt_logo_ypos ); ?>" value="<?php echo esc_attr( $yt_logo_ypos ); ?>">
83
- </div>
84
- </div>
85
- <div class="logo__adjust__controller__item">
86
- <label class="controller__label" for="yt_cta_url" ><?php esc_html_e( "Call to Action Link", "embedpress" );?> </label>
87
- <div>
88
- <input type="url" name="yt_cta_url" id="yt_cta_url" class="form__control" data-default="<?php echo esc_attr( $yt_cta_url ); ?>" value="<?php echo esc_attr( $yt_cta_url); ?>">
89
-
90
- <p><?php esc_html_e( "You may link the logo to any CTA link.", "embedpress" ); ?></p>
91
- </div>
92
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  </div>
94
- <div class="logo__adjust__preview">
95
- <span class="title"><?php esc_html_e( "Live Preview", "embedpress" ); ?></span>
96
- <div class="preview__box">
97
- <iframe src="https://www.youtube.com/embed/2u0HRUdLHxo" frameborder="0"></iframe>
98
- <img src="<?php echo $yt_logo_url; ?>" class="preview__logo" style="bottom:<?php echo esc_attr( $yt_logo_ypos); ?>%; right:<?php echo esc_attr( $yt_logo_xpos); ?>%; opacity:<?php echo ($yt_logo_opacity/100); ?>;" alt="">
99
- </div>
100
  </div>
101
  </div>
102
- </div>
103
- <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?>
104
- </div>
105
- </div>
106
- <div class="form__group">
107
- <p class="form__label"><?php
108
- printf( esc_html__( 'Vimeo Custom Branding %s', 'embedpress'), $coming_soon);
109
- echo $pro_active ? '': ' <span class="isPro">Pro</span>'; ?>
110
- </p>
111
- <div class="form__control__wrap">
112
- <label class="input__switch switch__text isPro">
113
- <input type="checkbox" disabled>
114
- <span></span>
115
- </label>
116
- <?php include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-coming-soon.php'; ?>
117
- </div>
118
- </div>
119
- <div class="form__group">
120
- <p class="form__label"><?php
121
- printf( esc_html__( 'Wistia Custom Branding %s', 'embedpress'), $coming_soon);
122
- echo $pro_active ? '': ' <span class="isPro">Pro</span>';
123
- ?></p>
124
- <div class="form__control__wrap">
125
- <label class="input__switch switch__text isPro">
126
- <input type="checkbox" disabled>
127
- <span></span>
128
- </label>
129
- <?php include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-coming-soon.php'; ?>
130
 
 
 
 
 
 
 
 
 
 
 
 
131
  </div>
132
  </div>
133
- <div class="form__group">
134
- <p class="form__label"><?php
135
- printf( esc_html__( 'Twitch Custom Branding %s', 'embedpress'), $coming_soon);
136
- echo $pro_active ? '': ' <span class="isPro">Pro</span>'; ?></p>
137
- <div class="form__control__wrap">
138
- <label class="input__switch switch__text isPro">
139
- <input type="checkbox" disabled>
140
- <span></span>
141
- </label>
142
- <?php include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-coming-soon.php'; ?>
143
 
144
- </div>
145
- </div>
146
- <?php do_action( 'embedpress_after_custom_branding_settings_fields'); ?>
147
- <button class="button button__themeColor radius-10 embedpress-submit-btn" name="submit" value="custom_logo"><?php esc_html_e( 'Save Changes', 'embedpress'); ?></button>
148
- </form>
149
  </div>
150
- </div>
 
 
 
18
 
19
 
20
  $embedpress_document_powered_by = isset( $gen_settings['embedpress_document_powered_by']) ? sanitize_text_field( $gen_settings['embedpress_document_powered_by']) : 'yes';
21
+
22
+ // Vimeo branding
23
+ $vm_settings = get_option( EMBEDPRESS_PLG_NAME.':vimeo');
24
+ //error_log( print_r( $vm_settings, 1));
25
+ $vm_branding = isset( $vm_settings['branding']) ? sanitize_text_field( $vm_settings['branding']) : 'no';
26
+ $vm_logo_xpos = isset( $vm_settings['logo_xpos']) ? intval( $vm_settings['logo_xpos']) : 10;
27
+ $vm_logo_ypos = isset( $vm_settings['logo_ypos']) ? intval( $vm_settings['logo_ypos']) : 10;
28
+ $vm_logo_opacity = isset( $vm_settings['logo_opacity']) ? intval( $vm_settings['logo_opacity']) : 50;
29
+ $vm_logo_id = isset( $vm_settings['logo_id']) ? intval( $vm_settings['logo_id']) : 0;
30
+ $vm_logo_url = isset( $vm_settings['logo_url']) ? esc_url( $vm_settings['logo_url']) : '';
31
+ $vm_cta_url = isset( $vm_settings['cta_url']) ? esc_url( $vm_settings['cta_url']) : 'no';
32
+
33
+
34
  ?>
35
 
36
  <div class="embedpress__settings background__white radius-25 p40">
50
  </div>
51
  </div>
52
  <h3><?php esc_html_e( "Custom Logo", "embedpress" ); ?></h3>
53
+ <?php
54
+ embedpress_print_branding_controls('youtube', 'yt');
55
+ embedpress_print_branding_controls('vimeo', 'vm');
56
+ embedpress_print_branding_controls('wistia', 'wis');
57
+ embedpress_print_branding_controls('twitch', 'tw');
58
+ ?>
59
+ <?php do_action( 'embedpress_after_custom_branding_settings_fields'); ?>
60
+ <button class="button button__themeColor radius-10 embedpress-submit-btn" name="submit" value="custom_logo"><?php esc_html_e( 'Save Changes', 'embedpress'); ?></button>
61
+ </form>
62
+ </div>
63
+ </div>
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
+ <?php
67
+ /**
68
+ * @param string $provider this is the provider name eg. youtube and vimeo etc. It should be lowercase generally or the same as the key we use to save data in the database. We save data like eg. EMBEDPRESS_PLG_NAME.':youtube'. Here youtube is the provider.
69
+ * @param string $prefix It is a prefix for field name eg. yt or vm etc.
70
+ */
71
+ function embedpress_print_branding_controls($provider='', $prefix='') {
72
+ global $pro_active;
73
+ $settings = get_option( EMBEDPRESS_PLG_NAME.':'.$provider, []);
74
+ $branding = isset( $settings['branding']) ? $settings['branding'] : 'no';
75
+ $logo_xpos = isset( $settings['logo_xpos']) ? intval( $settings['logo_xpos']) : 10;
76
+ $logo_ypos = isset( $settings['logo_ypos']) ? intval( $settings['logo_ypos']) : 10;
77
+ $logo_opacity = isset( $settings['logo_opacity']) ? intval( $settings['logo_opacity']) : 50;
78
+ $logo_id = isset( $settings['logo_id']) ? intval( $settings['logo_id']) : 0;
79
+ $logo_url = isset( $settings['logo_url']) ? esc_url( $settings['logo_url']) : '';
80
+ $cta_url = isset( $settings['cta_url']) ? esc_url( $settings['cta_url']) : '';
81
+
82
+ // prepare prefixed field name
83
+ $px_branding = "{$prefix}_branding";
84
+ $px_logo_xpos = "{$prefix}_logo_xpos";
85
+ $px_logo_ypos = "{$prefix}_logo_ypos";
86
+ $px_logo_opacity = "{$prefix}_logo_opacity";
87
+ $px_logo_id = "{$prefix}_logo_id";
88
+ $px_logo_url = "{$prefix}_logo_url";
89
+ $px_cta_url = "{$prefix}_cta_url";
90
+ switch ($provider){
91
+ case 'vimeo':
92
+ $preview_video = '<iframe src="https://player.vimeo.com/video/463346733" frameborder="0"></iframe>';
93
+ break;
94
+ case 'wistia':
95
+
96
+ $preview_video=<<<KAMAL
97
+ <div class="ose-wistia--inc. ose-uid-0869333898f94a99ed20457fc4b79d88 ose-embedpress-responsive" style="width:500px; max-width:100%; height: 300px"><iframe title="Best Embedding Solution For Elementor, Gutenberg &amp; Classic Editor - EmbedPress Video" src="https://fast.wistia.net/embed/iframe/u7eq83w1cg?dnt=1" allow="autoplay; fullscreen" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen msallowfullscreen width="500" height="300"></iframe><script src="https://fast.wistia.net/assets/external/E-v1.js" async></script></div>
98
+ KAMAL;
99
+
100
+ break;
101
+ case 'twitch':
102
+ $parent = wp_parse_url( site_url(), 1);
103
+ $preview_video = <<<KAMAL
104
+ <div class="embedpress_wrapper" data-url="https://www.twitch.tv/wpdeveloperdotnet" style="width:90%; height:360px;">
105
+ <iframe src="https://embed.twitch.tv?autoplay=true&#038;channel=wpdeveloperdotnet&#038;height=360&#038;layout=video&#038;migration=true&#038;muted=false&#038;theme=dark&#038;time=0h0m0s&#038;video=&#038;width=600&#038;allowfullscreen=true&#038;parent={$parent}" allowfullscreen="" scrolling="no" frameborder="0" allow="autoplay; fullscreen" title="Twitch" sandbox="allow-modals allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox" ></iframe>
106
+ </div>
107
+ KAMAL;
108
+
109
+ break;
110
+ default:
111
+ $preview_video = '<iframe src="https://www.youtube.com/embed/2u0HRUdLHxo" frameborder="0"></iframe>';
112
+ break;
113
+ }
114
+ ?>
115
+ <div class="form__group">
116
+ <p class="form__label"><?php
117
+ printf( esc_html__( '%s Custom Branding', 'embedpress'), ucfirst( $provider));
118
+ echo $pro_active ? '': ' <span class="isPro">Pro</span>'; ?>
119
+ </p>
120
+ <div class="form__control__wrap">
121
+ <label class="input__switch switch__text <?php echo $pro_active ? '': 'isPro'; ?>">
122
+ <input type="checkbox" name="<?php echo esc_attr( $px_branding ); ?>" data-default="<?php echo esc_attr( $branding ); ?>" data-value="<?php echo esc_attr( $branding ); ?>" value="yes" <?php checked( 'yes', $branding);?> <?php echo $pro_active ? '': ' disabled'; ?>>
123
+ <span></span>
124
+ <a href="#" class="logo__adjust__toggler"><?php esc_html_e( "Settings", "embedpress" ); ?><i class="ep-icon ep-caret-down"></i></a>
125
+ </label>
126
+ <div class="logo__adjust__wrap <?php echo $pro_active ? '': 'proOverlay'; ?>" style="<?php if ( ('yes' !== $branding) || !$pro_active ) { echo 'display:none;'; } ?>">
127
+ <label class="logo__upload" id="yt_logo_upload_wrap" style="<?php if (!empty( $logo_url)) { echo 'display:none;'; } ?>">
128
+ <input type="hidden" class="preview__logo__input" name="<?php echo esc_attr( $px_logo_url ); ?>" id="<?php echo esc_attr( $px_logo_url ); ?>" data-default="<?php echo esc_attr( $logo_url ); ?>" value="<?php echo $logo_url; ?>">
129
+ <input type="hidden" class="preview__logo__input_id" name="<?php echo esc_attr( $px_logo_id ); ?>" id="<?php echo esc_attr( $px_logo_id ); ?>" data-default="<?php echo esc_attr( $logo_id ); ?>" value="<?php echo $logo_id; ?>">
130
+ <span class="icon"><i class="ep-icon ep-upload"></i></span>
131
+ <span class="text"><?php esc_html_e( "Click To Upload", "embedpress" ); ?></span>
132
+ </label>
133
+ <div class="logo__upload__preview" id="yt_logo__upload__preview" style="<?php if ( empty( $logo_url) ) { echo 'display:none'; } ?> ">
134
+ <div class="instant__preview">
135
+ <a href="#" id="yt_preview__remove" class="preview__remove"><i class="ep-icon ep-cross"></i></a>
136
+ <img class="instant__preview__img" id="yt_logo_preview" src="<?php echo $logo_url; ?>" alt="">
137
+ </div>
138
+ </div>
139
+
140
+ <div class="logo__adjust">
141
+ <div class="logo__adjust__controller">
142
+ <div class="logo__adjust__controller__item">
143
+ <span class="controller__label"><?php esc_html_e( "Logo Opacity (%)", "embedpress" ); ?></span>
144
+ <div class="logo__adjust__controller__inputs">
145
+ <input type="range" max="100" data-default="<?php echo esc_attr( $logo_opacity ); ?>" value="<?php echo esc_attr( $logo_opacity ); ?>" class="opacity__range" name="<?php echo esc_attr( $px_logo_opacity )?>">
146
+ <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_opacity ); ?>" value="<?php echo esc_attr( $logo_opacity ); ?>">
147
  </div>
148
+ </div>
149
+ <div class="logo__adjust__controller__item">
150
+ <span class="controller__label"><?php esc_html_e( "Logo X Position (%)", "embedpress" ); ?></span>
151
+ <div class="logo__adjust__controller__inputs">
152
+ <input type="range" max="100" data-default="<?php echo esc_attr( $logo_xpos ); ?>" value="<?php echo $logo_xpos; ?>" class="x__range" name="<?php echo esc_attr( $px_logo_xpos );?>">
153
+ <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_xpos ); ?>" value="<?php echo $logo_xpos; ?>">
154
  </div>
155
  </div>
156
+ <div class="logo__adjust__controller__item">
157
+ <span class="controller__label"><?php esc_html_e( "Logo Y Position (%)", "embedpress" ); ?></span>
158
+ <div class="logo__adjust__controller__inputs">
159
+ <input type="range" max="100" data-default="<?php echo esc_attr( $logo_ypos ); ?>" value="<?php echo esc_attr( $logo_ypos ); ?>" class="y__range" name="<?php echo esc_attr( $px_logo_ypos ); ?>" >
160
+ <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_ypos ); ?>" value="<?php echo esc_attr( $logo_ypos ); ?>">
161
+ </div>
162
+ </div>
163
+ <div class="logo__adjust__controller__item">
164
+ <label class="controller__label" for="yt_cta_url" ><?php esc_html_e( "Call to Action Link", "embedpress" );?> </label>
165
+ <div>
166
+ <input type="url" name="<?php echo esc_attr( $px_cta_url ); ?>" id="<?php echo esc_attr( $px_cta_url ); ?>" class="form__control" data-default="<?php echo esc_attr( $cta_url ); ?>" value="<?php echo esc_attr( $cta_url); ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
 
168
+ <p><?php esc_html_e( "You may link the logo to any CTA link.", "embedpress" ); ?></p>
169
+ </div>
170
+ </div>
171
+ </div>
172
+ <div class="logo__adjust__preview">
173
+ <span class="title"><?php esc_html_e( "Live Preview", "embedpress" ); ?></span>
174
+ <div class="preview__box">
175
+ <?php echo $preview_video ;?>
176
+ <img src="<?php echo $logo_url; ?>" class="preview__logo" style="bottom:<?php echo esc_attr( $logo_ypos); ?>%; right:<?php echo esc_attr( $logo_xpos); ?>%; opacity:<?php echo ($logo_opacity/100); ?>;" alt="">
177
+ </div>
178
+ </div>
179
  </div>
180
  </div>
181
+ <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?>
 
 
 
 
 
 
 
 
 
182
 
183
+ </div>
 
 
 
 
184
  </div>
185
+
186
+ <?php
187
+ }
188
+ ?>
EmbedPress/Ends/Back/Settings/templates/partials/alert-pro.php CHANGED
@@ -1,7 +1,3 @@
1
- <?php
2
-
3
- ?>
4
-
5
  <div class="pro__alert__wrap">
6
  <div class="pro__alert__card">
7
  <img src="<?php echo EMBEDPRESS_SETTINGS_ASSETS_URL; ?>img/alert.svg" alt="">
 
 
 
 
1
  <div class="pro__alert__wrap">
2
  <div class="pro__alert__card">
3
  <img src="<?php echo EMBEDPRESS_SETTINGS_ASSETS_URL; ?>img/alert.svg" alt="">
EmbedPress/Includes/Classes/Feature_Enhancer.php CHANGED
@@ -4,15 +4,27 @@ namespace EmbedPress\Includes\Classes;
4
  class Feature_Enhancer {
5
 
6
  public function __construct() {
7
- add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_youtube'] );
8
- add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_vimeo'] );
9
- add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_wistia'] );
10
- add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_twitch'] );
11
- add_filter( 'embedpress_gutenberg_youtube_params',
12
- [$this, 'embedpress_gutenberg_register_block_youtube'] );
13
- add_action( 'init', array( $this, 'embedpress_gutenberg_register_block_vimeo' ) );
14
- add_action('embedpress_gutenberg_wistia_block_after_embed', array($this,'embedpress_wistia_block_after_embed'));
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
 
18
  public function getOptions($provider='', $schema=[])
4
  class Feature_Enhancer {
5
 
6
  public function __construct() {
 
 
 
 
 
 
 
 
7
 
8
+ if ( !is_embedpress_pro_active() ) {
9
+ add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_youtube'] );
10
+ add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_vimeo'] );
11
+ add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_wistia'] );
12
+ add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_twitch'] );
13
+ add_filter( 'embedpress_gutenberg_youtube_params',
14
+ [$this, 'embedpress_gutenberg_register_block_youtube'] );
15
+ add_action( 'init', array( $this, 'embedpress_gutenberg_register_block_vimeo' ) );
16
+ add_action('embedpress_gutenberg_wistia_block_after_embed', array($this,'embedpress_wistia_block_after_embed'));
17
+ add_action( 'elementor/widget/embedpres_elementor/skins_init', [ $this, 'elementor_setting_init' ] );
18
+ }
19
+
20
+
21
+ }
22
+
23
+ public function elementor_setting_init( ) {
24
+ remove_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_youtube'] );
25
+ remove_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_vimeo'] );
26
+ remove_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_wistia'] );
27
+ remove_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_twitch'] );
28
  }
29
 
30
  public function getOptions($provider='', $schema=[])
EmbedPress/Shortcode.php CHANGED
@@ -162,7 +162,7 @@ class Shortcode {
162
  // Replace all single quotes to double quotes. I.e: foo='joe' -> foo="joe"
163
  $parsedContent = str_replace( "'", '"', $parsedContent );
164
  $parsedContent = str_replace( "{provider_alias}", $provider_name , $parsedContent );
165
- self::purify_html_content( $parsedContent);
166
  self::modify_content_for_fb_and_canada( $provider_name, $parsedContent);
167
  unset( $embedTemplate, $serviceProvider );
168
 
@@ -245,7 +245,7 @@ KAMAL;
245
 
246
 
247
  $parsedContent = apply_filters( 'pp_embed_parsed_content', $parsedContent, $urlData, self::get_oembed_attributes() );
248
-
249
  if ( !empty( $parsedContent ) ) {
250
  $embed = (object) array_merge( (array)$urlData, [
251
  'attributes' => (object) self::get_oembed_attributes(),
@@ -253,7 +253,7 @@ KAMAL;
253
  'url' => $url,
254
  ] );
255
  $embed = apply_filters( 'embedpress:onAfterEmbed', $embed );
256
- set_transient( $hash, $embed, HOUR_IN_SECONDS * 6);
257
  return $embed;
258
  }
259
  }
@@ -605,6 +605,7 @@ KAMAL;
605
 
606
  protected static function get_content_from_template( $url, $template ) {
607
  $html = self::get_oembed()->get_html( $url, self::get_oembed_attributes() );
 
608
  if ( !$html ) {
609
  $html = str_replace( '{html}', self::get_embera_instance()->autoEmbed($url), $template );
610
  }
162
  // Replace all single quotes to double quotes. I.e: foo='joe' -> foo="joe"
163
  $parsedContent = str_replace( "'", '"', $parsedContent );
164
  $parsedContent = str_replace( "{provider_alias}", $provider_name , $parsedContent );
165
+ self::purify_html_content( $parsedContent);
166
  self::modify_content_for_fb_and_canada( $provider_name, $parsedContent);
167
  unset( $embedTemplate, $serviceProvider );
168
 
245
 
246
 
247
  $parsedContent = apply_filters( 'pp_embed_parsed_content', $parsedContent, $urlData, self::get_oembed_attributes() );
248
+
249
  if ( !empty( $parsedContent ) ) {
250
  $embed = (object) array_merge( (array)$urlData, [
251
  'attributes' => (object) self::get_oembed_attributes(),
253
  'url' => $url,
254
  ] );
255
  $embed = apply_filters( 'embedpress:onAfterEmbed', $embed );
256
+ //set_transient( $hash, $embed, HOUR_IN_SECONDS * 6);
257
  return $embed;
258
  }
259
  }
605
 
606
  protected static function get_content_from_template( $url, $template ) {
607
  $html = self::get_oembed()->get_html( $url, self::get_oembed_attributes() );
608
+
609
  if ( !$html ) {
610
  $html = str_replace( '{html}', self::get_embera_instance()->autoEmbed($url), $template );
611
  }
embedpress.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and uplaoad PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 100+ sources supported.
6
  * Author: WPDeveloper
7
  * Author URI: https://wpdeveloper.net
8
- * Version: 3.0.2
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and uplaoad PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 100+ sources supported.
6
  * Author: WPDeveloper
7
  * Author URI: https://wpdeveloper.net
8
+ * Version: 3.0.3
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
includes.php CHANGED
@@ -22,7 +22,7 @@ if ( ! defined('EMBEDPRESS_PLG_NAME')) {
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
- define('EMBEDPRESS_VERSION', "3.0.2");
26
  /**
27
  * @deprecated 2.2.0
28
  */
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
+ define('EMBEDPRESS_VERSION', "3.0.3");
26
  /**
27
  * @deprecated 2.2.0
28
  */
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: embed, embed youtube, gutenberg embed, pdf, doc, docs, ppt, elementor embe
6
  Requires at least: 4.6
7
  Tested up to: 5.7
8
  Requires PHP: 5.6
9
- Stable tag: 3.0.2
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
@@ -301,6 +301,11 @@ Not at all. You can set up everything your team needs without any coding knowled
301
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
302
  and this project adheres to [Semantic Versioning](http://semver.org/).
303
 
 
 
 
 
 
304
  = [3.0.2] - 2021-05-30 =
305
  * Removed : Ajax saving from license page.
306
  * Few minor bug fix and improvements.
6
  Requires at least: 4.6
7
  Tested up to: 5.7
8
  Requires PHP: 5.6
9
+ Stable tag: 3.0.3
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
301
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
302
  and this project adheres to [Semantic Versioning](http://semver.org/).
303
 
304
+ = [3.0.3] - 2021-06-08 =
305
+ * Added: Compatibility with Wistia, Vimeo and Twitch Branding
306
+ * Improved: JS for logo uploading and refactored some previous code.
307
+ * Few minor bug fix and improvements.
308
+
309
  = [3.0.2] - 2021-05-30 =
310
  * Removed : Ajax saving from license page.
311
  * Few minor bug fix and improvements.