Booster for WooCommerce - Version 3.4.3

Version Description

  • 14/02/2018 =
  • Dev - PDF INVOICING & PACKING SLIPS - Checking header image and background image to exist (before adding to PDF).
  • Dev - PDF INVOICING & PACKING SLIPS - Header - Header Image - Admin description expanded.
  • Dev - PDF INVOICING & PACKING SLIPS - Page Settings - Background Image - Admin description (with image path) added; admin description expanded.
  • Dev - PDF INVOICING & PACKING SLIPS - Advanced - Default Images Directory - Default value set to DOCUMENT_ROOT.
  • Dev - EMAILS & MISC. - Admin Tools - System Info - $_SERVER info added (works with wcj_debug param).
Download this release

Release Info

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

Code changes from version 3.4.2 to 3.4.3

includes/class-wcj-admin-tools.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Admin Tools
4
  *
5
- * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -199,7 +199,7 @@ class WCJ_Admin_Tools extends WCJ_Module {
199
  /**
200
  * get_system_info_table_array.
201
  *
202
- * @version 3.4.0
203
  * @since 2.5.7
204
  * @todo (maybe) 'DB_NAME', 'DB_USER', 'DB_PASSWORD', 'DB_HOST', 'DB_CHARSET', 'DB_COLLATE'
205
  */
@@ -218,6 +218,11 @@ class WCJ_Admin_Tools extends WCJ_Module {
218
  foreach ( $constants_array as $the_constant ) {
219
  $system_info[] = array( $the_constant, ( defined( $the_constant ) ? constant( $the_constant ) : __( 'NOT DEFINED', 'woocommerce-jetpack' ) ) );
220
  }
 
 
 
 
 
221
  return $system_info;
222
  }
223
 
2
  /**
3
  * Booster for WooCommerce - Module - Admin Tools
4
  *
5
+ * @version 3.4.3
6
  * @author Algoritmika Ltd.
7
  */
8
 
199
  /**
200
  * get_system_info_table_array.
201
  *
202
+ * @version 3.4.3
203
  * @since 2.5.7
204
  * @todo (maybe) 'DB_NAME', 'DB_USER', 'DB_PASSWORD', 'DB_HOST', 'DB_CHARSET', 'DB_COLLATE'
205
  */
218
  foreach ( $constants_array as $the_constant ) {
219
  $system_info[] = array( $the_constant, ( defined( $the_constant ) ? constant( $the_constant ) : __( 'NOT DEFINED', 'woocommerce-jetpack' ) ) );
220
  }
221
+ if ( isset( $_GET['wcj_debug'] ) ) {
222
+ foreach ( $_SERVER as $server_var_id => $server_var_value ) {
223
+ $system_info[] = array( $server_var_id, $server_var_value );
224
+ }
225
+ }
226
  return $system_info;
227
  }
228
 
includes/classes/class-wcj-pdf-invoice.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce PDF Invoice
4
  *
5
- * @version 3.2.4
6
  * @author Algoritmika Ltd.
7
  * @todo clean up
8
  */
@@ -23,7 +23,7 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
23
  /**
24
  * prepare_pdf.
25
  *
26
- * @version 3.2.4
27
  * @todo check `addTTFfont()`
28
  */
29
  function prepare_pdf() {
@@ -75,6 +75,10 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
75
  if ( '' != ( $header_image = do_shortcode( get_option( 'wcj_invoicing_' . $invoice_type . '_header_image', '' ) ) ) ) {
76
  $the_logo = parse_url( $header_image, PHP_URL_PATH );
77
  $the_logo_width_mm = get_option( 'wcj_invoicing_' . $invoice_type . '_header_image_width_mm', 50 );
 
 
 
 
78
  }
79
  $pdf->SetHeaderData(
80
  $the_logo,
@@ -144,7 +148,9 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
144
  // Background image
145
  if ( '' != ( $background_image = do_shortcode( get_option( 'wcj_invoicing_' . $invoice_type . '_background_image', '' ) ) ) ) {
146
  $background_image = parse_url( $background_image, PHP_URL_PATH );
147
- $pdf->Image( $background_image, 0, 0, $pdf->getPageWidth(), $pdf->getPageHeight() );
 
 
148
  }
149
 
150
  return $pdf;
2
  /**
3
  * Booster for WooCommerce PDF Invoice
4
  *
5
+ * @version 3.4.3
6
  * @author Algoritmika Ltd.
7
  * @todo clean up
8
  */
23
  /**
24
  * prepare_pdf.
25
  *
26
+ * @version 3.4.3
27
  * @todo check `addTTFfont()`
28
  */
29
  function prepare_pdf() {
75
  if ( '' != ( $header_image = do_shortcode( get_option( 'wcj_invoicing_' . $invoice_type . '_header_image', '' ) ) ) ) {
76
  $the_logo = parse_url( $header_image, PHP_URL_PATH );
77
  $the_logo_width_mm = get_option( 'wcj_invoicing_' . $invoice_type . '_header_image_width_mm', 50 );
78
+ if ( ! file_exists( K_PATH_IMAGES . $the_logo ) ) {
79
+ $the_logo = '';
80
+ $the_logo_width_mm = 0;
81
+ }
82
  }
83
  $pdf->SetHeaderData(
84
  $the_logo,
148
  // Background image
149
  if ( '' != ( $background_image = do_shortcode( get_option( 'wcj_invoicing_' . $invoice_type . '_background_image', '' ) ) ) ) {
150
  $background_image = parse_url( $background_image, PHP_URL_PATH );
151
+ if ( file_exists( K_PATH_IMAGES . $background_image ) ) {
152
+ $pdf->Image( $background_image, 0, 0, $pdf->getPageWidth(), $pdf->getPageHeight() );
153
+ }
154
  }
155
 
156
  return $pdf;
includes/functions/wcj-functions-invoicing.php CHANGED
@@ -2,19 +2,40 @@
2
  /**
3
  * Booster for WooCommerce - Functions - Invoicing
4
  *
5
- * @version 3.4.2
6
  * @author Algoritmika Ltd.
7
  */
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  if ( ! function_exists( 'wcj_get_invoicing_default_images_directory' ) ) {
10
  /**
11
  * wcj_get_invoicing_default_images_directory.
12
  *
13
- * @version 3.4.2
14
  * @since 3.4.2
15
  */
16
  function wcj_get_invoicing_default_images_directory() {
17
- switch ( get_option( 'wcj_invoicing_general_header_images_path', 'empty' ) ) {
18
  case 'empty':
19
  return '';
20
  case 'document_root':
2
  /**
3
  * Booster for WooCommerce - Functions - Invoicing
4
  *
5
+ * @version 3.4.3
6
  * @author Algoritmika Ltd.
7
  */
8
 
9
+ if ( ! function_exists( 'wcj_get_invoicing_current_image_path_desc' ) ) {
10
+ /**
11
+ * wcj_get_invoicing_current_image_path_desc.
12
+ *
13
+ * @version 3.4.3
14
+ * @since 3.4.3
15
+ */
16
+ function wcj_get_invoicing_current_image_path_desc( $option_name ) {
17
+ if ( '' != ( $current_image = get_option( $option_name, '' ) ) ) {
18
+ if ( false !== ( $default_images_directory = wcj_get_invoicing_default_images_directory() ) ) {
19
+ $image_path = $default_images_directory . parse_url( $current_image, PHP_URL_PATH );
20
+ $style = ( file_exists( $image_path ) ? ' style="color:green;"' : '' );
21
+ $current_image = '<br>' . sprintf( __( 'Current image path: %s.', 'woocommerce-jetpack' ), '<code' . $style . '>' . $image_path . '</code>' );
22
+ } else {
23
+ $current_image = '';
24
+ }
25
+ }
26
+ return $current_image;
27
+ }
28
+ }
29
+
30
  if ( ! function_exists( 'wcj_get_invoicing_default_images_directory' ) ) {
31
  /**
32
  * wcj_get_invoicing_default_images_directory.
33
  *
34
+ * @version 3.4.3
35
  * @since 3.4.2
36
  */
37
  function wcj_get_invoicing_default_images_directory() {
38
+ switch ( get_option( 'wcj_invoicing_general_header_images_path', 'document_root' ) ) {
39
  case 'empty':
40
  return '';
41
  case 'document_root':
includes/settings/wcj-settings-pdf-invoicing-advanced.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - PDF Invoicing - Advanced
4
  *
5
- * @version 3.3.0
6
  * @since 3.3.0
7
  * @author Algoritmika Ltd.
8
  * @todo (maybe) create "Tools (Options)" submodule
@@ -59,10 +59,10 @@ return array(
59
  ),
60
  array(
61
  'title' => __( 'Advanced', 'woocommerce-jetpack' ) . ': ' . __( 'Default Images Directory', 'woocommerce-jetpack' ),
62
- 'desc' => __( 'Default images directory in TCPDF library (K_PATH_IMAGES).', 'woocommerce-jetpack' ),
63
  'desc_tip' => __( 'Try changing this if you have issues displaying images in page background or header.', 'woocommerce-jetpack' ),
64
  'id' => 'wcj_invoicing_general_header_images_path', // mislabelled, should be `wcj_invoicing_general_images_path`
65
- 'default' => 'empty',
66
  'type' => 'select',
67
  'options' => array(
68
  'empty' => __( 'Empty', 'woocommerce-jetpack' ),
2
  /**
3
  * Booster for WooCommerce - Settings - PDF Invoicing - Advanced
4
  *
5
+ * @version 3.4.3
6
  * @since 3.3.0
7
  * @author Algoritmika Ltd.
8
  * @todo (maybe) create "Tools (Options)" submodule
59
  ),
60
  array(
61
  'title' => __( 'Advanced', 'woocommerce-jetpack' ) . ': ' . __( 'Default Images Directory', 'woocommerce-jetpack' ),
62
+ 'desc' => '<br>' . __( 'Default images directory in TCPDF library (K_PATH_IMAGES).', 'woocommerce-jetpack' ),
63
  'desc_tip' => __( 'Try changing this if you have issues displaying images in page background or header.', 'woocommerce-jetpack' ),
64
  'id' => 'wcj_invoicing_general_header_images_path', // mislabelled, should be `wcj_invoicing_general_images_path`
65
+ 'default' => 'document_root',
66
  'type' => 'select',
67
  'options' => array(
68
  'empty' => __( 'Empty', 'woocommerce-jetpack' ),
includes/settings/wcj-settings-pdf-invoicing-header.php CHANGED
@@ -5,6 +5,7 @@
5
  * @version 3.4.2
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
 
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -12,15 +13,6 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
12
  $settings = array();
13
  $invoice_types = ( 'yes' === get_option( 'wcj_invoicing_hide_disabled_docs_settings', 'no' ) ) ? wcj_get_enabled_invoice_types() : wcj_get_invoice_types();
14
  foreach ( $invoice_types as $invoice_type ) {
15
- if ( '' != ( $current_header_image = get_option( 'wcj_invoicing_' . $invoice_type['id'] . '_header_image', '' ) ) ) {
16
- if ( false !== ( $default_images_directory = wcj_get_invoicing_default_images_directory() ) ) {
17
- $image_path = $default_images_directory . parse_url( $current_header_image, PHP_URL_PATH );
18
- $style = ( file_exists( $image_path ) ? ' style="color:green;"' : '' );
19
- $current_header_image = '<br>' . sprintf( __( 'Current image path: %s.', 'woocommerce-jetpack' ), '<code' . $style . '>' . $image_path . '</code>' );
20
- } else {
21
- $current_header_image = '';
22
- }
23
- }
24
  $settings = array_merge( $settings, array(
25
  array(
26
  'title' => $invoice_type['title'],
@@ -40,8 +32,13 @@ foreach ( $invoice_types as $invoice_type ) {
40
  'default' => '',
41
  'type' => 'text',
42
  'desc' => sprintf(
43
- __( 'Enter a URL to an image you want to show in the invoice\'s header. Upload your image using the <a href="%s">media uploader</a>.', 'woocommerce-jetpack' ),
44
- admin_url( 'media-new.php' ) ) . $current_header_image,
 
 
 
 
 
45
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
46
  'class' => 'widefat',
47
  ),
5
  * @version 3.4.2
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
+ * @todo (maybe) add info on `<img>` in "Header Image" description
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
  $settings = array();
14
  $invoice_types = ( 'yes' === get_option( 'wcj_invoicing_hide_disabled_docs_settings', 'no' ) ) ? wcj_get_enabled_invoice_types() : wcj_get_invoice_types();
15
  foreach ( $invoice_types as $invoice_type ) {
 
 
 
 
 
 
 
 
 
16
  $settings = array_merge( $settings, array(
17
  array(
18
  'title' => $invoice_type['title'],
32
  'default' => '',
33
  'type' => 'text',
34
  'desc' => sprintf(
35
+ __( 'Enter a local URL to an image you want to show in the invoice\'s header. Upload your image using the <a href="%s">media uploader</a>.', 'woocommerce-jetpack' ),
36
+ admin_url( 'media-new.php' ) ) .
37
+ wcj_get_invoicing_current_image_path_desc( 'wcj_invoicing_' . $invoice_type['id'] . '_header_image' ) . '<br>' .
38
+ sprintf( __( 'If you are experiencing issues with displaying header image, please try setting different values for the "Advanced: Default Images Directory" option in %s.', 'woocommerce-jetpack' ),
39
+ '<a target="_blank" href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=pdf_invoicing&section=pdf_invoicing_advanced' ) . '">' .
40
+ __( 'PDF Invoicing & Packing Slips > Advanced', 'woocommerce-jetpack' ) .
41
+ '</a>' ),
42
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
43
  'class' => 'widefat',
44
  ),
includes/settings/wcj-settings-pdf-invoicing-page.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - PDF Invoicing - Page Settings
4
  *
5
- * @version 3.2.4
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -79,7 +79,12 @@ foreach ( $invoice_types as $invoice_type ) {
79
  'default' => '',
80
  'type' => 'text',
81
  'desc' => sprintf( __( 'Enter a local URL to an image. Upload your image using the <a href="%s">media uploader</a>.', 'woocommerce-jetpack' ),
82
- admin_url( 'media-new.php' ) ),
 
 
 
 
 
83
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
84
  'class' => 'widefat',
85
  ),
2
  /**
3
  * Booster for WooCommerce - Settings - PDF Invoicing - Page Settings
4
  *
5
+ * @version 3.4.3
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
79
  'default' => '',
80
  'type' => 'text',
81
  'desc' => sprintf( __( 'Enter a local URL to an image. Upload your image using the <a href="%s">media uploader</a>.', 'woocommerce-jetpack' ),
82
+ admin_url( 'media-new.php' ) ) .
83
+ wcj_get_invoicing_current_image_path_desc( 'wcj_invoicing_' . $invoice_type['id'] . '_background_image' ) . '<br>' .
84
+ sprintf( __( 'If you are experiencing issues with displaying background image, please try setting different values for the "Advanced: Default Images Directory" option in %s.', 'woocommerce-jetpack' ),
85
+ '<a target="_blank" href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=pdf_invoicing&section=pdf_invoicing_advanced' ) . '">' .
86
+ __( 'PDF Invoicing & Packing Slips > Advanced', 'woocommerce-jetpack' ) .
87
+ '</a>' ),
88
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
89
  'class' => 'widefat',
90
  ),
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.4.2
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -180,6 +180,13 @@ You can see the differences between versions in this [table](https://booster.io/
180
 
181
  == Changelog ==
182
 
 
 
 
 
 
 
 
183
  = 3.4.2 - 13/02/2018 =
184
  * Fix - Forcing session type to `standard` (and "Session Type in Booster" option temporary disabled). Affected modules: Checkout Files Upload, EU VAT Number, Multicurrency (Currency Switcher), Product Visibility by Country, Product Custom Visibility, Tax Display, Prices and Currencies by Country.
185
  * Dev - PDF INVOICING & PACKING SLIPS - Header - Header Image - Admin description (with image path) 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.4.3
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
180
 
181
  == Changelog ==
182
 
183
+ = 3.4.3 - 14/02/2018 =
184
+ * Dev - PDF INVOICING & PACKING SLIPS - Checking header image and background image to exist (before adding to PDF).
185
+ * Dev - PDF INVOICING & PACKING SLIPS - Header - Header Image - Admin description expanded.
186
+ * Dev - PDF INVOICING & PACKING SLIPS - Page Settings - Background Image - Admin description (with image path) added; admin description expanded.
187
+ * Dev - PDF INVOICING & PACKING SLIPS - Advanced - Default Images Directory - Default value set to `DOCUMENT_ROOT`.
188
+ * Dev - EMAILS & MISC. - Admin Tools - System Info - `$_SERVER` info added (works with `wcj_debug` param).
189
+
190
  = 3.4.2 - 13/02/2018 =
191
  * Fix - Forcing session type to `standard` (and "Session Type in Booster" option temporary disabled). Affected modules: Checkout Files Upload, EU VAT Number, Multicurrency (Currency Switcher), Product Visibility by Country, Product Custom Visibility, Tax Display, Prices and Currencies by Country.
192
  * Dev - PDF INVOICING & PACKING SLIPS - Header - Header Image - Admin description (with image path) 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.4.2
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.4.2';
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.4.3
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.4.3';
61
 
62
  /**
63
  * @var WC_Jetpack The single instance of the class