Woo-Vipps Plugin Translation Loading Bug
-
Woo-Vipps Plugin Translation Loading Bug Report Issue Summary
The plugin fails to load translations correctly because it uses an incorrect path when calling
load_plugin_textdomain(). Problem LocationFile:
payment/Vipps.class.php
Line: 2382
Method:after_setup_theme()Current (Incorrect) Code$ok = Vipps::load_plugin_textdomain('woo-vipps', false, basename( dirname( __FILE__ ) ) . "/languages");Problem
__FILE__in this context ispayment/Vipps.class.phpbasename(dirname(__FILE__))returns"payment"- This results in the path:
"payment/languages" - WordPress looks for:
wp-content/plugins/woo-vipps/payment/languages/woo-vipps-{locale}.mo - But the actual file is at:
wp-content/plugins/woo-vipps/languages/woo-vipps-{locale}.mo
Expected Behavior
The plugin should use the correct path:
"woo-vipps/languages"FixChange line 2382 from:
$ok = Vipps::load_plugin_textdomain('woo-vipps', false, basename( dirname( __FILE__ ) ) . "/languages");To:
$ok = Vipps::load_plugin_textdomain('woo-vipps', false, basename( dirname( dirname( __FILE__ ) ) ) . "/languages");This goes up two directory levels (from
payment/Vipps.class.phptowoo-vipps) instead of one. Impact- All translations fail to load (plugin shows English text regardless of WordPress locale)
- Affects all locales (da_DK, sv_SE, nb_NO, fi, etc.)
- Users see untranslated strings like “Please wait while we are preparing your order” instead of localized versions
Verification
Translation files exist at the correct location:
woo-vipps/languages/woo-vipps-da_DK.mo✓woo-vipps/languages/woo-vipps-sv_SE.mo✓- etc.
But plugin tries to load from:
woo-vipps/payment/languages/woo-vipps-da_DK.mo✗ (doesn’t exist)
Test Case
- Set WordPress locale to
da_DK - Navigate to Vipps express checkout page
- Expected: “Vent venligst mens vi forbereder din ordre”
- Actual: “Please wait while we are preparing your order”
Plugin Version
Tested on: 5.1.1
You must be logged in to reply to this topic.