Passed
Push — master ( f411ba...4d2fb8 )
by Brian
05:15
created
templates/payment-forms/elements/ip_address.php 1 patch
Switch Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays the ip address in payment form
4 4
  *
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-if ( empty( $text ) ) {
13
-    $text = __( 'Your IP address is:', 'invoicing' );
12
+    if ( empty( $text ) ) {
13
+        $text = __( 'Your IP address is:', 'invoicing' );
14 14
 }
15 15
 
16
-?>
16
+    ?>
17 17
 <div class="form-group mb-3 getpaid-ip-info">
18 18
     <span><?php echo wp_kses_post( $text ); ?></span>
19 19
     <strong><?php echo esc_html( wpinv_get_ip() ); ?></strong>
Please login to merge, or discard this patch.
templates/payment-forms/elements/billing_email.php 1 patch
Switch Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a billing email input in payment form
4 4
  *
@@ -7,45 +7,45 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-$value = $query_value;
13
-$class = '';
12
+    $value = $query_value;
13
+    $class = '';
14 14
 
15
-if ( ! empty( $form->invoice ) ) {
16
-    $value   = sanitize_email( $form->invoice->get_email() );
15
+    if ( ! empty( $form->invoice ) ) {
16
+        $value   = sanitize_email( $form->invoice->get_email() );
17 17
 } elseif ( is_user_logged_in() ) {
18
-    $user  = wp_get_current_user();
19
-    $value = sanitize_email( $user->user_email );
18
+        $user  = wp_get_current_user();
19
+        $value = sanitize_email( $user->user_email );
20 20
 }
21 21
 
22
-if ( ! empty( $value ) && ! empty( $hide_billing_email ) ) {
23
-    $class = 'd-none';
22
+    if ( ! empty( $value ) && ! empty( $hide_billing_email ) ) {
23
+        $class = 'd-none';
24 24
 }
25 25
 
26
-do_action( 'getpaid_before_payment_form_billing_email', $form );
27
-
28
-echo "<span class='" . esc_attr( $class ) . "'>";
29
-
30
-aui()->input(
31
-    array(
32
-        'name'             => 'billing_email',
33
-        'id'               => esc_attr( $element_id ),
34
-        'placeholder'      => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
35
-        'required'         => ! empty( $required ),
36
-        'label'            => empty( $label ) ? '' : wp_kses_post( $label ) . '<span class="text-danger"> *</span>',
37
-        'label_type'       => 'vertical',
38
-        'help_text'        => empty( $description ) ? '' : wp_kses_post( $description ),
39
-        'type'             => 'email',
40
-        'value'            => apply_filters ( 'getpaid_payment_form_billing_email_value', $value ),
41
-        'class'            => 'wpinv_billing_email getpaid-refresh-on-change',
42
-        'extra_attributes' => array(
43
-            'autocomplete' => 'billing email',
26
+    do_action( 'getpaid_before_payment_form_billing_email', $form );
27
+
28
+    echo "<span class='" . esc_attr( $class ) . "'>";
29
+
30
+    aui()->input(
31
+        array(
32
+            'name'             => 'billing_email',
33
+            'id'               => esc_attr( $element_id ),
34
+            'placeholder'      => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
35
+            'required'         => ! empty( $required ),
36
+            'label'            => empty( $label ) ? '' : wp_kses_post( $label ) . '<span class="text-danger"> *</span>',
37
+            'label_type'       => 'vertical',
38
+            'help_text'        => empty( $description ) ? '' : wp_kses_post( $description ),
39
+            'type'             => 'email',
40
+            'value'            => apply_filters ( 'getpaid_payment_form_billing_email_value', $value ),
41
+            'class'            => 'wpinv_billing_email getpaid-refresh-on-change',
42
+            'extra_attributes' => array(
43
+                'autocomplete' => 'billing email',
44
+            ),
44 45
         ),
45
-    ),
46
-    true
47
-);
46
+        true
47
+    );
48 48
 
49
-echo '</span>';
49
+    echo '</span>';
50 50
 
51
-do_action( 'getpaid_after_payment_form_billing_email', $form );
51
+    do_action( 'getpaid_after_payment_form_billing_email', $form );
Please login to merge, or discard this patch.
templates/payment-forms/elements/time.php 1 patch
Switch Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a time input in payment form
4 4
  *
@@ -7,27 +7,27 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-$label = empty( $label ) ? '' : wp_kses_post( $label );
13
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
12
+    $label = empty( $label ) ? '' : wp_kses_post( $label );
13
+    $label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
14 14
 
15
-if ( ! empty( $required ) ) {
16
-    $label .= "<span class='text-danger'> *</span>";
15
+    if ( ! empty( $required ) ) {
16
+        $label .= "<span class='text-danger'> *</span>";
17 17
 }
18 18
 
19
-aui()->input(
20
-    array(
21
-        'name'        => esc_attr( $id ),
22
-        'id'          => esc_attr( $element_id ),
23
-        'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
24
-        'required'    => ! empty( $required ),
25
-        'label'       => $label,
26
-        'label_type'  => 'vertical',
27
-        'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
28
-        'type'        => 'time',
29
-        'class'       => $label_class,
30
-        'value'       => $query_value,
31
-    ),
32
-    true
33
-);
19
+    aui()->input(
20
+        array(
21
+            'name'        => esc_attr( $id ),
22
+            'id'          => esc_attr( $element_id ),
23
+            'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
24
+            'required'    => ! empty( $required ),
25
+            'label'       => $label,
26
+            'label_type'  => 'vertical',
27
+            'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
28
+            'type'        => 'time',
29
+            'class'       => $label_class,
30
+            'value'       => $query_value,
31
+        ),
32
+        true
33
+    );
Please login to merge, or discard this patch.
templates/payment-forms/elements/text.php 1 patch
Switch Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a text input in payment form
4 4
  *
@@ -7,26 +7,26 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-$label = empty( $label ) ? '' : wp_kses_post( $label );
13
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
12
+    $label = empty( $label ) ? '' : wp_kses_post( $label );
13
+    $label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
14 14
 
15
-if ( ! empty( $required ) ) {
16
-    $label .= "<span class='text-danger'> *</span>";
15
+    if ( ! empty( $required ) ) {
16
+        $label .= "<span class='text-danger'> *</span>";
17 17
 }
18 18
 
19
-aui()->input(
20
-    array(
21
-        'name'        => esc_attr( $id ),
22
-        'id'          => esc_attr( $element_id ),
23
-        'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
24
-        'required'    => ! empty( $required ),
25
-        'label'       => $label,
26
-        'label_type'  => 'vertical',
27
-        'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
28
-        'class'       => esc_attr( $label_class ),
29
-        'value'       => $query_value,
30
-    ),
31
-    true
32
-);
19
+    aui()->input(
20
+        array(
21
+            'name'        => esc_attr( $id ),
22
+            'id'          => esc_attr( $element_id ),
23
+            'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
24
+            'required'    => ! empty( $required ),
25
+            'label'       => $label,
26
+            'label_type'  => 'vertical',
27
+            'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
28
+            'class'       => esc_attr( $label_class ),
29
+            'value'       => $query_value,
30
+        ),
31
+        true
32
+    );
Please login to merge, or discard this patch.
templates/payment-forms/elements/address.php 1 patch
Switch Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays an address in payment form
4 4
  *
@@ -7,33 +7,33 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-if ( empty( $fields ) ) {
13
-	return;
12
+    if ( empty( $fields ) ) {
13
+	    return;
14 14
 }
15 15
 
16
-// A prefix for all ids (so that a form can be included in the same page multiple times).
17
-$uniqid = uniqid( '_' );
16
+    // A prefix for all ids (so that a form can be included in the same page multiple times).
17
+    $uniqid = uniqid( '_' );
18 18
 
19
-// Prepare the user's country.
20
-if ( ! empty( $form->invoice ) ) {
21
-	$country = $form->invoice->get_country();
19
+    // Prepare the user's country.
20
+    if ( ! empty( $form->invoice ) ) {
21
+	    $country = $form->invoice->get_country();
22 22
 }
23 23
 
24
-if ( empty( $country ) ) {
25
-	$country = empty( $country ) ? getpaid_get_ip_country() : $country;
26
-	$country = empty( $country ) ? wpinv_get_default_country() : $country;
24
+    if ( empty( $country ) ) {
25
+	    $country = empty( $country ) ? getpaid_get_ip_country() : $country;
26
+	    $country = empty( $country ) ? wpinv_get_default_country() : $country;
27 27
 }
28 28
 
29
-// A prefix for all ids (so that a form can be included in the same page multiple times).
30
-$uniqid = uniqid( '_' );
29
+    // A prefix for all ids (so that a form can be included in the same page multiple times).
30
+    $uniqid = uniqid( '_' );
31 31
 
32
-$address_type = empty( $address_type ) ? 'billing' : $address_type;
32
+    $address_type = empty( $address_type ) ? 'billing' : $address_type;
33 33
 
34
-?>
35
-
36
-<?php if ( 'both' === $address_type ) : ?>
34
+    ?>
35
+    
36
+    <?php if ( 'both' === $address_type ) : ?>
37 37
 
38 38
 	<!-- Start Billing/Shipping Address Title -->
39 39
 	<h4 class="mb-3 getpaid-shipping-billing-address-title">
@@ -48,43 +48,43 @@  discard block
 block discarded – undo
48 48
 	<!-- End Billing Address Title -->
49 49
 
50 50
 <?php endif; ?>
51
+    
51 52
 
52
-
53
-<?php if ( 'both' === $address_type || 'billing' === $address_type ) : ?>
53
+    <?php if ( 'both' === $address_type || 'billing' === $address_type ) : ?>
54 54
 
55 55
 	<!-- Start Billing Address -->
56 56
 	<div class="getpaid-billing-address-wrapper">
57 57
 		<?php
58
-			$field_type = 'billing';
59
-			include plugin_dir_path( __FILE__ ) . 'address-fields.php';
60
-			do_action( 'getpaid_after_payment_form_billing_fields', $form );
61
-		?>
58
+			    $field_type = 'billing';
59
+			    include plugin_dir_path( __FILE__ ) . 'address-fields.php';
60
+			    do_action( 'getpaid_after_payment_form_billing_fields', $form );
61
+		    ?>
62 62
 	</div>
63 63
 	<!-- End Billing Address -->
64 64
 
65 65
 <?php endif; ?>
66
+    
66 67
 
67
-
68
-<?php if ( 'both' === $address_type ) : ?>
69
-
68
+    <?php if ( 'both' === $address_type ) : ?>
69
+    
70 70
 
71 71
 	<?php
72 72
 
73
-		aui()->input(
74
-		    array(
75
-			    'type'     => 'checkbox',
76
-			    'name'     => 'same-shipping-address',
77
-			    'id'       => "shipping-toggle$uniqid",
78
-			    'required' => false,
79
-			    'label'    => empty( $shipping_address_toggle ) ? esc_html__( 'Same billing & shipping address.', 'invoicing' ) : wp_kses_post( $shipping_address_toggle ),
80
-			    'value'    => 1,
81
-			    'checked'  => true,
82
-				'class'    => 'w-auto',
83
-		    ),
84
-			true
85
-		);
73
+		    aui()->input(
74
+		        array(
75
+			        'type'     => 'checkbox',
76
+			        'name'     => 'same-shipping-address',
77
+			        'id'       => "shipping-toggle$uniqid",
78
+			        'required' => false,
79
+			        'label'    => empty( $shipping_address_toggle ) ? esc_html__( 'Same billing & shipping address.', 'invoicing' ) : wp_kses_post( $shipping_address_toggle ),
80
+			        'value'    => 1,
81
+			        'checked'  => true,
82
+				    'class'    => 'w-auto',
83
+		        ),
84
+			    true
85
+		    );
86 86
 
87
-	?>
87
+	    ?>
88 88
 
89 89
 
90 90
 	<!-- Start Shipping Address Title -->
@@ -95,18 +95,18 @@  discard block
 block discarded – undo
95 95
 
96 96
 
97 97
 <?php endif; ?>
98
-
98
+    
99 99
 
100 100
 	
101
-<?php if ( 'both' === $address_type || 'shipping' === $address_type ) : ?>
101
+    <?php if ( 'both' === $address_type || 'shipping' === $address_type ) : ?>
102 102
 
103 103
 	<!-- Start Shipping Address -->
104 104
 	<div class="getpaid-shipping-address-wrapper">
105 105
 		<?php
106
-			$field_type = 'shipping';
107
-			include plugin_dir_path( __FILE__ ) . 'address-fields.php';
108
-			do_action( 'getpaid_after_payment_form_shipping_fields', $form );
109
-		?>
106
+			    $field_type = 'shipping';
107
+			    include plugin_dir_path( __FILE__ ) . 'address-fields.php';
108
+			    do_action( 'getpaid_after_payment_form_shipping_fields', $form );
109
+		    ?>
110 110
 	</div>
111 111
 	<!-- End Shipping Address -->
112 112
 
Please login to merge, or discard this patch.
templates/payment-forms/elements/radio.php 1 patch
Switch Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a radio in payment form
4 4
  *
@@ -7,28 +7,28 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-$label = empty( $label ) ? '' : wp_kses_post( $label );
13
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
12
+    $label = empty( $label ) ? '' : wp_kses_post( $label );
13
+    $label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
14 14
 
15
-if ( ! empty( $required ) ) {
16
-    $label .= "<span class='text-danger'> *</span>";
15
+    if ( ! empty( $required ) ) {
16
+        $label .= "<span class='text-danger'> *</span>";
17 17
 }
18 18
 
19
-aui()->radio(
20
-    array(
21
-        'name'       => esc_attr( $id ),
22
-        'id'         => esc_attr( $element_id ),
23
-        'required'   => ! empty( $required ),
24
-        'label'      => $label,
25
-        'label_type' => 'vertical',
26
-        'class'      => 'w-auto',
27
-        'inline'     => false,
28
-        'options'    => empty( $options ) ? array() : array_combine( $options, $options ),
29
-        'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
30
-        'class'      => $label_class,
31
-        'value'      => $query_value,
32
-    ),
33
-    true
34
-);
19
+    aui()->radio(
20
+        array(
21
+            'name'       => esc_attr( $id ),
22
+            'id'         => esc_attr( $element_id ),
23
+            'required'   => ! empty( $required ),
24
+            'label'      => $label,
25
+            'label_type' => 'vertical',
26
+            'class'      => 'w-auto',
27
+            'inline'     => false,
28
+            'options'    => empty( $options ) ? array() : array_combine( $options, $options ),
29
+            'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
30
+            'class'      => $label_class,
31
+            'value'      => $query_value,
32
+        ),
33
+        true
34
+    );
Please login to merge, or discard this patch.
templates/payment-forms/elements/items.php 1 patch
Switch Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays item totals in payment form
4 4
  *
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-if ( empty( $form->get_items() ) ) {
13
-    return;
12
+    if ( empty( $form->get_items() ) ) {
13
+        return;
14 14
 }
15 15
 
16
-if ( ! empty( $GLOBALS['getpaid_force_checkbox'] ) ) {
17
-    $items_type = 'checkbox';
16
+    if ( ! empty( $GLOBALS['getpaid_force_checkbox'] ) ) {
17
+        $items_type = 'checkbox';
18 18
 }
19 19
 
20
-if ( empty( $items_type ) ) {
21
-    $items_type = 'total';
20
+    if ( empty( $items_type ) ) {
21
+        $items_type = 'total';
22 22
 }
23 23
 
24
-do_action( 'getpaid_before_payment_form_items', $form );
24
+    do_action( 'getpaid_before_payment_form_items', $form );
25 25
 
26 26
 switch ( $items_type ) {
27 27
     case 'radio':
@@ -35,16 +35,16 @@  discard block
 block discarded – undo
35 35
         break;
36 36
 }
37 37
 
38
-do_action( 'getpaid_before_payment_form_cart', $form );
38
+    do_action( 'getpaid_before_payment_form_cart', $form );
39 39
 
40
-// Display the cart totals.
41
-if ( ! empty( $hide_cart ) ) {
42
-    echo '<div class="d-none">';
40
+    // Display the cart totals.
41
+    if ( ! empty( $hide_cart ) ) {
42
+        echo '<div class="d-none">';
43 43
 }
44 44
 
45
-// Display the cart totals.
46
-wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) );
45
+    // Display the cart totals.
46
+    wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) );
47 47
 
48
-if ( ! empty( $hide_cart ) ) {
49
-    echo '</div>';
48
+    if ( ! empty( $hide_cart ) ) {
49
+        echo '</div>';
50 50
 }
Please login to merge, or discard this patch.
templates/payment-forms/elements/index.php 1 patch
Switch Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 # Silence is golden.
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
templates/payment-forms/elements/paragraph.php 1 patch
Switch Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php
1
+    <?php
2 2
 /**
3 3
  * Displays a paragraph in payment form
4 4
  *
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+    defined( 'ABSPATH' ) || exit;
11 11
 
12
-if ( ! empty( $element['text'] ) ) {
13
-    echo '<p>' . wp_kses_post( trim( $element['text'] ) ) . '</p>';
12
+    if ( ! empty( $element['text'] ) ) {
13
+        echo '<p>' . wp_kses_post( trim( $element['text'] ) ) . '</p>';
14 14
 }
Please login to merge, or discard this patch.