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
|
@@ 4571-4582 (lines=12) @@
|
| 4568 |
|
* |
| 4569 |
|
* @return bool If it worked. |
| 4570 |
|
*/ |
| 4571 |
|
static function do_server_side_stat( $args ) { |
| 4572 |
|
$response = wp_remote_get( esc_url_raw( self::build_stats_url( $args ) ) ); |
| 4573 |
|
if ( is_wp_error( $response ) ) { |
| 4574 |
|
return false; |
| 4575 |
|
} |
| 4576 |
|
|
| 4577 |
|
if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { |
| 4578 |
|
return false; |
| 4579 |
|
} |
| 4580 |
|
|
| 4581 |
|
return true; |
| 4582 |
|
} |
| 4583 |
|
|
| 4584 |
|
/** |
| 4585 |
|
* Builds the stats url. |