Translation loading for the riverbank domain is triggered too early (WordPress 6.7+)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- php
- Domain
- internationalization
Research direction
Start in the Block_Patterns class: its constructor and the run() method, plus the Core::get_instance() call in functions.php that triggers the early load. Reproduce on WordPress 6.7+ with WP_DEBUG_LOG on and check wp-content/debug.log for the _load_textdomain_just_in_time notice. Done when a request with a riverbank translation file logs no notice.
Written by the indexing model from the issue text.
Description
On WordPress 6.7 and later, every request on a site that has a Riverbank translation logs:
PHP Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the riverbank 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.)
Cause: functions.php calls Core::get_instance() while the theme loads. The Core constructor creates Block_Patterns, whose constructor calls setup_properties(), which runs __( 'Riverbank Patterns', 'riverbank' ) before after_setup_theme.
Fix: the same as Jaxon 1.0.9 (Codeinwp/jaxon commit c7f8818) and Neve FSE (Codeinwp/neve-fse#170): move $this->setup_properties(); from Block_Patterns::__construct() into run(), which runs on init.
Reproduce:
- WordPress 6.7 or later with
WP_DEBUGandWP_DEBUG_LOGon, Riverbank 1.0.18 active. - Put any translation file for the theme at
wp-content/languages/themes/riverbank-<locale>.moand use that locale (an emptyriverbank-en_US.moon an English site is enough). - Load any page.
Expect: no notice. Actual: the notice above in wp-content/debug.log on every request.
Found by the WordPress compatibility routine (Codeinwp/qa-compatibility): Riverbank 1.0.12 logs nothing on WordPress 6.6.12 and logs the notice on 6.7; 1.0.18 logs it on 7.0.8, 7.1.5 and 7.2-RC2.
- Dominant language
- PHP
- Stars
- 2
- Forks
- 0
- Avg merge
- 4h 59m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Codeinwp/riverbank
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug customer report
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
customer report new feature
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in Codeinwp/riverbank
Similar issues
-
sync-en
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
a11y
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
omeka/plugin-ExhibitBuilder#169 ·
-
35-feedback
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day