Print, PDF, Email by PrintFriendly - Version 3.4.0

Version Description

  • Fixed the admin javascript error and increased plugin text boxes size
  • Enabled Print Friendly button href to www.printfriendly.com only when the plugin JavaScript option is enabled
  • Made some plugin text translation ready
Download this release

Release Info

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

Code changes from version 3.3.10 to 3.4.0

Files changed (4) hide show
  1. admin.css +12 -1
  2. admin.js +23 -18
  3. pf.php +20 -15
  4. readme.txt +7 -3
admin.css CHANGED
@@ -353,4 +353,15 @@ span.description.pf-help-link {
353
  padding-left: 10px;
354
  font-style: normal;
355
  }
356
- .no-italics { font-style:normal !important }
 
 
 
 
 
 
 
 
 
 
 
353
  padding-left: 10px;
354
  font-style: normal;
355
  }
356
+
357
+ .no-italics {
358
+ font-style:normal !important
359
+ }
360
+
361
+ #custom-txt #txt-enter {
362
+ margin: 0 0 2em 0;
363
+ }
364
+
365
+ #margin input[type="number"]{
366
+ width: 65px;
367
+ }
admin.js CHANGED
@@ -205,27 +205,32 @@ jQuery(document).ready(function() {
205
  jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
206
 
207
  // categories checkboxes
208
- var category_ids = jQuery('#category_ids').val().split(',');
209
- if(category_ids[0] == 'all') {
210
- var ids = [];
211
- jQuery('#categorydiv :checkbox').each(function() {
212
- jQuery(this).attr('checked', 'checked');
213
- });
214
- jQuery('#category-all :checkbox').each(function() {
215
- ids.push(jQuery(this).val());
216
- });
217
- // for older wp versions we do not have per category settings so
218
- // ids array will be empty and in that case we shouldn't replace 'all'
219
- if(ids.length != 0) {
220
- jQuery('#category_ids').val(ids.join(','));
221
- }
222
- } else {
223
 
224
- jQuery('#categorydiv :checkbox').each(function() {
225
- if(jQuery.inArray(jQuery(this).val(), category_ids) != -1) {
 
226
  jQuery(this).attr('checked', 'checked');
 
 
 
 
 
 
 
 
227
  }
228
- });
 
 
 
 
 
 
 
229
  }
230
 
231
  jQuery('#categorydiv :checkbox').click(function() {
205
  jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
206
 
207
  // categories checkboxes
208
+ var category_ids = jQuery('#category_ids').val();
209
+
210
+ if( typeof category_ids !== 'undefined' ) {
211
+ category_ids = category_ids.split(',');
 
 
 
 
 
 
 
 
 
 
 
212
 
213
+ if(category_ids[0] == 'all') {
214
+ var ids = [];
215
+ jQuery('#categorydiv :checkbox').each(function() {
216
  jQuery(this).attr('checked', 'checked');
217
+ });
218
+ jQuery('#category-all :checkbox').each(function() {
219
+ ids.push(jQuery(this).val());
220
+ });
221
+ // for older wp versions we do not have per category settings so
222
+ // ids array will be empty and in that case we shouldn't replace 'all'
223
+ if(ids.length != 0) {
224
+ jQuery('#category_ids').val(ids.join(','));
225
  }
226
+ } else {
227
+
228
+ jQuery('#categorydiv :checkbox').each(function() {
229
+ if(jQuery.inArray(jQuery(this).val(), category_ids) != -1) {
230
+ jQuery(this).attr('checked', 'checked');
231
+ }
232
+ });
233
+ }
234
  }
235
 
236
  jQuery('#categorydiv :checkbox').click(function() {
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.10
9
  Author: Print Friendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
 
13
  3.3.10 - Implemented both Classic Google Analytics and Google Universal Analytics code.
14
  3.3.9 - Removed the functionality that opens new window when JavaScript is disabled.
15
  3.3.8 - Shortcode Bug fix, urlencode button href
@@ -386,8 +387,12 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
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()) {
@@ -1104,7 +1109,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1104
  //require_once('includes/nav-menu.php');
1105
  wp_enqueue_script('post');
1106
 
1107
- add_meta_box('categorydiv', __('Only display when post is in:'), 'post_categories_meta_box', 'settings_page_'. $this->hook, 'normal', 'core');
1108
  }
1109
  }
1110
 
@@ -1122,8 +1127,8 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1122
 
1123
  // Show the content of the options array when debug is enabled
1124
  if ( WP_DEBUG ) {
1125
- echo "<p>Currently in Debug Mode. Following information is visible in debug mode only:</p>";
1126
- echo '<pre>Options:<br><br>' . print_r( $this->options, 1 ) . '</pre>';
1127
  }
1128
  ?>
1129
  <div id="pf_settings" class="wrap">
@@ -1169,9 +1174,9 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1169
  <div id="custom-txt" >
1170
  <div id="txt-enter">
1171
  <?php _e( "Text", $this->hook ); ?><br>
1172
- <input type="text" size="10" name="<?php echo $this->option_name; ?>[custom_text]" id="custom_text" value="<?php $this->val( 'custom_text' ); ?>">
1173
  </div>
1174
- <div id="txt-color">
1175
  <?php _e( "Text Color", $this->hook ); ?>
1176
  <input type="hidden" name="<?php echo $this->option_name; ?>[text_color]" id="text_color" value="<?php $this->val( 'text_color' ); ?>"/><br>
1177
  <div id="colorSelector">
@@ -1330,7 +1335,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1330
  <!--Section 5 WebMaster-->
1331
  <h3><?php _e( "Webmaster Settings", $this->hook ); ?></h3>
1332
 
1333
- <label for="protocol"<?php /* for="website_protocol"*/ ?>>Website Protocol<br>
1334
  <select id="website_protocol" name="<?php echo $this->option_name; ?>[website_protocol]" >
1335
  <option value="http" <?php selected( $this->options['website_protocol'], 'http' ); ?>><?php _e( "http (common)", $this->hook ); ?></option>
1336
  <option value="https" <?php selected( $this->options['website_protocol'], 'https' ); ?>><?php _e( "https (secure)", $this->hook ); ?></option>
@@ -1338,13 +1343,13 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1338
  <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>.
1339
  </span>
1340
  </label>
1341
- <label for="password-site"<?php /*for="password_protected"*/ ?>>Password Protected Content
1342
  <select id="password_protected" name="<?php echo $this->option_name; ?>[password_protected]">
1343
  <option value="no" <?php selected( $this->options['password_protected'], 'no' ); ?>><?php _e( "No", $this->hook ); ?></option>
1344
  <option value="yes" <?php selected( $this->options['password_protected'], 'yes' ); ?>><?php _e( "Yes", $this->hook ); ?></option>
1345
  </select>
1346
  </label>
1347
- <label id="pf-javascript-container" <?php /*for="javascript"*/ ?>>Use JavaScript<br>
1348
  <select id="javascript" name="<?php echo $this->option_name; ?>[javascript]>">
1349
  <option value="yes" <?php $this->selected( 'javascript', 'yes' ); ?>> <?php _e( "Yes", $this->hook ); ?></option>
1350
  <option value="no" <?php $this->selected( 'javascript', 'no' ); ?>> <?php _e( "No", $this->hook ); ?></option>
@@ -1356,14 +1361,14 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1356
  <?php _e( "Preview opens a new browser tab.", $this->hook ); ?>
1357
  </span>
1358
  </label>
1359
- <label id="pf-analytics-tracking" <?php /*for="javascript"*/ ?>>Track in Google Analytics<br>
1360
  <select id="pf-analytics-tracking" name="<?php echo $this->option_name; ?>[enable_google_analytics]">
1361
  <option value="yes" <?php $this->selected( 'enable_google_analytics', 'yes' ); ?>> <?php _e( "Yes", $this->hook ); ?></option>
1362
  <option value="no" <?php $this->selected( 'enable_google_analytics', 'no' ); ?>> <?php _e( "No", $this->hook ); ?></option>
1363
  </select>
1364
  </label>
1365
 
1366
- <label id="pf-algo-usage" <?php /*for="javascript"*/ ?>>My Page Content Selected By: <span class="description no-italics" > Change this setting if your content is not showing in the preview.</span><br>
1367
  <select id="pf-algo-usage" name="<?php echo $this->option_name; ?>[pf_algo]">
1368
  <option value="wp" <?php $this->selected( 'pf_algo', 'wp' ); ?>> <?php _e( 'WP "the_content" filter
1369
  ', $this->hook ); ?></option>
@@ -1376,7 +1381,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1376
  <input type="reset" class="button-secondary" value="<?php esc_attr_e( "Cancel", $this->hook ); ?>"/>
1377
  </p>
1378
  <div id="after-submit">
1379
- <p>Need professional options for your corporate, education, or agency developed website? Check out <a href="http://www.printfriendly.com/pro">PrintFriendly Pro</a>.</p>
1380
  <p>
1381
  <?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>
1382
  </div>
@@ -1401,4 +1406,4 @@ add_shortcode( 'printfriendly', 'pf_show_link' );
1401
  function pf_show_link() {
1402
  global $printfriendly;
1403
  return $printfriendly->getButton(true);
1404
- }
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.0
9
  Author: Print Friendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
13
+ 3.4.0 - Fixed the admin javascript error and increased plugin text boxes size
14
  3.3.10 - Implemented both Classic Google Analytics and Google Universal Analytics code.
15
  3.3.9 - Removed the functionality that opens new window when JavaScript is disabled.
16
  3.3.8 - Shortcode Bug fix, urlencode button href
387
  } else if ( $js_enabled ) {
388
  $onclick = 'onclick="window.print(); return false;"';
389
  }
390
+
391
+ if( $js_enabled ){
392
+ $href = '#';
393
+ } else {
394
+ $href = 'http://www.printfriendly.com/print?url='.urlencode(get_permalink());
395
+ }
396
 
397
  if (!$js_enabled) {
398
  if($this->google_analytics_enabled()) {
1109
  //require_once('includes/nav-menu.php');
1110
  wp_enqueue_script('post');
1111
 
1112
+ add_meta_box('categorydiv', __('Only display when post is in:', $this->hook), 'post_categories_meta_box', 'settings_page_'. $this->hook, 'normal', 'core');
1113
  }
1114
  }
1115
 
1127
 
1128
  // Show the content of the options array when debug is enabled
1129
  if ( WP_DEBUG ) {
1130
+ echo "<p>" . __( 'Currently in Debug Mode. Following information is visible in debug mode only:', $this->hook ) . "</p>";
1131
+ echo '<pre>' . __( 'Options:', $this->hook ) . '<br><br>' . print_r( $this->options, 1 ) . '</pre>';
1132
  }
1133
  ?>
1134
  <div id="pf_settings" class="wrap">
1174
  <div id="custom-txt" >
1175
  <div id="txt-enter">
1176
  <?php _e( "Text", $this->hook ); ?><br>
1177
+ <input type="text" size="30" class="clear regular-text" name="<?php echo $this->option_name; ?>[custom_text]" id="custom_text" value="<?php $this->val( 'custom_text' ); ?>">
1178
  </div>
1179
+ <div id="txt-color" class="clear">
1180
  <?php _e( "Text Color", $this->hook ); ?>
1181
  <input type="hidden" name="<?php echo $this->option_name; ?>[text_color]" id="text_color" value="<?php $this->val( 'text_color' ); ?>"/><br>
1182
  <div id="colorSelector">
1335
  <!--Section 5 WebMaster-->
1336
  <h3><?php _e( "Webmaster Settings", $this->hook ); ?></h3>
1337
 
1338
+ <label for="website_protocol"><?php _e( 'Website Protocol', $this->hook ); ?><br>
1339
  <select id="website_protocol" name="<?php echo $this->option_name; ?>[website_protocol]" >
1340
  <option value="http" <?php selected( $this->options['website_protocol'], 'http' ); ?>><?php _e( "http (common)", $this->hook ); ?></option>
1341
  <option value="https" <?php selected( $this->options['website_protocol'], 'https' ); ?>><?php _e( "https (secure)", $this->hook ); ?></option>
1343
  <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>.
1344
  </span>
1345
  </label>
1346
+ <label for="password_protected"><?php _e( 'Password Protected Content', $this->hook ); ?>
1347
  <select id="password_protected" name="<?php echo $this->option_name; ?>[password_protected]">
1348
  <option value="no" <?php selected( $this->options['password_protected'], 'no' ); ?>><?php _e( "No", $this->hook ); ?></option>
1349
  <option value="yes" <?php selected( $this->options['password_protected'], 'yes' ); ?>><?php _e( "Yes", $this->hook ); ?></option>
1350
  </select>
1351
  </label>
1352
+ <label for="javascript"><?php _e( 'Use JavaScript', $this->hook ); ?><br>
1353
  <select id="javascript" name="<?php echo $this->option_name; ?>[javascript]>">
1354
  <option value="yes" <?php $this->selected( 'javascript', 'yes' ); ?>> <?php _e( "Yes", $this->hook ); ?></option>
1355
  <option value="no" <?php $this->selected( 'javascript', 'no' ); ?>> <?php _e( "No", $this->hook ); ?></option>
1361
  <?php _e( "Preview opens a new browser tab.", $this->hook ); ?>
1362
  </span>
1363
  </label>
1364
+ <label for="pf-analytics-tracking"><?php _e( 'Track in Google Analytics', $this->hook ); ?><br>
1365
  <select id="pf-analytics-tracking" name="<?php echo $this->option_name; ?>[enable_google_analytics]">
1366
  <option value="yes" <?php $this->selected( 'enable_google_analytics', 'yes' ); ?>> <?php _e( "Yes", $this->hook ); ?></option>
1367
  <option value="no" <?php $this->selected( 'enable_google_analytics', 'no' ); ?>> <?php _e( "No", $this->hook ); ?></option>
1368
  </select>
1369
  </label>
1370
 
1371
+ <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>
1372
  <select id="pf-algo-usage" name="<?php echo $this->option_name; ?>[pf_algo]">
1373
  <option value="wp" <?php $this->selected( 'pf_algo', 'wp' ); ?>> <?php _e( 'WP "the_content" filter
1374
  ', $this->hook ); ?></option>
1381
  <input type="reset" class="button-secondary" value="<?php esc_attr_e( "Cancel", $this->hook ); ?>"/>
1382
  </p>
1383
  <div id="after-submit">
1384
+ <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>
1385
  <p>
1386
  <?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>
1387
  </div>
1406
  function pf_show_link() {
1407
  global $printfriendly;
1408
  return $printfriendly->getButton(true);
1409
+ }
readme.txt CHANGED
@@ -2,8 +2,8 @@
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.1.2
6
- Stable tag: 3.3.10
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,11 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
140
 
141
  == Changelog ==
142
 
 
 
 
 
 
143
  = 3.3.10 =
144
  * Implemented both Classic Google Analytics and Google Universal Analytics code
145
  * Fixed WP Slimstat conflict
@@ -338,4 +343,3 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
338
  * 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.
339
  * Custom image support for hosted solutions
340
 
341
-
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.2.2
6
+ Stable tag: 3.4.0
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.4.0 =
144
+ * Fixed the admin javascript error and increased plugin text boxes size
145
+ * Enabled Print Friendly button href to www.printfriendly.com only when the plugin JavaScript option is enabled
146
+ * Made some plugin text translation ready
147
+
148
  = 3.3.10 =
149
  * Implemented both Classic Google Analytics and Google Universal Analytics code
150
  * Fixed WP Slimstat conflict
343
  * 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.
344
  * Custom image support for hosted solutions
345