Yesterday, my WP got updated to 6.7 and it broke the site. Apparently, in WP6.7 plugins and themes aren’t allowed to do translations before init. Woocommerce had/has the problem as well and now that 6.7 is released, quite a few other of my plugins ran into the same problem. Even the Astra theme I’m using had it.
The error message looks something like this:
Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the [...] domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.)
Interesting, I have an instance that runs on 6.7 without error. But I had a quick look in the code and I do call load_plugin_textdomain without a hook, so I will release a patch.
As I was in the process of hacking Podlove to integrate JSON chapters into the feed, I had debugging plugins running when Wordpress was updated and all hell broke loose. While on the frontend I got those errors (or more precisely warnings, you’re right), I wasn’t able to log into the backend any longer. All I got were those warnings and a blank white page underneath. Only after renaming the plugins folder and hacking the DB to use another template did I regain control of the backend. From there, I was able to downgrade and get everything up and running again.
So it might have been a freak combination of Debug Mode active, the vulnerable theme Astra and a combination of plugins that caused this, but at the time I was quite shocked. Although I didn’t take a screenshot, I remember that the theme Astra, Podlove Publisher, YOAST and coincidently the WP Debugging plugin produced the warnings, amongst 2-3 other plugins I can’t remember.
For the time being I’ll wait for new versions of WP, theme and plugins to come out before trying to update again
Alright, did a little more research and it’s not just about registering the translations. Any output of a translated string before the ‘init’ action causes this notice. That will be a major effort to trace all the origins… not looking forward to that. I’ll create an issue.
Just for documentation purposes in case someone else gets these messages: there is WP ticket 62175 that refers to this. It’s been closed by shifting the responsibilities to the theme and plugin develovers. The developers can read the WP Internationlization Improvements in 6.7 for reference on the change in WP 6.7 and are responsible to supply updated versions of their products.
Based on the wide spread of affected plugins and themes, I suppose it was not forseen by the WP developers how big of an issue this might turn out to be.