Merge pull request #7567 from tamarazuk/system-status-fatal-fix
System Status: Fix fatal error when `$response` is not an object
This commit is contained in:
commit
3d2ee4f54a
|
@ -224,8 +224,10 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
|
|||
$posting['wp_remote_post']['success'] = true;
|
||||
} else {
|
||||
$posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'woocommerce' );
|
||||
if ( $response->get_error_message() ) {
|
||||
if ( is_wp_error( $response ) ) {
|
||||
$posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Error: %s', 'woocommerce' ), wc_clean( $response->get_error_message() ) );
|
||||
} else {
|
||||
$posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'woocommerce' ), wc_clean( $response['response']['code'] ) );
|
||||
}
|
||||
$posting['wp_remote_post']['success'] = false;
|
||||
}
|
||||
|
@ -240,8 +242,10 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
|
|||
$posting['wp_remote_get']['success'] = true;
|
||||
} else {
|
||||
$posting['wp_remote_get']['note'] = __( 'wp_remote_get() failed. The WooCommerce plugin updater won\'t work with your server. Contact your hosting provider.', 'woocommerce' );
|
||||
if ( $response->get_error_message() ) {
|
||||
if ( is_wp_error( $response ) ) {
|
||||
$posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Error: %s', 'woocommerce' ), wc_clean( $response->get_error_message() ) );
|
||||
} else {
|
||||
$posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'woocommerce' ), wc_clean( $response['response']['code'] ) );
|
||||
}
|
||||
$posting['wp_remote_get']['success'] = false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue