Error with _load_textdomain_just_in_time
-
This error message is showing when the “Easy Watermark” plugin is activated.
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the easy-watermark 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 6114When I investigated your plugin, I can see that the thing needed to be added inside the init hook is added wrong inside the constructor. Please see the below code block from your plugin file: underDEV_Requirements.php line 62
public function __construct( $plugin_name = '', $to_check = array() ) {
$this->checks = $to_check;
$this->plugin_name = $plugin_name;
// Load translations
if ( function_exists( 'get_user_locale' ) ) {
$locale = get_user_locale();
} else {
$locale = get_locale();
}
load_textdomain( $this->textdomain, dirname( __FILE__ ) . '/languages/' . $this->textdomain . '-' . $locale . '.mo' );
// Add default checks
$this->add_check( 'php', array( $this, 'check_php' ) );
$this->add_check( 'php_extensions', array( $this, 'check_php_extensions' ) );
$this->add_check( 'wp', array( $this, 'check_wp' ) );
$this->add_check( 'plugins', array( $this, 'check_plugins' ) );
$this->add_check( 'theme', array( $this, 'check_theme' ) );
$this->add_check( 'function_collision', array( $this, 'check_function_collision' ) );
$this->add_check( 'class_collision', array( $this, 'check_class_collision' ) );
}load_textdomain( $this->textdomain, dirname( __FILE__ ) . ‘/languages/’ . $this->textdomain . ‘-‘ . $locale . ‘.mo’ );
This should be added inside init hook. Please fix this issue, as we are seeing the error on the live site.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
You must be logged in to reply to this topic.