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

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.4.0
Comparing to
See all releases

Code changes from version 3.3.7 to 3.4.0

EmbedPress/Elementor/Widgets/Embedpress_Pdf.php CHANGED
@@ -247,7 +247,13 @@ class Embedpress_Pdf extends Widget_Base
247
  {
248
  $settings = $this->get_settings();
249
  $url = $this->get_file_url();
250
- $id = 'embedpress-pdf-' . $this->get_id();
 
 
 
 
 
 
251
  $dimension = "width: {$settings['embedpress_elementor_document_width']['size']}px;height: {$settings['embedpress_elementor_document_height']['size']}px";
252
  $this->add_render_attribute( 'embedpres-pdf-render', [
253
  'class' => ['embedpress-embed-document-pdf', $id],
@@ -272,10 +278,9 @@ class Embedpress_Pdf extends Widget_Base
272
  <?php
273
 
274
  } else {
275
- $view_link = 'https://docs.google.com/viewer?url=' . $url . '&embedded=true';
276
  ?>
277
  <div>
278
- <iframe allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" style="<?php echo esc_attr( $dimension); ?>; max-width:100%;" src="<?php echo esc_url( $view_link); ?>" <?php $this->get_render_attribute_string( 'embedpres-pdf-render' ); ?>></iframe>
279
  </div>
280
 
281
  <?php
247
  {
248
  $settings = $this->get_settings();
249
  $url = $this->get_file_url();
250
+ $id = $this->get_id();
251
+ $this->_render($url, $settings, $id);
252
+ }
253
+
254
+ public function _render($url, $settings, $id)
255
+ {
256
+ $id = 'embedpress-pdf-' . $id;
257
  $dimension = "width: {$settings['embedpress_elementor_document_width']['size']}px;height: {$settings['embedpress_elementor_document_height']['size']}px";
258
  $this->add_render_attribute( 'embedpres-pdf-render', [
259
  'class' => ['embedpress-embed-document-pdf', $id],
278
  <?php
279
 
280
  } else {
 
281
  ?>
282
  <div>
283
+ <iframe allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" style="<?php echo esc_attr( $dimension); ?>; max-width:100%;" src="<?php echo esc_url( $url); ?>" <?php $this->get_render_attribute_string( 'embedpres-pdf-render' ); ?>></iframe>
284
  </div>
285
 
286
  <?php
EmbedPress/Ends/Back/Settings/assets/js/settings.js CHANGED
@@ -372,16 +372,22 @@ jQuery(document).ready( function($){
372
 
373
  $(document).on('click', '#ep-shortcode-btn', function (e){
374
  e.preventDefault();
375
- let $linkNode = $('#ep-link');
376
- let link = $linkNode.val();
377
- if (!validateUrl(link)){
378
- show_attention_alert('Please enter a valid URL.');
379
- $linkNode.val('');
380
- $shortcodePreview.val('');
381
- return;
382
- }
383
- $linkNode.val('');
384
- $shortcodePreview.val('[embedpress]'+link+'[/embedpress]');
 
 
 
 
 
 
385
  $shortcodePreview.focus();
386
  });
387
 
372
 
373
  $(document).on('click', '#ep-shortcode-btn', function (e){
374
  e.preventDefault();
375
+ let $linkNode = $('#ep-link');
376
+ let link = $linkNode.val();
377
+ if (!validateUrl(link)){
378
+ show_attention_alert('Please enter a valid URL.');
379
+ $linkNode.val('');
380
+ $shortcodePreview.val('');
381
+ return;
382
+ }
383
+ $linkNode.val('');
384
+ var arr = link.split('.');
385
+ if (arr[arr.length - 1] === 'pdf') {
386
+ $shortcodePreview.val('[embedpress_pdf]'+link+'[/embedpress_pdf]');
387
+ }
388
+ else{
389
+ $shortcodePreview.val('[embedpress]'+link+'[/embedpress]');
390
+ }
391
  $shortcodePreview.focus();
392
  });
393
 
EmbedPress/Ends/Back/Settings/templates/partials/logo.php CHANGED
@@ -6,9 +6,9 @@
6
  <header class="embedpress-header">
7
  <a href="#" class="site__logo"><img src="<?php echo EMBEDPRESS_SETTINGS_ASSETS_URL; ?>img/logo.svg" alt=""></a>
8
  <ul class="embedpress-version-wrapper">
9
- <li>Core Version: V<?php echo EMBEDPRESS_VERSION; ?></li>
10
  <?php if ( $pro_active ) { ?>
11
- <li>Pro Version: V<?php echo get_embedpress_pro_version(); ?></li>
12
  <?php }?>
13
  </ul>
14
  </header>
6
  <header class="embedpress-header">
7
  <a href="#" class="site__logo"><img src="<?php echo EMBEDPRESS_SETTINGS_ASSETS_URL; ?>img/logo.svg" alt=""></a>
8
  <ul class="embedpress-version-wrapper">
9
+ <li>Core Version: v<?php echo EMBEDPRESS_VERSION; ?></li>
10
  <?php if ( $pro_active ) { ?>
11
+ <li>Pro Version: v<?php echo get_embedpress_pro_version(); ?></li>
12
  <?php }?>
13
  </ul>
14
  </header>
EmbedPress/Includes/Traits/Shared.php CHANGED
@@ -102,7 +102,7 @@ trait Shared {
102
  * Message message for showing.
103
  */
104
  $notice->classes( 'upsale', 'notice is-dismissible ' );
105
- $notice->message( 'upsale', '<p>' . __( 'Thank you for relying on EmbedPress with 50,000 other websites. Checkout our Pro features.', $notice->text_domain ) . '</p>' );
106
 
107
  // Update Notice For PRO Version
108
  if ( $this->is_pro_active() && \version_compare( get_embedpress_pro_version(), '2.0.0', '<' ) ) {
102
  * Message message for showing.
103
  */
104
  $notice->classes( 'upsale', 'notice is-dismissible ' );
105
+ $notice->message( 'upsale', '<p>' . __( 'Thank you for relying on EmbedPress with 60,000 other websites. Checkout our Pro features.', $notice->text_domain ) . '</p>' );
106
 
107
  // Update Notice For PRO Version
108
  if ( $this->is_pro_active() && \version_compare( get_embedpress_pro_version(), '2.0.0', '<' ) ) {
EmbedPress/Shortcode.php CHANGED
@@ -66,6 +66,7 @@ class Shortcode {
66
  add_shortcode( EMBEDPRESS_SHORTCODE, ['\\EmbedPress\\Shortcode', 'do_shortcode'] );
67
  add_shortcode( 'embed_oembed_html', ['\\EmbedPress\\Shortcode', 'do_shortcode'] );
68
  add_shortcode( 'embedpress', ['\\EmbedPress\\Shortcode', 'do_shortcode'] );
 
69
  }
70
 
71
  /**
@@ -762,4 +763,28 @@ KAMAL;
762
  }
763
  return $embed;
764
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
  }
66
  add_shortcode( EMBEDPRESS_SHORTCODE, ['\\EmbedPress\\Shortcode', 'do_shortcode'] );
67
  add_shortcode( 'embed_oembed_html', ['\\EmbedPress\\Shortcode', 'do_shortcode'] );
68
  add_shortcode( 'embedpress', ['\\EmbedPress\\Shortcode', 'do_shortcode'] );
69
+ add_shortcode( 'embedpress_pdf', ['\\EmbedPress\\Shortcode', 'do_shortcode_pdf'] );
70
  }
71
 
72
  /**
763
  }
764
  return $embed;
765
  }
766
+
767
+ public static function do_shortcode_pdf($attributes = [], $subject = null ){
768
+ $plgSettings = Core::getSettings();
769
+
770
+ $default = [
771
+ 'width' => $plgSettings->enableEmbedResizeWidth,
772
+ 'height' => $plgSettings->enableEmbedResizeHeight,
773
+ 'powered_by' => 'no',
774
+ ];
775
+ $attributes = wp_parse_args( $attributes, $default );
776
+ $pdf = new \EmbedPress\Elementor\Widgets\Embedpress_Pdf();
777
+ $url = preg_replace( '/(\[' . EMBEDPRESS_SHORTCODE . '(?:\]|.+?\])|\[\/' . EMBEDPRESS_SHORTCODE . '\])/i',
778
+ "", $subject );
779
+ $settings = [
780
+ 'embedpress_elementor_document_width' => ['size' => $attributes['width']],
781
+ 'embedpress_elementor_document_height' => ['size' => $attributes['height']],
782
+ 'embedpress_pdf_powered_by' => $attributes['powered_by'],
783
+ ];
784
+
785
+ ob_start();
786
+ $pdf->_render($url, $settings, 'sdfg');
787
+
788
+ return ob_get_clean();
789
+ }
790
  }
embedpress.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and upload 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.com
8
- * Version: 3.3.7
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and upload 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.com
8
+ * Version: 3.4.0
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.3.7");
26
  /**
27
  * @deprecated 2.2.0
28
  */
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
+ define('EMBEDPRESS_VERSION', "3.4.0");
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: 6.0
8
  Requires PHP: 5.6
9
- Stable tag: 3.3.7
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
@@ -382,6 +382,12 @@ Not at all. You can set up everything your team needs without any coding knowled
382
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
383
  and this project adheres to [Semantic Versioning](http://semver.org/).
384
 
 
 
 
 
 
 
385
  = [3.3.7] - 2022-04-26 =
386
  * Fixed: Gfycat fullscreen and social share option.
387
  * Fixed: Profile & open links for Coub videos.
6
  Requires at least: 4.6
7
  Tested up to: 6.0
8
  Requires PHP: 5.6
9
+ Stable tag: 3.4.0
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
382
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
383
  and this project adheres to [Semantic Versioning](http://semver.org/).
384
 
385
+ = [3.4.0] - 2022-06-07 =
386
+ * Added: PDF embedding support in Classic and other editors.
387
+ * Fixed: Meetup layout breaking issues.
388
+ * Fixed: PDF doesn’t load when embedded via URL in Elementor.
389
+ * Few minor bug fix and improvements.
390
+
391
  = [3.3.7] - 2022-04-26 =
392
  * Fixed: Gfycat fullscreen and social share option.
393
  * Fixed: Profile & open links for Coub videos.