PDF Embedder - Version 4.4

Version Description

Fixed code for policy compatibility

Download this release

Release Info

Developer levertechadmin
Plugin Icon 128x128 PDF Embedder
Version 4.4
Comparing to
See all releases

Code changes from version 4.3 to 4.4

core/core_pdf_embedder.php CHANGED
@@ -31,8 +31,10 @@ class core_pdf_embedder {
31
  }
32
 
33
  protected function get_translation_array() {
 
34
  return Array('worker_src' => $this->my_plugin_url().'js/pdfjs/pdf.worker'.($this->useminified() ? '.min' : '').'.js',
35
- 'cmap_url' => $this->my_plugin_url().'js/pdfjs/cmaps/',
 
36
  'objectL10n' => array(
37
  'loading' => esc_html__('Loading...', 'pdf-embedder'),
38
  'page' => esc_html__('Page', 'pdf-embedder'),
@@ -337,7 +339,13 @@ class core_pdf_embedder {
337
  <input type="radio" name='<?php echo $this->get_options_name(); ?>[pdfemb_toolbarfixed]' id='pdfemb_toolbarfixed_on' class='radio' value="on" <?php echo $options['pdfemb_toolbarfixed'] == 'on' ? 'checked' : ''; ?> />
338
  <label for="pdfemb_toolbarfixed_on" class="radio"><?php esc_html_e('Toolbar always visible', 'pdf-embedder'); ?></label>
339
  </span>
 
 
 
 
340
 
 
 
341
  <?php
342
  $this->pdfemb_mainsection_extra();
343
  ?>
@@ -420,6 +428,13 @@ class core_pdf_embedder {
420
  }
421
 
422
  $newinput['pdfemb_version'] = $this->PLUGIN_VERSION;
 
 
 
 
 
 
 
423
  return $newinput;
424
  }
425
 
@@ -514,6 +529,7 @@ class core_pdf_embedder {
514
  'pdfemb_height' => 'max',
515
  'pdfemb_toolbar' => 'bottom',
516
  'pdfemb_toolbarfixed' => 'off',
 
517
  'pdfemb_version' => $this->PLUGIN_VERSION
518
  );
519
  }
31
  }
32
 
33
  protected function get_translation_array() {
34
+ $options = $this->get_option_pdfemb();
35
  return Array('worker_src' => $this->my_plugin_url().'js/pdfjs/pdf.worker'.($this->useminified() ? '.min' : '').'.js',
36
+ 'cmap_url' => $this->my_plugin_url().'js/pdfjs/cmaps/',
37
+ 'poweredby'=>$options['poweredby'],
38
  'objectL10n' => array(
39
  'loading' => esc_html__('Loading...', 'pdf-embedder'),
40
  'page' => esc_html__('Page', 'pdf-embedder'),
339
  <input type="radio" name='<?php echo $this->get_options_name(); ?>[pdfemb_toolbarfixed]' id='pdfemb_toolbarfixed_on' class='radio' value="on" <?php echo $options['pdfemb_toolbarfixed'] == 'on' ? 'checked' : ''; ?> />
340
  <label for="pdfemb_toolbarfixed_on" class="radio"><?php esc_html_e('Toolbar always visible', 'pdf-embedder'); ?></label>
341
  </span>
342
+ <br/>
343
+ <label for="pdfemb_toolbarfixed" class="textinput"><?php esc_html_e('Display Credit', 'pdf-embedder'); ?></label>
344
+ <span>
345
+ <input type='checkbox' name='<?php echo $this->get_options_name(); ?>[poweredby]' id='poweredby' class='checkbox' <?php echo $options['poweredby'] == 'on' ? 'checked' : ''; ?> />
346
 
347
+ <label for="poweredby" class="checkbox plain" style="margin-left: 10px;"><?php esc_html_e('Display "Powered by wp-pdf.com" on PDF Viewer with a link to our site. Spread the love!', 'pdf-embedder'); ?></label>
348
+ </span>
349
  <?php
350
  $this->pdfemb_mainsection_extra();
351
  ?>
428
  }
429
 
430
  $newinput['pdfemb_version'] = $this->PLUGIN_VERSION;
431
+
432
+ if (isset($input['poweredby']) && in_array($input['poweredby'], array('on', 'off'))) {
433
+ $newinput['poweredby'] = $input['poweredby'];
434
+ }else{
435
+ $newinput['poweredby'] = 'off';
436
+ }
437
+
438
  return $newinput;
439
  }
440
 
529
  'pdfemb_height' => 'max',
530
  'pdfemb_toolbar' => 'bottom',
531
  'pdfemb_toolbarfixed' => 'off',
532
+ 'poweredby' => 'off',
533
  'pdfemb_version' => $this->PLUGIN_VERSION
534
  );
535
  }
css/pdfemb-embed-pdf.css CHANGED
@@ -417,7 +417,9 @@ input.pdfemb-page-num {
417
  position: relative;
418
  background-color: lightGrey;
419
  }
420
-
 
 
421
 
422
  /* Safari 6.1+ (9.0 is the latest version of Safari at this time) */
423
 
417
  position: relative;
418
  background-color: lightGrey;
419
  }
420
+ .poweredby{
421
+ float: right !important;
422
+ }
423
 
424
  /* Safari 6.1+ (9.0 is the latest version of Safari at this time) */
425
 
js/all-pdfemb-basic.min.js CHANGED
@@ -30,7 +30,7 @@ null!=c&&c.setupAnnotations(C,b.divContainer.data("newwindow"));h.data("invalida
30
  (a?" pdfemb-toolbar-top":"pdfemb-toolbar-bottom")}),k=g('<button class="pdfemb-prev" title="'+pdfemb_trans.objectL10n.prev+'" type="button"></button>');d.append(k);var h=g('<button class="pdfemb-next" title="'+pdfemb_trans.objectL10n.next+'" type="button"></button>');d.append(h);d.append(g('<div class="pdfemb-page-area">'+pdfemb_trans.objectL10n.page+' <span class="pdfemb-page-num">0</span> / <span class="pdfemb-page-count"></span></div>'));var l=g('<button class="pdfemb-zoomout" title="'+pdfemb_trans.objectL10n.zoomout+
31
  '" type="button"></button>');d.append(l);var p=g('<button class="pdfemb-zoomin" title="'+pdfemb_trans.objectL10n.zoomin+'" type="button"></button>');d.append(p);d.append(g("<div>"+pdfemb_trans.objectL10n.zoom+' <span class="pdfemb-zoom">100%</span></div>'));b&&d.append(g("<div>"+pdfemb_trans.objectL10n.secure+"</div>"));a?f.prepend(d):f.append(d);k.on("click",function(a){1>=e.currentPageNum||(e.gotoPage(e.currentPageNum-1),e.jumpToTop())});h.on("click",function(a){e.currentPageNum>=e.pageCount||0==
32
  e.currentPageNum||(e.gotoPage(e.currentPageNum+1),e.jumpToTop())});p.on("click",function(a){500<=e.zoom||e.changeZoom(10)});l.on("click",function(a){20>=e.zoom||e.changeZoom(-10)});e.addMoreToolbar(d);c||(f.on("mouseenter",function(a){a=f.find("div.pdfemb-toolbar-hover");!0!==a.data("no-hover")&&a.show()}),f.on("mouseleave",function(a){f.find("div.pdfemb-toolbar-hover").hide()}),f.on("pdfembTouchTapped",function(a){a.stopPropagation();a.preventDefault();if(!e.locktaps){e.locktaps=!0;a=f.find("div.pdfemb-toolbar-hover");
33
- var b=a.is(":visible");1==a.data("no-hover")&&(b=!0);b?a.hide():a.show();setTimeout(function(){e.locktaps=!1},250)}}));pdfemb_trans.poweredby&&d.append(g("<div></div>",{"class":"pdfemb-poweredby"}).append(g('<a href="https://wp-pdf.com/?utm_source=Poweredby&utm_medium=freemium&utm_campaign=Freemium" target="_blank">wp-pdf.com</a>')))};d.prototype.magnifyEvent=function(a){var c=a.originalEvent.magnification;if(-1==c)this.resizeViewer(),this.resizeInnerDivs(),this.invalidateAllPages(),this.renderPage(this.getTopVisiblePageNum());
34
  else{var b=this.divContainer.find(".pdfemb-pagescontainer").offset();this.magnifyZoom(c,a.originalEvent.centreLeft-b.left,a.originalEvent.centreTop-b.top)}};d.prototype.magnifyZoom=function(a,c,b){var d=this.zoom;a=Math.floor(d*a);20>a&&(a=20);500<a&&(a=500);this.zoom=a;this.divContainer.find("span.pdfemb-zoom").text(a+"%");this.fromZoom=d;this.toZoom=a;this.pccentreLeft=c;this.pccentreTop=b;this.resizeViewer();this.resizeInnerDivs();this.invalidateAllPages()};d.prototype.pdfembWantMobile=function(a,
35
  c){return!1};d.prototype.pdfembMakeMobile=function(){};d.prototype.addMoreToolbar=function(a){};d.prototype.jumpToTop=function(){};d.prototype.preRenderCanvas=function(a,c,b){};PDFEMB_NS.pdfembPagesViewer=d});jQuery(document).ready(function(g){var k=PDFEMB_NS.pdfembPagesViewer;g=function(){k.apply(this,arguments)};g.prototype=new k;PDFEMB_NS.pdfembPagesViewerUsable=g});PDFEMB_NS.pdfembGetPDF=function(g,k){k(g,!1)};
36
  jQuery(document).ready(function(g){g.fn.pdfEmbedder=function(){this.each(function(k,p){var l,d=g(p);if(d.is("a")){var a=d.data();l=g("<div></div>",{"class":d.attr("class"),style:d.attr("style")});l.data(g.extend({"pdf-url":d.attr("href")},a));d.replaceWith(l)}else l=d;l.append(g("<div></div>",{"class":"pdfemb-loadingmsg"}).append(document.createTextNode(pdfemb_trans.objectL10n.loading)));"on"==l.data("disablerightclick")&&l.bind("contextmenu",function(a){a.preventDefault()});var c=function(a,c){(new PDFEMB_NS.pdfembPagesViewerUsable(a,
30
  (a?" pdfemb-toolbar-top":"pdfemb-toolbar-bottom")}),k=g('<button class="pdfemb-prev" title="'+pdfemb_trans.objectL10n.prev+'" type="button"></button>');d.append(k);var h=g('<button class="pdfemb-next" title="'+pdfemb_trans.objectL10n.next+'" type="button"></button>');d.append(h);d.append(g('<div class="pdfemb-page-area">'+pdfemb_trans.objectL10n.page+' <span class="pdfemb-page-num">0</span> / <span class="pdfemb-page-count"></span></div>'));var l=g('<button class="pdfemb-zoomout" title="'+pdfemb_trans.objectL10n.zoomout+
31
  '" type="button"></button>');d.append(l);var p=g('<button class="pdfemb-zoomin" title="'+pdfemb_trans.objectL10n.zoomin+'" type="button"></button>');d.append(p);d.append(g("<div>"+pdfemb_trans.objectL10n.zoom+' <span class="pdfemb-zoom">100%</span></div>'));b&&d.append(g("<div>"+pdfemb_trans.objectL10n.secure+"</div>"));a?f.prepend(d):f.append(d);k.on("click",function(a){1>=e.currentPageNum||(e.gotoPage(e.currentPageNum-1),e.jumpToTop())});h.on("click",function(a){e.currentPageNum>=e.pageCount||0==
32
  e.currentPageNum||(e.gotoPage(e.currentPageNum+1),e.jumpToTop())});p.on("click",function(a){500<=e.zoom||e.changeZoom(10)});l.on("click",function(a){20>=e.zoom||e.changeZoom(-10)});e.addMoreToolbar(d);c||(f.on("mouseenter",function(a){a=f.find("div.pdfemb-toolbar-hover");!0!==a.data("no-hover")&&a.show()}),f.on("mouseleave",function(a){f.find("div.pdfemb-toolbar-hover").hide()}),f.on("pdfembTouchTapped",function(a){a.stopPropagation();a.preventDefault();if(!e.locktaps){e.locktaps=!0;a=f.find("div.pdfemb-toolbar-hover");
33
+ var b=a.is(":visible");1==a.data("no-hover")&&(b=!0);b?a.hide():a.show();setTimeout(function(){e.locktaps=!1},250)}}));pdfemb_trans.poweredby=='on'&&d.append(g("<div class='poweredby'>Powered by </div>",{"class":"pdfemb-poweredby"}).append(g('<a href="https://wp-pdf.com/?utm_source=Poweredby&utm_medium=freemium&utm_campaign=Freemium" target="_blank">wp-pdf.com</a>')))};d.prototype.magnifyEvent=function(a){var c=a.originalEvent.magnification;if(-1==c)this.resizeViewer(),this.resizeInnerDivs(),this.invalidateAllPages(),this.renderPage(this.getTopVisiblePageNum());
34
  else{var b=this.divContainer.find(".pdfemb-pagescontainer").offset();this.magnifyZoom(c,a.originalEvent.centreLeft-b.left,a.originalEvent.centreTop-b.top)}};d.prototype.magnifyZoom=function(a,c,b){var d=this.zoom;a=Math.floor(d*a);20>a&&(a=20);500<a&&(a=500);this.zoom=a;this.divContainer.find("span.pdfemb-zoom").text(a+"%");this.fromZoom=d;this.toZoom=a;this.pccentreLeft=c;this.pccentreTop=b;this.resizeViewer();this.resizeInnerDivs();this.invalidateAllPages()};d.prototype.pdfembWantMobile=function(a,
35
  c){return!1};d.prototype.pdfembMakeMobile=function(){};d.prototype.addMoreToolbar=function(a){};d.prototype.jumpToTop=function(){};d.prototype.preRenderCanvas=function(a,c,b){};PDFEMB_NS.pdfembPagesViewer=d});jQuery(document).ready(function(g){var k=PDFEMB_NS.pdfembPagesViewer;g=function(){k.apply(this,arguments)};g.prototype=new k;PDFEMB_NS.pdfembPagesViewerUsable=g});PDFEMB_NS.pdfembGetPDF=function(g,k){k(g,!1)};
36
  jQuery(document).ready(function(g){g.fn.pdfEmbedder=function(){this.each(function(k,p){var l,d=g(p);if(d.is("a")){var a=d.data();l=g("<div></div>",{"class":d.attr("class"),style:d.attr("style")});l.data(g.extend({"pdf-url":d.attr("href")},a));d.replaceWith(l)}else l=d;l.append(g("<div></div>",{"class":"pdfemb-loadingmsg"}).append(document.createTextNode(pdfemb_trans.objectL10n.loading)));"on"==l.data("disablerightclick")&&l.bind("contextmenu",function(a){a.preventDefault()});var c=function(a,c){(new PDFEMB_NS.pdfembPagesViewerUsable(a,
pdf_embedder.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: PDF Embedder
5
  * Plugin URI: http://wp-pdf.com/
6
  * Description: Embed PDFs straight into your posts and pages, with flexible width and height. No third-party services required. Compatible with Gutenberg Editor WordPress
7
- * Version: 4.3
8
  * Author: Lever Technology LLC
9
  * Author URI: http://wp-pdf.com/
10
  * License: GPL3
@@ -15,7 +15,7 @@ require_once( plugin_dir_path(__FILE__).'/core/core_pdf_embedder.php' );
15
 
16
  class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
17
 
18
- protected $PLUGIN_VERSION = '4.3';
19
 
20
  // Singleton
21
  private static $instance = null;
@@ -29,7 +29,7 @@ class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
29
 
30
  // Basic specific
31
 
32
- protected static $poweredby_optionname='pdfemb_poweredby';
33
 
34
  public function pdfemb_activation_hook($network_wide) {
35
  parent::pdfemb_activation_hook($network_wide);
@@ -38,7 +38,7 @@ class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
38
  $old_options = get_site_option($this->get_options_name());
39
 
40
  if (!$old_options) {
41
- update_site_option(self::$poweredby_optionname, true);
42
  }
43
  }
44
 
@@ -181,8 +181,9 @@ class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
181
  }
182
 
183
  protected function get_translation_array() {
184
- return array_merge(parent::get_translation_array(),
185
- Array('poweredby' => get_site_option(self::$poweredby_optionname, false)));
 
186
  }
187
 
188
  public function pdfemb_attachment_fields_to_edit($form_fields, $post) {
4
  * Plugin Name: PDF Embedder
5
  * Plugin URI: http://wp-pdf.com/
6
  * Description: Embed PDFs straight into your posts and pages, with flexible width and height. No third-party services required. Compatible with Gutenberg Editor WordPress
7
+ * Version: 4.4
8
  * Author: Lever Technology LLC
9
  * Author URI: http://wp-pdf.com/
10
  * License: GPL3
15
 
16
  class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
17
 
18
+ protected $PLUGIN_VERSION = '4.4';
19
 
20
  // Singleton
21
  private static $instance = null;
29
 
30
  // Basic specific
31
 
32
+ protected static $poweredby_optionname='poweredby';
33
 
34
  public function pdfemb_activation_hook($network_wide) {
35
  parent::pdfemb_activation_hook($network_wide);
38
  $old_options = get_site_option($this->get_options_name());
39
 
40
  if (!$old_options) {
41
+ update_site_option(self::$poweredby_optionname, 'off');
42
  }
43
  }
44
 
181
  }
182
 
183
  protected function get_translation_array() {
184
+ return array_merge(parent::get_translation_array()
185
+ // ,Array('poweredby' => get_site_option(self::$poweredby_optionname, false))
186
+ );
187
  }
188
 
189
  public function pdfemb_attachment_fields_to_edit($form_fields, $post) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: levertechadmin
3
  Tags: doc, pdf, pdf viewer, office, google, document, embed, intranet
4
  Requires at least: 3.5
5
  Tested up to: 5.2.2
6
- Stable tag: 4.3
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -203,6 +203,10 @@ the Plugins section of your Wordpress admin
203
 
204
  == Changelog ==
205
 
 
 
 
 
206
  = 4.3 =
207
 
208
  Fixed Scrollbar issues with Firefox and iOS devices. Improved compatibility
3
  Tags: doc, pdf, pdf viewer, office, google, document, embed, intranet
4
  Requires at least: 3.5
5
  Tested up to: 5.2.2
6
+ Stable tag: 4.4
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
203
 
204
  == Changelog ==
205
 
206
+ = 4.4 =
207
+
208
+ Fixed code for policy compatibility
209
+
210
  = 4.3 =
211
 
212
  Fixed Scrollbar issues with Firefox and iOS devices. Improved compatibility