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

Text domain bug in WordPress 6.7 and above [issue #107] #108

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

Ramin-Farhadi
Copy link
Contributor

@Ramin-Farhadi Ramin-Farhadi commented Jan 30, 2025

Text domain bug in WordPress 6.7 and above #107

After debugging, I found that ATHENA_SC__CACHE_BUST was being defined too early in the plugin loading sequence.
This caused _load_textdomain_just_in_time warnings, indicating that translation files were being loaded prematurely.

🔍 Debugging Process:
I traced the call stack and found that get_plugin_data() was triggering _load_textdomain_just_in_time too early.
I logged various WordPress hooks (plugins_loaded, init) to determine the correct execution timing.
Moving the definition of ATHENA_SC__CACHE_BUST to an init hook resolved the issue.

✅ Fix Implemented:
Wrapped define( 'ATHENA_SC__CACHE_BUST', athena_sc_get_cache_bust() ); inside an init hook.
Ensured translations and other plugin functions load only after WordPress initializes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires an update to the documentation.
  • I have updated the documentation accordingly.

@Ramin-Farhadi Ramin-Farhadi self-assigned this Jan 30, 2025
@Ramin-Farhadi Ramin-Farhadi requested a review from a team as a code owner January 30, 2025 19:43
@Ramin-Farhadi Ramin-Farhadi requested review from jmbarne3 and kimberspencer and removed request for a team January 30, 2025 19:43
athena-shortcodes.php Outdated Show resolved Hide resolved
@Ramin-Farhadi Ramin-Farhadi merged commit 1589f32 into rc-v0.7.10 Jan 31, 2025
@Ramin-Farhadi Ramin-Farhadi deleted the load-textdomain-bug branch January 31, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants