WooCommerce PDF Invoices - Version 3.0.1

Version Description

  • April, 2019 =

  • Fixed: Fatal error PLUGIN_SLUG constant.

Download this release

Release Info

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

Code changes from version 3.0.0 to 3.0.1

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: 3.0.0
7
  * Author: Bas Elbers
8
  * Author URI: http://wcpdfinvoices.com
9
  * License: GPL-2.0+
@@ -16,7 +16,7 @@
16
 
17
  defined( 'ABSPATH' ) || exit;
18
 
19
- define( 'WPI_VERSION', '3.0.0' );
20
 
21
  /**
22
  * 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: 3.0.1
7
  * Author: Bas Elbers
8
  * Author URI: http://wcpdfinvoices.com
9
  * License: GPL-2.0+
16
 
17
  defined( 'ABSPATH' ) || exit;
18
 
19
+ define( 'WPI_VERSION', '3.0.1' );
20
 
21
  /**
22
  * Load WooCommerce PDF Invoices plugin.
includes/abstracts/abstract-settings.php CHANGED
@@ -116,7 +116,7 @@ abstract class BEWPI_Abstract_Settings {
116
  */
117
  public static function admin_init() {
118
  // Only load settings on settings saved or page load.
119
- if ( isset( $_GET['key'] ) && md5( WPI()::PLUGIN_SLUG ) === $_GET['key'] || isset( $_GET['page'] ) && WPI()::PLUGIN_SLUG === $_GET['page'] ) {
120
  self::load_setting_tabs();
121
 
122
  self::$current_tab = isset( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : self::$current_tab;
@@ -175,7 +175,7 @@ abstract class BEWPI_Abstract_Settings {
175
  * Add submenu to WooCommerce menu and display options page.
176
  */
177
  public static function add_wc_submenu_options_page() {
178
- add_submenu_page( 'woocommerce', __( 'Invoices', 'woocommerce-pdf-invoices' ), __( 'Invoices', 'woocommerce-pdf-invoices' ), self::settings_capability(), WPI()::PLUGIN_SLUG, array(
179
  __CLASS__,
180
  'display_options_page',
181
  ) );
@@ -207,7 +207,7 @@ abstract class BEWPI_Abstract_Settings {
207
  printf( '<a class="nav-tab %1$s" href="%2$s">%3$s</a>',
208
  esc_attr( $active ),
209
  add_query_arg( array(
210
- 'page' => WPI()::PLUGIN_SLUG,
211
  'tab' => $id,
212
  ), '' ),
213
  esc_html( $tab['label'] )
@@ -216,7 +216,7 @@ abstract class BEWPI_Abstract_Settings {
216
  ?>
217
  </h2>
218
  <form method="post"
219
- action="options.php?tab=<?php echo self::$current_tab; ?>&key=<?php echo md5( WPI()::PLUGIN_SLUG ); ?>"
220
  enctype="multipart/form-data" <?php echo esc_html( $width ); ?>>
221
  <?php
222
  settings_fields( self::$setting->settings_key );
116
  */
117
  public static function admin_init() {
118
  // Only load settings on settings saved or page load.
119
+ if ( isset( $_GET['key'] ) && md5( WPI()->get_plugin_slug() ) === $_GET['key'] || isset( $_GET['page'] ) && WPI()->get_plugin_slug() === $_GET['page'] ) {
120
  self::load_setting_tabs();
121
 
122
  self::$current_tab = isset( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : self::$current_tab;
175
  * Add submenu to WooCommerce menu and display options page.
176
  */
177
  public static function add_wc_submenu_options_page() {
178
+ add_submenu_page( 'woocommerce', __( 'Invoices', 'woocommerce-pdf-invoices' ), __( 'Invoices', 'woocommerce-pdf-invoices' ), self::settings_capability(), WPI()->get_plugin_slug(), array(
179
  __CLASS__,
180
  'display_options_page',
181
  ) );
207
  printf( '<a class="nav-tab %1$s" href="%2$s">%3$s</a>',
208
  esc_attr( $active ),
209
  add_query_arg( array(
210
+ 'page' => WPI()->get_plugin_slug(),
211
  'tab' => $id,
212
  ), '' ),
213
  esc_html( $tab['label'] )
216
  ?>
217
  </h2>
218
  <form method="post"
219
+ action="options.php?tab=<?php echo self::$current_tab; ?>&key=<?php echo md5( WPI()->get_plugin_slug() ); ?>"
220
  enctype="multipart/form-data" <?php echo esc_html( $width ); ?>>
221
  <?php
222
  settings_fields( self::$setting->settings_key );
includes/admin/views/html-activation-notice.php CHANGED
@@ -10,7 +10,7 @@
10
  * @version 1.0.0
11
  */
12
 
13
- $settings_url = add_query_arg( array( 'page' => WPI()::PLUGIN_SLUG ), admin_url( 'admin.php' ) );
14
  ?>
15
  <div class="updated notice notice-success is-dismissible" data-dismissible="activation-forever">
16
  <p>
10
  * @version 1.0.0
11
  */
12
 
13
+ $settings_url = add_query_arg( array( 'page' => WPI()->get_plugin_slug() ), admin_url( 'admin.php' ) );
14
  ?>
15
  <div class="updated notice notice-success is-dismissible" data-dismissible="activation-forever">
16
  <p>
includes/woocommerce-pdf-invoices.php CHANGED
@@ -392,7 +392,9 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
392
  */
393
  public function add_plugin_action_links( $links ) {
394
  // add settings link.
395
- $settings_url = add_query_arg( array( 'page' => WPI()::PLUGIN_SLUG ), admin_url( 'admin.php' ) );
 
 
396
  $settings_title = __( 'Settings', 'woocommerce-pdf-invoices' );
397
  array_unshift( $links, sprintf( '<a href="%1$s">%2$s</a>', $settings_url, $settings_title ) );
398
 
@@ -402,8 +404,8 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
402
  /**
403
  * Add links to row meta on plugins.php page.
404
  *
405
- * @param array $links row meta.
406
- * @param string $file plugin basename.
407
  *
408
  * @return array
409
  */
@@ -425,7 +427,7 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
425
  */
426
  public static function get_screen_ids() {
427
  $screen_ids = array(
428
- 'woocommerce_page_' . WPI()::PLUGIN_SLUG,
429
  'edit-shop_order',
430
  'shop_order',
431
  );
@@ -480,8 +482,8 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
480
  * Add "Email It In" email address as BCC to WooCommerce email.
481
  *
482
  * @param string $headers email headers.
483
- * @param string $status email name.
484
- * @param object $order WooCommerce order.
485
  *
486
  * @return string
487
  */
@@ -520,9 +522,9 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
520
  /**
521
  * Attach a generated invoice to WooCommerce emails.
522
  *
523
- * @param array $attachments attachments.
524
- * @param string $status name of email.
525
- * @param object $order order.
526
  *
527
  * @return array.
528
  */
@@ -672,10 +674,10 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
672
  /**
673
  * Display invoice button html.
674
  *
675
- * @param string $title title attribute of button.
676
- * @param int $order_id WC_ORDER id.
677
- * @param string $action action create, view or cancel.
678
- * @param array $attributes additional attributes.
679
  */
680
  private function show_invoice_button( $title, $order_id, $action, $attributes = array() ) {
681
  $url = wp_nonce_url( add_query_arg( array(
@@ -817,8 +819,8 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
817
  /**
818
  * Display download link on My Account page.
819
  *
820
- * @param array $actions my account order table actions.
821
- * @param WC_Order $order WooCommerce order object.
822
  *
823
  * @return mixed
824
  */
@@ -902,7 +904,7 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
902
  * Get option by group and name.
903
  *
904
  * @param string $group Option group name (without 'bewpi_' prefix and '_settings' suffix). Available groups are: 'general', 'template' and 'premium'.
905
- * @param string $name Option name (without 'bewpi_' prefix).
906
  *
907
  * @return bool|mixed
908
  */
@@ -932,7 +934,7 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
932
  /**
933
  * Get tax or vat label.
934
  *
935
- * @param bool $incl Including tax or vat.
936
  * @param bool $small text font size.
937
  *
938
  * @return string
@@ -965,9 +967,9 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
965
  /**
966
  * Get order property.
967
  *
968
- * @param WC_Order $order order object.
969
- * @param string $prop order property.
970
- * @param string $context display context.
971
  *
972
  * @return mixed
973
  */
@@ -978,8 +980,8 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
978
  /**
979
  * Get order meta.
980
  *
981
- * @param WC_Order $order Order object.
982
- * @param string $meta_key Post meta key.
983
  *
984
  * @return bool/string
985
  */
@@ -1040,6 +1042,15 @@ if ( ! class_exists( 'BE_WooCommerce_PDF_Invoices' ) ) {
1040
  return $this->prefix;
1041
  }
1042
 
 
 
 
 
 
 
 
 
 
1043
  /**
1044
  * Templater instance.
1045
  *
392
  */
393
  public function add_plugin_action_links( $links ) {
394
  // add settings link.
395
+
396
+
397
+ $settings_url = add_query_arg( array( 'page' => WPI()->get_plugin_slug() ), admin_url( 'admin.php' ) );
398
  $settings_title = __( 'Settings', 'woocommerce-pdf-invoices' );
399
  array_unshift( $links, sprintf( '<a href="%1$s">%2$s</a>', $settings_url, $settings_title ) );
400
 
404
  /**
405
  * Add links to row meta on plugins.php page.
406
  *
407
+ * @param array $links row meta.
408
+ * @param string $file plugin basename.
409
  *
410
  * @return array
411
  */
427
  */
428
  public static function get_screen_ids() {
429
  $screen_ids = array(
430
+ 'woocommerce_page_' . WPI()->get_plugin_slug(),
431
  'edit-shop_order',
432
  'shop_order',
433
  );
482
  * Add "Email It In" email address as BCC to WooCommerce email.
483
  *
484
  * @param string $headers email headers.
485
+ * @param string $status email name.
486
+ * @param object $order WooCommerce order.
487
  *
488
  * @return string
489
  */
522
  /**
523
  * Attach a generated invoice to WooCommerce emails.
524
  *
525
+ * @param array $attachments attachments.
526
+ * @param string $status name of email.
527
+ * @param object $order order.
528
  *
529
  * @return array.
530
  */
674
  /**
675
  * Display invoice button html.
676
  *
677
+ * @param string $title title attribute of button.
678
+ * @param int $order_id WC_ORDER id.
679
+ * @param string $action action create, view or cancel.
680
+ * @param array $attributes additional attributes.
681
  */
682
  private function show_invoice_button( $title, $order_id, $action, $attributes = array() ) {
683
  $url = wp_nonce_url( add_query_arg( array(
819
  /**
820
  * Display download link on My Account page.
821
  *
822
+ * @param array $actions my account order table actions.
823
+ * @param WC_Order $order WooCommerce order object.
824
  *
825
  * @return mixed
826
  */
904
  * Get option by group and name.
905
  *
906
  * @param string $group Option group name (without 'bewpi_' prefix and '_settings' suffix). Available groups are: 'general', 'template' and 'premium'.
907
+ * @param string $name Option name (without 'bewpi_' prefix).
908
  *
909
  * @return bool|mixed
910
  */
934
  /**
935
  * Get tax or vat label.
936
  *
937
+ * @param bool $incl Including tax or vat.
938
  * @param bool $small text font size.
939
  *
940
  * @return string
967
  /**
968
  * Get order property.
969
  *
970
+ * @param WC_Order $order order object.
971
+ * @param string $prop order property.
972
+ * @param string $context display context.
973
  *
974
  * @return mixed
975
  */
980
  /**
981
  * Get order meta.
982
  *
983
+ * @param WC_Order $order Order object.
984
+ * @param string $meta_key Post meta key.
985
  *
986
  * @return bool/string
987
  */
1042
  return $this->prefix;
1043
  }
1044
 
1045
+ /**
1046
+ * Get plugin slug.
1047
+ *
1048
+ * @return string
1049
+ */
1050
+ public function get_plugin_slug() {
1051
+ return self::PLUGIN_SLUG;
1052
+ }
1053
+
1054
  /**
1055
  * Templater instance.
1056
  *
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: woocommerce pdf invoices, invoice, packing slips, delivery note, packing list, shipping list, generate, pdf, woocommerce, attachment, email, customer invoice, processing, vat, tax, sequential, number, dropbox, google drive, onedrive, egnyte, cloud, storage
5
  Requires at least: 4.0
6
  Tested up to: 5.1
7
- Stable tag: 3.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -344,6 +344,10 @@ Since version 2.9.4 the plugin removed the ability to update the PDF invoice whe
344
 
345
  == Changelog ==
346
 
 
 
 
 
347
  = 3.0.0 - April, 2019 =
348
 
349
  - Added: Debug settings tab with debug information.
4
  Tags: woocommerce pdf invoices, invoice, packing slips, delivery note, packing list, shipping list, generate, pdf, woocommerce, attachment, email, customer invoice, processing, vat, tax, sequential, number, dropbox, google drive, onedrive, egnyte, cloud, storage
5
  Requires at least: 4.0
6
  Tested up to: 5.1
7
+ Stable tag: 3.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
344
 
345
  == Changelog ==
346
 
347
+ = 3.0.1 - April, 2019 =
348
+
349
+ - Fixed: Fatal error PLUGIN_SLUG constant.
350
+
351
  = 3.0.0 - April, 2019 =
352
 
353
  - Added: Debug settings tab with debug information.
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInita4011a6fb3afb300f2234691b1bab1cb::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit46eaa0f83e1f340202498774b3cec439::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInitb9dbe781055ee404f0462851b4c8ee88::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit0982b17ebb2ba3f28eaf1c6d85777d2c::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInita4011a6fb3afb300f2234691b1bab1cb
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInita4011a6fb3afb300f2234691b1bab1cb
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInita4011a6fb3afb300f2234691b1bab1cb', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInita4011a6fb3afb300f2234691b1bab1cb', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInita4011a6fb3afb300f2234691b1bab1cb::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit46eaa0f83e1f340202498774b3cec439
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit46eaa0f83e1f340202498774b3cec439', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit46eaa0f83e1f340202498774b3cec439', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit46eaa0f83e1f340202498774b3cec439::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInitb9dbe781055ee404f0462851b4c8ee88 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitb9dbe781055ee404f0462851b4c8ee88 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitb9dbe781055ee404f0462851b4c8ee88', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitb9dbe781055ee404f0462851b4c8ee88', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInit0982b17ebb2ba3f28eaf1c6d85777d2c {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit0982b17ebb2ba3f28eaf1c6d85777d2c', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit0982b17ebb2ba3f28eaf1c6d85777d2c', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInita4011a6fb3afb300f2234691b1bab1cb
8
  {
9
  public static $prefixesPsr0 = array (
10
  'x' =>
@@ -73,8 +73,8 @@ class ComposerStaticInita4011a6fb3afb300f2234691b1bab1cb
73
  public static function getInitializer(ClassLoader $loader)
74
  {
75
  return \Closure::bind(function () use ($loader) {
76
- $loader->prefixesPsr0 = ComposerStaticInita4011a6fb3afb300f2234691b1bab1cb::$prefixesPsr0;
77
- $loader->classMap = ComposerStaticInita4011a6fb3afb300f2234691b1bab1cb::$classMap;
78
 
79
  }, null, ClassLoader::class);
80
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit46eaa0f83e1f340202498774b3cec439
8
  {
9
  public static $prefixesPsr0 = array (
10
  'x' =>
73
  public static function getInitializer(ClassLoader $loader)
74
  {
75
  return \Closure::bind(function () use ($loader) {
76
+ $loader->prefixesPsr0 = ComposerStaticInit46eaa0f83e1f340202498774b3cec439::$prefixesPsr0;
77
+ $loader->classMap = ComposerStaticInit46eaa0f83e1f340202498774b3cec439::$classMap;
78
 
79
  }, null, ClassLoader::class);
80
  }