WooCommerce PDF Invoices - Version 2.7.3

Version Description

  • April, 18, 2017 =

  • Improved: setup_directories() running on every (admin) request by only running when WPI_UPLOADS_DIR does not exists.

  • Fixed: 'Call to undefined function bewpi_get_id()' by dumping Composer autoloading.

  • Fixed: GLOB_BRACE unsupported on some systems.

Download this release

Release Info

Developer baaaaas
Plugin Icon 128x128 WooCommerce PDF Invoices
Version 2.7.3
Comparing to
See all releases

Code changes from version 2.7.2 to 2.7.3

bootstrap.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce PDF Invoices
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-pdf-invoices
5
  * Description: Automatically generate and attach customizable PDF Invoices to WooCommerce emails and connect with Dropbox, Google Drive, OneDrive or Egnyte.
6
- * Version: 2.7.2
7
  * Author: Bas Elbers
8
  * Author URI: http://wcpdfinvoices.com
9
  * License: GPL-2.0+
@@ -19,9 +19,9 @@ if ( ! defined( 'ABSPATH' ) ) {
19
  /**
20
  * @deprecated instead use WPI_VERSION.
21
  */
22
- define( 'BEWPI_VERSION', '2.7.2' );
23
 
24
- define( 'WPI_VERSION', '2.7.2' );
25
 
26
  /**
27
  * Load WooCommerce PDF Invoices plugin.
3
  * Plugin Name: WooCommerce PDF Invoices
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-pdf-invoices
5
  * Description: Automatically generate and attach customizable PDF Invoices to WooCommerce emails and connect with Dropbox, Google Drive, OneDrive or Egnyte.
6
+ * Version: 2.7.3
7
  * Author: Bas Elbers
8
  * Author URI: http://wcpdfinvoices.com
9
  * License: GPL-2.0+
19
  /**
20
  * @deprecated instead use WPI_VERSION.
21
  */
22
+ define( 'BEWPI_VERSION', '2.7.3' );
23
 
24
+ define( 'WPI_VERSION', '2.7.3' );
25
 
26
  /**
27
  * Load WooCommerce PDF Invoices plugin.
includes/be-woocommerce-pdf-invoices.php CHANGED
@@ -113,7 +113,7 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
113
  /**
114
  * Creates invoices dir in uploads folder.
115
  */
116
- public function setup_directories() {
117
  $current_year = date_i18n( 'Y', current_time( 'timestamp' ) );
118
  $directories = apply_filters( 'bewpi_uploads_directories', array(
119
  WPI_UPLOADS_DIR . '/attachments/' => array(
@@ -149,7 +149,7 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
149
  }
150
 
151
  // Copy fonts from tmp directory to uploads/woocommerce-pdf-invoices/fonts.
152
- $font_files = glob( WPI_DIR . '/tmp/fonts/*.{ttf,otf}', GLOB_BRACE );
153
  foreach ( $font_files as $font_file ) {
154
  $destination_file = WPI_UPLOADS_DIR . '/fonts/' . basename( $font_file );
155
  if ( file_exists( $destination_file ) ) {
@@ -172,9 +172,12 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
172
  add_action( 'init', array( $this, 'frontend_pdf_callback' ) );
173
  }
174
 
 
 
 
 
175
  add_action( 'admin_init', array( $this, 'admin_pdf_callback' ) );
176
  add_action( 'admin_init', array( $this, 'admin_init_hooks' ) );
177
- add_action( 'admin_init', array( $this, 'setup_directories' ) );
178
  add_action( 'admin_enqueue_scripts', array( $this, 'load_admin_scripts' ) );
179
 
180
  // woocommerce.
113
  /**
114
  * Creates invoices dir in uploads folder.
115
  */
116
+ public static function setup_directories() {
117
  $current_year = date_i18n( 'Y', current_time( 'timestamp' ) );
118
  $directories = apply_filters( 'bewpi_uploads_directories', array(
119
  WPI_UPLOADS_DIR . '/attachments/' => array(
149
  }
150
 
151
  // Copy fonts from tmp directory to uploads/woocommerce-pdf-invoices/fonts.
152
+ $font_files = array_merge( glob( WPI_DIR . '/tmp/fonts/*.ttf' ), glob( WPI_DIR . '/tmp/fonts/*.otf' ) );
153
  foreach ( $font_files as $font_file ) {
154
  $destination_file = WPI_UPLOADS_DIR . '/fonts/' . basename( $font_file );
155
  if ( file_exists( $destination_file ) ) {
172
  add_action( 'init', array( $this, 'frontend_pdf_callback' ) );
173
  }
174
 
175
+ if ( ! file_exists( WPI_UPLOADS_DIR ) ) {
176
+ add_action( 'admin_init', array( $this, 'setup_directories' ) );
177
+ }
178
+
179
  add_action( 'admin_init', array( $this, 'admin_pdf_callback' ) );
180
  add_action( 'admin_init', array( $this, 'admin_init_hooks' ) );
 
181
  add_action( 'admin_enqueue_scripts', array( $this, 'load_admin_scripts' ) );
182
 
183
  // woocommerce.
includes/class-bewpi-template.php CHANGED
@@ -85,7 +85,7 @@ class BEWPI_Template {
85
  continue;
86
  }
87
 
88
- $files = glob( $template_path . '/*{.php,.css}', GLOB_BRACE );
89
  foreach ( $files as $full_path ) {
90
  $file = pathinfo( $full_path );
91
  $template[ $file['filename'] ] = $full_path;
85
  continue;
86
  }
87
 
88
+ $files = array_merge( glob( $template_path . '/*.php' ), glob( $template_path . '/*.css' ) );
89
  foreach ( $files as $full_path ) {
90
  $file = pathinfo( $full_path );
91
  $template[ $file['filename'] ] = $full_path;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: woocommerce pdf invoices, invoice, generate, pdf, woocommerce, attachment, email, completed order, customer invoice, processing order, attach, automatic, vat, rate, sequential, number
5
  Requires at least: 4.0
6
  Tested up to: 4.7
7
- Stable tag: 2.7.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -233,7 +233,13 @@ Important: A custom template is required to add a custom field to the PDF invoic
233
 
234
  == Changelog ==
235
 
236
- = 2.7.2 - April, 15, 2017 =
 
 
 
 
 
 
237
 
238
  - Added: Filter 'bewpi_my_account_pdf_name' to change the name of the PDF button on My Account page.
239
  - Fixed: 'Fatal error: Call to a member function get_id() on null' by checking object type in method `add_emailitin_as_recipient()`.
4
  Tags: woocommerce pdf invoices, invoice, generate, pdf, woocommerce, attachment, email, completed order, customer invoice, processing order, attach, automatic, vat, rate, sequential, number
5
  Requires at least: 4.0
6
  Tested up to: 4.7
7
+ Stable tag: 2.7.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
233
 
234
  == Changelog ==
235
 
236
+ = 2.7.3 - April, 18, 2017 =
237
+
238
+ - Improved: `setup_directories()` running on every (admin) request by only running when `WPI_UPLOADS_DIR` does not exists.
239
+ - Fixed: 'Call to undefined function bewpi_get_id()' by dumping Composer autoloading.
240
+ - Fixed: `GLOB_BRACE` unsupported on some systems.
241
+
242
+ = 2.7.2 - April, 18, 2017 =
243
 
244
  - Added: Filter 'bewpi_my_account_pdf_name' to change the name of the PDF button on My Account page.
245
  - Fixed: 'Fatal error: Call to a member function get_id() on null' by checking object type in method `add_emailitin_as_recipient()`.
vendor/composer/autoload_classmap.php CHANGED
@@ -10,6 +10,7 @@ return array(
10
  'BEWPI_Abstract_Invoice' => $baseDir . '/includes/abstracts/abstract-bewpi-invoice.php',
11
  'BEWPI_Abstract_Setting' => $baseDir . '/includes/abstracts/abstract-bewpi-setting.php',
12
  'BEWPI_Admin_Notices' => $baseDir . '/includes/admin/class-bewpi-admin-notices.php',
 
13
  'BEWPI_General_Settings' => $baseDir . '/includes/admin/settings/class-bewpi-admin-settings-general.php',
14
  'BEWPI_Invoice' => $baseDir . '/includes/class-bewpi-invoice.php',
15
  'BEWPI_Template' => $baseDir . '/includes/class-bewpi-template.php',
10
  'BEWPI_Abstract_Invoice' => $baseDir . '/includes/abstracts/abstract-bewpi-invoice.php',
11
  'BEWPI_Abstract_Setting' => $baseDir . '/includes/abstracts/abstract-bewpi-setting.php',
12
  'BEWPI_Admin_Notices' => $baseDir . '/includes/admin/class-bewpi-admin-notices.php',
13
+ 'BEWPI_Debug_Log' => $baseDir . '/includes/class-bewpi-debug-log.php',
14
  'BEWPI_General_Settings' => $baseDir . '/includes/admin/settings/class-bewpi-admin-settings-general.php',
15
  'BEWPI_Invoice' => $baseDir . '/includes/class-bewpi-invoice.php',
16
  'BEWPI_Template' => $baseDir . '/includes/class-bewpi-template.php',
vendor/composer/autoload_files.php CHANGED
@@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  '04325844027171964b9df3c6105af385' => $baseDir . '/includes/be-woocommerce-pdf-invoices.php',
10
  'd2050ec9372ea29bd0609053442e7429' => $baseDir . '/includes/abstracts/abstract-bewpi-document.php',
11
  '01750539cdf2435c7e90158d2e00d822' => $baseDir . '/includes/abstracts/abstract-bewpi-invoice.php',
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ '4738408c81ab2069c3593b9151c233d9' => $baseDir . '/includes/functions.php',
10
  '04325844027171964b9df3c6105af385' => $baseDir . '/includes/be-woocommerce-pdf-invoices.php',
11
  'd2050ec9372ea29bd0609053442e7429' => $baseDir . '/includes/abstracts/abstract-bewpi-document.php',
12
  '01750539cdf2435c7e90158d2e00d822' => $baseDir . '/includes/abstracts/abstract-bewpi-invoice.php',
vendor/composer/autoload_static.php CHANGED
@@ -7,6 +7,7 @@ namespace Composer\Autoload;
7
  class ComposerStaticInit94c7f0816fa203ee4c190ff0bde4f23b
8
  {
9
  public static $files = array (
 
10
  '04325844027171964b9df3c6105af385' => __DIR__ . '/../..' . '/includes/be-woocommerce-pdf-invoices.php',
11
  'd2050ec9372ea29bd0609053442e7429' => __DIR__ . '/../..' . '/includes/abstracts/abstract-bewpi-document.php',
12
  '01750539cdf2435c7e90158d2e00d822' => __DIR__ . '/../..' . '/includes/abstracts/abstract-bewpi-invoice.php',
@@ -23,6 +24,7 @@ class ComposerStaticInit94c7f0816fa203ee4c190ff0bde4f23b
23
  'BEWPI_Abstract_Invoice' => __DIR__ . '/../..' . '/includes/abstracts/abstract-bewpi-invoice.php',
24
  'BEWPI_Abstract_Setting' => __DIR__ . '/../..' . '/includes/abstracts/abstract-bewpi-setting.php',
25
  'BEWPI_Admin_Notices' => __DIR__ . '/../..' . '/includes/admin/class-bewpi-admin-notices.php',
 
26
  'BEWPI_General_Settings' => __DIR__ . '/../..' . '/includes/admin/settings/class-bewpi-admin-settings-general.php',
27
  'BEWPI_Invoice' => __DIR__ . '/../..' . '/includes/class-bewpi-invoice.php',
28
  'BEWPI_Template' => __DIR__ . '/../..' . '/includes/class-bewpi-template.php',
7
  class ComposerStaticInit94c7f0816fa203ee4c190ff0bde4f23b
8
  {
9
  public static $files = array (
10
+ '4738408c81ab2069c3593b9151c233d9' => __DIR__ . '/../..' . '/includes/functions.php',
11
  '04325844027171964b9df3c6105af385' => __DIR__ . '/../..' . '/includes/be-woocommerce-pdf-invoices.php',
12
  'd2050ec9372ea29bd0609053442e7429' => __DIR__ . '/../..' . '/includes/abstracts/abstract-bewpi-document.php',
13
  '01750539cdf2435c7e90158d2e00d822' => __DIR__ . '/../..' . '/includes/abstracts/abstract-bewpi-invoice.php',
24
  'BEWPI_Abstract_Invoice' => __DIR__ . '/../..' . '/includes/abstracts/abstract-bewpi-invoice.php',
25
  'BEWPI_Abstract_Setting' => __DIR__ . '/../..' . '/includes/abstracts/abstract-bewpi-setting.php',
26
  'BEWPI_Admin_Notices' => __DIR__ . '/../..' . '/includes/admin/class-bewpi-admin-notices.php',
27
+ 'BEWPI_Debug_Log' => __DIR__ . '/../..' . '/includes/class-bewpi-debug-log.php',
28
  'BEWPI_General_Settings' => __DIR__ . '/../..' . '/includes/admin/settings/class-bewpi-admin-settings-general.php',
29
  'BEWPI_Invoice' => __DIR__ . '/../..' . '/includes/class-bewpi-invoice.php',
30
  'BEWPI_Template' => __DIR__ . '/../..' . '/includes/class-bewpi-template.php',