Merge pull request #27148 from woocommerce/fix/dont-request-translations-with-no-locales

Don't request empty locales list for plugin translations.
This commit is contained in:
Néstor Soriano 2020-07-29 16:23:06 +02:00 committed by GitHub
commit d5bedd82b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -191,6 +191,11 @@ class WC_Helper_Updater {
$locales = apply_filters( 'plugins_update_check_locales', $locales ); $locales = apply_filters( 'plugins_update_check_locales', $locales );
$locales = array_unique( $locales ); $locales = array_unique( $locales );
// No locales, the respone will be empty, we can return now.
if ( empty( $locales ) ) {
return array();
}
// Scan local plugins which may or may not have a subscription. // Scan local plugins which may or may not have a subscription.
$plugins = WC_Helper::get_local_woo_plugins(); $plugins = WC_Helper::get_local_woo_plugins();
$active_woo_plugins = array_intersect( array_keys( $plugins ), get_option( 'active_plugins', array() ) ); $active_woo_plugins = array_intersect( array_keys( $plugins ), get_option( 'active_plugins', array() ) );