@@ 4676-4687 (lines=12) @@ | ||
4673 | * |
|
4674 | * @return bool If it worked. |
|
4675 | */ |
|
4676 | static function do_server_side_stat( $args ) { |
|
4677 | $response = wp_remote_get( esc_url_raw( self::build_stats_url( $args ) ) ); |
|
4678 | if ( is_wp_error( $response ) ) { |
|
4679 | return false; |
|
4680 | } |
|
4681 | ||
4682 | if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { |
|
4683 | return false; |
|
4684 | } |
|
4685 | ||
4686 | return true; |
|
4687 | } |
|
4688 | ||
4689 | /** |
|
4690 | * Builds the stats url. |
@@ 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. |