Passed
Push — master ( 618fc1...d0e164 )
by Brian
05:18
created
templates/payment-forms/elements/price_select.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -7,35 +7,35 @@  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 12
 // Ensure that we have options.
13
-if ( empty( $options ) ) {
13
+if (empty($options)) {
14 14
     return;
15 15
 }
16 16
 
17 17
 // Prepare price options.
18
-$options = getpaid_convert_price_string_to_options( $options );
19
-$keys    = array_keys( $options );
20
-$value   = empty( $options ) ? '' : $keys[0];
18
+$options = getpaid_convert_price_string_to_options($options);
19
+$keys    = array_keys($options);
20
+$value   = empty($options) ? '' : $keys[0];
21 21
 
22 22
 // Prepare id.
23
-$id = esc_attr( $id );
23
+$id = esc_attr($id);
24 24
 
25
-$select_type = empty( $select_type ) ? 'select' : $select_type;
25
+$select_type = empty($select_type) ? 'select' : $select_type;
26 26
 
27 27
 // Item select;
28
-if ( $select_type == 'select' ) {
28
+if ($select_type == 'select') {
29 29
     echo aui()->select(
30 30
         array(
31 31
             'name'       => $id,
32
-            'id'         => $id . uniqid( '_' ),
33
-            'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ),
32
+            'id'         => $id . uniqid('_'),
33
+            'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder),
34 34
             'value'      => $value,
35
-            'label'      => empty( $label ) ? '' : esc_html( $label ),
35
+            'label'      => empty($label) ? '' : esc_html($label),
36 36
             'label_type' => 'vertical',
37 37
             'class'      => 'getpaid-price-select-dropdown getpaid-refresh-on-change',
38
-            'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
38
+            'help_text'  => empty($description) ? '' : wp_kses_post($description),
39 39
             'options'    => $options,
40 40
         )
41 41
     );
@@ -43,18 +43,18 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 // Item radios;
46
-if ( $select_type == 'radios' ) {
46
+if ($select_type == 'radios') {
47 47
     echo aui()->radio(
48 48
         array(
49
-            'name'       => esc_attr( $id ),
50
-            'id'         => esc_attr( $id ) . uniqid( '_' ),
51
-            'label'      => empty( $label ) ? '' : esc_html( $label ),
49
+            'name'       => esc_attr($id),
50
+            'id'         => esc_attr($id) . uniqid('_'),
51
+            'label'      => empty($label) ? '' : esc_html($label),
52 52
             'label_type' => 'vertical',
53 53
             'class'      => 'getpaid-price-select-radio getpaid-refresh-on-change w-100',
54 54
             'value'      => $value,
55 55
             'inline'     => false,
56 56
             'options'    => $options,
57
-            'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
57
+            'help_text'  => empty($description) ? '' : wp_kses_post($description),
58 58
         )
59 59
     );
60 60
     return;
@@ -62,30 +62,30 @@  discard block
 block discarded – undo
62 62
 
63 63
 
64 64
 // Display the label.
65
-if ( ! empty( $label ) ) {
66
-    $label = esc_html( $label );
65
+if (!empty($label)) {
66
+    $label = esc_html($label);
67 67
     echo "<label>$label</label>";
68 68
 }
69 69
 
70 70
 // Item buttons;
71
-if ( $select_type == 'buttons' || $select_type == 'circles' ) {
71
+if ($select_type == 'buttons' || $select_type == 'circles') {
72 72
 
73 73
     $class = 'getpaid-price-buttons';
74 74
 
75
-    if ( $select_type == 'circles' ) {
75
+    if ($select_type == 'circles') {
76 76
         $class .= ' getpaid-price-circles';
77 77
     }
78 78
     echo "<div class='$class'>";
79 79
 
80
-    foreach ( $options as $price => $label ) {
81
-        $label   = esc_html( $label );
82
-        $price   = esc_attr( $price );
83
-        $_id     = $id . uniqid( '_' );
84
-        $checked = checked( $price, $value, false );
80
+    foreach ($options as $price => $label) {
81
+        $label   = esc_html($label);
82
+        $price   = esc_attr($price);
83
+        $_id     = $id . uniqid('_');
84
+        $checked = checked($price, $value, false);
85 85
 
86 86
         $class = 'rounded';
87 87
 
88
-        if ( $select_type == 'circles' ) {
88
+        if ($select_type == 'circles') {
89 89
             $class = '';
90 90
         }
91 91
         echo "
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
 }
102 102
 
103 103
 // Item checkboxes;
104
-if ( $select_type == 'checkboxes' ) {
104
+if ($select_type == 'checkboxes') {
105 105
     echo '<div class="form-group">';
106 106
 
107
-    foreach ( $options as $price => $label ) {
108
-        $label   = esc_html( $label );
109
-        $price   = esc_attr( $price );
110
-        $checked = checked( $price, $value, false );
107
+    foreach ($options as $price => $label) {
108
+        $label   = esc_html($label);
109
+        $price   = esc_attr($price);
110
+        $checked = checked($price, $value, false);
111 111
         echo "
112 112
             <label class='d-block'>
113 113
                 <input type='checkbox' class='getpaid-price-select-checkbox getpaid-refresh-on-change w-auto' name='{$id}[]' value='$price' $checked />
@@ -120,6 +120,6 @@  discard block
 block discarded – undo
120 120
 
121 121
 }
122 122
 
123
-if ( ! empty( $description ) ) {
123
+if (!empty($description)) {
124 124
     echo "<small class='form-text text-muted'>$description</small>";
125 125
 }
Please login to merge, or discard this patch.
templates/payment-forms/elements/ip_address.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@
 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
-$ip_address = esc_html( wpinv_get_ip() );
16
+$ip_address = esc_html(wpinv_get_ip());
17 17
 
18 18
 ?>
19 19
 <div class="form-group getpaid-ip-info">
20
-    <span><?php echo wp_kses_post( $text ); ?></span>
20
+    <span><?php echo wp_kses_post($text); ?></span>
21 21
     <strong><?php echo $ip_address; ?></strong>
22 22
 </div>
Please login to merge, or discard this patch.
templates/payment-forms/elements/price_input.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -7,32 +7,32 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // Set the currency position.
13 13
 $position = wpinv_currency_position();
14 14
 
15
-if ( $position == 'left_space' ) {
15
+if ($position == 'left_space') {
16 16
     $position = 'left';
17 17
 }
18 18
 
19
-if ( $position == 'right_space' ) {
19
+if ($position == 'right_space') {
20 20
     $position = 'right';
21 21
 }
22
-$label       = empty( $label ) ? '' : esc_html( $label );
23
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
22
+$label       = empty($label) ? '' : esc_html($label);
23
+$label_class = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label));
24 24
 
25 25
 echo aui()->input(
26 26
     array(
27
-        'name'              => esc_attr( $id ),
28
-        'id'                => esc_attr( $id ) . uniqid( '_' ),
29
-        'placeholder'       => empty( $placeholder ) ? wpinv_format_amount(0) : wpinv_format_amount( $placeholder ),
30
-        'value'             => empty( $value ) ? wpinv_format_amount(0) : wpinv_format_amount( $value ),
31
-        'label'             => empty( $label ) ? '' : wp_kses_post( $label ),
27
+        'name'              => esc_attr($id),
28
+        'id'                => esc_attr($id) . uniqid('_'),
29
+        'placeholder'       => empty($placeholder) ? wpinv_format_amount(0) : wpinv_format_amount($placeholder),
30
+        'value'             => empty($value) ? wpinv_format_amount(0) : wpinv_format_amount($value),
31
+        'label'             => empty($label) ? '' : wp_kses_post($label),
32 32
         'label_type'        => 'vertical',
33
-        'help_text'         => empty( $description ) ? '' : wp_kses_post( $description ),
34
-        'input_group_right' => $position == 'right' ? wpinv_currency_symbol( $form->get_currency() ) : '',
35
-        'input_group_left'  => $position == 'left' ? wpinv_currency_symbol( $form->get_currency() ) : '',
33
+        'help_text'         => empty($description) ? '' : wp_kses_post($description),
34
+        'input_group_right' => $position == 'right' ? wpinv_currency_symbol($form->get_currency()) : '',
35
+        'input_group_left'  => $position == 'left' ? wpinv_currency_symbol($form->get_currency()) : '',
36 36
         'class'             => 'getpaid-refresh-on-change ' . $label_class,
37 37
     )
38 38
 );
Please login to merge, or discard this patch.
templates/payment-forms/elements/total_payable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 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 = __( 'Total to pay:', 'invoicing' );
12
+if (empty($text)) {
13
+    $text = __('Total to pay:', 'invoicing');
14 14
 }
15 15
 ?>
16 16
 <div class="form-group mt-4">
17
-    <strong><?php echo esc_html( $text ); ?></strong>
17
+    <strong><?php echo esc_html($text); ?></strong>
18 18
     <span class="getpaid-checkout-total-payable"></span>
19 19
 </div>
Please login to merge, or discard this patch.
templates/payment-forms/elements/gateway_select.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -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 12
 // The payment methods select title.
13
-if ( empty( $text ) ) {
14
-    $text = __( 'Select Payment Method', 'invoicing' );
13
+if (empty($text)) {
14
+    $text = __('Select Payment Method', 'invoicing');
15 15
 }
16 16
 
17 17
 // An array of active payment methods.
18
-$gateways = wpinv_get_enabled_payment_gateways( true );
18
+$gateways = wpinv_get_enabled_payment_gateways(true);
19 19
 
20 20
 // The current invoice id.
21 21
 $invoice_id     = 0;
22 22
 $chosen_gateway = wpinv_get_default_gateway();
23 23
 
24
-if ( ! empty( $form->invoice ) ) {
24
+if (!empty($form->invoice)) {
25 25
     $invoice_id = $form->invoice->get_id();
26 26
     $chosen_gateway = $form->invoice->get_gateway();
27 27
 }
28 28
 
29 29
 ?>
30 30
 
31
-    <?php do_action( 'getpaid_before_payment_form_gateway_select', $form ); ?>
31
+    <?php do_action('getpaid_before_payment_form_gateway_select', $form); ?>
32 32
     <div class="mt-4 mb-4 getpaid-gateways">
33 33
 
34
-        <?php do_action( 'wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
34
+        <?php do_action('wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form); ?>
35 35
 
36 36
         <div class="getpaid-select-gateway-title-div">
37
-            <h6><?php echo esc_html( $text ); ?></h6>
37
+            <h6><?php echo esc_html($text); ?></h6>
38 38
         </div>
39 39
 
40 40
         <div class="getpaid-available-gateways-div">
41 41
 
42
-            <?php foreach ( array_keys( $gateways ) as $gateway ) : ?>
42
+            <?php foreach (array_keys($gateways) as $gateway) : ?>
43 43
 
44
-                <div class="pt-1 pb-1 getpaid-gateway getpaid-gateway-<?php echo sanitize_html_class( $gateway ) ;?>" data-checkout-label='<?php echo esc_attr( apply_filters( "getpaid_gateway_{$gateway}_checkout_button_label", '' ) ); ?>'>
44
+                <div class="pt-1 pb-1 getpaid-gateway getpaid-gateway-<?php echo sanitize_html_class($gateway); ?>" data-checkout-label='<?php echo esc_attr(apply_filters("getpaid_gateway_{$gateway}_checkout_button_label", '')); ?>'>
45 45
 
46 46
                     <label class="d-block w-100 getpaid-gateway-radio">
47
-                        <input type="radio" value="<?php echo esc_attr( $gateway ) ;?>" <?php checked( $gateway, $chosen_gateway ) ;?> name="wpi-gateway">
48
-                        <span><?php echo esc_html( wpinv_get_gateway_checkout_label( $gateway ) ); ?></span>
47
+                        <input type="radio" value="<?php echo esc_attr($gateway); ?>" <?php checked($gateway, $chosen_gateway); ?> name="wpi-gateway">
48
+                        <span><?php echo esc_html(wpinv_get_gateway_checkout_label($gateway)); ?></span>
49 49
                     </label>
50 50
 
51 51
                 </div>
@@ -56,22 +56,22 @@  discard block
 block discarded – undo
56 56
 
57 57
         <div class="getpaid-gateway-descriptions-div">
58 58
 
59
-            <?php foreach ( array_keys( $gateways ) as $gateway ) : ?>
59
+            <?php foreach (array_keys($gateways) as $gateway) : ?>
60 60
 
61
-                <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo sanitize_html_class( $gateway ) ;?>" style="display: none;">
61
+                <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo sanitize_html_class($gateway); ?>" style="display: none;">
62 62
                     <?php
63 63
 
64
-                        $description = wpinv_get_gateway_description( $gateway );
64
+                        $description = wpinv_get_gateway_description($gateway);
65 65
 
66
-                        if ( wpinv_is_test_mode( $gateway ) ) {
67
-                            $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) );
66
+                        if (wpinv_is_test_mode($gateway)) {
67
+                            $sandbox_notice = apply_filters("getpaid_{$gateway}_sandbox_notice", __('SANDBOX ENABLED: No real payments will occur.', 'invoicing'));
68 68
                             $description = "$description $sandbox_notice";
69 69
                         }
70 70
 
71
-                        echo wpautop( wp_kses_post( $description ) );
71
+                        echo wpautop(wp_kses_post($description));
72 72
 
73
-                        do_action( 'wpinv_' . $gateway . '_checkout_fields', $invoice_id ) ;
74
-                        do_action( 'wpinv_' . $gateway . '_cc_form', $invoice_id, $form ) ;
73
+                        do_action('wpinv_' . $gateway . '_checkout_fields', $invoice_id);
74
+                        do_action('wpinv_' . $gateway . '_cc_form', $invoice_id, $form);
75 75
 
76 76
                     ?>
77 77
                 </div>
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             <?php
85 85
                 echo aui()->alert(
86 86
                     array(
87
-                        'content'     => __( 'None of the available payment gateways support purchasing recurring items.', 'invoicing' ),
87
+                        'content'     => __('None of the available payment gateways support purchasing recurring items.', 'invoicing'),
88 88
                         'type'        => 'danger',
89 89
                     )
90 90
                 );
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             <?php
96 96
                 echo aui()->alert(
97 97
                     array(
98
-                        'content'     => __( 'None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing' ),
98
+                        'content'     => __('None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing'),
99 99
                         'type'        => 'danger',
100 100
                     )
101 101
                 );
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             <?php
107 107
                 echo aui()->alert(
108 108
                     array(
109
-                        'content'     => __( 'None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing' ),
109
+                        'content'     => __('None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing'),
110 110
                         'type'        => 'danger',
111 111
                     )
112 112
                 );
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
             <?php
118 118
                 echo aui()->alert(
119 119
                     array(
120
-                        'content'     => __( 'There is no active payment gateway available to process your request.', 'invoicing' ),
120
+                        'content'     => __('There is no active payment gateway available to process your request.', 'invoicing'),
121 121
                         'type'        => 'danger',
122 122
                     )
123 123
                 );
124 124
             ?>
125 125
         </div>
126 126
 
127
-        <?php do_action( 'wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form ); ?>
127
+        <?php do_action('wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form); ?>
128 128
 
129 129
     </div>
130
-    <?php do_action( 'getpaid_after_payment_form_gateway_select', $form ); ?>
130
+    <?php do_action('getpaid_after_payment_form_gateway_select', $form); ?>
Please login to merge, or discard this patch.
templates/emails/invoice-totals.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -8,22 +8,22 @@  discard block
 block discarded – undo
8 8
  * @var WPInv_Invoice $invoice
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 // Totals rows.
14
-$totals = getpaid_invoice_totals_rows( $invoice );
14
+$totals = getpaid_invoice_totals_rows($invoice);
15 15
 
16
-do_action( 'getpaid_before_email_line_totals', $invoice, $totals );
16
+do_action('getpaid_before_email_line_totals', $invoice, $totals);
17 17
 
18 18
 ?>
19 19
 
20 20
 
21
-<?php if ( has_action( 'wpinv_email_footer_buttons' ) ) : ?>
21
+<?php if (has_action('wpinv_email_footer_buttons')) : ?>
22 22
 
23 23
     <tr class="wpinv_cart_footer_row">
24 24
 
25
-        <td colspan="<?php echo ( (int) $column_count ); ?>">
26
-            <?php do_action( 'wpinv_email_footer_buttons' ); ?>
25
+        <td colspan="<?php echo ((int) $column_count); ?>">
26
+            <?php do_action('wpinv_email_footer_buttons'); ?>
27 27
         </td>
28 28
 
29 29
     </tr>
@@ -31,44 +31,44 @@  discard block
 block discarded – undo
31 31
 <?php endif; ?>
32 32
 
33 33
 
34
-<?php foreach ( $totals as $key => $label ) : ?>
34
+<?php foreach ($totals as $key => $label) : ?>
35 35
 
36
-    <tr class="wpinv_cart_footer_row wpinv_cart_<?php echo sanitize_html_class( $key ); ?>_row">
36
+    <tr class="wpinv_cart_footer_row wpinv_cart_<?php echo sanitize_html_class($key); ?>_row">
37 37
 
38
-        <td colspan="<?php echo ( $column_count - 1 ); ?>" class="wpinv_cart_<?php echo sanitize_html_class( $key ); ?>_label text-right">
39
-            <strong><?php echo esc_html( $label ); ?>:</strong>
38
+        <td colspan="<?php echo ($column_count - 1); ?>" class="wpinv_cart_<?php echo sanitize_html_class($key); ?>_label text-right">
39
+            <strong><?php echo esc_html($label); ?>:</strong>
40 40
         </td>
41 41
 
42
-        <td class="wpinv_cart_<?php echo sanitize_html_class( $key ); ?> text-right">
42
+        <td class="wpinv_cart_<?php echo sanitize_html_class($key); ?> text-right">
43 43
 
44 44
             <?php
45 45
 
46 46
                 // Total tax.
47
-                if ( 'tax' == $key ) {
48
-                    echo wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() );
47
+                if ('tax' == $key) {
48
+                    echo wpinv_price($invoice->get_total_tax(), $invoice->get_currency());
49 49
                 }
50 50
 
51
-                if ( 'fee' == $key ) {
52
-                    echo wpinv_price( $invoice->get_total_fees(), $invoice->get_currency() );
51
+                if ('fee' == $key) {
52
+                    echo wpinv_price($invoice->get_total_fees(), $invoice->get_currency());
53 53
                 }
54 54
 
55 55
                 // Total discount.
56
-                if ( 'discount' == $key ) {
57
-                    echo wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() );
56
+                if ('discount' == $key) {
57
+                    echo wpinv_price($invoice->get_total_discount(), $invoice->get_currency());
58 58
                 }
59 59
 
60 60
                 // Sub total.
61
-                if ( 'subtotal' == $key ) {
62
-                    echo wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() );
61
+                if ('subtotal' == $key) {
62
+                    echo wpinv_price($invoice->get_subtotal(), $invoice->get_currency());
63 63
                 }
64 64
 
65 65
                 // Total.
66
-                if ( 'total' == $key ) {
67
-                    echo wpinv_price( $invoice->get_total(), $invoice->get_currency() );
66
+                if ('total' == $key) {
67
+                    echo wpinv_price($invoice->get_total(), $invoice->get_currency());
68 68
                 }
69 69
 
70 70
                 // Fires when printing a cart total in an email.
71
-                do_action( "getpaid_email_cart_totals_$key", $invoice );
71
+                do_action("getpaid_email_cart_totals_$key", $invoice);
72 72
 
73 73
             ?>
74 74
 
@@ -80,4 +80,4 @@  discard block
 block discarded – undo
80 80
 
81 81
 <?php
82 82
 
83
-    do_action( 'getpaid_after_email_line_totals', $invoice, $totals );
83
+    do_action('getpaid_after_email_line_totals', $invoice, $totals);
Please login to merge, or discard this patch.
templates/emails/invoice-details.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,45 +8,45 @@  discard block
 block discarded – undo
8 8
  * @var WPInv_Invoice $invoice
9 9
  * @var array $columns
10 10
  */
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13
-$meta_data = getpaid_get_invoice_meta( $invoice );
13
+$meta_data = getpaid_get_invoice_meta($invoice);
14 14
 
15
-if ( isset( $meta_data['status'] ) ) {
15
+if (isset($meta_data['status'])) {
16 16
     $meta_data['status']['value'] = $invoice->get_status_nicename();
17 17
 }
18 18
 
19
-do_action( 'wpinv_email_before_invoice_details', $invoice, $sent_to_admin );
19
+do_action('wpinv_email_before_invoice_details', $invoice, $sent_to_admin);
20 20
 
21 21
 ?>
22 22
 
23 23
 <div id="wpinv-email-details">
24 24
 
25 25
     <h3 class="invoice-details-title">
26
-        <?php echo sprintf( esc_html__( '%s Details', 'invoicing' ), ucfirst( $invoice->get_invoice_quote_type() )); ?>
26
+        <?php echo sprintf(esc_html__('%s Details', 'invoicing'), ucfirst($invoice->get_invoice_quote_type())); ?>
27 27
     </h3>
28 28
 
29 29
     <table class="table table-bordered table-sm">
30 30
 
31
-        <?php foreach ( $meta_data as $key => $data ) : ?>
31
+        <?php foreach ($meta_data as $key => $data) : ?>
32 32
 
33
-            <?php if ( ! empty( $data['value'] ) ) : ?>
33
+            <?php if (!empty($data['value'])) : ?>
34 34
 
35
-                <?php do_action( "getpaid_before_email_details_$key", $invoice, $data ); ?>
35
+                <?php do_action("getpaid_before_email_details_$key", $invoice, $data); ?>
36 36
 
37
-                <tr class="getpaid-email-details-<?php echo sanitize_html_class( $key ); ?>">
37
+                <tr class="getpaid-email-details-<?php echo sanitize_html_class($key); ?>">
38 38
 
39 39
                     <td class="getpaid-lable-td">
40
-                        <?php echo esc_html( $data['label'] ); ?>
40
+                        <?php echo esc_html($data['label']); ?>
41 41
                     </td>
42 42
 
43 43
                     <td class="getpaid-value-td">
44
-                        <span class="getpaid-invoice-meta-<?php echo sanitize_html_class( $key ); ?>-value"><?php echo wp_kses_post( $data['value'] ); ?></span>
44
+                        <span class="getpaid-invoice-meta-<?php echo sanitize_html_class($key); ?>-value"><?php echo wp_kses_post($data['value']); ?></span>
45 45
                     </td>
46 46
 
47 47
                 </tr>
48 48
 
49
-                <?php do_action( "getpaid_after_email_details_$key", $invoice, $data ); ?>
49
+                <?php do_action("getpaid_after_email_details_$key", $invoice, $data); ?>
50 50
 
51 51
             <?php endif; ?>
52 52
 
@@ -56,4 +56,4 @@  discard block
 block discarded – undo
56 56
 
57 57
 </div>
58 58
 
59
-<?php do_action( 'wpinv_email_after_invoice_details', $invoice, $sent_to_admin ); ?>
59
+<?php do_action('wpinv_email_after_invoice_details', $invoice, $sent_to_admin); ?>
Please login to merge, or discard this patch.
templates/emails/invoice-item.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -10,66 +10,66 @@  discard block
 block discarded – undo
10 10
  * @var array $columns
11 11
  */
12 12
 
13
-defined( 'ABSPATH' ) || exit;
13
+defined('ABSPATH') || exit;
14 14
 
15 15
 ?>
16 16
 
17
-<?php do_action( 'getpaid_before_email_line_item', $invoice, $item ); ?>
17
+<?php do_action('getpaid_before_email_line_item', $invoice, $item); ?>
18 18
 
19
-<tr class="wpinv_cart_item item-type-<?php echo sanitize_html_class( $item->get_type() ); ?>">
19
+<tr class="wpinv_cart_item item-type-<?php echo sanitize_html_class($item->get_type()); ?>">
20 20
 
21
-    <?php foreach ( array_keys( $columns ) as $column ): ?>
21
+    <?php foreach (array_keys($columns) as $column): ?>
22 22
 
23
-        <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class( $column ); ?>">
23
+        <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class($column); ?>">
24 24
             
25 25
             <?php
26 26
 
27 27
                 // Fires before printing a line item column.
28
-                do_action( "getpaid_email_line_item_before_$column", $item, $invoice );
28
+                do_action("getpaid_email_line_item_before_$column", $item, $invoice);
29 29
 
30 30
                 // Item name.
31
-                if ( 'name' == $column ) {
31
+                if ('name' == $column) {
32 32
 
33 33
                     // Display the name.
34
-                    echo '<div class="wpinv_email_cart_item_title">' . esc_html( $item->get_name() ) . '</div>';
34
+                    echo '<div class="wpinv_email_cart_item_title">' . esc_html($item->get_name()) . '</div>';
35 35
 
36 36
                     // And an optional description.
37 37
                     $description = $item->get_description();
38 38
 
39
-                    if ( ! empty( $description ) ) {
40
-                        $description = wp_kses_post( $description );
39
+                    if (!empty($description)) {
40
+                        $description = wp_kses_post($description);
41 41
                         echo "<p class='small'>$description</p>";
42 42
                     }
43 43
 
44 44
                 }
45 45
 
46 46
                 // Item price.
47
-                if ( 'price' == $column ) {
47
+                if ('price' == $column) {
48 48
 
49 49
                     // Display the item price (or recurring price if this is a renewal invoice)
50 50
                     $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price();
51
-                    echo wpinv_price( $price, $invoice->get_currency() );
51
+                    echo wpinv_price($price, $invoice->get_currency());
52 52
 
53 53
                 }
54 54
 
55 55
                 // Item quantity.
56
-                if ( 'quantity' == $column ) {
56
+                if ('quantity' == $column) {
57 57
                     echo (float) $item->get_quantity();
58 58
                 }
59 59
 
60 60
                 // Tax rate.
61
-                if ( 'tax_rate' == $column ) {
62
-                    echo round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) . '%';
61
+                if ('tax_rate' == $column) {
62
+                    echo round(getpaid_get_invoice_tax_rate($invoice, $item), 2) . '%';
63 63
                 }
64 64
 
65 65
                 // Item sub total.
66
-                if ( 'subtotal' == $column ) {
66
+                if ('subtotal' == $column) {
67 67
                     $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total();
68
-                    echo wpinv_price( $subtotal, $invoice->get_currency() );
68
+                    echo wpinv_price($subtotal, $invoice->get_currency());
69 69
                 }
70 70
 
71 71
                 // Fires when printing a line item column.
72
-                do_action( "getpaid_email_line_item_$column", $item, $invoice );
72
+                do_action("getpaid_email_line_item_$column", $item, $invoice);
73 73
 
74 74
             ?>
75 75
 
@@ -79,4 +79,4 @@  discard block
 block discarded – undo
79 79
 
80 80
 </tr>
81 81
 
82
-<?php do_action( 'getpaid_after_email_line_item', $invoice, $item ); ?>
82
+<?php do_action('getpaid_after_email_line_item', $invoice, $item); ?>
Please login to merge, or discard this patch.
templates/emails/invoice-items.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@  discard block
 block discarded – undo
8 8
  * @var WPInv_Invoice $invoice
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13
-$column_count = count( $columns );
13
+$column_count = count($columns);
14 14
 ?>
15 15
 
16
-<?php do_action( 'wpinv_before_email_items', $invoice ); ?>
16
+<?php do_action('wpinv_before_email_items', $invoice); ?>
17 17
 
18 18
 
19 19
 <div id="wpinv-email-items">
20 20
 
21 21
     <h3 class="invoice-items-title">
22
-        <?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), ucfirst( $invoice->get_invoice_quote_type() )); ?>
22
+        <?php echo sprintf(esc_html__('%s Items', 'invoicing'), ucfirst($invoice->get_invoice_quote_type())); ?>
23 23
     </h3>
24 24
 
25 25
     <table class="table table-bordered table-hover">
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 
29 29
             <tr class="wpinv_cart_header_row">
30 30
 
31
-                <?php foreach ( $columns as $key => $label ) : ?>
32
-                    <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class( $key ); ?>">
33
-                        <?php echo esc_html( $label ); ?>
31
+                <?php foreach ($columns as $key => $label) : ?>
32
+                    <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class($key); ?>">
33
+                        <?php echo esc_html($label); ?>
34 34
                     </th>
35 35
                 <?php endforeach; ?>
36 36
 
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
             <?php
44 44
 
45 45
                 // Display the item totals.
46
-                foreach ( $invoice->get_items() as $item ) {
47
-                    wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) );
46
+                foreach ($invoice->get_items() as $item) {
47
+                    wpinv_get_template('emails/invoice-item.php', compact('invoice', 'item', 'columns'));
48 48
                 }
49 49
 
50 50
                 // Display the fee totals.
51
-                foreach ( $invoice->get_fees() as $fee ) {
52
-                    wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) );
51
+                foreach ($invoice->get_fees() as $fee) {
52
+                    wpinv_get_template('emails/fee-item.php', compact('invoice', 'fee', 'columns'));
53 53
                 }
54 54
 
55 55
             ?>
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         </tbody>
58 58
 
59 59
         <tfoot>
60
-            <?php wpinv_get_template( 'emails/invoice-totals.php', compact( 'invoice', 'column_count' ) ); ?>
60
+            <?php wpinv_get_template('emails/invoice-totals.php', compact('invoice', 'column_count')); ?>
61 61
         </tfoot>
62 62
     
63 63
     </table>
Please login to merge, or discard this patch.