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

PHP Notice _load_textdomain_just_in_time was called incorrectly #150

Open
cannobbio opened this issue Nov 14, 2024 · 1 comment
Open

PHP Notice _load_textdomain_just_in_time was called incorrectly #150

cannobbio opened this issue Nov 14, 2024 · 1 comment

Comments

@cannobbio
Copy link

WordPress 6.7 update PHP Notice:

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wp-migrate-db 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.) in wp-includes\functions.php on line 6114

Using wp-migrate-db v2.7.0

@cannobbio
Copy link
Author

I've tested this changes for a solution to avoid early localization:

/wp-migrate-db/php-checker.php

Change line 26
from:

self::$base_message = __( '%s requires PHP version %s or higher and cannot be activated. You are currently running version %s. <a href="%s">Learn&nbsp;More&nbsp;»</a>', 'wp-migrate-db' );

to:

self::$base_message = '%s requires PHP version %s or higher and cannot be activated. You are currently running version %s. <a href="%s">Learn&nbsp;More&nbsp;»</a>';

Change line 35
from:

wp_die( sprintf( self::$base_message, __( 'WP Migrate Lite' ), self::$min_php, PHP_VERSION, self::$php_doc_link ) );

to:

wp_die( sprintf( __( self::$base_message, 'wp-migrate-db' ), __( 'WP Migrate Lite', 'wp-migrate-db' ), self::$min_php, PHP_VERSION, self::$php_doc_link ) );

Hope it helps.
Thank you.

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