Version Description
- New: Product Media UI.
- New: Cart Item Meta API
- New: 'wpsc_after_checkout_cart_rows' action.
- New: Add 'wpsc_default_dimension_unit' and 'wpsc_default_weight_unit' filters.
- New: Add 'wpsc_save_product_order' action and use it to save category product order in the term_relationships table.
- New: Add logic filter for coupons. We currently have one for properties, this should sufficiently round out the extensibility for the UI.
- New: Allow gateway images to be filtered.
- New: Allow multiple comma-separated categories in coupon conditions.
- New: Product Gallery metabox.
- Change: Better Customer API.
- Change: Prepend (WPEC) to widget names in wp-admin
- Change: Replace default noimage.png with a better image.
- Change: Updated NL language
- Change: Updated german language strings
- Change: Use new spinner image in WordPress 3.8
- Fix: Add preg_quote() to coupon regexes that intend to parse strings. Fixes issue where unexpected results occur when strings contain slashes, or really, any regex-oriented characters.
- Fix: Change wpsc_get_remaining_quantity() to call the method dynamically, rather than statically. The previous behaviour caused a strict standards warning.
- Fix: Database Upgrade Routine to rename old wpsc* product metadata array keys so they no longer include the 'wpsc' prefix
- Fix: In Purchase log admin screen, item count is sum of quantity field rather than count of rows
- Fix: Invert logic on shipping ZIP code check in core theme files.
- Fix: Modify behavior in Download CSV functionality to properly convert region IDs to regions.
- Fix: Modify wpsc_update_item_quantity() to listen for wpsc_quantity_update, reverting to $_POST['quantity'] only if it exists.
- Fix: PHP strict warnings.
- Fix: Properly quote SKUs in CSV file.
- Fix: Rename generically named function.
- Fix: Stock and sale price empty values should be preserved.
- Fix: Variation thumbnail size in admin screen.
- Fix: cart is not initialized when some shipping modules are triggered
- Fix: redundant product thumbnail is displayed on category / single product list.
- Fix: variation checkbox column width in WP 3.7.
- Fix: Out of stock message for variations now correctly shows variation of product for the title, rather than main product.
- Fix: Use proper link in checkout for variation products.
- Fix: Return tax information in switchmethod() JS function.
- Fix: Resolve conflict with Advanced Custom Fields on save_post hook for products.
- Fix: Update Bulgarian Currency symbol.
- Fix: Resolve issue where updating pages causes rewrite rule conflicts when pretty permalinks are enabled.
Download this release
Release Info
Developer | JustinSainton |
Plugin | WP eCommerce |
Version | 3.8.13 |
Comparing to | |
See all releases |
Code changes from version 3.8.13.3 to 3.8.13
- readme.txt +1 -15
- wp-shopping-cart.php +1 -1
- wpsc-admin/css/admin.css +6 -7
- wpsc-core/wpsc-constants.php +9 -4
- wpsc-includes/cron.php +7 -28
- wpsc-includes/customer.php +10 -190
- wpsc-includes/page-about.php +136 -0
- wpsc-includes/wpsc-meta-init.php +1 -1
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://getshopped.org
|
|
4 |
Tags: e-commerce, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
|
5 |
Requires at least: 3.7
|
6 |
Tested up to: 3.8
|
7 |
-
Stable tag: 3.8.13
|
8 |
|
9 |
WP e-Commerce is a free WordPress Shopping Cart Plugin that lets customers buy your products, services and digital downloads online.
|
10 |
|
@@ -146,20 +146,6 @@ After upgrading from earlier versions look for link "Update Store". This will up
|
|
146 |
|
147 |
== Changelog ==
|
148 |
|
149 |
-
= 3.8.13.3 =
|
150 |
-
* Fix: Users disappear in Network Admin -> Users page (for multisite)
|
151 |
-
* Fix: User counts are incorrect when there are thousands separators.
|
152 |
-
* Fix: "Save Product Files" button doesn't like being clicked on.
|
153 |
-
|
154 |
-
|
155 |
-
= 3.8.13.2 =
|
156 |
-
* Fix: Anonymous customers should not be visible in admin UI.
|
157 |
-
* Fix: Cronjob to purge anonymous customers doesn't work due to memory issues.
|
158 |
-
* Fix: Anonymous cart items will be lost after signing in.
|
159 |
-
|
160 |
-
= 3.8.13.1 =
|
161 |
-
* Security and maintenance release
|
162 |
-
|
163 |
= 3.8.13 =
|
164 |
|
165 |
* New: Product Media UI.
|
4 |
Tags: e-commerce, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
|
5 |
Requires at least: 3.7
|
6 |
Tested up to: 3.8
|
7 |
+
Stable tag: 3.8.13
|
8 |
|
9 |
WP e-Commerce is a free WordPress Shopping Cart Plugin that lets customers buy your products, services and digital downloads online.
|
10 |
|
146 |
|
147 |
== Changelog ==
|
148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
= 3.8.13 =
|
150 |
|
151 |
* New: Product Media UI.
|
wp-shopping-cart.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WP e-Commerce
|
4 |
* Plugin URI: http://getshopped.org/
|
5 |
* Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://getshopped.org" target="_blank">GetShopped.org</a> | <a href="http://getshopped.org/forums/" target="_blank">Support Forum</a> | <a href="http://docs.getshopped.org/" target="_blank">Documentation</a>
|
6 |
-
* Version: 3.8.13
|
7 |
* Author: Instinct Entertainment
|
8 |
* Author URI: http://getshopped.org/
|
9 |
**/
|
3 |
* Plugin Name: WP e-Commerce
|
4 |
* Plugin URI: http://getshopped.org/
|
5 |
* Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://getshopped.org" target="_blank">GetShopped.org</a> | <a href="http://getshopped.org/forums/" target="_blank">Support Forum</a> | <a href="http://docs.getshopped.org/" target="_blank">Documentation</a>
|
6 |
+
* Version: 3.8.13
|
7 |
* Author: Instinct Entertainment
|
8 |
* Author URI: http://getshopped.org/
|
9 |
**/
|
wpsc-admin/css/admin.css
CHANGED
@@ -846,13 +846,12 @@ div#side-sortables input[type="file"] {
|
|
846 |
}
|
847 |
.select_product_file,
|
848 |
.edit_select_product_file {
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
}
|
856 |
|
857 |
span.select_product_note {
|
858 |
margin: 0 0 5px;
|
846 |
}
|
847 |
.select_product_file,
|
848 |
.edit_select_product_file {
|
849 |
+
margin-bottom:0;
|
850 |
+
margin-top:3px;
|
851 |
+
overflow-x:hidden;
|
852 |
+
overflow-y:auto;
|
853 |
+
position:relative;
|
854 |
+
}
|
|
|
855 |
|
856 |
span.select_product_note {
|
857 |
margin: 0 0 5px;
|
wpsc-core/wpsc-constants.php
CHANGED
@@ -29,9 +29,9 @@ function wpsc_core_constants() {
|
|
29 |
define( 'WPSC_URL', plugins_url( '', __FILE__ ) );
|
30 |
|
31 |
// Define Plugin version
|
32 |
-
define( 'WPSC_VERSION' , '3.8.13
|
33 |
-
define( 'WPSC_MINOR_VERSION' , '
|
34 |
-
define( 'WPSC_PRESENTABLE_VERSION', '3.8.13
|
35 |
define( 'WPSC_DB_VERSION' , 8 );
|
36 |
|
37 |
// Define Debug Variables for developers
|
@@ -256,7 +256,12 @@ function wpsc_core_setup_cart() {
|
|
256 |
if ( 2 == get_option( 'cart_location' ) )
|
257 |
add_filter( 'the_content', 'wpsc_shopping_cart', 14 );
|
258 |
|
259 |
-
$
|
|
|
|
|
|
|
|
|
|
|
260 |
}
|
261 |
|
262 |
/**
|
29 |
define( 'WPSC_URL', plugins_url( '', __FILE__ ) );
|
30 |
|
31 |
// Define Plugin version
|
32 |
+
define( 'WPSC_VERSION' , '3.8.13' );
|
33 |
+
define( 'WPSC_MINOR_VERSION' , 'e8a508c011' );
|
34 |
+
define( 'WPSC_PRESENTABLE_VERSION', '3.8.13' );
|
35 |
define( 'WPSC_DB_VERSION' , 8 );
|
36 |
|
37 |
// Define Debug Variables for developers
|
256 |
if ( 2 == get_option( 'cart_location' ) )
|
257 |
add_filter( 'the_content', 'wpsc_shopping_cart', 14 );
|
258 |
|
259 |
+
$cart = maybe_unserialize( base64_decode( wpsc_get_customer_meta( 'cart' ) ) );
|
260 |
+
|
261 |
+
if ( is_object( $cart ) && ! is_wp_error( $cart ) )
|
262 |
+
$GLOBALS['wpsc_cart'] = $cart;
|
263 |
+
else
|
264 |
+
$GLOBALS['wpsc_cart'] = new wpsc_cart();
|
265 |
}
|
266 |
|
267 |
/**
|
wpsc-includes/cron.php
CHANGED
@@ -3,17 +3,12 @@ add_action( 'wpsc_hourly_cron_task', 'wpsc_clear_stock_claims' );
|
|
3 |
add_action( 'wpsc_hourly_cron_task', '_wpsc_clear_customer_meta' );
|
4 |
|
5 |
/**
|
6 |
-
*
|
7 |
-
*
|
8 |
-
* @since 3.8.9
|
9 |
-
* @access public
|
10 |
-
*
|
11 |
-
* @return void
|
12 |
*/
|
13 |
function wpsc_clear_stock_claims() {
|
14 |
global $wpdb;
|
15 |
|
16 |
-
$time
|
17 |
$interval = get_option( 'wpsc_stock_keeping_interval', 'day' );
|
18 |
|
19 |
// we need to convert into seconds because we're allowing decimal intervals like 1.5 days
|
@@ -23,43 +18,27 @@ function wpsc_clear_stock_claims() {
|
|
23 |
'week' => 604800,
|
24 |
);
|
25 |
|
26 |
-
$seconds = floor( $time * $convert[
|
27 |
|
28 |
$sql = $wpdb->prepare( "DELETE FROM " . WPSC_TABLE_CLAIMED_STOCK . " WHERE last_activity < UTC_TIMESTAMP() - INTERVAL %d SECOND", $seconds );
|
29 |
$wpdb->query( $sql );
|
30 |
}
|
31 |
|
32 |
-
/**
|
33 |
-
* Purges customer meta that is older than WPSC_CUSTOMER_DATA_EXPIRATION on an hourly WP_Cron event.
|
34 |
-
*
|
35 |
-
* @since 3.8.9.2
|
36 |
-
* @access public
|
37 |
-
*
|
38 |
-
* @return void
|
39 |
-
*/
|
40 |
function _wpsc_clear_customer_meta() {
|
41 |
global $wpdb;
|
42 |
|
43 |
require_once( ABSPATH . 'wp-admin/includes/user.php' );
|
44 |
|
45 |
-
$purge_count = 200;
|
46 |
-
|
47 |
$sql = "
|
48 |
SELECT user_id
|
49 |
FROM {$wpdb->usermeta}
|
50 |
WHERE
|
51 |
meta_key = '_wpsc_last_active'
|
52 |
AND meta_value < UNIX_TIMESTAMP() - " . WPSC_CUSTOMER_DATA_EXPIRATION . "
|
53 |
-
LIMIT {$purge_count}
|
54 |
";
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
$ids = $wpdb->get_col( $sql );
|
61 |
-
foreach ( $ids as $id ) {
|
62 |
-
wp_delete_user( $id );
|
63 |
-
}
|
64 |
-
} while ( count( $ids ) == $purge_count );
|
65 |
}
|
3 |
add_action( 'wpsc_hourly_cron_task', '_wpsc_clear_customer_meta' );
|
4 |
|
5 |
/**
|
6 |
+
* wpsc_clear_stock_claims, clears the stock claims, runs using wp-cron and when editing purchase log statuses via the dashboard
|
|
|
|
|
|
|
|
|
|
|
7 |
*/
|
8 |
function wpsc_clear_stock_claims() {
|
9 |
global $wpdb;
|
10 |
|
11 |
+
$time = (float) get_option( 'wpsc_stock_keeping_time', 1 );
|
12 |
$interval = get_option( 'wpsc_stock_keeping_interval', 'day' );
|
13 |
|
14 |
// we need to convert into seconds because we're allowing decimal intervals like 1.5 days
|
18 |
'week' => 604800,
|
19 |
);
|
20 |
|
21 |
+
$seconds = floor( $time * $convert[$interval] );
|
22 |
|
23 |
$sql = $wpdb->prepare( "DELETE FROM " . WPSC_TABLE_CLAIMED_STOCK . " WHERE last_activity < UTC_TIMESTAMP() - INTERVAL %d SECOND", $seconds );
|
24 |
$wpdb->query( $sql );
|
25 |
}
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
function _wpsc_clear_customer_meta() {
|
28 |
global $wpdb;
|
29 |
|
30 |
require_once( ABSPATH . 'wp-admin/includes/user.php' );
|
31 |
|
|
|
|
|
32 |
$sql = "
|
33 |
SELECT user_id
|
34 |
FROM {$wpdb->usermeta}
|
35 |
WHERE
|
36 |
meta_key = '_wpsc_last_active'
|
37 |
AND meta_value < UNIX_TIMESTAMP() - " . WPSC_CUSTOMER_DATA_EXPIRATION . "
|
|
|
38 |
";
|
39 |
|
40 |
+
$ids = $wpdb->get_col( $sql );
|
41 |
+
foreach ( $ids as $id ) {
|
42 |
+
wp_delete_user( $id );
|
43 |
+
}
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
wpsc-includes/customer.php
CHANGED
@@ -4,9 +4,6 @@ add_action( 'wpsc_set_cart_item' , '_wpsc_action_update_customer_last_ac
|
|
4 |
add_action( 'wpsc_add_item' , '_wpsc_action_update_customer_last_active' );
|
5 |
add_action( 'wpsc_before_submit_checkout', '_wpsc_action_update_customer_last_active' );
|
6 |
add_action( 'wp_login' , '_wpsc_action_setup_customer' );
|
7 |
-
add_action( 'load-users.php' , '_wpsc_action_load_users' );
|
8 |
-
add_filter( 'views_users' , '_wpsc_filter_views_users' );
|
9 |
-
add_filter( 'editable_roles' , '_wpsc_filter_editable_roles' );
|
10 |
|
11 |
/**
|
12 |
* Helper function for setting the customer cookie content and expiration
|
@@ -126,10 +123,8 @@ function _wpsc_create_customer_id_cookie( $id, $fake_it = false ) {
|
|
126 |
* @return mixed Return the customer ID if the cookie is valid, false if otherwise.
|
127 |
*/
|
128 |
function _wpsc_validate_customer_cookie() {
|
129 |
-
|
130 |
-
|
131 |
-
return false;
|
132 |
-
}
|
133 |
|
134 |
$cookie = $_COOKIE[ WPSC_CUSTOMER_COOKIE ];
|
135 |
list( $id, $expire, $hash ) = $x = explode( '|', $cookie );
|
@@ -138,25 +133,22 @@ function _wpsc_validate_customer_cookie() {
|
|
138 |
$id = intval( $id );
|
139 |
|
140 |
// invalid ID
|
141 |
-
if ( ! $id )
|
142 |
return false;
|
143 |
-
}
|
144 |
|
145 |
$user = get_user_by( 'id', $id );
|
146 |
|
147 |
// no user found
|
148 |
-
if ( $user === false )
|
149 |
return false;
|
150 |
-
}
|
151 |
|
152 |
$pass_frag = substr( $user->user_pass, 8, 4 );
|
153 |
$key = wp_hash( $user->user_login . $pass_frag . '|' . $expire );
|
154 |
$hmac = hash_hmac( 'md5', $data, $key );
|
155 |
|
156 |
// integrity check
|
157 |
-
if ( $hmac == $hash )
|
158 |
return $id;
|
159 |
-
}
|
160 |
|
161 |
_wpsc_set_customer_cookie( '', time() - 3600 );
|
162 |
return false;
|
@@ -200,20 +192,12 @@ function wpsc_get_current_customer_id() {
|
|
200 |
* @since 3.8.13
|
201 |
*/
|
202 |
function _wpsc_action_setup_customer() {
|
|
|
|
|
|
|
|
|
203 |
// if the customer cookie is invalid, unset it
|
204 |
-
|
205 |
-
|
206 |
-
// if a valid ID is present in the cookie, and the user is logged in,
|
207 |
-
// it's time to merge the carts
|
208 |
-
if ( isset( $_COOKIE[WPSC_CUSTOMER_COOKIE] ) && is_user_logged_in() ) {
|
209 |
-
// merging cart requires the taxonomies to have been initialized
|
210 |
-
if ( did_action( 'wpsc_register_taxonomies_after' ) ) {
|
211 |
-
_wpsc_merge_cart();
|
212 |
-
}
|
213 |
-
else {
|
214 |
-
add_action( 'wpsc_register_taxonomies_after', '_wpsc_merge_cart', 1 );
|
215 |
-
}
|
216 |
-
}
|
217 |
|
218 |
// if this request is by a bot, prevent multiple account creation
|
219 |
_wpsc_maybe_setup_bot_user();
|
@@ -227,64 +211,6 @@ function _wpsc_action_setup_customer() {
|
|
227 |
do_action( 'wpsc_setup_customer' );
|
228 |
}
|
229 |
|
230 |
-
function _wpsc_merge_cart() {
|
231 |
-
$old_id = _wpsc_validate_customer_cookie();
|
232 |
-
|
233 |
-
if ( ! $old_id ) {
|
234 |
-
return;
|
235 |
-
}
|
236 |
-
|
237 |
-
$new_id = get_current_user_id();
|
238 |
-
|
239 |
-
$old_cart = wpsc_get_customer_cart( $old_id );
|
240 |
-
$items = $old_cart->get_items();
|
241 |
-
|
242 |
-
$new_cart = wpsc_get_customer_cart( $new_id );
|
243 |
-
|
244 |
-
// first of all empty the old cart so that the claimed stock and related
|
245 |
-
// hooks are released
|
246 |
-
$old_cart->empty_cart();
|
247 |
-
|
248 |
-
// add each item to the new cart
|
249 |
-
foreach ( $items as $item ) {
|
250 |
-
$new_cart->set_item( $item->product_id, array(
|
251 |
-
'quantity' => $item->quantity,
|
252 |
-
'variation_values' => $item->variation_values,
|
253 |
-
'custom_message' => $item->custom_message,
|
254 |
-
'provided_price' => $item->provided_price,
|
255 |
-
'time_requested' => $item->time_requested,
|
256 |
-
'custom_file' => $item->custom_file,
|
257 |
-
'is_customisable' => $item->is_customisable,
|
258 |
-
'meta' => $item->meta
|
259 |
-
) );
|
260 |
-
}
|
261 |
-
|
262 |
-
require_once( ABSPATH . 'wp-admin/includes/user.php' );
|
263 |
-
wp_delete_user( $old_id );
|
264 |
-
|
265 |
-
_wpsc_set_customer_cookie( '', time() - 3600 );
|
266 |
-
}
|
267 |
-
|
268 |
-
function wpsc_get_customer_cart( $id = false ) {
|
269 |
-
global $wpsc_cart;
|
270 |
-
|
271 |
-
if ( ! empty( $wpsc_cart ) && ( ! $id || $id == wpsc_get_current_customer_id() ) )
|
272 |
-
return $wpsc_cart;
|
273 |
-
|
274 |
-
$cart = maybe_unserialize( base64_decode( wpsc_get_customer_meta( 'cart', $id ) ) );
|
275 |
-
if ( empty( $cart ) || ! $cart instanceof wpsc_cart )
|
276 |
-
$cart = new wpsc_cart();
|
277 |
-
|
278 |
-
return $cart;
|
279 |
-
}
|
280 |
-
|
281 |
-
function wpsc_update_customer_cart( $cart, $id = false ) {
|
282 |
-
if ( ! $id || $id == wpsc_get_current_customer_id() )
|
283 |
-
return wpsc_serialize_shopping_cart();
|
284 |
-
|
285 |
-
return wpsc_update_customer_meta( 'cart', base64_encode( serialize( $wpsc_cart ) ), $id );
|
286 |
-
}
|
287 |
-
|
288 |
/**
|
289 |
* Return the internal customer meta key, which depends on the blog prefix
|
290 |
* if this is a multi-site installation.
|
@@ -548,110 +474,4 @@ function _wpsc_is_bot_user() {
|
|
548 |
|
549 |
// at this point we have eliminated all but the most obvious choice, a human (or cylon?)
|
550 |
return false;
|
551 |
-
}
|
552 |
-
|
553 |
-
/**
|
554 |
-
* Given a users.php view's HTML code, this function returns the user count displayed
|
555 |
-
* in the view.
|
556 |
-
*
|
557 |
-
* If `count_users()` had implented caching, we could have just called that function again
|
558 |
-
* instead of using this hack.
|
559 |
-
*
|
560 |
-
* @access private
|
561 |
-
* @since 3.8.13.2
|
562 |
-
* @param string $view
|
563 |
-
* @return int
|
564 |
-
*/
|
565 |
-
function _wpsc_extract_user_count( $view ) {
|
566 |
-
global $wp_locale;
|
567 |
-
if ( preg_match( '/class="count">\((.+)\)/', $view, $matches ) ) {
|
568 |
-
return absint( str_replace( $wp_locale->number_format['thousands_sep'], '', $matches[1] ) );
|
569 |
-
}
|
570 |
-
|
571 |
-
return 0;
|
572 |
-
}
|
573 |
-
|
574 |
-
/**
|
575 |
-
* Filter the user views so that Anonymous role is not displayed
|
576 |
-
*
|
577 |
-
* @since 3.8.13.2
|
578 |
-
* @access private
|
579 |
-
* @param array $views
|
580 |
-
* @return array
|
581 |
-
*/
|
582 |
-
function _wpsc_filter_views_users( $views ) {
|
583 |
-
if ( isset( $views['wpsc_anonymous'] ) ) {
|
584 |
-
// ugly hack to make the anonymous users not count towards "All"
|
585 |
-
// really wish WordPress had a filter in count_users(), but in the mean time
|
586 |
-
// this will do
|
587 |
-
$anon_count = _wpsc_extract_user_count( $views['wpsc_anonymous'] );
|
588 |
-
$all_count = _wpsc_extract_user_count( $views['all'] );
|
589 |
-
$new_count = $all_count - $anon_count;
|
590 |
-
$views['all'] = preg_replace( '/class="count">\(.+\)/', 'class="count">(' . number_format_i18n( $new_count ) . ')', $views['all'] );
|
591 |
-
}
|
592 |
-
|
593 |
-
unset( $views['wpsc_anonymous'] );
|
594 |
-
return $views;
|
595 |
-
}
|
596 |
-
|
597 |
-
/**
|
598 |
-
* Add the action necessary to filter out anonymous users
|
599 |
-
*
|
600 |
-
* @since 3.8.13.2
|
601 |
-
* @access private
|
602 |
-
*/
|
603 |
-
function _wpsc_action_load_users() {
|
604 |
-
add_action( 'pre_user_query', '_wpsc_action_pre_user_query', 10, 1 );
|
605 |
-
}
|
606 |
-
|
607 |
-
/**
|
608 |
-
* Filter out anonymous users in "All" view
|
609 |
-
*
|
610 |
-
* @since 3.8.13.2
|
611 |
-
* @access private
|
612 |
-
* @param WP_User_Query $query
|
613 |
-
*/
|
614 |
-
function _wpsc_action_pre_user_query( $query ) {
|
615 |
-
global $wpdb;
|
616 |
-
|
617 |
-
// only do this when we're viewing all users
|
618 |
-
if ( ! empty( $query->query_vars['role'] ) )
|
619 |
-
return;
|
620 |
-
|
621 |
-
// if the site is multisite, we need to do things a bit differently
|
622 |
-
if ( is_multisite() ) {
|
623 |
-
// on Network Admin, a JOIN with usermeta is not possible (some users don't have capabilities set, so we fall back to matching user_login, although this is not ideal)
|
624 |
-
if ( empty( $query->query_vars['blog_id'] ) ) {
|
625 |
-
$query->query_where .= " AND $wpdb->users.user_login NOT LIKE '\_________'";
|
626 |
-
} else {
|
627 |
-
$query->query_where .= " AND CAST($wpdb->usermeta.meta_value AS CHAR) NOT LIKE '%" . like_escape( '"wpsc_anonymous"' ) . "%'";
|
628 |
-
}
|
629 |
-
return;
|
630 |
-
}
|
631 |
-
|
632 |
-
$cap_meta_query = array(
|
633 |
-
array(
|
634 |
-
'key' => $wpdb->get_blog_prefix( $query->query_vars['blog_id'] ) . 'capabilities',
|
635 |
-
'value' => '"wpsc_anonymous"',
|
636 |
-
'compare' => 'not like',
|
637 |
-
)
|
638 |
-
);
|
639 |
-
|
640 |
-
$meta_query = new WP_Meta_Query( $cap_meta_query );
|
641 |
-
$clauses = $meta_query->get_sql( 'user', $wpdb->users, 'ID', $query );
|
642 |
-
|
643 |
-
$query->query_from .= $clauses['join'];
|
644 |
-
$query->query_where .= $clauses['where'];
|
645 |
-
}
|
646 |
-
|
647 |
-
/**
|
648 |
-
* Make sure Anonymous role not editable
|
649 |
-
*
|
650 |
-
* @since 3.8.13.2
|
651 |
-
* @param array $editable_roles
|
652 |
-
* @return array
|
653 |
-
*/
|
654 |
-
function _wpsc_filter_editable_roles( $editable_roles ) {
|
655 |
-
unset( $editable_roles['wpsc_anonymous'] );
|
656 |
-
return $editable_roles;
|
657 |
}
|
4 |
add_action( 'wpsc_add_item' , '_wpsc_action_update_customer_last_active' );
|
5 |
add_action( 'wpsc_before_submit_checkout', '_wpsc_action_update_customer_last_active' );
|
6 |
add_action( 'wp_login' , '_wpsc_action_setup_customer' );
|
|
|
|
|
|
|
7 |
|
8 |
/**
|
9 |
* Helper function for setting the customer cookie content and expiration
|
123 |
* @return mixed Return the customer ID if the cookie is valid, false if otherwise.
|
124 |
*/
|
125 |
function _wpsc_validate_customer_cookie() {
|
126 |
+
if ( is_admin() || ! isset( $_COOKIE[ WPSC_CUSTOMER_COOKIE ] ) )
|
127 |
+
return;
|
|
|
|
|
128 |
|
129 |
$cookie = $_COOKIE[ WPSC_CUSTOMER_COOKIE ];
|
130 |
list( $id, $expire, $hash ) = $x = explode( '|', $cookie );
|
133 |
$id = intval( $id );
|
134 |
|
135 |
// invalid ID
|
136 |
+
if ( ! $id )
|
137 |
return false;
|
|
|
138 |
|
139 |
$user = get_user_by( 'id', $id );
|
140 |
|
141 |
// no user found
|
142 |
+
if ( $user === false )
|
143 |
return false;
|
|
|
144 |
|
145 |
$pass_frag = substr( $user->user_pass, 8, 4 );
|
146 |
$key = wp_hash( $user->user_login . $pass_frag . '|' . $expire );
|
147 |
$hmac = hash_hmac( 'md5', $data, $key );
|
148 |
|
149 |
// integrity check
|
150 |
+
if ( $hmac == $hash )
|
151 |
return $id;
|
|
|
152 |
|
153 |
_wpsc_set_customer_cookie( '', time() - 3600 );
|
154 |
return false;
|
192 |
* @since 3.8.13
|
193 |
*/
|
194 |
function _wpsc_action_setup_customer() {
|
195 |
+
// if the user is logged in and the cookie is still there, delete the cookie
|
196 |
+
if ( is_user_logged_in() && isset( $_COOKIE[WPSC_CUSTOMER_COOKIE] ) )
|
197 |
+
_wpsc_set_customer_cookie( '', time() - 3600 );
|
198 |
+
|
199 |
// if the customer cookie is invalid, unset it
|
200 |
+
_wpsc_validate_customer_cookie();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
|
202 |
// if this request is by a bot, prevent multiple account creation
|
203 |
_wpsc_maybe_setup_bot_user();
|
211 |
do_action( 'wpsc_setup_customer' );
|
212 |
}
|
213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
/**
|
215 |
* Return the internal customer meta key, which depends on the blog prefix
|
216 |
* if this is a multi-site installation.
|
474 |
|
475 |
// at this point we have eliminated all but the most obvious choice, a human (or cylon?)
|
476 |
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
477 |
}
|
wpsc-includes/page-about.php
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The template for displaying the About page.
|
4 |
+
*
|
5 |
+
* @package WordPress
|
6 |
+
* @subpackage Twenty_Eleven
|
7 |
+
* @since Twenty Eleven 1.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
get_header(); ?>
|
11 |
+
|
12 |
+
<div class="row-fluid aboutBG our-goal"></div>
|
13 |
+
<div class="container">
|
14 |
+
<div class="row-fluid" id="aboutUs">
|
15 |
+
<div class="header span12">
|
16 |
+
<h4><span class="show">Licensing. Production & Development. Distribution. Marketing & Publicity. Digital & Social Media. Creative Services.</span><span class="hide">Saban Brands</span></h4>
|
17 |
+
</div>
|
18 |
+
<div class="row-fluid">
|
19 |
+
<div class="span2">
|
20 |
+
<ul class="nav nav-pills nav-stacked ">
|
21 |
+
<li class="active"><a href="#">Saban Brands</a></li>
|
22 |
+
<li><a href="#">Power Rangers emPOWER</a></li>
|
23 |
+
<li><a href="#">Paul Frank Arts</a></li>
|
24 |
+
</ul>
|
25 |
+
</div>
|
26 |
+
<script>
|
27 |
+
jQuery( document ).ready(function( $ ) {
|
28 |
+
|
29 |
+
$( 'div.about-section' ).not( ':first' ).hide();
|
30 |
+
|
31 |
+
var show_about_tabs = function( e ) {
|
32 |
+
var $this, $parent, $index, $_index, $_hash;
|
33 |
+
|
34 |
+
if ( e && $( this ).parents( 'ul' ).hasClass( 'nav-stacked' ) ) {
|
35 |
+
|
36 |
+
e.preventDefault();
|
37 |
+
$this = $( this );
|
38 |
+
|
39 |
+
} else if ( window.location.hash ) {
|
40 |
+
|
41 |
+
if ( e ) {
|
42 |
+
$_hash = $( this ).prop( 'hash' );
|
43 |
+
} else {
|
44 |
+
$_hash = window.location.hash;
|
45 |
+
}
|
46 |
+
|
47 |
+
$_index = $( '.about-section.' + $_hash.substring(1) ).index();
|
48 |
+
$this = $( '.nav-stacked li' ).eq( $_index ).find( 'a' );
|
49 |
+
}
|
50 |
+
|
51 |
+
$parent = $this.parent(), $index = $parent.index();
|
52 |
+
|
53 |
+
$( '.nav-stacked li' ).removeClass( 'active' );
|
54 |
+
|
55 |
+
$parent.addClass( 'active' );
|
56 |
+
|
57 |
+
$( '.about-section' ).hide();
|
58 |
+
$( '.about-section' ).eq( $index ).show();
|
59 |
+
|
60 |
+
$( '.aboutBG' ).removeClass().addClass( 'row-fluid aboutBG ' + $( '.about-section' ).eq( $index ).attr( 'class' ).split(' ')[1] );
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
if ( $( 'body' ).hasClass( 'page-id-2' ) ) {
|
65 |
+
$( 'li.first-menu-item ul.dropdown-menu a' ).click( show_about_tabs );
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( window.location.hash ) {
|
69 |
+
show_about_tabs();
|
70 |
+
}
|
71 |
+
|
72 |
+
$( '.nav-stacked li a' ).click( show_about_tabs );
|
73 |
+
|
74 |
+
});
|
75 |
+
</script>
|
76 |
+
<?php while ( have_posts() ) : the_post(); ?>
|
77 |
+
<div class="span10" id="description">
|
78 |
+
<?php
|
79 |
+
the_content();
|
80 |
+
?>
|
81 |
+
</div>
|
82 |
+
<?php endwhile; // end of the loop. ?>
|
83 |
+
<div class="clearfix"></div>
|
84 |
+
</div>
|
85 |
+
</div>
|
86 |
+
<ul class="thumbnails">
|
87 |
+
<?php
|
88 |
+
$logo_src = isset( $brand_meta['brand-logo_url'] ) ? $brand_meta['brand-logo_url'] : '';
|
89 |
+
|
90 |
+
$latest_posts = get_posts( array( 'numberposts' => 3, 'brands' => 'saban-brands', 'meta_query' => array( array( 'key' => '_thumbnail_id', 'value' => '', 'compare' => '!=' ) ) ) );
|
91 |
+
foreach ( $latest_posts as $latest_post ) :
|
92 |
+
?>
|
93 |
+
<li class="span4">
|
94 |
+
<div class="thumbnail">
|
95 |
+
<?php
|
96 |
+
if ( has_post_thumbnail( $latest_post->ID ) )
|
97 |
+
echo get_the_post_thumbnail( $latest_post->ID, 'home-page-news' );
|
98 |
+
|
99 |
+
$link = get_permalink( $latest_post->ID );
|
100 |
+
|
101 |
+
if ( in_category( 'press', $latest_post->ID ) ) {
|
102 |
+
$pdfs = get_posts( array( 'post_parent' => $latest_post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'application/pdf', 'numberposts' => 1 ) );
|
103 |
+
$pdf = wp_get_attachment_url( $pdfs[0]->ID );
|
104 |
+
|
105 |
+
$link = $pdf ? $pdf : $link;
|
106 |
+
}
|
107 |
+
|
108 |
+
?>
|
109 |
+
<div class="copy">
|
110 |
+
<h3><?php echo get_the_title( $latest_post->ID ); ?></h3>
|
111 |
+
<p><?php echo wp_trim_words( $latest_post->post_content, 16 ); ?></p>
|
112 |
+
<a class="btn" href="<?php echo esc_url( $link ); ?>">read Article</a></div>
|
113 |
+
</div>
|
114 |
+
</li>
|
115 |
+
<?php endforeach; ?>
|
116 |
+
|
117 |
+
</ul><p></p>
|
118 |
+
|
119 |
+
<!--We Love it Here Row-->
|
120 |
+
|
121 |
+
<div class="row-fluid" id="weLoveItHere">
|
122 |
+
<div class="header span12">
|
123 |
+
<h4>We Love it Here</h4>
|
124 |
+
</div>
|
125 |
+
|
126 |
+
<?php
|
127 |
+
if ( is_active_sidebar( 'footer-content' ) ) :
|
128 |
+
dynamic_sidebar( 'footer-content' );
|
129 |
+
endif;
|
130 |
+
?>
|
131 |
+
</div>
|
132 |
+
|
133 |
+
<!--End We Love it Here Row-->
|
134 |
+
</div>
|
135 |
+
|
136 |
+
<?php get_footer(); ?>
|
wpsc-includes/wpsc-meta-init.php
CHANGED
@@ -122,7 +122,7 @@ function wpsc_meta_migrate( $meta_object_type ) {
|
|
122 |
|
123 |
foreach ( $old_meta_rows as $old_meta_row ) {
|
124 |
$meta_data = maybe_unserialize( $old_meta_row->meta_value );
|
125 |
-
add_metadata(
|
126 |
}
|
127 |
}
|
128 |
|
122 |
|
123 |
foreach ( $old_meta_rows as $old_meta_row ) {
|
124 |
$meta_data = maybe_unserialize( $old_meta_row->meta_value );
|
125 |
+
add_metadata( $meta_object_type, $old_meta_row->object_id, $old_meta_row->meta_key, $meta_data, false );
|
126 |
}
|
127 |
}
|
128 |
|