Open
Reported for: WPML String Translation 3.2.8
Overview of the issue
Must-Use (MU) plugins are not available for string scanning under WPML > Theme and Plugins Localization page.
Workaround
Please, make sure of having a full backup of your site before proceeding.
- Open …/wp-content/plugins/wpml-string-translation/classes/menus/theme-plugin-localization-ui/class-st-plugin-localization-ui-utils.php file.
- Look for line 6.
- Replace:
/** @return array */ public function get_plugins() { $plugins = get_plugins(); $mu_plugins = wp_get_mu_plugins(); if ( $mu_plugins ) { foreach ( $mu_plugins as $p ) { $plugin_file = basename( $p ); $plugins[ $plugin_file ] = array( 'Name' => 'MU :: ' . $plugin_file ); } } return $plugins; }
- With:
public function get_plugins() { $plugins = get_plugins(); $mu_plugins = wp_get_mu_plugins(); if ( $mu_plugins ) { foreach ( $mu_plugins as $p ) { $plugin_file = basename( $p ); $plugins[ $plugin_file ] = array( 'Name' => 'MU :: ' . $plugin_file ); } //Workaround $folders = scandir(WPMU_PLUGIN_DIR); $folders = array_diff($folders, array('.', '..')); foreach($folders as $folder) { if (is_dir(WPMU_PLUGIN_DIR.'/'.$folder)) { $plugin_file = basename( $folder ); $plugins[ $plugin_file ] = array( 'Name' => 'MU :: ' . $plugin_file ); } } } return $plugins; }
Why is this not in the plugin proper?
This bug is already in our devs roadmap. We will update this page once it will be released.
Great! It was first raised four year ago ( https://wpml.org/forums/topic/scanning-for-strings-in-a-mu-plugin/ ) so it’s well past time to get this done.