includes/class-fs-plugin-updater.php
private function fetch_wp_org_module_translation_updates( $module_type, $slug ) {
            $plugin_data = $this->_fs->get_plugin_data();

            $locales = array_values( get_available_languages() );
            $locales = apply_filters( "{$module_type}_update_check_locales", $locales );
            $locales = array_unique( $locales );

            $plugin_basename = $this->_fs->get_plugin_basename();
            if ( 'themes' === $module_type ) {
                $plugin_basename = $slug;
            }

            global $wp_version;

            $request_args = array(
                'timeout' => 15,
                'body'    => array(
                    "{$module_type}" => json_encode(
                        array(
                            "{$module_type}" => array(
                                $plugin_basename => array(
                                    'Name'   => trim( str_replace( $this->_fs->get_plugin()->premium_suffix, '', $plugin_data['Name'] ) ),
                                    'Author' => $plugin_data['Author'],
                                )
                            )
                        )
                    ),
                    'translations'    => json_encode( $this->get_installed_translations( $module_type, $slug ) ),
                    'locale'          => json_encode( $locales )
                ),
                'user-agent' => ( 'WordPress/' . $wp_version . '; ' . home_url( '/' ) )
            );

            $url = "http://api.wordpress.org/{$module_type}/update-check/1.1/";
            if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
                $url = set_url_scheme( $url, 'https' );
            }

            $raw_response = Freemius::safe_remote_post(
                $url,
                $request_args,
                WP_FS__TIME_24_HOURS_IN_SEC,
                WP_FS__TIME_12_HOURS_IN_SEC,
                false
            );

            if ( is_wp_error( $raw_response ) ) {
                return null;
            }

            $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );

            if ( ! is_array( $response ) ) {
                return null;
            }

            if ( ! isset( $response['translations'] ) || empty( $response['translations'] ) ) {
                return null;
            }

            return $response['translations'];
        }
private function fetch_wp_org_module_translation_updates( $module_type, $slug ) {
            $plugin_data = $this->_fs->get_plugin_data();

            $locales = array_values( get_available_languages() );
            $locales = apply_filters( "{$module_type}_update_check_locales", $locales );
            $locales = array_unique( $locales );

            $plugin_basename = $this->_fs->get_plugin_basename();
            if ( 'themes' === $module_type ) {
                $plugin_basename = $slug;
            }

            global $wp_version;

            $request_args = array(
                'timeout' => 15,
                'body'    => array(
                    "{$module_type}" => json_encode(
                        array(
                            "{$module_type}" => array(
                                $plugin_basename => array(
                                    'Name'   => trim( str_replace( $this->_fs->get_plugin()->premium_suffix, '', $plugin_data['Name'] ) ),
                                    'Author' => $plugin_data['Author'],
                                )
                            )
                        )
                    ),
                    'translations'    => json_encode( $this->get_installed_translations( $module_type, $slug ) ),
                    'locale'          => json_encode( $locales )
                ),
                'user-agent' => ( 'WordPress/' . $wp_version . '; ' . home_url( '/' ) )
            );

            $url = "http://api.wordpress.org/{$module_type}/update-check/1.1/";
            if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
                $url = set_url_scheme( $url, 'https' );
            }

            $raw_response = Freemius::safe_remote_post(
                $url,
                $request_args,
                WP_FS__TIME_24_HOURS_IN_SEC,
                WP_FS__TIME_12_HOURS_IN_SEC,
                false
            );

            if ( is_wp_error( $raw_response ) ) {
                return null;
            }

            $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );

            if ( ! is_array( $response ) ) {
                return null;
            }

            if ( ! isset( $response['translations'] ) || empty( $response['translations'] ) ) {
                return null;
            }

            return $response['translations'];
        }
private function fetch_wp_org_module_translation_updates ( $ module_type , $ slug ) { $ plugin_data = $ this -> _fs -> get_plugin_data ( ) ; $ locales = array_values ( get_available_languages ( ) ) ; $ locales = apply_filters ( "{$module_type}_update_check_locales" , $ locales ) ; $ locales = array_unique ( $ locales ) ; $ plugin_basename = $ this -> _fs -> get_plugin_basename ( ) ; if ( 'themes' === $ module_type ) { $ plugin_basename = $ slug ; } global $ wp_version ; $ request_args = array ( 'timeout' => 15 , 'body' => array ( "{$module_type}" => json_encode ( array ( "{$module_type}" => array ( $ plugin_basename => array ( 'Name' => trim ( str_replace ( $ this -> _fs -> get_plugin ( ) -> premium_suffix , '' , $ plugin_data [ 'Name' ] ) ) , 'Author' => $ plugin_data [ 'Author' ] , ) ) ) ) , 'translations' => json_encode ( $ this -> get_installed_translations ( $ module_type , $ slug ) ) , 'locale' => json_encode ( $ locales ) ) , 'user-agent' => ( 'WordPress/' . $ wp_version . '; ' . home_url ( '/' ) ) ) ; $ url = "http://api.wordpress.org/{$module_type}/update-check/1.1/" ; if ( $ ssl = wp_http_supports ( array ( 'ssl' ) ) ) { $ url = set_url_scheme ( $ url , 'https' ) ; } $ raw_response = Freemius :: safe_remote_post ( $ url , $ request_args , WP_FS__TIME_24_HOURS_IN_SEC , WP_FS__TIME_12_HOURS_IN_SEC , false ) ; if ( is_wp_error ( $ raw_response ) ) { return null ; } $ response = json_decode ( wp_remote_retrieve_body ( $ raw_response ) , true ) ; if ( ! is_array ( $ response ) ) { return null ; } if ( ! isset ( $ response [ 'translations' ] ) || empty ( $ response [ 'translations' ] ) ) { return null ; } return $ response [ 'translations' ] ; }
Fetches module translation updates from wordpress.org.

@author Leo Fajardo (@leorw)
@since  2.1.2

@param string $module_type
@param string $slug

@return array|null
Fetches module translation updates from wordpress . org .