Passed
Push — master ( 6086f2...9dee83 )
by Kiran
09:50 queued 20s
created
templates/payment-forms/elements/heading.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$heading_tag  = isset( $element['level'] ) ? trim( sanitize_key( $element['level'] ) ) : 'h3';
13
-$text = isset( $element['text'] ) ? trim( $element['text'] ) : '';
12
+$heading_tag = isset($element['level']) ? trim(sanitize_key($element['level'])) : 'h3';
13
+$text = isset($element['text']) ? trim($element['text']) : '';
14 14
 
15
-if ( ! empty( $text ) ) {
16
-    echo wp_kses_post( "<$heading_tag>$text</$heading_tag>" );
15
+if (!empty($text)) {
16
+    echo wp_kses_post("<$heading_tag>$text</$heading_tag>");
17 17
 }
Please login to merge, or discard this patch.
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/invoice-receipt.php 1 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/wpinv-admin-functions.php 1 patch
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -7,81 +7,81 @@  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
 
14
-function wpinv_bulk_actions( $actions ) {
15
-    if ( isset( $actions['edit'] ) ) {
16
-        unset( $actions['edit'] );
14
+function wpinv_bulk_actions($actions) {
15
+    if (isset($actions['edit'])) {
16
+        unset($actions['edit']);
17 17
     }
18 18
 
19 19
     return $actions;
20 20
 }
21
-add_filter( 'bulk_actions-edit-wpi_invoice', 'wpinv_bulk_actions' );
22
-add_filter( 'bulk_actions-edit-wpi_item', 'wpinv_bulk_actions' );
21
+add_filter('bulk_actions-edit-wpi_invoice', 'wpinv_bulk_actions');
22
+add_filter('bulk_actions-edit-wpi_item', 'wpinv_bulk_actions');
23 23
 
24
-function wpinv_admin_post_id( $id = 0 ) {
24
+function wpinv_admin_post_id($id = 0) {
25 25
     global $post;
26 26
 
27
-    if ( isset( $id ) && ! empty( $id ) ) {
28
-        return (int)$id;
29
-    } elseif ( get_the_ID() ) {
27
+    if (isset($id) && !empty($id)) {
28
+        return (int) $id;
29
+    } elseif (get_the_ID()) {
30 30
         return (int) get_the_ID();
31
-    } elseif ( isset( $post->ID ) && ! empty( $post->ID ) ) {
31
+    } elseif (isset($post->ID) && !empty($post->ID)) {
32 32
         return (int) $post->ID;
33
-    } elseif ( isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) {
33
+    } elseif (isset($_GET['post']) && !empty($_GET['post'])) {
34 34
         return (int) $_GET['post'];
35
-    } elseif ( isset( $_GET['id'] ) && ! empty( $_GET['id'] ) ) {
35
+    } elseif (isset($_GET['id']) && !empty($_GET['id'])) {
36 36
         return (int) $_GET['id'];
37
-    } elseif ( isset( $_POST['id'] ) && ! empty( $_POST['id'] ) ) {
37
+    } elseif (isset($_POST['id']) && !empty($_POST['id'])) {
38 38
         return (int) $_POST['id'];
39 39
     }
40 40
 
41 41
     return null;
42 42
 }
43 43
 
44
-function wpinv_admin_post_type( $id = 0 ) {
45
-    if ( ! $id ) {
44
+function wpinv_admin_post_type($id = 0) {
45
+    if (!$id) {
46 46
         $id = wpinv_admin_post_id();
47 47
     }
48 48
 
49
-    $type = get_post_type( $id );
49
+    $type = get_post_type($id);
50 50
 
51
-    if ( ! $type ) {
52
-        $type = isset( $_GET['post_type'] ) && ! empty( $_GET['post_type'] ) ? sanitize_text_field( $_GET['post_type'] ) : null;
51
+    if (!$type) {
52
+        $type = isset($_GET['post_type']) && !empty($_GET['post_type']) ? sanitize_text_field($_GET['post_type']) : null;
53 53
     }
54 54
 
55
-    return apply_filters( 'wpinv_admin_post_type', $type, $id );
55
+    return apply_filters('wpinv_admin_post_type', $type, $id);
56 56
 }
57 57
 
58 58
 function wpinv_admin_messages() {
59
-	settings_errors( 'wpinv-notices' );
59
+	settings_errors('wpinv-notices');
60 60
 }
61
-add_action( 'admin_notices', 'wpinv_admin_messages' );
61
+add_action('admin_notices', 'wpinv_admin_messages');
62 62
 
63
-add_action( 'admin_init', 'wpinv_show_test_payment_gateway_notice' );
63
+add_action('admin_init', 'wpinv_show_test_payment_gateway_notice');
64 64
 function wpinv_show_test_payment_gateway_notice() {
65
-    add_action( 'admin_notices', 'wpinv_test_payment_gateway_messages' );
65
+    add_action('admin_notices', 'wpinv_test_payment_gateway_messages');
66 66
 }
67 67
 
68 68
 function wpinv_test_payment_gateway_messages() {
69 69
     $gateways = wpinv_get_enabled_payment_gateways();
70 70
     $name = array(); $test_gateways = '';
71
-    if ( $gateways ) {
72
-        foreach ( $gateways as $id => $gateway ) {
73
-            if ( wpinv_is_test_mode( $id ) ) {
71
+    if ($gateways) {
72
+        foreach ($gateways as $id => $gateway) {
73
+            if (wpinv_is_test_mode($id)) {
74 74
                 $name[] = $gateway['checkout_label'];
75 75
             }
76 76
         }
77
-        $test_gateways = implode( ', ', $name );
77
+        $test_gateways = implode(', ', $name);
78 78
     }
79
-    if ( isset( $test_gateways ) && ! empty( $test_gateways ) && wpinv_current_user_can_manage_invoicing() ) {
80
-        $link = admin_url( 'admin.php?page=wpinv-settings&tab=gateways' );
81
-        $notice = wp_sprintf( __( '<strong>Important:</strong> Payment Gateway(s) %1$s are in testing mode and will not receive real payments. Go to <a href="%2$s"> Gateway Settings</a>.', 'invoicing' ), $test_gateways, $link );
79
+    if (isset($test_gateways) && !empty($test_gateways) && wpinv_current_user_can_manage_invoicing()) {
80
+        $link = admin_url('admin.php?page=wpinv-settings&tab=gateways');
81
+        $notice = wp_sprintf(__('<strong>Important:</strong> Payment Gateway(s) %1$s are in testing mode and will not receive real payments. Go to <a href="%2$s"> Gateway Settings</a>.', 'invoicing'), $test_gateways, $link);
82 82
         ?>
83 83
         <div class="notice notice-warning is-dismissible">
84
-            <p><?php echo wp_kses_post( $notice ); ?></p>
84
+            <p><?php echo wp_kses_post($notice); ?></p>
85 85
         </div>
86 86
         <?php
87 87
     }
@@ -95,37 +95,37 @@  discard block
 block discarded – undo
95 95
     global $wpdb;
96 96
 
97 97
     // Only do this on our settings page.
98
-    if ( empty( $_GET['page'] ) || 'wpinv-settings' !== $_GET['page'] ) {
98
+    if (empty($_GET['page']) || 'wpinv-settings' !== $_GET['page']) {
99 99
         return;
100 100
     }
101 101
 
102 102
     // Check tables.
103
-    $tables             = array(
103
+    $tables = array(
104 104
         "{$wpdb->prefix}wpinv_subscriptions",
105 105
         "{$wpdb->prefix}getpaid_invoices",
106 106
         "{$wpdb->prefix}getpaid_invoice_items",
107 107
     );
108 108
 
109
-    foreach ( $tables as $table ) {
110
-        if ( $table != $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) ) {
109
+    foreach ($tables as $table) {
110
+        if ($table != $wpdb->get_var("SHOW TABLES LIKE '$table'")) {
111 111
 
112
-            $url     = wp_nonce_url(
113
-                add_query_arg( 'getpaid-admin-action', 'create_missing_tables' ),
112
+            $url = wp_nonce_url(
113
+                add_query_arg('getpaid-admin-action', 'create_missing_tables'),
114 114
                 'getpaid-nonce',
115 115
                 'getpaid-nonce'
116 116
             );
117
-            $message  = __( 'Some GetPaid database tables are missing. To use GetPaid without any issues, click on the button below to create the missing tables.', 'invoicing' );
118
-            $message2 = __( 'Create Tables', 'invoicing' );
119
-            echo wp_kses_post( "<div class='notice notice-warning is-dismissible'><p>$message<br><br><a href='$url' class='button button-primary'>$message2</a></p></div>" );
117
+            $message  = __('Some GetPaid database tables are missing. To use GetPaid without any issues, click on the button below to create the missing tables.', 'invoicing');
118
+            $message2 = __('Create Tables', 'invoicing');
119
+            echo wp_kses_post("<div class='notice notice-warning is-dismissible'><p>$message<br><br><a href='$url' class='button button-primary'>$message2</a></p></div>");
120 120
             break;
121 121
 
122 122
         }
123 123
     }
124 124
 
125 125
 }
126
-add_action( 'admin_notices', 'wpinv_check_for_missing_tables' );
126
+add_action('admin_notices', 'wpinv_check_for_missing_tables');
127 127
 
128
-add_action( 'admin_init', 'wpinv_admin_search_by_invoice' );
128
+add_action('admin_init', 'wpinv_admin_search_by_invoice');
129 129
 
130 130
 /**
131 131
  * hook the posts search if we're on the admin page for our type
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 function wpinv_admin_search_by_invoice() {
134 134
     global $typenow;
135 135
 
136
-    if ( $typenow === 'wpi_invoice' || $typenow === 'wpi_quote' ) {
137
-        add_filter( 'posts_search', 'wpinv_posts_search_example_type', 10, 2 );
136
+    if ($typenow === 'wpi_invoice' || $typenow === 'wpi_quote') {
137
+        add_filter('posts_search', 'wpinv_posts_search_example_type', 10, 2);
138 138
     }
139 139
 }
140 140
 
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
  * @param WP_Query $query
145 145
  * @return string
146 146
  */
147
-function wpinv_posts_search_example_type( $search, $query ) {
147
+function wpinv_posts_search_example_type($search, $query) {
148 148
     global $wpdb;
149 149
 
150
-    if ( $query->is_main_query() && ! empty( $query->query['s'] ) ) {
151
-        $conditions_str = "{$wpdb->posts}.post_author IN ( SELECT ID FROM {$wpdb->users} WHERE user_email LIKE '%" . esc_sql( $query->query['s'] ) . "%' )";
152
-        if ( ! empty( $search ) ) {
153
-            $search = preg_replace( '/^ AND /', '', $search );
150
+    if ($query->is_main_query() && !empty($query->query['s'])) {
151
+        $conditions_str = "{$wpdb->posts}.post_author IN ( SELECT ID FROM {$wpdb->users} WHERE user_email LIKE '%" . esc_sql($query->query['s']) . "%' )";
152
+        if (!empty($search)) {
153
+            $search = preg_replace('/^ AND /', '', $search);
154 154
             $search = " AND ( {$search} OR ( {$conditions_str} ) )";
155 155
         } else {
156 156
             $search = " AND ( {$conditions_str} )";
@@ -164,16 +164,16 @@  discard block
 block discarded – undo
164 164
  * Resets invoice counts.
165 165
  */
166 166
 function wpinv_reset_invoice_count() {
167
-    if ( ! empty( $_GET['reset_invoice_count'] ) && isset( $_GET['_nonce'] ) && wp_verify_nonce( sanitize_text_field( $_GET['_nonce'] ), 'reset_invoice_count' ) ) {
168
-        wpinv_update_option( 'invoice_sequence_start', 1 );
169
-        delete_option( 'wpinv_last_invoice_number' );
170
-        getpaid_admin()->show_success( __( 'Invoice number sequence reset successfully.', 'invoicing' ) );
171
-        $url = remove_query_arg( array( 'reset_invoice_count', '_nonce' ) );
172
-        wp_redirect( $url );
167
+    if (!empty($_GET['reset_invoice_count']) && isset($_GET['_nonce']) && wp_verify_nonce(sanitize_text_field($_GET['_nonce']), 'reset_invoice_count')) {
168
+        wpinv_update_option('invoice_sequence_start', 1);
169
+        delete_option('wpinv_last_invoice_number');
170
+        getpaid_admin()->show_success(__('Invoice number sequence reset successfully.', 'invoicing'));
171
+        $url = remove_query_arg(array('reset_invoice_count', '_nonce'));
172
+        wp_redirect($url);
173 173
         exit();
174 174
     }
175 175
 }
176
-add_action( 'admin_init', 'wpinv_reset_invoice_count' );
176
+add_action('admin_init', 'wpinv_reset_invoice_count');
177 177
 
178 178
 /**
179 179
  * Displays line items on the invoice edit page.
@@ -182,29 +182,29 @@  discard block
 block discarded – undo
182 182
  * @param array $columns
183 183
  * @return string
184 184
  */
185
-function wpinv_admin_get_line_items( $invoice, $columns ) {
185
+function wpinv_admin_get_line_items($invoice, $columns) {
186 186
 
187 187
     ob_start();
188 188
 
189
-    do_action( 'getpaid_admin_before_line_items', $invoice );
189
+    do_action('getpaid_admin_before_line_items', $invoice);
190 190
 
191 191
     $count = 0;
192
-    foreach ( $invoice->get_items() as $item ) {
192
+    foreach ($invoice->get_items() as $item) {
193 193
 
194
-        $item_price     = wpinv_price( $item->get_price(), $invoice->get_currency() );
194
+        $item_price     = wpinv_price($item->get_price(), $invoice->get_currency());
195 195
         $quantity       = (int) $item->get_quantity();
196
-        $item_subtotal  = wpinv_price( $item->get_sub_total(), $invoice->get_currency() );
197
-        $summary        = apply_filters( 'getpaid_admin_invoice_line_item_summary', $item->get_description(), $item, $invoice );
196
+        $item_subtotal  = wpinv_price($item->get_sub_total(), $invoice->get_currency());
197
+        $summary        = apply_filters('getpaid_admin_invoice_line_item_summary', $item->get_description(), $item, $invoice);
198 198
         $item_tax       = $item->item_tax;
199
-        $tax_rate       = wpinv_round_amount( getpaid_get_invoice_tax_rate( $invoice, $item ), 2, true ) . '%';
200
-        $tax_rate       = empty( $tax_rate ) ? ' <span class="tax-rate">(' . $tax_rate . '%)</span>' : '';
199
+        $tax_rate       = wpinv_round_amount(getpaid_get_invoice_tax_rate($invoice, $item), 2, true) . '%';
200
+        $tax_rate       = empty($tax_rate) ? ' <span class="tax-rate">(' . $tax_rate . '%)</span>' : '';
201 201
         $line_item_tax  = $item_tax . $tax_rate;
202
-        $line_item      = '<tr class="item item-' . ( ($count % 2 == 0) ? 'even' : 'odd' ) . '" data-item-id="' . esc_attr( $item->get_id() ) . '">';
202
+        $line_item      = '<tr class="item item-' . (($count % 2 == 0) ? 'even' : 'odd') . '" data-item-id="' . esc_attr($item->get_id()) . '">';
203 203
         $line_item     .= '<td class="id">' . (int) $item->get_id() . '</td>';
204
-        $line_item     .= '<td class="title"><a href="' . get_edit_post_link( $item->get_id() ) . '" target="_blank">' . $item->get_name() . '</a>';
204
+        $line_item     .= '<td class="title"><a href="' . get_edit_post_link($item->get_id()) . '" target="_blank">' . $item->get_name() . '</a>';
205 205
 
206
-        if ( $summary !== '' ) {
207
-            $line_item .= '<span class="meta">' . wp_kses_post( wpautop( $summary ) ) . '</span>';
206
+        if ($summary !== '') {
207
+            $line_item .= '<span class="meta">' . wp_kses_post(wpautop($summary)) . '</span>';
208 208
         }
209 209
 
210 210
         $line_item .= '</td>';
@@ -212,23 +212,23 @@  discard block
 block discarded – undo
212 212
         $line_item .= '<td class="qty" data-quantity="' . $quantity . '">&nbsp;&times;&nbsp;' . $quantity . '</td>';
213 213
         $line_item .= '<td class="total">' . $item_subtotal . '</td>';
214 214
 
215
-        if ( wpinv_use_taxes() && $invoice->is_taxable() ) {
215
+        if (wpinv_use_taxes() && $invoice->is_taxable()) {
216 216
             $line_item .= '<td class="tax">' . $line_item_tax . '</td>';
217 217
         }
218 218
 
219 219
         $line_item .= '<td class="action">';
220
-        if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) {
220
+        if (!$invoice->is_paid() && !$invoice->is_refunded()) {
221 221
             $line_item .= '<i class="fa fa-remove wpinv-item-remove"></i>';
222 222
         }
223 223
         $line_item .= '</td>';
224 224
         $line_item .= '</tr>';
225 225
 
226
-        echo wp_kses_post( apply_filters( 'getpaid_admin_line_item', $line_item, $item, $invoice ) );
226
+        echo wp_kses_post(apply_filters('getpaid_admin_line_item', $line_item, $item, $invoice));
227 227
 
228 228
         $count++;
229 229
     }
230 230
 
231
-    do_action( 'getpaid_admin_after_line_items', $invoice );
231
+    do_action('getpaid_admin_after_line_items', $invoice);
232 232
 
233 233
     return ob_get_clean();
234 234
 }
Please login to merge, or discard this patch.
includes/admin/views/wizard-header.php 1 patch
Spacing   +15 added lines, -15 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
 $aui_settings = AyeCode_UI_Settings::instance();
10 10
 $aui_settings->enqueue_scripts();
@@ -17,15 +17,15 @@  discard block
 block discarded – undo
17 17
 		<head>
18 18
 			<meta name="viewport" content="width=device-width"/>
19 19
 			<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
20
-			<title><?php esc_html_e( 'GetPaid &rsaquo; Setup Wizard', 'invoicing' ); ?></title>
20
+			<title><?php esc_html_e('GetPaid &rsaquo; Setup Wizard', 'invoicing'); ?></title>
21 21
 			<?php
22 22
                 getpaid_admin()->enqeue_scripts();
23
-				wp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.13.0/css/all.css', array(), 'v5.13.0' );
24
-				wp_print_styles( 'select2' );
25
-                wp_print_scripts( 'select2' );
26
-				wp_print_scripts( 'wpinv-admin-script' );
27
-                do_action( 'admin_print_styles' );
28
-                do_action( 'admin_head' );
23
+				wp_enqueue_style('font-awesome', 'https://use.fontawesome.com/releases/v5.13.0/css/all.css', array(), 'v5.13.0');
24
+				wp_print_styles('select2');
25
+                wp_print_scripts('select2');
26
+				wp_print_scripts('wpinv-admin-script');
27
+                do_action('admin_print_styles');
28
+                do_action('admin_head');
29 29
 			?>
30 30
 			<style>
31 31
 				body, p{
@@ -37,23 +37,23 @@  discard block
 block discarded – undo
37 37
                     font-weight: 500;
38 38
                     margin-bottom: .1rem;
39 39
                 }
40
-				<?php echo esc_html( $aui_settings::css_primary( '#009874', true ) ); ?>
40
+				<?php echo esc_html($aui_settings::css_primary('#009874', true)); ?>
41 41
 			</style>
42 42
 		</head>
43 43
 
44 44
         <body class="gp-setup wp-core-ui bg-lightx mx-auto text-dark scrollbars-ios" style="background: #f3f6ff;">
45 45
 
46
-            <?php if ( isset( $_REQUEST['step'] ) ) : ?>
46
+            <?php if (isset($_REQUEST['step'])) : ?>
47 47
                 <ol class="gp-setup-steps mb-0 pb-4 mw-100 list-group list-group-horizontal text-center">
48
-                    <?php foreach ( $steps as $step => $data ) : ?>
48
+                    <?php foreach ($steps as $step => $data) : ?>
49 49
                         <li class="list-group-item flex-fill rounded-0 
50 50
                         <?php
51 51
                             echo $step == $current ? 'active' : 'd-none d-md-block';
52
-                            echo array_search( $current, array_keys( $steps ) ) > array_search( $step, array_keys( $steps ) ) ? ' done' : '';
52
+                            echo array_search($current, array_keys($steps)) > array_search($step, array_keys($steps)) ? ' done' : '';
53 53
                         ?>
54 54
                         ">
55
-                            <i class="far fa-check-circle <?php echo array_search( $current, array_keys( $steps ) ) > array_search( $step, array_keys( $steps ) ) ? 'text-success' : ''; ?>"></i>
56
-                            <?php echo esc_html( $data['name'] ); ?>
55
+                            <i class="far fa-check-circle <?php echo array_search($current, array_keys($steps)) > array_search($step, array_keys($steps)) ? 'text-success' : ''; ?>"></i>
56
+                            <?php echo esc_html($data['name']); ?>
57 57
                         </li>
58 58
                     <?php endforeach; ?>
59 59
                 </ol>
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             <div class="text-center pb-3 mt-5">
65 65
                 <a class=" text-decoration-none" href="https://wpgetpaid.com/">
66 66
                     <span class="text-black-50">
67
-                        <img class="ml-n3x" src="<?php echo esc_url( WPINV_PLUGIN_URL . 'assets/images/getpaid-logo.png' ); ?>" />
67
+                        <img class="ml-n3x" src="<?php echo esc_url(WPINV_PLUGIN_URL . 'assets/images/getpaid-logo.png'); ?>" />
68 68
                     </span>
69 69
                 </a>
70 70
             </div>
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.