Passed
Pull Request — master (#840)
by Patrik
05:05
created
templates/emails/wpinv-email-footer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // don't load directly
3
-if ( ! defined( 'ABSPATH' ) ) {
4
-    die( '-1' );
3
+if (!defined('ABSPATH')) {
4
+    die('-1');
5 5
 }
6 6
 
7
-$email_footer = apply_filters( 'wpinv_email_footer_text', wpinv_get_option( 'email_footer_text', get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GetPaid', 'invoicing' ) ) );
8
-$email_footer = $email_footer ? wp_kses_post( wpautop( wptexturize( $email_footer ) ) ) : '';
7
+$email_footer = apply_filters('wpinv_email_footer_text', wpinv_get_option('email_footer_text', get_bloginfo('name', 'display') . ' - ' . __('Powered by GetPaid', 'invoicing')));
8
+$email_footer = $email_footer ? wp_kses_post(wpautop(wptexturize($email_footer))) : '';
9 9
 ?>
10 10
                                                             </div>
11 11
                                                         </td>
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
                                                 <table border="0" cellpadding="10" cellspacing="0" width="100%">
28 28
                                                     <tr>
29 29
                                                         <td colspan="2" valign="middle" id="credit">
30
-                                                            <?php echo wp_kses_post( $email_footer ); ?>
30
+                                                            <?php echo wp_kses_post($email_footer); ?>
31 31
                                                         </td>
32 32
                                                     </tr>
33 33
                                                 </table>
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 wp_kses_post( wptexturize( str_replace( '{customer_note}', $customer_note, $message_body ) ) );
17
+echo wp_kses_post(wptexturize(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 );
27
+do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin);
Please login to merge, or discard this patch.
templates/emails/fee-item.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,21 +30,21 @@  discard block
 block discarded – undo
30 30
                 // Item name.
31 31
                 if ( 'name' == $column ) {
32 32
 
33
-				// Display the name.
34
-				echo '<div class="wpinv_email_cart_item_title">' . esc_html( $fee['name'] ) . '</div>';
33
+                // Display the name.
34
+                echo '<div class="wpinv_email_cart_item_title">' . esc_html( $fee['name'] ) . '</div>';
35 35
 
36
-				// And an optional description.
37
-				$description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] );
38
-				echo wp_kses_post( "<p class='small'>$description</p>" );
36
+                // And an optional description.
37
+                $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] );
38
+                echo wp_kses_post( "<p class='small'>$description</p>" );
39 39
 
40 40
                 }
41 41
 
42 42
                 // Item price.
43 43
                 if ( 'price' == $column ) {
44 44
 
45
-				// Display the item price (or recurring price if this is a renewal invoice)
46
-				if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
47
-					wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
45
+                // Display the item price (or recurring price if this is a renewal invoice)
46
+                if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
47
+                    wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
48 48
                     } else {
49 49
                         wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() );
50 50
                     }
@@ -52,18 +52,18 @@  discard block
 block discarded – undo
52 52
 
53 53
                 // Item quantity.
54 54
                 if ( 'quantity' == $column ) {
55
-				echo '&mdash;';
55
+                echo '&mdash;';
56 56
                 }
57 57
 
58 58
                 // Item tax.
59 59
                 if ( 'tax_rate' == $column ) {
60
-				echo '&mdash;';
60
+                echo '&mdash;';
61 61
                 }
62 62
 
63 63
                 // Item sub total.
64 64
                 if ( 'subtotal' == $column ) {
65
-				if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
66
-					wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
65
+                if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
66
+                    wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
67 67
                 } else {
68 68
                     wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() );
69 69
                 }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -10,67 +10,67 @@  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 esc_attr( $column ); ?>">
23
+        <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr($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">' . esc_html( $fee['name'] ) . '</div>';
34
+				echo '<div class="wpinv_email_cart_item_title">' . esc_html($fee['name']) . '</div>';
35 35
 
36 36
 				// And an optional description.
37
-				$description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] );
38
-				echo wp_kses_post( "<p class='small'>$description</p>" );
37
+				$description = empty($fee['description']) ? esc_html__('Fee', 'invoicing') : esc_html($fee['description']);
38
+				echo wp_kses_post("<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
-					wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
46
+				if ($invoice->is_recurring() && $invoice->is_renewal()) {
47
+					wpinv_the_price($fee['recurring_fee'], $invoice->get_currency());
48 48
                     } else {
49
-                        wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() );
49
+                        wpinv_the_price($fee['initial_fee'], $invoice->get_currency());
50 50
                     }
51 51
 }
52 52
 
53 53
                 // Item quantity.
54
-                if ( 'quantity' == $column ) {
54
+                if ('quantity' == $column) {
55 55
 				echo '&mdash;';
56 56
                 }
57 57
 
58 58
                 // Item tax.
59
-                if ( 'tax_rate' == $column ) {
59
+                if ('tax_rate' == $column) {
60 60
 				echo '&mdash;';
61 61
                 }
62 62
 
63 63
                 // Item sub total.
64
-                if ( 'subtotal' == $column ) {
65
-				if ( $invoice->is_recurring() && $invoice->is_renewal() ) {
66
-					wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() );
64
+                if ('subtotal' == $column) {
65
+				if ($invoice->is_recurring() && $invoice->is_renewal()) {
66
+					wpinv_the_price($fee['recurring_fee'], $invoice->get_currency());
67 67
                 } else {
68
-                    wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() );
68
+                    wpinv_the_price($fee['initial_fee'], $invoice->get_currency());
69 69
                 }
70 70
                 }
71 71
 
72 72
                 // Fires when printing a line item column.
73
-                do_action( "getpaid_email_fee_item_$column", $fee, $invoice );
73
+                do_action("getpaid_email_fee_item_$column", $fee, $invoice);
74 74
 
75 75
             ?>
76 76
 
@@ -80,4 +80,4 @@  discard block
 block discarded – undo
80 80
 
81 81
 </tr>
82 82
 
83
-<?php do_action( 'getpaid_after_email_fee_item', $invoice, $fee ); ?>
83
+<?php do_action('getpaid_after_email_fee_item', $invoice, $fee); ?>
Please login to merge, or discard this patch.
templates/invoice-receipt.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -126,25 +126,25 @@
 block discarded – undo
126 126
 
127 127
             if ( ! empty( $invoice_actions ) ) {
128 128
 
129
-			echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">';
129
+            echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">';
130 130
 
131
-			foreach ( $invoice_actions as $key => $invoice_action ) {
131
+            foreach ( $invoice_actions as $key => $invoice_action ) {
132 132
 
133
-				$key    = sanitize_html_class( $key );
134
-				$class  = empty( $invoice_action['class'] ) ? 'btn-dark' : sanitize_html_class( $invoice_action['class'] );
135
-				$url    = empty( $invoice_action['url'] ) ? '#' : esc_url( $invoice_action['url'] );
136
-				$attrs  = empty( $invoice_action['attrs'] ) ? '' : $invoice_action['attrs'];
137
-				$anchor = esc_html( $invoice_action['name'] );
133
+                $key    = sanitize_html_class( $key );
134
+                $class  = empty( $invoice_action['class'] ) ? 'btn-dark' : sanitize_html_class( $invoice_action['class'] );
135
+                $url    = empty( $invoice_action['url'] ) ? '#' : esc_url( $invoice_action['url'] );
136
+                $attrs  = empty( $invoice_action['attrs'] ) ? '' : $invoice_action['attrs'];
137
+                $anchor = esc_html( $invoice_action['name'] );
138 138
 
139
-				echo wp_kses_post( "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>" );
139
+                echo wp_kses_post( "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>" );
140 140
                 }
141 141
 
142
-			echo '</div>';
142
+            echo '</div>';
143 143
 
144 144
             }
145 145
 
146 146
             if ( ! empty( $alert ) ) {
147
-			echo wp_kses_post( $alert );
147
+            echo wp_kses_post( $alert );
148 148
             }
149 149
 
150 150
         ?>
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -7,64 +7,64 @@  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
-} elseif ( $invoice->is_refunded() ) {
31
+} elseif ($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
-} elseif ( $invoice->is_held() ) {
40
+} elseif ($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
-} elseif ( $invoice->needs_payment() ) {
49
+} elseif ($invoice->needs_payment()) {
50 50
 
51
-    if ( ! empty( $_GET['token'] ) ) {
51
+    if (!empty($_GET['token'])) {
52 52
 
53 53
         $alert = aui()->alert(
54 54
             array(
55 55
                 'type'    => 'info',
56
-                'content' => __( "Sometimes it takes a few minutes for us to verify your payment. We'll notify you as soon as we've verified the payment.", 'invoicing' ),
56
+                'content' => __("Sometimes it takes a few minutes for us to verify your payment. We'll notify you as soon as we've verified the payment.", 'invoicing'),
57 57
             )
58 58
         );
59 59
 
60
-    } elseif ( $invoice->is_due() ) {
60
+    } elseif ($invoice->is_due()) {
61 61
 
62 62
         $alert = aui()->alert(
63 63
             array(
64 64
                 'type'    => 'danger',
65 65
                 'content' => sprintf(
66
-                    __( 'This invoice was due on %.', 'invoicing' ),
67
-                    getpaid_format_date_value( $invoice->get_due_date() )
66
+                    __('This invoice was due on %.', 'invoicing'),
67
+                    getpaid_format_date_value($invoice->get_due_date())
68 68
                 ),
69 69
             )
70 70
         );
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $alert = aui()->alert(
75 75
             array(
76 76
                 'type'    => 'warning',
77
-                'content' => __( 'This invoice needs payment.', 'invoicing' ),
77
+                'content' => __('This invoice needs payment.', 'invoicing'),
78 78
             )
79 79
         );
80 80
 
@@ -88,19 +88,19 @@  discard block
 block discarded – undo
88 88
 
89 89
         'pay'     => array(
90 90
             'url'   => $invoice->get_checkout_payment_url(),
91
-            'name'  => __( 'Pay For Invoice', 'invoicing' ),
91
+            'name'  => __('Pay For Invoice', 'invoicing'),
92 92
             'class' => 'btn-success',
93 93
         ),
94 94
 
95 95
         'view'    => array(
96 96
             'url'   => $invoice->get_view_url(),
97
-            'name'  => __( 'View Invoice', 'invoicing' ),
97
+            'name'  => __('View Invoice', 'invoicing'),
98 98
             'class' => 'btn-primary',
99 99
         ),
100 100
 
101 101
         'history' => array(
102 102
             'url'   => wpinv_get_history_page_uri(),
103
-            'name'  => __( 'Invoice History', 'invoicing' ),
103
+            'name'  => __('Invoice History', 'invoicing'),
104 104
             'class' => 'btn-warning',
105 105
         ),
106 106
 
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
     $invoice
109 109
 );
110 110
 
111
-if ( ( ! $invoice->needs_payment() || $invoice->is_held() ) && isset( $invoice_actions['pay'] ) ) {
112
-    unset( $invoice_actions['pay'] );
111
+if ((!$invoice->needs_payment() || $invoice->is_held()) && isset($invoice_actions['pay'])) {
112
+    unset($invoice_actions['pay']);
113 113
 }
114 114
 
115
-if ( ! is_user_logged_in() && isset( $invoice_actions['history'] ) ) {
116
-    unset( $invoice_actions['history'] );
115
+if (!is_user_logged_in() && isset($invoice_actions['history'])) {
116
+    unset($invoice_actions['history']);
117 117
 }
118 118
 
119 119
 ?>
@@ -122,29 +122,29 @@  discard block
 block discarded – undo
122 122
 
123 123
         <?php
124 124
 
125
-            do_action( 'wpinv_receipt_start', $invoice );
125
+            do_action('wpinv_receipt_start', $invoice);
126 126
 
127
-            if ( ! empty( $invoice_actions ) ) {
127
+            if (!empty($invoice_actions)) {
128 128
 
129 129
 			echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">';
130 130
 
131
-			foreach ( $invoice_actions as $key => $invoice_action ) {
131
+			foreach ($invoice_actions as $key => $invoice_action) {
132 132
 
133
-				$key    = sanitize_html_class( $key );
134
-				$class  = empty( $invoice_action['class'] ) ? 'btn-dark' : sanitize_html_class( $invoice_action['class'] );
135
-				$url    = empty( $invoice_action['url'] ) ? '#' : esc_url( $invoice_action['url'] );
136
-				$attrs  = empty( $invoice_action['attrs'] ) ? '' : $invoice_action['attrs'];
137
-				$anchor = esc_html( $invoice_action['name'] );
133
+				$key    = sanitize_html_class($key);
134
+				$class  = empty($invoice_action['class']) ? 'btn-dark' : sanitize_html_class($invoice_action['class']);
135
+				$url    = empty($invoice_action['url']) ? '#' : esc_url($invoice_action['url']);
136
+				$attrs  = empty($invoice_action['attrs']) ? '' : $invoice_action['attrs'];
137
+				$anchor = esc_html($invoice_action['name']);
138 138
 
139
-				echo wp_kses_post( "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>" );
139
+				echo wp_kses_post("<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>");
140 140
                 }
141 141
 
142 142
 			echo '</div>';
143 143
 
144 144
             }
145 145
 
146
-            if ( ! empty( $alert ) ) {
147
-			echo wp_kses_post( $alert );
146
+            if (!empty($alert)) {
147
+			echo wp_kses_post($alert);
148 148
             }
149 149
 
150 150
         ?>
@@ -152,19 +152,19 @@  discard block
 block discarded – undo
152 152
         <div class="wpinv-receipt-details">
153 153
 
154 154
             <h4 class="wpinv-details-t mb-3 mt-3">
155
-                <?php echo esc_html( apply_filters( 'wpinv_receipt_details_title', __( 'Invoice Details', 'invoicing' ), $invoice ) ); ?>
155
+                <?php echo esc_html(apply_filters('wpinv_receipt_details_title', __('Invoice Details', 'invoicing'), $invoice)); ?>
156 156
             </h4>
157 157
 
158
-            <?php getpaid_invoice_meta( $invoice ); ?>
158
+            <?php getpaid_invoice_meta($invoice); ?>
159 159
 
160 160
         </div>
161 161
 
162
-        <?php do_action( 'wpinv_receipt_end', $invoice ); ?>
162
+        <?php do_action('wpinv_receipt_end', $invoice); ?>
163 163
 
164 164
     </div>
165 165
 
166 166
 <?php
167 167
 
168 168
 // @deprecated
169
-do_action( 'wpinv_success_content_after', $invoice );
170
-do_action( 'wpinv_after_receipt', $invoice );
169
+do_action('wpinv_success_content_after', $invoice);
170
+do_action('wpinv_after_receipt', $invoice);
Please login to merge, or discard this patch.
includes/admin/class-wpinv-users.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 // MUST have WordPress.
10
-if ( ! defined( 'WPINC' ) ) {
10
+if (!defined('WPINC')) {
11 11
     exit;
12 12
 }
13 13
 
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     private static $instance;
16 16
 
17 17
     public static function run() {
18
-        if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WPInv_Admin_Users ) ) {
18
+        if (!isset(self::$instance) && !(self::$instance instanceof WPInv_Admin_Users)) {
19 19
             self::$instance = new WPInv_Admin_Users();
20 20
         }
21 21
 
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
     }
24 24
 
25 25
     public function __construct() {
26
-        add_filter( 'manage_users_columns', array( $this, 'wpinv_add_user_column' ) );
27
-        add_filter( 'manage_users_custom_column', array( $this, 'wpinv_user_column_content' ), 10, 3 );
26
+        add_filter('manage_users_columns', array($this, 'wpinv_add_user_column'));
27
+        add_filter('manage_users_custom_column', array($this, 'wpinv_user_column_content'), 10, 3);
28 28
     }
29 29
 
30 30
     /**
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
      *
35 35
      * @return mixed
36 36
      */
37
-    public function wpinv_add_user_column( $column ) {
38
-        $column['wpinvoicing'] = __( 'Invoicing', 'invoicing' );
37
+    public function wpinv_add_user_column($column) {
38
+        $column['wpinvoicing'] = __('Invoicing', 'invoicing');
39 39
         return $column;
40 40
     }
41 41
 
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @return string
50 50
      */
51
-    public function wpinv_user_column_content( $val, $column_name, $user_id ) {
52
-        switch ( $column_name ) {
51
+    public function wpinv_user_column_content($val, $column_name, $user_id) {
52
+        switch ($column_name) {
53 53
             case 'wpinvoicing':
54
-                return $this->get_user_invoices( $user_id );
54
+                return $this->get_user_invoices($user_id);
55 55
                 break;
56 56
             default:
57 57
         }
@@ -65,30 +65,30 @@  discard block
 block discarded – undo
65 65
      *
66 66
      * @return string
67 67
      */
68
-    public function get_user_invoices( $user_id ) {
68
+    public function get_user_invoices($user_id) {
69 69
         $output = '';
70 70
         $wp_query_args = array(
71 71
             'post_type'      => 'wpi_invoice',
72
-            'post_status'    => array( 'wpi-pending', 'publish', 'wpi-processing', 'wpi-onhold', 'wpi-refunded', 'wpi-cancelled', 'wpi-failed', 'wpi-renewal' ),
72
+            'post_status'    => array('wpi-pending', 'publish', 'wpi-processing', 'wpi-onhold', 'wpi-refunded', 'wpi-cancelled', 'wpi-failed', 'wpi-renewal'),
73 73
             'posts_per_page' => -1,
74 74
             'fields'         => 'ids',
75 75
             'author'         => $user_id,
76 76
         );
77 77
 
78
-        $wp_query_args = apply_filters( 'wpinv_get_user_invoices_args', $wp_query_args, $user_id );
78
+        $wp_query_args = apply_filters('wpinv_get_user_invoices_args', $wp_query_args, $user_id);
79 79
 
80
-        $invoices = new WP_Query( $wp_query_args );
81
-        $count = absint( $invoices->found_posts );
80
+        $invoices = new WP_Query($wp_query_args);
81
+        $count = absint($invoices->found_posts);
82 82
 
83
-        if ( empty( $count ) ) {
84
-            $output .= __( 'No Invoice(s)', 'invoicing' );
83
+        if (empty($count)) {
84
+            $output .= __('No Invoice(s)', 'invoicing');
85 85
         } else {
86
-            $link_url = admin_url( 'edit.php?post_type=wpi_invoice&author=' . absint( $user_id ) );
87
-            $link_text = sprintf( __( 'Invoices ( %d )', 'invoicing' ), $count );
86
+            $link_url = admin_url('edit.php?post_type=wpi_invoice&author=' . absint($user_id));
87
+            $link_text = sprintf(__('Invoices ( %d )', 'invoicing'), $count);
88 88
             $output .= "<a href='$link_url' >$link_text</a>";
89 89
         }
90 90
 
91
-        return apply_filters( 'wpinv_user_invoice_content', $output, $user_id );
91
+        return apply_filters('wpinv_user_invoice_content', $output, $user_id);
92 92
     }
93 93
 
94 94
 }
Please login to merge, or discard this patch.
includes/admin/views/html-tax-rates-edit.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  *
5 5
  */
6 6
 
7
-defined( 'ABSPATH' ) || exit;
7
+defined('ABSPATH') || exit;
8 8
 
9 9
 $tax_rates  = GetPaid_Tax::get_all_tax_rates();
10 10
 $dummy_rate = array(
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
     'global'       => true,
14 14
     'rate'         => wpinv_get_default_tax_rate(),
15 15
     'reduced_rate' => 5,
16
-    'name'         => __( 'VAT', 'invoicing' ),
16
+    'name'         => __('VAT', 'invoicing'),
17 17
 );
18 18
 
19 19
 $reset_url = wp_nonce_url(
20
-    add_query_arg( 'getpaid-admin-action', 'reset_tax_rates' ),
20
+    add_query_arg('getpaid-admin-action', 'reset_tax_rates'),
21 21
     'getpaid-nonce',
22 22
     'getpaid-nonce'
23 23
 );
@@ -25,34 +25,34 @@  discard block
 block discarded – undo
25 25
 ?>
26 26
 <div class="table-responsive">
27 27
     <table id="wpinv_tax_rates" class="widefat fixed table">
28
-        <caption><?php echo esc_html_e( 'Enter tax rates for specific regions.', 'invoicing' ); ?></caption>
28
+        <caption><?php echo esc_html_e('Enter tax rates for specific regions.', 'invoicing'); ?></caption>
29 29
 
30 30
         <thead>
31 31
             <tr class="table-light">
32 32
 
33 33
                 <th scope="col" class="border-bottom border-top">
34
-                    <?php esc_html_e( 'Country', 'invoicing' ); ?>
35
-                    <?php getpaid_get_help_tip( __( 'Optionally limit this tax rate to a specific country.', 'invoicing' ), 'position-static', true ); ?>
34
+                    <?php esc_html_e('Country', 'invoicing'); ?>
35
+                    <?php getpaid_get_help_tip(__('Optionally limit this tax rate to a specific country.', 'invoicing'), 'position-static', true); ?>
36 36
                 </th>
37 37
 
38 38
                 <th scope="col" class="border-bottom border-top">
39
-                    <?php esc_html_e( 'State', 'invoicing' ); ?>
40
-                    <?php getpaid_get_help_tip( __( 'Separate state codes using a comma or leave blank to apply country wide.', 'invoicing' ), 'position-static', true ); ?>
39
+                    <?php esc_html_e('State', 'invoicing'); ?>
40
+                    <?php getpaid_get_help_tip(__('Separate state codes using a comma or leave blank to apply country wide.', 'invoicing'), 'position-static', true); ?>
41 41
                 </th>
42 42
 
43 43
                 <th scope="col" class="border-bottom border-top">
44
-                    <?php esc_html_e( 'Standard Rate %', 'invoicing' ); ?>
45
-                    <?php getpaid_get_help_tip( __( 'The tax rate (percentage) to charge on items that use the "Standard rate" tax class.', 'invoicing' ), 'position-static', true ); ?>
44
+                    <?php esc_html_e('Standard Rate %', 'invoicing'); ?>
45
+                    <?php getpaid_get_help_tip(__('The tax rate (percentage) to charge on items that use the "Standard rate" tax class.', 'invoicing'), 'position-static', true); ?>
46 46
                 </th>
47 47
 
48 48
                 <th scope="col" class="border-bottom border-top">
49
-                    <?php esc_html_e( 'Reduced Rate %', 'invoicing' ); ?>
50
-                    <?php getpaid_get_help_tip( __( 'The tax rate (percentage) to charge on items that use the "Reduced rate" tax class.', 'invoicing' ), 'position-static', true ); ?>
49
+                    <?php esc_html_e('Reduced Rate %', 'invoicing'); ?>
50
+                    <?php getpaid_get_help_tip(__('The tax rate (percentage) to charge on items that use the "Reduced rate" tax class.', 'invoicing'), 'position-static', true); ?>
51 51
                 </th>
52 52
 
53 53
                 <th scope="col" class="border-bottom border-top">
54
-                    <?php esc_html_e( 'Tax Name', 'invoicing' ); ?>
55
-                    <?php getpaid_get_help_tip( __( 'The name of this tax, e.g VAT.', 'invoicing' ), 'position-static', true ); ?>
54
+                    <?php esc_html_e('Tax Name', 'invoicing'); ?>
55
+                    <?php getpaid_get_help_tip(__('The name of this tax, e.g VAT.', 'invoicing'), 'position-static', true); ?>
56 56
                 </th>
57 57
 
58 58
                 <th scope="col" class="border-bottom border-top" style="width:32px">&nbsp;</th>
@@ -61,19 +61,19 @@  discard block
 block discarded – undo
61 61
         </thead>
62 62
 
63 63
         <tbody>
64
-            <?php array_walk( $tax_rates, 'wpinv_tax_rate_callback' ); ?>
64
+            <?php array_walk($tax_rates, 'wpinv_tax_rate_callback'); ?>
65 65
         </tbody>
66 66
 
67 67
         <tfoot>
68 68
             <tr class="table-light">
69 69
                 <td colspan="6" class="border-top">
70 70
 
71
-                    <button type="button" class="button button-secondary wpinv_add_tax_rate" aria-label="<?php esc_attr_e( 'Add Tax Rate', 'invoicing' ); ?>">
72
-                        <span><?php esc_html_e( 'Add Tax Rate', 'invoicing' ); ?></span>
71
+                    <button type="button" class="button button-secondary wpinv_add_tax_rate" aria-label="<?php esc_attr_e('Add Tax Rate', 'invoicing'); ?>">
72
+                        <span><?php esc_html_e('Add Tax Rate', 'invoicing'); ?></span>
73 73
                     </button>
74 74
 
75
-                    <a href="<?php echo esc_url( $reset_url ); ?>" class="button button-secondary wpinv_reset_tax_rates" aria-label="<?php esc_attr_e( 'Reset Tax Rates', 'invoicing' ); ?>">
76
-                        <span><?php esc_html_e( 'Reset Tax Rates', 'invoicing' ); ?></span>
75
+                    <a href="<?php echo esc_url($reset_url); ?>" class="button button-secondary wpinv_reset_tax_rates" aria-label="<?php esc_attr_e('Reset Tax Rates', 'invoicing'); ?>">
76
+                        <span><?php esc_html_e('Reset Tax Rates', 'invoicing'); ?></span>
77 77
                     </a>
78 78
                 </td>
79 79
             </tr>
@@ -82,6 +82,6 @@  discard block
 block discarded – undo
82 82
 </div>
83 83
 
84 84
 <script type="text/html" id="tmpl-wpinv-tax-rate-row">
85
-    <?php wpinv_tax_rate_callback( $dummy_rate, 0, true ); ?>
85
+    <?php wpinv_tax_rate_callback($dummy_rate, 0, true); ?>
86 86
 </script>
87 87
 
Please login to merge, or discard this patch.
includes/class-wpinv-cache-helper.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit; // Exit if accessed directly
4 4
 }
5 5
 
@@ -14,18 +14,18 @@  discard block
 block discarded – undo
14 14
      * Hook in methods.
15 15
      */
16 16
     public static function init() {
17
-        add_action( 'init', array( __CLASS__, 'init_hooks' ), 0 );
18
-        add_action( 'admin_notices', array( __CLASS__, 'notices' ) );
17
+        add_action('init', array(__CLASS__, 'init_hooks'), 0);
18
+        add_action('admin_notices', array(__CLASS__, 'notices'));
19 19
     }
20 20
 
21 21
     public static function init_hooks() {
22
-        if ( false === ( $page_uris = get_transient( 'wpinv_cache_excluded_uris' ) ) ) {
23
-            $checkout_page = wpinv_get_option( 'checkout_page', '' );
24
-            $success_page  = wpinv_get_option( 'success_page', '' );
25
-            $failure_page  = wpinv_get_option( 'failure_page', '' );
26
-            $history_page  = wpinv_get_option( 'invoice_history_page', '' );
27
-            $subscr_page   = wpinv_get_option( 'invoice_subscription_page', '' );
28
-            if ( empty( $checkout_page ) || empty( $success_page ) || empty( $failure_page ) || empty( $history_page ) || empty( $subscr_page ) ) {
22
+        if (false === ($page_uris = get_transient('wpinv_cache_excluded_uris'))) {
23
+            $checkout_page = wpinv_get_option('checkout_page', '');
24
+            $success_page  = wpinv_get_option('success_page', '');
25
+            $failure_page  = wpinv_get_option('failure_page', '');
26
+            $history_page  = wpinv_get_option('invoice_history_page', '');
27
+            $subscr_page   = wpinv_get_option('invoice_subscription_page', '');
28
+            if (empty($checkout_page) || empty($success_page) || empty($failure_page) || empty($history_page) || empty($subscr_page)) {
29 29
                 return;
30 30
             }
31 31
 
@@ -39,34 +39,34 @@  discard block
 block discarded – undo
39 39
             $page_uris[] = 'p=' . $subscr_page;
40 40
 
41 41
             // Exclude permalinks
42
-            $checkout_page  = get_post( $checkout_page );
43
-            $success_page   = get_post( $success_page );
44
-            $failure_page   = get_post( $failure_page );
45
-            $history_page   = get_post( $history_page );
46
-            $subscr_page    = get_post( $subscr_page );
42
+            $checkout_page  = get_post($checkout_page);
43
+            $success_page   = get_post($success_page);
44
+            $failure_page   = get_post($failure_page);
45
+            $history_page   = get_post($history_page);
46
+            $subscr_page    = get_post($subscr_page);
47 47
 
48
-            if ( ! is_null( $checkout_page ) ) {
48
+            if (!is_null($checkout_page)) {
49 49
                 $page_uris[] = '/' . $checkout_page->post_name;
50 50
             }
51
-            if ( ! is_null( $success_page ) ) {
51
+            if (!is_null($success_page)) {
52 52
                 $page_uris[] = '/' . $success_page->post_name;
53 53
             }
54
-            if ( ! is_null( $failure_page ) ) {
54
+            if (!is_null($failure_page)) {
55 55
                 $page_uris[] = '/' . $failure_page->post_name;
56 56
             }
57
-            if ( ! is_null( $history_page ) ) {
57
+            if (!is_null($history_page)) {
58 58
                 $page_uris[] = '/' . $history_page->post_name;
59 59
             }
60
-            if ( ! is_null( $subscr_page ) ) {
60
+            if (!is_null($subscr_page)) {
61 61
                 $page_uris[] = '/' . $subscr_page->post_name;
62 62
             }
63 63
 
64
-            set_transient( 'wpinv_cache_excluded_uris', $page_uris );
64
+            set_transient('wpinv_cache_excluded_uris', $page_uris);
65 65
         }
66 66
 
67
-        if ( is_array( $page_uris ) ) {
68
-            foreach ( $page_uris as $uri ) {
69
-                if ( strstr( $_SERVER['REQUEST_URI'], $uri ) ) {
67
+        if (is_array($page_uris)) {
68
+            foreach ($page_uris as $uri) {
69
+                if (strstr($_SERVER['REQUEST_URI'], $uri)) {
70 70
                     self::nocache();
71 71
                     break;
72 72
                 }
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
      * @access private
80 80
      */
81 81
     private static function nocache() {
82
-        if ( ! defined( 'DONOTCACHEPAGE' ) ) {
83
-            define( 'DONOTCACHEPAGE', true );
82
+        if (!defined('DONOTCACHEPAGE')) {
83
+            define('DONOTCACHEPAGE', true);
84 84
         }
85
-        if ( ! defined( 'DONOTCACHEOBJECT' ) ) {
86
-            define( 'DONOTCACHEOBJECT', true );
85
+        if (!defined('DONOTCACHEOBJECT')) {
86
+            define('DONOTCACHEOBJECT', true);
87 87
         }
88
-        if ( ! defined( 'DONOTCACHEDB' ) ) {
89
-            define( 'DONOTCACHEDB', true );
88
+        if (!defined('DONOTCACHEDB')) {
89
+            define('DONOTCACHEDB', true);
90 90
         }
91 91
         nocache_headers();
92 92
     }
@@ -95,18 +95,18 @@  discard block
 block discarded – undo
95 95
      * notices function.
96 96
      */
97 97
     public static function notices() {
98
-        if ( ! function_exists( 'w3tc_pgcache_flush' ) || ! function_exists( 'w3_instance' ) ) {
98
+        if (!function_exists('w3tc_pgcache_flush') || !function_exists('w3_instance')) {
99 99
             return;
100 100
         }
101 101
 
102
-        $config   = w3_instance( 'W3_Config' );
103
-        $enabled  = $config->get_integer( 'dbcache.enabled' );
104
-        $settings = array_map( 'trim', $config->get_array( 'dbcache.reject.sql' ) );
102
+        $config   = w3_instance('W3_Config');
103
+        $enabled  = $config->get_integer('dbcache.enabled');
104
+        $settings = array_map('trim', $config->get_array('dbcache.reject.sql'));
105 105
 
106
-        if ( $enabled && ! in_array( '_wp_session_', $settings ) ) {
106
+        if ($enabled && !in_array('_wp_session_', $settings)) {
107 107
             ?>
108 108
             <div class="error">
109
-                <p><?php printf( wp_kses_post( __( 'In order for <strong>database caching</strong> to work with Invoicing you must add %1$s to the "Ignored Query Strings" option in <a href="%2$s">W3 Total Cache settings</a>.', 'invoicing' ) ), '<code>_wp_session_</code>', esc_url( admin_url( 'admin.php?page=w3tc_dbcache' ) ) ); ?></p>
109
+                <p><?php printf(wp_kses_post(__('In order for <strong>database caching</strong> to work with Invoicing you must add %1$s to the "Ignored Query Strings" option in <a href="%2$s">W3 Total Cache settings</a>.', 'invoicing')), '<code>_wp_session_</code>', esc_url(admin_url('admin.php?page=w3tc_dbcache'))); ?></p>
110 110
             </div>
111 111
             <?php
112 112
         }
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-mb-invoice-notes.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,38 +1,38 @@
 block discarded – undo
1 1
 <?php
2 2
 // MUST have WordPress.
3
-if ( ! defined( 'WPINC' ) ) {
3
+if (!defined('WPINC')) {
4 4
     exit;
5 5
 }
6 6
 
7 7
 class WPInv_Meta_Box_Notes {
8
-    public static function output( $post ) {
8
+    public static function output($post) {
9 9
         global $post;
10 10
 
11
-        $notes = wpinv_get_invoice_notes( $post->ID );
11
+        $notes = wpinv_get_invoice_notes($post->ID);
12 12
 
13 13
         echo '<ul class="invoice_notes">';
14 14
 
15
-        if ( $notes ) {
16
-            foreach ( $notes as $note ) {
17
-                wpinv_get_invoice_note_line_item( $note );
15
+        if ($notes) {
16
+            foreach ($notes as $note) {
17
+                wpinv_get_invoice_note_line_item($note);
18 18
             }
19 19
 } else {
20
-            echo '<li>' . esc_html__( 'There are no notes yet.', 'invoicing' ) . '</li>';
20
+            echo '<li>' . esc_html__('There are no notes yet.', 'invoicing') . '</li>';
21 21
         }
22 22
 
23 23
         echo '</ul>';
24 24
         ?>
25 25
         <div class="add_note">
26
-            <h4><?php esc_html_e( 'Add note', 'invoicing' ); ?></h4>
26
+            <h4><?php esc_html_e('Add note', 'invoicing'); ?></h4>
27 27
             <p>
28 28
                 <textarea type="text" name="invoice_note" id="add_invoice_note" class="input-text" cols="20" rows="5"></textarea>
29 29
             </p>
30 30
             <p>
31 31
                 <select name="invoice_note_type" id="invoice_note_type" class="regular-text">
32
-                    <option value=""><?php esc_html_e( 'Private note', 'invoicing' ); ?></option>
33
-                    <option value="customer"><?php esc_html_e( 'Note to customer', 'invoicing' ); ?></option>
32
+                    <option value=""><?php esc_html_e('Private note', 'invoicing'); ?></option>
33
+                    <option value="customer"><?php esc_html_e('Note to customer', 'invoicing'); ?></option>
34 34
                 </select>
35
-                <a href="#" class="add_note button"><?php esc_html_e( 'Add', 'invoicing' ); ?></a> <span class="description"><?php esc_html_e( 'Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing' ); ?></span>
35
+                <a href="#" class="add_note button"><?php esc_html_e('Add', 'invoicing'); ?></a> <span class="description"><?php esc_html_e('Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing'); ?></span>
36 36
             </p>
37 37
         </div>
38 38
         <?php
Please login to merge, or discard this patch.
includes/error-functions.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -126,14 +126,14 @@
 block discarded – undo
126 126
  */
127 127
 function getpaid_doing_it_wrong( $function, $message, $version ) {
128 128
 
129
-	$message .= ' Backtrace: ' . wp_debug_backtrace_summary();
130
-
131
-	if ( wp_doing_ajax() || defined( 'REST_REQUEST' ) ) {
132
-		do_action( 'doing_it_wrong_run', $function, $message, $version );
133
-		error_log( "{$function} was called incorrectly. {$message}. This message was added in version {$version}." );
134
-	} else {
135
-		_doing_it_wrong( esc_html( $function ), wp_kses_post( $message ), esc_html( $version ) );
136
-	}
129
+    $message .= ' Backtrace: ' . wp_debug_backtrace_summary();
130
+
131
+    if ( wp_doing_ajax() || defined( 'REST_REQUEST' ) ) {
132
+        do_action( 'doing_it_wrong_run', $function, $message, $version );
133
+        error_log( "{$function} was called incorrectly. {$message}. This message was added in version {$version}." );
134
+    } else {
135
+        _doing_it_wrong( esc_html( $function ), wp_kses_post( $message ), esc_html( $version ) );
136
+    }
137 137
 
138 138
 }
139 139
 
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Invoicing
7 7
  */
8 8
 
9
-defined( 'ABSPATH' ) || exit;
9
+defined('ABSPATH') || exit;
10 10
 
11 11
 /**
12 12
  * Returns the errors as html
@@ -15,35 +15,35 @@  discard block
 block discarded – undo
15 15
  * @param bool $wrap whether or not to wrap the errors.
16 16
  * @since  1.0.19
17 17
  */
18
-function getpaid_get_errors_html( $clear = true, $wrap = true ) {
18
+function getpaid_get_errors_html($clear = true, $wrap = true) {
19 19
 
20 20
     $errors = '';
21
-    foreach ( wpinv_get_errors() as $id => $error ) {
22
-        $type     = 'error';
21
+    foreach (wpinv_get_errors() as $id => $error) {
22
+        $type = 'error';
23 23
 
24
-        if ( is_array( $error ) ) {
24
+        if (is_array($error)) {
25 25
             $type  = $error['type'];
26 26
             $error = $error['text'];
27 27
         }
28 28
 
29
-        if ( $wrap ) {
29
+        if ($wrap) {
30 30
 
31 31
             $errors .= aui()->alert(
32 32
                 array(
33
-                    'content' => wp_kses_post( $error ),
33
+                    'content' => wp_kses_post($error),
34 34
                     'type'    => $type,
35 35
                 )
36 36
             );
37 37
 
38 38
         } else {
39 39
 
40
-            $id      = esc_attr( $id );
41
-            $error   = wp_kses_post( $error );
40
+            $id      = esc_attr($id);
41
+            $error   = wp_kses_post($error);
42 42
             $errors .= "<div data-code='$id'>$error</div>";
43 43
         }
44 44
     }
45 45
 
46
-    if ( $clear ) {
46
+    if ($clear) {
47 47
         wpinv_clear_errors();
48 48
     }
49 49
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
  * Prints (then clears) all available errors.
56 56
  */
57 57
 function wpinv_print_errors() {
58
-    echo wp_kses_post( getpaid_get_errors_html() );
58
+    echo wp_kses_post(getpaid_get_errors_html());
59 59
 }
60 60
 
61 61
 /**
@@ -69,54 +69,54 @@  discard block
 block discarded – undo
69 69
     $all_errors = array(
70 70
         'perm_cancel_subscription'   => array(
71 71
             'type' => 'error',
72
-            'text' => __( 'You do not have permission to cancel this subscription', 'invoicing' ),
72
+            'text' => __('You do not have permission to cancel this subscription', 'invoicing'),
73 73
         ),
74 74
         'cannot_cancel_subscription' => array(
75 75
             'type' => 'error',
76
-            'text' => __( 'This subscription cannot be cancelled as it is not active.', 'invoicing' ),
76
+            'text' => __('This subscription cannot be cancelled as it is not active.', 'invoicing'),
77 77
         ),
78 78
         'cancelled_subscription'     => array(
79 79
             'type' => 'success',
80
-            'text' => __( 'Subscription cancelled successfully.', 'invoicing' ),
80
+            'text' => __('Subscription cancelled successfully.', 'invoicing'),
81 81
         ),
82 82
         'address_updated'            => array(
83 83
             'type' => 'success',
84
-            'text' => __( 'Address updated successfully.', 'invoicing' ),
84
+            'text' => __('Address updated successfully.', 'invoicing'),
85 85
         ),
86 86
         'perm_delete_invoice'        => array(
87 87
             'type' => 'error',
88
-            'text' => __( 'You do not have permission to delete this invoice', 'invoicing' ),
88
+            'text' => __('You do not have permission to delete this invoice', 'invoicing'),
89 89
         ),
90 90
         'cannot_delete_invoice'      => array(
91 91
             'type' => 'error',
92
-            'text' => __( 'This invoice cannot be deleted as it has already been paid.', 'invoicing' ),
92
+            'text' => __('This invoice cannot be deleted as it has already been paid.', 'invoicing'),
93 93
         ),
94 94
         'deleted_invoice'            => array(
95 95
             'type' => 'success',
96
-            'text' => __( 'Invoice deleted successfully.', 'invoicing' ),
96
+            'text' => __('Invoice deleted successfully.', 'invoicing'),
97 97
         ),
98 98
         'card_declined'              => array(
99 99
             'type' => 'error',
100
-            'text' => __( 'Your card was declined.', 'invoicing' ),
100
+            'text' => __('Your card was declined.', 'invoicing'),
101 101
         ),
102 102
         'invalid_currency'           => array(
103 103
             'type' => 'error',
104
-            'text' => __( 'The chosen payment gateway does not support this currency.', 'invoicing' ),
104
+            'text' => __('The chosen payment gateway does not support this currency.', 'invoicing'),
105 105
         ),
106 106
     );
107 107
 
108
-    $errors = apply_filters( 'wpinv_errors', array() );
108
+    $errors = apply_filters('wpinv_errors', array());
109 109
 
110
-    if ( isset( $_GET['wpinv-notice'] ) && isset( $all_errors[ $_GET['wpinv-notice'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
111
-        $errors[ $_GET['wpinv-notice'] ] = $all_errors[ $_GET['wpinv-notice'] ]; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
110
+    if (isset($_GET['wpinv-notice']) && isset($all_errors[$_GET['wpinv-notice']])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
111
+        $errors[$_GET['wpinv-notice']] = $all_errors[$_GET['wpinv-notice']]; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
112 112
     }
113 113
 
114
-    if ( isset( $GLOBALS['wpinv_notice'] ) && isset( $all_errors[ $GLOBALS['wpinv_notice'] ] ) ) {
115
-        $errors[ $GLOBALS['wpinv_notice'] ] = $all_errors[ $GLOBALS['wpinv_notice'] ];
114
+    if (isset($GLOBALS['wpinv_notice']) && isset($all_errors[$GLOBALS['wpinv_notice']])) {
115
+        $errors[$GLOBALS['wpinv_notice']] = $all_errors[$GLOBALS['wpinv_notice']];
116 116
     }
117 117
 
118
-    if ( isset( $GLOBALS['wpinv_custom_notice'] ) ) {
119
-        $errors[ $GLOBALS['wpinv_custom_notice']['code'] ] = $GLOBALS['wpinv_custom_notice'];
118
+    if (isset($GLOBALS['wpinv_custom_notice'])) {
119
+        $errors[$GLOBALS['wpinv_custom_notice']['code']] = $GLOBALS['wpinv_custom_notice'];
120 120
     }
121 121
 
122 122
     return $errors;
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
  * @param string $error The error message.
130 130
  * @param string $type The error type.
131 131
  */
132
-function wpinv_set_error( $error_id, $message = '', $type = 'error' ) {
132
+function wpinv_set_error($error_id, $message = '', $type = 'error') {
133 133
 
134
-    if ( ! empty( $message ) ) {
134
+    if (!empty($message)) {
135 135
         $GLOBALS['wpinv_custom_notice'] = array(
136 136
             'code' => $error_id,
137 137
             'type' => $type,
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
  *
148 148
  */
149 149
 function wpinv_has_errors() {
150
-    return count( wpinv_get_errors() ) > 0;
150
+    return count(wpinv_get_errors()) > 0;
151 151
 }
152 152
 
153 153
 /**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
  *
156 156
  */
157 157
 function wpinv_clear_errors() {
158
-    unset( $GLOBALS['wpinv_notice'] );
158
+    unset($GLOBALS['wpinv_notice']);
159 159
 }
160 160
 
161 161
 /**
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
  *
164 164
  */
165 165
 function wpinv_unset_error() {
166
-    unset( $GLOBALS['wpinv_notice'] );
166
+    unset($GLOBALS['wpinv_notice']);
167 167
 }
168 168
 
169 169
 /**
@@ -174,15 +174,15 @@  discard block
 block discarded – undo
174 174
  * @param string $message Message to log.
175 175
  * @param string $version Version the message was added in.
176 176
  */
177
-function getpaid_doing_it_wrong( $function, $message, $version ) {
177
+function getpaid_doing_it_wrong($function, $message, $version) {
178 178
 
179 179
 	$message .= ' Backtrace: ' . wp_debug_backtrace_summary();
180 180
 
181
-	if ( wp_doing_ajax() || defined( 'REST_REQUEST' ) ) {
182
-		do_action( 'doing_it_wrong_run', $function, $message, $version );
183
-		error_log( "{$function} was called incorrectly. {$message}. This message was added in version {$version}." );
181
+	if (wp_doing_ajax() || defined('REST_REQUEST')) {
182
+		do_action('doing_it_wrong_run', $function, $message, $version);
183
+		error_log("{$function} was called incorrectly. {$message}. This message was added in version {$version}.");
184 184
 	} else {
185
-		_doing_it_wrong( esc_html( $function ), wp_kses_post( $message ), esc_html( $version ) );
185
+		_doing_it_wrong(esc_html($function), wp_kses_post($message), esc_html($version));
186 186
 	}
187 187
 
188 188
 }
@@ -196,41 +196,41 @@  discard block
 block discarded – undo
196 196
  * @param string $line The line that contains the error.
197 197
  * @param bool $exit Whether or not to exit function execution.
198 198
  */
199
-function wpinv_error_log( $log, $title = '', $file = '', $line = '', $exit = false ) {
199
+function wpinv_error_log($log, $title = '', $file = '', $line = '', $exit = false) {
200 200
 
201
-    if ( true === apply_filters( 'wpinv_log_errors', true ) ) {
201
+    if (true === apply_filters('wpinv_log_errors', true)) {
202 202
 
203 203
         // Ensure the log is a scalar.
204
-        if ( ! is_scalar( $log ) ) {
205
-            $log = print_r( $log, true );
204
+        if (!is_scalar($log)) {
205
+            $log = print_r($log, true);
206 206
         }
207 207
 
208 208
         // Add title.
209
-        if ( ! empty( $title ) ) {
210
-            $log  = $title . ' ' . trim( $log );
209
+        if (!empty($title)) {
210
+            $log = $title . ' ' . trim($log);
211 211
         }
212 212
 
213 213
         // Add the file to the label.
214
-        if ( ! empty( $file ) ) {
214
+        if (!empty($file)) {
215 215
             $log .= ' in ' . $file;
216 216
         }
217 217
 
218 218
         // Add the line number to the label.
219
-        if ( ! empty( $line ) ) {
219
+        if (!empty($line)) {
220 220
             $log .= ' on line ' . $line;
221 221
         }
222 222
 
223 223
         // Log the message.
224
-        error_log( trim( $log ) );
224
+        error_log(trim($log));
225 225
 
226 226
         // ... and a backtrace.
227
-        if ( false !== $title && false !== $file ) {
228
-            error_log( 'Backtrace ' . wp_debug_backtrace_summary() );
227
+        if (false !== $title && false !== $file) {
228
+            error_log('Backtrace ' . wp_debug_backtrace_summary());
229 229
         }
230 230
 }
231 231
 
232 232
     // Maybe exit.
233
-    if ( $exit ) {
233
+    if ($exit) {
234 234
         exit;
235 235
     }
236 236
 
Please login to merge, or discard this patch.