Booster for WooCommerce - Version 3.4.2

Version Description

  • 13/02/2018 =
  • 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.
  • Dev - PDF INVOICING & PACKING SLIPS - Header - Header Image - Admin description (with image path) added.
Download this release

Release Info

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

Code changes from version 3.4.1 to 3.4.2

includes/classes/class-wcj-tcpdf.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce TCPDF
4
  *
5
- * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  * @todo (maybe) `Header()`
8
  */
@@ -17,16 +17,8 @@ if ( wcj_check_tcpdf_fonts_version( true ) ) {
17
  define( 'K_PATH_FONTS', wcj_get_wcj_uploads_dir( 'tcpdf_fonts' ) . '/' );
18
  }
19
  // Default images directory
20
- switch ( get_option( 'wcj_invoicing_general_header_images_path', 'empty' ) ) {
21
- case 'empty':
22
- define ( 'K_PATH_IMAGES', '' );
23
- break;
24
- case 'document_root':
25
- define ( 'K_PATH_IMAGES', $_SERVER['DOCUMENT_ROOT'] );
26
- break;
27
- case 'abspath':
28
- define ( 'K_PATH_IMAGES', ABSPATH );
29
- break;
30
  }
31
 
32
  // Include the main TCPDF library
2
  /**
3
  * Booster for WooCommerce TCPDF
4
  *
5
+ * @version 3.4.2
6
  * @author Algoritmika Ltd.
7
  * @todo (maybe) `Header()`
8
  */
17
  define( 'K_PATH_FONTS', wcj_get_wcj_uploads_dir( 'tcpdf_fonts' ) . '/' );
18
  }
19
  // Default images directory
20
+ if ( false !== ( $default_images_directory = wcj_get_invoicing_default_images_directory() ) ) {
21
+ define ( 'K_PATH_IMAGES', $default_images_directory );
 
 
 
 
 
 
 
 
22
  }
23
 
24
  // Include the main TCPDF library
includes/core/wcj-constants.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce Constants
4
  *
5
- * @version 3.4.0
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -73,10 +73,12 @@ if ( ! defined( 'WCJ_SESSION_TYPE' ) ) {
73
  /**
74
  * Session type.
75
  *
76
- * @version 3.4.0
77
  * @since 3.1.0
 
78
  */
79
- define( 'WCJ_SESSION_TYPE', ( 'yes' === get_option( 'wcj_general_enabled', 'no' ) ? get_option( 'wcj_general_advanced_session_type', 'wc' ) : 'wc' ) );
 
80
  }
81
 
82
  if ( ! defined( 'WCJ_VERSION_OPTION' ) ) {
2
  /**
3
  * Booster for WooCommerce Constants
4
  *
5
+ * @version 3.4.2
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
73
  /**
74
  * Session type.
75
  *
76
+ * @version 3.4.2
77
  * @since 3.1.0
78
+ * @todo ! this is only a temporary "fix"
79
  */
80
+ define( 'WCJ_SESSION_TYPE', 'standard' );
81
+ // define( 'WCJ_SESSION_TYPE', ( 'yes' === get_option( 'wcj_general_enabled', 'no' ) ? get_option( 'wcj_general_advanced_session_type', 'wc' ) : 'wc' ) );
82
  }
83
 
84
  if ( ! defined( 'WCJ_VERSION_OPTION' ) ) {
includes/functions/wcj-functions-invoicing.php CHANGED
@@ -2,10 +2,31 @@
2
  /**
3
  * Booster for WooCommerce - Functions - Invoicing
4
  *
5
- * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  if ( ! function_exists( 'wcj_get_fonts_list' ) ) {
10
  /**
11
  * wcj_get_fonts_list.
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':
21
+ return $_SERVER['DOCUMENT_ROOT'];
22
+ case 'abspath':
23
+ return ABSPATH;
24
+ default: // 'tcpdf_default'
25
+ return false;
26
+ }
27
+ }
28
+ }
29
+
30
  if ( ! function_exists( 'wcj_get_fonts_list' ) ) {
31
  /**
32
  * wcj_get_fonts_list.
includes/settings/wcj-settings-general.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - General
4
  *
5
- * @version 3.4.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  * @todo add link to Booster's shortcodes list
@@ -85,7 +85,7 @@ $settings = array(
85
  'default' => 'no',
86
  'type' => 'checkbox',
87
  ),
88
- array(
89
  'title' => __( 'Session Type in Booster', 'woocommerce-jetpack' ),
90
  'id' => 'wcj_general_advanced_session_type',
91
  'default' => 'wc',
@@ -94,7 +94,7 @@ $settings = array(
94
  'standard' => __( 'Standard PHP sessions', 'woocommerce-jetpack' ),
95
  'wc' => __( 'WC sessions', 'woocommerce-jetpack' ),
96
  ),
97
- ),
98
  array(
99
  'title' => __( 'Disable Loading Datepicker/Weekpicker CSS', 'woocommerce-jetpack' ),
100
  'desc' => __( 'Disable', 'woocommerce-jetpack' ),
2
  /**
3
  * Booster for WooCommerce - Settings - General
4
  *
5
+ * @version 3.4.2
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  * @todo add link to Booster's shortcodes list
85
  'default' => 'no',
86
  'type' => 'checkbox',
87
  ),
88
+ /* array(
89
  'title' => __( 'Session Type in Booster', 'woocommerce-jetpack' ),
90
  'id' => 'wcj_general_advanced_session_type',
91
  'default' => 'wc',
94
  'standard' => __( 'Standard PHP sessions', 'woocommerce-jetpack' ),
95
  'wc' => __( 'WC sessions', 'woocommerce-jetpack' ),
96
  ),
97
+ ), */
98
  array(
99
  'title' => __( 'Disable Loading Datepicker/Weekpicker CSS', 'woocommerce-jetpack' ),
100
  'desc' => __( 'Disable', 'woocommerce-jetpack' ),
includes/settings/wcj-settings-pdf-invoicing-advanced.php CHANGED
@@ -6,6 +6,7 @@
6
  * @since 3.3.0
7
  * @author Algoritmika Ltd.
8
  * @todo (maybe) create "Tools (Options)" submodule
 
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
6
  * @since 3.3.0
7
  * @author Algoritmika Ltd.
8
  * @todo (maybe) create "Tools (Options)" submodule
9
+ * @todo (maybe) remove `tcpdf_default` option in `wcj_invoicing_general_header_images_path`
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
includes/settings/wcj-settings-pdf-invoicing-header.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - PDF Invoicing - Header
4
  *
5
- * @version 3.2.3
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -12,6 +12,15 @@ 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
  $settings = array_merge( $settings, array(
16
  array(
17
  'title' => $invoice_type['title'],
@@ -32,7 +41,7 @@ foreach ( $invoice_types as $invoice_type ) {
32
  'type' => 'text',
33
  'desc' => sprintf(
34
  __( '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' ),
35
- admin_url( 'media-new.php' ) ),
36
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
37
  'class' => 'widefat',
38
  ),
2
  /**
3
  * Booster for WooCommerce - Settings - PDF Invoicing - Header
4
  *
5
+ * @version 3.4.2
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
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'],
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
  ),
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.1
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -180,6 +180,10 @@ You can see the differences between versions in this [table](https://booster.io/
180
 
181
  == Changelog ==
182
 
 
 
 
 
183
  = 3.4.1 - 13/02/2018 =
184
  * Fix - PRODUCTS - SKU - Search by SKU - `pre_get_posts` - `$wpdb->prefix` is used instead of hard-coded `wp_` prefix.
185
  * Dev - SHIPPING & ORDERS - Shipping Descriptions - Description updated.
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
 
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.
186
+
187
  = 3.4.1 - 13/02/2018 =
188
  * Fix - PRODUCTS - SKU - Search by SKU - `pre_get_posts` - `$wpdb->prefix` is used instead of hard-coded `wp_` prefix.
189
  * Dev - SHIPPING & ORDERS - Shipping Descriptions - Description updated.
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.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.4.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.4.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.4.2';
61
 
62
  /**
63
  * @var WC_Jetpack The single instance of the class