Skip to content

WordPress 6.7 - _load_textdomain_just_in_time was called incorrectly #45

@htmgarcia

Description

@htmgarcia

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the ml-slider 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 for more information. (This message was added in version 6.7.0.)

The problem in sites with WordPress 6.7 is explained here:

Your plugin might be _doing_it_wrong() if you for example directly call get_plugin_data() (which attempts to load translations by default) or __() without waiting for the init hook.

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

The issue affects this line https://github.com/Appsero/client/blob/develop/src/Client.php#L194

Since we only check for plugin 'Version', we can skip $markup and $translate params by setting up as false both: https://developer.wordpress.org/reference/functions/get_plugin_data/

$plugin_data = get_plugin_data( $this->file, false, false );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions