• Resolved skellner

    (@skellner)


    Hello there! We’ve recently started experiencing the following error log message when running our websites in debug mode. Our sites are running WordPress 6.7.1 on PHP 8.2.

    PHP Notice:  Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>acf-icomoon</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> for more information. (This message was added in version 6.7.0.) in /home/webuser/public_html/wp-includes/functions.php on line 6114

    We’ve traced the source of this message to the main acf-icomoon.php file in the plugin’s root folder. We have been patching this locally on sites we manage with the following change…

    --- acf-icomoon.php     2024-11-22 10:06:59.000000000 -0500
    +++ acf-icomoon-patched.php 2024-11-22 10:27:51.861305200 -0500
    @@ -22,28 +22,34 @@
    }

    /**
    - * Definitions
    + * Initialize Plugin
    */

    -if(!function_exists('get_plugin_data')){
    - require_once(ABSPATH . 'wp-admin/includes/plugin.php');
    -}
    -$plugin_data = get_plugin_data(__FILE__);
    -
    -define("ACFICOMOON_VERSION", $plugin_data['Version']);
    -define("ACFICOMOON_DIR", plugin_dir_path(__FILE__));
    -define("ACFICOMOON_ASSETS_URL", plugin_dir_url(__FILE__) . 'assets/');
    -define("ACFICOMOON_STYLESHEET_DIR", get_stylesheet_directory());
    -
    -/**
    - * Include functions
    - */
    +add_action('init', 'viivue_initialize_plugin');
    +function viivue_initialize_plugin(){
    + /**
    + * Definitions
    + */
    + if(!function_exists('get_plugin_data')){
    + require_once(ABSPATH . 'wp-admin/includes/plugin.php');
    + }
    + $plugin_data = get_plugin_data(__FILE__);
    +
    + define("ACFICOMOON_VERSION", $plugin_data['Version']);
    + define("ACFICOMOON_DIR", plugin_dir_path(__FILE__));
    + define("ACFICOMOON_ASSETS_URL", plugin_dir_url(__FILE__) . 'assets/');
    + define("ACFICOMOON_STYLESHEET_DIR", get_stylesheet_directory());
    +
    + /**
    + * Include functions
    + */

    -// helper
    -include_once(ACFICOMOON_DIR . 'includes/helper.php');
    + // helper
    + include_once(ACFICOMOON_DIR . 'includes/helper.php');

    -// main functions
    -include_once(ACFICOMOON_DIR . 'includes/acf-icomoon.php');
    + // main functions
    + include_once(ACFICOMOON_DIR . 'includes/acf-icomoon.php');
    +}

    /**
    * WPBakery Page Builder

    Perhaps you’ll have another way you’d want to address this error message, but at the very least we wanted to bring it to your attention. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter skellner

    (@skellner)

    Apologies. I realized I shared the incorrect patch from one of our earlier attempts that didn’t work. Below is the actual patch that we’ve rolled out to our sites that is working…

    Basically we’re just hard-coding the plugin version number rather than relying on get_plugin_data()

    --- acf-icomoon.php     2024-10-11 08:20:32.000000000 -0400
    +++ acf-icomoon-patched.php 2024-11-22 13:49:14.363537900 -0500
    @@ -28,9 +28,8 @@
    if(!function_exists('get_plugin_data')){
    require_once(ABSPATH . 'wp-admin/includes/plugin.php');
    }
    -$plugin_data = get_plugin_data(__FILE__);

    -define("ACFICOMOON_VERSION", $plugin_data['Version']);
    +define("ACFICOMOON_VERSION", '4.0.10');
    define("ACFICOMOON_DIR", plugin_dir_path(__FILE__));
    define("ACFICOMOON_ASSETS_URL", plugin_dir_url(__FILE__) . 'assets/');
    define("ACFICOMOON_STYLESHEET_DIR", get_stylesheet_directory());
    • This reply was modified 1 year, 6 months ago by skellner.
    Plugin Contributor daomapsieucap

    (@daomapsieucap)

    Hi @skellner,

    Apologies for the delay. We’ve just released version 4.0.12, which fixes this issue. Could you please try the latest version?

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

The topic ‘WordPress 6.7 Debug Message: “code in the plugin or theme running too early”’ is closed to new replies.