litespeedtech / litespeedtech/lscache_wp
PHP Fatal error: Uncaught Error: Call to undefined function LiteSpeed\__()
- Dominant language
- PHP
- Stars
- 257
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
We have object cache setup via Redis.
We just hit the memory limit for Redis set on the server and saw intermittent fatal errors throughout the site.
Then an intermittent warning in the WordPress admin area:
Redis encountered a fatal error: OOM command not allowed when used memory > 'maxmemory'. (code: 0)
The site is a WordPress multisite install, running WordPress 6.9 and Litespeed version 7.8.0.1
I re-generated the object-cache.php drop-in and it was current and up-to date.
Litespeed is enabled on the network level.
These errors references below don't match the functions in 7.8.0.1 - so wandering if perhaps they were cached themselves.
The stack trace is below:
`[14-Apr-2026 09:57:54 UTC] PHP Fatal error: Uncaught Error: Call to undefined function LiteSpeed\__() in /home/public_html/wp-content/plugins/litespeed-cache/src/object-cache.cls.php:708
Stack trace:
#0 /home/public_html/wp-content/plugins/litespeed-cache/src/object-cache-wp.cls.php(440): LiteSpeed\Object_Cache->set()
#1 /home/public_html/wp-content/plugins/litespeed-cache/src/object.lib.php(157): WP_Object_Cache->set()
#2 /home/public_html/wp-includes/cache-compat.php(247): wp_cache_set()
#3 /home/public_html/wp-includes/class-wp-site-query.php(373): wp_cache_set_salted()
#4 /home/public_html/wp-includes/class-wp-site-query.php(272): WP_Site_Query->get_sites()
#5 /home/public_html/wp-includes/ms-site.php(448): WP_Site_Query->query()
#6 /home/public_html/wp-includes/ms-load.php(257): get_sites()
#7 /home/public_html/wp-includes/ms-load.php(322): get_site_by_path()
#8 /home/public_html/wp-includes/ms-settings.php(77): ms_load_current_site_and_network()
#9 /home/public_html/wp-settings.php(159): require('/home/kintzing/...')
#10 /home/public_html/wp-config.php(119): require_once('/home/kintzing/...')
#11 /home/public_html/wp-load.php(50): require_once('/home/kintzing/...')
#12 /home/public_html/wp-blog-header.php(13): require_once('/home/kintzing/...')
#13 /home/public_html/index.php(17): require('/home/kintzing/...')
#14 {main}
thrown in /home/public_html/wp-content/plugins/litespeed-cache/src/object-cache.cls.php on line 708`
Claude is suggesting, beyond the code being cached - that the issue is the string translation on line 708:
The file declares namespace LiteSpeed; at the top. In PHP, when you call a non-fully-qualified function inside a namespace, PHP looks for LiteSpeed\__() first. For user-defined functions (like WordPress's __()), there is no fallback to global scope — unlike built-in PHP functions. So __() on line 708 should be \__() with a leading backslash to explicitly target the global namespace.
`$msg = sprintf( __( 'Redis encountered a fatal error: %1$s (code: %2$d)', 'litespeed-cache' ), $ex->getMessage(), $ex->getCode() );
`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at src/object-cache.cls.php:708 and trace the call from src/object-cache-wp.cls.php:440 while reviewing the Redis maxmemory warning and the multisite context. Check whether the reported undefined function is caused by the namespaced translation call or stale generated code, and confirm that the Redis failure no longer produces a fatal error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, redis, wordpress
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100