Code Duplication    Length = 12-12 lines in 2 locations

packages/a8c-mc-stats/src/class-a8c-mc-stats.php 1 location

@@ 139-150 (lines=12) @@
136
	 *
137
	 * @return bool If it worked.
138
	 */
139
	public function do_server_side_stat( $url ) {
140
		$response = wp_remote_get( esc_url_raw( $url ) );
141
		if ( is_wp_error( $response ) ) {
142
			return false;
143
		}
144
145
		if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
146
			return false;
147
		}
148
149
		return true;
150
	}
151
152
	/**
153
	 * Builds the stats url.

class.jetpack.php 1 location

@@ 4578-4589 (lines=12) @@
4575
	 *
4576
	 * @return bool If it worked.
4577
	 */
4578
	static function do_server_side_stat( $args ) {
4579
		$response = wp_remote_get( esc_url_raw( self::build_stats_url( $args ) ) );
4580
		if ( is_wp_error( $response ) ) {
4581
			return false;
4582
		}
4583
4584
		if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
4585
			return false;
4586
		}
4587
4588
		return true;
4589
	}
4590
4591
	/**
4592
	 * Builds the stats url.