Skip to content
Browse files

Merge remote branch 'upstream/master'

  • Loading branch information...
2 parents 6b15a4f + 14a2c52 commit b48f18aca003a74b3c2483e6921dab6df9ba3e04 @1bigidea committed
View
30 wp-shopping-cart.php
@@ -3,7 +3,7 @@
* Plugin Name: WP eCommerce
* Plugin URI: http://wpecommerce.org/
* 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>
- * Version: 3.9.3
+ * Version: 4.0-dev
* Author: WP eCommerce
* Author URI: http://wpecommerce.org/
**/
@@ -119,8 +119,15 @@ public function start() {
do_action( 'wpsc_started' );
}
+ /**
+ * Sets table names as WPDB properties.
+ *
+ * @since 4.0
+ * @return array Array of custom tables
+ */
public function setup_table_names() {
global $wpdb;
+
$wpdb->wpsc_meta = WPSC_TABLE_META;
$wpdb->wpsc_also_bought = WPSC_TABLE_ALSO_BOUGHT;
$wpdb->wpsc_region_tax = WPSC_TABLE_REGION_TAX;
@@ -137,6 +144,27 @@ public function setup_table_names() {
$wpdb->wpsc_purchasemeta = WPSC_TABLE_PURCHASE_META;
$wpdb->wpsc_visitors = WPSC_TABLE_VISITORS;
$wpdb->wpsc_visitormeta = WPSC_TABLE_VISITOR_META;
+
+ return array(
+ $wpdb->wpsc_meta ,
+ $wpdb->wpsc_also_bought ,
+ $wpdb->wpsc_region_tax ,
+ $wpdb->wpsc_coupon_codes ,
+ $wpdb->wpsc_cart_contents ,
+ $wpdb->wpsc_claimed_stock ,
+ $wpdb->wpsc_currency_list ,
+ $wpdb->wpsc_purchase_logs ,
+ $wpdb->wpsc_checkout_forms ,
+ $wpdb->wpsc_product_rating ,
+ $wpdb->wpsc_download_status ,
+ $wpdb->wpsc_submitted_form_data,
+ $wpdb->wpsc_cart_itemmeta ,
+ $wpdb->wpsc_purchasemeta ,
+ $wpdb->wpsc_visitors ,
+ $wpdb->wpsc_visitormeta ,
+ );
+
+
}
/**
View
2 wpsc-admin/admin.php
@@ -1690,4 +1690,4 @@ function wpsc_support_links( $links ) {
return $links;
}
-add_filter( 'plugin_action_links_' . WPSC_PLUGIN_BASENAME, 'wpsc_support_links' );
+add_filter( 'plugin_action_links_' . WPSC_PLUGIN_BASENAME, 'wpsc_support_links' );
View
2 wpsc-admin/includes/save-data.functions.php
@@ -98,7 +98,7 @@ function wpsc_custom_category_column_data( $string, $column_name, $term_id ) {
$format = '<img src="%s" title="%s" alt="%2$s" width="30" height="30" />';
if ( ! empty( $image ) ) {
- $string = sprintf( $format, WPSC_CORE_IMAGES_URL . $image, esc_attr( $term->name ) );
+ $string = sprintf( $format, WPSC_CATEGORY_URL . $image, esc_attr( $term->name ) );
} else {
$string = sprintf( $format, WPSC_CORE_IMAGES_URL . '/no-image-uploaded.gif', esc_attr( $term->name ) );
}
View
4 wpsc-admin/includes/settings-tabs/checkout.php
@@ -80,7 +80,7 @@ public function callback_submit_options() {
}
if ( isset( $_POST['checkout_set'] ) ) {
- $_SERVER['REQUEST_URI'] = esc_url( add_query_arg( 'checkout_set', $_POST['checkout_set'] ) );
+ $_SERVER['REQUEST_URI'] = esc_url_raw( add_query_arg( 'checkout_set', $_POST['checkout_set'] ) );
}
if ( ! isset( $_POST['form_name'] ) && ! isset( $_POST['new_field_name'] ) )
@@ -522,4 +522,4 @@ public function display() {
</table>
<?php
}
-}
+}
View
2 wpsc-admin/includes/settings-tabs/shipping.php
@@ -61,7 +61,7 @@ public function callback_submit_options() {
update_option( 'do_not_use_shipping', '1' );
return array( 'shipping_disabled' => 1 );
} else {
- $_SERVER['REQUEST_URI'] = esc_url( remove_query_arg( 'shipping_disabled' ) );
+ $_SERVER['REQUEST_URI'] = esc_url_raw( remove_query_arg( 'shipping_disabled' ) );
}
}
View
8 wpsc-components/marketplace-core-v1/library/Sputnik/Admin.php
@@ -242,7 +242,7 @@ public static function build_url($args = array()) {
if (!empty($args)) {
$url = add_query_arg( $args, $url );
}
- return esc_url( $url );
+ return esc_url_raw( $url );
}
public static function build_account_url($args = array()) {
@@ -250,7 +250,7 @@ public static function build_account_url($args = array()) {
if (!empty($args)) {
$url = add_query_arg( $args, $url );
}
- return esc_url( $url );
+ return esc_url_raw( $url );
}
public static function page_styles() {
@@ -811,9 +811,9 @@ protected static function paid( $product_slug ) {
// Update Sputnik account to include newly purchased plugin
Sputnik::update_account();
- $install_url = self::build_url(array('install' => $product_slug));
+ $install_url = self::build_url( array( 'install' => $product_slug ) );
$install_url = add_query_arg('_wpnonce', wp_create_nonce('sputnik_install-plugin_' . $product_slug), $install_url);
- $install_url = esc_url( add_query_arg(array('TB_iframe' => true), $install_url) );
+ $install_url = add_query_arg( array( 'TB_iframe' => true ), $install_url );
self::iframe_closer( self::build_url( array('run-installer' => urlencode( $install_url ) ) ), __( 'Installing ... ', 'wpsc' ) );
}
View
3 wpsc-components/theme-engine-v1/helpers/query.php
@@ -295,8 +295,9 @@ function wpsc_get_page_slug( $shortcode ) {
* @return array Array of query variables
*/
function wpsc_product_sort_order_query_vars( $orderby = null ) {
- if ( is_null($orderby) )
+ if ( is_null( $orderby ) ) {
$orderby = get_option( 'wpsc_sort_by' );
+ }
$query_vars = array();
View
6 wpsc-components/theme-engine-v2/admin/js/select2.full.min.js
3 additions, 3 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
11 wpsc-components/theme-engine-v2/mvc/controllers/checkout.php
@@ -268,13 +268,16 @@ private function save_shipping_and_billing_info() {
_wpsc_update_location();
- if ( wpsc_is_tax_included() ) {
- $tax = $wpsc_cart->calculate_total_tax();
+ //keep track of tax if taxes are exclusive
+ $wpec_taxes_controller = new wpec_taxes_controller();
+ if ( ! $wpec_taxes_controller->wpec_taxes_isincluded() ) {
+ $tax = $wpsc_cart->calculate_total_tax();
$tax_percentage = $wpsc_cart->tax_percentage;
} else {
- $tax = 0;
- $tax_percentage = 0;
+ $tax = 0.00;
+ $tax_percentage = 0.00;
}
+
$purchase_log->set( array(
'wpec_taxes_total' => $tax,
'wpec_taxes_rate' => $tax_percentage,
View
4 wpsc-core/wpsc-constants.php
@@ -53,7 +53,7 @@ function wpsc_core_constants() {
// Define Plugin version
if ( ! defined( 'WPSC_VERSION' ) ) {
- define( 'WPSC_VERSION' , '3.9.3' );
+ define( 'WPSC_VERSION' , '4.0-dev' );
}
if ( ! defined( 'WPSC_MINOR_VERSION' ) ) {
@@ -61,7 +61,7 @@ function wpsc_core_constants() {
}
if ( ! defined( 'WPSC_PRESENTABLE_VERSION' ) ) {
- define( 'WPSC_PRESENTABLE_VERSION', '3.9.3' );
+ define( 'WPSC_PRESENTABLE_VERSION', '4.0-dev' );
}
// Define a salt to use when we hash, WPSC_SALT may be defined for us in our config file, so check first
View
27 wpsc-core/wpsc-functions.php
@@ -955,3 +955,30 @@ function _wpsc_clear_wp_cache_on_version_change() {
}
add_action( 'admin_init', '_wpsc_clear_wp_cache_on_version_change', 1 );
+
+/**
+ * Adds custom WP eCommerce tables to `tables_to_repair` array.
+ *
+ * WordPress provides a link, `admin_url( 'maint/repair.php' )`, that allows users to repair database tables.
+ * We find that this becomes necessary often times when visitor/visitor meta tables become corrupt.
+ * Symptoms of a corrupt visitor/meta table include disappearing carts, refreshing checkout pages, etc.
+ *
+ * In a future version, we will likely have a `System` page that would include a link to the repair.php page.
+ *
+ * @since 4.0
+ *
+ * @param array $tables Core tables
+ *
+ * @return array $tables Core + WP eCommerce tables
+ */
+function wpsc_add_tables_to_repair( $tables ) {
+ global $wpec;
+
+ if ( ! defined( 'WP_ALLOW_REPAIR' ) && apply_filters( 'wpsc_tables_need_repair', true ) ) {
+ define( 'WP_ALLOW_REPAIR', true );
+ }
+
+ return array_merge( $wpec->setup_table_names(), $tables );
+}
+
+add_filter( 'tables_to_repair', 'wpsc_add_tables_to_repair' );

0 comments on commit b48f18a

Please sign in to comment.
Something went wrong with that request. Please try again.