Background of the issue:
I am developing a custom plugin for a referral and commission system on the website. When I install and activate that plugin, it's showing an error, and I think WPML is causing a conflict. Along with the main WPML plugin, there are many other WPML plugins, and I am unsure if they are part of the main WPML or unnecessary. I have attached screenshots of the list of WPML plugins that are installed or activated: hidden link, hidden link.
Symptoms:
An error occurs when I install and activate my custom plugin, and I suspect a conflict with WPML.
Questions:
Can you check if your plugin is causing any conflict with other plugins?
Are all the WPML plugins listed necessary, or are some of them unnecessary?
Hello, we are collecting the main issues we're facing and will inform you shortly. So don't close the ticket because we'll reach as soon as possible.
Thank you
Hello,
The translation files for plugins like ld-multilingual, learndash-certificate-builder, and learndash-memberpress are being loaded before WordPress has fully initialized. This is causing PHP notices and may lead to issues with content translation and functionality.
The plugin or theme code is executing too early in the WordPress lifecycle.
The translation files for plugins like ld-multilingual, learndash-certificate-builder, and learndash-memberpress are being loaded before WordPress has fully initialized. This is causing PHP notices and may lead to issues with content translation and functionality.
The plugin or theme code is executing too early in the WordPress lifecycle.
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
The warning messages shown in the image aren't necessarily specific to WPML, but they are related to translation loading, which could involve WPML or any plugin handling translations, including:
- ld-multilingual (likely related to WPML and LearnDash)
- learndash-certificate-builder
- learndash-memberpress
The key message is that these plugins or code are calling translation functions like _load_textdomain_just_in_time too early in the WordPress lifecycle. This is not strictly a WPML issue but a timing issue with how translation domains are being loaded, and WPML could be involved if it's managing translations for those domains.
This should ensure you're loading the plugin's translation files inside a function hooked to init. Replace 'my-plugin-slug' with your actual text domain and ensure the .mo/.po files are in the /languages subdirectory.
Thanks Bruno for your answer.
is it clear and could you confirm to me that the error or issue which I shared with you is not due to WPML? Just so I can check with my developer
And the code you send us,is it necessary to use? Or it's just for translation speed improvement?
Thanks for your support
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
The warnings you're seeing are not necessarily caused by WPML directly, but WPML could be involved if it's managing translations for the affected text domains (`ld-multilingual`, `learndash-certificate-builder`, `learndash-memberpress`).
The actual issue is that some code is trying to load translation files too early in the WordPress lifecycle. This is more of a timing or code placement issue, not a direct fault of WPML itself.
The code I shared is just an example of the correct way to load translation files using the `init` action. It's not required unless you're working on custom plugin or theme code and want to ensure translations are being loaded at the right time.
If you're using third-party plugins (like LearnDash or MemberPress), they should already handle this correctly—if not, it would be something to report to their support.