WP eCommerce - Version 3.10.1

Version Description

  • Fix: Uses version_compare() for comparing wpsc_version constant in legacy code (from 5 years ago). Using comparators was causing 3.10.0 to be "less than" 3.8, resulting in an unnecessary admin notice.
  • Fix: Changes internal mechanism for detecting which theme engine is in use. The way we were checking for it before caused many core actions to be unhooked, leading to unsavory results, like Fancy Notifications no longer working.
  • Fix: Patched in a few fixes for incorrect usage of esc_url(). This resolves scenarios like the selecting a custom checkout form in the Dashboard failing because of double-encoded ampersands.
Download this release

Release Info

Developer JustinSainton
Plugin Icon 128x128 WP eCommerce
Version 3.10.1
Comparing to
See all releases

Code changes from version 3.10.0 to 3.10.1

Files changed (30) hide show
  1. package.json +1 -1
  2. phpunit.xml +14 -0
  3. readme.md +1 -1
  4. readme.txt +7 -1
  5. wp-shopping-cart.php +1 -1
  6. wpsc-admin/admin.php +7 -5
  7. wpsc-admin/display-update.page.php +1 -2
  8. wpsc-admin/includes/save-data.functions.php +2 -1
  9. wpsc-admin/includes/settings-tabs/checkout.php +2 -2
  10. wpsc-admin/includes/settings-tabs/shipping.php +1 -1
  11. wpsc-components/merchant-core-v2/helpers/admin.php +7 -0
  12. wpsc-components/merchant-core-v3/classes/http.php +0 -0
  13. wpsc-components/merchant-core-v3/classes/payment-gateway.php +4 -1
  14. wpsc-components/merchant-core-v3/gateways/dg.js +0 -0
  15. wpsc-components/merchant-core-v3/gateways/dgs.js +0 -0
  16. wpsc-components/merchant-core-v3/gateways/paypal-digital-goods.php +0 -0
  17. wpsc-components/merchant-core-v3/gateways/paypal-express-checkout.php +0 -0
  18. wpsc-components/merchant-core-v3/gateways/paypal-pro.php +0 -0
  19. wpsc-components/merchant-core-v3/gateways/php-merchant/README.md +0 -0
  20. wpsc-components/merchant-core-v3/gateways/php-merchant/gateways/paypal-digital-goods.php +0 -0
  21. wpsc-components/merchant-core-v3/gateways/php-merchant/gateways/paypal-express-checkout.php +0 -0
  22. wpsc-components/merchant-core-v3/gateways/php-merchant/gateways/paypal-pro.php +0 -0
  23. wpsc-components/merchant-core-v3/gateways/pro.css +0 -0
  24. wpsc-components/merchant-core-v3/gateways/pro.js +0 -0
  25. wpsc-components/merchant-core-v3/helpers/checkout.php +0 -0
  26. wpsc-components/merchant-core-v3/helpers/common.php +0 -0
  27. wpsc-components/merchant-core-v3/merchant-core-v3.php +0 -0
  28. wpsc-components/theme-engine-v1/helpers/page.php +1 -1
  29. wpsc-core/wpsc-constants.php +3 -3
  30. wpsc-core/wpsc-installer.php +3 -1
package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "wp-e-commerce",
3
- "version": "3.10.0",
4
  "private": true,
5
  "devDependencies": {
6
  "grunt": "~0.4.5",
1
  {
2
  "name": "wp-e-commerce",
3
+ "version": "3.10.1",
4
  "private": true,
5
  "devDependencies": {
6
  "grunt": "~0.4.5",
phpunit.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <phpunit
2
+ bootstrap="tests/bootstrap.php"
3
+ backupGlobals="false"
4
+ colors="true"
5
+ convertErrorsToExceptions="true"
6
+ convertNoticesToExceptions="false"
7
+ convertWarningsToExceptions="false"
8
+ >
9
+ <testsuites>
10
+ <testsuite>
11
+ <directory prefix="test-" suffix=".php">./tests/</directory>
12
+ </testsuite>
13
+ </testsuites>
14
+ </phpunit>
readme.md CHANGED
@@ -15,7 +15,7 @@ If you're looking for general user support, please submit your support request o
15
  Development status
16
  -------------------------
17
 
18
- * The latest stable version is [3.10.0](http://wordpress.org/extend/plugins/wp-e-commerce).
19
  * Active development version: 4.0-dev (branch [master](https://github.com/wp-e-commerce/WP-e-Commerce))
20
  * [Roadmap for 4.0](https://github.com/wp-e-commerce/wp-e-commerce/wiki/Roadmap)
21
  * [4.0 tickets](https://github.com/wp-e-commerce/WP-e-Commerce/milestones/4.0)
15
  Development status
16
  -------------------------
17
 
18
+ * The latest stable version is [3.10.1](http://wordpress.org/extend/plugins/wp-e-commerce).
19
  * Active development version: 4.0-dev (branch [master](https://github.com/wp-e-commerce/WP-e-Commerce))
20
  * [Roadmap for 4.0](https://github.com/wp-e-commerce/wp-e-commerce/wiki/Roadmap)
21
  * [4.0 tickets](https://github.com/wp-e-commerce/WP-e-Commerce/milestones/4.0)
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wpecommerce.org
4
  Tags: e-commerce, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
5
  Requires at least: 4.1
6
  Tested up to: 4.3
7
- Stable tag: 3.10.0
8
 
9
  WP eCommerce is a free, powerful plugin that empowers you to sell anything online, quickly and easily.
10
 
@@ -36,6 +36,12 @@ After upgrading from earlier versions look for link "Update Store". This will up
36
 
37
  == Changelog ==
38
 
 
 
 
 
 
 
39
  = 3.10.0 =
40
 
41
  * Enhancement: Added updated PayPal gateways. We now support Digital Goods and Pro Hosted, and have updated the Express Checkout gateway. We now recommend all existing users of the 2.0 Express Checkout gateway update to the 3.0 version.
4
  Tags: e-commerce, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
5
  Requires at least: 4.1
6
  Tested up to: 4.3
7
+ Stable tag: 3.10.1
8
 
9
  WP eCommerce is a free, powerful plugin that empowers you to sell anything online, quickly and easily.
10
 
36
 
37
  == Changelog ==
38
 
39
+ = 3.10.1 =
40
+
41
+ * Fix: Uses version_compare() for comparing wpsc_version constant in legacy code (from 5 years ago). Using comparators was causing 3.10.0 to be "less than" 3.8, resulting in an unnecessary admin notice.
42
+ * Fix: Changes internal mechanism for detecting which theme engine is in use. The way we were checking for it before caused many core actions to be unhooked, leading to unsavory results, like Fancy Notifications no longer working.
43
+ * Fix: Patched in a few fixes for incorrect usage of esc_url(). This resolves scenarios like the selecting a custom checkout form in the Dashboard failing because of double-encoded ampersands.
44
+
45
  = 3.10.0 =
46
 
47
  * Enhancement: Added updated PayPal gateways. We now support Digital Goods and Pro Hosted, and have updated the Express Checkout gateway. We now recommend all existing users of the 2.0 Express Checkout gateway update to the 3.0 version.
wp-shopping-cart.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP eCommerce
4
  * Plugin URI: http://wpecommerce.org/
5
  * Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://wpecommerce.org" target="_blank">WPeCommerce.org</a> | <a href="https://wordpress.org/support/plugin/wp-e-commerce/" target="_blank">Support Forum</a> | <a href="http://docs.wpecommerce.org/" target="_blank">Documentation</a>
6
- * Version: 3.10.0
7
  * Author: WP eCommerce
8
  * Author URI: http://wpecommerce.org/
9
  **/
3
  * Plugin Name: WP eCommerce
4
  * Plugin URI: http://wpecommerce.org/
5
  * Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://wpecommerce.org" target="_blank">WPeCommerce.org</a> | <a href="https://wordpress.org/support/plugin/wp-e-commerce/" target="_blank">Support Forum</a> | <a href="http://docs.wpecommerce.org/" target="_blank">Documentation</a>
6
+ * Version: 3.10.1
7
  * Author: WP eCommerce
8
  * Author URI: http://wpecommerce.org/
9
  **/
wpsc-admin/admin.php CHANGED
@@ -154,6 +154,7 @@ function wpsc_show_update_link() {
154
  else
155
  return false;
156
  }
 
157
  /**
158
  * wpsc_admin_pages function, all the definitons of admin pages are stores here.
159
  * No parameters, returns nothing
@@ -188,13 +189,14 @@ function wpsc_admin_pages() {
188
  }
189
  }
190
 
191
- // Add to Dashboard
192
- // $page_hooks[] = $purchase_log_page = add_submenu_page( 'index.php', __( 'Store Sales', 'wpsc' ), __( 'Store Sales', 'wpsc' ), 'administrator', 'wpsc-sales-logs', 'wpsc_display_sales_logs' );
193
 
194
- if ( wpsc_show_update_link() )
195
- $page_hooks[] = add_submenu_page( 'index.php', __( 'Update Store', 'wpsc' ), __( 'Store Update', 'wpsc' ), 'administrator', 'wpsc-update', 'wpsc_display_update_page' );
 
 
 
196
 
197
- $store_upgrades_cap = apply_filters( 'wpsc_upgrades_cap', 'administrator' );
198
  $page_hooks[] = add_submenu_page( 'index.php', __( 'Store Upgrades', 'wpsc' ), __( 'Store Upgrades', 'wpsc' ), $store_upgrades_cap, 'wpsc-upgrades', 'wpsc_display_upgrades_page' );
199
 
200
  $purchase_logs_cap = apply_filters( 'wpsc_purchase_logs_cap', 'administrator' );
154
  else
155
  return false;
156
  }
157
+
158
  /**
159
  * wpsc_admin_pages function, all the definitons of admin pages are stores here.
160
  * No parameters, returns nothing
189
  }
190
  }
191
 
192
+ $store_upgrades_cap = apply_filters( 'wpsc_upgrades_cap', 'administrator' );
 
193
 
194
+ $page_hooks = array();
195
+
196
+ if ( wpsc_show_update_link() ) {
197
+ $page_hooks[] = add_submenu_page( 'index.php', __( 'Update Store', 'wpsc' ), __( 'Store Update', 'wpsc' ), $store_upgrades_cap, 'wpsc-update', 'wpsc_display_update_page' );
198
+ }
199
 
 
200
  $page_hooks[] = add_submenu_page( 'index.php', __( 'Store Upgrades', 'wpsc' ), __( 'Store Upgrades', 'wpsc' ), $store_upgrades_cap, 'wpsc-upgrades', 'wpsc_display_upgrades_page' );
201
 
202
  $purchase_logs_cap = apply_filters( 'wpsc_purchase_logs_cap', 'administrator' );
wpsc-admin/display-update.page.php CHANGED
@@ -56,8 +56,7 @@ function wpsc_display_php_version_notice() {
56
 
57
  function wpsc_display_update_page() {
58
  global $wpdb;
59
-
60
- ?>
61
 
62
  <div class="wrap">
63
  <h2><?php esc_html_e( 'Update WP eCommerce', 'wpsc' ); ?> </h2>
56
 
57
  function wpsc_display_update_page() {
58
  global $wpdb;
59
+ ?>
 
60
 
61
  <div class="wrap">
62
  <h2><?php esc_html_e( 'Update WP eCommerce', 'wpsc' ); ?> </h2>
wpsc-admin/includes/save-data.functions.php CHANGED
@@ -95,12 +95,13 @@ function wpsc_custom_category_column_data( $string, $column_name, $term_id ) {
95
  if ( 'image' == $column_name ) {
96
  $term = get_term_by( 'id', $term_id, 'wpsc_product_category' );
97
  $image = wpsc_get_categorymeta( $term_id, 'image' );
 
98
 
99
  $format = '<img src="%s" title="%s" alt="%2$s" width="30" height="30" />';
100
  if ( ! empty( $image ) ) {
101
  $string = sprintf( $format, WPSC_CORE_IMAGES_URL . $image, esc_attr( $term->name ) );
102
  } else {
103
- $string = sprintf( $format, WPSC_CORE_IMAGES_URL . '/no-image-uploaded.gif', esc_attr( $term->name ) );
104
  }
105
  }
106
  return $string;
95
  if ( 'image' == $column_name ) {
96
  $term = get_term_by( 'id', $term_id, 'wpsc_product_category' );
97
  $image = wpsc_get_categorymeta( $term_id, 'image' );
98
+ $noimage = defined( 'WPSC_CORE_THEME_URL' ) ? WPSC_CORE_THEME_URL . '/wpsc-images/noimage.png' : WPSC_TE_V2_URL . '/theming/assets/images/noimage.png';
99
 
100
  $format = '<img src="%s" title="%s" alt="%2$s" width="30" height="30" />';
101
  if ( ! empty( $image ) ) {
102
  $string = sprintf( $format, WPSC_CORE_IMAGES_URL . $image, esc_attr( $term->name ) );
103
  } else {
104
+ $string = sprintf( $format, $noimage, esc_attr( $term->name ) );
105
  }
106
  }
107
  return $string;
wpsc-admin/includes/settings-tabs/checkout.php CHANGED
@@ -77,7 +77,7 @@ class WPSC_Settings_Tab_Checkout extends WPSC_Settings_Tab {
77
  }
78
 
79
  if ( isset( $_POST['checkout_set'] ) ) {
80
- $_SERVER['REQUEST_URI'] = esc_url( add_query_arg( 'checkout_set', $_POST['checkout_set'] ) );
81
  }
82
 
83
  if ( ! isset( $_POST['form_name'] ) && ! isset( $_POST['new_field_name'] ) )
@@ -521,4 +521,4 @@ class WPSC_Settings_Tab_Checkout extends WPSC_Settings_Tab {
521
  </table>
522
  <?php
523
  }
524
- }
77
  }
78
 
79
  if ( isset( $_POST['checkout_set'] ) ) {
80
+ $_SERVER['REQUEST_URI'] = esc_url_raw( add_query_arg( 'checkout_set', $_POST['checkout_set'] ) );
81
  }
82
 
83
  if ( ! isset( $_POST['form_name'] ) && ! isset( $_POST['new_field_name'] ) )
521
  </table>
522
  <?php
523
  }
524
+ }
wpsc-admin/includes/settings-tabs/shipping.php CHANGED
@@ -61,7 +61,7 @@ class WPSC_Settings_Tab_Shipping extends WPSC_Settings_Tab {
61
  update_option( 'do_not_use_shipping', '1' );
62
  return array( 'shipping_disabled' => 1 );
63
  } else {
64
- $_SERVER['REQUEST_URI'] = esc_url( remove_query_arg( 'shipping_disabled' ) );
65
  }
66
  }
67
 
61
  update_option( 'do_not_use_shipping', '1' );
62
  return array( 'shipping_disabled' => 1 );
63
  } else {
64
+ $_SERVER['REQUEST_URI'] = esc_url_raw( remove_query_arg( 'shipping_disabled' ) );
65
  }
66
  }
67
 
wpsc-components/merchant-core-v2/helpers/admin.php CHANGED
@@ -39,6 +39,13 @@ add_filter(
39
  */
40
  function wpsc_filter_deprecated_v2_gateways( $gateways ) {
41
 
 
 
 
 
 
 
 
42
  $deprecated_gateways = array(
43
  'wpsc_merchant_paypal_express'
44
  );
39
  */
40
  function wpsc_filter_deprecated_v2_gateways( $gateways ) {
41
 
42
+ // Don't remove gateways if 1.0 theme engine is in use.
43
+ $te = get_option( 'wpsc_get_active_theme_engine', '1.0' );
44
+
45
+ if ( '1.0' == $te ) {
46
+ return $gateways;
47
+ }
48
+
49
  $deprecated_gateways = array(
50
  'wpsc_merchant_paypal_express'
51
  );
wpsc-components/merchant-core-v3/classes/http.php CHANGED
File without changes
wpsc-components/merchant-core-v3/classes/payment-gateway.php CHANGED
@@ -581,7 +581,10 @@ abstract class WPSC_Payment_Gateway {
581
  }
582
 
583
  public function get_shopping_cart_payment_url() {
584
- return _wpsc_maybe_activate_theme_engine_v2() ? wpsc_get_checkout_url( 'shipping-and-billing' ) : get_option( 'shopping_cart_url' );
 
 
 
585
  }
586
 
587
  public function get_products_page_url() {
581
  }
582
 
583
  public function get_shopping_cart_payment_url() {
584
+
585
+ $te = get_option( 'wpsc_get_active_theme_engine', '1.0' );
586
+
587
+ return '1.0' !== $te ? wpsc_get_checkout_url( 'shipping-and-billing' ) : get_option( 'shopping_cart_url' );
588
  }
589
 
590
  public function get_products_page_url() {
wpsc-components/merchant-core-v3/gateways/dg.js CHANGED
File without changes
wpsc-components/merchant-core-v3/gateways/dgs.js CHANGED
File without changes
wpsc-components/merchant-core-v3/gateways/paypal-digital-goods.php CHANGED
File without changes
wpsc-components/merchant-core-v3/gateways/paypal-express-checkout.php CHANGED
File without changes
wpsc-components/merchant-core-v3/gateways/paypal-pro.php CHANGED
File without changes
wpsc-components/merchant-core-v3/gateways/php-merchant/README.md CHANGED
File without changes
wpsc-components/merchant-core-v3/gateways/php-merchant/gateways/paypal-digital-goods.php CHANGED
File without changes
wpsc-components/merchant-core-v3/gateways/php-merchant/gateways/paypal-express-checkout.php CHANGED
File without changes
wpsc-components/merchant-core-v3/gateways/php-merchant/gateways/paypal-pro.php CHANGED
File without changes
wpsc-components/merchant-core-v3/gateways/pro.css CHANGED
File without changes
wpsc-components/merchant-core-v3/gateways/pro.js CHANGED
File without changes
wpsc-components/merchant-core-v3/helpers/checkout.php CHANGED
File without changes
wpsc-components/merchant-core-v3/helpers/common.php CHANGED
File without changes
wpsc-components/merchant-core-v3/merchant-core-v3.php CHANGED
File without changes
wpsc-components/theme-engine-v1/helpers/page.php CHANGED
@@ -249,7 +249,7 @@ function wpsc_theme_admin_notices() {
249
  if ( false !== get_option( 'wpsc_version' ) ) {
250
 
251
  // Database update notice is most important
252
- if ( get_option ( 'wpsc_version' ) < 3.8 ) {
253
 
254
  add_action ( 'admin_notices', 'wpsc_database_update_notice' );
255
 
249
  if ( false !== get_option( 'wpsc_version' ) ) {
250
 
251
  // Database update notice is most important
252
+ if ( version_compare( get_option( 'wpsc_version' ), 3.8, '<' ) ) {
253
 
254
  add_action ( 'admin_notices', 'wpsc_database_update_notice' );
255
 
wpsc-core/wpsc-constants.php CHANGED
@@ -55,15 +55,15 @@ function wpsc_core_constants() {
55
 
56
  // Define Plugin version
57
  if ( ! defined( 'WPSC_VERSION' ) ) {
58
- define( 'WPSC_VERSION' , '3.10.0' );
59
  }
60
 
61
  if ( ! defined( 'WPSC_MINOR_VERSION' ) ) {
62
- define( 'WPSC_MINOR_VERSION' , '2f8b780' );
63
  }
64
 
65
  if ( ! defined( 'WPSC_PRESENTABLE_VERSION' ) ) {
66
- define( 'WPSC_PRESENTABLE_VERSION', '3.10.0' );
67
  }
68
 
69
  // Define a salt to use when we hash, WPSC_SALT may be defined for us in our config file, so check first
55
 
56
  // Define Plugin version
57
  if ( ! defined( 'WPSC_VERSION' ) ) {
58
+ define( 'WPSC_VERSION' , '3.10.1' );
59
  }
60
 
61
  if ( ! defined( 'WPSC_MINOR_VERSION' ) ) {
62
+ define( 'WPSC_MINOR_VERSION' , 'd31303e' );
63
  }
64
 
65
  if ( ! defined( 'WPSC_PRESENTABLE_VERSION' ) ) {
66
+ define( 'WPSC_PRESENTABLE_VERSION', '3.10.1' );
67
  }
68
 
69
  // Define a salt to use when we hash, WPSC_SALT may be defined for us in our config file, so check first
wpsc-core/wpsc-installer.php CHANGED
@@ -109,7 +109,9 @@ function wpsc_install() {
109
  require_once( WPSC_FILE_PATH . '/wpsc-core/wpsc-functions.php' );
110
  require_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-theme-engine-bootstrap.php' );
111
 
112
- if ( ! _wpsc_maybe_activate_theme_engine_v2() ) {
 
 
113
  add_option( 'product_list_url', '', '', 'no' );
114
  add_option( 'shopping_cart_url', '', '', 'no' );
115
  add_option( 'checkout_url', '', '', 'no' );
109
  require_once( WPSC_FILE_PATH . '/wpsc-core/wpsc-functions.php' );
110
  require_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-theme-engine-bootstrap.php' );
111
 
112
+ $te = get_option( 'wpsc_get_active_theme_engine', '1.0' );
113
+
114
+ if ( '1.0' == $te ) {
115
  add_option( 'product_list_url', '', '', 'no' );
116
  add_option( 'shopping_cart_url', '', '', 'no' );
117
  add_option( 'checkout_url', '', '', 'no' );