Closed remyperona closed 1 week ago
Coverage variation | Diff coverage |
---|---|
Report missing for e5bca6673a3669827f3998edebc0c785210fe561[^1] | :white_check_mark: 60.87% (target: 50.00%) |
Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more [^1]: Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
Reproducible steps:
1- WP 6.7
2- Query monitor is installed
3- install and activate wpr 3.17.2.1 => notice query monitor displays Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rocket 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. (This message was added in version 6.7.0.)
in debug.log
[14-Nov-2024 14:14:12 UTC] PHP Notice: Function _load_textdomain_just_in_time was called <strong>incorrectly</strong>. Translation loading for the <code>rocket</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.) in /var/www/new.rocketlabsqa.ovh/htdocs/wp-includes/functions.php on line 6114
@remyperona Thanks for the PR.
@remyperona Thanks for the update, the dynamic lists text is displayed correctly now. Notes:
dynamic list update FR translation is not displayed on PR
Using 3.17.2.1 with query monitor and having the doing wrong text at query monitor, after we update to the PR , the Doing wrong in query monitor will still be there till we manually refresh the page
/cc @piotrbak if nothing is needed for those notes then we can merge the PR. testrail-report-661.pdf
@remyperona Is the problem with lack of FR translation fixed? Or it's not fixable for now?
yes it's all good now
@remyperona Thanks for the update.
Now translations of the dynamic list update text are there only if script_debug
is true, o.w translations won't be reflected.
Coverage variation | Diff coverage |
---|---|
Report missing for e5bca6673a3669827f3998edebc0c785210fe561[^1] | :white_check_mark: 60.87% (target: 50.00%) |
Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more [^1]: Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
Description
Fixes #7102
A change in WordPress 6.7 is warning when translations functions are used too early. This PR fixes the doing it wrong warnings in the plugin.
Type of change
Detailed scenario
With WordPress 6.7 and WP Rocket 3.17.2, using query monitor to see it easily.
There should be doing it wrong warnings when loading pages in the admin. (also available in debug log)
With this PR, no doing it wrong warnings should happen.
Technical description
Documentation
This change delays the usage of translations functions to later, and also update the hook used to load the plugin textdomain, from
plugins_loaded
toinit
.Mandatory Checklist
Code validation
Code style