-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notice: Function _load_textdomain_just_in_time was called incorrectly #625
Comments
Maybe this is because we load the textdomain here in the "init" function: Which is on the "plugins_loaded" hook: But the documentation is not clear about which hook is correct: |
Well, keep in mind I encountered this warning with WordPress 6.7 beta 3. A lot might still change, and this can also be an issue with core, I just wanted to bring it to your attention. AntiSpam Bee still filters just fine, so no cheap viagra for me, I suppose 🙄 |
This is probably related to this change: https://core.trac.wordpress.org/ticket/44937 We have to take another look at this. |
Yes, @luminuu was posting this ticket on X/Twitter too. Looks like this could be the second call here: This is called on the |
But that wouldn't trigger when navigating to the Dashboard, right? I can debug this locally with XDebug and 6.7 beta 3 later. |
If this is not the problem, we maybe should change The docs for load_plugin_textdomain are not clear here, but the example clearly says
This would be great! |
@swissspidy was suggesting on X/Twitter to get rid of the https://make.wordpress.org/core/2016/07/06/i18n-improvements-in-4-6/ https://github.com/pluginkollektiv/antispam-bee/blob/master/readme.txt#L5 |
Tip: Query Monitor is very helpful to see the stack trace of how such warnings are triggered. For Antispam Bee, it looks as follows: In WordPress 6.6 and below:
In WordPress 6.7, In WordPress 6.7:
The easiest fix would be to call Alternatively, you could probably remove the Either solution will resolve the new warnings though. (And yes, if you bump your WP version requirement, you can totally remove the |
@swissspidy thanks for the explanation! I was also able to reproduce this with Xdebug locally. Can you please take a look at the PR? This should resolve it. At least, I don't see any notice locally anymore. |
Describe the bug
_Notice: Function load_textdomain_just_in_time was called incorrectly. Translation loading for the antispam-bee 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 /home/mkjqekzy/public_html/wp-includes/functions.php on line 6099
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It looks like a deprecation warning of some sort. Not that unexpected really ;)
System (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: