Fixing the 'Translation loading for the health-check domain was triggered too early' Error
Content
If you use the Health Check & Troubleshooting plugin and have recently updated WordPress, you might have encountered a PHP notice that reads:
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the health-check 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.)
This error can appear on your live site, in your admin dashboard, or fill up your debug.log file. This guide will explain why this happens and what you can do about it.
Why This Error Occurs
Starting with WordPress 6.7, the core software introduced a new check to ensure translation files are loaded at the correct time for optimal performance. The 'Health Check & Troubleshooting' plugin loads some of its code on the plugins_loaded action hook, which occurs before the recommended init hook. When the plugin attempts to translate text during this earlier phase, WordPress generates this notice to flag the non-standard behavior.
It is important to understand that this is a notice, not a fatal error. For the vast majority of users, the plugin will continue to function normally despite these messages. The primary issue is the clutter they can create in debug logs or on screens if debugging is enabled.
Known Status and Official Fix
This is a known issue with the plugin. An official bug report has been opened on the plugin's GitHub repository and can be found here: GitHub Issue #477.
The developers are aware of the problem, and a permanent code fix will need to be implemented in a future plugin update to make it fully compliant with the new WordPress translation timing standards.
Workarounds and Solutions
While you wait for an official plugin update, here are the most common solutions to manage or eliminate this notice.
1. Disable WordPress Debugging (Recommended for Live Sites)
Since this is merely a notice and not a critical error, the simplest solution for a live website is to ensure debugging is turned off. This will prevent the messages from being displayed to users or written to logs.
Check your site's wp-config.php file and ensure the following values are set:
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', false );
If these lines are not present or are set to true, changing them to false will suppress the notices. Always make a backup of the file before editing it.
2. Hide PHP Notices via php.ini
Another server-level approach is to configure PHP to not display or log notices, while still logging more severe warnings and errors. This can often be done by setting the following in your php.ini file (you may need to contact your hosting provider for help with this):
error_reporting = E_ALL & ~E_NOTICE
display_errors = Off
log_errors = On
3. Wait for a Plugin Update
For users who are not comfortable editing configuration files, the safest course of action is to simply wait for the 'Health Check & Troubleshooting' team to release an update that addresses the compatibility issue. You can monitor the progress on the GitHub issue.
Conclusion
The "Translation loading triggered too early" notice is a common result of the stricter translation timing checks in WordPress 6.7+. While the notice points to the Health Check & Troubleshooting plugin, it does not typically affect the plugin's core functionality. The most practical solutions for most site owners are to disable debugging on production sites or hide PHP notices. The long-term fix will arrive in a future plugin update.
Related Support Threads Support
-
Notice: Function _load_textdomain_just_in_time was called incorrectly.https://wordpress.org/support/topic/notice-function-_load_textdomain_just_in_time-was-called-incorrectly-30/
-
Query Monitor Error Messagehttps://wordpress.org/support/topic/query-monitor-error-message/
-
Plugin needs update after WordPress v. 6.7.1https://wordpress.org/support/topic/plugin-needs-update-after-wordpress-v-6-7-1/
-
Translation loading for the health-check domain was triggered too early.https://wordpress.org/support/topic/translation-loading-for-the-health-check-domain-was-triggered-too-early/
-
Function _load_textdomain_just_in_time was called incorrectlyhttps://wordpress.org/support/topic/function-_load_textdomain_just_in_time-was-called-incorrectly-158/
-
Function _load_textdomain_just_in_time was called incorrectlyhttps://wordpress.org/support/topic/function-_load_textdomain_just_in_time-was-called-incorrectly-172/
-
debug PHP Noticehttps://wordpress.org/support/topic/debug-php-notice-5/
-
Function _load_textdomain_just_in_time was called incorrectlyhttps://wordpress.org/support/topic/function-_load_textdomain_just_in_time-was-called-incorrectly/
-
Switching Language manuallyhttps://wordpress.org/support/topic/switching-language-manually/
-
Incorrect Function Callhttps://wordpress.org/support/topic/incorrect-function-call/
-
Plug in errorshttps://wordpress.org/support/topic/plug-in-errors-4/
-
call languagehttps://wordpress.org/support/topic/call-language-3/
-
Wrong languagehttps://wordpress.org/support/topic/wrong-language-15/