Title: The `pll_get_plugin_info()` function loads wrong textdomain
Last modified: November 29, 2024

---

# The `pll_get_plugin_info()` function loads wrong textdomain

 *  Resolved [alexmigf](https://wordpress.org/support/users/alexmigf/)
 * (@alexmigf)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/the-pll_get_plugin_info-function-loads-wrong-textdomain/)
 * Hi,
 * Thank you for creating such an excellent plugin—it’s been incredibly helpful!
 * While using it, we noticed an issue where our paid plugins are being displayed
   with the incorrect text domain. Instead of loading the actual plugin text domain,
   the function is mistakenly loading the text domain of the built-in updater.
 * This appears to happen because the `pll_get_plugin_info()` function scans subdirectories
   within the plugin directory, which inadvertently includes the updater directory
   and causes this conflict.
 * I tested an alternative approach that avoids scanning subdirectories and seems
   to resolve the issue:
 *     ```wp-block-code
       function pll_get_plugin_info($plugin_slug) {    $all = get_plugins();    foreach ($all as $key => $item) {        // Get the base directory of the plugin file        $plugin_base_dir = dirname($key);        // Ensure the plugin name matches and avoid scanning subdirectories        if (pathinfo($key, PATHINFO_FILENAME) === $plugin_slug && strpos($plugin_base_dir, '/') === false) {            return $item; // Return the matched plugin directly        }    }    return [];}
       ```
   
 * Please feel free to adapt or modify this approach as you see fit. I hope it proves
   useful in addressing this issue!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [crossmediahouse](https://wordpress.org/support/users/crossmediahouse/)
 * (@crossmediahouse)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/the-pll_get_plugin_info-function-loads-wrong-textdomain/#post-18173195)
 * Hello Marcin – yes we encouter also issues with WP Overnight PDF plugin. The 
   invoices are random translated with different languages strings on the pdf. We
   use polylang Pro. Please advice!
 *  Plugin Author [Marcin Kazmierski](https://wordpress.org/support/users/marcinkazmierski/)
 * (@marcinkazmierski)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/the-pll_get_plugin_info-function-loads-wrong-textdomain/#post-18363016)
 * [@alexmigf](https://wordpress.org/support/users/alexmigf/) thank you! I added
   this in 3.4.9 version.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘The `pll_get_plugin_info()` function loads wrong textdomain’ is closed
to new replies.

 * ![](https://ps.w.org/theme-translation-for-polylang/assets/icon-256x256.png?rev
   =1431912)
 * [Theme and plugin translation for Polylang (TTfP)](https://wordpress.org/plugins/theme-translation-for-polylang/)
 * [Support Threads](https://wordpress.org/support/plugin/theme-translation-for-polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/theme-translation-for-polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/theme-translation-for-polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/theme-translation-for-polylang/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Marcin Kazmierski](https://wordpress.org/support/users/marcinkazmierski/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/the-pll_get_plugin_info-function-loads-wrong-textdomain/#post-18363016)
 * Status: resolved