Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function _load_textdomain_just_in_time was called incorrectly #477

Open
threadi opened this issue Nov 13, 2024 · 1 comment
Open

Function _load_textdomain_just_in_time was called incorrectly #477

threadi opened this issue Nov 13, 2024 · 1 comment

Comments

@threadi
Copy link

threadi commented Nov 13, 2024

Using the plugin with WordPress 6.7 results with enable debug-mode in this message:

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. Please see [Debugging in WordPress](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/) for more information. (This message was added in version 6.7.0.) in /var/www/clients/client1/web3/web/wp-includes/functions.php on line 6114

See: https://make.wordpress.org/core/2024/10/21/i18n-improvements-6-7/

Details with the add_filter-Helper from this page:

#0 /var/www/clients/client1/web3/web/wp-includes/class-wp-hook.php(326): {closure}('...')
#1 /var/www/clients/client1/web3/web/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#2 /var/www/clients/client1/web3/web/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /var/www/clients/client1/web3/web/wp-includes/functions.php(6003): do_action('...', '...', '...', '...')
#4 /var/www/clients/client1/web3/web/wp-includes/l10n.php(1355): _doing_it_wrong('...', '...', '...')
#5 /var/www/clients/client1/web3/web/wp-includes/l10n.php(1385): _load_textdomain_just_in_time('...')
#6 /var/www/clients/client1/web3/web/wp-includes/l10n.php(194): get_translations_for_domain('...')
#7 /var/www/clients/client1/web3/web/wp-includes/l10n.php(306): translate('...', '...')
#8 /var/www/clients/client1/web3/web/wp-content/plugins/health-check/HealthCheck/Tools/class-health-check-files-integrity.php(20): __('...', '...')
#9 /var/www/clients/client1/web3/web/wp-content/plugins/health-check/HealthCheck/Tools/class-health-check-files-integrity.php(297): Health_Check_Files_Integrity->__construct()
#10 /var/www/clients/client1/web3/web/wp-content/plugins/health-check/health-check.php(72): require_once('...')
#11 /var/www/clients/client1/web3/web/wp-includes/class-wp-hook.php(324): HealthCheck\{closure}('')
#12 /var/www/clients/client1/web3/web/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#13 /var/www/clients/client1/web3/web/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#14 /var/www/clients/client1/web3/web/wp-settings.php(559): do_action('...')
#15 /var/www/clients/client1/web3/web/wp-config.php(109): require_once('...')
#16 /var/www/clients/client1/web3/web/wp-load.php(50): require_once('...')
#17 /var/www/clients/client1/web3/web/wp-admin/admin.php(34): require_once('...')
#18 /var/www/clients/client1/web3/web/wp-admin/plugins.php(10): require_once('...')

Reason should be the loading of translatable text here: https://github.com/WordPress/health-check/blob/trunk/HealthCheck/Tools/class-health-check-files-integrity.php#L20 but also in multiple other files without any surrounding hook.

lightningspirit added a commit to lightningspirit/health-check that referenced this issue Nov 14, 2024
lightningspirit added a commit to lightningspirit/health-check that referenced this issue Nov 14, 2024
@lightningspirit
Copy link

Meanwhile, I created a simple mu-plugin to remove all these notice messages. Turns out, there are many other plugins with the same issue.

Just drop-in in your wp-content/mu-plugins directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants