This thread is resolved. Here is a description of the problem and solution.
Problem: The client is developing a custom plugin for a referral and commission system, which shows an error upon activation, suspecting a conflict with WPML. The client also inquired about the necessity of various WPML plugins listed in their setup. Solution: The error is not specifically related to WPML but to the early loading of translation files by plugins like ld-multilingual, learndash-certificate-builder, and learndash-memberpress. These plugins are loading translation files before WordPress is fully initialized, which can cause PHP notices and affect content translation and functionality. We recommend wrapping the translation file loading within an
Replace 'my-plugin-slug' with the actual text domain of your plugin and ensure the .mo/.po files are located in the /languages subdirectory.
If this solution does not resolve the issue or seems irrelevant due to updates or different circumstances, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. We highly recommend opening a new support ticket if the problem persists. For further assistance, visit our support forum at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
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.