• Hi there,

    I’m seeing the following errors in my debug log, many, many times:

    [22-Dec-2025 01:34:09 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>sliced-invoices</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.ww.wp.xz.cn/advanced-administration/debug/debug-wordpress/”>Debugging in WordPress</a>

    Any chance of a fix?

    Thanks for your help!

Viewing 1 replies (of 1 total)
  • Thread Starter JapeNZ

    (@japenz)

    While it doesn’t fix the problem, if anyone else needs to stop the PHP Notice filling their debug log so they can see if anything is happening AI recommeded I do this and it seems to have done the trick:

    Use a Must-Use (MU) Plugin

    Must-Use plugins load before any regular plugins or theme files. This ensures your filter is active before Sliced Invoices can trigger the notice. 

    1. Access your site files via FTP or File Manager.
    2. Navigate to /wp-content/mu-plugins/. (If the mu-plugins folder does not exist, create it).
    3. Create a new file named silence-sliced-invoices.php.
    4. Paste the following code:
    <?php
    /**
     * Plugin Name: Silence Sliced Invoices Translation Notice
     */
    add_filter( 'doing_it_wrong_trigger_error', function( $trigger, $function_name, $message ) {
        if ( $function_name === '_load_textdomain_just_in_time' && strpos( $message, 'sliced-invoices' ) !== false ) {
            return false;
        }
        return $trigger;
    }, 10, 3 );

    Hope this helps.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.