Passed
Push — master ( c1548d...55a972 )
by Brian
04:30
created
templates/emails/wpinv-email-overdue.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@
 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
 // Print the email header.
13
-do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );
13
+do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin);
14 14
 
15 15
 // Generate the custom message body.
16 16
 echo $message_body;
17 17
 
18 18
 // Print invoice details.
19
-do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin );
19
+do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin);
20 20
 
21 21
 // Print invoice items.
22
-do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin );
22
+do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin);
23 23
 
24 24
 // Print the billing details.
25
-do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin );
25
+do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin);
26 26
 
27 27
 // Print the email footer.
28
-do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin );
28
+do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin);
Please login to merge, or discard this patch.
templates/emails/wpinv-email-user_note.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );
12
+do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin);
13 13
 
14
-do_action( 'wpinv_email_before_note_details', $invoice, $email_type, $sent_to_admin, $customer_note );
14
+do_action('wpinv_email_before_note_details', $invoice, $email_type, $sent_to_admin, $customer_note);
15 15
 
16 16
 // Generate the custom message body.
17
-echo wptexturize( wp_kses_post( str_replace( '{customer_note}', $customer_note, $message_body ) ) );
17
+echo wptexturize(wp_kses_post(str_replace('{customer_note}', $customer_note, $message_body)));
18 18
 
19
-do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin );
19
+do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin);
20 20
 
21
-do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin );
21
+do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin);
22 22
 
23
-do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin );
23
+do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin);
24 24
 
25
-do_action( 'wpinv_email_after_note_details', $invoice, $email_type, $sent_to_admin, $customer_note );
25
+do_action('wpinv_email_after_note_details', $invoice, $email_type, $sent_to_admin, $customer_note);
26 26
 
27
-do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin );
28 27
\ No newline at end of file
28
+do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin);
29 29
\ No newline at end of file
Please login to merge, or discard this patch.
templates/emails/fee-item.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -10,63 +10,63 @@  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_fee_item', $invoice, $fee ); ?>
17
+<?php do_action('getpaid_before_email_fee_item', $invoice, $fee); ?>
18 18
 
19 19
 <tr class="wpinv_cart_item item-fee">
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 fee item column.
28
-                do_action( "getpaid_email_fee_item_before_$column", $fee, $invoice );
28
+                do_action("getpaid_email_fee_item_before_$column", $fee, $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">' . sanitize_text_field( $fee['name'] ) . '</div>';
34
+                    echo '<div class="wpinv_email_cart_item_title">' . sanitize_text_field($fee['name']) . '</div>';
35 35
 
36 36
                     // And an optional description.
37
-                    $description = esc_html__( 'Fee', 'invoicing' );
37
+                    $description = esc_html__('Fee', 'invoicing');
38 38
                     echo "<p class='small'>$description</p>";
39 39
 
40 40
                 }
41 41
 
42 42
                 // Item price.
43
-                if ( 'price' == $column ) {
43
+                if ('price' == $column) {
44 44
 
45 45
                     // Display the item price (or recurring price if this is a renewal invoice)
46
-                    if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
47
-                        echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() );
46
+                    if ($invoice->is_recurring() && $invoice->is_renewal()) {
47
+                        echo wpinv_price($fee['recurring_fee'], $invoice->get_currency());
48 48
                     } else {
49
-                        echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() );
49
+                        echo wpinv_price($fee['initial_fee'], $invoice->get_currency());
50 50
                     }
51 51
 
52 52
                 }
53 53
 
54 54
                 // Item quantity.
55
-                if ( 'quantity' == $column ) {
55
+                if ('quantity' == $column) {
56 56
                     echo "&mdash;";
57 57
                 }
58 58
 
59 59
                 // Item sub total.
60
-                if ( 'subtotal' == $column ) {
61
-                    if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
62
-                        echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() );
60
+                if ('subtotal' == $column) {
61
+                    if ($invoice->is_recurring() && $invoice->is_renewal()) {
62
+                        echo wpinv_price($fee['recurring_fee'], $invoice->get_currency());
63 63
                     } else {
64
-                        echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() );
64
+                        echo wpinv_price($fee['initial_fee'], $invoice->get_currency());
65 65
                     }
66 66
                 }
67 67
 
68 68
                 // Fires when printing a line item column.
69
-                do_action( "getpaid_email_fee_item_$column", $fee, $invoice );
69
+                do_action("getpaid_email_fee_item_$column", $fee, $invoice);
70 70
 
71 71
             ?>
72 72
 
@@ -76,4 +76,4 @@  discard block
 block discarded – undo
76 76
 
77 77
 </tr>
78 78
 
79
-<?php do_action( 'getpaid_after_email_fee_item', $invoice, $fee ); ?>
79
+<?php do_action('getpaid_after_email_fee_item', $invoice, $fee); ?>
Please login to merge, or discard this patch.
templates/emails/wpinv-email-subscription_complete.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@
 block discarded – undo
8 8
  * @var WPInv_Subscription $object
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 $invoice = $object->get_parent_payment();
14 14
 
15 15
 // Print the email header.
16
-do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );
16
+do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin);
17 17
 
18 18
 // Generate the custom message body.
19 19
 echo $message_body;
20 20
 
21 21
 // Print the billing details.
22
-do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin );
22
+do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin);
23 23
 
24 24
 // Print the email footer.
25
-do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin );
25
+do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin);
Please login to merge, or discard this patch.
templates/emails/wpinv-email-renewal_reminder.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,24 +8,24 @@
 block discarded – undo
8 8
  * @var WPInv_Subscription $object
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 $invoice = $object->get_parent_payment();
14 14
 
15 15
 // Print the email header.
16
-do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );
16
+do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin);
17 17
 
18 18
 // Generate the custom message body.
19 19
 echo $message_body;
20 20
 
21 21
 // Print invoice details.
22
-do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin );
22
+do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin);
23 23
 
24 24
 // Print invoice items.
25
-do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin );
25
+do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin);
26 26
 
27 27
 // Print the billing details.
28
-do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin );
28
+do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin);
29 29
 
30 30
 // Print the email footer.
31
-do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin );
31
+do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin);
Please login to merge, or discard this patch.
templates/emails/wpinv-email-subscription_trial.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@
 block discarded – undo
8 8
  * @var WPInv_Subscription $object
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 $invoice = $object->get_parent_payment();
14 14
 
15 15
 // Print the email header.
16
-do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );
16
+do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin);
17 17
 
18 18
 // Generate the custom message body.
19 19
 echo $message_body;
20 20
 
21 21
 // Print the billing details.
22
-do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin );
22
+do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin);
23 23
 
24 24
 // Print the email footer.
25
-do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin );
25
+do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin);
Please login to merge, or discard this patch.
templates/emails/wpinv-email-subscription_expired.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@
 block discarded – undo
8 8
  * @var WPInv_Subscription $object
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 $invoice = $object->get_parent_payment();
14 14
 
15 15
 // Print the email header.
16
-do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );
16
+do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin);
17 17
 
18 18
 // Generate the custom message body.
19 19
 echo $message_body;
20 20
 
21 21
 // Print the billing details.
22
-do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin );
22
+do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin);
23 23
 
24 24
 // Print the email footer.
25
-do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin );
25
+do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin);
Please login to merge, or discard this patch.
templates/emails/wpinv-email-subscription_cancelled.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@
 block discarded – undo
8 8
  * @var WPInv_Subscription $object
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 $invoice = $object->get_parent_payment();
14 14
 
15 15
 // Print the email header.
16
-do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin );
16
+do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin);
17 17
 
18 18
 // Generate the custom message body.
19 19
 echo $message_body;
20 20
 
21 21
 // Print the billing details.
22
-do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin );
22
+do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin);
23 23
 
24 24
 // Print the email footer.
25
-do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin );
25
+do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin);
Please login to merge, or discard this patch.
templates/invoice-receipt.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -7,55 +7,55 @@  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
 // Fetch the invoice.
13
-$invoice = new WPInv_Invoice( $invoice );
13
+$invoice = new WPInv_Invoice($invoice);
14 14
 
15 15
 // @deprecated
16
-do_action( 'wpinv_success_content_before', $invoice );
17
-do_action( 'wpinv_before_receipt', $invoice );
16
+do_action('wpinv_success_content_before', $invoice);
17
+do_action('wpinv_before_receipt', $invoice);
18 18
 
19 19
 wpinv_print_errors();
20 20
 
21 21
 // Prepare header text.
22
-if ( $invoice->is_paid() ) {
22
+if ($invoice->is_paid()) {
23 23
 
24 24
     $alert = aui()->alert(
25 25
         array(
26 26
             'type'    => 'success',
27
-            'content' => __( 'Thank you for your payment!', 'invoicing' ),
27
+            'content' => __('Thank you for your payment!', 'invoicing'),
28 28
         )
29 29
     );
30 30
 
31
-} else if ( $invoice->is_refunded() ) {
31
+} else if ($invoice->is_refunded()) {
32 32
 
33 33
     $alert = aui()->alert(
34 34
         array(
35 35
             'type'    => 'info',
36
-            'content' => __( 'This invoice was refunded.', 'invoicing' ),
36
+            'content' => __('This invoice was refunded.', 'invoicing'),
37 37
         )
38 38
     );
39 39
 
40
-} else if ( $invoice->is_held() ) {
40
+} else if ($invoice->is_held()) {
41 41
 
42 42
     $alert = aui()->alert(
43 43
         array(
44 44
             'type'    => 'info',
45
-            'content' => __( 'This invoice will be processed as soon we verify your payment.', 'invoicing' ),
45
+            'content' => __('This invoice will be processed as soon we verify your payment.', 'invoicing'),
46 46
         )
47 47
     );
48 48
 
49
-} else if ( $invoice->needs_payment() ) {
49
+} else if ($invoice->needs_payment()) {
50 50
 
51
-    if ( $invoice->is_due() ) {
51
+    if ($invoice->is_due()) {
52 52
 
53 53
         $alert = aui()->alert(
54 54
             array(
55 55
                 'type'    => 'danger',
56 56
                 'content' => sprintf(
57
-                    __( 'This invoice was due on %.', 'invoicing' ),
58
-                    getpaid_format_date_value( $invoice->get_due_date() )
57
+                    __('This invoice was due on %.', 'invoicing'),
58
+                    getpaid_format_date_value($invoice->get_due_date())
59 59
                 ),
60 60
             )
61 61
         );
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $alert = aui()->alert(
66 66
             array(
67 67
                 'type'    => 'warning',
68
-                'content' => __( 'This invoice needs payment.', 'invoicing' ),
68
+                'content' => __('This invoice needs payment.', 'invoicing'),
69 69
             )
70 70
         );
71 71
 
@@ -80,19 +80,19 @@  discard block
 block discarded – undo
80 80
 
81 81
         'pay' => array(
82 82
             'url'   => $invoice->get_checkout_payment_url(),
83
-            'name'  => __( 'Pay For Invoice', 'invoicing' ),
83
+            'name'  => __('Pay For Invoice', 'invoicing'),
84 84
             'class' => 'btn-success',
85 85
         ),
86 86
 
87 87
         'view' => array(
88 88
             'url'   => $invoice->get_view_url(),
89
-            'name'  => __( 'View Invoice', 'invoicing' ),
89
+            'name'  => __('View Invoice', 'invoicing'),
90 90
             'class' => 'btn-primary',
91 91
         ),
92 92
 
93 93
         'history' => array(
94 94
             'url'   => wpinv_get_history_page_uri(),
95
-            'name'  => __( 'Invoice History', 'invoicing' ),
95
+            'name'  => __('Invoice History', 'invoicing'),
96 96
             'class' => 'btn-warning',
97 97
         ),
98 98
 
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
 
102 102
 );
103 103
 
104
-if ( ( ! $invoice->needs_payment() || $invoice->is_held() ) && isset( $actions['pay'] ) ) {
105
-    unset( $actions['pay'] );
104
+if ((!$invoice->needs_payment() || $invoice->is_held()) && isset($actions['pay'])) {
105
+    unset($actions['pay']);
106 106
 }
107 107
 
108
-if ( ! is_user_logged_in() && isset( $actions['history'] ) ) {
109
-    unset( $actions['history'] );
108
+if (!is_user_logged_in() && isset($actions['history'])) {
109
+    unset($actions['history']);
110 110
 }
111 111
 
112 112
 ?>
@@ -115,19 +115,19 @@  discard block
 block discarded – undo
115 115
 
116 116
         <?php
117 117
         
118
-            do_action( 'wpinv_receipt_start', $invoice );
118
+            do_action('wpinv_receipt_start', $invoice);
119 119
 
120
-            if ( ! empty( $actions ) ) {
120
+            if (!empty($actions)) {
121 121
 
122 122
                 echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">';
123 123
 
124
-                foreach ( $actions as $key => $action ) {
124
+                foreach ($actions as $key => $action) {
125 125
 
126
-                    $key    = sanitize_html_class( $key );
127
-                    $class  = empty( $action['class'] ) ? 'btn-dark' : sanitize_html_class( $action['class'] );
128
-                    $url    = empty( $action['url'] ) ? '#' : esc_url( $action['url'] );
129
-                    $attrs  = empty( $action['attrs'] ) ? '' : $action['attrs'];
130
-                    $anchor = sanitize_text_field( $action['name'] );
126
+                    $key    = sanitize_html_class($key);
127
+                    $class  = empty($action['class']) ? 'btn-dark' : sanitize_html_class($action['class']);
128
+                    $url    = empty($action['url']) ? '#' : esc_url($action['url']);
129
+                    $attrs  = empty($action['attrs']) ? '' : $action['attrs'];
130
+                    $anchor = sanitize_text_field($action['name']);
131 131
 
132 132
                     echo "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>";
133 133
                 }
@@ -143,20 +143,20 @@  discard block
 block discarded – undo
143 143
         <div class="wpinv-receipt-details">
144 144
 
145 145
             <h4 class="wpinv-details-t mb-3 mt-3">
146
-                <?php echo apply_filters( 'wpinv_receipt_details_title', __( 'Invoice Details', 'invoicing' ), $invoice ); ?>
146
+                <?php echo apply_filters('wpinv_receipt_details_title', __('Invoice Details', 'invoicing'), $invoice); ?>
147 147
             </h4>
148 148
 
149
-            <?php getpaid_invoice_meta( $invoice ); ?>
149
+            <?php getpaid_invoice_meta($invoice); ?>
150 150
 
151 151
         </div>
152 152
 
153 153
 
154
-        <?php do_action( 'wpinv_receipt_end', $invoice ); ?>
154
+        <?php do_action('wpinv_receipt_end', $invoice); ?>
155 155
 
156 156
     </div>
157 157
 
158 158
 <?php
159 159
 
160 160
 // @deprecated
161
-do_action( 'wpinv_success_content_after', $invoice );
162
-do_action( 'wpinv_after_receipt', $invoice );
161
+do_action('wpinv_success_content_after', $invoice);
162
+do_action('wpinv_after_receipt', $invoice);
Please login to merge, or discard this patch.