skip to Main Content

After updating to WordPress 6.7, I’m receiving the following PHP notice on my website. How can I resolve this issue?

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the blahblah domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /wp-includes/functions.php on line 6114

2

Answers


  1. Chosen as BEST ANSWER

    If You're a Website Owner

    1. Try updating your themes and plugins, as the issue may already have been resolved by the developers.
    2. If the problem persists, report the issue to the plugin or theme authors so they can address it in a future update.
    3. To identify the plugin or theme causing the error, look for the text domain mentioned in the error message. For example, in the following message, blahblah is the text domain:

    Translation loading for the blahblah domain.

    If You're a Plugin / Theme Author

    Check your textdomain registration code and make sure the function is set to init hook or later. By textdomain registration code I mean the load_textdomain, load_plugin_textdomain, or load_theme_textdomain functions.

    For example the following code is wrong and should get fixed.

    add_action('plugins_loaded', function()
    {
        load_plugin_textdomain('your-textdomain', false, '/path/to/your/plugin/languages/')
    });
    

    The following code is the correct one:

    add_action('init', function()
    {
        load_plugin_textdomain('your-textdomain', false, '/path/to/your/plugin/languages/')
    });
    

  2. Lots of plugins are seeing this error NOT caused by incorrect text domain loading, but by other WordPress functions.

    My plugin was using ‘get_plugin_data’ and getting was this error. I am still seeing it for other WP functions.

    I replaced ‘get_plugin_data’ with

    $plugin_data = get_file_data(ABSPATH . 'wp-content/plugins/bbpress/bbpress.php', array('Version' => 'Version'), false);
    

    as a workaround.

    But major plugins such as woocommerce (8 million installations)and really simple security (4 million installations) are seeing issues, and I gather it has been raised for a WP fix, rather than forcing plugin authors to work round it.

    https://developer.woocommerce.com/2024/11/11/developer-advisory-translation-loading-changes-in-wordpress-6-7/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search