ay( $values ); $expire = $this->ttl_to_seconds( $ttl ); $results = wp_cache_set_multiple( $values_array, self::CACHE_GROUP, $expire ); // Return true only if all operations succeeded. return ! in_array( false, $results, true ); } /** * Deletes multiple cache items in a single operation. * * @since 7.0.0 * * @param iterable $keys A list of string-based keys to be deleted. * @return bool True if the items were successfully removed. False if there was an error. */ public function deleteMultiple( $keys ): bool { $keys_array = $this->iterable_to_array( $keys ); $results = wp_cache_delete_multiple( $keys_array, self::CACHE_GROUP ); // Return true only if all operations succeeded. return ! in_array( false, $results, true ); } /** * Determines whether an item is present in the cache. * * @since 7.0.0 * * @param string $key The cache item key. * @return bool True if the item exists in the cache, false otherwise. */ public function has( $key ): bool { $found = false; wp_cache_get( $key, self::CACHE_GROUP, false, $found ); return (bool) $found; } /** * Converts a PSR-16 TTL value to seconds for WordPress cache functions. * * @since 7.0.0 * * @param null|int|DateInterval $ttl The TTL value. * @return int The TTL in seconds, or 0 for no expiration. */ private function ttl_to_seconds( $ttl ): int { if ( null === $ttl ) { return 0; } if ( $ttl instanceof DateInterval ) { $now = new DateTime(); $end = ( clone $now )->add( $ttl ); return $end->getTimestamp() - $now->getTimestamp(); } return max( 0, (int) $ttl ); } /** * Converts an iterable to an array. * * @since 7.0.0 * * @param iterable $items The iterable to convert. * @return array The array. */ private function iterable_to_array( $items ): array { if ( is_array( $items ) ) { return $items; } return iterator_to_array( $items ); } }
Fatal error: Uncaught Error: Class "WP_AI_Client_Cache" not found in /htdocs/emploitogo.info/wp-settings.php:476 Stack trace: #0 /htdocs/emploitogo.info/wp-config.php(112): require_once() #1 /htdocs/emploitogo.info/wp-load.php(50): require_once('/htdocs/emploit...') #2 /htdocs/emploitogo.info/wp-blog-header.php(13): require_once('/htdocs/emploit...') #3 /htdocs/emploitogo.info/index.php(17): require('/htdocs/emploit...') #4 {main} thrown in /htdocs/emploitogo.info/wp-settings.php on line 476