The notice for timing for text domain loading in WP 6.7 and later was addressed in the Pods core plugin, so unless the requirement has regressed, the most likely cause would be an additional plugin or custom code which initializes Pods without using a hook or filter
For example, hook init with priority 20 should be fine, while code put into a plugin or theme without an action or filter wrapping it could cause the notice.
The message doesn’t have any functional repercussions at this time, other than writing to the logs.
@nfong I covered all of the known cases. It sounds like you found one other weird case that may have been difficult to find.
Here’s what I usually have to do to track down the real source and since you are already modifying your WP core files it sounds like you could do this too. I was doing this on my local installation so it didn’t matter too much but you can do this on your staging if you see it there too.
In the function _load_textdomain_just_in_time within wp-includes/l10n.php, right before the _doing_it_wrong() call — you can add $backtrace = json_encode( array_splice( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), 3, -4 ), JSON_PRETTY_PRINT );
Then I just add that content to the end of the second argument in _doing_it_wrong to append the debug message. This should get you the additional information you need here.
Thread Starter
nfong
(@nfong)
Thanks for the suggestion. backtrace found the culprit: Cpanel’s wp-toolkit daily task, so this will affect others.
....
{
"file": "\/home\/a2076\/test.server.com\/wp-content\/plugins\/pods\/classes\/PodsInit.php",
"line": 2505,
"function": "pods_container_register_service_provider"
},
{
"file": "\/home\/a2076\/test.server.com\/wp-includes\/class-wp-hook.php",
"line": 341,
"function": "run",
"class": "PodsInit",
"type": "->"
},
{
"file": "\/home\/a2076\/test.server.com\/wp-includes\/class-wp-hook.php",
"line": 365,
"function": "apply_filters",
"class": "WP_Hook",
"type": "->"
},
{
"file": "\/home\/a2076\/test.server.com\/wp-includes\/plugin.php",
"line": 522,
"function": "do_action",
"class": "WP_Hook",
"type": "->"
},
{
"file": "\/home\/a2076\/test.server.com\/wp-settings.php",
"line": 593,
"function": "do_action"
},
{
"file": "\/usr\/local\/cpanel\/3rdparty\/wp-toolkit\/plib\/vendor\/wp-cli\/vendor\/wp-cli\/wp-cli\/php\/WP_CLI\/Runner.php",
"line": 1394,
"args": [
"\/home\/a2076\/test.server.com\/wp-settings.php"
],
"function": "require"
},
{
"file": "\/usr\/local\/cpanel\/3rdparty\/wp-toolkit\/plib\/vendor\/wp-cli\/vendor\/wp-cli\/wp-cli\/php\/WP_CLI\/Runner.php",
"line": 1313,
"function": "load_wordpress",
"class": "WP_CLI\\Runner",
"type": "->"
},
{
"file": "\/usr\/local\/cpanel\/3rdparty\/wp-toolkit\/plib\/vendor\/wp-cli\/vendor\/wp-cli\/wp-cli\/php\/WP_CLI\/Bootstrap\/LaunchRunner.php",
"line": 28,
"function": "start",
"class": "WP_CLI\\Runner",
"type": "->"
},
{
"file": "\/usr\/local\/cpanel\/3rdparty\/wp-toolkit\/plib\/vendor\/wp-cli\/vendor\/wp-cli\/wp-cli\/php\/bootstrap.php",
"line": 84,
"function": "process",
"class": "WP_CLI\\Bootstrap\\LaunchRunner",
"type": "->"
}
Thread Starter
nfong
(@nfong)
This warning shows up only on staging server that does not get any traffic. On our production server it works fine.