• Resolved Supriya Kanjilal

    (@careofweb)


    Hi Team,

    I’m currently using your plugin Secure Custom Fields on my WordPress site, and since updating to WordPress 6.8, the plugin has been triggering repeated PHP notices related to translation loading.

    Here’s the notice from the debug log:

    PHP Notice: Function _load_textdomain_just_in_time was called incorrectly. 
    Translation loading for the secure-custom-fields domain was triggered too early. 
    Translations should be loaded at the init action or later. 
    

    This message appears on every page load and clutters the debug log. It seems the plugin is attempting to load translations too early in the execution flow — possibly during plugin load or before the init hook. Suggested Fix (per WordPress standards):

    add_action('init', function() {
        load_plugin_textdomain('secure-custom-fields', false, dirname(plugin_basename(__FILE__)) . '/languages/');
    });
    

    Would you kindly look into this and release a fix in the next update? This will ensure better compatibility with WordPress 6.8 and reduce unnecessary log noise.

    Thanks for your work on the plugin!

    Best regards,
    Supriya Kanjilal

Viewing 3 replies - 1 through 3 (of 3 total)
  • Howdy!

    What version of SCF are you using? A similar bug (Too early translations loading bug | WordPress.org) was fixed in in 6.4.1 (7 Mar 2025) release.

    Thread Starter Supriya Kanjilal

    (@careofweb)

    Hi Yan Metelitsa

    Thanks for the quick response!

    I’ve double-checked, and I’m currently using Secure Custom Fields version 6.4.2. However, the issue still persists — I continue to see this notice in my debug log on WordPress 6.8:

    Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the secure-custom-fields domain was triggered too early.

    It appears the fix mentioned in 6.4.1 might not have fully resolved the issue, or it’s possibly being overridden elsewhere in the plugin lifecycle.

    Let me know if you’d like me to help pinpoint where it’s being triggered — I’m happy to test a patch or provide more details if needed.

    Thanks again for your work on the plugin!

    Best regards,
    Supriya Kanjilal

    I’ve checked the sites available to me with the latest versions of WordPress and SCF – I don’t see any errors in the logs or when WP_DEBUG is activated. Also tried doing a clean install on the local server – no errors either.

    Can you give more details about the error, like in which file it is triggered, on which line?

    I can also suggest duplicating your site to a test/local server and try reinstalling SCF.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Translations Loading Too Early (Triggers WordPress 6.8 Notice)’ is closed to new replies.