WooCommerce PDF Invoices & Packing Slips - Version 2.5.1

Version Description

  • Fix: Correct integration with permalink settings for [wcpdf_download_invoice] shortcode
  • Fix: Plugin assets versioning
Download this release

Release Info

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

Code changes from version 2.5.0 to 2.5.1

includes/class-wcpdf-frontend.php CHANGED
@@ -94,11 +94,13 @@ class Frontend {
94
  ), $atts);
95
  if( !$values ) return;
96
 
 
 
97
  // Get $order
98
- if( is_checkout() && !empty(is_wc_endpoint_url('order-received')) && empty($values['order_id']) ) {
99
- $order = wc_get_order( $_GET['order-received'] );
100
- } elseif( is_account_page() && !empty(is_wc_endpoint_url('view-order')) && empty($values['order_id']) ) {
101
- $order = wc_get_order( $_GET['view-order'] );
102
  } elseif( !empty($values['order_id']) ) {
103
  $order = wc_get_order( $values['order_id'] );
104
  }
@@ -112,12 +114,13 @@ class Frontend {
112
 
113
  // User permissions
114
  $debug_settings = get_option('wpo_wcpdf_settings_debug', array());
 
115
  if( is_user_logged_in() ) {
116
  $pdf_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->get_id() . '&my-account'), 'generate_wpo_wcpdf' );
117
- $text .= '<p><a href="'.esc_attr($pdf_url).'" target="_blank">'.$link_text.'</a></p>';
118
  } elseif( ! is_user_logged_in() && isset($debug_settings['guest_access']) ) {
119
  $pdf_url = admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->get_id() . '&order_key=' . $order->get_order_key() );
120
- $text .= '<p><a href="'.esc_attr($pdf_url).'" target="_blank">'.$link_text.'</a></p>';
121
  }
122
 
123
  return $text;
94
  ), $atts);
95
  if( !$values ) return;
96
 
97
+ global $wp;
98
+
99
  // Get $order
100
+ if( is_checkout() && !empty(is_wc_endpoint_url('order-received')) && empty($values['order_id']) && isset($wp->query_vars['order-received']) ) {
101
+ $order = wc_get_order( $wp->query_vars['order-received'] );
102
+ } elseif( is_account_page() && !empty(is_wc_endpoint_url('view-order')) && empty($values['order_id']) && isset($wp->query_vars['view-order']) ) {
103
+ $order = wc_get_order( $wp->query_vars['view-order'] );
104
  } elseif( !empty($values['order_id']) ) {
105
  $order = wc_get_order( $values['order_id'] );
106
  }
114
 
115
  // User permissions
116
  $debug_settings = get_option('wpo_wcpdf_settings_debug', array());
117
+ $text = null;
118
  if( is_user_logged_in() ) {
119
  $pdf_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->get_id() . '&my-account'), 'generate_wpo_wcpdf' );
120
+ $text = '<p><a href="'.esc_attr($pdf_url).'" target="_blank">'.$link_text.'</a></p>';
121
  } elseif( ! is_user_logged_in() && isset($debug_settings['guest_access']) ) {
122
  $pdf_url = admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->get_id() . '&order_key=' . $order->get_order_key() );
123
+ $text = '<p><a href="'.esc_attr($pdf_url).'" target="_blank">'.$link_text.'</a></p>';
124
  }
125
 
126
  return $text;
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.4
7
  Requires PHP: 5.3
8
- Stable tag: 2.5.0
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.5.0 =
106
  * Feature: Manually regenerate individual documents with latest settings (shop address/footer/etc)
107
  * Feature: Shortcode to download invoice: `[wcpdf_download_invoice]`
5
  Requires at least: 3.5
6
  Tested up to: 5.4
7
  Requires PHP: 5.3
8
+ Stable tag: 2.5.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
102
 
103
  == Changelog ==
104
 
105
+ = 2.5.1 =
106
+ * Fix: Correct integration with permalink settings for `[wcpdf_download_invoice]` shortcode
107
+ * Fix: Plugin assets versioning
108
+
109
  = 2.5.0 =
110
  * Feature: Manually regenerate individual documents with latest settings (shop address/footer/etc)
111
  * Feature: Shortcode to download invoice: `[wcpdf_download_invoice]`
woocommerce-pdf-invoices-packingslips.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce PDF Invoices & Packing Slips
4
  * Plugin URI: http://www.wpovernight.com
5
  * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
6
- * Version: 2.5.0
7
  * Author: Ewout Fernhout
8
  * Author URI: http://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.4.10';
25
  public $plugin_basename;
26
  public $legacy_mode;
27
 
3
  * Plugin Name: WooCommerce PDF Invoices & Packing Slips
4
  * Plugin URI: http://www.wpovernight.com
5
  * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
6
+ * Version: 2.5.1
7
  * Author: Ewout Fernhout
8
  * Author URI: http://www.wpovernight.com
9
  * License: GPLv2 or later
21
 
22
  class WPO_WCPDF {
23
 
24
+ public $version = '2.5.1';
25
  public $plugin_basename;
26
  public $legacy_mode;
27