Passed
Push — master ( 85f73b...944635 )
by Stiofan
03:51 queued 48s
created
templates/wpinv-invoice-history.php 1 patch
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -94,12 +94,13 @@
 block discarded – undo
94 94
 			$big = 999999;
95 95
 			$wpinv_cpt = isset($_REQUEST['wpinv-cpt']) ? $_REQUEST['wpinv-cpt'] : '';
96 96
 
97
-			if (get_query_var('paged') && 'wpi_invoice' == $wpinv_cpt)
98
-				$current_page = get_query_var('paged');
99
-			elseif (get_query_var('page') && 'wpi_invoice' == $wpinv_cpt)
100
-				$current_page = get_query_var('page');
101
-			else
102
-				$current_page = 1;
97
+			if (get_query_var('paged') && 'wpi_invoice' == $wpinv_cpt) {
98
+							$current_page = get_query_var('paged');
99
+			} elseif (get_query_var('page') && 'wpi_invoice' == $wpinv_cpt) {
100
+							$current_page = get_query_var('page');
101
+			} else {
102
+							$current_page = 1;
103
+			}
103 104
 
104 105
 			echo paginate_links( array(
105 106
 				'base'    => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
Please login to merge, or discard this patch.
includes/wpinv-invoice-functions.php 1 patch
Braces   +21 added lines, -16 removed lines patch added patch discarded remove patch
@@ -311,8 +311,9 @@  discard block
 block discarded – undo
311 311
 
312 312
     $invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_transaction_id' AND meta_value = %s LIMIT 1", $key ) );
313 313
 
314
-    if ( $invoice_id != NULL )
315
-        return $invoice_id;
314
+    if ( $invoice_id != NULL ) {
315
+            return $invoice_id;
316
+    }
316 317
 
317 318
     return 0;
318 319
 }
@@ -992,8 +993,9 @@  discard block
 block discarded – undo
992 993
 function wpinv_checkout_validate_cc_zip( $zip = 0, $country_code = '' ) {
993 994
     $ret = false;
994 995
 
995
-    if ( empty( $zip ) || empty( $country_code ) )
996
-        return $ret;
996
+    if ( empty( $zip ) || empty( $country_code ) ) {
997
+            return $ret;
998
+    }
997 999
 
998 1000
     $country_code = strtoupper( $country_code );
999 1001
 
@@ -1155,8 +1157,9 @@  discard block
 block discarded – undo
1155 1157
         "ZM" => "\d{5}"
1156 1158
     );
1157 1159
 
1158
-    if ( ! isset ( $zip_regex[ $country_code ] ) || preg_match( "/" . $zip_regex[ $country_code ] . "/i", $zip ) )
1159
-        $ret = true;
1160
+    if ( ! isset ( $zip_regex[ $country_code ] ) || preg_match( "/" . $zip_regex[ $country_code ] . "/i", $zip ) ) {
1161
+            $ret = true;
1162
+    }
1160 1163
 
1161 1164
     return apply_filters( 'wpinv_is_zip_valid', $ret, $zip, $country_code );
1162 1165
 }
@@ -1482,14 +1485,15 @@  discard block
 block discarded – undo
1482 1485
 
1483 1486
     $wpinv_cpt = isset( $_REQUEST[ 'wpinv-cpt' ] ) ? $_REQUEST[ 'wpinv-cpt' ] : '';
1484 1487
 
1485
-    if ( get_query_var( 'paged' ) && 'wpi_invoice' == $wpinv_cpt )
1486
-        $args['page'] = get_query_var('paged');
1487
-    else if ( get_query_var( 'page' )  && 'wpi_invoice' == $wpinv_cpt )
1488
-        $args['page'] = get_query_var( 'page' );
1489
-    else if ( !empty( $args[ 'page' ] ) )
1490
-        $args['page'] = $args[ 'page' ];
1491
-    else
1492
-        $args['page'] = 1;
1488
+    if ( get_query_var( 'paged' ) && 'wpi_invoice' == $wpinv_cpt ) {
1489
+            $args['page'] = get_query_var('paged');
1490
+    } else if ( get_query_var( 'page' )  && 'wpi_invoice' == $wpinv_cpt ) {
1491
+            $args['page'] = get_query_var( 'page' );
1492
+    } else if ( !empty( $args[ 'page' ] ) ) {
1493
+            $args['page'] = $args[ 'page' ];
1494
+    } else {
1495
+            $args['page'] = 1;
1496
+    }
1493 1497
 
1494 1498
     /**
1495 1499
      * Generate WP_Query args. This logic will change if orders are moved to
@@ -1624,8 +1628,9 @@  discard block
 block discarded – undo
1624 1628
 
1625 1629
 	$invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_key' AND meta_value = %s LIMIT 1", $key ) );
1626 1630
 
1627
-	if ( $invoice_id != NULL )
1628
-		return $invoice_id;
1631
+	if ( $invoice_id != NULL ) {
1632
+			return $invoice_id;
1633
+	}
1629 1634
 
1630 1635
 	return 0;
1631 1636
 }
Please login to merge, or discard this patch.