Code Duplication    Length = 3-6 lines in 4 locations

includes/abstracts/abstract-wc-payment-gateway.php 1 location

@@ 101-103 (lines=3) @@
98
			$return_url = wc_get_endpoint_url( 'order-received', '', wc_get_page_permalink( 'checkout' ) );
99
		}
100
101
		if ( is_ssl() || get_option('woocommerce_force_ssl_checkout') == 'yes' ) {
102
			$return_url = str_replace( 'http:', 'https:', $return_url );
103
		}
104
105
		return apply_filters( 'woocommerce_get_return_url', $return_url, $order );
106
	}

includes/abstracts/abstract-wc-order.php 2 locations

@@ 2032-2034 (lines=3) @@
2029
2030
		$pay_url = wc_get_endpoint_url( 'order-pay', $this->id, wc_get_page_permalink( 'checkout' ) );
2031
2032
		if ( 'yes' == get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) {
2033
			$pay_url = str_replace( 'http:', 'https:', $pay_url );
2034
		}
2035
2036
		if ( $on_checkout ) {
2037
			$pay_url = add_query_arg( 'key', $this->order_key, $pay_url );
@@ 2054-2056 (lines=3) @@
2051
2052
		$order_received_url = wc_get_endpoint_url( 'order-received', $this->id, wc_get_page_permalink( 'checkout' ) );
2053
2054
		if ( 'yes' == get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) {
2055
			$order_received_url = str_replace( 'http:', 'https:', $order_received_url );
2056
		}
2057
2058
		$order_received_url = add_query_arg( 'key', $this->order_key, $order_received_url );
2059

includes/wc-core-functions.php 1 location

@@ 904-909 (lines=6) @@
901
 */
902
function wc_get_checkout_url() {
903
	$checkout_url = wc_get_page_permalink( 'checkout' );
904
	if ( $checkout_url ) {
905
		// Force SSL if needed
906
		if ( is_ssl() || 'yes' === get_option( 'woocommerce_force_ssl_checkout' ) ) {
907
			$checkout_url = str_replace( 'http:', 'https:', $checkout_url );
908
		}
909
	}
910
911
	return apply_filters( 'woocommerce_get_checkout_url', $checkout_url );
912
}