| @@ -4,7 +4,9 @@ discard block | ||
| 4 | 4 | //set_site_transient( 'update_plugins', null ); | 
| 5 | 5 | |
| 6 | 6 | // Exit if accessed directly | 
| 7 | -if ( ! defined( 'ABSPATH' ) ) exit; | |
| 7 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 8 | + exit; | |
| 9 | +} | |
| 8 | 10 | |
| 9 | 11 | /** | 
| 10 | 12 | * Allows plugins to use their own update API. | 
| @@ -273,11 +275,13 @@ discard block | ||
| 273 | 275 | |
| 274 | 276 | $data = array_merge( $this->api_data, $_data ); | 
| 275 | 277 | |
| 276 | - if ( $data['slug'] != $this->slug ) | |
| 277 | - return; | |
| 278 | +        if ( $data['slug'] != $this->slug ) { | |
| 279 | + return; | |
| 280 | + } | |
| 278 | 281 | |
| 279 | - if ( empty( $data['license'] ) ) | |
| 280 | - return; | |
| 282 | +        if ( empty( $data['license'] ) ) { | |
| 283 | + return; | |
| 284 | + } | |
| 281 | 285 | |
| 282 | 286 |          if( $this->api_url == home_url() ) { | 
| 283 | 287 | return false; // Don't allow a plugin to ping itself | 
| @@ -10,7 +10,9 @@ discard block | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) exit; | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit; | |
| 15 | +} | |
| 14 | 16 | |
| 15 | 17 | /** | 
| 16 | 18 | * Payment History Page | 
| @@ -63,11 +65,13 @@ discard block | ||
| 63 | 65 | */ | 
| 64 | 66 |  function give_view_order_details_title( $admin_title, $title ) { | 
| 65 | 67 | |
| 66 | - if ( 'give_forms_page_give-payment-history' != get_current_screen()->base ) | |
| 67 | - return $admin_title; | |
| 68 | +	if ( 'give_forms_page_give-payment-history' != get_current_screen()->base ) { | |
| 69 | + return $admin_title; | |
| 70 | + } | |
| 68 | 71 | |
| 69 | - if( ! isset( $_GET['give-action'] ) ) | |
| 70 | - return $admin_title; | |
| 72 | +	if( ! isset( $_GET['give-action'] ) ) { | |
| 73 | + return $admin_title; | |
| 74 | + } | |
| 71 | 75 | |
| 72 | 76 | switch( $_GET['give-action'] ) : | 
| 73 | 77 | |
| @@ -99,11 +103,13 @@ discard block | ||
| 99 | 103 |  function give_override_edit_post_for_payment_link( $url, $post_id = 0, $context ) { | 
| 100 | 104 | |
| 101 | 105 | $post = get_post( $post_id ); | 
| 102 | - if( ! $post ) | |
| 103 | - return $url; | |
| 106 | +	if( ! $post ) { | |
| 107 | + return $url; | |
| 108 | + } | |
| 104 | 109 | |
| 105 | - if( 'give_payment' != $post->post_type ) | |
| 106 | - return $url; | |
| 110 | +	if( 'give_payment' != $post->post_type ) { | |
| 111 | + return $url; | |
| 112 | + } | |
| 107 | 113 | |
| 108 | 114 | $url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $post_id ); | 
| 109 | 115 | |
| @@ -440,8 +440,10 @@ | ||
| 440 | 440 | echo give_get_payment_note_html( $note, $payment_id ); | 
| 441 | 441 | |
| 442 | 442 | endforeach; | 
| 443 | - else : | |
| 443 | +										else { | |
| 444 | + : | |
| 444 | 445 | $no_notes_display = ''; | 
| 446 | + } | |
| 445 | 447 | endif; | 
| 446 | 448 | echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . __( 'No payment notes', 'give' ) . '</p>'; | 
| 447 | 449 | ?> | 
| @@ -143,9 +143,11 @@ discard block | ||
| 143 | 143 | |
| 144 | 144 | endwhile; | 
| 145 | 145 | |
| 146 | - else : | |
| 146 | +				else { | |
| 147 | + : | |
| 147 | 148 | |
| 148 | 149 | $sales = give_get_sales_by_date( null, $i, $y ); | 
| 150 | + } | |
| 149 | 151 | $sales_totals += $sales; | 
| 150 | 152 | |
| 151 | 153 | $earnings = give_get_earnings_by_date( null, $i, $y ); | 
| @@ -393,9 +395,11 @@ discard block | ||
| 393 | 395 | |
| 394 | 396 | endwhile; | 
| 395 | 397 | |
| 396 | - else : | |
| 398 | +				else { | |
| 399 | + : | |
| 397 | 400 | |
| 398 | 401 | $num_of_days = cal_days_in_month( CAL_GREGORIAN, $i, $y ); | 
| 402 | + } | |
| 399 | 403 | |
| 400 | 404 | $date = mktime( 0, 0, 0, $i, 1, $y ); | 
| 401 | 405 | $end_date = mktime( 23, 59, 59, $i, $num_of_days, $y ); | 
| @@ -124,8 +124,10 @@ | ||
| 124 | 124 | |
| 125 | 125 | $pdf->Row( array( $title, $price, $categories, $tags, $sales, $earnings ) ); | 
| 126 | 126 | endforeach; | 
| 127 | - else: | |
| 127 | +	else { | |
| 128 | + : | |
| 128 | 129 | $pdf->SetWidths( array( 280 ) ); | 
| 130 | + } | |
| 129 | 131 | $title = utf8_decode( sprintf( __( 'No %s found.', 'give' ), give_get_forms_label_plural() ) ); | 
| 130 | 132 | $pdf->Row( array( $title ) ); | 
| 131 | 133 | endif; | 
| @@ -10,7 +10,9 @@ | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) exit; | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit; | |
| 15 | +} | |
| 14 | 16 | |
| 15 | 17 | /** | 
| 16 | 18 | * Give_API_V1 Class | 
| @@ -10,7 +10,9 @@ | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly | 
| 13 | -if ( ! defined( 'ABSPATH' ) ) exit; | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit; | |
| 15 | +} | |
| 14 | 16 | |
| 15 | 17 | /** | 
| 16 | 18 | * Give_API_V1 Class | 
| @@ -544,7 +544,7 @@ | ||
| 544 | 544 | |
| 545 | 545 |          if( $payment_total_diff > 0 ) { | 
| 546 | 546 | $this->increase_value( $payment_total_diff ); | 
| 547 | -        }else{ | |
| 547 | +        } else{ | |
| 548 | 548 | // Pass payment total difference as +ve value to decrease amount from user lifetime stat. | 
| 549 | 549 | $this->decrease_value( -$payment_total_diff ); | 
| 550 | 550 | } | 
| @@ -259,8 +259,11 @@ discard block | ||
| 259 | 259 | <span class="customer-user-id info-item editable"> | 
| 260 | 260 | <?php if ( intval( $customer->user_id ) > 0 ) : ?> | 
| 261 | 261 | <span data-key="user_id"><?php echo $customer->user_id; ?></span> | 
| 262 | - <?php else : ?> | |
| 263 | - <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span> | |
| 262 | +									<?php else { | |
| 263 | + : ?> | |
| 264 | + <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); | |
| 265 | +} | |
| 266 | +?></span> | |
| 264 | 267 | <?php endif; ?> | 
| 265 | 268 | <?php if ( current_user_can( $customer_edit_role ) && intval( $customer->user_id ) > 0 ) : ?> | 
| 266 | 269 | <span class="disconnect-user"> - <a id="disconnect-customer" href="#disconnect" title="<?php esc_attr_e( 'Disconnects the current user ID from this customer record', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span> | 
| @@ -329,8 +332,11 @@ discard block | ||
| 329 | 332 | } | 
| 330 | 333 | ?> | 
| 331 | 334 | </select> | 
| 332 | - <?php else : ?> | |
| 333 | - <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e( 'State / Province', 'give' ); ?>" /> | |
| 335 | +											<?php else { | |
| 336 | + : ?> | |
| 337 | + <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e( 'State / Province', 'give' ); | |
| 338 | +} | |
| 339 | +?>" /> | |
| 334 | 340 | <?php endif; ?> | 
| 335 | 341 | <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Postal', 'give' ); ?>" value="<?php echo $address['zip']; ?>" /> | 
| 336 | 342 | </span> | 
| @@ -420,9 +426,12 @@ discard block | ||
| 420 | 426 | </td> | 
| 421 | 427 | </tr> | 
| 422 | 428 | <?php endforeach; ?> | 
| 423 | - <?php else: ?> | |
| 429 | +			<?php else { | |
| 430 | + : ?> | |
| 424 | 431 | <tr> | 
| 425 | - <td colspan="5"><?php esc_html_e( 'No Donations Found', 'give' ); ?></td> | |
| 432 | + <td colspan="5"><?php esc_html_e( 'No Donations Found', 'give' ); | |
| 433 | +} | |
| 434 | +?></td> | |
| 426 | 435 | </tr> | 
| 427 | 436 | <?php endif; ?> | 
| 428 | 437 | </tbody> | 
| @@ -463,9 +472,12 @@ discard block | ||
| 463 | 472 | </td> | 
| 464 | 473 | </tr> | 
| 465 | 474 | <?php endforeach; ?> | 
| 466 | - <?php else: ?> | |
| 475 | +			<?php else { | |
| 476 | + : ?> | |
| 467 | 477 | <tr> | 
| 468 | - <td colspan="2"><?php esc_html_e( 'No Completed Donations Found', 'give' ); ?></td> | |
| 478 | + <td colspan="2"><?php esc_html_e( 'No Completed Donations Found', 'give' ); | |
| 479 | +} | |
| 480 | +?></td> | |
| 469 | 481 | </tr> | 
| 470 | 482 | <?php endif; ?> | 
| 471 | 483 | </tbody> | 
| @@ -539,9 +551,12 @@ discard block | ||
| 539 | 551 | </span> | 
| 540 | 552 | </div> | 
| 541 | 553 | <?php endforeach; ?> | 
| 542 | - <?php else: ?> | |
| 554 | +			<?php else { | |
| 555 | + : ?> | |
| 543 | 556 | <div class="give-no-customer-notes"> | 
| 544 | - <?php esc_html_e( 'No Donor Notes', 'give' ); ?> | |
| 557 | + <?php esc_html_e( 'No Donor Notes', 'give' ); | |
| 558 | +} | |
| 559 | +?> | |
| 545 | 560 | </div> | 
| 546 | 561 | <?php endif; ?> | 
| 547 | 562 | </div> |