@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | * @deprecated |
| 247 | 247 | */ |
| 248 | 248 | function wpinv_get_payment_key( $invoice = 0 ) { |
| 249 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 249 | + $invoice = new WPInv_Invoice( $invoice ); |
|
| 250 | 250 | return $invoice->get_key(); |
| 251 | 251 | } |
| 252 | 252 | |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | * @deprecated |
| 425 | 425 | */ |
| 426 | 426 | function wpinv_get_checkout_session() { |
| 427 | - return false; |
|
| 427 | + return false; |
|
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | /** |
@@ -1273,5 +1273,5 @@ discard block |
||
| 1273 | 1273 | * @deprecated |
| 1274 | 1274 | */ |
| 1275 | 1275 | function wpinv_get_subscription( $invoice ) { |
| 1276 | - return wpinv_get_invoice_subscription( $invoice ); |
|
| 1276 | + return wpinv_get_invoice_subscription( $invoice ); |
|
| 1277 | 1277 | } |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @package Invoicing |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -defined( 'ABSPATH' ) || exit; |
|
| 9 | +defined('ABSPATH') || exit; |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * @deprecated |
@@ -19,48 +19,48 @@ discard block |
||
| 19 | 19 | * @deprecated |
| 20 | 20 | */ |
| 21 | 21 | function wpinv_get_invoice_cart() { |
| 22 | - return wpinv_get_invoice( getpaid_get_current_invoice_id() ); |
|
| 22 | + return wpinv_get_invoice(getpaid_get_current_invoice_id()); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * @deprecated |
| 27 | 27 | */ |
| 28 | -function wpinv_get_invoice_description( $invoice ) { |
|
| 29 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 28 | +function wpinv_get_invoice_description($invoice) { |
|
| 29 | + $invoice = new WPInv_Invoice($invoice); |
|
| 30 | 30 | return $invoice->get_description(); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * @deprecated |
| 35 | 35 | */ |
| 36 | -function wpinv_get_invoice_currency_code( $invoice ) { |
|
| 37 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 36 | +function wpinv_get_invoice_currency_code($invoice) { |
|
| 37 | + $invoice = new WPInv_Invoice($invoice); |
|
| 38 | 38 | return $invoice->get_currency(); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * @deprecated |
| 43 | 43 | */ |
| 44 | -function wpinv_get_payment_user_email( $invoice ) { |
|
| 45 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 44 | +function wpinv_get_payment_user_email($invoice) { |
|
| 45 | + $invoice = new WPInv_Invoice($invoice); |
|
| 46 | 46 | return $invoice->get_email(); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * @deprecated |
| 51 | 51 | */ |
| 52 | -function wpinv_get_user_id( $invoice ) { |
|
| 53 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 52 | +function wpinv_get_user_id($invoice) { |
|
| 53 | + $invoice = new WPInv_Invoice($invoice); |
|
| 54 | 54 | return $invoice->get_user_id(); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * @deprecated |
| 59 | 59 | */ |
| 60 | -function wpinv_get_invoice_status( $invoice, $return_label = false ) { |
|
| 61 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 60 | +function wpinv_get_invoice_status($invoice, $return_label = false) { |
|
| 61 | + $invoice = new WPInv_Invoice($invoice); |
|
| 62 | 62 | |
| 63 | - if ( $return_label ) { |
|
| 63 | + if ($return_label) { |
|
| 64 | 64 | return $invoice->get_status_nicename(); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | /** |
| 71 | 71 | * @deprecated |
| 72 | 72 | */ |
| 73 | -function wpinv_get_payment_gateway( $invoice, $return_label = false ) { |
|
| 74 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 73 | +function wpinv_get_payment_gateway($invoice, $return_label = false) { |
|
| 74 | + $invoice = new WPInv_Invoice($invoice); |
|
| 75 | 75 | |
| 76 | - if ( $return_label ) { |
|
| 76 | + if ($return_label) { |
|
| 77 | 77 | return $invoice->get_gateway_title(); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -83,75 +83,75 @@ discard block |
||
| 83 | 83 | /** |
| 84 | 84 | * @deprecated |
| 85 | 85 | */ |
| 86 | -function wpinv_get_payment_gateway_name( $invoice ) { |
|
| 87 | - return wpinv_get_payment_gateway( $invoice, true ); |
|
| 86 | +function wpinv_get_payment_gateway_name($invoice) { |
|
| 87 | + return wpinv_get_payment_gateway($invoice, true); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * @deprecated |
| 92 | 92 | */ |
| 93 | -function wpinv_get_payment_transaction_id( $invoice ) { |
|
| 94 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 93 | +function wpinv_get_payment_transaction_id($invoice) { |
|
| 94 | + $invoice = new WPInv_Invoice($invoice); |
|
| 95 | 95 | return $invoice->get_transaction_id(); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * @deprecated |
| 100 | 100 | */ |
| 101 | -function wpinv_get_invoice_meta( $invoice_id = 0, $meta_key = '_wpinv_payment_meta', $single = true ) { |
|
| 102 | - $invoice = new WPInv_Invoice( $invoice_id ); |
|
| 103 | - return $invoice->get_meta( $meta_key, $single ); |
|
| 101 | +function wpinv_get_invoice_meta($invoice_id = 0, $meta_key = '_wpinv_payment_meta', $single = true) { |
|
| 102 | + $invoice = new WPInv_Invoice($invoice_id); |
|
| 103 | + return $invoice->get_meta($meta_key, $single); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * @deprecated |
| 108 | 108 | */ |
| 109 | -function wpinv_update_invoice_meta( $invoice_id = 0, $meta_key = '', $meta_value = '' ) { |
|
| 110 | - $invoice = new WPInv_Invoice( $invoice_id ); |
|
| 111 | - return $invoice->update_meta_data( $meta_key, $meta_value ); |
|
| 109 | +function wpinv_update_invoice_meta($invoice_id = 0, $meta_key = '', $meta_value = '') { |
|
| 110 | + $invoice = new WPInv_Invoice($invoice_id); |
|
| 111 | + return $invoice->update_meta_data($meta_key, $meta_value); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * @deprecated |
| 116 | 116 | */ |
| 117 | -function wpinv_get_items( $invoice = 0 ) { |
|
| 118 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 117 | +function wpinv_get_items($invoice = 0) { |
|
| 118 | + $invoice = new WPInv_Invoice($invoice); |
|
| 119 | 119 | return $invoice->get_items(); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * @deprecated |
| 124 | 124 | */ |
| 125 | -function wpinv_get_fees( $invoice = 0 ) { |
|
| 126 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 125 | +function wpinv_get_fees($invoice = 0) { |
|
| 126 | + $invoice = new WPInv_Invoice($invoice); |
|
| 127 | 127 | return $invoice->get_fees(); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * @deprecated |
| 132 | 132 | */ |
| 133 | -function wpinv_get_invoice_ip( $invoice ) { |
|
| 134 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 133 | +function wpinv_get_invoice_ip($invoice) { |
|
| 134 | + $invoice = new WPInv_Invoice($invoice); |
|
| 135 | 135 | return $invoice->get_ip(); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * @deprecated |
| 140 | 140 | */ |
| 141 | -function wpinv_get_invoice_user_info( $invoice ) { |
|
| 142 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 141 | +function wpinv_get_invoice_user_info($invoice) { |
|
| 142 | + $invoice = new WPInv_Invoice($invoice); |
|
| 143 | 143 | return $invoice->get_user_info(); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | 147 | * @deprecated |
| 148 | 148 | */ |
| 149 | -function wpinv_subtotal( $invoice = 0, $currency = false ) { |
|
| 150 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 149 | +function wpinv_subtotal($invoice = 0, $currency = false) { |
|
| 150 | + $invoice = new WPInv_Invoice($invoice); |
|
| 151 | 151 | $subtotal = $invoice->get_subtotal(); |
| 152 | 152 | |
| 153 | - if ( $currency ) { |
|
| 154 | - return wpinv_price( $subtotal, $invoice->get_currency() ); |
|
| 153 | + if ($currency) { |
|
| 154 | + return wpinv_price($subtotal, $invoice->get_currency()); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | return $subtotal; |
@@ -160,12 +160,12 @@ discard block |
||
| 160 | 160 | /** |
| 161 | 161 | * @deprecated |
| 162 | 162 | */ |
| 163 | -function wpinv_tax( $invoice = 0, $currency = false ) { |
|
| 164 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 163 | +function wpinv_tax($invoice = 0, $currency = false) { |
|
| 164 | + $invoice = new WPInv_Invoice($invoice); |
|
| 165 | 165 | $tax = $invoice->get_total_tax(); |
| 166 | 166 | |
| 167 | - if ( $currency ) { |
|
| 168 | - return wpinv_price( $tax, $invoice->get_currency() ); |
|
| 167 | + if ($currency) { |
|
| 168 | + return wpinv_price($tax, $invoice->get_currency()); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | return $tax; |
@@ -174,12 +174,12 @@ discard block |
||
| 174 | 174 | /** |
| 175 | 175 | * @deprecated |
| 176 | 176 | */ |
| 177 | -function wpinv_discount( $invoice = 0, $currency = false ) { |
|
| 178 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 177 | +function wpinv_discount($invoice = 0, $currency = false) { |
|
| 178 | + $invoice = new WPInv_Invoice($invoice); |
|
| 179 | 179 | $discount = $invoice->get_total_discount(); |
| 180 | 180 | |
| 181 | - if ( $currency ) { |
|
| 182 | - return wpinv_price( $discount, $invoice->get_currency() ); |
|
| 181 | + if ($currency) { |
|
| 182 | + return wpinv_price($discount, $invoice->get_currency()); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | return $discount; |
@@ -188,20 +188,20 @@ discard block |
||
| 188 | 188 | /** |
| 189 | 189 | * @deprecated |
| 190 | 190 | */ |
| 191 | -function wpinv_discount_code( $invoice = 0 ) { |
|
| 192 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 191 | +function wpinv_discount_code($invoice = 0) { |
|
| 192 | + $invoice = new WPInv_Invoice($invoice); |
|
| 193 | 193 | return $invoice->get_discount_code(); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
| 197 | 197 | * @deprecated |
| 198 | 198 | */ |
| 199 | -function wpinv_payment_total( $invoice = 0, $currency = false ) { |
|
| 200 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 199 | +function wpinv_payment_total($invoice = 0, $currency = false) { |
|
| 200 | + $invoice = new WPInv_Invoice($invoice); |
|
| 201 | 201 | $total = $invoice->get_total(); |
| 202 | 202 | |
| 203 | - if ( $currency ) { |
|
| 204 | - return wpinv_price( $total, $invoice->get_currency() ); |
|
| 203 | + if ($currency) { |
|
| 204 | + return wpinv_price($total, $invoice->get_currency()); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | return $total; |
@@ -210,51 +210,51 @@ discard block |
||
| 210 | 210 | /** |
| 211 | 211 | * @deprecated |
| 212 | 212 | */ |
| 213 | -function wpinv_get_date_created( $invoice = 0, $format = '' ) { |
|
| 214 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 213 | +function wpinv_get_date_created($invoice = 0, $format = '') { |
|
| 214 | + $invoice = new WPInv_Invoice($invoice); |
|
| 215 | 215 | |
| 216 | - $format = ! empty( $format ) ? $format : get_option( 'date_format' ); |
|
| 216 | + $format = !empty($format) ? $format : get_option('date_format'); |
|
| 217 | 217 | $date_created = $invoice->get_created_date(); |
| 218 | 218 | |
| 219 | - return empty( $date_created ) ? date_i18n( $format, strtotime( $date_created ) ) : ''; |
|
| 219 | + return empty($date_created) ? date_i18n($format, strtotime($date_created)) : ''; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | /** |
| 223 | 223 | * @deprecated |
| 224 | 224 | */ |
| 225 | -function wpinv_get_invoice_date( $invoice = 0, $format = '' ) { |
|
| 226 | - wpinv_get_date_created( $invoice, $format ); |
|
| 225 | +function wpinv_get_invoice_date($invoice = 0, $format = '') { |
|
| 226 | + wpinv_get_date_created($invoice, $format); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
| 230 | 230 | * @deprecated |
| 231 | 231 | */ |
| 232 | -function wpinv_get_invoice_vat_number( $invoice = 0 ) { |
|
| 233 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 232 | +function wpinv_get_invoice_vat_number($invoice = 0) { |
|
| 233 | + $invoice = new WPInv_Invoice($invoice); |
|
| 234 | 234 | return $invoice->get_vat_number(); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
| 238 | 238 | * @deprecated |
| 239 | 239 | */ |
| 240 | -function wpinv_insert_payment_note( $invoice = 0, $note = '', $user_type = false, $added_by_user = false, $system = false ) { |
|
| 241 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 242 | - return $invoice->add_note( $note, $user_type, $added_by_user, $system ); |
|
| 240 | +function wpinv_insert_payment_note($invoice = 0, $note = '', $user_type = false, $added_by_user = false, $system = false) { |
|
| 241 | + $invoice = new WPInv_Invoice($invoice); |
|
| 242 | + return $invoice->add_note($note, $user_type, $added_by_user, $system); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |
| 246 | 246 | * @deprecated |
| 247 | 247 | */ |
| 248 | -function wpinv_get_payment_key( $invoice = 0 ) { |
|
| 249 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 248 | +function wpinv_get_payment_key($invoice = 0) { |
|
| 249 | + $invoice = new WPInv_Invoice($invoice); |
|
| 250 | 250 | return $invoice->get_key(); |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | /** |
| 254 | 254 | * @deprecated |
| 255 | 255 | */ |
| 256 | -function wpinv_get_invoice_number( $invoice = 0 ) { |
|
| 257 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 256 | +function wpinv_get_invoice_number($invoice = 0) { |
|
| 257 | + $invoice = new WPInv_Invoice($invoice); |
|
| 258 | 258 | return $invoice->get_number(); |
| 259 | 259 | } |
| 260 | 260 | |
@@ -401,9 +401,9 @@ discard block |
||
| 401 | 401 | /** |
| 402 | 402 | * @deprecated |
| 403 | 403 | */ |
| 404 | -function wpinv_update_payment_status( $invoice, $new_status = 'publish' ) { |
|
| 405 | - $invoice = new WPInv_Invoice( $invoice ); |
|
| 406 | - return $invoice->update_status( $new_status ); |
|
| 404 | +function wpinv_update_payment_status($invoice, $new_status = 'publish') { |
|
| 405 | + $invoice = new WPInv_Invoice($invoice); |
|
| 406 | + return $invoice->update_status($new_status); |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /** |
@@ -456,22 +456,22 @@ discard block |
||
| 456 | 456 | /** |
| 457 | 457 | * @deprecated |
| 458 | 458 | */ |
| 459 | -function wpinv_set_payment_transaction_id( $invoice_id = 0, $transaction_id = '' ) { |
|
| 459 | +function wpinv_set_payment_transaction_id($invoice_id = 0, $transaction_id = '') { |
|
| 460 | 460 | |
| 461 | 461 | // Fetch the invoice. |
| 462 | - $invoice = new WPInv_Invoice( $invoice_id ); |
|
| 462 | + $invoice = new WPInv_Invoice($invoice_id); |
|
| 463 | 463 | |
| 464 | - if ( 0 == $invoice->get_id() ) { |
|
| 464 | + if (0 == $invoice->get_id()) { |
|
| 465 | 465 | return false; |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | // Prepare the transaction id. |
| 469 | - if ( empty( $transaction_id ) ) { |
|
| 469 | + if (empty($transaction_id)) { |
|
| 470 | 470 | $transaction_id = $invoice_id; |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | // Set the transaction id; |
| 474 | - $invoice->set_transaction_id( apply_filters( 'wpinv_set_payment_transaction_id', $transaction_id, $invoice ) ); |
|
| 474 | + $invoice->set_transaction_id(apply_filters('wpinv_set_payment_transaction_id', $transaction_id, $invoice)); |
|
| 475 | 475 | |
| 476 | 476 | // Save the invoice. |
| 477 | 477 | return $invoice->save(); |
@@ -484,12 +484,12 @@ discard block |
||
| 484 | 484 | * @param WPInv_Invoice $invoice |
| 485 | 485 | * @param string $gateway |
| 486 | 486 | */ |
| 487 | -function wpinv_send_to_gateway( $gateway, $invoice ) { |
|
| 487 | +function wpinv_send_to_gateway($gateway, $invoice) { |
|
| 488 | 488 | |
| 489 | 489 | $payment_data = array( |
| 490 | 490 | 'invoice_id' => $invoice->get_id(), |
| 491 | 491 | 'items' => $invoice->get_cart_details(), |
| 492 | - 'cart_discounts' => array( $invoice->get_discount_code() ), |
|
| 492 | + 'cart_discounts' => array($invoice->get_discount_code()), |
|
| 493 | 493 | 'fees' => $invoice->get_total_fees(), |
| 494 | 494 | 'subtotal' => $invoice->get_subtotal(), |
| 495 | 495 | 'discount' => $invoice->get_total_discount(), |
@@ -497,16 +497,16 @@ discard block |
||
| 497 | 497 | 'price' => $invoice->get_total(), |
| 498 | 498 | 'invoice_key' => $invoice->get_key(), |
| 499 | 499 | 'user_email' => $invoice->get_email(), |
| 500 | - 'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ), |
|
| 500 | + 'date' => date('Y-m-d H:i:s', current_time('timestamp')), |
|
| 501 | 501 | 'user_info' => $invoice->get_user_info(), |
| 502 | - 'post_data' => wp_kses_post( wp_unslash( $_POST ) ), |
|
| 502 | + 'post_data' => wp_kses_post(wp_unslash($_POST)), |
|
| 503 | 503 | 'cart_details' => $invoice->get_cart_details(), |
| 504 | 504 | 'gateway' => $gateway, |
| 505 | 505 | 'card_info' => array(), |
| 506 | - 'gateway_nonce' => wp_create_nonce( 'wpi-gateway' ), |
|
| 506 | + 'gateway_nonce' => wp_create_nonce('wpi-gateway'), |
|
| 507 | 507 | ); |
| 508 | 508 | |
| 509 | - do_action( 'wpinv_gateway_' . $gateway, $payment_data ); |
|
| 509 | + do_action('wpinv_gateway_' . $gateway, $payment_data); |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | /** |
@@ -519,10 +519,10 @@ discard block |
||
| 519 | 519 | /** |
| 520 | 520 | * @deprecated |
| 521 | 521 | */ |
| 522 | -function wpinv_die( $message = '', $title = '', $status = 400 ) { |
|
| 523 | - add_filter( 'wp_die_ajax_handler', 'wpinv_die_handler', 10, 3 ); |
|
| 524 | - add_filter( 'wp_die_handler', 'wpinv_die_handler', 10, 3 ); |
|
| 525 | - wp_die( esc_html( $message ), esc_html( $title ), array( 'response' => (int) $status ) ); |
|
| 522 | +function wpinv_die($message = '', $title = '', $status = 400) { |
|
| 523 | + add_filter('wp_die_ajax_handler', 'wpinv_die_handler', 10, 3); |
|
| 524 | + add_filter('wp_die_handler', 'wpinv_die_handler', 10, 3); |
|
| 525 | + wp_die(esc_html($message), esc_html($title), array('response' => (int) $status)); |
|
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | /** |
@@ -640,14 +640,14 @@ discard block |
||
| 640 | 640 | /** |
| 641 | 641 | * @deprecated |
| 642 | 642 | */ |
| 643 | -function wpinv_invoice_status_label( $status, $status_display = '' ) { |
|
| 644 | - return empty( $status_display ) ? sanitize_text_field( $status ) : sanitize_text_field( $status_display ); |
|
| 643 | +function wpinv_invoice_status_label($status, $status_display = '') { |
|
| 644 | + return empty($status_display) ? sanitize_text_field($status) : sanitize_text_field($status_display); |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | /** |
| 648 | 648 | * @deprecated |
| 649 | 649 | */ |
| 650 | -function wpinv_clean_invoice_number( $number ) { |
|
| 650 | +function wpinv_clean_invoice_number($number) { |
|
| 651 | 651 | return $number; |
| 652 | 652 | } |
| 653 | 653 | |
@@ -852,12 +852,12 @@ discard block |
||
| 852 | 852 | /** |
| 853 | 853 | * @deprecated |
| 854 | 854 | */ |
| 855 | -function wpinv_item_show_price( $item_id = 0, $echo = true ) { |
|
| 855 | +function wpinv_item_show_price($item_id = 0, $echo = true) { |
|
| 856 | 856 | |
| 857 | - if ( $echo ) { |
|
| 858 | - echo wp_kses_post( wpinv_item_price( $item_id ) ); |
|
| 857 | + if ($echo) { |
|
| 858 | + echo wp_kses_post(wpinv_item_price($item_id)); |
|
| 859 | 859 | } else { |
| 860 | - return wpinv_item_price( $item_id ); |
|
| 860 | + return wpinv_item_price($item_id); |
|
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | } |
@@ -1272,6 +1272,6 @@ discard block |
||
| 1272 | 1272 | * @return WPInv_Subscription|bool |
| 1273 | 1273 | * @deprecated |
| 1274 | 1274 | */ |
| 1275 | -function wpinv_get_subscription( $invoice ) { |
|
| 1276 | - return wpinv_get_invoice_subscription( $invoice ); |
|
| 1275 | +function wpinv_get_subscription($invoice) { |
|
| 1276 | + return wpinv_get_invoice_subscription($invoice); |
|
| 1277 | 1277 | } |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | - exit; // Exit if accessed directly |
|
| 9 | + exit; // Exit if accessed directly |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -15,10 +15,10 @@ discard block |
||
| 15 | 15 | class GetPaid_Meta_Box_Invoice_Subscription { |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * Output the subscription metabox. |
|
| 19 | - * |
|
| 20 | - * @param WP_Post $post |
|
| 21 | - */ |
|
| 18 | + * Output the subscription metabox. |
|
| 19 | + * |
|
| 20 | + * @param WP_Post $post |
|
| 21 | + */ |
|
| 22 | 22 | public static function output( $post ) { |
| 23 | 23 | |
| 24 | 24 | // Fetch the invoice. |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * Output the subscription invoices. |
|
| 38 | - * |
|
| 39 | - * @param WP_Post $post |
|
| 40 | - */ |
|
| 37 | + * Output the subscription invoices. |
|
| 38 | + * |
|
| 39 | + * @param WP_Post $post |
|
| 40 | + */ |
|
| 41 | 41 | public static function output_invoices( $post ) { |
| 42 | 42 | |
| 43 | 43 | // Fetch the invoice. |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | - * Outputs related subscriptions. |
|
| 57 | - * |
|
| 58 | - * @param WP_Post $post |
|
| 59 | - */ |
|
| 56 | + * Outputs related subscriptions. |
|
| 57 | + * |
|
| 58 | + * @param WP_Post $post |
|
| 59 | + */ |
|
| 60 | 60 | public static function output_related( $post ) { |
| 61 | 61 | |
| 62 | 62 | // Fetch the invoice. |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | * |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 8 | +if (!defined('ABSPATH')) { |
|
| 9 | 9 | exit; // Exit if accessed directly |
| 10 | 10 | } |
| 11 | 11 | |
@@ -19,16 +19,16 @@ discard block |
||
| 19 | 19 | * |
| 20 | 20 | * @param WP_Post $post |
| 21 | 21 | */ |
| 22 | - public static function output( $post ) { |
|
| 22 | + public static function output($post) { |
|
| 23 | 23 | |
| 24 | 24 | // Fetch the invoice. |
| 25 | - $invoice = new WPInv_Invoice( $post ); |
|
| 25 | + $invoice = new WPInv_Invoice($post); |
|
| 26 | 26 | |
| 27 | 27 | // Fetch the subscription. |
| 28 | - $subscription = getpaid_get_invoice_subscription( $invoice ); |
|
| 28 | + $subscription = getpaid_get_invoice_subscription($invoice); |
|
| 29 | 29 | |
| 30 | 30 | echo '<div class="bsui">'; |
| 31 | - getpaid_admin_subscription_details_metabox( /** @scrutinizer ignore-type */$subscription ); |
|
| 31 | + getpaid_admin_subscription_details_metabox(/** @scrutinizer ignore-type */$subscription); |
|
| 32 | 32 | echo '</div>'; |
| 33 | 33 | |
| 34 | 34 | } |
@@ -38,16 +38,16 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @param WP_Post $post |
| 40 | 40 | */ |
| 41 | - public static function output_invoices( $post ) { |
|
| 41 | + public static function output_invoices($post) { |
|
| 42 | 42 | |
| 43 | 43 | // Fetch the invoice. |
| 44 | - $invoice = new WPInv_Invoice( $post ); |
|
| 44 | + $invoice = new WPInv_Invoice($post); |
|
| 45 | 45 | |
| 46 | 46 | // Fetch the subscription. |
| 47 | - $subscription = getpaid_get_invoice_subscription( $invoice ); |
|
| 47 | + $subscription = getpaid_get_invoice_subscription($invoice); |
|
| 48 | 48 | |
| 49 | 49 | echo '<div class="bsui">'; |
| 50 | - getpaid_admin_subscription_invoice_details_metabox( /** @scrutinizer ignore-type */$subscription, false ); |
|
| 50 | + getpaid_admin_subscription_invoice_details_metabox(/** @scrutinizer ignore-type */$subscription, false); |
|
| 51 | 51 | echo '</div>'; |
| 52 | 52 | |
| 53 | 53 | } |
@@ -57,16 +57,16 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @param WP_Post $post |
| 59 | 59 | */ |
| 60 | - public static function output_related( $post ) { |
|
| 60 | + public static function output_related($post) { |
|
| 61 | 61 | |
| 62 | 62 | // Fetch the invoice. |
| 63 | - $invoice = new WPInv_Invoice( $post ); |
|
| 63 | + $invoice = new WPInv_Invoice($post); |
|
| 64 | 64 | |
| 65 | 65 | // Fetch the subscription. |
| 66 | - $subscription = getpaid_get_invoice_subscription( $invoice ); |
|
| 66 | + $subscription = getpaid_get_invoice_subscription($invoice); |
|
| 67 | 67 | |
| 68 | 68 | echo '<div class="bsui">'; |
| 69 | - getpaid_admin_subscription_related_subscriptions_metabox( /** @scrutinizer ignore-type */$subscription, false ); |
|
| 69 | + getpaid_admin_subscription_related_subscriptions_metabox(/** @scrutinizer ignore-type */$subscription, false); |
|
| 70 | 70 | echo '</div>'; |
| 71 | 71 | |
| 72 | 72 | } |
@@ -239,7 +239,7 @@ |
||
| 239 | 239 | do_action( 'getpaid_checkout_invoice_exception', $invoice ); |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - // Do we have any errors? |
|
| 242 | + // Do we have any errors? |
|
| 243 | 243 | if ( wpinv_get_errors() ) { |
| 244 | 244 | $response['data'] = getpaid_get_errors_html( true, false ); |
| 245 | 245 | } else { |
@@ -1,155 +1,155 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -function wpinv_is_subscription_payment( $invoice = '' ) { |
|
| 3 | - if ( empty( $invoice ) ) { |
|
| 2 | +function wpinv_is_subscription_payment($invoice = '') { |
|
| 3 | + if (empty($invoice)) { |
|
| 4 | 4 | return false; |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | - if ( ! is_object( $invoice ) && is_scalar( $invoice ) ) { |
|
| 8 | - $invoice = wpinv_get_invoice( $invoice ); |
|
| 7 | + if (!is_object($invoice) && is_scalar($invoice)) { |
|
| 8 | + $invoice = wpinv_get_invoice($invoice); |
|
| 9 | 9 | } |
| 10 | 10 | |
| 11 | - if ( empty( $invoice ) ) { |
|
| 11 | + if (empty($invoice)) { |
|
| 12 | 12 | return false; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - if ( $invoice->is_renewal() ) { |
|
| 15 | + if ($invoice->is_renewal()) { |
|
| 16 | 16 | return true; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | return false; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -function wpinv_payment_link_transaction_id( $invoice = '' ) { |
|
| 23 | - if ( empty( $invoice ) ) { |
|
| 22 | +function wpinv_payment_link_transaction_id($invoice = '') { |
|
| 23 | + if (empty($invoice)) { |
|
| 24 | 24 | return false; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - if ( ! is_object( $invoice ) && is_scalar( $invoice ) ) { |
|
| 28 | - $invoice = wpinv_get_invoice( $invoice ); |
|
| 27 | + if (!is_object($invoice) && is_scalar($invoice)) { |
|
| 28 | + $invoice = wpinv_get_invoice($invoice); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - if ( empty( $invoice ) ) { |
|
| 31 | + if (empty($invoice)) { |
|
| 32 | 32 | return false; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - return apply_filters( 'wpinv_payment_details_transaction_id-' . $invoice->gateway, $invoice->get_transaction_id(), $invoice->ID, $invoice ); |
|
| 35 | + return apply_filters('wpinv_payment_details_transaction_id-' . $invoice->gateway, $invoice->get_transaction_id(), $invoice->ID, $invoice); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -function wpinv_subscription_initial_payment_desc( $amount, $period, $interval, $trial_period = '', $trial_interval = 0 ) { |
|
| 39 | - $interval = (int)$interval > 0 ? (int)$interval : 1; |
|
| 38 | +function wpinv_subscription_initial_payment_desc($amount, $period, $interval, $trial_period = '', $trial_interval = 0) { |
|
| 39 | + $interval = (int) $interval > 0 ? (int) $interval : 1; |
|
| 40 | 40 | |
| 41 | - if ( $trial_interval > 0 && ! empty( $trial_period ) ) { |
|
| 42 | - $amount = __( 'Free', 'invoicing' ); |
|
| 41 | + if ($trial_interval > 0 && !empty($trial_period)) { |
|
| 42 | + $amount = __('Free', 'invoicing'); |
|
| 43 | 43 | $interval = $trial_interval; |
| 44 | 44 | $period = $trial_period; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $description = ''; |
| 48 | - switch ( $period ) { |
|
| 48 | + switch ($period) { |
|
| 49 | 49 | case 'D': |
| 50 | 50 | case 'day': |
| 51 | - $description = wp_sprintf( _n( '%s for the first day.', '%1$s for the first %2$d days.', $interval, 'invoicing' ), $amount, $interval ); |
|
| 51 | + $description = wp_sprintf(_n('%s for the first day.', '%1$s for the first %2$d days.', $interval, 'invoicing'), $amount, $interval); |
|
| 52 | 52 | break; |
| 53 | 53 | case 'W': |
| 54 | 54 | case 'week': |
| 55 | - $description = wp_sprintf( _n( '%s for the first week.', '%1$s for the first %2$d weeks.', $interval, 'invoicing' ), $amount, $interval ); |
|
| 55 | + $description = wp_sprintf(_n('%s for the first week.', '%1$s for the first %2$d weeks.', $interval, 'invoicing'), $amount, $interval); |
|
| 56 | 56 | break; |
| 57 | 57 | case 'M': |
| 58 | 58 | case 'month': |
| 59 | - $description = wp_sprintf( _n( '%s for the first month.', '%1$s for the first %2$d months.', $interval, 'invoicing' ), $amount, $interval ); |
|
| 59 | + $description = wp_sprintf(_n('%s for the first month.', '%1$s for the first %2$d months.', $interval, 'invoicing'), $amount, $interval); |
|
| 60 | 60 | break; |
| 61 | 61 | case 'Y': |
| 62 | 62 | case 'year': |
| 63 | - $description = wp_sprintf( _n( '%s for the first year.', '%1$s for the first %2$d years.', $interval, 'invoicing' ), $amount, $interval ); |
|
| 63 | + $description = wp_sprintf(_n('%s for the first year.', '%1$s for the first %2$d years.', $interval, 'invoicing'), $amount, $interval); |
|
| 64 | 64 | break; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - return apply_filters( 'wpinv_subscription_initial_payment_desc', $description, $amount, $period, $interval, $trial_period, $trial_interval ); |
|
| 67 | + return apply_filters('wpinv_subscription_initial_payment_desc', $description, $amount, $period, $interval, $trial_period, $trial_interval); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | -function wpinv_subscription_recurring_payment_desc( $amount, $period, $interval, $bill_times = 0, $trial_period = '', $trial_interval = 0 ) { |
|
| 71 | - $interval = (int)$interval > 0 ? (int)$interval : 1; |
|
| 72 | - $bill_times = (int)$bill_times > 0 ? (int)$bill_times : 0; |
|
| 70 | +function wpinv_subscription_recurring_payment_desc($amount, $period, $interval, $bill_times = 0, $trial_period = '', $trial_interval = 0) { |
|
| 71 | + $interval = (int) $interval > 0 ? (int) $interval : 1; |
|
| 72 | + $bill_times = (int) $bill_times > 0 ? (int) $bill_times : 0; |
|
| 73 | 73 | |
| 74 | 74 | $description = ''; |
| 75 | - switch ( $period ) { |
|
| 75 | + switch ($period) { |
|
| 76 | 76 | case 'D': |
| 77 | 77 | case 'day': |
| 78 | - if ( (int)$bill_times > 0 ) { |
|
| 79 | - if ( $interval > 1 ) { |
|
| 80 | - if ( $bill_times > 1 ) { |
|
| 81 | - $description = wp_sprintf( __( '%1$s for each %2$d days, for %3$d installments.', 'invoicing' ), $amount, $interval, $bill_times ); |
|
| 78 | + if ((int) $bill_times > 0) { |
|
| 79 | + if ($interval > 1) { |
|
| 80 | + if ($bill_times > 1) { |
|
| 81 | + $description = wp_sprintf(__('%1$s for each %2$d days, for %3$d installments.', 'invoicing'), $amount, $interval, $bill_times); |
|
| 82 | 82 | } else { |
| 83 | - $description = wp_sprintf( __( '%1$s for %2$d days.', 'invoicing' ), $amount, $interval ); |
|
| 83 | + $description = wp_sprintf(__('%1$s for %2$d days.', 'invoicing'), $amount, $interval); |
|
| 84 | 84 | } |
| 85 | 85 | } else { |
| 86 | - $description = wp_sprintf( _n( '%s for one day.', '%1$s for each day, for %2$d installments.', $bill_times, 'invoicing' ), $amount, $bill_times ); |
|
| 86 | + $description = wp_sprintf(_n('%s for one day.', '%1$s for each day, for %2$d installments.', $bill_times, 'invoicing'), $amount, $bill_times); |
|
| 87 | 87 | } |
| 88 | 88 | } else { |
| 89 | - $description = wp_sprintf( _n( '%s for each day.', '%1$s for each %2$d days.', $interval, 'invoicing' ), $amount, $interval ); |
|
| 89 | + $description = wp_sprintf(_n('%s for each day.', '%1$s for each %2$d days.', $interval, 'invoicing'), $amount, $interval); |
|
| 90 | 90 | } |
| 91 | 91 | break; |
| 92 | 92 | case 'W': |
| 93 | 93 | case 'week': |
| 94 | - if ( (int)$bill_times > 0 ) { |
|
| 95 | - if ( $interval > 1 ) { |
|
| 96 | - if ( $bill_times > 1 ) { |
|
| 97 | - $description = wp_sprintf( __( '%1$s for each %2$d weeks, for %3$d installments.', 'invoicing' ), $amount, $interval, $bill_times ); |
|
| 94 | + if ((int) $bill_times > 0) { |
|
| 95 | + if ($interval > 1) { |
|
| 96 | + if ($bill_times > 1) { |
|
| 97 | + $description = wp_sprintf(__('%1$s for each %2$d weeks, for %3$d installments.', 'invoicing'), $amount, $interval, $bill_times); |
|
| 98 | 98 | } else { |
| 99 | - $description = wp_sprintf( __( '%1$s for %2$d weeks.', 'invoicing' ), $amount, $interval ); |
|
| 99 | + $description = wp_sprintf(__('%1$s for %2$d weeks.', 'invoicing'), $amount, $interval); |
|
| 100 | 100 | } |
| 101 | 101 | } else { |
| 102 | - $description = wp_sprintf( _n( '%s for one week.', '%1$s for each week, for %2$d installments.', $bill_times, 'invoicing' ), $amount, $bill_times ); |
|
| 102 | + $description = wp_sprintf(_n('%s for one week.', '%1$s for each week, for %2$d installments.', $bill_times, 'invoicing'), $amount, $bill_times); |
|
| 103 | 103 | } |
| 104 | 104 | } else { |
| 105 | - $description = wp_sprintf( _n( '%s for each week.', '%1$s for each %2$d weeks.', $interval, 'invoicing' ), $amount, $interval ); |
|
| 105 | + $description = wp_sprintf(_n('%s for each week.', '%1$s for each %2$d weeks.', $interval, 'invoicing'), $amount, $interval); |
|
| 106 | 106 | } |
| 107 | 107 | break; |
| 108 | 108 | case 'M': |
| 109 | 109 | case 'month': |
| 110 | - if ( (int)$bill_times > 0 ) { |
|
| 111 | - if ( $interval > 1 ) { |
|
| 112 | - if ( $bill_times > 1 ) { |
|
| 113 | - $description = wp_sprintf( __( '%1$s for each %2$d months, for %3$d installments.', 'invoicing' ), $amount, $interval, $bill_times ); |
|
| 110 | + if ((int) $bill_times > 0) { |
|
| 111 | + if ($interval > 1) { |
|
| 112 | + if ($bill_times > 1) { |
|
| 113 | + $description = wp_sprintf(__('%1$s for each %2$d months, for %3$d installments.', 'invoicing'), $amount, $interval, $bill_times); |
|
| 114 | 114 | } else { |
| 115 | - $description = wp_sprintf( __( '%1$s for %2$d months.', 'invoicing' ), $amount, $interval ); |
|
| 115 | + $description = wp_sprintf(__('%1$s for %2$d months.', 'invoicing'), $amount, $interval); |
|
| 116 | 116 | } |
| 117 | 117 | } else { |
| 118 | - $description = wp_sprintf( _n( '%s for one month.', '%1$s for each month, for %2$d installments.', $bill_times, 'invoicing' ), $amount, $bill_times ); |
|
| 118 | + $description = wp_sprintf(_n('%s for one month.', '%1$s for each month, for %2$d installments.', $bill_times, 'invoicing'), $amount, $bill_times); |
|
| 119 | 119 | } |
| 120 | 120 | } else { |
| 121 | - $description = wp_sprintf( _n( '%s for each month.', '%1$s for each %2$d months.', $interval, 'invoicing' ), $amount, $interval ); |
|
| 121 | + $description = wp_sprintf(_n('%s for each month.', '%1$s for each %2$d months.', $interval, 'invoicing'), $amount, $interval); |
|
| 122 | 122 | } |
| 123 | 123 | break; |
| 124 | 124 | case 'Y': |
| 125 | 125 | case 'year': |
| 126 | - if ( (int)$bill_times > 0 ) { |
|
| 127 | - if ( $interval > 1 ) { |
|
| 128 | - if ( $bill_times > 1 ) { |
|
| 129 | - $description = wp_sprintf( __( '%1$s for each %2$d years, for %3$d installments.', 'invoicing' ), $amount, $interval, $bill_times ); |
|
| 126 | + if ((int) $bill_times > 0) { |
|
| 127 | + if ($interval > 1) { |
|
| 128 | + if ($bill_times > 1) { |
|
| 129 | + $description = wp_sprintf(__('%1$s for each %2$d years, for %3$d installments.', 'invoicing'), $amount, $interval, $bill_times); |
|
| 130 | 130 | } else { |
| 131 | - $description = wp_sprintf( __( '%1$s for %2$d years.', 'invoicing' ), $amount, $interval ); |
|
| 131 | + $description = wp_sprintf(__('%1$s for %2$d years.', 'invoicing'), $amount, $interval); |
|
| 132 | 132 | } |
| 133 | 133 | } else { |
| 134 | - $description = wp_sprintf( _n( '%s for one year.', '%1$s for each year, for %2$d installments.', $bill_times, 'invoicing' ), $amount, $bill_times ); |
|
| 134 | + $description = wp_sprintf(_n('%s for one year.', '%1$s for each year, for %2$d installments.', $bill_times, 'invoicing'), $amount, $bill_times); |
|
| 135 | 135 | } |
| 136 | 136 | } else { |
| 137 | - $description = wp_sprintf( _n( '%s for each year.', '%1$s for each %2$d years.', $interval, 'invoicing' ), $amount, $interval ); |
|
| 137 | + $description = wp_sprintf(_n('%s for each year.', '%1$s for each %2$d years.', $interval, 'invoicing'), $amount, $interval); |
|
| 138 | 138 | } |
| 139 | 139 | break; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - return apply_filters( 'wpinv_subscription_recurring_payment_desc', $description, $amount, $period, $interval, $bill_times, $trial_period, $trial_interval ); |
|
| 142 | + return apply_filters('wpinv_subscription_recurring_payment_desc', $description, $amount, $period, $interval, $bill_times, $trial_period, $trial_interval); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | -function wpinv_subscription_payment_desc( $invoice ) { |
|
| 146 | - if ( empty( $invoice ) ) { |
|
| 145 | +function wpinv_subscription_payment_desc($invoice) { |
|
| 146 | + if (empty($invoice)) { |
|
| 147 | 147 | return null; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $description = ''; |
| 151 | - if ( $invoice->is_parent() && $item = $invoice->get_recurring( true ) ) { |
|
| 152 | - if ( $item->has_free_trial() ) { |
|
| 151 | + if ($invoice->is_parent() && $item = $invoice->get_recurring(true)) { |
|
| 152 | + if ($item->has_free_trial()) { |
|
| 153 | 153 | $trial_period = $item->get_trial_period(); |
| 154 | 154 | $trial_interval = $item->get_trial_interval(); |
| 155 | 155 | } else { |
@@ -157,40 +157,40 @@ discard block |
||
| 157 | 157 | $trial_interval = 0; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - $description = wpinv_get_billing_cycle( $invoice->get_total(), $invoice->get_recurring_details( 'total' ), $item->get_recurring_period(), $item->get_recurring_interval(), $item->get_recurring_limit(), $trial_period, $trial_interval, $invoice->get_currency() ); |
|
| 160 | + $description = wpinv_get_billing_cycle($invoice->get_total(), $invoice->get_recurring_details('total'), $item->get_recurring_period(), $item->get_recurring_interval(), $item->get_recurring_limit(), $trial_period, $trial_interval, $invoice->get_currency()); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - return apply_filters( 'wpinv_subscription_payment_desc', $description, $invoice ); |
|
| 163 | + return apply_filters('wpinv_subscription_payment_desc', $description, $invoice); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | -function wpinv_get_billing_cycle( $initial, $recurring, $period, $interval, $bill_times, $trial_period = '', $trial_interval = 0, $currency = '' ) { |
|
| 167 | - $initial_total = wpinv_round_amount( $initial ); |
|
| 168 | - $recurring_total = wpinv_round_amount( $recurring ); |
|
| 166 | +function wpinv_get_billing_cycle($initial, $recurring, $period, $interval, $bill_times, $trial_period = '', $trial_interval = 0, $currency = '') { |
|
| 167 | + $initial_total = wpinv_round_amount($initial); |
|
| 168 | + $recurring_total = wpinv_round_amount($recurring); |
|
| 169 | 169 | |
| 170 | - if ( $trial_interval > 0 && ! empty( $trial_period ) ) { |
|
| 170 | + if ($trial_interval > 0 && !empty($trial_period)) { |
|
| 171 | 171 | // Free trial |
| 172 | 172 | } else { |
| 173 | - if ( $bill_times == 1 ) { |
|
| 173 | + if ($bill_times == 1) { |
|
| 174 | 174 | $recurring_total = $initial_total; |
| 175 | - } elseif ( $bill_times > 1 && $initial_total != $recurring_total ) { |
|
| 175 | + } elseif ($bill_times > 1 && $initial_total != $recurring_total) { |
|
| 176 | 176 | $bill_times--; |
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $initial_amount = wpinv_price( $initial_total, $currency ); |
|
| 181 | - $recurring_amount = wpinv_price( $recurring_total, $currency ); |
|
| 180 | + $initial_amount = wpinv_price($initial_total, $currency); |
|
| 181 | + $recurring_amount = wpinv_price($recurring_total, $currency); |
|
| 182 | 182 | |
| 183 | - $recurring = wpinv_subscription_recurring_payment_desc( $recurring_amount, $period, $interval, $bill_times, $trial_period, $trial_interval ); |
|
| 183 | + $recurring = wpinv_subscription_recurring_payment_desc($recurring_amount, $period, $interval, $bill_times, $trial_period, $trial_interval); |
|
| 184 | 184 | |
| 185 | - if ( $initial_total != $recurring_total ) { |
|
| 186 | - $initial = wpinv_subscription_initial_payment_desc( $initial_amount, $period, $interval, $trial_period, $trial_interval ); |
|
| 185 | + if ($initial_total != $recurring_total) { |
|
| 186 | + $initial = wpinv_subscription_initial_payment_desc($initial_amount, $period, $interval, $trial_period, $trial_interval); |
|
| 187 | 187 | |
| 188 | - $description = wp_sprintf( __( '%1$s Then %2$s', 'invoicing' ), $initial, $recurring ); |
|
| 188 | + $description = wp_sprintf(__('%1$s Then %2$s', 'invoicing'), $initial, $recurring); |
|
| 189 | 189 | } else { |
| 190 | 190 | $description = $recurring; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - return apply_filters( 'wpinv_get_billing_cycle', $description, $initial, $recurring, $period, $interval, $bill_times, $trial_period, $trial_interval, $currency ); |
|
| 193 | + return apply_filters('wpinv_get_billing_cycle', $description, $initial, $recurring, $period, $interval, $bill_times, $trial_period, $trial_interval, $currency); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -200,27 +200,27 @@ discard block |
||
| 200 | 200 | * @param string $card_number Card number. |
| 201 | 201 | * @return string |
| 202 | 202 | */ |
| 203 | -function getpaid_get_card_name( $card_number ) { |
|
| 203 | +function getpaid_get_card_name($card_number) { |
|
| 204 | 204 | |
| 205 | 205 | // Known regexes. |
| 206 | 206 | $regexes = array( |
| 207 | - '/^4/' => __( 'Visa', 'invoicing' ), |
|
| 208 | - '/^5[1-5]/' => __( 'Mastercard', 'invoicing' ), |
|
| 209 | - '/^3[47]/' => __( 'Amex', 'invoicing' ), |
|
| 210 | - '/^3(?:0[0-5]|[68])/' => __( 'Diners Club', 'invoicing' ), |
|
| 211 | - '/^6(?:011|5)/' => __( 'Discover', 'invoicing' ), |
|
| 212 | - '/^(?:2131|1800|35\d{3})/' => __( 'JCB', 'invoicing' ), |
|
| 207 | + '/^4/' => __('Visa', 'invoicing'), |
|
| 208 | + '/^5[1-5]/' => __('Mastercard', 'invoicing'), |
|
| 209 | + '/^3[47]/' => __('Amex', 'invoicing'), |
|
| 210 | + '/^3(?:0[0-5]|[68])/' => __('Diners Club', 'invoicing'), |
|
| 211 | + '/^6(?:011|5)/' => __('Discover', 'invoicing'), |
|
| 212 | + '/^(?:2131|1800|35\d{3})/' => __('JCB', 'invoicing'), |
|
| 213 | 213 | ); |
| 214 | 214 | |
| 215 | 215 | // Confirm if one matches. |
| 216 | - foreach ( $regexes as $regex => $card ) { |
|
| 217 | - if ( preg_match( $regex, $card_number ) >= 1 ) { |
|
| 216 | + foreach ($regexes as $regex => $card) { |
|
| 217 | + if (preg_match($regex, $card_number) >= 1) { |
|
| 218 | 218 | return $card; |
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | // None matched. |
| 223 | - return __( 'Card', 'invoicing' ); |
|
| 223 | + return __('Card', 'invoicing'); |
|
| 224 | 224 | |
| 225 | 225 | } |
| 226 | 226 | |
@@ -229,23 +229,23 @@ discard block |
||
| 229 | 229 | * |
| 230 | 230 | * @param WPInv_Invoice|int|null $invoice |
| 231 | 231 | */ |
| 232 | -function wpinv_send_back_to_checkout( $invoice = null ) { |
|
| 233 | - $response = array( 'success' => false ); |
|
| 234 | - $invoice = wpinv_get_invoice( $invoice ); |
|
| 232 | +function wpinv_send_back_to_checkout($invoice = null) { |
|
| 233 | + $response = array('success' => false); |
|
| 234 | + $invoice = wpinv_get_invoice($invoice); |
|
| 235 | 235 | |
| 236 | 236 | // Was an invoice created? |
| 237 | - if ( ! empty( $invoice ) ) { |
|
| 238 | - $invoice = is_scalar( $invoice ) ? new WPInv_Invoice( $invoice ) : $invoice; |
|
| 237 | + if (!empty($invoice)) { |
|
| 238 | + $invoice = is_scalar($invoice) ? new WPInv_Invoice($invoice) : $invoice; |
|
| 239 | 239 | $response['invoice'] = $invoice->get_id(); |
| 240 | - do_action( 'getpaid_checkout_invoice_exception', $invoice ); |
|
| 240 | + do_action('getpaid_checkout_invoice_exception', $invoice); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | // Do we have any errors? |
| 244 | - if ( wpinv_get_errors() ) { |
|
| 245 | - $response['data'] = getpaid_get_errors_html( true, false ); |
|
| 244 | + if (wpinv_get_errors()) { |
|
| 245 | + $response['data'] = getpaid_get_errors_html(true, false); |
|
| 246 | 246 | } else { |
| 247 | - $response['data'] = __( 'An error occured while processing your payment. Please try again.', 'invoicing' ); |
|
| 247 | + $response['data'] = __('An error occured while processing your payment. Please try again.', 'invoicing'); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - wp_send_json( $response ); |
|
| 250 | + wp_send_json($response); |
|
| 251 | 251 | } |
@@ -16,165 +16,165 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class GetPaid_MaxMind_Geolocation { |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * The service responsible for interacting with the MaxMind database. |
|
| 21 | - * |
|
| 22 | - * @var GetPaid_MaxMind_Database_Service |
|
| 23 | - */ |
|
| 24 | - private $database_service; |
|
| 25 | - |
|
| 26 | - /** |
|
| 27 | - * Initialize the integration. |
|
| 28 | - */ |
|
| 29 | - public function __construct() { |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * Supports overriding the database service to be used. |
|
| 33 | - * |
|
| 34 | - * @since 1.0.19 |
|
| 35 | - * @return mixed|null The geolocation database service. |
|
| 36 | - */ |
|
| 37 | - $this->database_service = apply_filters( 'getpaid_maxmind_geolocation_database_service', null ); |
|
| 38 | - if ( null === $this->database_service ) { |
|
| 39 | - $this->database_service = new GetPaid_MaxMind_Database_Service( $this->get_database_prefix() ); |
|
| 40 | - } |
|
| 41 | - |
|
| 42 | - // Bind to the scheduled updater action. |
|
| 43 | - add_action( 'getpaid_update_geoip_databases', array( $this, 'update_database' ) ); |
|
| 44 | - |
|
| 45 | - // Bind to the geolocation filter for MaxMind database lookups. |
|
| 46 | - add_filter( 'getpaid_get_geolocation', array( $this, 'get_geolocation' ), 10, 2 ); |
|
| 47 | - |
|
| 48 | - // Handle maxmind key updates. |
|
| 49 | - add_filter( 'wpinv_settings_sanitize_maxmind_license_key', array( $this, 'handle_key_updates' ) ); |
|
| 50 | - |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * Get database service. |
|
| 55 | - * |
|
| 56 | - * @return GetPaid_MaxMind_Database_Service|null |
|
| 57 | - */ |
|
| 58 | - public function get_database_service() { |
|
| 59 | - return $this->database_service; |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - /** |
|
| 63 | - * Checks to make sure that the license key is valid. |
|
| 64 | - * |
|
| 65 | - * @param string $license_key The new license key. |
|
| 66 | - * @return string |
|
| 67 | - */ |
|
| 68 | - public function handle_key_updates( $license_key ) { |
|
| 69 | - |
|
| 70 | - // Trim whitespaces and strip slashes. |
|
| 71 | - $license_key = trim( $license_key ); |
|
| 72 | - |
|
| 73 | - // Abort if the license key is empty or unchanged. |
|
| 74 | - if ( empty( $license_key ) ) { |
|
| 75 | - return $license_key; |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - // Abort if a database exists and the license key is unchaged. |
|
| 79 | - if ( file_exists( $this->database_service->get_database_path() && $license_key == wpinv_get_option( 'maxmind_license_key' ) ) ) { |
|
| 80 | - return $license_key; |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - // Check the license key by attempting to download the Geolocation database. |
|
| 84 | - $tmp_database_path = $this->database_service->download_database( $license_key ); |
|
| 85 | - if ( is_wp_error( $tmp_database_path ) ) { |
|
| 86 | - getpaid_admin()->show_error( $tmp_database_path->get_error_message() ); |
|
| 87 | - return $license_key; |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - $this->update_database( /** @scrutinizer ignore-type */ $tmp_database_path ); |
|
| 91 | - |
|
| 92 | - return $license_key; |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - /** |
|
| 96 | - * Updates the database used for geolocation queries. |
|
| 97 | - * |
|
| 98 | - * @param string $tmp_database_path Temporary database path. |
|
| 99 | - */ |
|
| 100 | - public function update_database( $tmp_database_path = null ) { |
|
| 101 | - |
|
| 102 | - // Allow us to easily interact with the filesystem. |
|
| 103 | - require_once ABSPATH . 'wp-admin/includes/file.php'; |
|
| 104 | - WP_Filesystem(); |
|
| 105 | - global $wp_filesystem; |
|
| 106 | - |
|
| 107 | - // Remove any existing archives to comply with the MaxMind TOS. |
|
| 108 | - $target_database_path = $this->database_service->get_database_path(); |
|
| 109 | - |
|
| 110 | - // If there's no database path, we can't store the database. |
|
| 111 | - if ( empty( $target_database_path ) ) { |
|
| 112 | - return; |
|
| 113 | - } |
|
| 114 | - |
|
| 115 | - if ( $wp_filesystem->exists( $target_database_path ) ) { |
|
| 116 | - $wp_filesystem->delete( $target_database_path ); |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - // We can't download a database if there's no license key configured. |
|
| 120 | - $license_key = wpinv_get_option( 'maxmind_license_key' ); |
|
| 121 | - if ( empty( $license_key ) ) { |
|
| 122 | - return; |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - if ( empty( $tmp_database_path ) ) { |
|
| 126 | - $tmp_database_path = $this->database_service->download_database( $license_key ); |
|
| 127 | - } |
|
| 128 | - |
|
| 129 | - if ( is_wp_error( $tmp_database_path ) ) { |
|
| 130 | - wpinv_error_log( $tmp_database_path->get_error_message() ); |
|
| 131 | - return; |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - // Move the new database into position. |
|
| 135 | - $wp_filesystem->move( $tmp_database_path, $target_database_path, true ); |
|
| 136 | - $wp_filesystem->delete( dirname( $tmp_database_path ) ); |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - /** |
|
| 140 | - * Performs a geolocation lookup against the MaxMind database for the given IP address. |
|
| 141 | - * |
|
| 142 | - * @param array $data Geolocation data. |
|
| 143 | - * @param string $ip_address The IP address to geolocate. |
|
| 144 | - * @return array Geolocation including country code, state, city and postcode based on an IP address. |
|
| 145 | - */ |
|
| 146 | - public function get_geolocation( $data, $ip_address ) { |
|
| 147 | - |
|
| 148 | - if ( ! empty( $data['country'] ) || empty( $ip_address ) ) { |
|
| 149 | - return $data; |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - $country_code = $this->database_service->get_iso_country_code_for_ip( $ip_address ); |
|
| 153 | - |
|
| 154 | - return array( |
|
| 155 | - 'country' => $country_code, |
|
| 156 | - 'state' => '', |
|
| 157 | - 'city' => '', |
|
| 158 | - 'postcode' => '', |
|
| 159 | - ); |
|
| 160 | - |
|
| 161 | - } |
|
| 162 | - |
|
| 163 | - /** |
|
| 164 | - * Fetches the prefix for the MaxMind database file. |
|
| 165 | - * |
|
| 166 | - * @return string |
|
| 167 | - */ |
|
| 168 | - private function get_database_prefix() { |
|
| 169 | - |
|
| 170 | - $prefix = get_option( 'wpinv_maxmind_database_prefix' ); |
|
| 171 | - |
|
| 172 | - if ( empty( $prefix ) ) { |
|
| 173 | - $prefix = md5( uniqid( 'wpinv' ) ); |
|
| 174 | - update_option( 'wpinv_maxmind_database_prefix', $prefix ); |
|
| 175 | - } |
|
| 176 | - |
|
| 177 | - return $prefix; |
|
| 178 | - } |
|
| 19 | + /** |
|
| 20 | + * The service responsible for interacting with the MaxMind database. |
|
| 21 | + * |
|
| 22 | + * @var GetPaid_MaxMind_Database_Service |
|
| 23 | + */ |
|
| 24 | + private $database_service; |
|
| 25 | + |
|
| 26 | + /** |
|
| 27 | + * Initialize the integration. |
|
| 28 | + */ |
|
| 29 | + public function __construct() { |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * Supports overriding the database service to be used. |
|
| 33 | + * |
|
| 34 | + * @since 1.0.19 |
|
| 35 | + * @return mixed|null The geolocation database service. |
|
| 36 | + */ |
|
| 37 | + $this->database_service = apply_filters( 'getpaid_maxmind_geolocation_database_service', null ); |
|
| 38 | + if ( null === $this->database_service ) { |
|
| 39 | + $this->database_service = new GetPaid_MaxMind_Database_Service( $this->get_database_prefix() ); |
|
| 40 | + } |
|
| 41 | + |
|
| 42 | + // Bind to the scheduled updater action. |
|
| 43 | + add_action( 'getpaid_update_geoip_databases', array( $this, 'update_database' ) ); |
|
| 44 | + |
|
| 45 | + // Bind to the geolocation filter for MaxMind database lookups. |
|
| 46 | + add_filter( 'getpaid_get_geolocation', array( $this, 'get_geolocation' ), 10, 2 ); |
|
| 47 | + |
|
| 48 | + // Handle maxmind key updates. |
|
| 49 | + add_filter( 'wpinv_settings_sanitize_maxmind_license_key', array( $this, 'handle_key_updates' ) ); |
|
| 50 | + |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * Get database service. |
|
| 55 | + * |
|
| 56 | + * @return GetPaid_MaxMind_Database_Service|null |
|
| 57 | + */ |
|
| 58 | + public function get_database_service() { |
|
| 59 | + return $this->database_service; |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * Checks to make sure that the license key is valid. |
|
| 64 | + * |
|
| 65 | + * @param string $license_key The new license key. |
|
| 66 | + * @return string |
|
| 67 | + */ |
|
| 68 | + public function handle_key_updates( $license_key ) { |
|
| 69 | + |
|
| 70 | + // Trim whitespaces and strip slashes. |
|
| 71 | + $license_key = trim( $license_key ); |
|
| 72 | + |
|
| 73 | + // Abort if the license key is empty or unchanged. |
|
| 74 | + if ( empty( $license_key ) ) { |
|
| 75 | + return $license_key; |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + // Abort if a database exists and the license key is unchaged. |
|
| 79 | + if ( file_exists( $this->database_service->get_database_path() && $license_key == wpinv_get_option( 'maxmind_license_key' ) ) ) { |
|
| 80 | + return $license_key; |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + // Check the license key by attempting to download the Geolocation database. |
|
| 84 | + $tmp_database_path = $this->database_service->download_database( $license_key ); |
|
| 85 | + if ( is_wp_error( $tmp_database_path ) ) { |
|
| 86 | + getpaid_admin()->show_error( $tmp_database_path->get_error_message() ); |
|
| 87 | + return $license_key; |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + $this->update_database( /** @scrutinizer ignore-type */ $tmp_database_path ); |
|
| 91 | + |
|
| 92 | + return $license_key; |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * Updates the database used for geolocation queries. |
|
| 97 | + * |
|
| 98 | + * @param string $tmp_database_path Temporary database path. |
|
| 99 | + */ |
|
| 100 | + public function update_database( $tmp_database_path = null ) { |
|
| 101 | + |
|
| 102 | + // Allow us to easily interact with the filesystem. |
|
| 103 | + require_once ABSPATH . 'wp-admin/includes/file.php'; |
|
| 104 | + WP_Filesystem(); |
|
| 105 | + global $wp_filesystem; |
|
| 106 | + |
|
| 107 | + // Remove any existing archives to comply with the MaxMind TOS. |
|
| 108 | + $target_database_path = $this->database_service->get_database_path(); |
|
| 109 | + |
|
| 110 | + // If there's no database path, we can't store the database. |
|
| 111 | + if ( empty( $target_database_path ) ) { |
|
| 112 | + return; |
|
| 113 | + } |
|
| 114 | + |
|
| 115 | + if ( $wp_filesystem->exists( $target_database_path ) ) { |
|
| 116 | + $wp_filesystem->delete( $target_database_path ); |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + // We can't download a database if there's no license key configured. |
|
| 120 | + $license_key = wpinv_get_option( 'maxmind_license_key' ); |
|
| 121 | + if ( empty( $license_key ) ) { |
|
| 122 | + return; |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + if ( empty( $tmp_database_path ) ) { |
|
| 126 | + $tmp_database_path = $this->database_service->download_database( $license_key ); |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + if ( is_wp_error( $tmp_database_path ) ) { |
|
| 130 | + wpinv_error_log( $tmp_database_path->get_error_message() ); |
|
| 131 | + return; |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + // Move the new database into position. |
|
| 135 | + $wp_filesystem->move( $tmp_database_path, $target_database_path, true ); |
|
| 136 | + $wp_filesystem->delete( dirname( $tmp_database_path ) ); |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + /** |
|
| 140 | + * Performs a geolocation lookup against the MaxMind database for the given IP address. |
|
| 141 | + * |
|
| 142 | + * @param array $data Geolocation data. |
|
| 143 | + * @param string $ip_address The IP address to geolocate. |
|
| 144 | + * @return array Geolocation including country code, state, city and postcode based on an IP address. |
|
| 145 | + */ |
|
| 146 | + public function get_geolocation( $data, $ip_address ) { |
|
| 147 | + |
|
| 148 | + if ( ! empty( $data['country'] ) || empty( $ip_address ) ) { |
|
| 149 | + return $data; |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + $country_code = $this->database_service->get_iso_country_code_for_ip( $ip_address ); |
|
| 153 | + |
|
| 154 | + return array( |
|
| 155 | + 'country' => $country_code, |
|
| 156 | + 'state' => '', |
|
| 157 | + 'city' => '', |
|
| 158 | + 'postcode' => '', |
|
| 159 | + ); |
|
| 160 | + |
|
| 161 | + } |
|
| 162 | + |
|
| 163 | + /** |
|
| 164 | + * Fetches the prefix for the MaxMind database file. |
|
| 165 | + * |
|
| 166 | + * @return string |
|
| 167 | + */ |
|
| 168 | + private function get_database_prefix() { |
|
| 169 | + |
|
| 170 | + $prefix = get_option( 'wpinv_maxmind_database_prefix' ); |
|
| 171 | + |
|
| 172 | + if ( empty( $prefix ) ) { |
|
| 173 | + $prefix = md5( uniqid( 'wpinv' ) ); |
|
| 174 | + update_option( 'wpinv_maxmind_database_prefix', $prefix ); |
|
| 175 | + } |
|
| 176 | + |
|
| 177 | + return $prefix; |
|
| 178 | + } |
|
| 179 | 179 | |
| 180 | 180 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * Uses MaxMind for Geolocation |
@@ -34,19 +34,19 @@ discard block |
||
| 34 | 34 | * @since 1.0.19 |
| 35 | 35 | * @return mixed|null The geolocation database service. |
| 36 | 36 | */ |
| 37 | - $this->database_service = apply_filters( 'getpaid_maxmind_geolocation_database_service', null ); |
|
| 38 | - if ( null === $this->database_service ) { |
|
| 39 | - $this->database_service = new GetPaid_MaxMind_Database_Service( $this->get_database_prefix() ); |
|
| 37 | + $this->database_service = apply_filters('getpaid_maxmind_geolocation_database_service', null); |
|
| 38 | + if (null === $this->database_service) { |
|
| 39 | + $this->database_service = new GetPaid_MaxMind_Database_Service($this->get_database_prefix()); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // Bind to the scheduled updater action. |
| 43 | - add_action( 'getpaid_update_geoip_databases', array( $this, 'update_database' ) ); |
|
| 43 | + add_action('getpaid_update_geoip_databases', array($this, 'update_database')); |
|
| 44 | 44 | |
| 45 | 45 | // Bind to the geolocation filter for MaxMind database lookups. |
| 46 | - add_filter( 'getpaid_get_geolocation', array( $this, 'get_geolocation' ), 10, 2 ); |
|
| 46 | + add_filter('getpaid_get_geolocation', array($this, 'get_geolocation'), 10, 2); |
|
| 47 | 47 | |
| 48 | 48 | // Handle maxmind key updates. |
| 49 | - add_filter( 'wpinv_settings_sanitize_maxmind_license_key', array( $this, 'handle_key_updates' ) ); |
|
| 49 | + add_filter('wpinv_settings_sanitize_maxmind_license_key', array($this, 'handle_key_updates')); |
|
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | |
@@ -65,29 +65,29 @@ discard block |
||
| 65 | 65 | * @param string $license_key The new license key. |
| 66 | 66 | * @return string |
| 67 | 67 | */ |
| 68 | - public function handle_key_updates( $license_key ) { |
|
| 68 | + public function handle_key_updates($license_key) { |
|
| 69 | 69 | |
| 70 | 70 | // Trim whitespaces and strip slashes. |
| 71 | - $license_key = trim( $license_key ); |
|
| 71 | + $license_key = trim($license_key); |
|
| 72 | 72 | |
| 73 | 73 | // Abort if the license key is empty or unchanged. |
| 74 | - if ( empty( $license_key ) ) { |
|
| 74 | + if (empty($license_key)) { |
|
| 75 | 75 | return $license_key; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // Abort if a database exists and the license key is unchaged. |
| 79 | - if ( file_exists( $this->database_service->get_database_path() && $license_key == wpinv_get_option( 'maxmind_license_key' ) ) ) { |
|
| 79 | + if (file_exists($this->database_service->get_database_path() && $license_key == wpinv_get_option('maxmind_license_key'))) { |
|
| 80 | 80 | return $license_key; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // Check the license key by attempting to download the Geolocation database. |
| 84 | - $tmp_database_path = $this->database_service->download_database( $license_key ); |
|
| 85 | - if ( is_wp_error( $tmp_database_path ) ) { |
|
| 86 | - getpaid_admin()->show_error( $tmp_database_path->get_error_message() ); |
|
| 84 | + $tmp_database_path = $this->database_service->download_database($license_key); |
|
| 85 | + if (is_wp_error($tmp_database_path)) { |
|
| 86 | + getpaid_admin()->show_error($tmp_database_path->get_error_message()); |
|
| 87 | 87 | return $license_key; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $this->update_database( /** @scrutinizer ignore-type */ $tmp_database_path ); |
|
| 90 | + $this->update_database(/** @scrutinizer ignore-type */ $tmp_database_path); |
|
| 91 | 91 | |
| 92 | 92 | return $license_key; |
| 93 | 93 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @param string $tmp_database_path Temporary database path. |
| 99 | 99 | */ |
| 100 | - public function update_database( $tmp_database_path = null ) { |
|
| 100 | + public function update_database($tmp_database_path = null) { |
|
| 101 | 101 | |
| 102 | 102 | // Allow us to easily interact with the filesystem. |
| 103 | 103 | require_once ABSPATH . 'wp-admin/includes/file.php'; |
@@ -108,32 +108,32 @@ discard block |
||
| 108 | 108 | $target_database_path = $this->database_service->get_database_path(); |
| 109 | 109 | |
| 110 | 110 | // If there's no database path, we can't store the database. |
| 111 | - if ( empty( $target_database_path ) ) { |
|
| 111 | + if (empty($target_database_path)) { |
|
| 112 | 112 | return; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - if ( $wp_filesystem->exists( $target_database_path ) ) { |
|
| 116 | - $wp_filesystem->delete( $target_database_path ); |
|
| 115 | + if ($wp_filesystem->exists($target_database_path)) { |
|
| 116 | + $wp_filesystem->delete($target_database_path); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | // We can't download a database if there's no license key configured. |
| 120 | - $license_key = wpinv_get_option( 'maxmind_license_key' ); |
|
| 121 | - if ( empty( $license_key ) ) { |
|
| 120 | + $license_key = wpinv_get_option('maxmind_license_key'); |
|
| 121 | + if (empty($license_key)) { |
|
| 122 | 122 | return; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - if ( empty( $tmp_database_path ) ) { |
|
| 126 | - $tmp_database_path = $this->database_service->download_database( $license_key ); |
|
| 125 | + if (empty($tmp_database_path)) { |
|
| 126 | + $tmp_database_path = $this->database_service->download_database($license_key); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - if ( is_wp_error( $tmp_database_path ) ) { |
|
| 130 | - wpinv_error_log( $tmp_database_path->get_error_message() ); |
|
| 129 | + if (is_wp_error($tmp_database_path)) { |
|
| 130 | + wpinv_error_log($tmp_database_path->get_error_message()); |
|
| 131 | 131 | return; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | // Move the new database into position. |
| 135 | - $wp_filesystem->move( $tmp_database_path, $target_database_path, true ); |
|
| 136 | - $wp_filesystem->delete( dirname( $tmp_database_path ) ); |
|
| 135 | + $wp_filesystem->move($tmp_database_path, $target_database_path, true); |
|
| 136 | + $wp_filesystem->delete(dirname($tmp_database_path)); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -143,13 +143,13 @@ discard block |
||
| 143 | 143 | * @param string $ip_address The IP address to geolocate. |
| 144 | 144 | * @return array Geolocation including country code, state, city and postcode based on an IP address. |
| 145 | 145 | */ |
| 146 | - public function get_geolocation( $data, $ip_address ) { |
|
| 146 | + public function get_geolocation($data, $ip_address) { |
|
| 147 | 147 | |
| 148 | - if ( ! empty( $data['country'] ) || empty( $ip_address ) ) { |
|
| 148 | + if (!empty($data['country']) || empty($ip_address)) { |
|
| 149 | 149 | return $data; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - $country_code = $this->database_service->get_iso_country_code_for_ip( $ip_address ); |
|
| 152 | + $country_code = $this->database_service->get_iso_country_code_for_ip($ip_address); |
|
| 153 | 153 | |
| 154 | 154 | return array( |
| 155 | 155 | 'country' => $country_code, |
@@ -167,11 +167,11 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | private function get_database_prefix() { |
| 169 | 169 | |
| 170 | - $prefix = get_option( 'wpinv_maxmind_database_prefix' ); |
|
| 170 | + $prefix = get_option('wpinv_maxmind_database_prefix'); |
|
| 171 | 171 | |
| 172 | - if ( empty( $prefix ) ) { |
|
| 173 | - $prefix = md5( uniqid( 'wpinv' ) ); |
|
| 174 | - update_option( 'wpinv_maxmind_database_prefix', $prefix ); |
|
| 172 | + if (empty($prefix)) { |
|
| 173 | + $prefix = md5(uniqid('wpinv')); |
|
| 174 | + update_option('wpinv_maxmind_database_prefix', $prefix); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return $prefix; |
@@ -20,13 +20,13 @@ |
||
| 20 | 20 | <title><?php esc_html_e( 'GetPaid › 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' ); |
|
| 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 | 25 | wp_print_scripts( 'select2' ); |
| 26 | - wp_print_scripts( 'wpinv-admin-script' ); |
|
| 26 | + wp_print_scripts( 'wpinv-admin-script' ); |
|
| 27 | 27 | do_action( 'admin_print_styles' ); |
| 28 | 28 | do_action( 'admin_head' ); |
| 29 | - ?> |
|
| 29 | + ?> |
|
| 30 | 30 | <style> |
| 31 | 31 | body, p{ |
| 32 | 32 | font-size: 16px; |
@@ -57,9 +57,12 @@ |
||
| 57 | 57 | </li> |
| 58 | 58 | <?php endforeach; ?> |
| 59 | 59 | </ol> |
| 60 | - <?php else : ?> |
|
| 60 | + <?php else { |
|
| 61 | + : ?> |
|
| 61 | 62 | <div class='mb-3'> </div> |
| 62 | - <?php endif; ?> |
|
| 63 | + <?php endif; |
|
| 64 | +} |
|
| 65 | +?> |
|
| 63 | 66 | |
| 64 | 67 | <div class="text-center pb-3 mt-5"> |
| 65 | 68 | <a class=" text-decoration-none" href="https://wpgetpaid.com/"> |
@@ -4,7 +4,7 @@ discard block |
||
| 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 |
||
| 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 › Setup Wizard', 'invoicing' ); ?></title> |
|
| 20 | + <title><?php esc_html_e('GetPaid › 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 |
||
| 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 |
||
| 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> |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | - exit; // Exit if accessed directly |
|
| 11 | + exit; // Exit if accessed directly |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | /** |
@@ -319,10 +319,10 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /** |
| 322 | - * Output the metabox. |
|
| 323 | - * |
|
| 324 | - * @param WP_Post $post |
|
| 325 | - */ |
|
| 322 | + * Output the metabox. |
|
| 323 | + * |
|
| 324 | + * @param WP_Post $post |
|
| 325 | + */ |
|
| 326 | 326 | public static function output2( $post ) { |
| 327 | 327 | |
| 328 | 328 | // Prepare the invoice. |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 10 | +if (!defined('ABSPATH')) { |
|
| 11 | 11 | exit; // Exit if accessed directly |
| 12 | 12 | } |
| 13 | 13 | |
@@ -16,82 +16,82 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | class GetPaid_Meta_Box_Invoice_Items { |
| 18 | 18 | |
| 19 | - public static function get_columns( $invoice ) { |
|
| 19 | + public static function get_columns($invoice) { |
|
| 20 | 20 | $use_taxes = $invoice->is_taxable() && wpinv_use_taxes(); |
| 21 | 21 | $columns = array( |
| 22 | - 'id' => __( 'ID', 'invoicing' ), |
|
| 23 | - 'title' => __( 'Item', 'invoicing' ), |
|
| 22 | + 'id' => __('ID', 'invoicing'), |
|
| 23 | + 'title' => __('Item', 'invoicing'), |
|
| 24 | 24 | 'price' => sprintf( |
| 25 | 25 | '<span class="getpaid-hide-if-hours getpaid-hide-if-quantity">%s</span> |
| 26 | 26 | <span class="getpaid-hide-if-hours hide-if-amount">%s</span> |
| 27 | 27 | <span class="getpaid-hide-if-quantity hide-if-amount">%s</span>', |
| 28 | - __( 'Amount', 'invoicing' ), |
|
| 29 | - __( 'Price', 'invoicing' ), |
|
| 30 | - __( 'Rate', 'invoicing' ) |
|
| 28 | + __('Amount', 'invoicing'), |
|
| 29 | + __('Price', 'invoicing'), |
|
| 30 | + __('Rate', 'invoicing') |
|
| 31 | 31 | ), |
| 32 | 32 | 'qty' => sprintf( |
| 33 | 33 | '<span class="getpaid-hide-if-hours">%s</span><span class="getpaid-hide-if-quantity">%s</span>', |
| 34 | - __( 'Quantity', 'invoicing' ), |
|
| 35 | - __( 'Hours', 'invoicing' ) |
|
| 34 | + __('Quantity', 'invoicing'), |
|
| 35 | + __('Hours', 'invoicing') |
|
| 36 | 36 | ), |
| 37 | - 'total' => __( 'Total', 'invoicing' ), |
|
| 38 | - 'tax' => __( 'Tax (%)', 'invoicing' ), |
|
| 37 | + 'total' => __('Total', 'invoicing'), |
|
| 38 | + 'tax' => __('Tax (%)', 'invoicing'), |
|
| 39 | 39 | 'action' => '', |
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | - if ( ! $use_taxes ) { |
|
| 43 | - unset( $columns['tax'] ); |
|
| 42 | + if (!$use_taxes) { |
|
| 43 | + unset($columns['tax']); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return $columns; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public static function output( $post, $invoice = false ) { |
|
| 49 | + public static function output($post, $invoice = false) { |
|
| 50 | 50 | |
| 51 | - if ( apply_filters( 'getpaid_use_new_invoice_items_metabox', false ) ) { |
|
| 52 | - return self::output2( $post ); |
|
| 51 | + if (apply_filters('getpaid_use_new_invoice_items_metabox', false)) { |
|
| 52 | + return self::output2($post); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $post_id = !empty( $post->ID ) ? $post->ID : 0; |
|
| 56 | - $invoice = $invoice instanceof WPInv_Invoice ? $invoice : new WPInv_Invoice( $post_id ); |
|
| 55 | + $post_id = !empty($post->ID) ? $post->ID : 0; |
|
| 56 | + $invoice = $invoice instanceof WPInv_Invoice ? $invoice : new WPInv_Invoice($post_id); |
|
| 57 | 57 | $use_taxes = $invoice->is_taxable() && wpinv_use_taxes(); |
| 58 | - $item_types = apply_filters( 'wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post ); |
|
| 59 | - $columns = self::get_columns( $invoice ); |
|
| 60 | - $cols = count( $columns ); |
|
| 58 | + $item_types = apply_filters('wpinv_item_types_for_quick_add_item', wpinv_get_item_types(), $post); |
|
| 59 | + $columns = self::get_columns($invoice); |
|
| 60 | + $cols = count($columns); |
|
| 61 | 61 | $class = ''; |
| 62 | 62 | |
| 63 | - unset( $item_types['adv'] ); |
|
| 64 | - unset( $item_types['package'] ); |
|
| 63 | + unset($item_types['adv']); |
|
| 64 | + unset($item_types['package']); |
|
| 65 | 65 | |
| 66 | - if ( $invoice->is_paid() ) { |
|
| 66 | + if ($invoice->is_paid()) { |
|
| 67 | 67 | $class .= ' wpinv-paid'; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if ( $invoice->is_refunded() ) { |
|
| 70 | + if ($invoice->is_refunded()) { |
|
| 71 | 71 | $class .= ' wpinv-refunded'; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if ( $invoice->is_recurring() ) { |
|
| 74 | + if ($invoice->is_recurring()) { |
|
| 75 | 75 | $class .= ' wpi-recurring'; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | ?> |
| 79 | 79 | |
| 80 | - <div class="wpinv-items-wrap<?php echo esc_attr( $class ); ?>" id="wpinv_items_wrap" data-status="<?php echo esc_attr( $invoice->get_status() ); ?>"> |
|
| 80 | + <div class="wpinv-items-wrap<?php echo esc_attr($class); ?>" id="wpinv_items_wrap" data-status="<?php echo esc_attr($invoice->get_status()); ?>"> |
|
| 81 | 81 | <table id="wpinv_items" class="wpinv-items" cellspacing="0" cellpadding="0"> |
| 82 | 82 | |
| 83 | 83 | <thead> |
| 84 | 84 | <tr> |
| 85 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
| 86 | - <th class="<?php echo esc_attr( $key ); echo 'total' == $key || 'qty' == $key ? ' hide-if-amount' : '' ?>"><?php echo wp_kses_post( $label ); ?></th> |
|
| 85 | + <?php foreach ($columns as $key => $label) : ?> |
|
| 86 | + <th class="<?php echo esc_attr($key); echo 'total' == $key || 'qty' == $key ? ' hide-if-amount' : '' ?>"><?php echo wp_kses_post($label); ?></th> |
|
| 87 | 87 | <?php endforeach; ?> |
| 88 | 88 | </tr> |
| 89 | 89 | </thead> |
| 90 | 90 | |
| 91 | 91 | <tbody class="wpinv-line-items"> |
| 92 | 92 | <?php |
| 93 | - foreach ( $invoice->get_items() as $int => $item ) { |
|
| 94 | - self::output_row( $columns, $item, $invoice, $int % 2 == 0 ? 'even' : 'odd' ); |
|
| 93 | + foreach ($invoice->get_items() as $int => $item) { |
|
| 94 | + self::output_row($columns, $item, $invoice, $int % 2 == 0 ? 'even' : 'odd'); |
|
| 95 | 95 | } |
| 96 | 96 | ?> |
| 97 | 97 | </tbody> |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | <div class="wp-clearfix"> |
| 109 | 109 | <label class="wpi-item-name"> |
| 110 | 110 | <span class="input-text-wrap"> |
| 111 | - <input type="text" style="width: 100%" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' );?>" class="wpinv-quick-item-name" name="_wpinv_quick[name]"> |
|
| 111 | + <input type="text" style="width: 100%" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="wpinv-quick-item-name" name="_wpinv_quick[name]"> |
|
| 112 | 112 | </span> |
| 113 | 113 | </label> |
| 114 | 114 | </div> |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | <div class="wp-clearfix"> |
| 117 | 117 | <label class="wpi-item-price"> |
| 118 | 118 | <span class="input-text-wrap"> |
| 119 | - <input type="text" style="width: 200px" placeholder="<?php esc_attr_e( 'Item Price', 'invoicing' );?>" class="wpinv-quick-item-price" name="_wpinv_quick[price]"> |
|
| 120 | - × <input type="text" style="width: 140px" placeholder="<?php esc_attr_e( 'Item Quantity', 'invoicing' );?>" class="wpinv-quick-item-qty" name="_wpinv_quick[qty]"> |
|
| 119 | + <input type="text" style="width: 200px" placeholder="<?php esc_attr_e('Item Price', 'invoicing'); ?>" class="wpinv-quick-item-price" name="_wpinv_quick[price]"> |
|
| 120 | + × <input type="text" style="width: 140px" placeholder="<?php esc_attr_e('Item Quantity', 'invoicing'); ?>" class="wpinv-quick-item-qty" name="_wpinv_quick[qty]"> |
|
| 121 | 121 | </span> |
| 122 | 122 | </label> |
| 123 | 123 | </div> |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | <div class="wp-clearfix"> |
| 126 | 126 | <label class="wpi-item-name"> |
| 127 | 127 | <span class="input-text-wrap"> |
| 128 | - <textarea rows="4" style="width: 100%" placeholder="<?php esc_attr_e( 'Item Description', 'invoicing' );?>" class="wpinv-quick-item-description" name="_wpinv_quick[description]"></textarea> |
|
| 128 | + <textarea rows="4" style="width: 100%" placeholder="<?php esc_attr_e('Item Description', 'invoicing'); ?>" class="wpinv-quick-item-description" name="_wpinv_quick[description]"></textarea> |
|
| 129 | 129 | </span> |
| 130 | 130 | </label> |
| 131 | 131 | </div> |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | <div class="wp-clearfix"> |
| 134 | 134 | <label class="wpi-item-type"> |
| 135 | 135 | <span class="input-text-wrap"> |
| 136 | - <?php wpinv_html_select( array( |
|
| 136 | + <?php wpinv_html_select(array( |
|
| 137 | 137 | 'options' => $item_types, |
| 138 | 138 | 'name' => '_wpinv_quick[type]', |
| 139 | 139 | 'id' => '_wpinv_quick_type', |
@@ -141,19 +141,19 @@ discard block |
||
| 141 | 141 | 'show_option_all' => false, |
| 142 | 142 | 'show_option_none' => false, |
| 143 | 143 | 'class' => 'gdmbx2-text-medium wpinv-quick-type', |
| 144 | - ) ); ?> |
|
| 144 | + )); ?> |
|
| 145 | 145 | </span> |
| 146 | 146 | </label> |
| 147 | 147 | </div> |
| 148 | 148 | |
| 149 | - <?php if ( $use_taxes ) : ?> |
|
| 149 | + <?php if ($use_taxes) : ?> |
|
| 150 | 150 | <div class="wp-clearfix"> |
| 151 | 151 | <label class="wpi-vat-rule"> |
| 152 | 152 | <span class="input-text-wrap"> |
| 153 | 153 | <?php |
| 154 | - wpinv_html_select( array( |
|
| 154 | + wpinv_html_select(array( |
|
| 155 | 155 | 'options' => array_merge( |
| 156 | - array( '' => __( 'Select VAT Rule', 'invoicing' ) ), |
|
| 156 | + array('' => __('Select VAT Rule', 'invoicing')), |
|
| 157 | 157 | getpaid_get_tax_rules() |
| 158 | 158 | ), |
| 159 | 159 | 'name' => '_wpinv_quick[vat_rule]', |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | 'show_option_none' => false, |
| 163 | 163 | 'class' => 'gdmbx2-text-medium wpinv-quick-vat-rule', |
| 164 | 164 | 'selected' => 'digital', |
| 165 | - ) ); |
|
| 165 | + )); |
|
| 166 | 166 | ?> |
| 167 | 167 | </span> |
| 168 | 168 | </label> |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | <label class="wpi-vat-class"> |
| 172 | 172 | <span class="input-text-wrap"> |
| 173 | 173 | <?php |
| 174 | - wpinv_html_select( array( |
|
| 174 | + wpinv_html_select(array( |
|
| 175 | 175 | 'options' => array_merge( |
| 176 | - array( '' => __( 'Select VAT Class', 'invoicing' ) ), |
|
| 176 | + array('' => __('Select VAT Class', 'invoicing')), |
|
| 177 | 177 | getpaid_get_tax_classes() |
| 178 | 178 | ), |
| 179 | 179 | 'name' => '_wpinv_quick[vat_class]', |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | 'show_option_none' => false, |
| 183 | 183 | 'class' => 'gdmbx2-text-medium wpinv-quick-vat-class', |
| 184 | 184 | 'selected' => '_standard', |
| 185 | - ) ); |
|
| 185 | + )); |
|
| 186 | 186 | ?> |
| 187 | 187 | </span> |
| 188 | 188 | </label> |
@@ -203,29 +203,29 @@ discard block |
||
| 203 | 203 | </td> |
| 204 | 204 | </tr> |
| 205 | 205 | <tr class="totals"> |
| 206 | - <td colspan="<?php echo ( (int) $cols - 4 ); ?>"></td> |
|
| 206 | + <td colspan="<?php echo ((int) $cols - 4); ?>"></td> |
|
| 207 | 207 | <td colspan="4"> |
| 208 | 208 | <table cellspacing="0" cellpadding="0"> |
| 209 | 209 | <tr class="subtotal"> |
| 210 | - <td class="name"><?php esc_html_e( 'Sub Total:', 'invoicing' );?></td> |
|
| 211 | - <td class="total"><?php wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() );?></td> |
|
| 210 | + <td class="name"><?php esc_html_e('Sub Total:', 'invoicing'); ?></td> |
|
| 211 | + <td class="total"><?php wpinv_the_price($invoice->get_subtotal(), $invoice->get_currency()); ?></td> |
|
| 212 | 212 | <td class="action"></td> |
| 213 | 213 | </tr> |
| 214 | 214 | <tr class="discount"> |
| 215 | - <td class="name"><?php esc_html_e( 'Discount:', 'invoicing' ) ; ?></td> |
|
| 216 | - <td class="total"><?php wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() );?></td> |
|
| 215 | + <td class="name"><?php esc_html_e('Discount:', 'invoicing'); ?></td> |
|
| 216 | + <td class="total"><?php wpinv_the_price($invoice->get_total_discount(), $invoice->get_currency()); ?></td> |
|
| 217 | 217 | <td class="action"></td> |
| 218 | 218 | </tr> |
| 219 | - <?php if ( $use_taxes ) : ?> |
|
| 219 | + <?php if ($use_taxes) : ?> |
|
| 220 | 220 | <tr class="tax"> |
| 221 | - <td class="name"><?php esc_html_e( 'Tax:', 'invoicing' );?></td> |
|
| 222 | - <td class="total"><?php wpinv_the_price( $invoice->get_total_tax(), $invoice->get_currency() );?></td> |
|
| 221 | + <td class="name"><?php esc_html_e('Tax:', 'invoicing'); ?></td> |
|
| 222 | + <td class="total"><?php wpinv_the_price($invoice->get_total_tax(), $invoice->get_currency()); ?></td> |
|
| 223 | 223 | <td class="action"></td> |
| 224 | 224 | </tr> |
| 225 | 225 | <?php endif; ?> |
| 226 | 226 | <tr class="total"> |
| 227 | - <td class="name"><?php esc_html_e( 'Total:', 'invoicing' );?></td> |
|
| 228 | - <td class="total"><?php wpinv_the_price( $invoice->get_total(), $invoice->get_currency() );?></td> |
|
| 227 | + <td class="name"><?php esc_html_e('Total:', 'invoicing'); ?></td> |
|
| 228 | + <td class="total"><?php wpinv_the_price($invoice->get_total(), $invoice->get_currency()); ?></td> |
|
| 229 | 229 | <td class="action"></td> |
| 230 | 230 | </tr> |
| 231 | 231 | </table> |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | </table> |
| 237 | 237 | <div class="wpinv-actions"> |
| 238 | 238 | <?php |
| 239 | - if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) { |
|
| 239 | + if (!$invoice->is_paid() && !$invoice->is_refunded()) { |
|
| 240 | 240 | wpinv_item_dropdown( |
| 241 | 241 | array( |
| 242 | 242 | 'name' => 'wpinv_invoice_item', |
@@ -246,61 +246,61 @@ discard block |
||
| 246 | 246 | ) |
| 247 | 247 | ); |
| 248 | 248 | |
| 249 | - echo " " . '<button class="button button-primary" id="wpinv-add-item">' . sprintf( esc_html__( 'Add item to %s', 'invoicing' ), esc_html( $invoice->get_label() ) ) . '</button>'; |
|
| 250 | - echo " " . '<button class="button button-primary" id="wpinv-new-item">' . esc_html__( 'Create new item', 'invoicing' ) . '</button>'; |
|
| 251 | - echo " " . '<button class="button button-primary wpinv-flr" id="wpinv-recalc-totals">' . esc_html__( 'Recalculate Totals', 'invoicing' ) . '</button>'; |
|
| 249 | + echo " " . '<button class="button button-primary" id="wpinv-add-item">' . sprintf(esc_html__('Add item to %s', 'invoicing'), esc_html($invoice->get_label())) . '</button>'; |
|
| 250 | + echo " " . '<button class="button button-primary" id="wpinv-new-item">' . esc_html__('Create new item', 'invoicing') . '</button>'; |
|
| 251 | + echo " " . '<button class="button button-primary wpinv-flr" id="wpinv-recalc-totals">' . esc_html__('Recalculate Totals', 'invoicing') . '</button>'; |
|
| 252 | 252 | |
| 253 | 253 | } |
| 254 | 254 | ?> |
| 255 | - <?php do_action( 'wpinv_invoice_items_actions', $invoice ); ?> |
|
| 255 | + <?php do_action('wpinv_invoice_items_actions', $invoice); ?> |
|
| 256 | 256 | </div> |
| 257 | 257 | </div> |
| 258 | 258 | <?php |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - public static function output_row( $columns, $item, $invoice, $class='even' ) { |
|
| 261 | + public static function output_row($columns, $item, $invoice, $class = 'even') { |
|
| 262 | 262 | |
| 263 | 263 | ?> |
| 264 | - <tr class="item item-<?php echo esc_attr( $class ); ?>" data-item-id="<?php echo esc_attr( $item->get_id() ); ?>"> |
|
| 265 | - <?php foreach ( array_keys( $columns ) as $column ) : ?> |
|
| 266 | - <td class="<?php echo esc_attr( $column ); echo 'total' == $column || 'qty' == $column ? ' hide-if-amount' : '' ?>"> |
|
| 264 | + <tr class="item item-<?php echo esc_attr($class); ?>" data-item-id="<?php echo esc_attr($item->get_id()); ?>"> |
|
| 265 | + <?php foreach (array_keys($columns) as $column) : ?> |
|
| 266 | + <td class="<?php echo esc_attr($column); echo 'total' == $column || 'qty' == $column ? ' hide-if-amount' : '' ?>"> |
|
| 267 | 267 | <?php |
| 268 | - switch ( $column ) { |
|
| 268 | + switch ($column) { |
|
| 269 | 269 | case 'id': |
| 270 | 270 | echo (int) $item->get_id(); |
| 271 | 271 | break; |
| 272 | 272 | case 'title': |
| 273 | 273 | printf( |
| 274 | 274 | '<a href="%s" target="_blank">%s</a>', |
| 275 | - esc_url( get_edit_post_link( $item->get_id() ) ), |
|
| 276 | - esc_html( $item->get_raw_name() ) |
|
| 275 | + esc_url(get_edit_post_link($item->get_id())), |
|
| 276 | + esc_html($item->get_raw_name()) |
|
| 277 | 277 | ); |
| 278 | 278 | |
| 279 | - $summary = apply_filters( 'getpaid_admin_invoice_line_item_summary', $item->get_description(), $item, $invoice ); |
|
| 280 | - if ( $summary !== '' ) { |
|
| 279 | + $summary = apply_filters('getpaid_admin_invoice_line_item_summary', $item->get_description(), $item, $invoice); |
|
| 280 | + if ($summary !== '') { |
|
| 281 | 281 | printf( |
| 282 | 282 | '<span class="meta">%s</span>', |
| 283 | - wp_kses_post( wpautop( $summary ) ) |
|
| 283 | + wp_kses_post(wpautop($summary)) |
|
| 284 | 284 | ); |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | printf( |
| 288 | 288 | '<input type="hidden" value="%s" name="getpaid_items[%s][name]" class="getpaid-recalculate-prices-on-change" />', |
| 289 | - esc_attr( $item->get_raw_name() ), |
|
| 289 | + esc_attr($item->get_raw_name()), |
|
| 290 | 290 | (int) $item->get_id() |
| 291 | 291 | ); |
| 292 | 292 | |
| 293 | 293 | printf( |
| 294 | 294 | '<textarea style="display: none;" name="getpaid_items[%s][description]" class="getpaid-recalculate-prices-on-change">%s</textarea>', |
| 295 | 295 | (int) $item->get_id(), |
| 296 | - esc_attr( $item->get_description() ) |
|
| 296 | + esc_attr($item->get_description()) |
|
| 297 | 297 | ); |
| 298 | 298 | |
| 299 | 299 | break; |
| 300 | 300 | case 'price': |
| 301 | 301 | printf( |
| 302 | 302 | '<input type="text" value="%s" name="getpaid_items[%s][price]" style="width: 100px;" class="getpaid-admin-invoice-item-price getpaid-recalculate-prices-on-change" />', |
| 303 | - esc_attr( getpaid_unstandardize_amount( $item->get_price() ) ), |
|
| 303 | + esc_attr(getpaid_unstandardize_amount($item->get_price())), |
|
| 304 | 304 | (int) $item->get_id() |
| 305 | 305 | ); |
| 306 | 306 | |
@@ -308,26 +308,26 @@ discard block |
||
| 308 | 308 | case 'qty': |
| 309 | 309 | printf( |
| 310 | 310 | '<input type="text" style="width: 100px;" value="%s" name="getpaid_items[%s][quantity]" class="getpaid-admin-invoice-item-quantity getpaid-recalculate-prices-on-change" />', |
| 311 | - floatval( $item->get_quantity() ), |
|
| 311 | + floatval($item->get_quantity()), |
|
| 312 | 312 | (int) $item->get_id() |
| 313 | 313 | ); |
| 314 | 314 | |
| 315 | 315 | break; |
| 316 | 316 | case 'total': |
| 317 | - wpinv_the_price( $item->get_sub_total(), $invoice->get_currency() ); |
|
| 317 | + wpinv_the_price($item->get_sub_total(), $invoice->get_currency()); |
|
| 318 | 318 | |
| 319 | 319 | break; |
| 320 | 320 | case 'tax': |
| 321 | - echo floatval( wpinv_round_amount( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
| 321 | + echo floatval(wpinv_round_amount(getpaid_get_invoice_tax_rate($invoice, $item), 2)) . '%'; |
|
| 322 | 322 | |
| 323 | 323 | break; |
| 324 | 324 | case 'action': |
| 325 | - if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) { |
|
| 325 | + if (!$invoice->is_paid() && !$invoice->is_refunded()) { |
|
| 326 | 326 | echo '<i class="fa fa-trash wpinv-item-remove"></i>'; |
| 327 | 327 | } |
| 328 | 328 | break; |
| 329 | 329 | } |
| 330 | - do_action( 'getpaid_admin_edit_invoice_item_' . $column, $item, $invoice ); |
|
| 330 | + do_action('getpaid_admin_edit_invoice_item_' . $column, $item, $invoice); |
|
| 331 | 331 | ?> |
| 332 | 332 | </td> |
| 333 | 333 | <?php endforeach; ?> |
@@ -340,10 +340,10 @@ discard block |
||
| 340 | 340 | * |
| 341 | 341 | * @param WP_Post $post |
| 342 | 342 | */ |
| 343 | - public static function output2( $post ) { |
|
| 343 | + public static function output2($post) { |
|
| 344 | 344 | |
| 345 | 345 | // Prepare the invoice. |
| 346 | - $invoice = new WPInv_Invoice( $post ); |
|
| 346 | + $invoice = new WPInv_Invoice($post); |
|
| 347 | 347 | |
| 348 | 348 | // Invoice items. |
| 349 | 349 | $items = $invoice->get_items(); |
@@ -351,28 +351,28 @@ discard block |
||
| 351 | 351 | $totals = array( |
| 352 | 352 | |
| 353 | 353 | 'subtotal' => array( |
| 354 | - 'label' => __( 'Items Subtotal', 'invoicing' ), |
|
| 355 | - 'value' => wpinv_price( $invoice->get_subtotal(), $invoice->get_currency() ), |
|
| 354 | + 'label' => __('Items Subtotal', 'invoicing'), |
|
| 355 | + 'value' => wpinv_price($invoice->get_subtotal(), $invoice->get_currency()), |
|
| 356 | 356 | ), |
| 357 | 357 | |
| 358 | 358 | 'discount' => array( |
| 359 | - 'label' => __( 'Total Discount', 'invoicing' ), |
|
| 360 | - 'value' => wpinv_price( $invoice->get_total_discount(), $invoice->get_currency() ), |
|
| 359 | + 'label' => __('Total Discount', 'invoicing'), |
|
| 360 | + 'value' => wpinv_price($invoice->get_total_discount(), $invoice->get_currency()), |
|
| 361 | 361 | ), |
| 362 | 362 | |
| 363 | 363 | 'tax' => array( |
| 364 | - 'label' => __( 'Total Tax', 'invoicing' ), |
|
| 365 | - 'value' => wpinv_price( $invoice->get_total_tax(), $invoice->get_currency() ), |
|
| 364 | + 'label' => __('Total Tax', 'invoicing'), |
|
| 365 | + 'value' => wpinv_price($invoice->get_total_tax(), $invoice->get_currency()), |
|
| 366 | 366 | ), |
| 367 | 367 | |
| 368 | 368 | 'total' => array( |
| 369 | - 'label' => __( 'Invoice Total', 'invoicing' ), |
|
| 370 | - 'value' => wpinv_price( $invoice->get_total(), $invoice->get_currency() ), |
|
| 369 | + 'label' => __('Invoice Total', 'invoicing'), |
|
| 370 | + 'value' => wpinv_price($invoice->get_total(), $invoice->get_currency()), |
|
| 371 | 371 | ) |
| 372 | 372 | ); |
| 373 | 373 | |
| 374 | - if ( ! wpinv_use_taxes() ) { |
|
| 375 | - unset( $totals['tax'] ); |
|
| 374 | + if (!wpinv_use_taxes()) { |
|
| 375 | + unset($totals['tax']); |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | $item_args = array( |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | 'orderby' => 'title', |
| 381 | 381 | 'order' => 'ASC', |
| 382 | 382 | 'posts_per_page' => -1, |
| 383 | - 'post_status' => array( 'publish' ), |
|
| 383 | + 'post_status' => array('publish'), |
|
| 384 | 384 | 'meta_query' => array( |
| 385 | 385 | array( |
| 386 | 386 | 'key' => '_wpinv_type', |
@@ -404,10 +404,10 @@ discard block |
||
| 404 | 404 | } |
| 405 | 405 | </style> |
| 406 | 406 | |
| 407 | - <div class="bsui getpaid-invoice-items-inner <?php echo empty( $items ) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem; padding: 0 12px 12px;"> |
|
| 407 | + <div class="bsui getpaid-invoice-items-inner <?php echo empty($items) ? 'no-items' : 'has-items'; ?> <?php echo $invoice->is_paid() || $invoice->is_refunded() ? 'not-editable' : 'editable'; ?>" style="margin-top: 1.5rem; padding: 0 12px 12px;"> |
|
| 408 | 408 | |
| 409 | - <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?> |
|
| 410 | - <?php do_action( 'wpinv_meta_box_before_invoice_template_row', $invoice->get_id() ); ?> |
|
| 409 | + <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?> |
|
| 410 | + <?php do_action('wpinv_meta_box_before_invoice_template_row', $invoice->get_id()); ?> |
|
| 411 | 411 | |
| 412 | 412 | <div class="row"> |
| 413 | 413 | <div class="col-12 col-sm-6"> |
@@ -416,15 +416,15 @@ discard block |
||
| 416 | 416 | array( |
| 417 | 417 | 'id' => 'wpinv_template', |
| 418 | 418 | 'name' => 'wpinv_template', |
| 419 | - 'label' => __( 'Template', 'invoicing' ), |
|
| 419 | + 'label' => __('Template', 'invoicing'), |
|
| 420 | 420 | 'label_type' => 'vertical', |
| 421 | - 'placeholder' => __( 'Choose a template', 'invoicing' ), |
|
| 421 | + 'placeholder' => __('Choose a template', 'invoicing'), |
|
| 422 | 422 | 'class' => 'form-control-sm', |
| 423 | - 'value' => $invoice->get_template( 'edit' ), |
|
| 423 | + 'value' => $invoice->get_template('edit'), |
|
| 424 | 424 | 'options' => array( |
| 425 | - 'quantity' => __( 'Quantity', 'invoicing' ), |
|
| 426 | - 'hours' => __( 'Hours', 'invoicing' ), |
|
| 427 | - 'amount' => __( 'Amount Only', 'invoicing' ), |
|
| 425 | + 'quantity' => __('Quantity', 'invoicing'), |
|
| 426 | + 'hours' => __('Hours', 'invoicing'), |
|
| 427 | + 'amount' => __('Amount Only', 'invoicing'), |
|
| 428 | 428 | ), |
| 429 | 429 | 'data-allow-clear' => 'false', |
| 430 | 430 | 'select2' => true, |
@@ -441,11 +441,11 @@ discard block |
||
| 441 | 441 | array( |
| 442 | 442 | 'id' => 'wpinv_currency', |
| 443 | 443 | 'name' => 'wpinv_currency', |
| 444 | - 'label' => __( 'Currency', 'invoicing' ), |
|
| 444 | + 'label' => __('Currency', 'invoicing'), |
|
| 445 | 445 | 'label_type' => 'vertical', |
| 446 | - 'placeholder' => __( 'Select Invoice Currency', 'invoicing' ), |
|
| 446 | + 'placeholder' => __('Select Invoice Currency', 'invoicing'), |
|
| 447 | 447 | 'class' => 'form-control-sm', |
| 448 | - 'value' => $invoice->get_currency( 'edit' ), |
|
| 448 | + 'value' => $invoice->get_currency('edit'), |
|
| 449 | 449 | 'required' => false, |
| 450 | 450 | 'data-allow-clear' => 'false', |
| 451 | 451 | 'select2' => true, |
@@ -458,24 +458,24 @@ discard block |
||
| 458 | 458 | </div> |
| 459 | 459 | </div> |
| 460 | 460 | |
| 461 | - <?php do_action( 'wpinv_meta_box_invoice_template_row', $invoice->get_id() ); ?> |
|
| 461 | + <?php do_action('wpinv_meta_box_invoice_template_row', $invoice->get_id()); ?> |
|
| 462 | 462 | <?php endif; ?> |
| 463 | 463 | |
| 464 | 464 | <table cellpadding="0" cellspacing="0" class="getpaid_invoice_items"> |
| 465 | 465 | <thead> |
| 466 | 466 | <tr> |
| 467 | - <th class="getpaid-item" colspan="2"><?php esc_html_e( 'Item', 'invoicing' ) ?></th> |
|
| 467 | + <th class="getpaid-item" colspan="2"><?php esc_html_e('Item', 'invoicing') ?></th> |
|
| 468 | 468 | <th class="getpaid-quantity hide-if-amount text-right"> |
| 469 | - <span class="getpaid-hide-if-hours"><?php esc_html_e( 'Quantity', 'invoicing' ) ?></span> |
|
| 470 | - <span class="getpaid-hide-if-quantity"><?php esc_html_e( 'Hours', 'invoicing' ) ?></span> |
|
| 469 | + <span class="getpaid-hide-if-hours"><?php esc_html_e('Quantity', 'invoicing') ?></span> |
|
| 470 | + <span class="getpaid-hide-if-quantity"><?php esc_html_e('Hours', 'invoicing') ?></span> |
|
| 471 | 471 | </th> |
| 472 | 472 | <th class="getpaid-price hide-if-amount text-right"> |
| 473 | - <span class="getpaid-hide-if-hours"><?php esc_html_e( 'Price', 'invoicing' ) ?></span> |
|
| 474 | - <span class="getpaid-hide-if-quantity"><?php esc_html_e( 'Rate', 'invoicing' ) ?></span> |
|
| 473 | + <span class="getpaid-hide-if-hours"><?php esc_html_e('Price', 'invoicing') ?></span> |
|
| 474 | + <span class="getpaid-hide-if-quantity"><?php esc_html_e('Rate', 'invoicing') ?></span> |
|
| 475 | 475 | </th> |
| 476 | 476 | <th class="getpaid-item-subtotal text-right"> |
| 477 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php esc_html_e( 'Amount', 'invoicing' ) ?></span> |
|
| 478 | - <span class="hide-if-amount"><?php esc_html_e( 'Total', 'invoicing' ) ?></span> |
|
| 477 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity"><?php esc_html_e('Amount', 'invoicing') ?></span> |
|
| 478 | + <span class="hide-if-amount"><?php esc_html_e('Total', 'invoicing') ?></span> |
|
| 479 | 479 | </th> |
| 480 | 480 | <th class="getpaid-item-actions hide-if-not-editable" width="70px"> </th> |
| 481 | 481 | </tr> |
@@ -483,8 +483,8 @@ discard block |
||
| 483 | 483 | <tbody class="getpaid_invoice_line_items"> |
| 484 | 484 | <tr class="hide-if-has-items hide-if-not-editable"> |
| 485 | 485 | <td colspan="2" class="pt-4 pb-4"> |
| 486 | - <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e( 'Add Existing Items', 'invoicing' ) ?></button> |
|
| 487 | - <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e( 'Create New Item', 'invoicing' ) ?></button> |
|
| 486 | + <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e('Add Existing Items', 'invoicing') ?></button> |
|
| 487 | + <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e('Create New Item', 'invoicing') ?></button> |
|
| 488 | 488 | </td> |
| 489 | 489 | <td class="hide-if-amount"> </th> |
| 490 | 490 | <td class="hide-if-amount"> </th> |
@@ -516,11 +516,11 @@ discard block |
||
| 516 | 516 | <div class="col-12 col-sm-6 offset-sm-6"> |
| 517 | 517 | <table class="getpaid-invoice-totals text-right w-100"> |
| 518 | 518 | <tbody> |
| 519 | - <?php foreach ( apply_filters( 'getpaid_invoice_subtotal_rows', $totals, $invoice ) as $key => $data ) : ?> |
|
| 520 | - <tr class="getpaid-totals-<?php echo esc_attr( $key ); ?>"> |
|
| 521 | - <td class="label"><?php echo esc_html( $data['label'] ) ?>:</td> |
|
| 519 | + <?php foreach (apply_filters('getpaid_invoice_subtotal_rows', $totals, $invoice) as $key => $data) : ?> |
|
| 520 | + <tr class="getpaid-totals-<?php echo esc_attr($key); ?>"> |
|
| 521 | + <td class="label"><?php echo esc_html($data['label']) ?>:</td> |
|
| 522 | 522 | <td width="1%"></td> |
| 523 | - <td class="value"><?php echo wp_kses_post( $data['value'] ) ?></td> |
|
| 523 | + <td class="value"><?php echo wp_kses_post($data['value']) ?></td> |
|
| 524 | 524 | </tr> |
| 525 | 525 | <?php endforeach; ?> |
| 526 | 526 | </tbody> |
@@ -533,18 +533,18 @@ discard block |
||
| 533 | 533 | <div class="getpaid-invoice-item-actions hide-if-no-items hide-if-not-editable"> |
| 534 | 534 | <div class="row"> |
| 535 | 535 | <div class="text-left col-12 col-sm-8"> |
| 536 | - <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e( 'Add Existing Item', 'invoicing' ) ?></button> |
|
| 537 | - <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e( 'Create New Item', 'invoicing' ) ?></button> |
|
| 538 | - <?php do_action( 'getpaid-invoice-items-actions', $invoice ); ?> |
|
| 536 | + <button type="button" class="button button-primary add-invoice-item" data-toggle="modal" data-target="#getpaid-add-items-to-invoice"><?php esc_html_e('Add Existing Item', 'invoicing') ?></button> |
|
| 537 | + <button type="button" class="button button-secondary create-invoice-item" data-toggle="modal" data-target="#getpaid-create-invoice-item"><?php esc_html_e('Create New Item', 'invoicing') ?></button> |
|
| 538 | + <?php do_action('getpaid-invoice-items-actions', $invoice); ?> |
|
| 539 | 539 | </div> |
| 540 | 540 | <div class="text-right col-12 col-sm-4"> |
| 541 | - <button type="button" class="button button-primary recalculate-totals-button"><?php esc_html_e( 'Recalculate Totals', 'invoicing' ) ?></button> |
|
| 541 | + <button type="button" class="button button-primary recalculate-totals-button"><?php esc_html_e('Recalculate Totals', 'invoicing') ?></button> |
|
| 542 | 542 | </div> |
| 543 | 543 | </div> |
| 544 | 544 | </div> |
| 545 | 545 | |
| 546 | 546 | <div class="getpaid-invoice-item-actions hide-if-editable"> |
| 547 | - <p class="description m-2 text-right text-muted"><?php esc_html_e( 'This invoice is no longer editable', 'invoicing' ); ?></p> |
|
| 547 | + <p class="description m-2 text-right text-muted"><?php esc_html_e('This invoice is no longer editable', 'invoicing'); ?></p> |
|
| 548 | 548 | </div> |
| 549 | 549 | |
| 550 | 550 | <!-- Add items to an invoice --> |
@@ -552,8 +552,8 @@ discard block |
||
| 552 | 552 | <div class="modal-dialog modal-dialog-centered" role="document"> |
| 553 | 553 | <div class="modal-content"> |
| 554 | 554 | <div class="modal-header"> |
| 555 | - <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php esc_html_e( "Add Item(s)", 'invoicing' ); ?></h5> |
|
| 556 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e( "Close", 'invoicing' ); ?>"> |
|
| 555 | + <h5 class="modal-title" id="getpaid-add-item-to-invoice-label"><?php esc_html_e("Add Item(s)", 'invoicing'); ?></h5> |
|
| 556 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e("Close", 'invoicing'); ?>"> |
|
| 557 | 557 | <span aria-hidden="true">×</span> |
| 558 | 558 | </button> |
| 559 | 559 | </div> |
@@ -561,10 +561,10 @@ discard block |
||
| 561 | 561 | <table class="widefat"> |
| 562 | 562 | <thead> |
| 563 | 563 | <tr> |
| 564 | - <th class="pl-0 text-left"><?php esc_html_e( 'Item', 'invoicing' ) ?></th> |
|
| 564 | + <th class="pl-0 text-left"><?php esc_html_e('Item', 'invoicing') ?></th> |
|
| 565 | 565 | <th class="pr-0 text-right hide-if-amount"> |
| 566 | - <span class="getpaid-hide-if-hours"><?php esc_html_e( 'Quantity', 'invoicing' ) ?></span> |
|
| 567 | - <span class="getpaid-hide-if-quantity"><?php esc_html_e( 'Hours', 'invoicing' ) ?></span> |
|
| 566 | + <span class="getpaid-hide-if-hours"><?php esc_html_e('Quantity', 'invoicing') ?></span> |
|
| 567 | + <span class="getpaid-hide-if-quantity"><?php esc_html_e('Hours', 'invoicing') ?></span> |
|
| 568 | 568 | </th> |
| 569 | 569 | </tr> |
| 570 | 570 | </thead> |
@@ -572,9 +572,9 @@ discard block |
||
| 572 | 572 | <tr> |
| 573 | 573 | <td class="pl-0 text-left"> |
| 574 | 574 | <select class="regular-text getpaid-add-invoice-item-select"> |
| 575 | - <option value="" selected="selected" disabled><?php esc_html_e( 'Select an item…', 'invoicing' ); ?></option> |
|
| 576 | - <?php foreach ( get_posts( $item_args ) as $item ) : ?> |
|
| 577 | - <option value="<?php echo (int) $item->ID; ?>"><?php echo esc_html( $item->post_title ); ?></option> |
|
| 575 | + <option value="" selected="selected" disabled><?php esc_html_e('Select an item…', 'invoicing'); ?></option> |
|
| 576 | + <?php foreach (get_posts($item_args) as $item) : ?> |
|
| 577 | + <option value="<?php echo (int) $item->ID; ?>"><?php echo esc_html($item->post_title); ?></option> |
|
| 578 | 578 | <?php endforeach; ?> |
| 579 | 579 | </select> |
| 580 | 580 | </td> |
@@ -586,8 +586,8 @@ discard block |
||
| 586 | 586 | </table> |
| 587 | 587 | </div> |
| 588 | 588 | <div class="modal-footer"> |
| 589 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e( 'Cancel', 'invoicing' ); ?></button> |
|
| 590 | - <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php esc_html_e( 'Add', 'invoicing' ); ?></button> |
|
| 589 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e('Cancel', 'invoicing'); ?></button> |
|
| 590 | + <button type="button" class="btn btn-primary getpaid-add" data-dismiss="modal"><?php esc_html_e('Add', 'invoicing'); ?></button> |
|
| 591 | 591 | </div> |
| 592 | 592 | </div> |
| 593 | 593 | </div> |
@@ -598,8 +598,8 @@ discard block |
||
| 598 | 598 | <div class="modal-dialog modal-dialog-centered" role="document"> |
| 599 | 599 | <div class="modal-content"> |
| 600 | 600 | <div class="modal-header"> |
| 601 | - <h5 class="modal-title" id="getpaid-create-invoice-item-label"><?php esc_html_e( "Create Item", 'invoicing' ); ?></h5> |
|
| 602 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e( "Close", 'invoicing' ); ?>"> |
|
| 601 | + <h5 class="modal-title" id="getpaid-create-invoice-item-label"><?php esc_html_e("Create Item", 'invoicing'); ?></h5> |
|
| 602 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e("Close", 'invoicing'); ?>"> |
|
| 603 | 603 | <span aria-hidden="true">×</span> |
| 604 | 604 | </button> |
| 605 | 605 | </div> |
@@ -607,27 +607,27 @@ discard block |
||
| 607 | 607 | <div class="getpaid-create-item-div"> |
| 608 | 608 | <input type="hidden" name="id" value="new" class="form-control form-control-sm item-id"> |
| 609 | 609 | <label class="form-group mb-3 w-100"> |
| 610 | - <span><?php esc_html_e( 'Name', 'invoicing' ); ?></span> |
|
| 611 | - <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name"> |
|
| 610 | + <span><?php esc_html_e('Name', 'invoicing'); ?></span> |
|
| 611 | + <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name"> |
|
| 612 | 612 | </label> |
| 613 | 613 | <label class="form-group mb-3 w-100"> |
| 614 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e( 'Amount', 'invoicing' ); ?></span> |
|
| 615 | - <span class="hide-if-amount"><?php esc_html_e( 'Price', 'invoicing' ); ?></span> |
|
| 616 | - <input type="text" name="price" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control form-control-sm item-price"> |
|
| 614 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e('Amount', 'invoicing'); ?></span> |
|
| 615 | + <span class="hide-if-amount"><?php esc_html_e('Price', 'invoicing'); ?></span> |
|
| 616 | + <input type="text" name="price" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control form-control-sm item-price"> |
|
| 617 | 617 | </label> |
| 618 | 618 | <label class="form-group mb-3 w-100 hide-if-amount"> |
| 619 | - <span><?php esc_html_e( 'Quantity', 'invoicing' ); ?></span> |
|
| 619 | + <span><?php esc_html_e('Quantity', 'invoicing'); ?></span> |
|
| 620 | 620 | <input type="text" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity"> |
| 621 | 621 | </label> |
| 622 | 622 | <label class="form-group mb-3 w-100"> |
| 623 | - <span><?php esc_html_e( 'Item Description', 'invoicing' ); ?></span> |
|
| 624 | - <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea> |
|
| 623 | + <span><?php esc_html_e('Item Description', 'invoicing'); ?></span> |
|
| 624 | + <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea> |
|
| 625 | 625 | </label> |
| 626 | 626 | </div> |
| 627 | 627 | </div> |
| 628 | 628 | <div class="modal-footer"> |
| 629 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e( 'Cancel', 'invoicing' ); ?></button> |
|
| 630 | - <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e( 'Create', 'invoicing' ); ?></button> |
|
| 629 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e('Cancel', 'invoicing'); ?></button> |
|
| 630 | + <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e('Create', 'invoicing'); ?></button> |
|
| 631 | 631 | </div> |
| 632 | 632 | </div> |
| 633 | 633 | </div> |
@@ -638,8 +638,8 @@ discard block |
||
| 638 | 638 | <div class="modal-dialog modal-dialog-centered" role="document"> |
| 639 | 639 | <div class="modal-content"> |
| 640 | 640 | <div class="modal-header"> |
| 641 | - <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php esc_html_e( "Edit Item", 'invoicing' ); ?></h5> |
|
| 642 | - <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e( "Close", 'invoicing' ); ?>"> |
|
| 641 | + <h5 class="modal-title" id="getpaid-edit-invoice-item-label"><?php esc_html_e("Edit Item", 'invoicing'); ?></h5> |
|
| 642 | + <button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_html_e("Close", 'invoicing'); ?>"> |
|
| 643 | 643 | <span aria-hidden="true">×</span> |
| 644 | 644 | </button> |
| 645 | 645 | </div> |
@@ -647,27 +647,27 @@ discard block |
||
| 647 | 647 | <div class="getpaid-edit-item-div"> |
| 648 | 648 | <input type="hidden" name="id" class="form-control form-control-sm item-id"> |
| 649 | 649 | <label class="form-group mb-3 w-100"> |
| 650 | - <span><?php esc_html_e( 'Name', 'invoicing' ); ?></span> |
|
| 651 | - <input type="text" name="name" placeholder="<?php esc_attr_e( 'Item Name', 'invoicing' ); ?>" class="form-control form-control-sm item-name"> |
|
| 650 | + <span><?php esc_html_e('Name', 'invoicing'); ?></span> |
|
| 651 | + <input type="text" name="name" placeholder="<?php esc_attr_e('Item Name', 'invoicing'); ?>" class="form-control form-control-sm item-name"> |
|
| 652 | 652 | </label> |
| 653 | 653 | <label class="form-group mb-3 w-100"> |
| 654 | - <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e( 'Amount', 'invoicing' ); ?></span> |
|
| 655 | - <span class="hide-if-amount"><?php esc_html_e( 'Price', 'invoicing' ); ?></span> |
|
| 656 | - <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount( 0 ); ?>" class="form-control form-control-sm item-price"> |
|
| 654 | + <span class="getpaid-hide-if-hours getpaid-hide-if-quantity item-price"><?php esc_html_e('Amount', 'invoicing'); ?></span> |
|
| 655 | + <span class="hide-if-amount"><?php esc_html_e('Price', 'invoicing'); ?></span> |
|
| 656 | + <input type="text" name="price" placeholder="<?php wpinv_sanitize_amount(0); ?>" class="form-control form-control-sm item-price"> |
|
| 657 | 657 | </label> |
| 658 | 658 | <label class="form-group mb-3 w-100 hide-if-amount"> |
| 659 | - <span><?php esc_html_e( 'Quantity', 'invoicing' ); ?></span> |
|
| 659 | + <span><?php esc_html_e('Quantity', 'invoicing'); ?></span> |
|
| 660 | 660 | <input type="text" name="quantity" placeholder="1" class="form-control form-control-sm item-quantity"> |
| 661 | 661 | </label> |
| 662 | 662 | <label class="form-group mb-3 w-100"> |
| 663 | - <span><?php esc_html_e( 'Item Description', 'invoicing' ); ?></span> |
|
| 664 | - <textarea name="description" placeholder="<?php esc_attr_e( 'Enter a description for this item', 'invoicing' ); ?>" class="form-control item-description"></textarea> |
|
| 663 | + <span><?php esc_html_e('Item Description', 'invoicing'); ?></span> |
|
| 664 | + <textarea name="description" placeholder="<?php esc_attr_e('Enter a description for this item', 'invoicing'); ?>" class="form-control item-description"></textarea> |
|
| 665 | 665 | </label> |
| 666 | 666 | </div> |
| 667 | 667 | </div> |
| 668 | 668 | <div class="modal-footer"> |
| 669 | - <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e( 'Cancel', 'invoicing' ); ?></button> |
|
| 670 | - <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e( 'Save', 'invoicing' ); ?></button> |
|
| 669 | + <button type="button" class="btn btn-secondary getpaid-cancel" data-dismiss="modal"><?php esc_html_e('Cancel', 'invoicing'); ?></button> |
|
| 670 | + <button type="button" class="btn btn-primary getpaid-save" data-dismiss="modal"><?php esc_html_e('Save', 'invoicing'); ?></button> |
|
| 671 | 671 | </div> |
| 672 | 672 | </div> |
| 673 | 673 | </div> |
@@ -15,12 +15,12 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | if ( ! defined( 'ABSPATH' ) ) { |
| 18 | - exit; |
|
| 18 | + exit; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | if ( ! class_exists( 'AyeCode_Deactivation_Survey' ) ) { |
| 22 | - // include the class if needed |
|
| 23 | - include_once( dirname( __FILE__ ) . "/wp-deactivation-survey.php" ); |
|
| 22 | + // include the class if needed |
|
| 23 | + include_once( dirname( __FILE__ ) . "/wp-deactivation-survey.php" ); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
@@ -36,6 +36,6 @@ discard block |
||
| 36 | 36 | //}); |
| 37 | 37 | |
| 38 | 38 | AyeCode_Deactivation_Survey::instance(array( |
| 39 | - 'slug' => 'ayecode-deactivation-survey-testing', |
|
| 40 | - 'version' => '1.0.0' |
|
| 39 | + 'slug' => 'ayecode-deactivation-survey-testing', |
|
| 40 | + 'version' => '1.0.0' |
|
| 41 | 41 | )); |
| 42 | 42 | \ No newline at end of file |
@@ -14,13 +14,13 @@ |
||
| 14 | 14 | * Tested up to: 5.8 |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 17 | +if (!defined('ABSPATH')) { |
|
| 18 | 18 | exit; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -if ( ! class_exists( 'AyeCode_Deactivation_Survey' ) ) { |
|
| 21 | +if (!class_exists('AyeCode_Deactivation_Survey')) { |
|
| 22 | 22 | // include the class if needed |
| 23 | - include_once( dirname( __FILE__ ) . "/wp-deactivation-survey.php" ); |
|
| 23 | + include_once(dirname(__FILE__) . "/wp-deactivation-survey.php"); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
@@ -7,10 +7,10 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | ?> |
| 13 | 13 | <span>{{form_element.text}}</span> |
| 14 | 14 | <a target='_blank' href="#"> |
| 15 | - <?php echo esc_html( wpinv_get_ip() ); ?> <i class='fa fa-external-link-square' aria-hidden='true'></i> |
|
| 15 | + <?php echo esc_html(wpinv_get_ip()); ?> <i class='fa fa-external-link-square' aria-hidden='true'></i> |
|
| 16 | 16 | </a> |
@@ -6,35 +6,35 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | class ComposerStaticInit8b6d4385c391849a80038f0b0e87c8b5 |
| 8 | 8 | { |
| 9 | - public static $files = array ( |
|
| 9 | + public static $files = array( |
|
| 10 | 10 | 'e8d544c98e79f913e13eae1306ab635e' => __DIR__ . '/..' . '/ayecode/wp-ayecode-ui/ayecode-ui-loader.php', |
| 11 | 11 | '24583d3588ebda5228dd453cfaa070da' => __DIR__ . '/..' . '/ayecode/wp-font-awesome-settings/wp-font-awesome-settings.php', |
| 12 | 12 | '42671a413efb740d7040437ff2a982cd' => __DIR__ . '/..' . '/ayecode/wp-super-duper/sd-functions.php', |
| 13 | 13 | ); |
| 14 | 14 | |
| 15 | - public static $prefixLengthsPsr4 = array ( |
|
| 15 | + public static $prefixLengthsPsr4 = array( |
|
| 16 | 16 | 'M' => |
| 17 | - array ( |
|
| 17 | + array( |
|
| 18 | 18 | 'MaxMind\\Db\\' => 11, |
| 19 | 19 | ), |
| 20 | 20 | 'C' => |
| 21 | - array ( |
|
| 21 | + array( |
|
| 22 | 22 | 'Composer\\Installers\\' => 20, |
| 23 | 23 | ), |
| 24 | 24 | ); |
| 25 | 25 | |
| 26 | - public static $prefixDirsPsr4 = array ( |
|
| 26 | + public static $prefixDirsPsr4 = array( |
|
| 27 | 27 | 'MaxMind\\Db\\' => |
| 28 | - array ( |
|
| 28 | + array( |
|
| 29 | 29 | 0 => __DIR__ . '/..' . '/maxmind-db/reader/src/MaxMind/Db', |
| 30 | 30 | ), |
| 31 | 31 | 'Composer\\Installers\\' => |
| 32 | - array ( |
|
| 32 | + array( |
|
| 33 | 33 | 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers', |
| 34 | 34 | ), |
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | - public static $classMap = array ( |
|
| 37 | + public static $classMap = array( |
|
| 38 | 38 | 'AyeCode_Connect_Helper' => __DIR__ . '/..' . '/ayecode/ayecode-connect-helper/ayecode-connect-helper.php', |
| 39 | 39 | 'AyeCode_Deactivation_Survey' => __DIR__ . '/..' . '/ayecode/wp-deactivation-survey/wp-deactivation-survey.php', |
| 40 | 40 | 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public static function getInitializer(ClassLoader $loader) |
| 45 | 45 | { |
| 46 | - return \Closure::bind(function () use ($loader) { |
|
| 46 | + return \Closure::bind(function() use ($loader) { |
|
| 47 | 47 | $loader->prefixLengthsPsr4 = ComposerStaticInit8b6d4385c391849a80038f0b0e87c8b5::$prefixLengthsPsr4; |
| 48 | 48 | $loader->prefixDirsPsr4 = ComposerStaticInit8b6d4385c391849a80038f0b0e87c8b5::$prefixDirsPsr4; |
| 49 | 49 | $loader->classMap = ComposerStaticInit8b6d4385c391849a80038f0b0e87c8b5::$classMap; |