Bit Form Pro – Cache Key Empty String Warning
Issue Summary
On our development environment (WordPress 6.7.2, PHP 8.2), we are seeing the following warning at the top of the Bit Forms admin page:
Notice: Function WP_Object_Cache::add was called incorrectly. Cache key must not be an empty string. Please see Debugging in WordPress for more information. (This message was added in version 6.1.0.) in /Users/chrisconlee/Documents/pifster.local/wp-includes/functions.php on line 6121
Steps to Reproduce
-
Log in to WordPress admin.
-
Navigate to the Bit Forms admin page.
-
The above notice appears at the top of the page.
Environment
-
WordPress Version: 6.7.2
-
PHP Version: 8.2
-
Bit Form Pro Version: 2.12.6 (standard version 218.8)
-
Theme: Breakdance Zero Child
Debugging Actions Taken
-
Enabled
WP_DEBUG
andWP_DEBUG_LOG
inwp-config.php
. -
Added a temporary shutdown handler to capture a stack trace when the warning occurs.
Captured Notice and Stack Trace
[01-May-2025 18:34:10 UTC] PHP Notice: Function WP_Object_Cache::add was called incorrectly. Cache key must not be an empty string. Please see Debugging in WordPress for more information. (This message was added in version 6.1.0.) in /Users/chrisconlee/Documents/pifster.local/wp-includes/functions.php on line 6121
[01-May-2025 18:34:11 UTC] === WP_Object_Cache::add Stack Trace ===
[01-May-2025 18:34:11 UTC] #0 /Users/chrisconlee/Documents/pifster.local/wp-includes/class-wp-hook.php(324): {closure}('')
#1 /Users/chrisconlee/Documents/pifster.local/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#2 /Users/chrisconlee/Documents/pifster.local/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /Users/chrisconlee/Documents/pifster.local/wp-includes/load.php(1304): do_action('shutdown')
#4 [internal function]: shutdown_action_hook()
[01-May-2025 18:34:11 UTC] === End Stack Trace ===
Additional Notes
-
The stack trace was captured using a shutdown handler in the theme’s
functions.php
. -
No additional plugin or theme code is referenced in the trace, so the original source of the empty cache key is not visible.
-
The issue does not appear to break site functionality, but it does indicate a bug in plugin or theme code using
wp_cache_add()
(or similar) with an empty string as the cache key.
Request
-
Please advise on how to further trace the origin of this warning, or provide a patch to ensure all cache keys are non-empty when using WordPress object cache functions.
-
Let us know if you need more information or if you would like us to test a debug version for deeper tracing.
Prepared by the PIFster development team – May 1, 2025