10up / debug-bar-elasticpress

Extends the Debug Bar plugin for usage with ElasticPress
https://wordpress.org/plugins/debug-bar-elasticpress/
GNU General Public License v2.0
27 stars 16 forks source link

User Notice: Function _load_textdomain_just_in_time was called incorrectly #102

Open archon810 opened 6 days ago

archon810 commented 6 days ago

Describe the bug

Many plugins are getting hit with this and many have released fixes in the past few days.

User Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>debug-bar-elasticpress</code> 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 <code>init</code> action or later. Please see <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.7.0.)

Steps to Reproduce

Just do nothing. Notices roll in by themselves via wp-admin/admin-ajax.php.

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

6.7.1

Code of Conduct

archon810 commented 6 days ago

Cross-posted to https://wordpress.org/support/topic/user-notice-function-_load_textdomain_just_in_time-was-called-incorrectly.

skora-cpl commented 1 day ago

This message appears as a result of https://core.trac.wordpress.org/changeset/59157 which fixes https://core.trac.wordpress.org/ticket/44937 and 59157 was included in WP 6.7

There is consideration of reverting 59157 at https://core.trac.wordpress.org/ticket/62462

Nonetheless, it should probably be fixed here, in this plugin so that the translations are properly loaded (more information at https://core.trac.wordpress.org/ticket/44937#comment:33) and a dev note is available at https://make.wordpress.org/core/2024/10/21/i18n-improvements-6-7/

If anyone reads this and wants a temporary workaround to disable this message in their environment, they can use this filter (courtesy of @kowsar89 - https://gist.github.com/kowsar89/ed30f2b7abc5d4784ba4b05503c70fe0)


add_filter( 'doing_it_wrong_trigger_error', function( $status, $function_name ) {
    if ( '_load_textdomain_just_in_time' === $function_name ) {
        return false;
    }
    return $status;
}, 10, 2 );