Skip to main content

WithWine Wordpress Plugin Change Log

1.3.24​

  • Added "Cart Link CSS Class", "Login / Logout Link CSS Class" and "Register Link CSS Class" settings (in Wordpress Admin > Settings > WithWine). These classes are applied to the link element directly, which can be used to match any existing menu link classes applied by your theme.
  • The XSRF token endpoint (/wp-json/withwine/xsrf/token) now responds with Cache-Control: private, max-age=30 instead of only max-age=30, so CDNs (eg: CloudFlare, CloudFront) or caching tools can use the Cache-Control: private header to ignore caching.
  • The plugin now tells caches not to store any response that is specific to a logged in customer. Previously some of these (such as API requests sent via the Wordpress server, and /auth/refresh) were sent without any caching instructions, which could allow a CDN or caching plugin to cache them by default. See "Important Page Cache Exceptions" in the README for how these headers can be used with your CDN.
  • Pages viewed by a logged in customer are now only marked as uncacheable when the plugin actually renders customer-specific content on the server, ie: when "Allow Authenticated Server Requests" is enabled globally or via allow_authenticated_server_requests='true' on a shortcode on that page. Previously every page viewed by a logged in customer was marked as uncacheable.

1.3.23​

  • Added a withwine_remote_server() PHP function so theme and plugin developers can call the WithWine API directly from PHP code via get_widget_json(). See "Calling the WithWine API from PHP" in the README.
  • Templating: filter() can now match null values, including fields explicitly set to null and fields missing from an item (previously such items could never match), eg filter(data, 'range', null) or filter(data, 'range', '!=', null).
  • POTENTIALLY BREAKING CHANGE: Templating comparisons against null are now strict — null only equals null. Previously PHP loose comparison meant null compared equal to 0, '' and false (eg {{if nullField = ''}} was true, and filter(items, 'price', 0) matched items with a null price). Ordering comparisons (>, >=, <, <=) against null now never match.

1.3.22​

  • POTENTIALLY BREAKING CHANGE: When "Use Direct API Requests to WithWine" is unchecked, API requests sent via the Wordpress server will be routed through /wp-json/withwine instead of ?rest_route=/withwine. This may impact any custom firewall or caching rules that directly reference ?rest_route=/withwine.
  • Reduce scope of Session ID cookie to /wp-json/withwine/ instead of /

1.3.21​

  • Allow /product/ and /spirit/ url prefixes as an alternative to /products/ and /spirits/

1.3.20​

  • Added conditional blocks ({{if}}/{{elseif}}/{{else}}), {{foreach as}} alias syntax, markdown output format, and composable functions (array, math, string, logic) to the templating syntax. See README for full documentation.

1.3.19​

  • Improved login reliability by automatically retrying once if authentication fails during the LoginCallback step. This prevents transient failures while avoiding retry loops caused by configuration issues.
  • Improved login and logout stability by isolating OIDC nonce handling into a dedicated cookie (WithWine_Oidc_Nonce), ensuring nonce values are only issued during active authentication flows.
  • Fixed an issue where users were not always fully logged out in certain cases.

1.3.18​

  • Fix bug where "Use Direct API Requests to WithWine" setting doesn't work after toggling it off and on again

V1.3.17​

  • Use SameSite=None for the WithWine_SessionId cookie which is used for nonce generation. This cookie is used when the login server performs a POST to /LoginCallback so this change is to make sure the cookie is sent.

V1.3.16​

  • Move rendering of WithWine components JS and CSS to the head instead of at the end of the body so that the CSS has been loaded for server-rendered HTML.
  • By default, use CORS for client-side API requests so that they go directly to the WithWine API instead of being sent via the Wordpress server. This is more perfromant but requires the WithWine login cookie to be accessible via JavaScript. You can disable this in the Wordpress > Settings > WithWine > Use Direct API Requests to WithWine.
  • Fix issue with withwine api shortcode when accessing arrays using an index of 0 or arrayhasatleast='0'

V1.3.15​

  • When checking for WithWine URLs such as /user/login and /products, use the Wordpress > General Settings > Site Address (URL) to determine the base URL in case the plugin is installed in a subdirectory

V1.3.14​

  • Log to error_log when the login callback's state/nonce fails verification
  • Log to error_log when XSRF token fails validation for rest_route URLs
  • Add support for counting arrays when using the templating syntax eg: {{cnt arrayProperty.property}}

V1.3.13​

  • Add format string support for templating syntax (handlebars). eg: {{propertyName json}} {{propertyName.subPropertyName raw}}. See the README.md for more details.
  • BREAKING CHANGE: The default encoding for templating syntax (handlebars) is now html instead of json_unquoted. This may affect Google Structured Data or any custom JavaScript that relies on the default encoding. See the README.md for updated examples.

V1.3.12​

  • Add documentation for join-mailing-list shortcode's data_conversiontag attribute
  • Add options for cart tax and surcharge line items to WithWine plugin settings to allow customisation of how these are displayed

V1.3.11​

  • Add documentation for the menu-cart-link shortcode
  • HTML decode all shortcode attributes used in withwine and withwineapi shortcodes (because shortcode attribute values cannot have escaped characters)

V1.3.10​

  • Fixes login flow when the WithWine plugin settings Wordpress Website Base URL differs from the Wordpress site URL. Login flow will now use the URL from WithWine plugin settings
  • Defaults to the Wordpress site URL when the WithWine plugin settings Wordpress Website Base URL is an empty string
  • Changes the JavaScript initialisation of session storage for WithWine_User_State and WithWine_Widgets to be encapsulated in withwineInitUserStateSessionStore() and withwineInitWidgetsSessionStore() functions

V1.3.9​

  • SECURITY RELEASE: Ensure Wordpress generates unique "nonce" codes for unauthenticated users for XSRF and OIDC state verification
  • Remove ID token from cookies because it isn't required and unnecessarily increases the overall cookie size
  • If the server is unable to reach components.withwine.com, log it to the error log instead of throwing an error

V1.3.8​

  • Cart version selection and other cart settings available in Wordpress Admin > Settings > WithWine
  • Increased timeout on API requests in case of any slower responses such as outliers or if there is a degredation of service

V1.3.7​

  • Changed WithWine_User_State to be set via a cookie instead of written directly into the page to avoid issues when the page is cached

V1.3.6​

  • Fixes some syntax errors for PHP 7.2
  • Fixes a bug that excluded authorisation when needed for certain API calls
  • Added my-account shortcodes to widget builder
  • Added support for server-side rendering of shortcodes customised for the currently logged in user (previously this was only available after the page had loaded)
  • Xsrf token implementation fix for when a Wordpress user is logged into Wordpress

v1.3.5​

  • SECURITY RELEASE: Include Cross Site Request Forgery protection for all WithWine API requests
    • If you use page caching on any page, token verification will return errors when using WithWine components on those pages. You can use a header-exists check by unchecking "Verify Xsrf Token" in the settings page.
    • The origin header is now also explicitly checked against Wordpress' list of allowed origins in case the server implementation allows requests. The allowed origin list can be modified using Wordpress' allowed_http_origins filter hook.
  • Support for returning a 404 status code or redirecting users if no data is returned from the WithWine API, this can be achieved by adding the set_not_found_status attribute to the shortcode and optionally setting the not_found_redirect attribute to either true or a selected Page ID to redirect to. and set_not_found_status=true
  • Added documentation for Club Sign Up Wizard
  • Added some "getting started" notes
  • Added an option to the settings page for the Gray 6 text colour

v1.3.4​

  • Widget Containers in settings (Cart, Login and Registration Links) can now accept multiple IDs

v1.3.3​

  • Fixed caching of refresh endpoint response

v1.3.2​

  • Allow use of <title> tag inside Withwine api shortcode with head attribute

v1.3.0​

  • Reverted to the original approach on how shortcodes are rendered
  • Shortcodes with _compat are now deprecated
  • Fixed set_page_title

v1.2.12-v1.2.14​

  • Fixes for refresh token on PHP versions pre 7.2
  • Fixes for template fields. If a value is a string, use json_encode and trim the extra double quotes

v1.2.11​

  • Added refresh token handling for auto-refreshing the login and keeping sessions fresh
  • Template fields will now always be encoded using json_encode, regardless of whether they are scalar or not

v1.2.10​

  • Added withwine_compat and withwineapi_compat compatibility modes to allow other plugins (such as Elementor) to render the widgets normally

v1.2.8​

  • Added new admin option Tasting Menu Product List Page Template ID to map the product list ID to the product-list widget varieties

v1.2.7​

  • Changed product ID support to work for any widget type that starts with "product-" but not "product-list" (This will enable support for "product variation"-related components and should future proof the need to upgrade the plugin for new product components)
  • Added a "widget type" CSS class to widget containers so they can be targeted more easily with custom styles
  • Added documentation for product variations

v1.2.6​

  • Fixed bug where POST requests with a large body were failing
  • Fixed Wordpress' "doing it wrong" response header in requests
  • Fixed typo in readme

v1.2.5​

  • fixed showif / hideif checking for truthiness, again
  • added {{$self}} to access the current object

v1.2.4​

  • fixed showif / hideif checking for truthiness

v1.2.3​

  • Added Global Widget Version settings.
  • Saving the settings will now nuke the cache for that Brand Id / Client Id.
  • Shortcodes can add version="[VERSION NUMBER]" as widget's attribute to overwrite the global version setting.

v1.2.2​

  • Added additional any / all conditional attributes with showIf / hideIf, added arrayhasatleast.

v1.2.1​

  • Added admin option to disable try/like (tasting) bar

v1.2.0​

  • Added templating syntax which allows to access the API result and / or transform the shortcode's content.
  • Added schema attribute.
  • Added head attribute.

v1.1.6​

  • Added ability to format api values using a "PHP sprintf format string" in the renderformat attribute.
  • Catch API errors when not in debug mode so the page still renders. You can use define( 'WP_DEBUG_LOG', true ); to see errors in a log file or define( 'WP_DEBUG', true ); to see errors on the page (more info available from Wordpress Support).

v1.1.5​

  • Support for try/like bar

v1.1.4​

  • Added no-cache headers to paths used directly by the plugin to hint to CDNs not to cache them in case CDNs are unintentionally configuraed to include these endpoints

v1.1.2​

  • Added product-price type for withwine shortcode for displaying the price for the current user.
  • Added conditional-content type for withwine shortcode for displaying content or log in/out links based on the logged in status of the user

v1.1.1​

  • Added option to prevent deletion of settings when uninstalling the plugin. This will make it easier to upgrade.

v1.1.0​

  • Updated documentation for product list support. Changed itemname=* attribute on [withwine type='item'] to sourceitem=*

10 August 2020​

  • Support for rendering API data via the withwineapi shortcode
  • Added Register and Login links instead of just Login link

29 May 2020​

  • Option to set the page title from widgets
  • Selecting star colour for product award ratings
  • Support for un-trying and un-liking products
  • Instead of using the attribute data with a JSON value, specify these options as multiple attributes prefixed with data_. **

**The README has been updated to reflect this. The new version of the plugin is backwards compatible with the data attribute. Previous versions of the plugin can replace attributes that start with data_ by specifying them in JSON format in a "data" attribute (as was done previously). For example: data{ "product_id":"123", "pricing": { "display": "singlePrice", "decimals": "2" }, "carrot": { "text": "Club Members save 15%" } }