WooCommerce PDF Invoices & Packing Slips - Version 2.11.4

Version Description

  • Fix: bundled fonts being deleted during upgrades
  • Fix: dompdf 1.1.0+ font cache data compatibility
Download this release

Release Info

Developer pomegranate
Plugin Icon 128x128 WooCommerce PDF Invoices & Packing Slips
Version 2.11.4
Comparing to
See all releases

Code changes from version 2.11.3 to 2.11.4

includes/class-wcpdf-font-synchronizer.php CHANGED
@@ -88,8 +88,13 @@ class Font_Synchronizer {
88
  * @return void
89
  */
90
  public function delete_font_files( $filenames ) {
 
91
  $extensions = array( '.ttf', '.ufm', '.ufm.php', '.afm', '.afm.php' );
92
  foreach ( $filenames as $filename ) {
 
 
 
 
93
  foreach ( $extensions as $extension ) {
94
  $file = $filename . $extension;
95
  if ( file_exists( $file ) ) {
@@ -147,7 +152,7 @@ class Font_Synchronizer {
147
 
148
  // dompdf 1.1.X uses a closure to return the fonts, instead of a plain array (1.0.X and older)
149
  if ( ! is_array( $font_data ) && is_callable( $font_data ) ) {
150
- $font_data = $destination;
151
  }
152
 
153
  return is_array( $font_data ) ? $this->normalize_font_paths( $font_data ) : array();
88
  * @return void
89
  */
90
  public function delete_font_files( $filenames ) {
91
+ $plugin_folder = $this->normalize_path( WPO_WCPDF()->plugin_path() );
92
  $extensions = array( '.ttf', '.ufm', '.ufm.php', '.afm', '.afm.php' );
93
  foreach ( $filenames as $filename ) {
94
+ // never delete files in our own plugin folder
95
+ if ( strpos( $filename, $plugin_folder ) !== false ) {
96
+ continue;
97
+ }
98
  foreach ( $extensions as $extension ) {
99
  $file = $filename . $extension;
100
  if ( file_exists( $file ) ) {
152
 
153
  // dompdf 1.1.X uses a closure to return the fonts, instead of a plain array (1.0.X and older)
154
  if ( ! is_array( $font_data ) && is_callable( $font_data ) ) {
155
+ $font_data = $font_data( $fontDir, $rootDir );
156
  }
157
 
158
  return is_array( $font_data ) ? $this->normalize_font_paths( $font_data ) : array();
includes/views/wcpdf-settings-page.php CHANGED
@@ -18,7 +18,8 @@ $review_invitation = sprintf(
18
  <h2><?php esc_html_e( 'WooCommerce PDF Invoices', 'woocommerce-pdf-invoices-packing-slips' ); ?></h2>
19
  <h2 class="nav-tab-wrapper">
20
  <?php
21
- foreach ( $settings_tabs as $tab_slug => $tab_title ) {
 
22
  $tab_link = esc_url("?page=wpo_wcpdf_options_page&tab={$tab_slug}");
23
  printf('<a href="%1$s" class="nav-tab nav-tab-%2$s %3$s">%4$s</a>', $tab_link, esc_attr( $tab_slug ), ( ( $active_tab == $tab_slug ) ? 'nav-tab-active' : '' ), esc_html( $tab_title ) );
24
  }
18
  <h2><?php esc_html_e( 'WooCommerce PDF Invoices', 'woocommerce-pdf-invoices-packing-slips' ); ?></h2>
19
  <h2 class="nav-tab-wrapper">
20
  <?php
21
+ foreach ( $settings_tabs as $tab_slug => $tab_data ) {
22
+ $tab_title = is_array( $tab_data ) ? $tab_data['title'] : $tab_data;
23
  $tab_link = esc_url("?page=wpo_wcpdf_options_page&tab={$tab_slug}");
24
  printf('<a href="%1$s" class="nav-tab nav-tab-%2$s %3$s">%4$s</a>', $tab_link, esc_attr( $tab_slug ), ( ( $active_tab == $tab_slug ) ? 'nav-tab-active' : '' ), esc_html( $tab_title ) );
25
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: woocommerce, pdf, invoices, packing slips, print, delivery notes, invoice,
5
  Requires at least: 3.5
6
  Tested up to: 5.8
7
  Requires PHP: 7.1
8
- Stable tag: 2.11.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -102,6 +102,10 @@ There's a setting on the Status tab of the settings page that allows you to togg
102
 
103
  == Changelog ==
104
 
 
 
 
 
105
  = 2.11.3 =
106
  * Fix: Extended currency symbol support in bulk documents
107
  * Fix: Prevent copying packing slip and other document data for renewal orders (WooCommerce Subscriptions)
5
  Requires at least: 3.5
6
  Tested up to: 5.8
7
  Requires PHP: 7.1
8
+ Stable tag: 2.11.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
102
 
103
  == Changelog ==
104
 
105
+ = 2.11.4 =
106
+ * Fix: bundled fonts being deleted during upgrades
107
+ * Fix: dompdf 1.1.0+ font cache data compatibility
108
+
109
  = 2.11.3 =
110
  * Fix: Extended currency symbol support in bulk documents
111
  * Fix: Prevent copying packing slip and other document data for renewal orders (WooCommerce Subscriptions)
woocommerce-pdf-invoices-packingslips.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce PDF Invoices & Packing Slips
4
  * Plugin URI: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/
5
  * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
6
- * Version: 2.11.3
7
  * Author: WP Overnight
8
  * Author URI: https://www.wpovernight.com
9
  * License: GPLv2 or later
@@ -21,7 +21,7 @@ if ( !class_exists( 'WPO_WCPDF' ) ) :
21
 
22
  class WPO_WCPDF {
23
 
24
- public $version = '2.11.3';
25
  public $plugin_basename;
26
  public $legacy_mode;
27
  public $legacy_textdomain;
3
  * Plugin Name: WooCommerce PDF Invoices & Packing Slips
4
  * Plugin URI: https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/
5
  * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
6
+ * Version: 2.11.4
7
  * Author: WP Overnight
8
  * Author URI: https://www.wpovernight.com
9
  * License: GPLv2 or later
21
 
22
  class WPO_WCPDF {
23
 
24
+ public $version = '2.11.4';
25
  public $plugin_basename;
26
  public $legacy_mode;
27
  public $legacy_textdomain;