Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notice: Function _load_textdomain_just_in_time was called incorrectly #3108

Open
BhargavBhandari90 opened this issue Feb 25, 2025 · 6 comments · May be fixed by #3109
Open

Notice: Function _load_textdomain_just_in_time was called incorrectly #3108

BhargavBhandari90 opened this issue Feb 25, 2025 · 6 comments · May be fixed by #3109
Labels
Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. [Type] Bug Something isn't working on the Learn website.

Comments

@BhargavBhandari90
Copy link

BhargavBhandari90 commented Feb 25, 2025

Notice on the screen when we setup repo locally.
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the sensei-lms 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](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/) for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6121 Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the jetpack 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](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/) for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6121

Description

When we try to setup learn site locally by following series of command given in readme.md and when we try to access site by localhost:8888, then it shows notice on the top of the screen.

Step-by-step reproduction instructions (optional)

  1. Clone the repo
  2. Run following commands:
  • yarn
  • yarn run create
  • Visit site localhost:8888
  1. See the top of the browser.

Screenshots or screen recording (optional)

Image

@BhargavBhandari90 BhargavBhandari90 added the Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. label Feb 25, 2025
@github-actions github-actions bot added the [Type] Bug Something isn't working on the Learn website. label Feb 25, 2025
@BhargavBhandari90
Copy link
Author

BhargavBhandari90 commented Feb 25, 2025

I've quickly tried to debug this issue and found that we need following updated plugins needs to be installed:

  • Jetpack
  • Sensei LMS

When I updated these plugins from wp-admin, notice has gone after that.

@BhargavBhandari90
Copy link
Author

Further debugging, I've found that we are installing pluigns via this line https://github.com/WordPress/Learn/blob/trunk/bin/index.sh#L18 ( let me know if this is correct ).

Questions:

  • Why it is not installing latest plugins?
  • Is it installing versions same as LIVE site?

@jonathanbossenger
Copy link
Collaborator

Aha, well found.

Essentially, the plugins are updated only when necessary, and we don't control which versions are installed, as that's managed by the Meta team that manages the entire .org infrastructure.

My recommendation then is to keep supressing the errors locally, eventually those plugins will get updated, and the issue will go away.

@BhargavBhandari90
Copy link
Author

Got it. I thought the same. Closing the issue now. Thanks

@dd32
Copy link
Member

dd32 commented Feb 27, 2025

Essentially, the plugins are updated only when necessary, and we don't control which versions are installed, as that's managed by the Meta team that manages the entire .org infrastructure.

To clarify, Meta only controls the versions deployed to learn.wordpress.org, not the versions installed locally.

npm run wp-env run cli wp plugin activate edit-flow jetpack wordpress-importer sensei-lms gutenberg locale-detection code-syntax-block wporg-learn

When you run locally, the above wp-cli command activates the plugins, but the versions are per what was installed, per composer.
Composer is not good at this IMHO. It's not suitable for the purpose of which learn is being used in.

Learn/composer.json

Lines 70 to 75 in d1bf93d

"wpackagist-plugin/code-syntax-block": "*",
"wpackagist-plugin/edit-flow": "*",
"wpackagist-plugin/gutenberg": "*",
"wpackagist-plugin/jetpack": "*",
"wpackagist-plugin/sensei-lms": "*",
"wpackagist-plugin/wordpress-importer": "*",

The above specifies that any version (latest..) of those plugins should be installed, but because composer.lock exists, it uses the locked versions from there:

Learn/composer.lock

Lines 799 to 816 in d1bf93d

{
"name": "wpackagist-plugin/sensei-lms",
"version": "4.24.0",
"source": {
"type": "svn",
"url": "https://plugins.svn.wordpress.org/sensei-lms/",
"reference": "tags/4.24.0"
},
"dist": {
"type": "zip",
"url": "https://downloads.wordpress.org/plugin/sensei-lms.4.24.0.zip"
},
"require": {
"composer/installers": "^1.0 || ^2.0"
},
"type": "wordpress-plugin",
"homepage": "https://wordpress.org/plugins/sensei-lms/"
},

Due to the way composer works, it's not possible to install the latest version of the plugins, unless the lock file is not distributed. My personal preference is to never commit the composer.lock file to a repository, such that everyone ends up with the latest version of packages. This might be a solution for the learn repo.

I'm re-opening this, because at the minimum we probably need to update the composer.lock file.

@dd32 dd32 reopened this Feb 27, 2025
@BhargavBhandari90
Copy link
Author

BhargavBhandari90 commented Feb 27, 2025

Thanks for the information. I'll update the lock file.

@BhargavBhandari90 BhargavBhandari90 linked a pull request Feb 27, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. [Type] Bug Something isn't working on the Learn website.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants