[wp-trac] [WordPress Trac] #62570: Fatal error: call to undefined function wp_cache_get() (in option.php)
WordPress Trac
noreply at wordpress.org
Tue Nov 26 06:38:09 UTC 2024
#62570: Fatal error: call to undefined function wp_cache_get() (in option.php)
-----------------------------+-----------------------------
Reporter: dugwood | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Upgrade/Install | Version: 6.7.1
Severity: major | Keywords:
Focuses: |
-----------------------------+-----------------------------
Hello,
I've read a lot of issues about the missing `wp_cache_get()` function in
some cases. And I think I've found some clues.
First, the website must be in Maintenance mode. I've seen a lot of reports
on StackOverflow or the like with « upgrading », which is done after
enabling the maintenance mode. When this happens, `the wp-settings.php`
will stop early, avoiding the cache to be loaded.
But plugins, notably the translation plugins, are loaded. And many rely on
cache to be present.
One way to deal with this, as we are in maintenance, so degraded status,
is to load the default cache functions.
Using WordPress 6.7.1 it should be around line 383 in `wp-
includes/load.php`:
{{{#!php
<?php
require_once ABSPATH . WPINC . '/functions.php';
wp_load_translations_early();
}}}
Which may be changed as:
{{{#!php
<?php
require_once ABSPATH . WPINC . '/functions.php';
require_once ABSPATH . WPINC . '/cache.php';
wp_load_translations_early();
}}}
This way the translation plugins called in `wp_load_translations_early()`
would work as expected.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62570>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list