Booster for WooCommerce - Version 3.5.2

Version Description

  • 09/04/2018 =
  • Dev - PDF INVOICING & PACKING SLIPS - Bulk Actions - Merge (Print) - Error messages output added.
  • Dev - PDF INVOICING & PACKING SLIPS - Bulk Actions - Merge (Print) - Namespaces parse error in PHP < 5.3.0 fixed.
Download this release

Release Info

Developer algoritmika
Plugin Icon 128x128 Booster for WooCommerce
Version 3.5.2
Comparing to
See all releases

Code changes from version 3.5.1 to 3.5.2

includes/class-wcj-pdf-invoicing.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - PDF Invoicing
4
  *
5
- * @version 3.5.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -116,7 +116,7 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
116
  /**
117
  * bulk_actions_pdfs_notices.
118
  *
119
- * @version 3.1.0
120
  * @since 2.5.7
121
  */
122
  function bulk_actions_pdfs_notices() {
@@ -139,6 +139,21 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
139
  __( 'Booster: ZipArchive error.', 'woocommerce-jetpack' ) .
140
  '</p></div>';
141
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  }
143
  }
144
  }
@@ -238,14 +253,16 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
238
  /**
239
  * merge_pdfs.
240
  *
241
- * @version 3.5.0
242
  * @since 3.5.0
243
  * @see https://www.setasign.com/products/fpdi/demos/concatenate-fake/
244
- * @todo add errors notices
245
  * @todo rethink filename (i.e. 'docs.pdf')
246
  * @todo (maybe) always save/download instead of display on output
247
  */
248
  function merge_pdfs( $invoice_type_id, $post_ids ) {
 
 
 
249
  $files = array();
250
  foreach( $post_ids as $post_id ) {
251
  $the_invoice = wcj_get_pdf_invoice( $post_id, $invoice_type_id );
@@ -255,7 +272,7 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
255
  return 'merge_pdfs_no_files';
256
  }
257
  require_once( wcj_plugin_path() . '/includes/lib/FPDI/src/autoload.php' );
258
- $fpdi_pdf = new \setasign\Fpdi\TcpdfFpdi();
259
  $fpdi_pdf->SetTitle( 'docs.pdf' );
260
  $fpdi_pdf->setPrintHeader( false );
261
  $fpdi_pdf->setPrintFooter( false );
2
  /**
3
  * Booster for WooCommerce - Module - PDF Invoicing
4
  *
5
+ * @version 3.5.2
6
  * @author Algoritmika Ltd.
7
  */
8
 
116
  /**
117
  * bulk_actions_pdfs_notices.
118
  *
119
+ * @version 3.5.2
120
  * @since 2.5.7
121
  */
122
  function bulk_actions_pdfs_notices() {
139
  __( 'Booster: ZipArchive error.', 'woocommerce-jetpack' ) .
140
  '</p></div>';
141
  break;
142
+ case 'merge_pdfs_no_files':
143
+ echo '<div class="notice notice-error"><p>' .
144
+ __( 'Booster: Merge PDFs: No files.', 'woocommerce-jetpack' ) .
145
+ '</p></div>';
146
+ break;
147
+ case 'merge_pdfs_php_version':
148
+ echo '<div class="notice notice-error"><p>' .
149
+ sprintf( __( 'Booster: Merge PDFs: Command requires PHP version 5.3.0 at least. You have PHP version %s installed.', 'woocommerce-jetpack' ), PHP_VERSION ) .
150
+ '</p></div>';
151
+ break;
152
+ default:
153
+ echo '<div class="notice notice-error"><p>' .
154
+ sprintf( __( 'Booster: %s.', 'woocommerce-jetpack' ), '<code>' . $_GET['wcj_notice'] . '</code>' ) .
155
+ '</p></div>';
156
+ break;
157
  }
158
  }
159
  }
253
  /**
254
  * merge_pdfs.
255
  *
256
+ * @version 3.5.2
257
  * @since 3.5.0
258
  * @see https://www.setasign.com/products/fpdi/demos/concatenate-fake/
 
259
  * @todo rethink filename (i.e. 'docs.pdf')
260
  * @todo (maybe) always save/download instead of display on output
261
  */
262
  function merge_pdfs( $invoice_type_id, $post_ids ) {
263
+ if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) {
264
+ return 'merge_pdfs_php_version';
265
+ }
266
  $files = array();
267
  foreach( $post_ids as $post_id ) {
268
  $the_invoice = wcj_get_pdf_invoice( $post_id, $invoice_type_id );
272
  return 'merge_pdfs_no_files';
273
  }
274
  require_once( wcj_plugin_path() . '/includes/lib/FPDI/src/autoload.php' );
275
+ $fpdi_pdf = require_once( wcj_plugin_path() . '/includes/pdf-invoices/tcpdffpdi.php' );
276
  $fpdi_pdf->SetTitle( 'docs.pdf' );
277
  $fpdi_pdf->setPrintHeader( false );
278
  $fpdi_pdf->setPrintFooter( false );
includes/pdf-invoices/tcpdffpdi.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Booster for WooCommerce - PDF Invoicing - TcpdfFpdi
4
+ *
5
+ * This is needed to get round namespaces parse error in PHP < 5.3.0.
6
+ *
7
+ * @version 3.5.2
8
+ * @since 3.5.2
9
+ * @author Algoritmika Ltd.
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ return new \setasign\Fpdi\TcpdfFpdi();
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: algoritmika, anbinder
3
  Tags: woocommerce, booster for woocommerce, woocommerce jetpack
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
- Stable tag: 3.5.1
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -182,6 +182,10 @@ You can see the differences between versions in this [table](https://booster.io/
182
 
183
  == Changelog ==
184
 
 
 
 
 
185
  = 3.5.1 - 09/04/2018 =
186
  * Dev - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Advanced: Price Filters Priority - Added to all hooks.
187
  * Dev - PRICES & CURRENCIES - Prices and Currencies by Country - "Advanced: Price Filters Priority" option added.
3
  Tags: woocommerce, booster for woocommerce, woocommerce jetpack
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
+ Stable tag: 3.5.2
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
182
 
183
  == Changelog ==
184
 
185
+ = 3.5.2 - 09/04/2018 =
186
+ * Dev - PDF INVOICING & PACKING SLIPS - Bulk Actions - Merge (Print) - Error messages output added.
187
+ * Dev - PDF INVOICING & PACKING SLIPS - Bulk Actions - Merge (Print) - Namespaces parse error in PHP < 5.3.0 fixed.
188
+
189
  = 3.5.1 - 09/04/2018 =
190
  * Dev - PRICES & CURRENCIES - Multicurrency (Currency Switcher) - Advanced: Price Filters Priority - Added to all hooks.
191
  * Dev - PRICES & CURRENCIES - Prices and Currencies by Country - "Advanced: Price Filters Priority" option added.
woocommerce-jetpack.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: https://booster.io
5
  Description: Supercharge your WooCommerce site with these awesome powerful features.
6
- Version: 3.5.1
7
  Author: Algoritmika Ltd
8
  Author URI: https://booster.io
9
  Text Domain: woocommerce-jetpack
@@ -57,7 +57,7 @@ final class WC_Jetpack {
57
  * @var string
58
  * @since 2.4.7
59
  */
60
- public $version = '3.5.1';
61
 
62
  /**
63
  * @var WC_Jetpack The single instance of the class
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: https://booster.io
5
  Description: Supercharge your WooCommerce site with these awesome powerful features.
6
+ Version: 3.5.2
7
  Author: Algoritmika Ltd
8
  Author URI: https://booster.io
9
  Text Domain: woocommerce-jetpack
57
  * @var string
58
  * @since 2.4.7
59
  */
60
+ public $version = '3.5.2';
61
 
62
  /**
63
  * @var WC_Jetpack The single instance of the class