Since the last WP update I have this lines very often in my error PHP log file :
[15-Nov-2024 07:57:02 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>simple-history</code> 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 <code>init</code> action or later. Please see <a href=”https://developer.ww.wp.xz.cn/advanced-administration/debug/debug-wordpress/”>Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /home/mofr4003/public_html/wp-includes/functions.php on line 6114
[15-Nov-2024 07:57:02 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>simple-history</code> 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 <code>init</code> action or later. Please see <a href=”https://developer.ww.wp.xz.cn/advanced-administration/debug/debug-wordpress/”>Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /home/mofr4003/public_html/wp-includes/functions.php on line 6114
[15-Nov-2024 10:12:01 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>simple-history</code> 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 <code>init</code> action or later. Please see <a href=”https://developer.ww.wp.xz.cn/advanced-administration/debug/debug-wordpress/”>Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /home/xxxx/public_html/wp-includes/functions.php on line 6114 [15-Nov-2024 10:12:04 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>simple-history</code> 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 <code>init</code> action or later. Please see <a href=”https://developer.ww.wp.xz.cn/advanced-administration/debug/debug-wordpress/”>Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /home/xxxx/public_html/wp-includes/functions.php on line 6114 [15-Nov-2024 10:12:06 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>simple-history</code> 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 <code>init</code> action or later. Please see <a href=”https://developer.ww.wp.xz.cn/advanced-administration/debug/debug-wordpress/”>Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /home/xxxx/public_html/wp-includes/functions.php on line 6114 [15-Nov-2024 10:12:06 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>simple-history</code> 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 <code>init</code> action or later. Please see <a href=”https://developer.ww.wp.xz.cn/advanced-administration/debug/debug-wordpress/”>Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.) in /home/xxxx/public_html/wp-includes/functions.php on line 6114
While I can’t reproduce this myself (no notice warnings anywhere) I have seen the notice message on other sites now. If anyone else has the same problem please let me know your plugins and theme!
This is only appearing when debug mode is on, of course. But many users forget this setting when publishing their website or it’s still for testing in production.
Hi @eskapism, I just looked into it a little bit more. It seems that you load a translation in /inc/services/class-licences-settings-page.php on line 81 with the plugins_loaded hook, which is loaded before after_setup_theme and init.
Did you set the debug settings in the wp-config.php on true?
@mirkoschubert Thank you for looking that up. I’m still confused why I don’t see any warning/notices. I do develop with both WP_DEBUG true and with Query Monitor running, but still no message (see screenshot). It must be something I’m missing.. 🤔
OMG I finally got the error! Of course I must have the language set to something else than English for translations to be loaded 🤦. Thanks for the help everyone, now I can fix the bug.
@eskapism Of course, I didn’t think about that, because WordPress is in German for me every time (and in English as a user). I just updated one of my projects. Seems to work great 🙂