• I am getting the following error numerous times in the error log…

    Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the adventurous 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.

    Query Monitor reports this as coming from this plugin…

    Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the adventurous 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 message was added in version 6.7.0.)
    _load_textdomain_just_in_time()
    Plugin: bbp-style-pack

    WordPress says…

    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.

    Are you able to assist with this?

    Viewing 13 replies - 1 through 13 (of 13 total)
    • Plugin Author Robin W

      (@robin-w)

      I would suspect that it is a combination of plugins or your theme that is causing the error showing in style pack. This error has been reported before, and does not occur on my test site (with quite a few plugins) except on plugin activation.

      I have spent a great deal of time trying to fix this in all cases, but I have failed.

      Sorry, I’m unable to spend more time on it.

      I have the same issue.

      to fix the issue, edit bbp-style-pack.php line 86
      change
      add_action(‘setup_theme‘, ‘bsp_theme_check’);

      to
      add_action(‘after_setup_theme‘, ‘bsp_theme_check’);

      You’ll need to do this manually until the developer fixes the issue.

      WordPress core is now stricter (since version 6.7) about when theme functions and text domains can be loaded.

      Plugin Author Robin W

      (@robin-w)

      Interesting….

      so the function that is being called ‘bsp_theme_check’ is to check whether the theme is a block theme.

      If it is a block theme, then being called at the ‘after_setup_theme‘ is too late.

      @dsawyers – I’m not sure how technical you are and what theme you are using? If this is stuff that you are good at, then any further help you can give me would be useful. If not, I’ll add a setting to allow you to skip this test if you are not using a block theme, so that you don’t have to change core code

      Plugin Author Robin W

      (@robin-w)

      @bobjgarrett I just loaded the theme ‘adventurous’ to my test site, and I am not seeing the Function _load_textdomain_just_in_time error with style pack also activated. Not saying that you are not seeing this, just that I cannot immediately replicate.

      A lot of our sites use a custom theme that’snot a block theme. The error only appears when debugging is turned on (which we normally only do when troubleshooting). It’s my understanding that the error is related to language files being loaded too early. That part could be moved to the after_theme_setup

      Plugin Author Robin W

      (@robin-w)

      @witchblade32  thanks very much for posting, I’d love this to work in all cases. And yes, WordPress recommends turning off error display on production sites, which is what you are doing.

      You can skip the next 2 paragraphs unless you want background to this.

      My understanding (which may be flawed) is the core issue here is that WordPress have changed how things work, which is fine for many things. However many plugins create templates that are customizable, this is a typical design feature of plugins. Templates will almost always have output that using that plugin’s language files. So far so good. However themes and plugins can then change these templates (again this is a key design element in WordPress) by putting amended copies of them into special locations with the theme or the plugin. This works fine for themes as they load language files at the right time. But if a plugin has amended template files from another plugin, then this starts to fall apart as the plugin tries to load another plugin’s language file at the wrong time – at least that is how I understand it.

      Style pack changes templates from bbpress if you use certain features and you obviously want to maintain consistency in having a word that is translated in bbpress to have exactly the same translation if you use the same word in a style pack template. Eg you want the word ‘Topic’ in whatever language to be the same whether it is a bbpress template or an amended style pack version. WordPress struggles to cope with this as they have (wrongly in my opinion) not allowed for this. There are also issues with how other translation plugins (such as locotranslate) handle and understand amended templates in other plugins which mean I have to allow for this also.

      SO

      I am happy to try and fix it to work in all cases, but I need to tread with care, as a fix for one can generate an error for another!

      I am not seeing this error on my test site for both block themes, and the non-block themes I have tried. That may well be because it only occurs on combinations of plugins/settings.

      If you have a free theme where you are seeing this error, can you give me the name, so that I can try it on my test site. If it does not cause the error, then I could do with your help to work out what additional plugin/setting causes it to happen. I can them look to see if I can work out a fix for that circumstance.

      If you are able to help me, then that would be great.

      • This reply was modified 2 months, 1 week ago by Robin W.
      Thread Starter bobjgarrett

      (@bobjgarrett)

      I am sorry to say that the latest version of bbp style pack (6.4.3) still produces the problem. I am using a theme called Adventurous from Catch Themes.
      However, the fix offered by dsawyers does seem to have worked for me.

      I do turn off display of errors to visitors but the debug log is useful to see what is not working so well. And having fewer errors in it means you can “see the wood for the trees”. Having used that fix I am now able to see another plugin producing errors!

      Still our site works for our members which is the key feature. Thank you.

      Plugin Author Robin W

      (@robin-w)

      @bobjgarrett – thanks, I have tried Adventurous free version, but do not see the error.

      Are you using the paid/pro version or the free one?

      If the latter I am guessing that it is related to a style pack setting or another plugin in combination. If I can get my site to error then I have a chance of fixing it.

      Let me know on theme version, and I’ll see if I can fix. As the fix by @dsawyers works for you, if I don’t fix quickly, I’ll add it as an option, so you can switch to it and not have to keep amending code.

      Thread Starter bobjgarrett

      (@bobjgarrett)

      I fear I have not provided enough correct and detailed information for this issue, and having done some further testing find this is very relevant.

      We are using the free theme of Adventurous version 3.5.3. Is Adventurous a block theme?

      However we have a child theme to add some further features in particular related to the search plugin we use (Relevanssi). I have just tested the site without activating the child theme and this particular error message does not occur. So as you suggested it is a combination of software modules which generates it.

      Plugin Author Robin W

      (@robin-w)

      Thanks, that is really useful info.

      I’d love to be able to load your child theme onto my site, or just look at what code is in there to see if I can find the culprit.

      If it contains nothing sensitive, any chance you could zip the child theme and email to me at

      [email protected]

      Thread Starter bobjgarrett

      (@bobjgarrett)

      I don’t think the code is “sensitive” but I will email it.

      Thread Starter bobjgarrett

      (@bobjgarrett)

      I note that the Child theme also has some code related to BBpress. I cannot recall when and why that was added but would have been from one of the other plug-in authors.

      Plugin Author Robin W

      (@robin-w)

      ok as it was raining all this afternoon in my part of the UK, I did some more testing.

      It appears that my checks need to run at ‘theme_setup’ unless you are running a child theme, when they need to run at ‘after_theme_checkup’ stage.

      Unfortunately you cannot determine a child theme until it is loaded (I expect there is a way, but I have not yet investigated that!)

      SO TO FIX – I have added an option under the ‘bbpress bug fixes’ tab

          dashboard>settings>bbp style pack>bug fixes 

      Fix Load Text domain notice which if you click should clear these messages.

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

    You must be logged in to reply to this topic.