Function load_plugin_textdomain was called incorrectly notice in 6.7
-
In 6.7 a new notice was added
Function load_plugin_textdomain was called incorrectly
. This notice now appears also when theplugins_loaded
is used to callload_plugin_textdomain
. I have tested with other hooks (includingafter_setup_theme
), and the translations do not load.
-
Please report that following the steps at https://make.www.ads-software.com/core/handbook/testing/reporting-bugs/
Same problem here with WP 6.7 beta 1. Many plugins throw the same warning:
Notice: Function load_plugin_textdomain was called incorrectly. Attempted to load translations for the
ultimate-category-excluder
domain too early. Translations should be loaded after theafter_setup_theme
action has fired, to ensure that the current user is already set up. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in xxxxx\wp-includes\functions.php on line 6099
Notice: Function load_plugin_textdomain was called incorrectly. Attempted to load translations for thewp-statistics
domain too early. Translations should be loaded after theafter_setup_theme
action has fired, to ensure that the current user is already set up. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in xxxxx\wp-includes\functions.php on line 6099
Notice: Function load_plugin_textdomain was called incorrectly. Attempted to load translations for theautodescription
domain too early. Translations should be loaded after theafter_setup_theme
action has fired, to ensure that the current user is already set up. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in xxxxx\wp-includes\functions.php on line 6099
Notice: Function load_plugin_textdomain was called incorrectly. Attempted to load translations for theblacklist-updater
domain too early. Translations should be loaded after theafter_setup_theme
action has fired, to ensure that the current user is already set up. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in xxxxx\wp-includes\functions.php on line 6099
Notice: Function load_plugin_textdomain was called incorrectly. Attempted to load translations for thelimit-login-attempts-reloaded
domain too early. Translations should be loaded after theafter_setup_theme
action has fired, to ensure that the current user is already set up. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in xxxxx\wp-includes\functions.php on line 6099
Notice: Function load_plugin_textdomain was called incorrectly. Attempted to load translations for thepolylang
domain too early. Translations should be loaded after theafter_setup_theme
action has fired, to ensure that the current user is already set up. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in xxxxx\wp-includes\functions.php on line 6099@leemon, I marked it as resolved because it makes sense we are updating the hooks in our code.
Initially I did switch to usingafter_setup_theme
hook, and it did not work, the translations were not picked up. After playing with the hook priority (do not leave it to the default priority), I got it to work as intended and also the notices are gone. So, this was a false positive issue, using the hook suggested in the notices makes things work as intended, but only when we do some higher priority.- This reply was modified 1 month, 2 weeks ago by Iulia Cazan.
@iulia-cazan Are you saying it works with
after_setup_theme
with a different priority? What did you change the priority to?I’ve tried it with
10
(default),11
,1
, and evenPHP_INT_MAX
and0 - PHP_INT_MAX
to test the extremes, and I can’t make the notice go away. (Interestingly, get the notices twice for my plugins. Using this hook makes one go away, but another persists. I can’t figure out why, but this is happening in a Multisite setup with Network Active plugins, so perhaps that’s the issue.)Scratch my previous reply.
Tip for fellow plugin developers who are running into this issue:
- You probably don’t need to call
load_plugin_textdomain()
at all because WordPress has a just-in-time loader for translations in all versions after 4.6. I deleted the code from my plugins and the translations are still working without it, but I still got the warning, because… - I poked around a bit further and determined that the call that is generating the notice is at line 151 in?
wp-admin/includes/plugin.php
?in the?_get_plugin_data_markup_translate()
?function. That private function is called by the public function?get_plugin_data()
?which I do use in my plugins, fairly early. I see that function has a parameter to bypass translation, so that seems to be my fix.
So, if you’re still getting the error after removing the direct call in your plugin, check if you’re using the
get_plugin_data()
function, and be sure to set its third input parameter ($translate
) tofalse
.- This reply was modified 1 month, 2 weeks ago by room34.
Sekilas?Kami :Al Hijaz Tour TravelAgen Travel Umroh dan Haji Banten Terpercaya
Di Al Hijaz Tour and Travel, kami percaya bahwa ibadah umroh dan haji Anda harus menjadi pengalaman transformasional. Kami melayani Paket Ibadah Umroh Haji Banten, Travel Umroh Haji Resmi Banten, Biro Travel Umroh Banten, Biro Perjalanan Haji Banten, Tour Travel Umroh Banten.
Kami berdedikasi untuk memastikan bahwa perjalanan Anda ke kota suci Makkah dan Madinah nyaman dan terjangkau. Selain itu juga membangkitkan semangat spiritual Anda. Bergabunglah dengan kami dalam perjalanan suci ini, dan biarkan kami menjadi teman terpercaya Anda dalam ibadah umrah dan haji Anda
Kantor Pusat
Graha Alhijaz :
Jl. Dewi Sartika No. 239A Cawang, Jakarta Timur
Telepon: 021-801111
WA CS :?0853-1179-6051
website :https//alhijazjakarta.web.id
website ://httpsalhijaz.com (domain hosting Niaga Hoster )
Perwakilan Tangerang Selatan
Ruko Green Cove Blok B36/ 218 , Citra Raya Maja [Samping Pintu Gerbang Cluster Green Cove Citra Maja]
Rekening Bank
BSI : 707-367-5598 (Rp)
BCA : 006-0008-012-225 (Rp)
Mandiri : 273-221-1111 (Rp)
BSI : 706-774-5587 (US$)
a/n. PT Alhijaz IndowisataHi @leemon,
I’m pleased to inform you that we have released version 14.10.3 of WP Statistics, which resolves the incompatibility issue with WordPress version 6.7.
Please update the plugin to the latest version and enjoy!
Regards
@macmanx, I reopened the issue as it seems this is still replicable in 6.7 and now maybe it seems more relevant https://github.com/woocommerce/woocommerce/issues/52646
Additionally, for some plugins the text domain do not get picked up anymore, regardless of the hook used.
Does anyone know where is the new/updated documentation regarding the plugins translations – if available – after the new changes introduced in 6.7?- This reply was modified 1 week, 1 day ago by Iulia Cazan.
- This reply was modified 1 week, 1 day ago by Iulia Cazan.
- You must be logged in to reply to this topic.