• Hi there,

    Since WordPress 6.7 was released, I’m seeing the following PHP notice repeatedly in my debug.log file:

    PHP Notice:  Function _load_textdomain_just_in_time was called incorrectly. 
    Translation loading for the
    better-wp-security 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.

    This seems to indicate that the plugin is attempting to load translation files (.mo) too early in the WordPress execution lifecycle, likely before the init hook.

    I’m running the latest version of both WordPress and the plugin. Functionally everything seems fine, but this notice clutters the debug log and might hint at future compatibility issues.

    Would it be possible to adjust the timing of the translation loading to comply with the newer WordPress standards?

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support kmarusek

    (@kmarusek)

    Hi there,

    Thanks for the info, and good catch on that notice!

    The fix for this issue was included in version 9.3.5 (released November 19, 2024), so it should have resolved the PHP notice about translations loading too early.

    Since you’re already on the latest version and still seeing the notice, it might be caused by a conflict with another plugin or your theme loading the plugin’s textdomain too early.

    Here are a couple of things you can try:

    • Temporarily switch to a default theme (like Twenty Twenty-Five) to see if the notice persists.
    • Disable other plugins one by one to rule out conflicts.
    • Make sure no custom code is calling translation functions before the init hook.

    If none of that helps, please share your full debug.log entry and your plugin version again so we can investigate further.

    Thanks for your patience!

    Thread Starter Rafael Fischmann

    (@rfischmann)

    I appreciate your response @kmarusek, and it’s indeed weird that this bug was supposed to be fixed already. And yes, I’m running version 9.3.8.

    As for the testing you’ve suggested, maybe there’s indeed a theme and/or plugin conflict on my side, but unfortunately that’s too much hassle and not a good thing to do on a live site (I currently don’t have a staging environment set), so let’s see if some other Solid Security user might come and shed some light on the issue.

    Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-wp-security domain was triggered too early…

    You can reproduce this with a fresh install of WordPress, Solid Security and Kadence Blocks plugin.

    I posted this on their support forum but since the notice doesn’t appear when just Kadence Blocks is being used, here we are.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.