Print, PDF, Email by PrintFriendly - Version 3.4.7

Version Description

  • Fix button style to remove underline
Download this release

Release Info

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

Code changes from version 3.4.6 to 3.4.7

Files changed (6) hide show
  1. pf.php +173 -75
  2. readme.txt +109 -71
  3. screenshot-1.png +0 -0
  4. screenshot-2.png +0 -0
  5. screenshot-3.png +0 -0
  6. screenshot-4.png +0 -0
pf.php CHANGED
@@ -1,15 +1,27 @@
1
  <?php
2
 
3
  /*
4
- 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.4.6
9
- Author: Print Friendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
 
 
 
 
 
 
 
 
 
 
 
 
13
  3.4.6 - Always removed PrintFriendly button underline regardless plugin CSS for button styles option
14
  3.4.4 - Removed page content selection option - Wordpress Standard/Strict
15
  3.4.2 - Fixed the issue occured due to new changes made in the page content selection options
@@ -24,9 +36,9 @@ Changelog :
24
  3.3.4 - Provided Algorithm Options
25
  3.3.3 - Using WP content hook for all Buttons
26
  3.3.2 - Algorithm update
27
- 3.3.1 - SSL support issue.
28
  3.3.0 - Printfriendly custom commands support and PF Algo V6 release.
29
- 3.2.10 - Fixed Bug.
30
  3.2.9 - Added Support for Google Analytics
31
  3.2.8 - Algorithm Update
32
  3.2.7 - Removed Break tag from button code.
@@ -116,6 +128,13 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
116
  */
117
  var $settings_page = '';
118
 
 
 
 
 
 
 
 
119
  /**
120
  * Constructor
121
  *
@@ -132,7 +151,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
132
  $this->set_defaults();
133
 
134
  /**
135
- * Set page content selection option "Wordpress Standard/Strict" to "WP Template"
136
  */
137
  if( isset( $this->options['pf_algo'] ) && $this->options['pf_algo'] == 'ws' ){
138
  $this->options['pf_algo'] = 'wp';
@@ -149,9 +168,18 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
149
  add_filter( 'the_content', array( &$this, 'show_link' ) );
150
  add_filter( 'the_excerpt', array( &$this, 'show_link' ) );
151
  }
152
-
153
  add_action('the_content', array(&$this, 'add_pf_content_class_around_content_hook'));
154
 
 
 
 
 
 
 
 
 
 
155
  if ( is_admin() ) {
156
  // Hook into init for registration of the option and the language files
157
  add_action( 'admin_init', array( &$this, 'init' ) );
@@ -168,20 +196,96 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
168
  // Register a link to the settings page on the plugins overview page
169
  add_filter( 'plugin_action_links', array( &$this, 'filter_plugin_actions' ), 10, 2 );
170
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  }
172
 
 
 
 
173
  /**
174
  * Adds wraps content in pf-content class to help Printfriendly algo determine the content
175
- *
176
  * @since 3.2.8
177
  *
178
  **/
179
  function add_pf_content_class_around_content_hook($content = false) {
180
-
181
- if( isset($this->options['pf_algo']) &&
182
- $content &&
183
- $this->options['pf_algo'] == 'wp' &&
184
- !$this->print_only_override($content) ) {
185
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ));
186
  return '<div class="pf-content">'.$content.'</div>';
187
  } else {
@@ -190,7 +294,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
190
  }
191
 
192
  /**
193
- * Override to check if print-only command is being used
194
  *
195
  * @since 3.3.0
196
  **/
@@ -199,7 +303,17 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
199
  $pf_pattern = '/class=[\"]pf-content|class=[\']pf-content|pf-content/';
200
  return (preg_match($pattern, $content) || preg_match($pf_pattern, $content)) ;
201
  }
202
-
 
 
 
 
 
 
 
 
 
 
203
  /**
204
  * PHP 4 Compatible Constructor
205
  *
@@ -229,22 +343,24 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
229
  <style type="text/css" media="screen">
230
  div.printfriendly {
231
  margin: <?php echo $this->options['margin_top'].'px '.$this->options['margin_right'].'px '.$this->options['margin_bottom'].'px '.$this->options['margin_left'].'px'; ?>;
 
 
232
  }
233
  div.printfriendly a, div.printfriendly a:link, div.printfriendly a:visited {
234
  font-size: <?php echo $this->options['text_size']; ?>px;
235
  color: <?php echo $this->options['text_color']; ?>;
236
  vertical-align: bottom;
237
  }
238
-
 
 
239
  .printfriendly a:hover {
240
  cursor: pointer;
241
  }
242
-
243
  .printfriendly a img {
244
  border: none;
245
  padding:0;
246
  margin-right: 6px;
247
- display:inline-block;
248
  box-shadow: none;
249
  -webkit-box-shadow: none;
250
  -moz-box-shadow: none;
@@ -273,8 +389,6 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
273
  <?php
274
  }
275
 
276
-
277
-
278
  /**
279
  * Prints the PrintFriendly JavaScript, in the footer, and loads it asynchronously.
280
  *
@@ -293,12 +407,10 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
293
  }
294
 
295
  // Currently we use v3 for both: normal and password protected sites
296
-
297
-
298
  ?>
299
  <script type="text/javascript">
300
 
301
- var pfHeaderImgUrl = '<?php echo esc_js(esc_url_raw($image_url)); ?>';
302
  var pfHeaderTagline = '<?php echo esc_js($tagline); ?>';
303
  var pfdisableClickToDel = '<?php echo esc_js($this->options['click_to_delete']); ?>';
304
  var pfHideImages = '<?php echo esc_js($this->options['hide-images']); ?>';
@@ -306,16 +418,10 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
306
  var pfDisableEmail = '<?php echo esc_js($this->options['email']); ?>';
307
  var pfDisablePDF = '<?php echo esc_js($this->options['pdf']); ?>';
308
  var pfDisablePrint = '<?php echo esc_js($this->options['print']); ?>';
309
- var pfCustomCSS = '<?php echo esc_js($this->options['custom_css_url']); ?>';
310
  (function() {
311
  var e = document.createElement('script'); e.type="text/javascript";
312
- if('https:' == document.location.protocol) {
313
- js='https://pf-cdn.printfriendly.com/ssl/main.js';
314
- }
315
- else{
316
- js='http://cdn.printfriendly.com/printfriendly.js';
317
- }
318
- e.src = js;
319
  document.getElementsByTagName('head')[0].appendChild(e);
320
  })();
321
  </script>
@@ -343,7 +449,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
343
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
344
  return $button;
345
  }
346
-
347
  else
348
  {
349
  if ( (is_page() && ( isset($this->options['show_on_pages']) && 'on' === $this->options['show_on_pages'] ) )
@@ -368,13 +474,13 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
368
  }
369
 
370
  }
371
-
372
 
373
  /**
374
  * @since 3.3.8
375
  * @returns Printfriendly Button HTML
376
  */
377
-
378
  function getButton($add_footer_script = false) {
379
  if($add_footer_script) {
380
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
@@ -382,7 +488,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
382
  $js_enabled = $this->js_enabled();
383
  $analytics_code = "";
384
  $onclick = '';
385
-
386
  if ( $this->google_analytics_enabled() ) {
387
  $title_var = "NULL";
388
  $analytics_code = "if(typeof(_gaq) != 'undefined') { _gaq.push(['_trackEvent','PRINTFRIENDLY', 'print', '".$title_var."']);
@@ -391,7 +497,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
391
  $onclick = 'onclick="window.print();'. $analytics_code .' return false;"';
392
  } else {
393
  $onclick = '';
394
- }
395
  } else if ( $js_enabled ) {
396
  $onclick = 'onclick="window.print(); return false;"';
397
  }
@@ -399,20 +505,20 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
399
  if( $js_enabled ){
400
  $href = '#';
401
  } else {
402
- $href = 'http://www.printfriendly.com/print?url='.urlencode(get_permalink());
403
  }
404
 
405
  if (!$js_enabled) {
406
  if($this->google_analytics_enabled()) {
407
  $onclick = $onclick.' onclick="'.$analytics_code.'"';
408
  }
409
- $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())."&source=wp";
410
  }
411
  if ( !is_singular() && '' != $onclick && $js_enabled) {
412
  $onclick = '';
413
  $href = add_query_arg('pfstyle','wp',get_permalink());
414
  }
415
-
416
  $align = '';
417
  if ( 'none' != $this->options['content_position'] )
418
  $align = ' pf-align'.$this->options['content_position'];
@@ -420,7 +526,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
420
  $button = apply_filters( 'printfriendly_button', '<div class="printfriendly'.$align.'"><a href="'.$href.'" rel="nofollow" '.$onclick.' class="noslimstat">'.$this->button().'</a></div>' );
421
  return $button;
422
  }
423
-
424
 
425
  /**
426
  * @since 3.2.9
@@ -469,6 +575,9 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
469
  * @return array $valid_input with validated options.
470
  */
471
  function options_validate( $input ) {
 
 
 
472
  $valid_input = $input;
473
 
474
  /* Section 1 options */
@@ -617,20 +726,17 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
617
 
618
 
619
  /* Section 5 options */
620
- if ( !isset( $input['website_protocol'] ) || !in_array( $input['website_protocol'], array( 'http', 'https' ) ) )
621
- $valid_input['website_protocol'] = 'http';
622
-
623
  if ( !isset( $input['password_protected'] ) || !in_array( $input['password_protected'], array( 'no', 'yes' ) ) )
624
  $valid_input['password_protected'] = 'no';
625
 
626
  if ( !isset( $input['javascript'] ) || !in_array( $input['javascript'], array( 'no', 'yes' ) ) )
627
  $valid_input['javascript'] = 'yes';
628
-
629
  /*Analytics Options */
630
  if ( !isset( $input['enable_google_analytics'] ) || !in_array( $input['enable_google_analytics'], array( 'no', 'yes' ) ) ) {
631
  $valid_input['enable_google_analytics'] = "no";
632
  }
633
-
634
  if ( !isset( $input['pf_algo'] ) || !in_array( $input['pf_algo'], array( 'wp', 'pf' ) ) ) {
635
  $valid_input['pf_algo'] = "wp";
636
  }
@@ -661,7 +767,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
661
  function contextual_help( $contextual_help, $screen_id ) {
662
  if ( $this->settings_page == $screen_id ) {
663
  $contextual_help = '<strong>'.__( "Need Help?", $this->hook ).'</strong><br/>'
664
- .sprintf( __( "Be sure to check out the %s!", $this->hook), '<a href="http://wordpress.org/extend/plugins/printfriendly/faq/">'.__( "Frequently Asked Questions", $this->hook ).'</a>' );
665
  }
666
  return $contextual_help;
667
  }
@@ -717,7 +823,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
717
  'button_type' => 'pf-button.gif',
718
  'content_position' => 'left',
719
  'content_placement' => 'after',
720
- 'custom_image' => 'http://cdn.printfriendly.com/pf-icon.gif',
721
  'custom_text' => 'Print Friendly',
722
  'enable_css' => 'on',
723
  'margin_top' => '12',
@@ -737,7 +843,6 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
737
  'email' => '0', // 0 - allow, 1 - do not allow
738
  'pdf' => '0', // 0 - allow, 1 - do not allow
739
  'print' => '0', // 0 - allow, 1 - do not allow
740
- 'website_protocol' => 'http',
741
  'password_protected' => 'no',
742
  'javascript' => 'yes',
743
  'custom_css_url' => '',
@@ -776,7 +881,6 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
776
  'image_url' => '',
777
  'tagline' => '',
778
  'click_to_delete' => '0',
779
- 'website_protocol' => 'http',
780
  'password_protected' => 'no',
781
  'javascript' => 'yes'
782
  );
@@ -800,7 +904,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
800
  if(in_array($this->options['button_type'], array('pf_button_sq_qry_m.png', 'pf_button_sq_qry_l.png')))
801
  $this->options['button_type'] = str_replace('qry', 'gry', $this->options['button_type']);
802
 
803
- $image_address = '//cdn.printfriendly.com/'.$this->options['button_type'];
804
  $this->options['button_type'] = 'custom-image';
805
  $this->options['custom_text'] = '';
806
  $this->options['custom_image'] = $image_address;
@@ -923,36 +1027,37 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
923
  function button( $name = false ){
924
  if( !$name )
925
  $name = $this->options['button_type'];
926
- $button_css = $this->generic_button_css();
 
927
  $text = $this->options['custom_text'];
928
- $img_path = 'http://cdn.printfriendly.com/';
929
- if($this->options['website_protocol'] == 'https')
930
- $img_path = 'https://pf-cdn.printfriendly.com/images/';
931
 
932
  switch($name){
933
  case "custom-image":
934
  if( '' == trim($this->options['custom_image']) )
935
  $return = '';
936
  else
937
- $return = '<img src="'.$this->options['custom_image'].'" alt="Print Friendly" />';
938
 
939
- $return .= $this->options['custom_text'];
940
 
941
  return $return;
942
  break;
 
943
  case "text-only":
944
  return '<span class="printfriendly-text2">'.$text.'</span>';
945
  break;
946
 
947
  case "pf-icon-both.gif":
948
- return '<span class="printfriendly-text2 printandpdf"><img style="border:none;margin-right:6px;" src="'.$img_path.'pf-print-icon.gif" width="16" height="15" alt="Print Friendly Version of this page" />Print <img style="'.$button_css.'margin:0 6px" src="'.$img_path.'pf-pdf-icon.gif" width="12" height="12" alt="Get a PDF version of this webpage" />PDF</span>';
949
  break;
950
 
951
  case "pf-icon-small.gif":
952
- return '<img style="'.$button_css.'margin-right:4px;" src="'.$img_path.'pf-icon-small.gif" alt="PrintFriendly and PDF" width="18" height="18"><span class="printfriendly-text2">'.$text.'</span>';
953
  break;
 
954
  case "pf-icon.gif":
955
- return '<img style="'.$button_css.'margin-right:6px;" src="'.$img_path.'pf-icon.gif" width="23" height="25" alt="PrintFriendly and PDF"><span class="printfriendly-text2">'.$text.'</span>';
956
  break;
957
 
958
  default:
@@ -965,7 +1070,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
965
  *
966
  *
967
  **/
968
-
969
  function generic_button_css() {
970
  return "border:none;-webkit-box-shadow:none; box-shadow:none;";
971
  }
@@ -980,9 +1085,9 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
980
  if( '' == trim($this->options['custom_image']) )
981
  $button_preview = '<span id="pf-custom-button-preview"></span>';
982
  else
983
- $button_preview = '<span id="pf-custom-button-preview"><img src="'.$this->options['custom_image'].'" alt="Print Friendly" /></span>';
984
 
985
- $button_preview .= '<span class="printfriendly-text2">'.$this->options['custom_text'].'</span>';
986
 
987
  echo $button_preview;
988
  }
@@ -1146,6 +1251,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1146
  <h2><?php _e( 'Print Friendly & PDF Settings', $this->hook ); ?></h2>
1147
 
1148
  <form action="options.php" method="post">
 
1149
  <?php settings_fields( $this->option_name ); ?>
1150
 
1151
  <h3><?php _e( "Pick Your Button Style", $this->hook ); ?></h3>
@@ -1176,7 +1282,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1176
  <div id="custom-img">
1177
  <?php _e( "Enter Image URL", $this->hook ); ?><br>
1178
  <input id="custom_image" type="text" class="clear regular-text" size="30" name="<?php echo $this->option_name; ?>[custom_image]" value="<?php $this->val( 'custom_image' ); ?>" />
1179
- <div class="description"><?php _e( "Ex: http://www.example.com/<br>Ex: /wp/wp-content/uploads/example.png", $this->hook ); ?>
1180
  </div>
1181
  </div>
1182
  <div id="pf-custom-button-error"></div>
@@ -1340,21 +1446,13 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1340
  <label for="custom_css_url">
1341
  <?php _e( "Custom css url", $this->hook ); ?>
1342
  <input id="custom_css_url" type="text" class="regular-text" name="<?php echo $this->option_name; ?>[custom_css_url]" value="<?php $this->val( 'custom_css_url' ); ?>" />
1343
- <span class="description pf-help-link"><a target="_howto" href="http://support.printfriendly.com/customer/portal/articles/895256-custom-css-styles"><?php _e( '?', $this->hook ); ?></a></span>
1344
  </label>
1345
  </div>
1346
 
1347
  <!--Section 5 WebMaster-->
1348
  <h3><?php _e( "Webmaster Settings", $this->hook ); ?></h3>
1349
 
1350
- <label for="website_protocol"><?php _e( 'Website Protocol', $this->hook ); ?><br>
1351
- <select id="website_protocol" name="<?php echo $this->option_name; ?>[website_protocol]" >
1352
- <option value="http" <?php selected( $this->options['website_protocol'], 'http' ); ?>><?php _e( "http (common)", $this->hook ); ?></option>
1353
- <option value="https" <?php selected( $this->options['website_protocol'], 'https' ); ?>><?php _e( "https (secure)", $this->hook ); ?></option>
1354
- </select>
1355
- <span id="https-beta-registration" class="description">HTTPS is in Beta. Please <a href="#" onclick="window.open('http://www.printfriendly.com/https-registration.html', 'newwindow', 'width=600, height=550'); return false;">Register for updates</a>.
1356
- </span>
1357
- </label>
1358
  <label for="password_protected"><?php _e( 'Password Protected Content', $this->hook ); ?>
1359
  <select id="password_protected" name="<?php echo $this->option_name; ?>[password_protected]">
1360
  <option value="no" <?php selected( $this->options['password_protected'], 'no' ); ?>><?php _e( "No", $this->hook ); ?></option>
@@ -1379,7 +1477,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1379
  <option value="no" <?php $this->selected( 'enable_google_analytics', 'no' ); ?>> <?php _e( "No", $this->hook ); ?></option>
1380
  </select>
1381
  </label>
1382
-
1383
  <label for="pf-algo-usage"><?php _e( 'My Page Content Selected By:', $this->hook ); ?> <span class="description no-italics" ><?php _e( 'Change this setting if your content is not showing in the preview.', $this->hook ); ?></span><br>
1384
  <select id="pf-algo-usage" name="<?php echo $this->option_name; ?>[pf_algo]">
1385
  <option value="wp" <?php $this->selected( 'pf_algo', 'wp' ); ?>> <?php _e( 'WP Template', $this->hook ); ?></option>
@@ -1392,9 +1490,9 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1392
  <input type="reset" class="button-secondary" value="<?php esc_attr_e( "Cancel", $this->hook ); ?>"/>
1393
  </p>
1394
  <div id="after-submit">
1395
- <p><?php _e( "Need professional options for your corporate, education, or agency developed website? Check out", $this->hook ); ?> <a href="http://www.printfriendly.com/pro">PrintFriendly Pro</a>.</p>
1396
  <p>
1397
- <?php _e( "Like PrintFriendly?", $this->hook ); ?> <a href="http://wordpress.org/extend/plugins/printfriendly/"><?php _e( "Give us a rating", $this->hook ); ?></a>. <?php _e( "Need help or have suggestions?", $this->hook ); ?> <a href="mailto:support@printfriendly.com?subject=Support%20for%20PrintFriendly%20WordPress%20plugin">support@PrintFriendly.com</a>.</p>
1398
  </div>
1399
 
1400
  </form>
1
  <?php
2
 
3
  /*
4
+ Plugin Name: Print, PDF & Email by PrintFriendly
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.7.4
9
+ Author: Print, PDF, & Email by PrintFriendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
13
+ 3.7.4 - Added CSS Relative Position and Z-Index to button to avoid content covering the button.
14
+ 3.7.3 - Always use https
15
+ 3.7.2 - Use schema less URLs for loading icons
16
+ 3.7.1 - Use www.printfriendly.com instead of app.printfriendly.com for redirects
17
+ 3.7.0 - Remove http/https option, use current schema
18
+ 3.6.0 - Allow custom HTML in Custom Button Text
19
+ 3.5.4 - WooCommerce 'Content Algorithm' fix
20
+ 3.5.3 - Fix security issues
21
+ 3.5.2 - Fix code to support PHP 5.2
22
+ 3.5.0 - WooCommerce product page improvements. Better support for product images, price, and description.
23
+ 3.4.8 - Fix button images style
24
+ 3.4.7 - Fix button style to remove underline
25
  3.4.6 - Always removed PrintFriendly button underline regardless plugin CSS for button styles option
26
  3.4.4 - Removed page content selection option - Wordpress Standard/Strict
27
  3.4.2 - Fixed the issue occured due to new changes made in the page content selection options
36
  3.3.4 - Provided Algorithm Options
37
  3.3.3 - Using WP content hook for all Buttons
38
  3.3.2 - Algorithm update
39
+ 3.3.1 - SSL support issue.
40
  3.3.0 - Printfriendly custom commands support and PF Algo V6 release.
41
+ 3.2.10 - Fixed Bug.
42
  3.2.9 - Added Support for Google Analytics
43
  3.2.8 - Algorithm Update
44
  3.2.7 - Removed Break tag from button code.
128
  */
129
  var $settings_page = '';
130
 
131
+ /**
132
+ * Helps don't print related products for WooCommerce
133
+ *
134
+ * @since 3.5
135
+ */
136
+ var $wc_should_print = true;
137
+
138
  /**
139
  * Constructor
140
  *
151
  $this->set_defaults();
152
 
153
  /**
154
+ * Set page content selection option "Wordpress Standard/Strict" to "WP Template"
155
  */
156
  if( isset( $this->options['pf_algo'] ) && $this->options['pf_algo'] == 'ws' ){
157
  $this->options['pf_algo'] = 'wp';
168
  add_filter( 'the_content', array( &$this, 'show_link' ) );
169
  add_filter( 'the_excerpt', array( &$this, 'show_link' ) );
170
  }
171
+
172
  add_action('the_content', array(&$this, 'add_pf_content_class_around_content_hook'));
173
 
174
+ // WooCommerce hooks
175
+ add_filter('woocommerce_get_price_html', array(&$this, 'woocommerce_get_price_html'), 10, 2);
176
+
177
+ add_filter('woocommerce_single_product_image_html', array(&$this, 'woocommerce_single_product_image_html'));
178
+ add_filter('woocommerce_single_product_image_thumbnail_html', array(&$this, 'woocommerce_single_product_image_thumbnail_html'));
179
+
180
+ add_filter('woocommerce_up_sells_columns', array(&$this, 'woocommerce_up_sells_columns'));
181
+
182
+ // Admin hooks
183
  if ( is_admin() ) {
184
  // Hook into init for registration of the option and the language files
185
  add_action( 'admin_init', array( &$this, 'init' ) );
196
  // Register a link to the settings page on the plugins overview page
197
  add_filter( 'plugin_action_links', array( &$this, 'filter_plugin_actions' ), 10, 2 );
198
  }
199
+ }
200
+
201
+ /**
202
+ * Do not print related products
203
+ *
204
+ * @since 3.5
205
+ */
206
+ function woocommerce_up_sells_columns( $columns ) {
207
+ $this->wc_should_print = false;
208
+ return $columns;
209
+ }
210
+
211
+ /**
212
+ * Add pf-content class to WooCommerce Product Price
213
+ *
214
+ * @since 3.5
215
+ */
216
+ function woocommerce_get_price_html( $price ) {
217
+ if ( $this->is_content_algo_on($price) ) {
218
+ return $this->add_class($price, 'pf-content');
219
+ } else {
220
+ return $price;
221
+ }
222
+ }
223
+
224
+ /**
225
+ * Add pf-content class to WooCommerce main Product Image
226
+ *
227
+ * @since 3.5
228
+ */
229
+ function woocommerce_single_product_image_html( $image ) {
230
+ if ( $this->is_content_algo_on($image) ) {
231
+ return $this->add_class($image, 'pf-content');
232
+ } else {
233
+ return $image;
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Add pf-content class to WooCommerce Product Images from gallery
239
+ *
240
+ * @since 3.5
241
+ */
242
+ function woocommerce_single_product_image_thumbnail_html( $image ) {
243
+ return $this->add_class($image, 'pf-content pf-gallery-img', 'img');
244
+ }
245
+
246
+ /**
247
+ * Adds class to elements by tagname
248
+ *
249
+ * @since 3.5
250
+ */
251
+ function add_class( $html, $class_name, $tagName = NULL ) {
252
+ if(!$this->wc_should_print || $html == "")
253
+ return $html;
254
+
255
+ $dom = new DOMDocument;
256
+ $dom->loadHTML($html);
257
+
258
+ // Use body tag if nothing passed to $tagName parameter
259
+ if (is_null($tagName)) {
260
+ $elements = $dom->getElementsByTagName('body')->item(0)->childNodes;
261
+ } else {
262
+ $elements = $dom->getElementsByTagName($tagName);
263
+ }
264
+
265
+ // return original html if we can't parse it with DOMDocument
266
+ if ($elements->length == 0) {
267
+ return $html;
268
+ }
269
+
270
+ // Find all ElementNodes and add class
271
+ foreach($elements as $element) {
272
+ if ($element->nodeType != XML_ELEMENT_NODE)
273
+ continue;
274
+
275
+ $element->setAttribute('class', $element->getAttribute('class') . ' ' . $class_name);
276
  }
277
 
278
+ return $dom->saveHTML();
279
+ }
280
+
281
  /**
282
  * Adds wraps content in pf-content class to help Printfriendly algo determine the content
283
+ *
284
  * @since 3.2.8
285
  *
286
  **/
287
  function add_pf_content_class_around_content_hook($content = false) {
288
+ if( $this->is_content_algo_on($content) ) {
 
 
 
 
289
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ));
290
  return '<div class="pf-content">'.$content.'</div>';
291
  } else {
294
  }
295
 
296
  /**
297
+ * Override to check if print-only command is being used
298
  *
299
  * @since 3.3.0
300
  **/
303
  $pf_pattern = '/class=[\"]pf-content|class=[\']pf-content|pf-content/';
304
  return (preg_match($pattern, $content) || preg_match($pf_pattern, $content)) ;
305
  }
306
+
307
+ /**
308
+ * Check if Content Algorithm is selected and content doesn't use print-only
309
+ *
310
+ * @since 3.5.4
311
+ **/
312
+ function is_content_algo_on($content) {
313
+ return isset($this->options['pf_algo']) && $content && $this->options['pf_algo'] == 'wp' && !$this->print_only_override($content);
314
+ }
315
+
316
+
317
  /**
318
  * PHP 4 Compatible Constructor
319
  *
343
  <style type="text/css" media="screen">
344
  div.printfriendly {
345
  margin: <?php echo $this->options['margin_top'].'px '.$this->options['margin_right'].'px '.$this->options['margin_bottom'].'px '.$this->options['margin_left'].'px'; ?>;
346
+ position: relative;
347
+ z-index: 1000;
348
  }
349
  div.printfriendly a, div.printfriendly a:link, div.printfriendly a:visited {
350
  font-size: <?php echo $this->options['text_size']; ?>px;
351
  color: <?php echo $this->options['text_color']; ?>;
352
  vertical-align: bottom;
353
  }
354
+ .printfriendly a {
355
+ box-shadow:none;
356
+ }
357
  .printfriendly a:hover {
358
  cursor: pointer;
359
  }
 
360
  .printfriendly a img {
361
  border: none;
362
  padding:0;
363
  margin-right: 6px;
 
364
  box-shadow: none;
365
  -webkit-box-shadow: none;
366
  -moz-box-shadow: none;
389
  <?php
390
  }
391
 
 
 
392
  /**
393
  * Prints the PrintFriendly JavaScript, in the footer, and loads it asynchronously.
394
  *
407
  }
408
 
409
  // Currently we use v3 for both: normal and password protected sites
 
 
410
  ?>
411
  <script type="text/javascript">
412
 
413
+ var pfHeaderImgUrl = '<?php echo esc_js(esc_url($image_url)); ?>';
414
  var pfHeaderTagline = '<?php echo esc_js($tagline); ?>';
415
  var pfdisableClickToDel = '<?php echo esc_js($this->options['click_to_delete']); ?>';
416
  var pfHideImages = '<?php echo esc_js($this->options['hide-images']); ?>';
418
  var pfDisableEmail = '<?php echo esc_js($this->options['email']); ?>';
419
  var pfDisablePDF = '<?php echo esc_js($this->options['pdf']); ?>';
420
  var pfDisablePrint = '<?php echo esc_js($this->options['print']); ?>';
421
+ var pfCustomCSS = '<?php echo esc_js(esc_url($this->options['custom_css_url'])); ?>';
422
  (function() {
423
  var e = document.createElement('script'); e.type="text/javascript";
424
+ e.src = 'https://cdn.printfriendly.com/printfriendly.js';
 
 
 
 
 
 
425
  document.getElementsByTagName('head')[0].appendChild(e);
426
  })();
427
  </script>
449
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
450
  return $button;
451
  }
452
+
453
  else
454
  {
455
  if ( (is_page() && ( isset($this->options['show_on_pages']) && 'on' === $this->options['show_on_pages'] ) )
474
  }
475
 
476
  }
477
+
478
 
479
  /**
480
  * @since 3.3.8
481
  * @returns Printfriendly Button HTML
482
  */
483
+
484
  function getButton($add_footer_script = false) {
485
  if($add_footer_script) {
486
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
488
  $js_enabled = $this->js_enabled();
489
  $analytics_code = "";
490
  $onclick = '';
491
+
492
  if ( $this->google_analytics_enabled() ) {
493
  $title_var = "NULL";
494
  $analytics_code = "if(typeof(_gaq) != 'undefined') { _gaq.push(['_trackEvent','PRINTFRIENDLY', 'print', '".$title_var."']);
497
  $onclick = 'onclick="window.print();'. $analytics_code .' return false;"';
498
  } else {
499
  $onclick = '';
500
+ }
501
  } else if ( $js_enabled ) {
502
  $onclick = 'onclick="window.print(); return false;"';
503
  }
505
  if( $js_enabled ){
506
  $href = '#';
507
  } else {
508
+ $href = 'https://www.printfriendly.com/print?url='.urlencode(get_permalink());
509
  }
510
 
511
  if (!$js_enabled) {
512
  if($this->google_analytics_enabled()) {
513
  $onclick = $onclick.' onclick="'.$analytics_code.'"';
514
  }
515
+ $href = "https://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())."&source=wp";
516
  }
517
  if ( !is_singular() && '' != $onclick && $js_enabled) {
518
  $onclick = '';
519
  $href = add_query_arg('pfstyle','wp',get_permalink());
520
  }
521
+
522
  $align = '';
523
  if ( 'none' != $this->options['content_position'] )
524
  $align = ' pf-align'.$this->options['content_position'];
526
  $button = apply_filters( 'printfriendly_button', '<div class="printfriendly'.$align.'"><a href="'.$href.'" rel="nofollow" '.$onclick.' class="noslimstat">'.$this->button().'</a></div>' );
527
  return $button;
528
  }
529
+
530
 
531
  /**
532
  * @since 3.2.9
575
  * @return array $valid_input with validated options.
576
  */
577
  function options_validate( $input ) {
578
+ // Prevent CSRF attack
579
+ check_admin_referer( 'pf-options', 'pf-nonce' );
580
+
581
  $valid_input = $input;
582
 
583
  /* Section 1 options */
726
 
727
 
728
  /* Section 5 options */
 
 
 
729
  if ( !isset( $input['password_protected'] ) || !in_array( $input['password_protected'], array( 'no', 'yes' ) ) )
730
  $valid_input['password_protected'] = 'no';
731
 
732
  if ( !isset( $input['javascript'] ) || !in_array( $input['javascript'], array( 'no', 'yes' ) ) )
733
  $valid_input['javascript'] = 'yes';
734
+
735
  /*Analytics Options */
736
  if ( !isset( $input['enable_google_analytics'] ) || !in_array( $input['enable_google_analytics'], array( 'no', 'yes' ) ) ) {
737
  $valid_input['enable_google_analytics'] = "no";
738
  }
739
+
740
  if ( !isset( $input['pf_algo'] ) || !in_array( $input['pf_algo'], array( 'wp', 'pf' ) ) ) {
741
  $valid_input['pf_algo'] = "wp";
742
  }
767
  function contextual_help( $contextual_help, $screen_id ) {
768
  if ( $this->settings_page == $screen_id ) {
769
  $contextual_help = '<strong>'.__( "Need Help?", $this->hook ).'</strong><br/>'
770
+ .sprintf( __( "Be sure to check out the %s!", $this->hook), '<a href="https://wordpress.org/extend/plugins/printfriendly/faq/">'.__( "Frequently Asked Questions", $this->hook ).'</a>' );
771
  }
772
  return $contextual_help;
773
  }
823
  'button_type' => 'pf-button.gif',
824
  'content_position' => 'left',
825
  'content_placement' => 'after',
826
+ 'custom_image' => 'https://cdn.printfriendly.com/pf-icon.gif',
827
  'custom_text' => 'Print Friendly',
828
  'enable_css' => 'on',
829
  'margin_top' => '12',
843
  'email' => '0', // 0 - allow, 1 - do not allow
844
  'pdf' => '0', // 0 - allow, 1 - do not allow
845
  'print' => '0', // 0 - allow, 1 - do not allow
 
846
  'password_protected' => 'no',
847
  'javascript' => 'yes',
848
  'custom_css_url' => '',
881
  'image_url' => '',
882
  'tagline' => '',
883
  'click_to_delete' => '0',
 
884
  'password_protected' => 'no',
885
  'javascript' => 'yes'
886
  );
904
  if(in_array($this->options['button_type'], array('pf_button_sq_qry_m.png', 'pf_button_sq_qry_l.png')))
905
  $this->options['button_type'] = str_replace('qry', 'gry', $this->options['button_type']);
906
 
907
+ $image_address = 'https://cdn.printfriendly.com/'.$this->options['button_type'];
908
  $this->options['button_type'] = 'custom-image';
909
  $this->options['custom_text'] = '';
910
  $this->options['custom_image'] = $image_address;
1027
  function button( $name = false ){
1028
  if( !$name )
1029
  $name = $this->options['button_type'];
1030
+ $button_css = $this->generic_button_css();
1031
+ /* esc_html was removerd to support custom html, CSRF prevents from attack by using this field */
1032
  $text = $this->options['custom_text'];
1033
+ $img_path = 'https://cdn.printfriendly.com/';
 
 
1034
 
1035
  switch($name){
1036
  case "custom-image":
1037
  if( '' == trim($this->options['custom_image']) )
1038
  $return = '';
1039
  else
1040
+ $return = '<img src="'.esc_url($this->options['custom_image']).'" alt="Print Friendly" />';
1041
 
1042
+ $return .= $text;
1043
 
1044
  return $return;
1045
  break;
1046
+
1047
  case "text-only":
1048
  return '<span class="printfriendly-text2">'.$text.'</span>';
1049
  break;
1050
 
1051
  case "pf-icon-both.gif":
1052
+ return '<span class="printfriendly-text2 printandpdf"><img style="border:none;margin-right:6px;display:inline-block" src="'.$img_path.'pf-print-icon.gif" width="16" height="15" alt="Print Friendly Version of this page" />Print <img style="'.$button_css.'margin:0 6px;display:inline-block" src="'.$img_path.'pf-pdf-icon.gif" width="12" height="12" alt="Get a PDF version of this webpage" />PDF</span>';
1053
  break;
1054
 
1055
  case "pf-icon-small.gif":
1056
+ return '<img style="'.$button_css.'margin-right:4px;display:inline-block" src="'.$img_path.'pf-icon-small.gif" alt="PrintFriendly and PDF" width="18" height="18"><span class="printfriendly-text2">'.$text.'</span>';
1057
  break;
1058
+
1059
  case "pf-icon.gif":
1060
+ return '<img style="'.$button_css.'margin-right:6px;display:inline-block" src="'.$img_path.'pf-icon.gif" width="23" height="25" alt="PrintFriendly and PDF"><span class="printfriendly-text2">'.$text.'</span>';
1061
  break;
1062
 
1063
  default:
1070
  *
1071
  *
1072
  **/
1073
+
1074
  function generic_button_css() {
1075
  return "border:none;-webkit-box-shadow:none; box-shadow:none;";
1076
  }
1085
  if( '' == trim($this->options['custom_image']) )
1086
  $button_preview = '<span id="pf-custom-button-preview"></span>';
1087
  else
1088
+ $button_preview = '<span id="pf-custom-button-preview"><img src="'.esc_url($this->options['custom_image']).'" alt="Print Friendly" /></span>';
1089
 
1090
+ $button_preview .= '<span class="printfriendly-text2">'.esc_html($this->options['custom_text']).'</span>';
1091
 
1092
  echo $button_preview;
1093
  }
1251
  <h2><?php _e( 'Print Friendly & PDF Settings', $this->hook ); ?></h2>
1252
 
1253
  <form action="options.php" method="post">
1254
+ <?php wp_nonce_field( 'pf-options', 'pf-nonce' ); ?>
1255
  <?php settings_fields( $this->option_name ); ?>
1256
 
1257
  <h3><?php _e( "Pick Your Button Style", $this->hook ); ?></h3>
1282
  <div id="custom-img">
1283
  <?php _e( "Enter Image URL", $this->hook ); ?><br>
1284
  <input id="custom_image" type="text" class="clear regular-text" size="30" name="<?php echo $this->option_name; ?>[custom_image]" value="<?php $this->val( 'custom_image' ); ?>" />
1285
+ <div class="description"><?php _e( "Ex: https://www.example.com/<br>Ex: /wp/wp-content/uploads/example.png", $this->hook ); ?>
1286
  </div>
1287
  </div>
1288
  <div id="pf-custom-button-error"></div>
1446
  <label for="custom_css_url">
1447
  <?php _e( "Custom css url", $this->hook ); ?>
1448
  <input id="custom_css_url" type="text" class="regular-text" name="<?php echo $this->option_name; ?>[custom_css_url]" value="<?php $this->val( 'custom_css_url' ); ?>" />
1449
+ <span class="description pf-help-link"><a target="_howto" href="https://support.printfriendly.com/customer/portal/articles/895256-custom-css-styles"><?php _e( '?', $this->hook ); ?></a></span>
1450
  </label>
1451
  </div>
1452
 
1453
  <!--Section 5 WebMaster-->
1454
  <h3><?php _e( "Webmaster Settings", $this->hook ); ?></h3>
1455
 
 
 
 
 
 
 
 
 
1456
  <label for="password_protected"><?php _e( 'Password Protected Content', $this->hook ); ?>
1457
  <select id="password_protected" name="<?php echo $this->option_name; ?>[password_protected]">
1458
  <option value="no" <?php selected( $this->options['password_protected'], 'no' ); ?>><?php _e( "No", $this->hook ); ?></option>
1477
  <option value="no" <?php $this->selected( 'enable_google_analytics', 'no' ); ?>> <?php _e( "No", $this->hook ); ?></option>
1478
  </select>
1479
  </label>
1480
+
1481
  <label for="pf-algo-usage"><?php _e( 'My Page Content Selected By:', $this->hook ); ?> <span class="description no-italics" ><?php _e( 'Change this setting if your content is not showing in the preview.', $this->hook ); ?></span><br>
1482
  <select id="pf-algo-usage" name="<?php echo $this->option_name; ?>[pf_algo]">
1483
  <option value="wp" <?php $this->selected( 'pf_algo', 'wp' ); ?>> <?php _e( 'WP Template', $this->hook ); ?></option>
1490
  <input type="reset" class="button-secondary" value="<?php esc_attr_e( "Cancel", $this->hook ); ?>"/>
1491
  </p>
1492
  <div id="after-submit">
1493
+ <p><?php _e( "Need professional options for your corporate, education, or agency developed website? Check out", $this->hook ); ?> <a href="https://www.printfriendly.com/pro">PrintFriendly Pro</a>.</p>
1494
  <p>
1495
+ <?php _e( "Like PrintFriendly?", $this->hook ); ?> <a href="https://wordpress.org/extend/plugins/printfriendly/"><?php _e( "Give us a rating", $this->hook ); ?></a>. <?php _e( "Need help or have suggestions?", $this->hook ); ?> <a href="mailto:support@printfriendly.com?subject=Support%20for%20PrintFriendly%20WordPress%20plugin">support@PrintFriendly.com</a>.</p>
1496
  </div>
1497
 
1498
  </form>
readme.txt CHANGED
@@ -1,41 +1,62 @@
1
- === Print Friendly and PDF Button===
2
  Contributors: printfriendly,joostdevalk, jrf
3
- Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
- Tested up to: 4.5.2
6
- Stable tag: 3.4.6
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.
10
 
11
  == Description ==
12
 
13
- The Print Friendly & PDF button saves paper and ink when printing or creating a PDF. It's fast, easy, and looks great when printed. Add the button now, and your users will see the difference.
14
 
15
- **How Print Friendly & PDF Works**
 
 
 
 
 
16
 
17
- The Print Friendly & PDF button automatically creates printer friendly and PDF versions of your pages without the hassle of having to create a print CSS file. No coding, hacking or programming required. Simply install the Print Friendly & PDF plugin, activate, and choose settings for full customization. It also gives your user the ability to remove images and paragraphs of text, so they really only have to print exactly what they want.
18
 
19
- **Cool Features For You:**
 
 
 
 
20
 
21
- * Get a Printer Friendly and PDF button for your users.
22
- * Fully Customizable! Choose your favorite print and PDF button, use a text link, or use your own graphic.
23
- * Get precision placement with easy to change margins, alignment, and pages for your Print and PDF button.
24
- * On-Page-Lightbox. Have you noticed that other printer friendly buttons open new windows, or tabs? Not with Print Friendly & PDF button. It opens in a Lightbox so you your users stay on the page, and your wp website.
25
- * Professional looking print and PDFs with branded headers.
26
- * More repeats and new users. Your brand/URL are printed on the page or saved in the PDF so users remember your site and new users can find you.
27
 
28
- **Cool Print Features for Users:**
 
 
 
 
 
29
 
30
- * Optimizes pages for printing and PDF so you save money and the environment.
31
- * You can Print or get a PDF.
32
- * Edit the page before printing or getting a PDF: remove the images and paragraphs you don't need to save ink!
33
 
34
- **Localized for 25 Languages**
35
 
36
- PrintFriendly & PDF automatically changes language to match your visitor's language settings. For example, if your browser is set to Spanish, then PrintFriendly will use Spanish.
37
 
38
- Supported languages:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  * Danish
41
  * German
@@ -61,37 +82,16 @@ Supported languages:
61
  * Chinese Simplified
62
  * Chinese Traditional
63
 
64
- [Learn more...](http://blog.printfriendly.com/2012/06/print-friendly-speaks-your-language.html)
65
-
66
  PrintFriendly and PDF is the #1 print optimization technology, **as featured in [Lifehacker](http://lifehacker.com/5272212/print-friendly-optimizes-web-pages-for-printing "PrintFriendly & PDF in Lifehacker"), [Mashable](http://mashable.com/2009/05/18/print-friendly/ "PrintFriendly & PDF in Mashable") & [makeuseof](http://www.makeuseof.com/dir/printfriendly-save-on-paper-and-ink/#comment-95052)**.
67
 
68
  **Give PrintFriendly & PDF a test drive at [PrintFriendly.com](http://www.printfriendly.com "PrintFriendly & PDF")**
69
 
70
 
71
- = Free - Ad Supported =
72
-
73
- This highly polished, professional plugin is free to use and fully functional. We maintain, improve, and offer support to all users.
74
-
75
- You get all this for free, and in return tasteful ads are displayed in a non-interfering way.
76
-
77
- Ads are only shown in the email confirmation window. No other ads are displayed or embedded in the content, or snuck in anywhere else.
78
-
79
- For example, [click here to see image](http://www.printfriendly.com/images/pf-free-ad-supported.gif)
80
-
81
-
82
- = Purchase an Ad-Free Subscription =
83
-
84
- Get a quality product for reasonable price. Remove the ads by purchasing an ad-free subscription. It’s cheap, easy, and straightforward.
85
-
86
- Your ad-free subscription applies to this email plugin, and our popular PrintFriendly & PDF plugin.
87
-
88
- Purchase now at [PrintFriendly.com/pro](http://printfriendly.com/pro)
89
 
90
- = Privacy & Data =
91
 
92
- PDFs are generated on our server; ** this plugin “phones home” **. Also if the end-user shares the page via email, the email is sent by our server.
93
-
94
- Our Fundamental Principles:
95
 
96
  * **We do not sell data.** Period.
97
  * **We do not share data,** unless compelled by the law.
@@ -104,7 +104,7 @@ Specifically, here’s what we do with the data and information:
104
 
105
  If you’re using the non-JavaScript option in the plugin, then the preview is generated on our server and temporarily stored in cache for a few minutes. After that time it is permanently deleted.
106
 
107
- **Email Address & Content get permanently deleted** In order to send the email, we need to store the email address and message on our server. After the email has been sent and found not to be a spammer, the email address is permanently deleted.
108
 
109
  **Server log files get created and deleted.** Browsers and Servers pass non-personally-identifying information, such as the browser type, language, referrer, and the date/time. We may use this data to analyze how the service is being used. Non-personally-identifying aggregate data may get published, e.g., by a report on trends in the usage of the service.
110
 
@@ -116,30 +116,69 @@ If you’re using the non-JavaScript option in the plugin, then the preview is g
116
  4. Select "Settings" to customize button style and placement.
117
 
118
  == Frequently Asked Questions ==
 
 
119
 
120
- = I set the button to align left / right and it doesn't align right! =
121
- Check whether your theme includes the [required CSS class](http://codex.wordpress.org/CSS#WordPress_Generated_Classes), PrintFriendly uses these to align your button. If that doesn't work for you, uncheck the "Add CSS to Pages" checkbox and style the button yourself.
122
 
123
- = The Print Friendly button is loading but it's not doing anything, what's wrong? =
124
- Check the "JavaScript fallback" checkbox in the settings and check again. If the button starts working now, the JavaScript isn't loading correctly. Check your source for a mention of `cdn.printfriendly.com/printfriendly.js`. If it's not there, make sure your theme has the required [wp_footer](http://codex.wordpress.org/Function_Reference/wp_footer) call.
125
 
126
- = Some of the input fields in the admin are disabled! =
127
- If you've disabled the loading of CSS and / or set "Add PrintFriendly To" to Manual, some of the input boxes will be disabled as you've basically disabled that functionality.
128
 
129
- = I'm manually adding the button but it's aligning wrong! =
130
- If you're getting unexpected results, you might want to set Horizontal Alignment to "None".
131
 
132
- = I still need help! =
133
- If you have any other issues with the plugin or the PrintFriendly widget, please write to support@printfriendly.com.
134
 
135
  == Screenshots ==
136
 
137
- 1. The Print Friendly widget optimizes and formats your pages for print. Users can remove images and text before printing plus get a PDF
138
- 2. The Settings Page: choose your print button, text link, or use your own text or graphic.
139
- 3. Localization example: Spanish
 
 
140
 
141
  == Changelog ==
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  = 3.4.6 =
144
  * Always removed PrintFriendly button underline regardless plugin CSS for button styles option
145
 
@@ -168,7 +207,7 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
168
  * Shortcode bug fix
169
  * Urlencoded button href to produce valid html
170
 
171
- = 3.3.7 =
172
  * Readme.txt update
173
 
174
  = 3.3.6 =
@@ -179,15 +218,15 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
179
 
180
  = 3.3.4 =
181
  * Provided Algorithm Options
182
-
183
  = 3.3.3 =
184
  * Using WP content hook for all Buttons
185
 
186
- = 3.3.2=
187
  * Algorithm Update
188
 
189
- = 3.3.1 =
190
- * SSL Support bug fixes.
191
 
192
  = 3.3.0 =
193
 
@@ -195,7 +234,7 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
195
  * Better syncing between client-side/server-side content detection algorithm. This will make improvements to content detection easier than ever.
196
  * Support for international language sub-regions, for example PT-BR vs. PT (Portuguese-Brazil vs. Portuguese for Portugal)
197
  * Support for Wordpress - 3.6 .
198
- * Printfriendly custom commands support.
199
 
200
  = 3.2.10 =
201
  * Fixed Bug in Google Analytics generation
@@ -203,13 +242,13 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
203
  = 3.2.9 =
204
  * Enabled support for Google Analytics
205
 
206
- = 3.2.8 =
207
  * Algorithm Update
208
 
209
- = 3.2.7 =
210
- * Removed Break tag from button code.
211
 
212
- = 3.2.6 =
213
  * Fixed Button behavior when displayed on Homepage for NON-JS version.
214
  * Fixed CSS issue with Button when placed above content.
215
  * Fixed box-shadow issue with button.
@@ -354,4 +393,3 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
354
 
355
  * 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.
356
  * Custom image support for hosted solutions
357
-
1
+ === Print, PDF, Email by PrintFriendly ===
2
  Contributors: printfriendly,joostdevalk, jrf
3
+ Tags: print, pdf, email, print button, wp-print, print recipe, print post, print page, print widget, print plugin, printable, wp-pdf, pdf post, pdf page, pdf button, pdf widget, pdf plugin, woocommerce print, woocommerce pdf
4
  Requires at least: 2.8
5
+ Tested up to: 4.7
6
+ Stable tag: 3.7.4
7
 
8
 
9
+ The #1 Print, PDF, Email button. Stylish, full featured, customizable. Add custom header, footer, and more.
10
 
11
  == Description ==
12
 
13
+ **Benefits For Publishers**
14
 
15
+ * Professional: highly polished, stable, and supported.
16
+ * Stylish lightbox (no annoying new tabs or window).
17
+ * Ultimate, Print, PDF, Email experience for your users.
18
+ * Works on HTTP, HTTPS, and password protected sites.
19
+ * Help people save money and the environment.
20
+ * Full featured and free (ad supported) or [Pro Service](https://www.printfriendly.com/button/pro).
21
 
22
+ **Benefits for End-Users**
23
 
24
+ * Save paper and ink when you print
25
+ * Change the text and image size
26
+ * Edit the page by clicking to remove text or images before print or PDF. (Optional feature publishers can choose.)
27
+ * PDF with clickable links
28
+ * Custom paper sizes (A4 or Letter) for PDF
29
 
30
+ **Customization**
 
 
 
 
 
31
 
32
+ * Print, PDF, Email, options can be on or off.
33
+ * Custom headers and footers for the print and PDF.
34
+ * Button styles to choose, or use your own text and image/button.
35
+ * [Include a copyright](https://support.printfriendly.com/button/developer-questions/include-copyright/) on print and PDF.
36
+ * [Use your own CSS](https://support.printfriendly.com/button/wordpress/create-custom-css-file/) for complete creative control or the print or PDF page.
37
+ * Use the JavaScript or non-JavaScript option.
38
 
 
 
 
39
 
 
40
 
 
41
 
42
+ = Free - Ad Supported =
43
+
44
+ > This highly polished, professional plugin is free to use and fully functional. We maintain, improve, and offer support to all users. <br>
45
+ > You get all this for free, and in return tasteful ads are displayed in a non-interfering way. <br>
46
+ > Ads are only shown in the print/pdf/email confirmation window. No other ads are displayed or embedded in the content, or snuck in anywhere else. <br>
47
+ > For example, [click here to see image](http://www.printfriendly.com/images/pf-free-ad-supported.gif)
48
+
49
+
50
+ = Purchase an Ad-Free Subscription =
51
+
52
+ > Get a quality product for reasonable price. Remove the ads by purchasing an ad-free subscription. It’s cheap, easy, and straightforward. <br>
53
+ > Purchase now at [PrintFriendly.com/pro](https://www.printfriendly.com/button/pro)
54
+
55
+ **Localized in 30 Languages**
56
+
57
+ PrintFriendly & PDF speaks your language! It detects (based on browser setting) the end-users language and automatically changes language. For example, if your browser is set to Spanish, then PrintFriendly will use Spanish.
58
+
59
+ A few of our supported languages:
60
 
61
  * Danish
62
  * German
82
  * Chinese Simplified
83
  * Chinese Traditional
84
 
 
 
85
  PrintFriendly and PDF is the #1 print optimization technology, **as featured in [Lifehacker](http://lifehacker.com/5272212/print-friendly-optimizes-web-pages-for-printing "PrintFriendly & PDF in Lifehacker"), [Mashable](http://mashable.com/2009/05/18/print-friendly/ "PrintFriendly & PDF in Mashable") & [makeuseof](http://www.makeuseof.com/dir/printfriendly-save-on-paper-and-ink/#comment-95052)**.
86
 
87
  **Give PrintFriendly & PDF a test drive at [PrintFriendly.com](http://www.printfriendly.com "PrintFriendly & PDF")**
88
 
89
 
90
+ = Print, PDF, Email Privacy & Data =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
+ PDFs are generated on our server; **this plugin “phones home”**. Also if the end-user shares the page via email, the email is sent by our server.
93
 
94
+ Our Fundamental Principles:
 
 
95
 
96
  * **We do not sell data.** Period.
97
  * **We do not share data,** unless compelled by the law.
104
 
105
  If you’re using the non-JavaScript option in the plugin, then the preview is generated on our server and temporarily stored in cache for a few minutes. After that time it is permanently deleted.
106
 
107
+ **Email Address & Content get permanently deleted** In order to send the email, we need to store the email address and message on our server. After the email has been sent and found not to be a spammer, the email address is permanently deleted.
108
 
109
  **Server log files get created and deleted.** Browsers and Servers pass non-personally-identifying information, such as the browser type, language, referrer, and the date/time. We may use this data to analyze how the service is being used. Non-personally-identifying aggregate data may get published, e.g., by a report on trends in the usage of the service.
110
 
116
  4. Select "Settings" to customize button style and placement.
117
 
118
  == Frequently Asked Questions ==
119
+ = Print Friendly & PDF Official Support=
120
+ [How to articles and support](https://support.printfriendly.com) for Print, PDF, and Email button by PrintFriendly
121
 
122
+ = Content Not Showing =
123
+ Use [PrintFriendly & PDF custom class names](https://support.printfriendly.com/button/developer-questions/include-exclude-content/) to include/exclude content.
124
 
125
+ = How to add custom header to Print and PDF =
126
+ Use the option in the Plugin settings. [See how](https://support.printfriendly.com/button/wordpress/custom-header-wp/)
127
 
128
+ = Hide the button on a specific page=
129
+ You can [hide the Print, PDF, and Email button](https://support.printfriendly.com/button/wordpress/hide-button/) using CSS.
130
 
 
 
131
 
 
 
132
 
133
  == Screenshots ==
134
 
135
+ 1. Lightbox design keeps users on your page.
136
+ 2. More sharing tools, Print, PDF, Email. Plus editing tools!
137
+ 3. Fully customizable: Choose your print button, text link, or use your own text or graphic.
138
+ 4. Print Friendly & PDF speaks your language! Localized in over 30 languages.
139
+
140
 
141
  == Changelog ==
142
 
143
+ = 3.7.4 =
144
+ * Added CSS Relative Position and Z-Index to button to avoid content covering the button.
145
+
146
+ = 3.7.3 =
147
+ * Always use https
148
+
149
+ = 3.7.2 =
150
+ * Use schema less URLs for loading icons
151
+
152
+ = 3.7.1 =
153
+ * Use www.printfriendly.com instead of app.printfriendly.com for redirects
154
+
155
+ = 3.7.0 =
156
+ * Remove http/https option, use current schema
157
+
158
+ = 3.6.0 =
159
+ * Allow custom HTML in Custom Button Text
160
+
161
+ = 3.5.4 =
162
+ * WooCommerce 'Content Algorithm' fix
163
+
164
+ = 3.5.3 =
165
+ * Fix security issues
166
+
167
+ = 3.5.2 =
168
+ * Fix code to support PHP 5.2
169
+
170
+ = 3.5.0 =
171
+ * WooCommerce product page improvements. Better support for product images, price, and description.
172
+
173
+ = 3.4.9 =
174
+ * Fix minor security issue
175
+
176
+ = 3.4.8 =
177
+ * Fix button images style
178
+
179
+ = 3.4.7 =
180
+ * Fix button style to remove underline
181
+
182
  = 3.4.6 =
183
  * Always removed PrintFriendly button underline regardless plugin CSS for button styles option
184
 
207
  * Shortcode bug fix
208
  * Urlencoded button href to produce valid html
209
 
210
+ = 3.3.7 =
211
  * Readme.txt update
212
 
213
  = 3.3.6 =
218
 
219
  = 3.3.4 =
220
  * Provided Algorithm Options
221
+
222
  = 3.3.3 =
223
  * Using WP content hook for all Buttons
224
 
225
+ = 3.3.2=
226
  * Algorithm Update
227
 
228
+ = 3.3.1 =
229
+ * SSL Support bug fixes.
230
 
231
  = 3.3.0 =
232
 
234
  * Better syncing between client-side/server-side content detection algorithm. This will make improvements to content detection easier than ever.
235
  * Support for international language sub-regions, for example PT-BR vs. PT (Portuguese-Brazil vs. Portuguese for Portugal)
236
  * Support for Wordpress - 3.6 .
237
+ * Printfriendly custom commands support.
238
 
239
  = 3.2.10 =
240
  * Fixed Bug in Google Analytics generation
242
  = 3.2.9 =
243
  * Enabled support for Google Analytics
244
 
245
+ = 3.2.8 =
246
  * Algorithm Update
247
 
248
+ = 3.2.7 =
249
+ * Removed Break tag from button code.
250
 
251
+ = 3.2.6 =
252
  * Fixed Button behavior when displayed on Homepage for NON-JS version.
253
  * Fixed CSS issue with Button when placed above content.
254
  * Fixed box-shadow issue with button.
393
 
394
  * 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.
395
  * Custom image support for hosted solutions
 
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file