• Resolved alexmigf

    (@alexmigf)


    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:

    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)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.