Skip to content

Function _load_textdomain_just_in_time was called incorrectly #477

Description

@threadi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions