Skip to content

Commit 648b49b

Browse files
lots of phpcs cleanups
1 parent a9f4f33 commit 648b49b

File tree

8 files changed

+18
-17
lines changed

8 files changed

+18
-17
lines changed

src/wp-admin/includes/class-wp-debug-data.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ private static function get_wp_core(): array {
298298
$fields['update_api_base'] = array(
299299
'label' => 'Update API URL',
300300
'value' => $update_api_base,
301-
'debug' => true
301+
'debug' => true,
302302
);
303303

304304
$update_dom = parse_url( wp_get_update_api_base(), PHP_URL_HOST );
@@ -316,7 +316,7 @@ private static function get_wp_core(): array {
316316
'label' => __( 'Communication with update API' ),
317317
'value' => sprintf(
318318
/* Translators: 1: hostname of update API, 2: IP address the update API hostname resolves to. 3: The error returned by the lookup */
319-
__('Unable to reach %1$s (%2$s): %3$s' ),
319+
__( 'Unable to reach %1$s (%2$s): %3$s' ),
320320
$update_dom;
321321
gethostbyname( $update_dom ),
322322
$wp_update_api->get_error_message(),

src/wp-admin/includes/class-wp-site-health.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ public function get_test_alt_update_api_communication() {
13911391
__( 'Error' ),
13921392
sprintf(
13931393
/* translators: 1: update API URL. 2: The IP address the update API endpoint resolves to. 3: The error returned by the lookup. */
1394-
__( 'Your site is unable to reach the specified update API endpoint (%s) at %s, and returned the error: %s' ),
1394+
__( 'Your site is unable to reach the specified update API endpoint (%1$s) at %2$s, and returned the error: %3$s' ),
13951395
wp_get_api_request_url(),
13961396
gethostbyname( parse_url( wp_get_api_request_url(), PHP_URL_HOST ) ),
13971397
$wp_update_api->get_error_message()
@@ -1401,7 +1401,7 @@ public function get_test_alt_update_api_communication() {
14011401

14021402
$result['actions'] = sprintf(
14031403
/* translators: URL of update API */
1404-
__('Contact the owners of %s for support.'),
1404+
__( 'Contact the owners of %s for support.' ),
14051405
wp_get_api_request_url()
14061406
);
14071407
}

src/wp-admin/includes/network.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ function network_step2( $errors = false ) {
554554

555555
if ( ! empty( $keys_salts ) ) {
556556
$keys_salts_str = '';
557-
$from_api = wp_remote_get( wp_get_api_request_url( '/secret-key/1.1/salt/') );
557+
$from_api = wp_remote_get( wp_get_api_request_url( '/secret-key/1.1/salt/' ) );
558558
if ( is_wp_error( $from_api ) ) {
559559
foreach ( $keys_salts as $c => $v ) {
560560
$keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );";

src/wp-admin/includes/translation-install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function translations_api( $type, $args = null ) {
5050
$res = apply_filters( 'translations_api', false, $type, $args );
5151

5252
if ( false === $res ) {
53-
$url = wp_get_api_request_url( '/translations/' . $type . '/1.0/' , 'http' );
53+
$url = wp_get_api_request_url( '/translations/' . $type . '/1.0/', 'http' );
5454
$http_url = $url;
5555
$ssl = wp_http_supports( array( 'ssl' ) );
5656
if ( $ssl ) {

src/wp-includes/functions.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9224,20 +9224,21 @@ function wp_verify_fast_hash(
92249224

92259225
/**
92269226
* Given a path, returns the complete URL for a WP API request.
9227-
*
9227+
*
92289228
* @since 7.0.0
9229-
*
9229+
*
92309230
* @param string $path The API endpoint to request.
92319231
* @param string $scheme Optional. Scheme for request. Defaults to https.
92329232
* @return string Complete URL for this request.
9233+
*
92339234
*/
92349235
function wp_get_api_request_url( $path = '/', $scheme = 'https' ) {
92359236
$domain = WP_UPDATE_API_DEFAULT;
9236-
if (false !== getenv('WP_UPDATE_API_BASE')) {
9237-
$domain = getenv('WP_UPDATE_API_BASE');
9237+
if (false !== getenv( 'WP_UPDATE_API_BASE' ) ) {
9238+
$domain = getenv( 'WP_UPDATE_API_BASE' );
92389239
}
92399240

9240-
$uri = $scheme . "://" . $domain . $path ;
9241+
$uri = $scheme . '://' . $domain . $path;
92419242
/**
92429243
* Filters the URL for a WP API request.
92439244
*
@@ -9246,5 +9247,5 @@ function wp_get_api_request_url( $path = '/', $scheme = 'https' ) {
92469247
* @param string $url URL
92479248
*/
92489249
$uri = apply_filters( 'wp_api_request');
9249-
return $uri;
9250+
return $uri;
92509251
}

src/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function get_items( $request ) {
114114
$raw_patterns = get_site_transient( $transient_key );
115115

116116
if ( ! $raw_patterns ) {
117-
$api_url = wp_get_update_api_base( $https = false ) . '/patterns/1.0/?' . build_query( $query_args );
117+
$api_url = wp_get_api_request_url( '/patterns/1.0/?' . build_query( $query_args ) , 'http' );
118118
if ( wp_http_supports( array( 'ssl' ) ) ) {
119119
$api_url = set_url_scheme( $api_url, 'https' );
120120
}

src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function register_routes() {
135135
array(
136136
'methods' => 'GET',
137137
'callback' => array( $this, 'test_alt_update_api_communication' ),
138-
'permission_callback' => function() {
138+
'permission_callback' => function () {
139139
return $this->validate_request_permission( 'alt_update_api_communication' );
140140
},
141141
),

src/wp-includes/update.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
188188
$query['channel'] = WP_AUTO_UPDATE_CORE;
189189
}
190190

191-
$url = wp_get_update_api_base( $https = false ). '/core/version-check/1.7/?' . http_build_query( $query, '', '&' );
191+
$url = wp_get_api_request_url( '/core/version-check/1.7/?' . http_build_query( $query, '', '&' ), 'http' );
192192
$http_url = $url;
193193
$ssl = wp_http_supports( array( 'ssl' ) );
194194

@@ -425,7 +425,7 @@ function wp_update_plugins( $extra_stats = array() ) {
425425
$options['body']['update_stats'] = wp_json_encode( $extra_stats );
426426
}
427427

428-
$url = wp_get_update_api_base( $https = false ). '/plugins/update-check/1.1/';
428+
$url = wp_get_api_request_url( '/plugins/update-check/1.1/', 'http' );
429429
$http_url = $url;
430430
$ssl = wp_http_supports( array( 'ssl' ) );
431431

@@ -710,7 +710,7 @@ function wp_update_themes( $extra_stats = array() ) {
710710
$options['body']['update_stats'] = wp_json_encode( $extra_stats );
711711
}
712712

713-
$url = wp_get_update_api_base( $https = false ) . '/themes/update-check/1.1/';
713+
$url = wp_get_api_request_url( '/themes/update-check/1.1/', 'http' );
714714
$http_url = $url;
715715
$ssl = wp_http_supports( array( 'ssl' ) );
716716

0 commit comments

Comments
 (0)