Issue with Translation Loading Triggering Too Early for Rank Math

#945126
  • Resolved Omahoung
    Rank Math free

    Hello,

    This message follows a thread on WordPress support forum (https://wordpress.org/support/topic/issue-with-translation-loading-triggering-too-early-for-rank-math/#post-18223193). As suggested on that thread, I open a ticket here.

    I have the last Rank Math free version installed (1.0.235) and still get the notice:
    Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rank-math 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 D:xampphtdocsomahoungwp-includesfunctions.php on line 6114

    The notice goes away when Rank Math is deactivated, and comes back when reactivated.

    The notice appears both on front-end and back-end. The website is in Traditional Chinese.

    Could you please assist?

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hello,

    We apologize for the issue you are facing with the translation loading notice in Rank Math. This notice indicates that the translation for the Rank Math domain is being triggered too early, which can be caused by code in either the plugin or theme running prematurely.

    To address this issue, we recommend the following steps:

    1. Update Rank Math: Ensure that you are using the latest version of Rank Math. You mentioned you have version 1.0.235, but it’s always good to check for any updates that may have been released since then.

    2. Check for Theme/Plugin Conflicts: Deactivate all other plugins except for Rank Math and switch to a default WordPress theme (like Twenty Twenty-One) to see if the notice persists. If it goes away, reactivate your theme and plugins one by one to identify the source of the conflict.

    3. Debugging: If you are comfortable with debugging, you can enable WP_DEBUG in your wp-config.php file to get more detailed error messages that might help pinpoint the issue.

    4. Contact Theme/Plugin Developers: If you identify a specific theme or plugin causing the issue, consider reaching out to their support for assistance.

    If the problem continues after trying these steps, please reply to this ticket, and a human agent from our support team will take over and assist you further.

    Thank you for bringing this concern to our attention!

    Hello,

    Thank you so much for getting in touch.

    If everything on your website is already up to date and the issue persists, this is something we need to check on your website’s admin dashboard. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    It has been almost a month since you requested the credentials, but I haven’t received any message. The issue still persists with the latest plugin version (1.0.237). Is this serious? Do I need to debug it for you?

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    Sorry for the long delay. Somehow, your ticket has been unintentionally moved to pending for moderation.

    Can you please share your website’s login information again so we can check this issue on a prioritized basis?

    We are sorry again for the inconvenience and we’re looking to help you resolve the issue further.

    Thank you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    Since we’re not able reproduce this issue on our development setups even with the same settings, could you please include the FTP details in the sensitive data area as well, so we may troubleshooting further by editing some of the RankMath plugin files.

    We look forward to having this issue resolved.

    Thank you.

    This sensitive data are already filed, can’t you see them?
    This is a test website. You can directly edit the plugin files by going to: Plugins> Plugin File Editor.

    Hello,

    We have identified the cause of the issue and it has been logged so that a fix can be included in an upcoming release.

    We apologize for any inconveniences that might have been caused by this issue.

    Thank you.

    Omahoung
    Rank Math free

    Hello,
    May I know in which version the fix will be released?
    Thank you.

    Hello,

    Please bear with us while we work on it.

    Once the update is available, we will inform you here.

    Appreciate your patience in the meantime.

    Omahoung
    Rank Math free

    Hello,

    I still have similar issue on other websites.

    I have check the code of your plugin. The issue is in the main file rank-math.php, line 316:

    add_filter( 'cron_schedules', [ $this, 'cron_schedules' ] );

    This function uses a translation ( esc_html__( ‘Once Weekly’, ‘rank-math’ ) ) which causes the warning.

    	public function cron_schedules( $schedules ) {
    		$schedules['weekly'] = [
    			'interval' => DAY_IN_SECONDS * 7,
    			'display'  => esc_html__( 'Once Weekly', 'rank-math' ),
    		];
    
    		return $schedules;
    	}

    It is possible (depending on the website setup) that this hook runs before the “after_setup_theme” hook you define in the same file, 2 lines before (line 314), which loads the text domain:

    add_action( 'after_setup_theme', [ $this, 'localization_setup' ], 1 );

    If cron_schedules runs before localization_setup, there will be a warning on __( ‘Once Weekly’, ‘rank-math’ ), because the Rank Math text domain is still not loaded.

    The solution I propose is to change line 316 by:

    add_action( 'init', function() {
      add_filter( 'cron_schedules', [ $this, 'cron_schedules' ] );
    });

    This solves the issue.

    Could you please insert the fix in a future plugin version?

    Thank you.

    Hello,

    This issue has been addressed in a recent update to our plugin. Can you please check if your plugin is using the latest build?

    Also, the login credentials you shared in the Sensitive Data section of this ticket are no longer working. Can you please share a new working login for us to check if the issue persists?

    Looking forward to helping you.

    Omahoung
    Rank Math free

    Hello,
    I am using the latest version of Rank Math, and no, it doesn’t fix the issue (https://temp4.omahoung.com/zh-tw/), as explained in my message. The code I provided is from the latest version of your plugin.
    Could you please check the file? You should reach the same conclusion: the function cron_schedules may run too early (before your text domain is loaded). I did the test on some websites and the fix I gave you works.
    Let me know if you need further clarification.

    Hello,

    We would like to check the issue further but the login information you shared isn’t working. Can you please verify that?

    Also, please include the FTP login as well.

    Looking forward to helping you on this one.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 15 replies - 1 through 15 (of 17 total)

The ticket ‘Issue with Translation Loading Triggering Too Early for Rank Math’ is closed to new replies.