get_session() attempts to cache a session even if it is already expired.
The code used passes negative expiry seconds to wp_cache_add if the session expired in the past:
wp_cache_add( $this->get_cache_prefix() . $customer_id, $value, WC_SESSION_CACHE_GROUP, $this->_session_expiration - time() );
Depending on the caching layers used this will give errors in the logs such as:
ERR invalid expire time in setex in /var/www/html/wp-content/plugins/redis-cache/includes/predis/src/Client.php:370
as reported on: https://wordpress.org/support/topic/error-when-trying-to-get-a-get-a-cache-not-available/
* fix the coupon usage limit issue
* fix the if condition for the usage limit
* fixed coding standard
* fix the if conditions for coupon usage limit per user
If rating is not mandatory on comments, generate_product_data() produces incorrect output.
For example items with comments but no reviews are output with rating of zero which is getting flagged in google webmasters tools under the heading "Rating is missing required best and/or worst values".
The output google is objecting to is eg:
"aggregateRating":{"@type":"AggregateRating","ratingValue":"0","reviewCount":1}}
postmeta in this case is:
_wc_average_rating 0
_wc_rating_count 0.0
_wc_review_count 1
product lookup table is reporting
rating_count 0
average_rating 0.00
the meta is correct and reflected in the product object, it is the test that is wrong since
if $product->get_review_count()
may be true even if there are no ratings.
This is solved by substituting get_rating_count() which has the correct number of ratings.
This commit simply removes an extra comma that was added in
52fced8d7a to prevent issues with older
versions of IE. I found this when running grunt to prepare the 3.6.4
release:
```
Running "jshint:all" (jshint) task
assets/js/admin/meta-boxes-order.js
413 | user_email : user_email,
^ Extra comma. (it breaks older versions of IE)
```
We might want to add jshint to the pre-commit hook and to Travis.
* Add functionality to wp-admin order to check for coupon usage based on email addresses, similar to how WC_Cart handles this seperately, included unit tests.
* Only do the coupon by email usage check if order is from a guest. Fix issue with unit test.
Different server configurations can require different paths to be sent and it isn't always possible for a plugin to know the correct path for a platform.
These filters will allow a hosting provider to install a platform level configuration via an `mu-plugin` to make sure things work in there configuration.