Code Duplication    Length = 7-10 lines in 2 locations

_inc/lib/core-api/class.jetpack-core-api-site-endpoints.php 1 location

@@ 34-40 (lines=7) @@
31
		$results = json_decode( $response['body'], true );
32
33
		// Bail if there were no results or plan details returned
34
		if ( ! is_array( $results ) ) {
35
			return new WP_Error(
36
				'failed_to_fetch_data',
37
				esc_html__( 'Unable to fetch the requested data.', 'jetpack' ),
38
				array( 'status' => 500 )
39
			);
40
		}
41
42
		return rest_ensure_response( array(
43
				'code' => 'success',

_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php 1 location

@@ 1592-1601 (lines=10) @@
1589
		}
1590
1591
		$verification_services_codes = get_option( 'verification_services_codes' );
1592
		if (
1593
			! is_array( $verification_services_codes )
1594
			|| empty( $verification_services_codes )
1595
		) {
1596
			return new WP_Error(
1597
				'empty',
1598
				esc_html__( 'Site not verified with any service.', 'jetpack' ),
1599
				array( 'status' => 404 )
1600
			);
1601
		}
1602
1603
		$services = array();
1604
		foreach ( jetpack_verification_services() as $name => $service ) {