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

WordPress 6.7 - _load_textdomain_just_in_time was called incorrectly #45

Open
htmgarcia opened this issue Nov 14, 2024 · 0 comments
Open

Comments

@htmgarcia
Copy link

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 );

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

1 participant