From 5a92126a3913d12e0c635f4a68799bbbb74dd66b Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 5 May 2015 13:39:34 +0100 Subject: [PATCH] Remove all sslverify false Closes #8058 cc @claudiosmweb @roykho @barrykooij --- includes/admin/class-wc-admin-welcome.php | 2 +- includes/admin/views/html-admin-page-status-report.php | 1 - includes/class-wc-language-pack-upgrader.php | 4 ++-- includes/class-wc-webhook.php | 1 - .../paypal/includes/class-wc-gateway-paypal-ipn-handler.php | 5 ++--- .../paypal/includes/class-wc-gateway-paypal-pdt-handler.php | 3 +-- .../paypal/includes/class-wc-gateway-paypal-refund.php | 1 - 7 files changed, 6 insertions(+), 11 deletions(-) diff --git a/includes/admin/class-wc-admin-welcome.php b/includes/admin/class-wc-admin-welcome.php index d2413af87f9..cfa6aeb33ca 100644 --- a/includes/admin/class-wc-admin-welcome.php +++ b/includes/admin/class-wc-admin-welcome.php @@ -404,7 +404,7 @@ class WC_Admin_Welcome { return $contributors; } - $response = wp_remote_get( 'https://api.github.com/repos/woothemes/woocommerce/contributors', array( 'sslverify' => false ) ); + $response = wp_remote_get( 'https://api.github.com/repos/woothemes/woocommerce/contributors' ); if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { return array(); diff --git a/includes/admin/views/html-admin-page-status-report.php b/includes/admin/views/html-admin-page-status-report.php index a2e8d6f9f6e..11de32748c5 100644 --- a/includes/admin/views/html-admin-page-status-report.php +++ b/includes/admin/views/html-admin-page-status-report.php @@ -224,7 +224,6 @@ if ( ! defined( 'ABSPATH' ) ) { $posting['wp_remote_post']['help'] = '[?]'; $response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array( - 'sslverify' => false, 'timeout' => 60, 'user-agent' => 'WooCommerce/' . WC()->version, 'body' => array( diff --git a/includes/class-wc-language-pack-upgrader.php b/includes/class-wc-language-pack-upgrader.php index a1e91d62dc2..096b9a16563 100644 --- a/includes/class-wc-language-pack-upgrader.php +++ b/includes/class-wc-language-pack-upgrader.php @@ -109,7 +109,7 @@ class WC_Language_Pack_Upgrader { * @return bool */ public function check_if_language_pack_exists() { - $response = wp_remote_get( $this->get_language_package_uri(), array( 'sslverify' => false, 'timeout' => 60 ) ); + $response = wp_remote_get( $this->get_language_package_uri(), array( 'timeout' => 60 ) ); if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { return true; @@ -188,7 +188,7 @@ class WC_Language_Pack_Upgrader { } // Download the language pack - $response = wp_remote_get( $this->get_language_package_uri(), array( 'sslverify' => false, 'timeout' => 60 ) ); + $response = wp_remote_get( $this->get_language_package_uri(), array( 'timeout' => 60 ) ); if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { global $wp_filesystem; diff --git a/includes/class-wc-webhook.php b/includes/class-wc-webhook.php index daa0665880b..c3ba399288f 100644 --- a/includes/class-wc-webhook.php +++ b/includes/class-wc-webhook.php @@ -191,7 +191,6 @@ class WC_Webhook { 'timeout' => MINUTE_IN_SECONDS, 'redirection' => 0, 'httpversion' => '1.0', - 'sslverify' => false, 'blocking' => true, 'user-agent' => sprintf( 'WooCommerce/%s Hookshot (WordPress/%s)', WC_VERSION, $GLOBALS['wp_version'] ), 'body' => trim( json_encode( $payload ) ), diff --git a/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php b/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php index 6d2ec8a2367..12fd6434c4e 100644 --- a/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php +++ b/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php @@ -76,7 +76,6 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response { // Send back post vars to paypal $params = array( 'body' => $validate_ipn, - 'sslverify' => false, 'timeout' => 60, 'httpversion' => '1.1', 'compress' => false, @@ -184,9 +183,9 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response { if ( ! empty( $posted['mc_fee'] ) ) { // log paypal transaction fee - update_post_meta( $order->id, 'PayPal Transaction Fee', wc_clean( $posted['mc_fee'] ) ); + update_post_meta( $order->id, 'PayPal Transaction Fee', wc_clean( $posted['mc_fee'] ) ); } - + } else { $this->payment_on_hold( $order, sprintf( __( 'Payment pending: %s', 'woocommerce' ), $posted['pending_reason'] ) ); } diff --git a/includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php b/includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php index 36082c8f667..9a67e11ad19 100644 --- a/includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php +++ b/includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php @@ -36,7 +36,6 @@ class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_Response { 'tx' => $transaction, 'at' => $this->identity_token ), - 'sslverify' => false, 'timeout' => 60, 'httpversion' => '1.1', 'user-agent' => 'WooCommerce/' . WC_VERSION @@ -78,7 +77,7 @@ class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_Response { if ( ! empty( $_REQUEST['mc_fee'] ) ) { // log paypal transaction fee - update_post_meta( $order->id, 'PayPal Transaction Fee', wc_clean( $_REQUEST['mc_fee'] ) ); + update_post_meta( $order->id, 'PayPal Transaction Fee', wc_clean( $_REQUEST['mc_fee'] ) ); } } } diff --git a/includes/gateways/paypal/includes/class-wc-gateway-paypal-refund.php b/includes/gateways/paypal/includes/class-wc-gateway-paypal-refund.php index ad9f94d53b9..8a8e0ff0611 100644 --- a/includes/gateways/paypal/includes/class-wc-gateway-paypal-refund.php +++ b/includes/gateways/paypal/includes/class-wc-gateway-paypal-refund.php @@ -59,7 +59,6 @@ class WC_Gateway_Paypal_Refund { 'method' => 'POST', 'body' => self::get_request( $order, $amount, $reason ), 'timeout' => 70, - 'sslverify' => false, 'user-agent' => 'WooCommerce', 'httpversion' => '1.1' )