Code Duplication    Length = 3-6 lines in 4 locations

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

@@ 222-224 (lines=3) @@
219
			$return_url = wc_get_endpoint_url( 'order-received', '', wc_get_page_permalink( 'checkout' ) );
220
		}
221
222
		if ( is_ssl() || get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' ) {
223
			$return_url = str_replace( 'http:', 'https:', $return_url );
224
		}
225
226
		return apply_filters( 'woocommerce_get_return_url', $return_url, $order );
227
	}

includes/class-wc-order.php 2 locations

@@ 1495-1497 (lines=3) @@
1492
	public function get_checkout_payment_url( $on_checkout = false ) {
1493
		$pay_url = wc_get_endpoint_url( 'order-pay', $this->get_id(), wc_get_page_permalink( 'checkout' ) );
1494
1495
		if ( 'yes' === get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) {
1496
			$pay_url = str_replace( 'http:', 'https:', $pay_url );
1497
		}
1498
1499
		if ( $on_checkout ) {
1500
			$pay_url = add_query_arg( 'key', $this->get_order_key(), $pay_url );
@@ 1521-1523 (lines=3) @@
1518
	public function get_checkout_order_received_url() {
1519
		$order_received_url = wc_get_endpoint_url( 'order-received', $this->get_id(), wc_get_page_permalink( 'checkout' ) );
1520
1521
		if ( 'yes' === get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) {
1522
			$order_received_url = str_replace( 'http:', 'https:', $order_received_url );
1523
		}
1524
1525
		$order_received_url = add_query_arg( 'key', $this->get_order_key(), $order_received_url );
1526

includes/wc-core-functions.php 1 location

@@ 1282-1287 (lines=6) @@
1279
 */
1280
function wc_get_checkout_url() {
1281
	$checkout_url = wc_get_page_permalink( 'checkout' );
1282
	if ( $checkout_url ) {
1283
		// Force SSL if needed.
1284
		if ( is_ssl() || 'yes' === get_option( 'woocommerce_force_ssl_checkout' ) ) {
1285
			$checkout_url = str_replace( 'http:', 'https:', $checkout_url );
1286
		}
1287
	}
1288
1289
	return apply_filters( 'woocommerce_get_checkout_url', $checkout_url );
1290
}