Plugin breaks in WP 6.7

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.

Ah, it’s a Notice. That should not break your site. Make sure errors are only logged and not output on the website Debugging in WordPress – Advanced Administration Handbook | Developer.WordPress.org

I also found out that I don’t need to call load_plugin_textdomain at all since we use Podlove Podcast Publisher < GlotPress | WordPress.org and not local translation files. But even if I remove the call, the notice remains, so I’m not sure what WordPress wants from me here :thinking: You can try yourself by opening this file (podlove-publisher/bootstrap/constants.php at master · podlove/podlove-publisher · GitHub) and simply removing the last line.

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 :slight_smile:

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.

/edit: the issue: WP 6.7 textdomain soft deprecation NOTICE · Issue #1532 · podlove/podlove-publisher · GitHub

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.

1 Like