class.jetpack.php 1 location
|
@@ 4658-4669 (lines=12) @@
|
| 4655 |
|
* |
| 4656 |
|
* @return bool If it worked. |
| 4657 |
|
*/ |
| 4658 |
|
static function do_server_side_stat( $args ) { |
| 4659 |
|
$response = wp_remote_get( esc_url_raw( self::build_stats_url( $args ) ) ); |
| 4660 |
|
if ( is_wp_error( $response ) ) { |
| 4661 |
|
return false; |
| 4662 |
|
} |
| 4663 |
|
|
| 4664 |
|
if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { |
| 4665 |
|
return false; |
| 4666 |
|
} |
| 4667 |
|
|
| 4668 |
|
return true; |
| 4669 |
|
} |
| 4670 |
|
|
| 4671 |
|
/** |
| 4672 |
|
* Builds the stats url. |
packages/mc-stats/src/class-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. |