@@ -473,7 +473,7 @@ private function _load_server_pk($from_wpapi = false)
473
473
if ($ from_wpapi ) {
474
474
$ server_key_url = self ::CLOUD_SERVER_WP . '/ ' . self ::API_SERVER_KEY_SIGN ;
475
475
}
476
- $ resp = wp_remote_get ($ server_key_url );
476
+ $ resp = wp_safe_remote_get ($ server_key_url );
477
477
if (is_wp_error ($ resp )) {
478
478
self ::debugErr ('Failed to load key: ' . $ resp ->get_error_message ());
479
479
return false ;
@@ -1036,7 +1036,7 @@ public function detect_cloud($service, $force = false)
1036
1036
// TODO
1037
1037
$ valid_cloud_loads = array ();
1038
1038
foreach ($ valid_clouds as $ k => $ v ) {
1039
- $ response = wp_remote_get ($ v , array ('timeout ' => 5 ));
1039
+ $ response = wp_safe_remote_get ($ v , array ('timeout ' => 5 ));
1040
1040
if (is_wp_error ($ response )) {
1041
1041
$ error_message = $ response ->get_error_message ();
1042
1042
self ::debug ('failed to do load checker: ' . $ error_message );
@@ -1188,7 +1188,7 @@ private function _get($service, $data = false)
1188
1188
1189
1189
self ::save_summary (array ('curr_request. ' . $ service_tag => time ()));
1190
1190
1191
- $ response = wp_remote_get ($ url , array (
1191
+ $ response = wp_safe_remote_get ($ url , array (
1192
1192
'timeout ' => 15 ,
1193
1193
'headers ' => array ('Accept ' => 'application/json ' ),
1194
1194
));
@@ -1361,7 +1361,7 @@ private function _post($service, $data = false, $time_out = false)
1361
1361
1362
1362
self ::save_summary (array ('curr_request. ' . $ service_tag => time ()));
1363
1363
1364
- $ response = wp_remote_post ($ url , array (
1364
+ $ response = wp_safe_remote_post ($ url , array (
1365
1365
'body ' => $ param ,
1366
1366
'timeout ' => $ time_out ?: 15 ,
1367
1367
'headers ' => array ('Accept ' => 'application/json ' , 'Expect ' => '' ),
@@ -1844,7 +1844,7 @@ private function _update_ips()
1844
1844
// Prevent multiple call in a short period
1845
1845
self ::save_summary (array ('ips_ts ' => time (), 'ips_ts_runner ' => time ()));
1846
1846
1847
- $ response = wp_remote_get (self ::CLOUD_IPS . '?json ' );
1847
+ $ response = wp_safe_remote_get (self ::CLOUD_IPS . '?json ' );
1848
1848
if (is_wp_error ($ response )) {
1849
1849
$ error_message = $ response ->get_error_message ();
1850
1850
self ::debug ('failed to get ip whitelist: ' . $ error_message );
0 commit comments