PHP notice on version 2.6.11
-
I am receiving this php notice:
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the bbpress 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.
I am running Version 2.6.11
-
what additional bbpress related plugins are you running?
I am running a courses site with LearnPress
so just bbpress and learnpress?
Not just that. Here is the full list:
- Advanced Custom Fields Versión 6.3.12 por WP Engine
- Akismet Anti-spam: Spam Protection Versión 5.3.5 por Automattic – Anti-spam Team
- bbPress Versión 2.6.11 por The bbPress Contributors
- BuddyPress Versión 14.3.3 por The BuddyPress Community
- CoBlocks Versión 3.1.14 por GoDaddy
- H5P Versión 1.16.0 por Joubel
- LearnPress Versión 4.2.7.5.1 por ThimPress
- LearnPress – bbPress Integration Versión 4.0.5 por ThimPress
- LearnPress – BuddyPress Integration Versión 4.0.2 por ThimPress
- LearnPress – Collections Versión 4.0.1 por ThimPress
- LearnPress – Coming Soon Courses Versión 4.0.6 por ThimPress
- LearnPress – Course Review Versión 4.1.4 por ThimPress
- LearnPress – Prerequisites Courses Versión 4.0.8 por ThimPress
- Loco Translate Versión 2.7.1 por Tim Whitlock
- PublishPress Capabilities Versión 2.18.2 por PublishPress
- Safe SVG Versión 2.3.1 por 10up
- Site Kit by Google Versión 1.145.0 por Google
- WP Mail SMTP Versión 4.3.0 por WP Mail SMTP
- WP Rocket Versión 3.18 por WP Media
- WP User Manager Versión 2.9.12 por WP User Manager
Thanks
This is just a warning that WordPress 6.7 introduced.
bbpress in itself does not issue that warning, so I’d suspect that another plugin is affecting this.
so you need to test to see which other plugin or your theme is doing this.
I’d start with loco translate and LearnPress – bbPress Integration as likely candidates.
If not you’ll need to work out which
Themes
As a test switch to a default theme such as twentytwenty, and see if this fixes.
Plugins
If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users
Then come back
Thank you so much for the info.
thank you for the response and the info.
I have a local dev version, but it’s not an exact copy of the production site, so I may try this tool you recommended
pretty sure that it is LearnPress – bbPress Integration
We have submitted a change required to Learndash.
If you are into code the fix is in learndash-bbpress\includes\class-dependency-check.php line 119 – the line needs changing from
$plugin_header = get_plugin_data( trailingslashit( str_replace( '\\', '/', WP_PLUGIN_DIR ) ) . $plugin_key );
to$plugin_header = get_plugin_data( trailingslashit( str_replace( '\\', '/', WP_PLUGIN_DIR ) ) . $plugin_key, false, false );
This then prevents translations being loaded at that point (too early) and hopefully fixes the issue.
I am not using Learndash, but Learnpress, is that line on both plugins the same?
apologies, ignore that !!
Same notice here, with v2.6.13. So I patched includes/extend/buddypress/loader.php
line 42 :
esc_html__( 'Forums', 'bbpress' ),
to :function_exists('esc_html__') && did_action('init') ? esc_html__( 'Forums', 'bbpress' ) : 'Forums',
and line 119 :
'search_string' => esc_html__( 'Search Forums...', 'bbpress' ),
to :'search_string' => did_action('init') ? esc_html__( 'Search Forums...', 'bbpress' ) : 'Search Forums...',
and it’s gone.
I had several similar notices from different plugins, and I suspect WPML to cause this issue. I can’t deavtivate it because last time I did it was a complete mess 😅
I don’t have much time to go further this now, but I saw this topic so I guess Bbpress is not causing it.
@dragoeco, Thanks a lot for posting this. This notice was driving me crazy. Can I ask why you say “bbpress is not causing it.” It seems like this is something that needs to be fixed in bbpress/includes/extend/buddypress/loader.php.
I checked it out with QueryMonitor and it didn’t appear that any other plugins were involved, though I’m rather out of my depth here and might be confused.
it’s not really anyone’s ‘fault’ but bbpress would need to make the change to their code, so yes bbpress is ‘causing it’.
Thanks for the clarification @robin-w. I don’t really understand anything about the WP translation scheme, or exactly when WP changed things so that these notices are shown (when I started seeing them doesn’t seem to jibe with what I can find in the WP trac). Anyway, AFAICT this isn’t in the bbpress trac (though there are similar things there). Should it be there?
Again, I’m fairly confused about this. I’m assuming that not everyone is seeing this, or there would be a lot more complaints about it. I don’t know if that’s because some special circumstances are necessary, or just because nobody has debugging turned on 🙂
Thanks for the clarification @robin-w. I don’t really understand anything about the WP translation scheme, or exactly when WP changed things so that these notices are shown (when I started seeing them doesn’t seem to jibe with what I can find in the WP trac). Anyway, AFAICT this isn’t in the bbpress trac (though there are similar things there). Should it be there?
Again, I’m fairly confused about this. I’m assuming that not everyone is seeing this, or there would be a lot more complaints about it. I don’t know if that’s because some special circumstances are necessary, or just because nobody has debugging turned on 🙂
Not sure why that posted twice. Sorry!
yes – 99% of sites never turn debug on, so never see any warnings.
- You must be logged in to reply to this topic.