close
Skip to content

[Backport to release/10.7] [WOOPLUG-6477] fix: fix _load_textdomain_just_in_time warning in FulfillmentsController::register_data_stores#63893

Merged
tpaksu merged 1 commit into
release/10.7from
cherry-pick-PR63888-to-release/10.7
Mar 27, 2026
Merged

[Backport to release/10.7] [WOOPLUG-6477] fix: fix _load_textdomain_just_in_time warning in FulfillmentsController::register_data_stores#63893
tpaksu merged 1 commit into
release/10.7from
cherry-pick-PR63888-to-release/10.7

Conversation

@woocommercebot
Copy link
Copy Markdown
Collaborator

This PR is a cherry-pick of #63888 to release/10.7.

Original PR Description

Submission Review Guidelines:

Changes proposed in this Pull Request:

Fixes _load_textdomain_just_in_time warning triggered when FulfillmentsController::register_data_stores() calls FeaturesController::feature_is_enabled() before the init action fires.

When plugins like WC Payments call WC_Data_Store::load() during plugins_loaded, the woocommerce_data_stores filter fires, and feature_is_enabled() triggers init_feature_definitions() which uses __() for translations. This causes WordPress to warn about loading textdomains too early.

The fix checks the option directly with get_option() instead of going through FeaturesController::feature_is_enabled(), matching the established pattern in OrdersVersionStringInvalidator, TaxRateVersionStringInvalidator, and ProductVersionStringInvalidator.

Related issue: WOOPLUG-6477

Screenshots or screen recordings:

Before After

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Install and activate WooCommerce Payments plugin (or any plugin that calls WC_Data_Store::load() during plugins_loaded)
  2. Enable the fulfillments feature flag
  3. Enable WP_DEBUG and WP_DEBUG_LOG
  4. Load any admin page
  5. Check wp-content/debug.log for _load_textdomain_just_in_time warnings related to the woocommerce textdomain
  6. Verify no such warning appears after the fix

Testing that has already taken place:

Milestone

Note: Check the box above to have the milestone automatically assigned when merged.
Alternatively (e.g. for point releases), manually assign the appropriate milestone.

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Fix _load_textdomain_just_in_time warning in FulfillmentsController by checking feature option directly instead of using FeaturesController::feature_is_enabled() before init action.

Changelog Entry Comment

Comment

…illmentsController::register_data_stores (#63888)

* [WOOPLUG-6477] fix: fix _load_textdomain_just_in_time warning in FulfillmentsController::register_data_stores

* Use get_option() instead of feature_is_enabled() in register_data_stores

The woocommerce_data_stores filter can fire before the 'init' action
(e.g. when WC Payments initializes during plugins_loaded). Calling
FeaturesController::feature_is_enabled() at that point triggers
init_feature_definitions() which uses __() for translations, causing
a _load_textdomain_just_in_time warning.

Check the option directly with get_option(), matching the pattern
used in OrdersVersionStringInvalidator, TaxRateVersionStringInvalidator,
and ProductVersionStringInvalidator.

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: woocommercebot <woocommercebot@users.noreply.github.com>
@woocommercebot woocommercebot requested a review from tpaksu March 27, 2026 09:26
@github-actions github-actions Bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Mar 27, 2026
@github-actions github-actions Bot added this to the 10.7.0 milestone Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Testing Guidelines

Hi @tpaksu ,

Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

Reminder: PR reviewers are required to document testing performed. This includes:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

@tpaksu tpaksu enabled auto-merge (squash) March 27, 2026 09:26
@github-actions
Copy link
Copy Markdown
Contributor

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

@tpaksu tpaksu merged commit cb01274 into release/10.7 Mar 27, 2026
42 of 43 checks passed
@tpaksu tpaksu deleted the cherry-pick-PR63888-to-release/10.7 branch March 27, 2026 09:39
@github-actions github-actions Bot added the metric: feature freeze exception A tracking label for PRs that were merged after the feature freeze. label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metric: feature freeze exception A tracking label for PRs that were merged after the feature freeze. plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants