Skip to content

Commit

Permalink
There will be no sessions retrieved while WordPress setup is due.
Browse files Browse the repository at this point in the history
  • Loading branch information
seb86 committed Dec 18, 2023
1 parent 0a77f9f commit fce7910
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/class-cocart-session-handler.php
Expand Up @@ -635,6 +635,11 @@ public function cleanup_sessions() {
public function get_cart( $cart_key, $default = false ) {
global $wpdb;

// There will be no sessions retrieved while WordPress setup is due.
if ( defined( 'WP_SETUP_CONFIG' ) ) {
return false;
}

// Try to get it from the cache, it will return false if not present or if object cache not in use.
$value = wp_cache_get( $this->get_cache_prefix() . $cart_key, COCART_CART_CACHE_GROUP );

Expand Down

0 comments on commit fce7910

Please sign in to comment.