@@ -51,10 +51,10 @@ discard block |
||
| 51 | 51 | $string = ""; |
| 52 | 52 | $types = $this->__getTypes(); |
| 53 | 53 | foreach ($types as $type) { |
| 54 | - if (preg_match("/struct /",$type)) { |
|
| 55 | - $type = preg_replace("/struct /","class ",$type); |
|
| 56 | - $type = preg_replace("/ (\w+) (\w+);/"," // $1\n public \$$2;",$type); |
|
| 57 | - $string .= $type ."\n"; |
|
| 54 | + if (preg_match("/struct /", $type)) { |
|
| 55 | + $type = preg_replace("/struct /", "class ", $type); |
|
| 56 | + $type = preg_replace("/ (\w+) (\w+);/", " // $1\n public \$$2;", $type); |
|
| 57 | + $string .= $type . "\n"; |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | return $string; |
@@ -84,13 +84,13 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function saveSoapDocumentation($path) |
| 86 | 86 | { |
| 87 | - $string = "<?php\n"; |
|
| 87 | + $string = "<?php\n"; |
|
| 88 | 88 | $string .= "/**\n"; |
| 89 | 89 | $string .= " * Auto generated documentation for the AuthorizeNetSOAP API.\n"; |
| 90 | 90 | $string .= " * Generated " . date("m/d/Y") . "\n"; |
| 91 | 91 | $string .= " */\n"; |
| 92 | 92 | $string .= "class AuthorizeNetSOAP\n"; |
| 93 | - $string .= "{\n" . $this->getSoapMethods() . "\n}\n\n" . $this->getSoapTypes() ."\n\n ?>"; |
|
| 93 | + $string .= "{\n" . $this->getSoapMethods() . "\n}\n\n" . $this->getSoapTypes() . "\n\n ?>"; |
|
| 94 | 94 | return file_put_contents($path, $string); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | else |
| 58 | 58 | { |
| 59 | 59 | // Redirect to error page. |
| 60 | - $redirect_url = $url . '?response_code='.$response->response_code . '&response_reason_text=' . $response->response_reason_text; |
|
| 60 | + $redirect_url = $url . '?response_code=' . $response->response_code . '&response_reason_text=' . $response->response_reason_text; |
|
| 61 | 61 | } |
| 62 | 62 | // Send the Javascript back to AuthorizeNet, which will redirect user back to your site. |
| 63 | 63 | echo AuthorizeNetDPM::getRelayResponseSnippet($redirect_url); |
@@ -179,54 +179,54 @@ discard block |
||
| 179 | 179 | -moz-box-shadow: inset 3px -3px 3px rgba(0,0,0,.5), inset 0 3px 3px rgba(255,255,255,.5), inset -3px 0 3px rgba(255,255,255,.75); |
| 180 | 180 | box-shadow: inset 3px -3px 3px rgba(0,0,0,.5), inset 0 3px 3px rgba(255,255,255,.5), inset -3px 0 3px rgba(255,255,255,.75); } |
| 181 | 181 | </style> |
| 182 | - <form method="post" action="'.$post_url.'"> |
|
| 183 | - '.$hidden_fields.' |
|
| 182 | + <form method="post" action="'.$post_url . '"> |
|
| 183 | + '.$hidden_fields . ' |
|
| 184 | 184 | <fieldset> |
| 185 | 185 | <div> |
| 186 | 186 | <label>Credit Card Number</label> |
| 187 | - <input type="text" class="text" size="15" name="x_card_num" value="'.($prefill ? '6011000000000012' : '').'"></input> |
|
| 187 | + <input type="text" class="text" size="15" name="x_card_num" value="'.($prefill ? '6011000000000012' : '') . '"></input> |
|
| 188 | 188 | </div> |
| 189 | 189 | <div> |
| 190 | 190 | <label>Exp.</label> |
| 191 | - <input type="text" class="text" size="4" name="x_exp_date" value="'.($prefill ? '04/17' : '').'"></input> |
|
| 191 | + <input type="text" class="text" size="4" name="x_exp_date" value="'.($prefill ? '04/17' : '') . '"></input> |
|
| 192 | 192 | </div> |
| 193 | 193 | <div> |
| 194 | 194 | <label>CCV</label> |
| 195 | - <input type="text" class="text" size="4" name="x_card_code" value="'.($prefill ? '782' : '').'"></input> |
|
| 195 | + <input type="text" class="text" size="4" name="x_card_code" value="'.($prefill ? '782' : '') . '"></input> |
|
| 196 | 196 | </div> |
| 197 | 197 | </fieldset> |
| 198 | 198 | <fieldset> |
| 199 | 199 | <div> |
| 200 | 200 | <label>First Name</label> |
| 201 | - <input type="text" class="text" size="15" name="x_first_name" value="'.($prefill ? 'John' : '').'"></input> |
|
| 201 | + <input type="text" class="text" size="15" name="x_first_name" value="'.($prefill ? 'John' : '') . '"></input> |
|
| 202 | 202 | </div> |
| 203 | 203 | <div> |
| 204 | 204 | <label>Last Name</label> |
| 205 | - <input type="text" class="text" size="14" name="x_last_name" value="'.($prefill ? 'Doe' : '').'"></input> |
|
| 205 | + <input type="text" class="text" size="14" name="x_last_name" value="'.($prefill ? 'Doe' : '') . '"></input> |
|
| 206 | 206 | </div> |
| 207 | 207 | </fieldset> |
| 208 | 208 | <fieldset> |
| 209 | 209 | <div> |
| 210 | 210 | <label>Address</label> |
| 211 | - <input type="text" class="text" size="26" name="x_address" value="'.($prefill ? '123 Main Street' : '').'"></input> |
|
| 211 | + <input type="text" class="text" size="26" name="x_address" value="'.($prefill ? '123 Main Street' : '') . '"></input> |
|
| 212 | 212 | </div> |
| 213 | 213 | <div> |
| 214 | 214 | <label>City</label> |
| 215 | - <input type="text" class="text" size="15" name="x_city" value="'.($prefill ? 'Boston' : '').'"></input> |
|
| 215 | + <input type="text" class="text" size="15" name="x_city" value="'.($prefill ? 'Boston' : '') . '"></input> |
|
| 216 | 216 | </div> |
| 217 | 217 | </fieldset> |
| 218 | 218 | <fieldset> |
| 219 | 219 | <div> |
| 220 | 220 | <label>State</label> |
| 221 | - <input type="text" class="text" size="4" name="x_state" value="'.($prefill ? 'MA' : '').'"></input> |
|
| 221 | + <input type="text" class="text" size="4" name="x_state" value="'.($prefill ? 'MA' : '') . '"></input> |
|
| 222 | 222 | </div> |
| 223 | 223 | <div> |
| 224 | 224 | <label>Zip Code</label> |
| 225 | - <input type="text" class="text" size="9" name="x_zip" value="'.($prefill ? '02142' : '').'"></input> |
|
| 225 | + <input type="text" class="text" size="9" name="x_zip" value="'.($prefill ? '02142' : '') . '"></input> |
|
| 226 | 226 | </div> |
| 227 | 227 | <div> |
| 228 | 228 | <label>Country</label> |
| 229 | - <input type="text" class="text" size="22" name="x_country" value="'.($prefill ? 'US' : '').'"></input> |
|
| 229 | + <input type="text" class="text" size="22" name="x_country" value="'.($prefill ? 'US' : '') . '"></input> |
|
| 230 | 230 | </div> |
| 231 | 231 | </fieldset> |
| 232 | 232 | <input type="submit" value="BUY" class="submit buy"> |
@@ -1,41 +1,41 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( !defined('ABSPATH') ) { |
|
| 2 | +if (!defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | global $post; |
| 6 | 6 | $invoice_id = $post->ID; |
| 7 | -$invoice = wpinv_get_invoice( $invoice_id ); |
|
| 8 | -if ( empty( $invoice ) ) { |
|
| 7 | +$invoice = wpinv_get_invoice($invoice_id); |
|
| 8 | +if (empty($invoice)) { |
|
| 9 | 9 | exit; |
| 10 | 10 | } |
| 11 | -$type = $post->post_type == 'wpi_invoice' ? __( 'Invoice', 'invoicing' ): __( 'Quotation', 'invoicing' ); |
|
| 12 | -do_action( 'wpinv_invoice_print_before_display', $invoice ); ?><!DOCTYPE html> |
|
| 11 | +$type = $post->post_type == 'wpi_invoice' ? __('Invoice', 'invoicing') : __('Quotation', 'invoicing'); |
|
| 12 | +do_action('wpinv_invoice_print_before_display', $invoice); ?><!DOCTYPE html> |
|
| 13 | 13 | <html <?php language_attributes(); ?>> |
| 14 | 14 | <head> |
| 15 | 15 | <meta charset="UTF-8"> |
| 16 | 16 | <title><?php wp_title() ?></title> |
| 17 | - <meta charset="<?php bloginfo( 'charset' ); ?>" /> |
|
| 17 | + <meta charset="<?php bloginfo('charset'); ?>" /> |
|
| 18 | 18 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 19 | 19 | <meta name="robots" content="noindex,nofollow"> |
| 20 | 20 | |
| 21 | - <?php do_action( 'wpinv_invoice_print_head', $invoice ); ?> |
|
| 21 | + <?php do_action('wpinv_invoice_print_head', $invoice); ?> |
|
| 22 | 22 | </head> |
| 23 | 23 | <body class="body wpinv wpinv-print"> |
| 24 | - <?php do_action( 'wpinv_invoice_print_body_start', $invoice ); ?> |
|
| 24 | + <?php do_action('wpinv_invoice_print_body_start', $invoice); ?> |
|
| 25 | 25 | <div class="container wpinv-wrap"> |
| 26 | - <?php if ( $watermark = wpinv_watermark( $invoice_id ) ) { ?> |
|
| 27 | - <div class="watermark no-print"><p><?php echo esc_html( $watermark ) ?></p></div> |
|
| 26 | + <?php if ($watermark = wpinv_watermark($invoice_id)) { ?> |
|
| 27 | + <div class="watermark no-print"><p><?php echo esc_html($watermark) ?></p></div> |
|
| 28 | 28 | <?php } ?> |
| 29 | 29 | <!-- ///// Start PDF header --> |
| 30 | 30 | <htmlpageheader name="wpinv-pdf-header"> |
| 31 | - <?php do_action( 'wpinv_invoice_print_before_header', $invoice ); ?> |
|
| 31 | + <?php do_action('wpinv_invoice_print_before_header', $invoice); ?> |
|
| 32 | 32 | <div class="row wpinv-header"> |
| 33 | 33 | <div class="col-xs-6 wpinv-business"> |
| 34 | - <a target="_blank" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
| 35 | - <?php if ( $logo = wpinv_get_business_logo() ) { ?> |
|
| 36 | - <img class="logo" src="<?php echo esc_url( $logo ); ?>"> |
|
| 34 | + <a target="_blank" href="<?php echo esc_url(wpinv_get_business_website()); ?>"> |
|
| 35 | + <?php if ($logo = wpinv_get_business_logo()) { ?> |
|
| 36 | + <img class="logo" src="<?php echo esc_url($logo); ?>"> |
|
| 37 | 37 | <?php } else { ?> |
| 38 | - <h1><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
| 38 | + <h1><?php echo esc_html(wpinv_get_business_name()); ?></h1> |
|
| 39 | 39 | <?php } ?> |
| 40 | 40 | </a> |
| 41 | 41 | </div> |
@@ -44,56 +44,56 @@ discard block |
||
| 44 | 44 | <h2><?php echo $type; ?></h2> |
| 45 | 45 | </div> |
| 46 | 46 | </div> |
| 47 | - <?php do_action( 'wpinv_invoice_print_after_header', $invoice ); ?> |
|
| 47 | + <?php do_action('wpinv_invoice_print_after_header', $invoice); ?> |
|
| 48 | 48 | </htmlpageheader> |
| 49 | 49 | <!-- End PDF header ///// --> |
| 50 | 50 | |
| 51 | - <?php do_action( 'wpinv_invoice_print_before_top_content', $invoice ); ?> |
|
| 51 | + <?php do_action('wpinv_invoice_print_before_top_content', $invoice); ?> |
|
| 52 | 52 | <div class="row wpinv-top-content"> |
| 53 | 53 | <div class="col-xs-12 col-sm-6 wpinv-addresses"> |
| 54 | 54 | <div class="col-xs-12 wpinv-address wpinv-from-address"> |
| 55 | 55 | <?php wpinv_display_from_address(); ?> |
| 56 | 56 | </div> |
| 57 | 57 | <div class="col-xs-12 wpinv-address wpinv-to-address"> |
| 58 | - <?php wpinv_display_to_address( $invoice_id ); ?> |
|
| 58 | + <?php wpinv_display_to_address($invoice_id); ?> |
|
| 59 | 59 | </div> |
| 60 | 60 | </div> |
| 61 | 61 | <div class="col-xs-12 col-sm-6 wpinv-details"> |
| 62 | 62 | <div class="col-xs-12 wpinv-line-details"> |
| 63 | - <?php do_action( 'wpinv_invoice_print_before_details', $invoice ); ?> |
|
| 64 | - <?php wpinv_display_invoice_details( $invoice ); ?> |
|
| 65 | - <?php do_action( 'wpinv_invoice_print_after_details', $invoice ); ?> |
|
| 63 | + <?php do_action('wpinv_invoice_print_before_details', $invoice); ?> |
|
| 64 | + <?php wpinv_display_invoice_details($invoice); ?> |
|
| 65 | + <?php do_action('wpinv_invoice_print_after_details', $invoice); ?> |
|
| 66 | 66 | </div> |
| 67 | 67 | </div> |
| 68 | 68 | </div> |
| 69 | - <?php do_action( 'wpinv_invoice_print_after_top_content', $invoice ); ?> |
|
| 69 | + <?php do_action('wpinv_invoice_print_after_top_content', $invoice); ?> |
|
| 70 | 70 | |
| 71 | - <?php do_action( 'wpinv_invoice_print_middle', $invoice ); ?> |
|
| 71 | + <?php do_action('wpinv_invoice_print_middle', $invoice); ?> |
|
| 72 | 72 | |
| 73 | - <?php do_action( 'wpinv_invoice_print_before_line_items', $invoice ); ?> |
|
| 73 | + <?php do_action('wpinv_invoice_print_before_line_items', $invoice); ?> |
|
| 74 | 74 | <div class="row wpinv-items"> |
| 75 | 75 | <div class="col-sm-12 wpinv-line-items"> |
| 76 | - <?php wpinv_display_line_items( $invoice_id ); ?> |
|
| 76 | + <?php wpinv_display_line_items($invoice_id); ?> |
|
| 77 | 77 | </div> |
| 78 | 78 | </div> |
| 79 | - <?php do_action( 'wpinv_invoice_print_after_line_items', $invoice ); ?> |
|
| 79 | + <?php do_action('wpinv_invoice_print_after_line_items', $invoice); ?> |
|
| 80 | 80 | |
| 81 | 81 | <!-- ///// Start PDF footer --> |
| 82 | 82 | <htmlpagefooter name="wpinv-pdf-footer"> |
| 83 | - <?php do_action( 'wpinv_invoice_print_before_footer', $invoice ); ?> |
|
| 83 | + <?php do_action('wpinv_invoice_print_before_footer', $invoice); ?> |
|
| 84 | 84 | <div class="row wpinv-footer"> |
| 85 | 85 | <div class="col-sm-12"> |
| 86 | - <?php if ( $term_text = wpinv_get_terms_text() ) { ?> |
|
| 87 | - <div class="terms-text"><?php echo wpautop( $term_text ); ?></div> |
|
| 86 | + <?php if ($term_text = wpinv_get_terms_text()) { ?> |
|
| 87 | + <div class="terms-text"><?php echo wpautop($term_text); ?></div> |
|
| 88 | 88 | <?php } ?> |
| 89 | 89 | <div class="footer-text"><?php echo wpinv_get_business_footer(); ?></div> |
| 90 | - <div class="print-only"><?php _e( 'Page ', 'invoicing' ) ?> {PAGENO}/{nbpg}</div> |
|
| 90 | + <div class="print-only"><?php _e('Page ', 'invoicing') ?> {PAGENO}/{nbpg}</div> |
|
| 91 | 91 | </div> |
| 92 | 92 | </div> |
| 93 | - <?php do_action( 'wpinv_invoice_print_after_footer', $invoice ); ?> |
|
| 93 | + <?php do_action('wpinv_invoice_print_after_footer', $invoice); ?> |
|
| 94 | 94 | </htmlpagefooter> |
| 95 | 95 | <!-- End PDF footer ///// --> |
| 96 | 96 | </div><!-- END wpinv-wrap --> |
| 97 | - <?php do_action( 'wpinv_invoice_print_body_end', $invoice ); ?> |
|
| 97 | + <?php do_action('wpinv_invoice_print_body_end', $invoice); ?> |
|
| 98 | 98 | </body> |
| 99 | 99 | </html> |
| 100 | 100 | \ No newline at end of file |
@@ -1,56 +1,56 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( !defined('ABSPATH') ) { |
|
| 2 | +if (!defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | -do_action( 'wpinv_invalid_invoice_before_display' ); ?><!DOCTYPE html> |
|
| 5 | +do_action('wpinv_invalid_invoice_before_display'); ?><!DOCTYPE html> |
|
| 6 | 6 | <html <?php language_attributes(); ?>> |
| 7 | 7 | <head> |
| 8 | 8 | <meta charset="UTF-8"> |
| 9 | 9 | <title><?php wp_title() ?></title> |
| 10 | - <meta charset="<?php bloginfo( 'charset' ); ?>" /> |
|
| 10 | + <meta charset="<?php bloginfo('charset'); ?>" /> |
|
| 11 | 11 | <meta name="viewport" content="width=device-width,initial-scale=1"> |
| 12 | 12 | <meta name="robots" content="noindex,nofollow"> |
| 13 | - <?php do_action( 'wpinv_invalid_invoice_head' ); ?> |
|
| 13 | + <?php do_action('wpinv_invalid_invoice_head'); ?> |
|
| 14 | 14 | </head> |
| 15 | 15 | <body class="body wpinv wpinv-print wpinv-invalid-invoice"> |
| 16 | - <?php do_action( 'wpinv_invalid_invoice_body_start' ); ?> |
|
| 16 | + <?php do_action('wpinv_invalid_invoice_body_start'); ?> |
|
| 17 | 17 | <div class="container wpinv-wrap"> |
| 18 | 18 | <!-- ///// Start Header --> |
| 19 | 19 | <htmlpageheader name="wpinv-pdf-header"> |
| 20 | - <?php do_action( 'wpinv_invalid_invoice_before_header' ); ?> |
|
| 20 | + <?php do_action('wpinv_invalid_invoice_before_header'); ?> |
|
| 21 | 21 | <div class="row wpinv-header"> |
| 22 | 22 | <div class="col-xs-12 wpinv-business"> |
| 23 | - <a target="_blank" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
| 24 | - <?php if ( $logo = wpinv_get_business_logo() ) { ?> |
|
| 25 | - <img class="logo" src="<?php echo esc_url( $logo ); ?>"> |
|
| 23 | + <a target="_blank" href="<?php echo esc_url(wpinv_get_business_website()); ?>"> |
|
| 24 | + <?php if ($logo = wpinv_get_business_logo()) { ?> |
|
| 25 | + <img class="logo" src="<?php echo esc_url($logo); ?>"> |
|
| 26 | 26 | <?php } else { ?> |
| 27 | - <h1><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
| 27 | + <h1><?php echo esc_html(wpinv_get_business_name()); ?></h1> |
|
| 28 | 28 | <?php } ?> |
| 29 | 29 | </a> |
| 30 | 30 | </div> |
| 31 | 31 | </div> |
| 32 | - <?php do_action( 'wpinv_invalid_invoice_after_header' ); ?> |
|
| 32 | + <?php do_action('wpinv_invalid_invoice_after_header'); ?> |
|
| 33 | 33 | </htmlpageheader> |
| 34 | 34 | <!-- End Header ///// --> |
| 35 | 35 | |
| 36 | - <?php do_action( 'wpinv_invalid_invoice_before_content' ); ?> |
|
| 36 | + <?php do_action('wpinv_invalid_invoice_before_content'); ?> |
|
| 37 | 37 | |
| 38 | - <?php do_action( 'wpinv_invalid_invoice_content' ); ?> |
|
| 38 | + <?php do_action('wpinv_invalid_invoice_content'); ?> |
|
| 39 | 39 | |
| 40 | - <?php do_action( 'wpinv_invalid_invoice_after_content' ); ?> |
|
| 40 | + <?php do_action('wpinv_invalid_invoice_after_content'); ?> |
|
| 41 | 41 | |
| 42 | 42 | <!-- ///// Start Footer --> |
| 43 | 43 | <htmlpagefooter name="wpinv-pdf-footer"> |
| 44 | - <?php do_action( 'wpinv_invalid_invoice_before_footer' ); ?> |
|
| 44 | + <?php do_action('wpinv_invalid_invoice_before_footer'); ?> |
|
| 45 | 45 | <div class="row wpinv-footer"> |
| 46 | 46 | <div class="col-sm-12"> |
| 47 | 47 | <div class="footer-text"><?php echo wpinv_get_business_footer(); ?></div> |
| 48 | 48 | </div> |
| 49 | 49 | </div> |
| 50 | - <?php do_action( 'wpinv_invalid_invoice_after_footer' ); ?> |
|
| 50 | + <?php do_action('wpinv_invalid_invoice_after_footer'); ?> |
|
| 51 | 51 | </htmlpagefooter> |
| 52 | 52 | <!-- End Footer ///// --> |
| 53 | 53 | </div> |
| 54 | - <?php do_action( 'wpinv_invalid_invoice_body_end' ); ?> |
|
| 54 | + <?php do_action('wpinv_invalid_invoice_body_end'); ?> |
|
| 55 | 55 | </body> |
| 56 | 56 | </html> |
| 57 | 57 | \ No newline at end of file |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Exit if accessed directly |
| 4 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 4 | +if (!defined('ABSPATH')) exit; |
|
| 5 | 5 | |
| 6 | 6 | abstract class Wpinv_DB { |
| 7 | 7 | |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | * @since 1.0.0 |
| 67 | 67 | * @return object |
| 68 | 68 | */ |
| 69 | - public function get( $row_id ) { |
|
| 69 | + public function get($row_id) { |
|
| 70 | 70 | global $wpdb; |
| 71 | - return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) ); |
|
| 71 | + return $wpdb->get_row($wpdb->prepare("SELECT * FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id)); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | * @since 1.0.0 |
| 79 | 79 | * @return object |
| 80 | 80 | */ |
| 81 | - public function get_by( $column, $row_id ) { |
|
| 81 | + public function get_by($column, $row_id) { |
|
| 82 | 82 | global $wpdb; |
| 83 | - $column = esc_sql( $column ); |
|
| 84 | - return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $column = %s LIMIT 1;", $row_id ) ); |
|
| 83 | + $column = esc_sql($column); |
|
| 84 | + return $wpdb->get_row($wpdb->prepare("SELECT * FROM $this->table_name WHERE $column = %s LIMIT 1;", $row_id)); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -91,10 +91,10 @@ discard block |
||
| 91 | 91 | * @since 1.0.0 |
| 92 | 92 | * @return string |
| 93 | 93 | */ |
| 94 | - public function get_column( $column, $row_id ) { |
|
| 94 | + public function get_column($column, $row_id) { |
|
| 95 | 95 | global $wpdb; |
| 96 | - $column = esc_sql( $column ); |
|
| 97 | - return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) ); |
|
| 96 | + $column = esc_sql($column); |
|
| 97 | + return $wpdb->get_var($wpdb->prepare("SELECT $column FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id)); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | * @since 1.0.0 |
| 105 | 105 | * @return string |
| 106 | 106 | */ |
| 107 | - public function get_column_by( $column, $column_where, $column_value ) { |
|
| 107 | + public function get_column_by($column, $column_where, $column_value) { |
|
| 108 | 108 | global $wpdb; |
| 109 | - $column_where = esc_sql( $column_where ); |
|
| 110 | - $column = esc_sql( $column ); |
|
| 111 | - return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $column_where = %s LIMIT 1;", $column_value ) ); |
|
| 109 | + $column_where = esc_sql($column_where); |
|
| 110 | + $column = esc_sql($column); |
|
| 111 | + return $wpdb->get_var($wpdb->prepare("SELECT $column FROM $this->table_name WHERE $column_where = %s LIMIT 1;", $column_value)); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -118,31 +118,31 @@ discard block |
||
| 118 | 118 | * @since 1.0.0 |
| 119 | 119 | * @return int |
| 120 | 120 | */ |
| 121 | - public function insert( $data, $type = '' ) { |
|
| 121 | + public function insert($data, $type = '') { |
|
| 122 | 122 | global $wpdb; |
| 123 | 123 | |
| 124 | 124 | // Set default values |
| 125 | - $data = wp_parse_args( $data, $this->get_column_defaults() ); |
|
| 125 | + $data = wp_parse_args($data, $this->get_column_defaults()); |
|
| 126 | 126 | |
| 127 | - do_action( 'wpinv_pre_insert_' . $type, $data ); |
|
| 127 | + do_action('wpinv_pre_insert_' . $type, $data); |
|
| 128 | 128 | |
| 129 | 129 | // Initialise column format array |
| 130 | 130 | $column_formats = $this->get_columns(); |
| 131 | 131 | |
| 132 | 132 | // Force fields to lower case |
| 133 | - $data = array_change_key_case( $data ); |
|
| 133 | + $data = array_change_key_case($data); |
|
| 134 | 134 | |
| 135 | 135 | // White list columns |
| 136 | - $data = array_intersect_key( $data, $column_formats ); |
|
| 136 | + $data = array_intersect_key($data, $column_formats); |
|
| 137 | 137 | |
| 138 | 138 | // Reorder $column_formats to match the order of columns given in $data |
| 139 | - $data_keys = array_keys( $data ); |
|
| 140 | - $column_formats = array_merge( array_flip( $data_keys ), $column_formats ); |
|
| 139 | + $data_keys = array_keys($data); |
|
| 140 | + $column_formats = array_merge(array_flip($data_keys), $column_formats); |
|
| 141 | 141 | |
| 142 | - $wpdb->insert( $this->table_name, $data, $column_formats ); |
|
| 142 | + $wpdb->insert($this->table_name, $data, $column_formats); |
|
| 143 | 143 | $wpdb_insert_id = $wpdb->insert_id; |
| 144 | 144 | |
| 145 | - do_action( 'wpinv_post_insert_' . $type, $wpdb_insert_id, $data ); |
|
| 145 | + do_action('wpinv_post_insert_' . $type, $wpdb_insert_id, $data); |
|
| 146 | 146 | |
| 147 | 147 | return $wpdb_insert_id; |
| 148 | 148 | } |
@@ -154,18 +154,18 @@ discard block |
||
| 154 | 154 | * @since 1.0.0 |
| 155 | 155 | * @return bool |
| 156 | 156 | */ |
| 157 | - public function update( $row_id, $data = array(), $where = '' ) { |
|
| 157 | + public function update($row_id, $data = array(), $where = '') { |
|
| 158 | 158 | |
| 159 | 159 | global $wpdb; |
| 160 | 160 | |
| 161 | 161 | // Row ID must be positive integer |
| 162 | - $row_id = absint( $row_id ); |
|
| 162 | + $row_id = absint($row_id); |
|
| 163 | 163 | |
| 164 | - if( empty( $row_id ) ) { |
|
| 164 | + if (empty($row_id)) { |
|
| 165 | 165 | return false; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - if( empty( $where ) ) { |
|
| 168 | + if (empty($where)) { |
|
| 169 | 169 | $where = $this->primary_key; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -173,16 +173,16 @@ discard block |
||
| 173 | 173 | $column_formats = $this->get_columns(); |
| 174 | 174 | |
| 175 | 175 | // Force fields to lower case |
| 176 | - $data = array_change_key_case( $data ); |
|
| 176 | + $data = array_change_key_case($data); |
|
| 177 | 177 | |
| 178 | 178 | // White list columns |
| 179 | - $data = array_intersect_key( $data, $column_formats ); |
|
| 179 | + $data = array_intersect_key($data, $column_formats); |
|
| 180 | 180 | |
| 181 | 181 | // Reorder $column_formats to match the order of columns given in $data |
| 182 | - $data_keys = array_keys( $data ); |
|
| 183 | - $column_formats = array_merge( array_flip( $data_keys ), $column_formats ); |
|
| 182 | + $data_keys = array_keys($data); |
|
| 183 | + $column_formats = array_merge(array_flip($data_keys), $column_formats); |
|
| 184 | 184 | |
| 185 | - if ( false === $wpdb->update( $this->table_name, $data, array( $where => $row_id ), $column_formats ) ) { |
|
| 185 | + if (false === $wpdb->update($this->table_name, $data, array($where => $row_id), $column_formats)) { |
|
| 186 | 186 | return false; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -196,18 +196,18 @@ discard block |
||
| 196 | 196 | * @since 1.0.0 |
| 197 | 197 | * @return bool |
| 198 | 198 | */ |
| 199 | - public function delete( $row_id = 0 ) { |
|
| 199 | + public function delete($row_id = 0) { |
|
| 200 | 200 | |
| 201 | 201 | global $wpdb; |
| 202 | 202 | |
| 203 | 203 | // Row ID must be positive integer |
| 204 | - $row_id = absint( $row_id ); |
|
| 204 | + $row_id = absint($row_id); |
|
| 205 | 205 | |
| 206 | - if( empty( $row_id ) ) { |
|
| 206 | + if (empty($row_id)) { |
|
| 207 | 207 | return false; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - if ( false === $wpdb->query( $wpdb->prepare( "DELETE FROM $this->table_name WHERE $this->primary_key = %d", $row_id ) ) ) { |
|
| 210 | + if (false === $wpdb->query($wpdb->prepare("DELETE FROM $this->table_name WHERE $this->primary_key = %d", $row_id))) { |
|
| 211 | 211 | return false; |
| 212 | 212 | } |
| 213 | 213 | |
@@ -221,11 +221,11 @@ discard block |
||
| 221 | 221 | * @param string $table The table name |
| 222 | 222 | * @return bool If the table name exists |
| 223 | 223 | */ |
| 224 | - public function table_exists( $table ) { |
|
| 224 | + public function table_exists($table) { |
|
| 225 | 225 | global $wpdb; |
| 226 | - $table = sanitize_text_field( $table ); |
|
| 226 | + $table = sanitize_text_field($table); |
|
| 227 | 227 | |
| 228 | - return $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE '%s'", $table ) ) === $table; |
|
| 228 | + return $wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE '%s'", $table)) === $table; |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | * @return bool Returns if the customers table was installed and upgrade routine run |
| 236 | 236 | */ |
| 237 | 237 | public function installed() { |
| 238 | - return $this->table_exists( $this->table_name ); |
|
| 238 | + return $this->table_exists($this->table_name); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | } |
@@ -1,25 +1,25 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | // don't load directly |
| 3 | -if ( !defined('ABSPATH') ) |
|
| 3 | +if (!defined('ABSPATH')) |
|
| 4 | 4 | die('-1'); |
| 5 | 5 | |
| 6 | 6 | // Load colours |
| 7 | -$bg = wpinv_get_option( 'email_background_color', '#f5f5f5' ); |
|
| 8 | -$body = wpinv_get_option( 'email_body_background_color', '#fdfdfd' ); |
|
| 9 | -$base = wpinv_get_option( 'email_base_color', '#557da2' ); |
|
| 10 | -$base_text = wpinv_light_or_dark( $base, '#202020', '#ffffff' ); |
|
| 11 | -$text = wpinv_get_option( 'email_text_color', '#505050' ); |
|
| 7 | +$bg = wpinv_get_option('email_background_color', '#f5f5f5'); |
|
| 8 | +$body = wpinv_get_option('email_body_background_color', '#fdfdfd'); |
|
| 9 | +$base = wpinv_get_option('email_base_color', '#557da2'); |
|
| 10 | +$base_text = wpinv_light_or_dark($base, '#202020', '#ffffff'); |
|
| 11 | +$text = wpinv_get_option('email_text_color', '#505050'); |
|
| 12 | 12 | |
| 13 | -$bg_darker_10 = wpinv_hex_darker( $bg, 10 ); |
|
| 14 | -$body_darker_10 = wpinv_hex_darker( $body, 10 ); |
|
| 15 | -$base_lighter_20 = wpinv_hex_lighter( $base, 20 ); |
|
| 16 | -$base_lighter_40 = wpinv_hex_lighter( $base, 40 ); |
|
| 17 | -$text_lighter_20 = wpinv_hex_lighter( $text, 20 ); |
|
| 13 | +$bg_darker_10 = wpinv_hex_darker($bg, 10); |
|
| 14 | +$body_darker_10 = wpinv_hex_darker($body, 10); |
|
| 15 | +$base_lighter_20 = wpinv_hex_lighter($base, 20); |
|
| 16 | +$base_lighter_40 = wpinv_hex_lighter($base, 40); |
|
| 17 | +$text_lighter_20 = wpinv_hex_lighter($text, 20); |
|
| 18 | 18 | |
| 19 | 19 | // !important; is a gmail hack to prevent styles being stripped if it doesn't like something. |
| 20 | 20 | ?> |
| 21 | 21 | #wrapper { |
| 22 | - background-color: <?php echo esc_attr( $bg ); ?>; |
|
| 22 | + background-color: <?php echo esc_attr($bg); ?>; |
|
| 23 | 23 | margin: 0; |
| 24 | 24 | -webkit-text-size-adjust: none !important; |
| 25 | 25 | padding: 3%; |
@@ -40,15 +40,15 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | #template_container { |
| 42 | 42 | box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important; |
| 43 | - background-color: <?php echo esc_attr( $body ); ?>; |
|
| 44 | - border: 1px solid <?php echo esc_attr( $bg_darker_10 ); ?>; |
|
| 43 | + background-color: <?php echo esc_attr($body); ?>; |
|
| 44 | + border: 1px solid <?php echo esc_attr($bg_darker_10); ?>; |
|
| 45 | 45 | border-radius: 3px !important; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | #template_header { |
| 49 | - background-color: <?php echo esc_attr( $base ); ?>; |
|
| 49 | + background-color: <?php echo esc_attr($base); ?>; |
|
| 50 | 50 | border-radius: 3px 3px 0 0 !important; |
| 51 | - color: <?php echo esc_attr( $base_text ); ?>; |
|
| 51 | + color: <?php echo esc_attr($base_text); ?>; |
|
| 52 | 52 | border-bottom: 0; |
| 53 | 53 | font-weight: bold; |
| 54 | 54 | line-height: 100%; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | #template_header h1 { |
| 64 | - color: <?php echo esc_attr( $base_text ); ?>; |
|
| 64 | + color: <?php echo esc_attr($base_text); ?>; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | #template_footer td { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | #template_footer #credit { |
| 74 | 74 | border:0; |
| 75 | - color: <?php echo esc_attr( $base_lighter_40 ); ?>; |
|
| 75 | + color: <?php echo esc_attr($base_lighter_40); ?>; |
|
| 76 | 76 | font-family: Arial; |
| 77 | 77 | font-size:12px; |
| 78 | 78 | line-height:125%; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | #body_content { |
| 84 | - background-color: <?php echo esc_attr( $body ); ?>; |
|
| 84 | + background-color: <?php echo esc_attr($body); ?>; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | #body_content table td { |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | #body_content_inner { |
| 104 | - color: <?php echo esc_attr( $text_lighter_20 ); ?>; |
|
| 104 | + color: <?php echo esc_attr($text_lighter_20); ?>; |
|
| 105 | 105 | font-family: Arial,Helvetica,sans-serif; |
| 106 | 106 | font-size: 14px; |
| 107 | 107 | line-height: 150%; |
@@ -109,17 +109,17 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | .td { |
| 112 | - color: <?php echo esc_attr( $text_lighter_20 ); ?>; |
|
| 113 | - border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>; |
|
| 112 | + color: <?php echo esc_attr($text_lighter_20); ?>; |
|
| 113 | + border: 1px solid <?php echo esc_attr($body_darker_10); ?>; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | .text { |
| 117 | - color: <?php echo esc_attr( $text ); ?>; |
|
| 117 | + color: <?php echo esc_attr($text); ?>; |
|
| 118 | 118 | font-family: Arial,Helvetica,sans-serif; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | .link { |
| 122 | - color: <?php echo esc_attr( $base ); ?>; |
|
| 122 | + color: <?php echo esc_attr($base); ?>; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | #header_wrapper { |
@@ -128,19 +128,19 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | h1 { |
| 131 | - color: <?php echo esc_attr( $base ); ?>; |
|
| 131 | + color: <?php echo esc_attr($base); ?>; |
|
| 132 | 132 | font-family: Arial,Helvetica,sans-serif; |
| 133 | 133 | font-size: 30px; |
| 134 | 134 | font-weight: 300; |
| 135 | 135 | line-height: 150%; |
| 136 | 136 | margin: 0; |
| 137 | 137 | text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; |
| 138 | - text-shadow: 0 1px 0 <?php echo esc_attr( $base_lighter_20 ); ?>; |
|
| 138 | + text-shadow: 0 1px 0 <?php echo esc_attr($base_lighter_20); ?>; |
|
| 139 | 139 | -webkit-font-smoothing: antialiased; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | h2 { |
| 143 | - color: <?php echo esc_attr( $base ); ?>; |
|
| 143 | + color: <?php echo esc_attr($base); ?>; |
|
| 144 | 144 | display: block; |
| 145 | 145 | font-family: Arial,Helvetica,sans-serif; |
| 146 | 146 | font-size: 18px; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | h3 { |
| 154 | - color: <?php echo esc_attr( $base ); ?>; |
|
| 154 | + color: <?php echo esc_attr($base); ?>; |
|
| 155 | 155 | display: block; |
| 156 | 156 | font-family: Arial,Helvetica,sans-serif; |
| 157 | 157 | font-size: 16px; |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | a { |
| 165 | - color: <?php echo esc_attr( $base ); ?>; |
|
| 165 | + color: <?php echo esc_attr($base); ?>; |
|
| 166 | 166 | font-weight: normal; |
| 167 | 167 | text-decoration: underline; |
| 168 | 168 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | .table-bordered { |
| 183 | - border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>; |
|
| 183 | + border: 1px solid <?php echo esc_attr($body_darker_10); ?>; |
|
| 184 | 184 | border-collapse: collapse; |
| 185 | 185 | border-spacing: 0; |
| 186 | 186 | width: 100%; |
@@ -188,8 +188,8 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | .table-bordered th, |
| 190 | 190 | .table-bordered td { |
| 191 | - border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>; |
|
| 192 | - color: <?php echo esc_attr( $text_lighter_20 ); ?>; |
|
| 191 | + border: 1px solid <?php echo esc_attr($body_darker_10); ?>; |
|
| 192 | + color: <?php echo esc_attr($text_lighter_20); ?>; |
|
| 193 | 193 | font-size: 14px; |
| 194 | 194 | } |
| 195 | 195 | .small { |
@@ -288,9 +288,9 @@ discard block |
||
| 288 | 288 | text-decoration: none; |
| 289 | 289 | } |
| 290 | 290 | .btn-default { |
| 291 | - color: <?php echo esc_attr( $base_text ); ?>; |
|
| 292 | - background-color: <?php echo esc_attr( $base ); ?>; |
|
| 293 | - border-color: <?php echo esc_attr( $base ); ?>; |
|
| 291 | + color: <?php echo esc_attr($base_text); ?>; |
|
| 292 | + background-color: <?php echo esc_attr($base); ?>; |
|
| 293 | + border-color: <?php echo esc_attr($base); ?>; |
|
| 294 | 294 | } |
| 295 | 295 | .btn-primary { |
| 296 | 296 | color: #fff; |
@@ -9,58 +9,58 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | // If uninstall not called from WordPress, then exit. |
| 12 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
| 12 | +if (!defined('WP_UNINSTALL_PLUGIN')) { |
|
| 13 | 13 | exit; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | global $wpdb, $wp_version; |
| 17 | 17 | |
| 18 | -$remove_data = get_option( 'wpinv_remove_data_on_invoice_unistall' ); |
|
| 18 | +$remove_data = get_option('wpinv_remove_data_on_invoice_unistall'); |
|
| 19 | 19 | |
| 20 | 20 | /* |
| 21 | 21 | * Only remove ALL product and page data if WPINV_REMOVE_ALL_DATA constant is set to true in user's |
| 22 | 22 | * wp-config.php. This is to prevent data loss when deleting the plugin from the backend |
| 23 | 23 | * and to ensure only the site owner can perform this action. |
| 24 | 24 | */ |
| 25 | -if ( defined( 'WPINV_REMOVE_ALL_DATA' ) ) { |
|
| 25 | +if (defined('WPINV_REMOVE_ALL_DATA')) { |
|
| 26 | 26 | $remove_data = true === WPINV_REMOVE_ALL_DATA ? true : false; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | -if ( $remove_data ) { |
|
| 29 | +if ($remove_data) { |
|
| 30 | 30 | // Load Invoicing file. |
| 31 | - include_once( 'invoicing.php' ); |
|
| 31 | + include_once('invoicing.php'); |
|
| 32 | 32 | |
| 33 | 33 | // Roles + caps. |
| 34 | - include_once( dirname( __FILE__ ) . '/includes/admin/install.php' ); |
|
| 34 | + include_once(dirname(__FILE__) . '/includes/admin/install.php'); |
|
| 35 | 35 | wpinv_remove_admin_caps(); |
| 36 | 36 | |
| 37 | - $settings = get_option( 'wpinv_settings' ); |
|
| 37 | + $settings = get_option('wpinv_settings'); |
|
| 38 | 38 | |
| 39 | 39 | // Delete pages. |
| 40 | - $wpi_pages = array( 'checkout_page', 'success_page', 'failure_page', 'invoice_history_page', 'quote_history_page', 'invoice_subscription_page' ); |
|
| 41 | - foreach ( $wpi_pages as $page ) { |
|
| 42 | - if ( !empty( $page ) && !empty( $settings[ $page ] ) ) { |
|
| 43 | - wp_delete_post( $settings[ $page ], true ); |
|
| 40 | + $wpi_pages = array('checkout_page', 'success_page', 'failure_page', 'invoice_history_page', 'quote_history_page', 'invoice_subscription_page'); |
|
| 41 | + foreach ($wpi_pages as $page) { |
|
| 42 | + if (!empty($page) && !empty($settings[$page])) { |
|
| 43 | + wp_delete_post($settings[$page], true); |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | // Delete posts + data. |
| 48 | - $wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'wpi_invoice', 'wpi_item', 'wpi_discount', 'wpi_quote' );" ); |
|
| 49 | - $wpdb->query( "DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;" ); |
|
| 48 | + $wpdb->query("DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'wpi_invoice', 'wpi_item', 'wpi_discount', 'wpi_quote' );"); |
|
| 49 | + $wpdb->query("DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;"); |
|
| 50 | 50 | |
| 51 | 51 | // Delete comments. |
| 52 | - $wpdb->query( "DELETE FROM {$wpdb->comments} WHERE comment_type LIKE 'wpinv_note';" ); |
|
| 53 | - $wpdb->query( "DELETE meta FROM {$wpdb->commentmeta} meta LEFT JOIN {$wpdb->comments} comments ON comments.comment_ID = meta.comment_id WHERE comments.comment_ID IS NULL;" ); |
|
| 52 | + $wpdb->query("DELETE FROM {$wpdb->comments} WHERE comment_type LIKE 'wpinv_note';"); |
|
| 53 | + $wpdb->query("DELETE meta FROM {$wpdb->commentmeta} meta LEFT JOIN {$wpdb->comments} comments ON comments.comment_ID = meta.comment_id WHERE comments.comment_ID IS NULL;"); |
|
| 54 | 54 | |
| 55 | 55 | // Delete user meta. |
| 56 | - $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '%_wpinv_%' OR meta_key LIKE '%_wpi_invoice%' OR meta_key LIKE '%_wpi_item%' OR meta_key LIKE '%_wpi_discount%' OR meta_key LIKE '_wpi_stripe%' OR meta_key LIKE '%_wpi_quote%';" ); |
|
| 56 | + $wpdb->query("DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE '%_wpinv_%' OR meta_key LIKE '%_wpi_invoice%' OR meta_key LIKE '%_wpi_item%' OR meta_key LIKE '%_wpi_discount%' OR meta_key LIKE '_wpi_stripe%' OR meta_key LIKE '%_wpi_quote%';"); |
|
| 57 | 57 | |
| 58 | 58 | // Cleanup Cron Schedule |
| 59 | - wp_clear_scheduled_hook( 'wp_session_garbage_collection' ); |
|
| 60 | - wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' ); |
|
| 59 | + wp_clear_scheduled_hook('wp_session_garbage_collection'); |
|
| 60 | + wp_clear_scheduled_hook('wpinv_register_schedule_event_twicedaily'); |
|
| 61 | 61 | |
| 62 | 62 | // Delete options. |
| 63 | - $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpinv_%' OR option_name LIKE '_wpinv_%' OR option_name LIKE '\_transient\_wpinv\_%';" ); |
|
| 63 | + $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpinv_%' OR option_name LIKE '_wpinv_%' OR option_name LIKE '\_transient\_wpinv\_%';"); |
|
| 64 | 64 | |
| 65 | 65 | // Clear any cached data that has been removed |
| 66 | 66 | wp_cache_flush(); |
@@ -1,68 +1,68 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // don't load directly |
| 3 | -if ( !defined('ABSPATH') ) |
|
| 3 | +if (!defined('ABSPATH')) |
|
| 4 | 4 | die('-1'); |
| 5 | 5 | |
| 6 | 6 | global $wpinv_euvat; |
| 7 | 7 | |
| 8 | -$sent_to_admin = !empty( $sent_to_admin ) ? true : false; |
|
| 9 | -$invoice_url = $invoice->get_view_url( true ); |
|
| 8 | +$sent_to_admin = !empty($sent_to_admin) ? true : false; |
|
| 9 | +$invoice_url = $invoice->get_view_url(true); |
|
| 10 | 10 | $use_taxes = wpinv_use_taxes(); |
| 11 | 11 | $vat_name = $wpinv_euvat->get_vat_name(); |
| 12 | 12 | |
| 13 | -do_action( 'wpinv_email_before_invoice_details', $invoice, $sent_to_admin ); ?> |
|
| 13 | +do_action('wpinv_email_before_invoice_details', $invoice, $sent_to_admin); ?> |
|
| 14 | 14 | <div id="wpinv-email-details"> |
| 15 | - <h3 class="wpinv-details-t"><?php echo apply_filters( 'wpinv_email_details_title', __( 'Invoice Details', 'invoicing' ), $invoice ); ?></h3> |
|
| 15 | + <h3 class="wpinv-details-t"><?php echo apply_filters('wpinv_email_details_title', __('Invoice Details', 'invoicing'), $invoice); ?></h3> |
|
| 16 | 16 | <table class="table table-bordered table-sm"> |
| 17 | - <?php if ( $invoice_number = $invoice->get_number() ) { ?> |
|
| 17 | + <?php if ($invoice_number = $invoice->get_number()) { ?> |
|
| 18 | 18 | <tr> |
| 19 | - <td><?php echo apply_filters( 'wpinv_invoice_number_label', __( 'Invoice Number', 'invoicing' ), $invoice ); ?></td> |
|
| 20 | - <td><a href="<?php echo esc_url( $invoice_url ) ;?>"><?php echo $invoice_number; ?></a></td> |
|
| 19 | + <td><?php echo apply_filters('wpinv_invoice_number_label', __('Invoice Number', 'invoicing'), $invoice); ?></td> |
|
| 20 | + <td><a href="<?php echo esc_url($invoice_url); ?>"><?php echo $invoice_number; ?></a></td> |
|
| 21 | 21 | </tr> |
| 22 | 22 | <?php } ?> |
| 23 | 23 | <tr> |
| 24 | - <td><?php echo apply_filters( 'wpinv_invoice_status_label', __( 'Invoice Status', 'invoicing' ), $invoice ); ?></td> |
|
| 25 | - <td><?php echo $invoice->get_status( true ); ?></td> |
|
| 24 | + <td><?php echo apply_filters('wpinv_invoice_status_label', __('Invoice Status', 'invoicing'), $invoice); ?></td> |
|
| 25 | + <td><?php echo $invoice->get_status(true); ?></td> |
|
| 26 | 26 | </tr> |
| 27 | - <?php if ( $invoice->is_renewal() ) { ?> |
|
| 27 | + <?php if ($invoice->is_renewal()) { ?> |
|
| 28 | 28 | <tr> |
| 29 | - <td><?php echo apply_filters( 'wpinv_invoice_parent_invoice_label', __( 'Parent Invoice', 'invoicing' ), $invoice ); ?></td> |
|
| 30 | - <td><?php echo wpinv_invoice_link( $invoice->parent_invoice ); ?></td> |
|
| 29 | + <td><?php echo apply_filters('wpinv_invoice_parent_invoice_label', __('Parent Invoice', 'invoicing'), $invoice); ?></td> |
|
| 30 | + <td><?php echo wpinv_invoice_link($invoice->parent_invoice); ?></td> |
|
| 31 | 31 | </tr> |
| 32 | 32 | <?php } ?> |
| 33 | - <?php if ( ( $gateway_title = $invoice->get_gateway_title() ) && ( $invoice->is_paid() || $invoice->is_refunded() ) ) { ?> |
|
| 34 | - <td><?php echo apply_filters( 'wpinv_invoice_payment_method_label', __( 'Payment Method', 'invoicing' ), $invoice ); ?></td> |
|
| 33 | + <?php if (($gateway_title = $invoice->get_gateway_title()) && ($invoice->is_paid() || $invoice->is_refunded())) { ?> |
|
| 34 | + <td><?php echo apply_filters('wpinv_invoice_payment_method_label', __('Payment Method', 'invoicing'), $invoice); ?></td> |
|
| 35 | 35 | <td><?php echo $gateway_title; ?></td> |
| 36 | 36 | <?php } ?> |
| 37 | - <?php if ( $invoice_date = $invoice->get_invoice_date( false ) ) { ?> |
|
| 37 | + <?php if ($invoice_date = $invoice->get_invoice_date(false)) { ?> |
|
| 38 | 38 | <tr> |
| 39 | - <td><?php echo apply_filters( 'wpinv_invoice_date_label', __( 'Invoice Date', 'invoicing' ), $invoice ); ?></td> |
|
| 40 | - <td><?php echo wp_sprintf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $invoice_date ) ), $invoice->get_invoice_date() ); ?></td> |
|
| 39 | + <td><?php echo apply_filters('wpinv_invoice_date_label', __('Invoice Date', 'invoicing'), $invoice); ?></td> |
|
| 40 | + <td><?php echo wp_sprintf('<time datetime="%s">%s</time>', date_i18n('c', strtotime($invoice_date)), $invoice->get_invoice_date()); ?></td> |
|
| 41 | 41 | </tr> |
| 42 | 42 | <?php } ?> |
| 43 | - <?php if ( wpinv_get_option( 'overdue_active' ) && $invoice->needs_payment() && ( $due_date = $invoice->get_due_date() ) ) { ?> |
|
| 43 | + <?php if (wpinv_get_option('overdue_active') && $invoice->needs_payment() && ($due_date = $invoice->get_due_date())) { ?> |
|
| 44 | 44 | <tr> |
| 45 | - <td><?php echo apply_filters( 'wpinv_invoice_due_date_label', __( 'Due Date', 'invoicing' ), $invoice ); ?></td> |
|
| 46 | - <td><?php echo wp_sprintf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $due_date ) ), $invoice->get_due_date( true ) ); ?></td> |
|
| 45 | + <td><?php echo apply_filters('wpinv_invoice_due_date_label', __('Due Date', 'invoicing'), $invoice); ?></td> |
|
| 46 | + <td><?php echo wp_sprintf('<time datetime="%s">%s</time>', date_i18n('c', strtotime($due_date)), $invoice->get_due_date(true)); ?></td> |
|
| 47 | 47 | </tr> |
| 48 | 48 | <?php } ?> |
| 49 | - <?php do_action( 'wpinv_email_invoice_details_after_due_date', $invoice->ID ); ?> |
|
| 50 | - <?php if ( empty( $sent_to_admin ) && ( $owner_vat_number = $wpinv_euvat->get_vat_number() ) ) { ?> |
|
| 49 | + <?php do_action('wpinv_email_invoice_details_after_due_date', $invoice->ID); ?> |
|
| 50 | + <?php if (empty($sent_to_admin) && ($owner_vat_number = $wpinv_euvat->get_vat_number())) { ?> |
|
| 51 | 51 | <tr> |
| 52 | - <td><?php echo apply_filters( 'wpinv_invoice_owner_vat_number_label', wp_sprintf( __( 'Owner %s Number', 'invoicing' ), $vat_name ), $invoice, $vat_name ); ?></td> |
|
| 52 | + <td><?php echo apply_filters('wpinv_invoice_owner_vat_number_label', wp_sprintf(__('Owner %s Number', 'invoicing'), $vat_name), $invoice, $vat_name); ?></td> |
|
| 53 | 53 | <td><?php echo $owner_vat_number; ?></td> |
| 54 | 54 | </tr> |
| 55 | 55 | <?php } ?> |
| 56 | - <?php if ( $use_taxes && ( $user_vat_number = $invoice->vat_number ) ) { ?> |
|
| 56 | + <?php if ($use_taxes && ($user_vat_number = $invoice->vat_number)) { ?> |
|
| 57 | 57 | <tr> |
| 58 | - <td><?php echo apply_filters( 'wpinv_invoice_user_vat_number_label', wp_sprintf( __( 'Invoice %s Number', 'invoicing' ), $vat_name ), $invoice, $vat_name ); ?></td> |
|
| 58 | + <td><?php echo apply_filters('wpinv_invoice_user_vat_number_label', wp_sprintf(__('Invoice %s Number', 'invoicing'), $vat_name), $invoice, $vat_name); ?></td> |
|
| 59 | 59 | <td><?php echo $user_vat_number; ?></td> |
| 60 | 60 | </tr> |
| 61 | 61 | <?php } ?> |
| 62 | 62 | <tr class="table-active"> |
| 63 | - <td><strong><?php _e( 'Total Amount', 'invoicing' ) ?></strong></td> |
|
| 64 | - <td><strong><?php echo $invoice->get_total( true ); ?></strong></td> |
|
| 63 | + <td><strong><?php _e('Total Amount', 'invoicing') ?></strong></td> |
|
| 64 | + <td><strong><?php echo $invoice->get_total(true); ?></strong></td> |
|
| 65 | 65 | </tr> |
| 66 | 66 | </table> |
| 67 | 67 | </div> |
| 68 | -<?php do_action( 'wpinv_email_after_invoice_details', $invoice, $sent_to_admin ); ?> |
|
| 69 | 68 | \ No newline at end of file |
| 69 | +<?php do_action('wpinv_email_after_invoice_details', $invoice, $sent_to_admin); ?> |
|
| 70 | 70 | \ No newline at end of file |
@@ -1,18 +1,18 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // don't load directly |
| 3 | -if ( !defined('ABSPATH') ) |
|
| 3 | +if (!defined('ABSPATH')) |
|
| 4 | 4 | die('-1'); |
| 5 | 5 | |
| 6 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 6 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 7 | 7 | |
| 8 | -if ( ! empty( $message_body ) ) { |
|
| 9 | - echo wpautop( wptexturize( $message_body ) ); |
|
| 8 | +if (!empty($message_body)) { |
|
| 9 | + echo wpautop(wptexturize($message_body)); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 12 | +do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin); |
|
| 13 | 13 | |
| 14 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 14 | +do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin); |
|
| 15 | 15 | |
| 16 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 16 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 17 | 17 | |
| 18 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 19 | 18 | \ No newline at end of file |
| 19 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
| 20 | 20 | \ No newline at end of file |