Print, PDF, Email by PrintFriendly - Version 3.3.9

Version Description

  • Removed the functionality that opens new window when JavaScript is disabled
Download this release

Release Info

Developer printfriendly
Plugin Icon 128x128 Print, PDF, Email by PrintFriendly
Version 3.3.9
Comparing to
See all releases

Code changes from version 3.3.8 to 3.3.9

Files changed (2) hide show
  1. pf.php +19 -10
  2. readme.txt +5 -1
pf.php CHANGED
@@ -5,11 +5,12 @@ Plugin Name: Print Friendly and PDF
5
  Plugin URI: http://www.printfriendly.com
6
  Description: PrintFriendly & PDF button for your website. Optimizes your pages and brand for print, pdf, and email.
7
  Name and URL are included to ensure repeat visitors and new visitors when printed versions are shared.
8
- Version: 3.3.8
9
  Author: Print Friendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
 
13
  3.3.8 - Shortcode Bug fix, urlencode button href
14
  3.3.7 - Readme.txt update
15
  3.3.6 - Fixed JS optimization Bug
@@ -369,23 +370,30 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
369
  if($add_footer_script) {
370
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
371
  }
372
- $analytics_code = "";
373
- $onclick = 'onclick="window.print(); return false;"';
374
- $title_var = "NULL";
 
375
  $analytics_code = "if(typeof(_gaq) != 'undefined') { _gaq.push(['_trackEvent','PRINTFRIENDLY', 'print', '".$title_var."']);}";
376
 
377
- if($this->google_analytics_enabled()) {
378
- $onclick = 'onclick="window.print();'.$analytics_code.' return false;"';
379
- }
 
 
 
 
 
 
 
380
 
381
  $href = 'http://www.printfriendly.com/print?url='.urlencode(get_permalink());
382
- $js_enabled = $this->js_enabled();
383
  if (!$js_enabled) {
384
- $onclick = 'target="_blank"';
385
  if($this->google_analytics_enabled()) {
386
  $onclick = $onclick.' onclick="'.$analytics_code.'"';
387
  }
388
- $href = "http://www.printfriendly.com/print?headerImageUrl=".urlencode($this->options['image_url'])."&headerTagline=".urlencode($this->options['tagline'])."&pfCustomCSS=".urlencode($this->options['custom_css_url'])."&imageDisplayStyle=".urlencode($this->options['image-style'])."&disableClickToDel=".urlencode($this->options['click_to_delete'])."&disablePDF=".urlencode($this->options['pdf'])."&disablePrint=".urlencode($this->options['print'])."&disableEmail=".urlencode($this->options['email'])."&hideImages=".urlencode($this->options['hide-images'])."&url=".urlencode(get_permalink());
389
  }
390
  if ( !is_singular() && '' != $onclick && $js_enabled) {
391
  $onclick = '';
@@ -1394,3 +1402,4 @@ function pf_show_link() {
1394
  global $printfriendly;
1395
  return $printfriendly->getButton(true);
1396
  }
 
5
  Plugin URI: http://www.printfriendly.com
6
  Description: PrintFriendly & PDF button for your website. Optimizes your pages and brand for print, pdf, and email.
7
  Name and URL are included to ensure repeat visitors and new visitors when printed versions are shared.
8
+ Version: 3.3.9
9
  Author: Print Friendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
13
+ 3.3.9 - Removed the functionality that opens new window when JavaScript is disabled
14
  3.3.8 - Shortcode Bug fix, urlencode button href
15
  3.3.7 - Readme.txt update
16
  3.3.6 - Fixed JS optimization Bug
370
  if($add_footer_script) {
371
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
372
  }
373
+ $js_enabled = $this->js_enabled();
374
+ $analytics_code = "";
375
+
376
+ $title_var = "NULL";
377
  $analytics_code = "if(typeof(_gaq) != 'undefined') { _gaq.push(['_trackEvent','PRINTFRIENDLY', 'print', '".$title_var."']);}";
378
 
379
+ if ( $this->google_analytics_enabled() ) {
380
+ if( $js_enabled ) {
381
+ $onclick = 'onclick="window.print();';
382
+ } else {
383
+ $onclick = '';
384
+ }
385
+ $onclick .= $analytics_code.' return false;"';
386
+ } else if ( $js_enabled ) {
387
+ $onclick = 'onclick="window.print(); return false;"';
388
+ }
389
 
390
  $href = 'http://www.printfriendly.com/print?url='.urlencode(get_permalink());
391
+
392
  if (!$js_enabled) {
 
393
  if($this->google_analytics_enabled()) {
394
  $onclick = $onclick.' onclick="'.$analytics_code.'"';
395
  }
396
+ $href = "http://www.printfriendly.com/print?headerImageUrl=".urlencode($this->options['image_url'])."&headerTagline=".urlencode($this->options['tagline'])."&pfCustomCSS=".urlencode($this->options['custom_css_url'])."&imageDisplayStyle=".urlencode($this->options['image-style'])."&disableClickToDel=".urlencode($this->options['click_to_delete'])."&disablePDF=".urlencode($this->options['pdf'])."&disablePrint=".urlencode($this->options['print'])."&disableEmail=".urlencode($this->options['email'])."&hideImages=".urlencode($this->options['hide-images'])."&url=".urlencode(get_permalink())."&redirect=wp";
397
  }
398
  if ( !is_singular() && '' != $onclick && $js_enabled) {
399
  $onclick = '';
1402
  global $printfriendly;
1403
  return $printfriendly->getButton(true);
1404
  }
1405
+
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: printfriendly,joostdevalk, jrf
3
  Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
  Tested up to: 4.1
6
- Stable tag: 3.3.8
7
 
8
 
9
  The #1 Print and PDF button for your WordPress site. Printer Friendly pages without coding, css, or print.css. Fast, easy, and professional.
@@ -140,6 +140,9 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
140
 
141
  == Changelog ==
142
 
 
 
 
143
  = 3.3.8 =
144
  * Shortcode bug fix
145
  * Urlencoded button href to produce valid html
@@ -330,3 +333,4 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
330
 
331
  * To avoid conflicts with Google Analytics widgets, changed link structure. No longer uses onclick to call PrintFriendly Javascript. Now the javascript is called in the href.
332
  * Custom image support for hosted solutions
 
3
  Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
  Tested up to: 4.1
6
+ Stable tag: 3.3.9
7
 
8
 
9
  The #1 Print and PDF button for your WordPress site. Printer Friendly pages without coding, css, or print.css. Fast, easy, and professional.
140
 
141
  == Changelog ==
142
 
143
+ = 3.3.9 =
144
+ * Removed the functionality that opens new window when JavaScript is disabled
145
+
146
  = 3.3.8 =
147
  * Shortcode bug fix
148
  * Urlencoded button href to produce valid html
333
 
334
  * To avoid conflicts with Google Analytics widgets, changed link structure. No longer uses onclick to call PrintFriendly Javascript. Now the javascript is called in the href.
335
  * Custom image support for hosted solutions
336
+