Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in /home/tbolleke/public_html/index.php on line 11
Notice: Undefined index: HTTP_REFERER in /home/tbolleke/public_html/index.php on line 12
decode( wp_remote_retrieve_body( $response ), true ) ?? [];
// Find all `welcome_page` incentives.
$incentives = array_filter(
$results,
function( $incentive ) {
return 'welcome_page' === $incentive['type'];
}
);
// Use the first found matching incentive or empty array if none was found.
// Store incentive in the in-memory cache.
$this->incentive = empty( $incentives ) ? [] : reset( $incentives );
}
// Skip transient cache if `cache-for` header equals zero.
if ( '0' === $cache_for ) {
// If we have a transient cache that is not expired, delete it so there are no leftovers.
if ( false !== $cache ) {
delete_transient( self::CACHE_TRANSIENT_NAME );
}
return $this->incentive;
}
// Store incentive in transient cache (together with the context hash) for the given number of seconds
// or 1 day in seconds. Also attach a timestamp to the transient data so we know when we last fetched.
set_transient(
self::CACHE_TRANSIENT_NAME,
[
'incentive' => $this->incentive,
'context_hash' => $store_context_hash,
'timestamp' => time(),
],
! empty( $cache_for ) ? (int) $cache_for : DAY_IN_SECONDS
);
return $this->incentive;
}
/**
* Generate a hash from the store context data.
*
* @param array $context The store context data.
*
* @return string The context hash.
*/
private function generate_context_hash( array $context ): string {
// Include only certain entries in the context hash.
// We need only discrete, user-interaction dependent data.
// Entries like `active_for` have no place in the hash generation since they change automatically.
return md5(
wp_json_encode(
[
'country' => $context['country'] ?? '',
'locale' => $context['locale'] ?? '',
'has_orders' => $context['has_orders'] ?? false,
'has_payments' => $context['has_payments'] ?? false,
'has_wcpay' => $context['has_wcpay'] ?? false,
]
)
);
}
}
Warning: Class 'Automattic\WooCommerce\Internal\Admin\WcPayWelcomePage' not found in /home/tbolleke/public_html/wp-content/plugins/woocommerce/src/Admin/Features/Features.php on line 377 Pagina niet gevonden – Opi 's BakHuis