@@ -10,13 +10,13 @@ discard block  | 
                                                    ||
| 10 | 10 | */  | 
                                                        
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly  | 
                                                        
| 13 | -if ( ! defined( 'ABSPATH' ) ) { | 
                                                        |
| 13 | +if ( ! defined('ABSPATH')) { | 
                                                        |
| 14 | 14 | exit;  | 
                                                        
| 15 | 15 | }  | 
                                                        
| 16 | 16 | |
| 17 | 17 | // Load WP_List_Table if not loaded  | 
                                                        
| 18 | -if ( ! class_exists( 'WP_List_Table' ) ) { | 
                                                        |
| 19 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';  | 
                                                        |
| 18 | +if ( ! class_exists('WP_List_Table')) { | 
                                                        |
| 19 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';  | 
                                                        |
| 20 | 20 | }  | 
                                                        
| 21 | 21 | |
| 22 | 22 | /**  | 
                                                        
@@ -118,37 +118,37 @@ discard block  | 
                                                    ||
| 118 | 118 |  	public function __construct() { | 
                                                        
| 119 | 119 | |
| 120 | 120 | // Set parent defaults  | 
                                                        
| 121 | - parent::__construct( array(  | 
                                                        |
| 122 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records  | 
                                                        |
| 123 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records  | 
                                                        |
| 121 | + parent::__construct(array(  | 
                                                        |
| 122 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records  | 
                                                        |
| 123 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records  | 
                                                        |
| 124 | 124 | 'ajax' => false // Does this table support ajax?  | 
                                                        
| 125 | - ) );  | 
                                                        |
| 125 | + ));  | 
                                                        |
| 126 | 126 | |
| 127 | 127 | $this->get_payment_counts();  | 
                                                        
| 128 | 128 | $this->process_bulk_action();  | 
                                                        
| 129 | - $this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );  | 
                                                        |
| 129 | +		$this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history'); | 
                                                        |
| 130 | 130 | }  | 
                                                        
| 131 | 131 | |
| 132 | 132 |  	public function advanced_filters() { | 
                                                        
| 133 | - $start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;  | 
                                                        |
| 134 | - $end_date = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null;  | 
                                                        |
| 135 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : '';  | 
                                                        |
| 133 | + $start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;  | 
                                                        |
| 134 | + $end_date = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null;  | 
                                                        |
| 135 | + $status = isset($_GET['status']) ? $_GET['status'] : '';  | 
                                                        |
| 136 | 136 | ?>  | 
                                                        
| 137 | 137 | <div id="give-payment-filters">  | 
                                                        
| 138 | 138 | <span id="give-payment-date-filters">  | 
                                                        
| 139 | - <label for="start-date" class="give-start-date-label"><?php esc_html_e( 'Start Date:', 'give' ); ?></label>  | 
                                                        |
| 139 | +				<label for="start-date" class="give-start-date-label"><?php esc_html_e('Start Date:', 'give'); ?></label> | 
                                                        |
| 140 | 140 | <input type="text" id="start-date" name="start-date" class="give_datepicker" value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy"/>  | 
                                                        
| 141 | - <label for="end-date" class="give-end-date-label"><?php esc_html_e( 'End Date:', 'give' ); ?></label>  | 
                                                        |
| 141 | +				<label for="end-date" class="give-end-date-label"><?php esc_html_e('End Date:', 'give'); ?></label> | 
                                                        |
| 142 | 142 | <input type="text" id="end-date" name="end-date" class="give_datepicker" value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy"/>  | 
                                                        
| 143 | - <input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Apply', 'give' ); ?>"/>  | 
                                                        |
| 143 | +				<input type="submit" class="button-secondary" value="<?php esc_attr_e('Apply', 'give'); ?>"/> | 
                                                        |
| 144 | 144 | </span>  | 
                                                        
| 145 | - <?php if ( ! empty( $status ) ) : ?>  | 
                                                        |
| 146 | - <input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>"/>  | 
                                                        |
| 145 | + <?php if ( ! empty($status)) : ?>  | 
                                                        |
| 146 | + <input type="hidden" name="status" value="<?php echo esc_attr($status); ?>"/>  | 
                                                        |
| 147 | 147 | <?php endif; ?>  | 
                                                        
| 148 | - <?php if ( ! empty( $start_date ) || ! empty( $end_date ) ) : ?>  | 
                                                        |
| 149 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>" class="button-secondary"><?php esc_html_e( 'Clear Filter', 'give' ); ?></a>  | 
                                                        |
| 148 | + <?php if ( ! empty($start_date) || ! empty($end_date)) : ?>  | 
                                                        |
| 149 | +				<a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>" class="button-secondary"><?php esc_html_e('Clear Filter', 'give'); ?></a> | 
                                                        |
| 150 | 150 | <?php endif; ?>  | 
                                                        
| 151 | - <?php $this->search_box( esc_html__( 'Search', 'give' ), 'give-payments' ); ?>  | 
                                                        |
| 151 | +			<?php $this->search_box(esc_html__('Search', 'give'), 'give-payments'); ?> | 
                                                        |
| 152 | 152 | </div>  | 
                                                        
| 153 | 153 | |
| 154 | 154 | <?php  | 
                                                        
@@ -165,18 +165,18 @@ discard block  | 
                                                    ||
| 165 | 165 | *  | 
                                                        
| 166 | 166 | * @return void  | 
                                                        
| 167 | 167 | */  | 
                                                        
| 168 | -	public function search_box( $text, $input_id ) { | 
                                                        |
| 169 | -		if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { | 
                                                        |
| 168 | +	public function search_box($text, $input_id) { | 
                                                        |
| 169 | +		if (empty($_REQUEST['s']) && ! $this->has_items()) { | 
                                                        |
| 170 | 170 | return;  | 
                                                        
| 171 | 171 | }  | 
                                                        
| 172 | 172 | |
| 173 | - $input_id = $input_id . '-search-input';  | 
                                                        |
| 173 | + $input_id = $input_id.'-search-input';  | 
                                                        |
| 174 | 174 | |
| 175 | -		if ( ! empty( $_REQUEST['orderby'] ) ) { | 
                                                        |
| 176 | - echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';  | 
                                                        |
| 175 | +		if ( ! empty($_REQUEST['orderby'])) { | 
                                                        |
| 176 | + echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';  | 
                                                        |
| 177 | 177 | }  | 
                                                        
| 178 | -		if ( ! empty( $_REQUEST['order'] ) ) { | 
                                                        |
| 179 | - echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';  | 
                                                        |
| 178 | +		if ( ! empty($_REQUEST['order'])) { | 
                                                        |
| 179 | + echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';  | 
                                                        |
| 180 | 180 | }  | 
                                                        
| 181 | 181 | ?>  | 
                                                        
| 182 | 182 | <p class="search-box">  | 
                                                        
@@ -188,11 +188,11 @@ discard block  | 
                                                    ||
| 188 | 188 | *  | 
                                                        
| 189 | 189 | * @since 1.0  | 
                                                        
| 190 | 190 | */  | 
                                                        
| 191 | - do_action( 'give_payment_history_search' );  | 
                                                        |
| 191 | +			do_action('give_payment_history_search'); | 
                                                        |
| 192 | 192 | ?>  | 
                                                        
| 193 | 193 | <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>  | 
                                                        
| 194 | 194 | <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>  | 
                                                        
| 195 | - <?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?><br/>  | 
                                                        |
| 195 | +			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?><br/> | 
                                                        |
| 196 | 196 | </p>  | 
                                                        
| 197 | 197 | <?php  | 
                                                        
| 198 | 198 | }  | 
                                                        
@@ -206,52 +206,52 @@ discard block  | 
                                                    ||
| 206 | 206 | */  | 
                                                        
| 207 | 207 |  	public function get_views() { | 
                                                        
| 208 | 208 | |
| 209 | - $current = isset( $_GET['status'] ) ? $_GET['status'] : '';  | 
                                                        |
| 210 | -		$total_count     = ' <span class="count">(' . $this->total_count . ')</span>'; | 
                                                        |
| 211 | -		$complete_count  = ' <span class="count">(' . $this->complete_count . ')</span>'; | 
                                                        |
| 212 | -		$cancelled_count = ' <span class="count">(' . $this->cancelled_count . ')</span>'; | 
                                                        |
| 213 | -		$pending_count   = ' <span class="count">(' . $this->pending_count . ')</span>'; | 
                                                        |
| 214 | -		$refunded_count  = ' <span class="count">(' . $this->refunded_count . ')</span>'; | 
                                                        |
| 215 | -		$failed_count    = ' <span class="count">(' . $this->failed_count . ')</span>'; | 
                                                        |
| 216 | -		$abandoned_count = ' <span class="count">(' . $this->abandoned_count . ')</span>'; | 
                                                        |
| 217 | -		$revoked_count   = ' <span class="count">(' . $this->revoked_count . ')</span>'; | 
                                                        |
| 209 | + $current = isset($_GET['status']) ? $_GET['status'] : '';  | 
                                                        |
| 210 | +		$total_count     = ' <span class="count">('.$this->total_count.')</span>'; | 
                                                        |
| 211 | +		$complete_count  = ' <span class="count">('.$this->complete_count.')</span>'; | 
                                                        |
| 212 | +		$cancelled_count = ' <span class="count">('.$this->cancelled_count.')</span>'; | 
                                                        |
| 213 | +		$pending_count   = ' <span class="count">('.$this->pending_count.')</span>'; | 
                                                        |
| 214 | +		$refunded_count  = ' <span class="count">('.$this->refunded_count.')</span>'; | 
                                                        |
| 215 | +		$failed_count    = ' <span class="count">('.$this->failed_count.')</span>'; | 
                                                        |
| 216 | +		$abandoned_count = ' <span class="count">('.$this->abandoned_count.')</span>'; | 
                                                        |
| 217 | +		$revoked_count   = ' <span class="count">('.$this->revoked_count.')</span>'; | 
                                                        |
| 218 | 218 | |
| 219 | 219 | $views = array(  | 
                                                        
| 220 | - 'all' => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array(  | 
                                                        |
| 220 | +			'all'       => sprintf('<a href="%s"%s>%s</a>', remove_query_arg(array( | 
                                                        |
| 221 | 221 | 'status',  | 
                                                        
| 222 | 222 | 'paged'  | 
                                                        
| 223 | - ) ), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__( 'All', 'give' ) . $total_count ),  | 
                                                        |
| 224 | - 'publish' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(  | 
                                                        |
| 223 | +			)), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__('All', 'give').$total_count), | 
                                                        |
| 224 | +			'publish'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( | 
                                                        |
| 225 | 225 | 'status' => 'publish',  | 
                                                        
| 226 | 226 | 'paged' => false  | 
                                                        
| 227 | - ) ) ), $current === 'publish' ? ' class="current"' : '', esc_html__( 'Completed', 'give' ) . $complete_count ),  | 
                                                        |
| 228 | - 'pending' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(  | 
                                                        |
| 227 | +			))), $current === 'publish' ? ' class="current"' : '', esc_html__('Completed', 'give').$complete_count), | 
                                                        |
| 228 | +			'pending'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( | 
                                                        |
| 229 | 229 | 'status' => 'pending',  | 
                                                        
| 230 | 230 | 'paged' => false  | 
                                                        
| 231 | - ) ) ), $current === 'pending' ? ' class="current"' : '', esc_html__( 'Pending', 'give' ) . $pending_count ),  | 
                                                        |
| 232 | - 'refunded' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(  | 
                                                        |
| 231 | +			))), $current === 'pending' ? ' class="current"' : '', esc_html__('Pending', 'give').$pending_count), | 
                                                        |
| 232 | +			'refunded'  => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( | 
                                                        |
| 233 | 233 | 'status' => 'refunded',  | 
                                                        
| 234 | 234 | 'paged' => false  | 
                                                        
| 235 | - ) ) ), $current === 'refunded' ? ' class="current"' : '', esc_html__( 'Refunded', 'give' ) . $refunded_count ),  | 
                                                        |
| 236 | - 'revoked' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(  | 
                                                        |
| 235 | +			))), $current === 'refunded' ? ' class="current"' : '', esc_html__('Refunded', 'give').$refunded_count), | 
                                                        |
| 236 | +			'revoked'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( | 
                                                        |
| 237 | 237 | 'status' => 'revoked',  | 
                                                        
| 238 | 238 | 'paged' => false  | 
                                                        
| 239 | - ) ) ), $current === 'revoked' ? ' class="current"' : '', esc_html__( 'Revoked', 'give' ) . $revoked_count ),  | 
                                                        |
| 240 | - 'failed' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(  | 
                                                        |
| 239 | +			))), $current === 'revoked' ? ' class="current"' : '', esc_html__('Revoked', 'give').$revoked_count), | 
                                                        |
| 240 | +			'failed'    => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( | 
                                                        |
| 241 | 241 | 'status' => 'failed',  | 
                                                        
| 242 | 242 | 'paged' => false  | 
                                                        
| 243 | - ) ) ), $current === 'failed' ? ' class="current"' : '', esc_html__( 'Failed', 'give' ) . $failed_count ),  | 
                                                        |
| 244 | - 'cancelled' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(  | 
                                                        |
| 243 | +			))), $current === 'failed' ? ' class="current"' : '', esc_html__('Failed', 'give').$failed_count), | 
                                                        |
| 244 | +			'cancelled' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( | 
                                                        |
| 245 | 245 | 'status' => 'cancelled',  | 
                                                        
| 246 | 246 | 'paged' => false  | 
                                                        
| 247 | - ) ) ), $current === 'cancelled' ? ' class="current"' : '', esc_html__( 'Cancelled', 'give' ) . $cancelled_count ),  | 
                                                        |
| 248 | - 'abandoned' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(  | 
                                                        |
| 247 | +			))), $current === 'cancelled' ? ' class="current"' : '', esc_html__('Cancelled', 'give').$cancelled_count), | 
                                                        |
| 248 | +			'abandoned' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array( | 
                                                        |
| 249 | 249 | 'status' => 'abandoned',  | 
                                                        
| 250 | 250 | 'paged' => false  | 
                                                        
| 251 | - ) ) ), $current === 'abandoned' ? ' class="current"' : '', esc_html__( 'Abandoned', 'give' ) . $abandoned_count )  | 
                                                        |
| 251 | +			))), $current === 'abandoned' ? ' class="current"' : '', esc_html__('Abandoned', 'give').$abandoned_count) | 
                                                        |
| 252 | 252 | );  | 
                                                        
| 253 | 253 | |
| 254 | - return apply_filters( 'give_payments_table_views', $views );  | 
                                                        |
| 254 | +		return apply_filters('give_payments_table_views', $views); | 
                                                        |
| 255 | 255 | }  | 
                                                        
| 256 | 256 | |
| 257 | 257 | /**  | 
                                                        
@@ -264,15 +264,15 @@ discard block  | 
                                                    ||
| 264 | 264 |  	public function get_columns() { | 
                                                        
| 265 | 265 | $columns = array(  | 
                                                        
| 266 | 266 | 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text  | 
                                                        
| 267 | - 'donation' => esc_html__( 'Donation', 'give' ),  | 
                                                        |
| 268 | - 'donation_form' => esc_html__( 'Donation Form', 'give' ),  | 
                                                        |
| 269 | - 'status' => esc_html__( 'Status', 'give' ),  | 
                                                        |
| 270 | - 'date' => esc_html__( 'Date', 'give' ),  | 
                                                        |
| 271 | - 'amount' => esc_html__( 'Amount', 'give' ),  | 
                                                        |
| 272 | - 'details' => esc_html__( 'Details', 'give' ),  | 
                                                        |
| 267 | +			'donation'      => esc_html__('Donation', 'give'), | 
                                                        |
| 268 | +			'donation_form' => esc_html__('Donation Form', 'give'), | 
                                                        |
| 269 | +			'status'        => esc_html__('Status', 'give'), | 
                                                        |
| 270 | +			'date'          => esc_html__('Date', 'give'), | 
                                                        |
| 271 | +			'amount'        => esc_html__('Amount', 'give'), | 
                                                        |
| 272 | +			'details'       => esc_html__('Details', 'give'), | 
                                                        |
| 273 | 273 | );  | 
                                                        
| 274 | 274 | |
| 275 | - return apply_filters( 'give_payments_table_columns', $columns );  | 
                                                        |
| 275 | +		return apply_filters('give_payments_table_columns', $columns); | 
                                                        |
| 276 | 276 | }  | 
                                                        
| 277 | 277 | |
| 278 | 278 | /**  | 
                                                        
@@ -284,12 +284,12 @@ discard block  | 
                                                    ||
| 284 | 284 | */  | 
                                                        
| 285 | 285 |  	public function get_sortable_columns() { | 
                                                        
| 286 | 286 | $columns = array(  | 
                                                        
| 287 | - 'donation' => array( 'ID', true ),  | 
                                                        |
| 288 | - 'amount' => array( 'amount', false ),  | 
                                                        |
| 289 | - 'date' => array( 'date', false )  | 
                                                        |
| 287 | +			'donation' => array('ID', true), | 
                                                        |
| 288 | +			'amount'   => array('amount', false), | 
                                                        |
| 289 | +			'date'     => array('date', false) | 
                                                        |
| 290 | 290 | );  | 
                                                        
| 291 | 291 | |
| 292 | - return apply_filters( 'give_payments_table_sortable_columns', $columns );  | 
                                                        |
| 292 | +		return apply_filters('give_payments_table_sortable_columns', $columns); | 
                                                        |
| 293 | 293 | }  | 
                                                        
| 294 | 294 | |
| 295 | 295 | /**  | 
                                                        
@@ -315,60 +315,60 @@ discard block  | 
                                                    ||
| 315 | 315 | *  | 
                                                        
| 316 | 316 | * @return string Column Name  | 
                                                        
| 317 | 317 | */  | 
                                                        
| 318 | -	public function column_default( $payment, $column_name ) { | 
                                                        |
| 318 | +	public function column_default($payment, $column_name) { | 
                                                        |
| 319 | 319 | |
| 320 | - $single_donation_url = esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details' ) ) );  | 
                                                        |
| 321 | - $row_actions = $this->get_row_actions( $payment );  | 
                                                        |
| 320 | +		$single_donation_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details'))); | 
                                                        |
| 321 | + $row_actions = $this->get_row_actions($payment);  | 
                                                        |
| 322 | 322 |  		$sensitive_data      = current_user_can('view_give_sensitive_data'); | 
                                                        
| 323 | 323 | |
| 324 | -		switch ( $column_name ) { | 
                                                        |
| 324 | +		switch ($column_name) { | 
                                                        |
| 325 | 325 | case 'donation' :  | 
                                                        
| 326 | 326 | ob_start();  | 
                                                        
| 327 | 327 | ?>  | 
                                                        
| 328 | -				<a href="<?php echo $single_donation_url; ?>" data-tooltip="<?php esc_html_e( 'View details', 'give' ) ?>">#<?php echo $payment->ID; ?></a> <?php _e( 'by', 'give' ); ?> <?php if ($sensitive_data){ echo $this->get_donor( $payment );} else {echo '(hidden)';}; ?> | 
                                                        |
| 328 | +				<a href="<?php echo $single_donation_url; ?>" data-tooltip="<?php esc_html_e('View details', 'give') ?>">#<?php echo $payment->ID; ?></a> <?php _e('by', 'give'); ?> <?php if ($sensitive_data) { echo $this->get_donor($payment); } else {echo '(hidden)'; }; ?> | 
                                                        |
| 329 | 329 | <br>  | 
                                                        
| 330 | -				<?php if($sensitive_data) { echo $this->get_donor_email( $payment );} else {echo '';} ?> | 
                                                        |
| 331 | - <?php echo $this->row_actions( $row_actions ); ?>  | 
                                                        |
| 330 | +				<?php if ($sensitive_data) { echo $this->get_donor_email($payment); } else {echo ''; } ?> | 
                                                        |
| 331 | + <?php echo $this->row_actions($row_actions); ?>  | 
                                                        |
| 332 | 332 | <?php  | 
                                                        
| 333 | 333 | $value = ob_get_clean();  | 
                                                        
| 334 | 334 | break;  | 
                                                        
| 335 | 335 | |
| 336 | 336 | case 'amount' :  | 
                                                        
| 337 | - $amount = ! empty( $payment->total ) ? $payment->total : 0;  | 
                                                        |
| 338 | - $value = give_currency_filter( give_format_amount( $amount ), give_get_payment_currency_code( $payment->ID ) );  | 
                                                        |
| 337 | + $amount = ! empty($payment->total) ? $payment->total : 0;  | 
                                                        |
| 338 | + $value = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID));  | 
                                                        |
| 339 | 339 | break;  | 
                                                        
| 340 | 340 | |
| 341 | 341 | case 'donation_form' :  | 
                                                        
| 342 | 342 | |
| 343 | - $value = '<a href="' . admin_url( 'post.php?post=' . $payment->form_id . '&action=edit' ) . '">' . $payment->form_title . '</a>';  | 
                                                        |
| 344 | - $level = give_get_payment_form_title( $payment->meta, true );  | 
                                                        |
| 343 | +				$value = '<a href="'.admin_url('post.php?post='.$payment->form_id.'&action=edit').'">'.$payment->form_title.'</a>'; | 
                                                        |
| 344 | + $level = give_get_payment_form_title($payment->meta, true);  | 
                                                        |
| 345 | 345 | |
| 346 | -				if ( ! empty( $level ) ) { | 
                                                        |
| 346 | +				if ( ! empty($level)) { | 
                                                        |
| 347 | 347 | $value .= $level;  | 
                                                        
| 348 | 348 | }  | 
                                                        
| 349 | 349 | |
| 350 | 350 | break;  | 
                                                        
| 351 | 351 | |
| 352 | 352 | case 'date' :  | 
                                                        
| 353 | - $date = strtotime( $payment->date );  | 
                                                        |
| 354 | - $value = date_i18n( get_option( 'date_format' ), $date );  | 
                                                        |
| 353 | + $date = strtotime($payment->date);  | 
                                                        |
| 354 | +				$value = date_i18n(get_option('date_format'), $date); | 
                                                        |
| 355 | 355 | break;  | 
                                                        
| 356 | 356 | |
| 357 | 357 | case 'status' :  | 
                                                        
| 358 | - $value = $this->get_payment_status( $payment );  | 
                                                        |
| 358 | + $value = $this->get_payment_status($payment);  | 
                                                        |
| 359 | 359 | break;  | 
                                                        
| 360 | 360 | |
| 361 | 361 | case 'details' :  | 
                                                        
| 362 | - $value = '<div class="give-payment-details-link-wrap"><a href="' . $single_donation_url . '" data-tooltip="' . __( 'View details', 'give' ) . '" class="give-payment-details-link button button-small" title="' . __( 'View Details', 'give' ) . '"><span class="dashicons dashicons-visibility"></span></a></div>';  | 
                                                        |
| 362 | +				$value = '<div class="give-payment-details-link-wrap"><a href="'.$single_donation_url.'" data-tooltip="'.__('View details', 'give').'" class="give-payment-details-link button button-small" title="'.__('View Details', 'give').'"><span class="dashicons dashicons-visibility"></span></a></div>'; | 
                                                        |
| 363 | 363 | break;  | 
                                                        
| 364 | 364 | |
| 365 | 365 | default:  | 
                                                        
| 366 | - $value = isset( $payment->$column_name ) ? $payment->$column_name : '';  | 
                                                        |
| 366 | + $value = isset($payment->$column_name) ? $payment->$column_name : '';  | 
                                                        |
| 367 | 367 | break;  | 
                                                        
| 368 | 368 | |
| 369 | 369 | }  | 
                                                        
| 370 | 370 | |
| 371 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name );  | 
                                                        |
| 371 | +		return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name); | 
                                                        |
| 372 | 372 | }  | 
                                                        
| 373 | 373 | |
| 374 | 374 | /**  | 
                                                        
@@ -381,17 +381,17 @@ discard block  | 
                                                    ||
| 381 | 381 | *  | 
                                                        
| 382 | 382 | * @return string Data shown in the Email column  | 
                                                        
| 383 | 383 | */  | 
                                                        
| 384 | -	public function get_donor_email( $payment ) { | 
                                                        |
| 384 | +	public function get_donor_email($payment) { | 
                                                        |
| 385 | 385 | |
| 386 | - $email = give_get_payment_user_email( $payment->ID );  | 
                                                        |
| 386 | + $email = give_get_payment_user_email($payment->ID);  | 
                                                        |
| 387 | 387 | |
| 388 | -		if ( empty( $email ) ) { | 
                                                        |
| 389 | - $email = esc_html__( '(unknown)', 'give' );  | 
                                                        |
| 388 | +		if (empty($email)) { | 
                                                        |
| 389 | +			$email = esc_html__('(unknown)', 'give'); | 
                                                        |
| 390 | 390 | }  | 
                                                        
| 391 | 391 | |
| 392 | - $value = '<a href="mailto:' . $email . '" data-tooltip="' . __( 'Email donor', 'give' ) . '">' . $email . '</a>';  | 
                                                        |
| 392 | +		$value = '<a href="mailto:'.$email.'" data-tooltip="'.__('Email donor', 'give').'">'.$email.'</a>'; | 
                                                        |
| 393 | 393 | |
| 394 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' );  | 
                                                        |
| 394 | +		return apply_filters('give_payments_table_column', $value, $payment->ID, 'email'); | 
                                                        |
| 395 | 395 | }  | 
                                                        
| 396 | 396 | |
| 397 | 397 | /**  | 
                                                        
@@ -401,31 +401,31 @@ discard block  | 
                                                    ||
| 401 | 401 | *  | 
                                                        
| 402 | 402 | * @return mixed|void  | 
                                                        
| 403 | 403 | */  | 
                                                        
| 404 | -	function get_row_actions( $payment ) { | 
                                                        |
| 404 | +	function get_row_actions($payment) { | 
                                                        |
| 405 | 405 | |
| 406 | 406 | $row_actions = array();  | 
                                                        
| 407 | - $email = give_get_payment_user_email( $payment->ID );  | 
                                                        |
| 407 | + $email = give_get_payment_user_email($payment->ID);  | 
                                                        |
| 408 | 408 | |
| 409 | 409 | // Add search term string back to base URL  | 
                                                        
| 410 | - $search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' );  | 
                                                        |
| 411 | -		if ( ! empty( $search_terms ) ) { | 
                                                        |
| 412 | - $this->base_url = add_query_arg( 's', $search_terms, $this->base_url );  | 
                                                        |
| 410 | + $search_terms = (isset($_GET['s']) ? trim($_GET['s']) : '');  | 
                                                        |
| 411 | +		if ( ! empty($search_terms)) { | 
                                                        |
| 412 | +			$this->base_url = add_query_arg('s', $search_terms, $this->base_url); | 
                                                        |
| 413 | 413 | }  | 
                                                        
| 414 | 414 | |
| 415 | -		if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) { | 
                                                        |
| 416 | - $row_actions['email_links'] = '<a href="' . add_query_arg( array(  | 
                                                        |
| 415 | +		if (give_is_payment_complete($payment->ID) && ! empty($email)) { | 
                                                        |
| 416 | + $row_actions['email_links'] = '<a href="'.add_query_arg(array(  | 
                                                        |
| 417 | 417 | 'give-action' => 'email_links',  | 
                                                        
| 418 | 418 | 'purchase_id' => $payment->ID  | 
                                                        
| 419 | - ), $this->base_url ) . '">' . esc_html__( 'Resend Donation Receipt', 'give' ) . '</a>';  | 
                                                        |
| 419 | +				), $this->base_url).'">'.esc_html__('Resend Donation Receipt', 'give').'</a>'; | 
                                                        |
| 420 | 420 | |
| 421 | 421 | }  | 
                                                        
| 422 | 422 | |
| 423 | - $row_actions['delete'] = '<a href="' . wp_nonce_url( add_query_arg( array(  | 
                                                        |
| 423 | + $row_actions['delete'] = '<a href="'.wp_nonce_url(add_query_arg(array(  | 
                                                        |
| 424 | 424 | 'give-action' => 'delete_payment',  | 
                                                        
| 425 | 425 | 'purchase_id' => $payment->ID  | 
                                                        
| 426 | - ), $this->base_url ), 'give_payment_nonce' ) . '">' . esc_html__( 'Delete', 'give' ) . '</a>';  | 
                                                        |
| 426 | +			), $this->base_url), 'give_payment_nonce').'">'.esc_html__('Delete', 'give').'</a>'; | 
                                                        |
| 427 | 427 | |
| 428 | - return apply_filters( 'give_payment_row_actions', $row_actions, $payment );  | 
                                                        |
| 428 | +		return apply_filters('give_payment_row_actions', $row_actions, $payment); | 
                                                        |
| 429 | 429 | }  | 
                                                        
| 430 | 430 | |
| 431 | 431 | /**  | 
                                                        
@@ -438,10 +438,10 @@ discard block  | 
                                                    ||
| 438 | 438 | *  | 
                                                        
| 439 | 439 | * @return string Data shown in the Email column  | 
                                                        
| 440 | 440 | */  | 
                                                        
| 441 | -	function get_payment_status( $payment ) { | 
                                                        |
| 442 | - $value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>';  | 
                                                        |
| 443 | -		if ( $payment->mode == 'test' ) { | 
                                                        |
| 444 | - $value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . esc_attr__( 'This payment was made in test mode', 'give' ) . '">' . esc_html__( 'Test', 'give' ) . '</span>';  | 
                                                        |
| 441 | +	function get_payment_status($payment) { | 
                                                        |
| 442 | + $value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>';  | 
                                                        |
| 443 | +		if ($payment->mode == 'test') { | 
                                                        |
| 444 | +			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.esc_attr__('This payment was made in test mode', 'give').'">'.esc_html__('Test', 'give').'</span>'; | 
                                                        |
| 445 | 445 | }  | 
                                                        
| 446 | 446 | |
| 447 | 447 | return $value;  | 
                                                        
@@ -457,7 +457,7 @@ discard block  | 
                                                    ||
| 457 | 457 | *  | 
                                                        
| 458 | 458 | * @return string Displays a checkbox  | 
                                                        
| 459 | 459 | */  | 
                                                        
| 460 | -	public function column_cb( $payment ) { | 
                                                        |
| 460 | +	public function column_cb($payment) { | 
                                                        |
| 461 | 461 | return sprintf(  | 
                                                        
| 462 | 462 | '<input type="checkbox" name="%1$s[]" value="%2$s" />',  | 
                                                        
| 463 | 463 | 'payment',  | 
                                                        
@@ -475,8 +475,8 @@ discard block  | 
                                                    ||
| 475 | 475 | *  | 
                                                        
| 476 | 476 | * @return string Displays a checkbox  | 
                                                        
| 477 | 477 | */  | 
                                                        
| 478 | -	public function get_payment_id( $payment ) { | 
                                                        |
| 479 | - return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>';  | 
                                                        |
| 478 | +	public function get_payment_id($payment) { | 
                                                        |
| 479 | + return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>';  | 
                                                        |
| 480 | 480 | }  | 
                                                        
| 481 | 481 | |
| 482 | 482 | /**  | 
                                                        
@@ -489,19 +489,19 @@ discard block  | 
                                                    ||
| 489 | 489 | *  | 
                                                        
| 490 | 490 | * @return string Data shown in the User column  | 
                                                        
| 491 | 491 | */  | 
                                                        
| 492 | -	public function get_donor( $payment ) { | 
                                                        |
| 492 | +	public function get_donor($payment) { | 
                                                        |
| 493 | 493 | |
| 494 | - $customer_id = give_get_payment_customer_id( $payment->ID );  | 
                                                        |
| 494 | + $customer_id = give_get_payment_customer_id($payment->ID);  | 
                                                        |
| 495 | 495 | |
| 496 | -		if ( ! empty( $customer_id ) ) { | 
                                                        |
| 497 | - $customer = new Give_Customer( $customer_id );  | 
                                                        |
| 498 | - $value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id" ) ) . '">' . $customer->name . '</a>';  | 
                                                        |
| 496 | +		if ( ! empty($customer_id)) { | 
                                                        |
| 497 | + $customer = new Give_Customer($customer_id);  | 
                                                        |
| 498 | +			$value    = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id")).'">'.$customer->name.'</a>'; | 
                                                        |
| 499 | 499 |  		} else { | 
                                                        
| 500 | - $email = give_get_payment_user_email( $payment->ID );  | 
                                                        |
| 501 | - $value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . esc_html__( '(donor missing)', 'give' ) . '</a>';  | 
                                                        |
| 500 | + $email = give_get_payment_user_email($payment->ID);  | 
                                                        |
| 501 | +			$value = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.esc_html__('(donor missing)', 'give').'</a>'; | 
                                                        |
| 502 | 502 | }  | 
                                                        
| 503 | 503 | |
| 504 | - return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' );  | 
                                                        |
| 504 | +		return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor'); | 
                                                        |
| 505 | 505 | }  | 
                                                        
| 506 | 506 | |
| 507 | 507 | /**  | 
                                                        
@@ -513,18 +513,18 @@ discard block  | 
                                                    ||
| 513 | 513 | */  | 
                                                        
| 514 | 514 |  	public function get_bulk_actions() { | 
                                                        
| 515 | 515 | $actions = array(  | 
                                                        
| 516 | - 'delete' => esc_html__( 'Delete', 'give' ),  | 
                                                        |
| 517 | - 'set-status-publish' => esc_html__( 'Set To Completed', 'give' ),  | 
                                                        |
| 518 | - 'set-status-pending' => esc_html__( 'Set To Pending', 'give' ),  | 
                                                        |
| 519 | - 'set-status-refunded' => esc_html__( 'Set To Refunded', 'give' ),  | 
                                                        |
| 520 | - 'set-status-revoked' => esc_html__( 'Set To Revoked', 'give' ),  | 
                                                        |
| 521 | - 'set-status-failed' => esc_html__( 'Set To Failed', 'give' ),  | 
                                                        |
| 522 | - 'set-status-cancelled' => esc_html__( 'Set To Cancelled', 'give' ),  | 
                                                        |
| 523 | - 'set-status-abandoned' => esc_html__( 'Set To Abandoned', 'give' ),  | 
                                                        |
| 524 | - 'resend-receipt' => esc_html__( 'Resend Email Receipts', 'give' )  | 
                                                        |
| 516 | +			'delete'               => esc_html__('Delete', 'give'), | 
                                                        |
| 517 | +			'set-status-publish'   => esc_html__('Set To Completed', 'give'), | 
                                                        |
| 518 | +			'set-status-pending'   => esc_html__('Set To Pending', 'give'), | 
                                                        |
| 519 | +			'set-status-refunded'  => esc_html__('Set To Refunded', 'give'), | 
                                                        |
| 520 | +			'set-status-revoked'   => esc_html__('Set To Revoked', 'give'), | 
                                                        |
| 521 | +			'set-status-failed'    => esc_html__('Set To Failed', 'give'), | 
                                                        |
| 522 | +			'set-status-cancelled' => esc_html__('Set To Cancelled', 'give'), | 
                                                        |
| 523 | +			'set-status-abandoned' => esc_html__('Set To Abandoned', 'give'), | 
                                                        |
| 524 | +			'resend-receipt'       => esc_html__('Resend Email Receipts', 'give') | 
                                                        |
| 525 | 525 | );  | 
                                                        
| 526 | 526 | |
| 527 | - return apply_filters( 'give_payments_table_bulk_actions', $actions );  | 
                                                        |
| 527 | +		return apply_filters('give_payments_table_bulk_actions', $actions); | 
                                                        |
| 528 | 528 | }  | 
                                                        
| 529 | 529 | |
| 530 | 530 | /**  | 
                                                        
@@ -535,59 +535,59 @@ discard block  | 
                                                    ||
| 535 | 535 | * @return void  | 
                                                        
| 536 | 536 | */  | 
                                                        
| 537 | 537 |  	public function process_bulk_action() { | 
                                                        
| 538 | - $ids = isset( $_GET['payment'] ) ? $_GET['payment'] : false;  | 
                                                        |
| 538 | + $ids = isset($_GET['payment']) ? $_GET['payment'] : false;  | 
                                                        |
| 539 | 539 | $action = $this->current_action();  | 
                                                        
| 540 | 540 | |
| 541 | -		if ( ! is_array( $ids ) ) { | 
                                                        |
| 542 | - $ids = array( $ids );  | 
                                                        |
| 541 | +		if ( ! is_array($ids)) { | 
                                                        |
| 542 | + $ids = array($ids);  | 
                                                        |
| 543 | 543 | }  | 
                                                        
| 544 | 544 | |
| 545 | -		if ( empty( $action ) ) { | 
                                                        |
| 545 | +		if (empty($action)) { | 
                                                        |
| 546 | 546 | return;  | 
                                                        
| 547 | 547 | }  | 
                                                        
| 548 | 548 | |
| 549 | -		foreach ( $ids as $id ) { | 
                                                        |
| 549 | +		foreach ($ids as $id) { | 
                                                        |
| 550 | 550 | |
| 551 | 551 | // Detect when a bulk action is being triggered...  | 
                                                        
| 552 | -			switch ( $this->current_action() ) { | 
                                                        |
| 552 | +			switch ($this->current_action()) { | 
                                                        |
| 553 | 553 | |
| 554 | 554 | case'delete':  | 
                                                        
| 555 | - give_delete_purchase( $id );  | 
                                                        |
| 555 | + give_delete_purchase($id);  | 
                                                        |
| 556 | 556 | break;  | 
                                                        
| 557 | 557 | |
| 558 | 558 | case 'set-status-publish':  | 
                                                        
| 559 | - give_update_payment_status( $id, 'publish' );  | 
                                                        |
| 559 | + give_update_payment_status($id, 'publish');  | 
                                                        |
| 560 | 560 | break;  | 
                                                        
| 561 | 561 | |
| 562 | 562 | case 'set-status-pending':  | 
                                                        
| 563 | - give_update_payment_status( $id, 'pending' );  | 
                                                        |
| 563 | + give_update_payment_status($id, 'pending');  | 
                                                        |
| 564 | 564 | break;  | 
                                                        
| 565 | 565 | |
| 566 | 566 | case 'set-status-refunded':  | 
                                                        
| 567 | - give_update_payment_status( $id, 'refunded' );  | 
                                                        |
| 567 | + give_update_payment_status($id, 'refunded');  | 
                                                        |
| 568 | 568 | break;  | 
                                                        
| 569 | 569 | case 'set-status-revoked':  | 
                                                        
| 570 | - give_update_payment_status( $id, 'revoked' );  | 
                                                        |
| 570 | + give_update_payment_status($id, 'revoked');  | 
                                                        |
| 571 | 571 | break;  | 
                                                        
| 572 | 572 | |
| 573 | 573 | case 'set-status-failed':  | 
                                                        
| 574 | - give_update_payment_status( $id, 'failed' );  | 
                                                        |
| 574 | + give_update_payment_status($id, 'failed');  | 
                                                        |
| 575 | 575 | break;  | 
                                                        
| 576 | 576 | |
| 577 | 577 | case 'set-status-cancelled':  | 
                                                        
| 578 | - give_update_payment_status( $id, 'cancelled' );  | 
                                                        |
| 578 | + give_update_payment_status($id, 'cancelled');  | 
                                                        |
| 579 | 579 | break;  | 
                                                        
| 580 | 580 | |
| 581 | 581 | case 'set-status-abandoned':  | 
                                                        
| 582 | - give_update_payment_status( $id, 'abandoned' );  | 
                                                        |
| 582 | + give_update_payment_status($id, 'abandoned');  | 
                                                        |
| 583 | 583 | break;  | 
                                                        
| 584 | 584 | |
| 585 | 585 | case 'set-status-preapproval':  | 
                                                        
| 586 | - give_update_payment_status( $id, 'preapproval' );  | 
                                                        |
| 586 | + give_update_payment_status($id, 'preapproval');  | 
                                                        |
| 587 | 587 | break;  | 
                                                        
| 588 | 588 | |
| 589 | 589 | case 'resend-receipt':  | 
                                                        
| 590 | - give_email_donation_receipt( $id, false );  | 
                                                        |
| 590 | + give_email_donation_receipt($id, false);  | 
                                                        |
| 591 | 591 | break;  | 
                                                        
| 592 | 592 | }  | 
                                                        
| 593 | 593 | |
@@ -599,7 +599,7 @@ discard block  | 
                                                    ||
| 599 | 599 | * @param int $id The ID of the payment.  | 
                                                        
| 600 | 600 | * @param string $current_action The action that is being triggered.  | 
                                                        
| 601 | 601 | */  | 
                                                        
| 602 | - do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() );  | 
                                                        |
| 602 | +			do_action('give_payments_table_do_bulk_action', $id, $this->current_action()); | 
                                                        |
| 603 | 603 | }  | 
                                                        
| 604 | 604 | |
| 605 | 605 | }  | 
                                                        
@@ -615,27 +615,27 @@ discard block  | 
                                                    ||
| 615 | 615 | |
| 616 | 616 | $args = array();  | 
                                                        
| 617 | 617 | |
| 618 | -		if ( isset( $_GET['user'] ) ) { | 
                                                        |
| 619 | - $args['user'] = urldecode( $_GET['user'] );  | 
                                                        |
| 620 | -		} elseif ( isset( $_GET['s'] ) ) { | 
                                                        |
| 621 | - $is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false;  | 
                                                        |
| 622 | -			if ( $is_user ) { | 
                                                        |
| 623 | - $args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) );  | 
                                                        |
| 624 | - unset( $args['s'] );  | 
                                                        |
| 618 | +		if (isset($_GET['user'])) { | 
                                                        |
| 619 | + $args['user'] = urldecode($_GET['user']);  | 
                                                        |
| 620 | +		} elseif (isset($_GET['s'])) { | 
                                                        |
| 621 | +			$is_user = strpos($_GET['s'], strtolower('user:')) !== false; | 
                                                        |
| 622 | +			if ($is_user) { | 
                                                        |
| 623 | +				$args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s'])))); | 
                                                        |
| 624 | + unset($args['s']);  | 
                                                        |
| 625 | 625 |  			} else { | 
                                                        
| 626 | - $args['s'] = sanitize_text_field( $_GET['s'] );  | 
                                                        |
| 626 | + $args['s'] = sanitize_text_field($_GET['s']);  | 
                                                        |
| 627 | 627 | }  | 
                                                        
| 628 | 628 | }  | 
                                                        
| 629 | 629 | |
| 630 | -		if ( ! empty( $_GET['start-date'] ) ) { | 
                                                        |
| 631 | - $args['start-date'] = urldecode( $_GET['start-date'] );  | 
                                                        |
| 630 | +		if ( ! empty($_GET['start-date'])) { | 
                                                        |
| 631 | + $args['start-date'] = urldecode($_GET['start-date']);  | 
                                                        |
| 632 | 632 | }  | 
                                                        
| 633 | 633 | |
| 634 | -		if ( ! empty( $_GET['end-date'] ) ) { | 
                                                        |
| 635 | - $args['end-date'] = urldecode( $_GET['end-date'] );  | 
                                                        |
| 634 | +		if ( ! empty($_GET['end-date'])) { | 
                                                        |
| 635 | + $args['end-date'] = urldecode($_GET['end-date']);  | 
                                                        |
| 636 | 636 | }  | 
                                                        
| 637 | 637 | |
| 638 | - $payment_count = give_count_payments( $args );  | 
                                                        |
| 638 | + $payment_count = give_count_payments($args);  | 
                                                        |
| 639 | 639 | $this->complete_count = $payment_count->publish;  | 
                                                        
| 640 | 640 | $this->pending_count = $payment_count->pending;  | 
                                                        
| 641 | 641 | $this->refunded_count = $payment_count->refunded;  | 
                                                        
@@ -644,7 +644,7 @@ discard block  | 
                                                    ||
| 644 | 644 | $this->cancelled_count = $payment_count->cancelled;  | 
                                                        
| 645 | 645 | $this->abandoned_count = $payment_count->abandoned;  | 
                                                        
| 646 | 646 | |
| 647 | -		foreach ( $payment_count as $count ) { | 
                                                        |
| 647 | +		foreach ($payment_count as $count) { | 
                                                        |
| 648 | 648 | $this->total_count += $count;  | 
                                                        
| 649 | 649 | }  | 
                                                        
| 650 | 650 | }  | 
                                                        
@@ -659,26 +659,26 @@ discard block  | 
                                                    ||
| 659 | 659 |  	public function payments_data() { | 
                                                        
| 660 | 660 | |
| 661 | 661 | $per_page = $this->per_page;  | 
                                                        
| 662 | - $orderby = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID';  | 
                                                        |
| 663 | - $order = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC';  | 
                                                        |
| 664 | - $user = isset( $_GET['user'] ) ? $_GET['user'] : null;  | 
                                                        |
| 665 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys();  | 
                                                        |
| 666 | - $meta_key = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null;  | 
                                                        |
| 667 | - $year = isset( $_GET['year'] ) ? $_GET['year'] : null;  | 
                                                        |
| 668 | - $month = isset( $_GET['m'] ) ? $_GET['m'] : null;  | 
                                                        |
| 669 | - $day = isset( $_GET['day'] ) ? $_GET['day'] : null;  | 
                                                        |
| 670 | - $search = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null;  | 
                                                        |
| 671 | - $start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;  | 
                                                        |
| 672 | - $end_date = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date;  | 
                                                        |
| 673 | -  | 
                                                        |
| 674 | -		if ( ! empty( $search ) ) { | 
                                                        |
| 662 | + $orderby = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID';  | 
                                                        |
| 663 | + $order = isset($_GET['order']) ? $_GET['order'] : 'DESC';  | 
                                                        |
| 664 | + $user = isset($_GET['user']) ? $_GET['user'] : null;  | 
                                                        |
| 665 | + $status = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys();  | 
                                                        |
| 666 | + $meta_key = isset($_GET['meta_key']) ? $_GET['meta_key'] : null;  | 
                                                        |
| 667 | + $year = isset($_GET['year']) ? $_GET['year'] : null;  | 
                                                        |
| 668 | + $month = isset($_GET['m']) ? $_GET['m'] : null;  | 
                                                        |
| 669 | + $day = isset($_GET['day']) ? $_GET['day'] : null;  | 
                                                        |
| 670 | + $search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null;  | 
                                                        |
| 671 | + $start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;  | 
                                                        |
| 672 | + $end_date = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date;  | 
                                                        |
| 673 | +  | 
                                                        |
| 674 | +		if ( ! empty($search)) { | 
                                                        |
| 675 | 675 | $status = 'any'; // Force all payment statuses when searching  | 
                                                        
| 676 | 676 | }  | 
                                                        
| 677 | 677 | |
| 678 | 678 | $args = array(  | 
                                                        
| 679 | 679 | 'output' => 'payments',  | 
                                                        
| 680 | 680 | 'number' => $per_page,  | 
                                                        
| 681 | - 'page' => isset( $_GET['paged'] ) ? $_GET['paged'] : null,  | 
                                                        |
| 681 | + 'page' => isset($_GET['paged']) ? $_GET['paged'] : null,  | 
                                                        |
| 682 | 682 | 'orderby' => $orderby,  | 
                                                        
| 683 | 683 | 'order' => $order,  | 
                                                        
| 684 | 684 | 'user' => $user,  | 
                                                        
@@ -692,14 +692,14 @@ discard block  | 
                                                    ||
| 692 | 692 | 'end_date' => $end_date,  | 
                                                        
| 693 | 693 | );  | 
                                                        
| 694 | 694 | |
| 695 | -		if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) { | 
                                                        |
| 695 | +		if (is_string($search) && false !== strpos($search, 'txn:')) { | 
                                                        |
| 696 | 696 | |
| 697 | 697 | $args['search_in_notes'] = true;  | 
                                                        
| 698 | - $args['s'] = trim( str_replace( 'txn:', '', $args['s'] ) );  | 
                                                        |
| 698 | +			$args['s']               = trim(str_replace('txn:', '', $args['s'])); | 
                                                        |
| 699 | 699 | |
| 700 | 700 | }  | 
                                                        
| 701 | 701 | |
| 702 | - $p_query = new Give_Payments_Query( $args );  | 
                                                        |
| 702 | + $p_query = new Give_Payments_Query($args);  | 
                                                        |
| 703 | 703 | |
| 704 | 704 | return $p_query->get_payments();  | 
                                                        
| 705 | 705 | |
@@ -719,17 +719,17 @@ discard block  | 
                                                    ||
| 719 | 719 | */  | 
                                                        
| 720 | 720 |  	public function prepare_items() { | 
                                                        
| 721 | 721 | |
| 722 | - wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) );  | 
                                                        |
| 722 | +		wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's')); | 
                                                        |
| 723 | 723 | |
| 724 | 724 | $columns = $this->get_columns();  | 
                                                        
| 725 | 725 | $hidden = array(); // No hidden columns  | 
                                                        
| 726 | 726 | $sortable = $this->get_sortable_columns();  | 
                                                        
| 727 | 727 | $data = $this->payments_data();  | 
                                                        
| 728 | - $status = isset( $_GET['status'] ) ? $_GET['status'] : 'any';  | 
                                                        |
| 728 | + $status = isset($_GET['status']) ? $_GET['status'] : 'any';  | 
                                                        |
| 729 | 729 | |
| 730 | - $this->_column_headers = array( $columns, $hidden, $sortable );  | 
                                                        |
| 730 | + $this->_column_headers = array($columns, $hidden, $sortable);  | 
                                                        |
| 731 | 731 | |
| 732 | -		switch ( $status ) { | 
                                                        |
| 732 | +		switch ($status) { | 
                                                        |
| 733 | 733 | case 'publish':  | 
                                                        
| 734 | 734 | $total_items = $this->complete_count;  | 
                                                        
| 735 | 735 | break;  | 
                                                        
@@ -756,19 +756,19 @@ discard block  | 
                                                    ||
| 756 | 756 | break;  | 
                                                        
| 757 | 757 | default:  | 
                                                        
| 758 | 758 | // Retrieve the count of the non-default-Give status  | 
                                                        
| 759 | - $count = wp_count_posts( 'give_payment' );  | 
                                                        |
| 759 | +				$count       = wp_count_posts('give_payment'); | 
                                                        |
| 760 | 760 |  				$total_items = $count->{$status}; | 
                                                        
| 761 | 761 | break;  | 
                                                        
| 762 | 762 | }  | 
                                                        
| 763 | 763 | |
| 764 | 764 | $this->items = $data;  | 
                                                        
| 765 | 765 | |
| 766 | - $this->set_pagination_args( array(  | 
                                                        |
| 766 | + $this->set_pagination_args(array(  | 
                                                        |
| 767 | 767 | 'total_items' => $total_items,  | 
                                                        
| 768 | 768 | // WE have to calculate the total number of items  | 
                                                        
| 769 | 769 | 'per_page' => $this->per_page,  | 
                                                        
| 770 | 770 | // WE have to determine how many items to show on a page  | 
                                                        
| 771 | - 'total_pages' => ceil( $total_items / $this->per_page )  | 
                                                        |
| 771 | + 'total_pages' => ceil($total_items / $this->per_page)  | 
                                                        |
| 772 | 772 | // WE have to calculate the total number of pages  | 
                                                        
| 773 | 773 | )  | 
                                                        
| 774 | 774 | );  | 
                                                        
@@ -10,7 +10,7 @@ discard block  | 
                                                    ||
| 10 | 10 | */  | 
                                                        
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly  | 
                                                        
| 13 | -if ( ! defined( 'ABSPATH' ) ) { | 
                                                        |
| 13 | +if ( ! defined('ABSPATH')) { | 
                                                        |
| 14 | 14 | exit;  | 
                                                        
| 15 | 15 | }  | 
                                                        
| 16 | 16 | |
@@ -20,27 +20,27 @@ discard block  | 
                                                    ||
| 20 | 20 | * @since 1.0  | 
                                                        
| 21 | 21 | * @return void  | 
                                                        
| 22 | 22 | */  | 
                                                        
| 23 | -if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { | 
                                                        |
| 24 | - wp_die( esc_html__( 'Donation ID not supplied. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );  | 
                                                        |
| 23 | +if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { | 
                                                        |
| 24 | +	wp_die(esc_html__('Donation ID not supplied. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); | 
                                                        |
| 25 | 25 | }  | 
                                                        
| 26 | 26 | |
| 27 | 27 | // Setup the variables  | 
                                                        
| 28 | -$payment_id = absint( $_GET['id'] );  | 
                                                        |
| 29 | -$payment = new Give_Payment( $payment_id );  | 
                                                        |
| 28 | +$payment_id = absint($_GET['id']);  | 
                                                        |
| 29 | +$payment = new Give_Payment($payment_id);  | 
                                                        |
| 30 | 30 | |
| 31 | 31 | // Sanity check... fail if purchase ID is invalid  | 
                                                        
| 32 | 32 | $payment_exists = $payment->ID;  | 
                                                        
| 33 | -if ( empty( $payment_exists ) ) { | 
                                                        |
| 34 | - wp_die( esc_html__( 'The specified ID does not belong to a payment. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );  | 
                                                        |
| 33 | +if (empty($payment_exists)) { | 
                                                        |
| 34 | +	wp_die(esc_html__('The specified ID does not belong to a payment. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); | 
                                                        |
| 35 | 35 | }  | 
                                                        
| 36 | 36 | |
| 37 | 37 | $number = $payment->number;  | 
                                                        
| 38 | 38 | $payment_meta = $payment->get_meta();  | 
                                                        
| 39 | -$transaction_id = esc_attr( $payment->transaction_id );  | 
                                                        |
| 39 | +$transaction_id = esc_attr($payment->transaction_id);  | 
                                                        |
| 40 | 40 | $user_id = $payment->user_id;  | 
                                                        
| 41 | 41 | $customer_id = $payment->customer_id;  | 
                                                        
| 42 | -$payment_date = strtotime( $payment->date );  | 
                                                        |
| 43 | -$user_info = give_get_payment_meta_user_info( $payment_id );  | 
                                                        |
| 42 | +$payment_date = strtotime($payment->date);  | 
                                                        |
| 43 | +$user_info = give_get_payment_meta_user_info($payment_id);  | 
                                                        |
| 44 | 44 | $address = $payment->address;  | 
                                                        
| 45 | 45 | $gateway = $payment->gateway;  | 
                                                        
| 46 | 46 | $currency_code = $payment->currency;  | 
                                                        
@@ -53,75 +53,75 @@ discard block  | 
                                                    ||
| 53 | 53 | <h1 id="transaction-details-heading"><?php  | 
                                                        
| 54 | 54 | printf(  | 
                                                        
| 55 | 55 | /* translators: %s: payment number */  | 
                                                        
| 56 | - esc_html__( 'Payment %s', 'give' ),  | 
                                                        |
| 56 | +			esc_html__('Payment %s', 'give'), | 
                                                        |
| 57 | 57 | $number  | 
                                                        
| 58 | 58 | );  | 
                                                        
| 59 | -		if ( $payment_mode == 'test' ) { | 
                                                        |
| 60 | - echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr__( 'This payment was made in Test Mode', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html__( 'Test Payment', 'give' ) . '</span>';  | 
                                                        |
| 59 | +		if ($payment_mode == 'test') { | 
                                                        |
| 60 | +			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="'.esc_attr__('This payment was made in Test Mode', 'give').'" data-tooltip-my-position="center left" data-tooltip-target-position="center right">'.esc_html__('Test Payment', 'give').'</span>'; | 
                                                        |
| 61 | 61 | }  | 
                                                        
| 62 | 62 | ?></h1>  | 
                                                        
| 63 | 63 | |
| 64 | - <?php do_action( 'give_view_order_details_before', $payment_id ); ?>  | 
                                                        |
| 64 | +	<?php do_action('give_view_order_details_before', $payment_id); ?> | 
                                                        |
| 65 | 65 | <form id="give-edit-order-form" method="post">  | 
                                                        
| 66 | - <?php do_action( 'give_view_order_details_form_top', $payment_id ); ?>  | 
                                                        |
| 66 | +		<?php do_action('give_view_order_details_form_top', $payment_id); ?> | 
                                                        |
| 67 | 67 | <div id="poststuff">  | 
                                                        
| 68 | 68 | <div id="give-dashboard-widgets-wrap">  | 
                                                        
| 69 | 69 | <div id="post-body" class="metabox-holder columns-2">  | 
                                                        
| 70 | 70 | <div id="postbox-container-1" class="postbox-container">  | 
                                                        
| 71 | 71 | <div id="side-sortables" class="meta-box-sortables ui-sortable">  | 
                                                        
| 72 | 72 | |
| 73 | - <?php do_action( 'give_view_order_details_sidebar_before', $payment_id ); ?>  | 
                                                        |
| 73 | +							<?php do_action('give_view_order_details_sidebar_before', $payment_id); ?> | 
                                                        |
| 74 | 74 | |
| 75 | 75 | <div id="give-order-update" class="postbox give-order-data">  | 
                                                        
| 76 | 76 | |
| 77 | 77 | <h3 class="hndle">  | 
                                                        
| 78 | - <span><?php esc_html_e( 'Update Payment', 'give' ); ?></span>  | 
                                                        |
| 78 | +									<span><?php esc_html_e('Update Payment', 'give'); ?></span> | 
                                                        |
| 79 | 79 | </h3>  | 
                                                        
| 80 | 80 | |
| 81 | 81 | <div class="inside">  | 
                                                        
| 82 | 82 | <div class="give-admin-box">  | 
                                                        
| 83 | 83 | |
| 84 | - <?php do_action( 'give_view_order_details_totals_before', $payment_id ); ?>  | 
                                                        |
| 84 | +										<?php do_action('give_view_order_details_totals_before', $payment_id); ?> | 
                                                        |
| 85 | 85 | |
| 86 | 86 | <div class="give-admin-box-inside">  | 
                                                        
| 87 | 87 | <p>  | 
                                                        
| 88 | - <span class="label"><?php esc_html_e( 'Status:', 'give' ); ?></span>   | 
                                                        |
| 88 | +												<span class="label"><?php esc_html_e('Status:', 'give'); ?></span>  | 
                                                        |
| 89 | 89 | <select name="give-payment-status" class="medium-text">  | 
                                                        
| 90 | - <?php foreach ( give_get_payment_statuses() as $key => $status ) : ?>  | 
                                                        |
| 91 | - <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option>  | 
                                                        |
| 90 | + <?php foreach (give_get_payment_statuses() as $key => $status) : ?>  | 
                                                        |
| 91 | + <option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option>  | 
                                                        |
| 92 | 92 | <?php endforeach; ?>  | 
                                                        
| 93 | 93 | </select>  | 
                                                        
| 94 | - <span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span>  | 
                                                        |
| 94 | + <span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span>  | 
                                                        |
| 95 | 95 | </p>  | 
                                                        
| 96 | 96 | </div>  | 
                                                        
| 97 | 97 | |
| 98 | 98 | <div class="give-admin-box-inside">  | 
                                                        
| 99 | 99 | <p>  | 
                                                        
| 100 | - <span class="label"><?php esc_html_e( 'Date:', 'give' ); ?></span>   | 
                                                        |
| 101 | - <input type="text" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/>  | 
                                                        |
| 100 | +												<span class="label"><?php esc_html_e('Date:', 'give'); ?></span>  | 
                                                        |
| 101 | +												<input type="text" name="give-payment-date" value="<?php echo esc_attr(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/> | 
                                                        |
| 102 | 102 | </p>  | 
                                                        
| 103 | 103 | </div>  | 
                                                        
| 104 | 104 | |
| 105 | 105 | <div class="give-admin-box-inside">  | 
                                                        
| 106 | 106 | <p>  | 
                                                        
| 107 | - <span class="label"><?php esc_html_e( 'Time:', 'give' ); ?></span>   | 
                                                        |
| 108 | - <input type="number" step="1" max="24" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/> :   | 
                                                        |
| 109 | - <input type="number" step="1" max="59" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/>  | 
                                                        |
| 107 | +												<span class="label"><?php esc_html_e('Time:', 'give'); ?></span>  | 
                                                        |
| 108 | +												<input type="number" step="1" max="24" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/> :  | 
                                                        |
| 109 | +												<input type="number" step="1" max="59" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/> | 
                                                        |
| 110 | 110 | </p>  | 
                                                        
| 111 | 111 | </div>  | 
                                                        
| 112 | 112 | |
| 113 | - <?php do_action( 'give_view_order_details_update_inner', $payment_id ); ?>  | 
                                                        |
| 113 | +										<?php do_action('give_view_order_details_update_inner', $payment_id); ?> | 
                                                        |
| 114 | 114 | |
| 115 | 115 | <?php  | 
                                                        
| 116 | 116 | //@TODO: Fees  | 
                                                        
| 117 | - $fees = give_get_payment_fees( $payment_id );  | 
                                                        |
| 118 | - if ( ! empty( $fees ) ) : ?>  | 
                                                        |
| 117 | + $fees = give_get_payment_fees($payment_id);  | 
                                                        |
| 118 | + if ( ! empty($fees)) : ?>  | 
                                                        |
| 119 | 119 | <div class="give-order-fees give-admin-box-inside">  | 
                                                        
| 120 | - <p class="strong"><?php esc_html_e( 'Fees', 'give' ); ?>:</p>  | 
                                                        |
| 120 | +												<p class="strong"><?php esc_html_e('Fees', 'give'); ?>:</p> | 
                                                        |
| 121 | 121 | <ul class="give-payment-fees">  | 
                                                        
| 122 | - <?php foreach ( $fees as $fee ) : ?>  | 
                                                        |
| 122 | + <?php foreach ($fees as $fee) : ?>  | 
                                                        |
| 123 | 123 | <li>  | 
                                                        
| 124 | - <span class="fee-label"><?php echo $fee['label'] . ':</span> ' . '<span class="fee-amount" data-fee="' . esc_attr( $fee['amount'] ) . '">' . give_currency_filter( $fee['amount'], $currency_code ); ?></span>  | 
                                                        |
| 124 | + <span class="fee-label"><?php echo $fee['label'].':</span> '.'<span class="fee-amount" data-fee="'.esc_attr($fee['amount']).'">'.give_currency_filter($fee['amount'], $currency_code); ?></span>  | 
                                                        |
| 125 | 125 | </li>  | 
                                                        
| 126 | 126 | <?php endforeach; ?>  | 
                                                        
| 127 | 127 | </ul>  | 
                                                        
@@ -131,12 +131,12 @@ discard block  | 
                                                    ||
| 131 | 131 | |
| 132 | 132 | <div class="give-order-payment give-admin-box-inside">  | 
                                                        
| 133 | 133 | <p>  | 
                                                        
| 134 | - <span class="label"><?php esc_html_e( 'Total Donation', 'give' ); ?>:</span>   | 
                                                        |
| 135 | - <?php echo give_currency_symbol( $payment->currency ); ?> <input name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_get_payment_amount( $payment_id ) ) ); ?>"/>  | 
                                                        |
| 134 | +												<span class="label"><?php esc_html_e('Total Donation', 'give'); ?>:</span>  | 
                                                        |
| 135 | + <?php echo give_currency_symbol($payment->currency); ?> <input name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_get_payment_amount($payment_id))); ?>"/>  | 
                                                        |
| 136 | 136 | </p>  | 
                                                        
| 137 | 137 | </div>  | 
                                                        
| 138 | 138 | |
| 139 | - <?php do_action( 'give_view_order_details_totals_after', $payment_id ); ?>  | 
                                                        |
| 139 | +										<?php do_action('give_view_order_details_totals_after', $payment_id); ?> | 
                                                        |
| 140 | 140 | |
| 141 | 141 | </div>  | 
                                                        
| 142 | 142 | <!-- /.give-admin-box -->  | 
                                                        
@@ -145,20 +145,20 @@ discard block  | 
                                                    ||
| 145 | 145 | <!-- /.inside -->  | 
                                                        
| 146 | 146 | |
| 147 | 147 | <div class="give-order-update-box give-admin-box">  | 
                                                        
| 148 | - <?php do_action( 'give_view_order_details_update_before', $payment_id ); ?>  | 
                                                        |
| 148 | +									<?php do_action('give_view_order_details_update_before', $payment_id); ?> | 
                                                        |
| 149 | 149 | <div id="major-publishing-actions">  | 
                                                        
| 150 | 150 | <div id="publishing-action">  | 
                                                        
| 151 | - <input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Payment', 'give' ); ?>"/>  | 
                                                        |
| 152 | - <?php if ( give_is_payment_complete( $payment_id ) ) : ?>  | 
                                                        |
| 153 | - <a href="<?php echo esc_url( add_query_arg( array(  | 
                                                        |
| 151 | +											<input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Payment', 'give'); ?>"/> | 
                                                        |
| 152 | + <?php if (give_is_payment_complete($payment_id)) : ?>  | 
                                                        |
| 153 | + <a href="<?php echo esc_url(add_query_arg(array(  | 
                                                        |
| 154 | 154 | 'give-action' => 'email_links',  | 
                                                        
| 155 | 155 | 'purchase_id' => $payment_id  | 
                                                        
| 156 | - ) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a>  | 
                                                        |
| 156 | +												))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a> | 
                                                        |
| 157 | 157 | <?php endif; ?>  | 
                                                        
| 158 | 158 | </div>  | 
                                                        
| 159 | 159 | <div class="clear"></div>  | 
                                                        
| 160 | 160 | </div>  | 
                                                        
| 161 | - <?php do_action( 'give_view_order_details_update_after', $payment_id ); ?>  | 
                                                        |
| 161 | +									<?php do_action('give_view_order_details_update_after', $payment_id); ?> | 
                                                        |
| 162 | 162 | </div>  | 
                                                        
| 163 | 163 | <!-- /.give-order-update-box -->  | 
                                                        
| 164 | 164 | |
@@ -168,56 +168,56 @@ discard block  | 
                                                    ||
| 168 | 168 | <div id="give-order-details" class="postbox give-order-data">  | 
                                                        
| 169 | 169 | |
| 170 | 170 | <h3 class="hndle">  | 
                                                        
| 171 | - <span><?php esc_html_e( 'Payment Meta', 'give' ); ?></span>  | 
                                                        |
| 171 | +									<span><?php esc_html_e('Payment Meta', 'give'); ?></span> | 
                                                        |
| 172 | 172 | </h3>  | 
                                                        
| 173 | 173 | |
| 174 | 174 | <div class="inside">  | 
                                                        
| 175 | 175 | <div class="give-admin-box">  | 
                                                        
| 176 | 176 | |
| 177 | - <?php do_action( 'give_view_order_details_payment_meta_before', $payment_id ); ?>  | 
                                                        |
| 177 | +										<?php do_action('give_view_order_details_payment_meta_before', $payment_id); ?> | 
                                                        |
| 178 | 178 | |
| 179 | 179 | <?php  | 
                                                        
| 180 | - $gateway = give_get_payment_gateway( $payment_id );  | 
                                                        |
| 181 | - if ( $gateway ) : ?>  | 
                                                        |
| 180 | + $gateway = give_get_payment_gateway($payment_id);  | 
                                                        |
| 181 | + if ($gateway) : ?>  | 
                                                        |
| 182 | 182 | <div class="give-order-gateway give-admin-box-inside">  | 
                                                        
| 183 | 183 | <p>  | 
                                                        
| 184 | - <span class="label"><?php esc_html_e( 'Gateway:', 'give' ); ?></span>   | 
                                                        |
| 185 | - <?php echo give_get_gateway_admin_label( $gateway ); ?>  | 
                                                        |
| 184 | +													<span class="label"><?php esc_html_e('Gateway:', 'give'); ?></span>  | 
                                                        |
| 185 | + <?php echo give_get_gateway_admin_label($gateway); ?>  | 
                                                        |
| 186 | 186 | </p>  | 
                                                        
| 187 | 187 | </div>  | 
                                                        
| 188 | 188 | <?php endif; ?>  | 
                                                        
| 189 | 189 | |
| 190 | 190 | <div class="give-order-payment-key give-admin-box-inside">  | 
                                                        
| 191 | 191 | <p>  | 
                                                        
| 192 | - <span class="label"><?php esc_html_e( 'Key:', 'give' ); ?></span>   | 
                                                        |
| 193 | - <span><?php echo give_get_payment_key( $payment_id ); ?></span>  | 
                                                        |
| 192 | +												<span class="label"><?php esc_html_e('Key:', 'give'); ?></span>  | 
                                                        |
| 193 | + <span><?php echo give_get_payment_key($payment_id); ?></span>  | 
                                                        |
| 194 | 194 | </p>  | 
                                                        
| 195 | 195 | </div>  | 
                                                        
| 196 | 196 | |
| 197 | 197 | <div class="give-order-ip give-admin-box-inside">  | 
                                                        
| 198 | 198 | <p>  | 
                                                        
| 199 | - <span class="label"><?php esc_html_e( 'IP:', 'give' ); ?></span>   | 
                                                        |
| 200 | - <span><?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?></span>  | 
                                                        |
| 199 | +												<span class="label"><?php esc_html_e('IP:', 'give'); ?></span>  | 
                                                        |
| 200 | + <span><?php echo esc_html(give_get_payment_user_ip($payment_id)); ?></span>  | 
                                                        |
| 201 | 201 | </p>  | 
                                                        
| 202 | 202 | </div>  | 
                                                        
| 203 | 203 | |
| 204 | - <?php if ( $transaction_id ) : ?>  | 
                                                        |
| 204 | + <?php if ($transaction_id) : ?>  | 
                                                        |
| 205 | 205 | <div class="give-order-tx-id give-admin-box-inside">  | 
                                                        
| 206 | 206 | <p>  | 
                                                        
| 207 | - <span class="label"><?php esc_html_e( 'Transaction ID:', 'give' ); ?></span>   | 
                                                        |
| 208 | - <span><?php echo apply_filters( 'give_payment_details_transaction_id-' . $gateway, $transaction_id, $payment_id ); ?></span>  | 
                                                        |
| 207 | +													<span class="label"><?php esc_html_e('Transaction ID:', 'give'); ?></span>  | 
                                                        |
| 208 | +													<span><?php echo apply_filters('give_payment_details_transaction_id-'.$gateway, $transaction_id, $payment_id); ?></span> | 
                                                        |
| 209 | 209 | </p>  | 
                                                        
| 210 | 210 | </div>  | 
                                                        
| 211 | 211 | <?php endif; ?>  | 
                                                        
| 212 | -										<?php if(current_user_can('view_give_sensitive_data')) { ?> | 
                                                        |
| 212 | +										<?php if (current_user_can('view_give_sensitive_data')) { ?> | 
                                                        |
| 213 | 213 | <div class="give-admin-box-inside">  | 
                                                        
| 214 | - <p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( esc_attr( give_get_payment_user_email( $payment_id ) ) ) ); ?>  | 
                                                        |
| 215 | - <a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor »', 'give' ); ?></a>  | 
                                                        |
| 214 | +												<p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode(esc_attr(give_get_payment_user_email($payment_id)))); ?> | 
                                                        |
| 215 | +													<a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor »', 'give'); ?></a> | 
                                                        |
| 216 | 216 | </p>  | 
                                                        
| 217 | 217 | </div>  | 
                                                        
| 218 | 218 | <?php } ?>  | 
                                                        
| 219 | 219 | |
| 220 | - <?php do_action( 'give_view_order_details_payment_meta_after', $payment_id ); ?>  | 
                                                        |
| 220 | +										<?php do_action('give_view_order_details_payment_meta_after', $payment_id); ?> | 
                                                        |
| 221 | 221 | |
| 222 | 222 | </div>  | 
                                                        
| 223 | 223 | <!-- /.column-container -->  | 
                                                        
@@ -228,7 +228,7 @@ discard block  | 
                                                    ||
| 228 | 228 | </div>  | 
                                                        
| 229 | 229 | <!-- /#give-order-data -->  | 
                                                        
| 230 | 230 | |
| 231 | - <?php do_action( 'give_view_order_details_sidebar_after', $payment_id ); ?>  | 
                                                        |
| 231 | +							<?php do_action('give_view_order_details_sidebar_after', $payment_id); ?> | 
                                                        |
| 232 | 232 | |
| 233 | 233 | </div>  | 
                                                        
| 234 | 234 | <!-- /#side-sortables -->  | 
                                                        
@@ -239,12 +239,12 @@ discard block  | 
                                                    ||
| 239 | 239 | |
| 240 | 240 | <div id="normal-sortables" class="meta-box-sortables ui-sortable">  | 
                                                        
| 241 | 241 | |
| 242 | - <?php do_action( 'give_view_order_details_main_before', $payment_id ); ?>  | 
                                                        |
| 242 | +							<?php do_action('give_view_order_details_main_before', $payment_id); ?> | 
                                                        |
| 243 | 243 | |
| 244 | 244 | <?php $column_count = 'columns-3'; ?>  | 
                                                        
| 245 | 245 | <div id="give-donation-overview" class="postbox <?php echo $column_count; ?>">  | 
                                                        
| 246 | 246 | <h3 class="hndle">  | 
                                                        
| 247 | - <span><?php esc_html_e( 'Donation Information', 'give' ); ?></span>  | 
                                                        |
| 247 | +									<span><?php esc_html_e('Donation Information', 'give'); ?></span> | 
                                                        |
| 248 | 248 | </h3>  | 
                                                        
| 249 | 249 | |
| 250 | 250 | <div class="inside">  | 
                                                        
@@ -252,32 +252,32 @@ discard block  | 
                                                    ||
| 252 | 252 | <table style="width:100%;">  | 
                                                        
| 253 | 253 | <thead>  | 
                                                        
| 254 | 254 | <tr>  | 
                                                        
| 255 | - <?php do_action( 'give_donation_details_thead_before', $payment_id ); ?>  | 
                                                        |
| 256 | - <th><?php esc_html_e( 'Donation Form ID', 'give' ) ?></th>  | 
                                                        |
| 257 | - <th><?php esc_html_e( 'Donation Form Title', 'give' ) ?></th>  | 
                                                        |
| 258 | - <th><?php esc_html_e( 'Donation Level', 'give' ) ?></th>  | 
                                                        |
| 259 | - <th><?php esc_html_e( 'Donation Date', 'give' ) ?></th>  | 
                                                        |
| 260 | - <th><?php esc_html_e( 'Total Donation', 'give' ) ?></th>  | 
                                                        |
| 261 | - <?php do_action( 'give_donation_details_thead_after', $payment_id ); ?>  | 
                                                        |
| 255 | +											<?php do_action('give_donation_details_thead_before', $payment_id); ?> | 
                                                        |
| 256 | +											<th><?php esc_html_e('Donation Form ID', 'give') ?></th> | 
                                                        |
| 257 | +											<th><?php esc_html_e('Donation Form Title', 'give') ?></th> | 
                                                        |
| 258 | +											<th><?php esc_html_e('Donation Level', 'give') ?></th> | 
                                                        |
| 259 | +											<th><?php esc_html_e('Donation Date', 'give') ?></th> | 
                                                        |
| 260 | +											<th><?php esc_html_e('Total Donation', 'give') ?></th> | 
                                                        |
| 261 | +											<?php do_action('give_donation_details_thead_after', $payment_id); ?> | 
                                                        |
| 262 | 262 | </tr>  | 
                                                        
| 263 | 263 | </thead>  | 
                                                        
| 264 | 264 | <tr>  | 
                                                        
| 265 | - <?php do_action( 'give_donation_details_tbody_before', $payment_id ); ?>  | 
                                                        |
| 265 | +											<?php do_action('give_donation_details_tbody_before', $payment_id); ?> | 
                                                        |
| 266 | 266 | <td>  | 
                                                        
| 267 | 267 | <?php echo $payment_meta['form_id']; ?>  | 
                                                        
| 268 | 268 | </td>  | 
                                                        
| 269 | 269 | <td>  | 
                                                        
| 270 | - <?php give_get_form_dropdown( array(  | 
                                                        |
| 270 | + <?php give_get_form_dropdown(array(  | 
                                                        |
| 271 | 271 | 'id' => $payment_meta['form_id'],  | 
                                                        
| 272 | 272 | 'selected' => $payment_meta['form_id'],  | 
                                                        
| 273 | 273 | 'chosen' => true  | 
                                                        
| 274 | - ), true ); ?>  | 
                                                        |
| 274 | + ), true); ?>  | 
                                                        |
| 275 | 275 | </td>  | 
                                                        
| 276 | 276 | <td>  | 
                                                        
| 277 | 277 | <?php  | 
                                                        
| 278 | - $var_prices = give_has_variable_prices( $payment_meta['form_id'] );  | 
                                                        |
| 279 | -												if ( empty( $var_prices ) ) { | 
                                                        |
| 280 | - echo esc_html__( 'n/a', 'give' );  | 
                                                        |
| 278 | + $var_prices = give_has_variable_prices($payment_meta['form_id']);  | 
                                                        |
| 279 | +												if (empty($var_prices)) { | 
                                                        |
| 280 | +													echo esc_html__('n/a', 'give'); | 
                                                        |
| 281 | 281 |  												} else { | 
                                                        
| 282 | 282 | // Variable price dropdown options.  | 
                                                        
| 283 | 283 | $variable_price_dropdown_option = array(  | 
                                                        
@@ -289,20 +289,20 @@ discard block  | 
                                                    ||
| 289 | 289 | );  | 
                                                        
| 290 | 290 | |
| 291 | 291 | // Render variable prices select tag html.  | 
                                                        
| 292 | - give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );  | 
                                                        |
| 292 | + give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);  | 
                                                        |
| 293 | 293 | }  | 
                                                        
| 294 | 294 | ?>  | 
                                                        
| 295 | 295 | </td>  | 
                                                        
| 296 | 296 | <td>  | 
                                                        
| 297 | 297 | <?php  | 
                                                        
| 298 | 298 | //Transaction Date  | 
                                                        
| 299 | - $date_format = get_option( 'date_format' );  | 
                                                        |
| 300 | - echo date_i18n( $date_format, $payment_date );  | 
                                                        |
| 299 | +												$date_format = get_option('date_format'); | 
                                                        |
| 300 | + echo date_i18n($date_format, $payment_date);  | 
                                                        |
| 301 | 301 | ?>  | 
                                                        
| 302 | 302 | </td>  | 
                                                        
| 303 | 303 | <td>  | 
                                                        
| 304 | - <?php echo esc_html( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ) ); ?></td>  | 
                                                        |
| 305 | - <?php do_action( 'give_donation_details_tbody_after', $payment_id ); ?>  | 
                                                        |
| 304 | + <?php echo esc_html(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)))); ?></td>  | 
                                                        |
| 305 | +											<?php do_action('give_donation_details_tbody_after', $payment_id); ?> | 
                                                        |
| 306 | 306 | |
| 307 | 307 | </tr>  | 
                                                        
| 308 | 308 | </table>  | 
                                                        
@@ -314,65 +314,65 @@ discard block  | 
                                                    ||
| 314 | 314 | </div>  | 
                                                        
| 315 | 315 | <!-- /#give-donation-overview -->  | 
                                                        
| 316 | 316 | |
| 317 | - <?php do_action( 'give_view_order_details_files_after', $payment_id ); ?>  | 
                                                        |
| 317 | +							<?php do_action('give_view_order_details_files_after', $payment_id); ?> | 
                                                        |
| 318 | 318 | |
| 319 | - <?php do_action( 'give_view_order_details_billing_before', $payment_id ); ?>  | 
                                                        |
| 319 | +							<?php do_action('give_view_order_details_billing_before', $payment_id); ?> | 
                                                        |
| 320 | 320 | |
| 321 | -							<?php if(current_user_can('view_give_sensitive_data')) { ?> | 
                                                        |
| 321 | +							<?php if (current_user_can('view_give_sensitive_data')) { ?> | 
                                                        |
| 322 | 322 | |
| 323 | 323 | <div id="give-customer-details" class="postbox">  | 
                                                        
| 324 | 324 | <h3 class="hndle">  | 
                                                        
| 325 | - <span><?php esc_html_e( 'Donor Details', 'give' ); ?></span>  | 
                                                        |
| 325 | +										<span><?php esc_html_e('Donor Details', 'give'); ?></span> | 
                                                        |
| 326 | 326 | </h3>  | 
                                                        
| 327 | 327 | |
| 328 | 328 | <div class="inside give-clearfix">  | 
                                                        
| 329 | 329 | |
| 330 | - <?php $customer = new Give_Customer( $customer_id ); ?>  | 
                                                        |
| 330 | + <?php $customer = new Give_Customer($customer_id); ?>  | 
                                                        |
| 331 | 331 | |
| 332 | 332 | <div class="column-container customer-info">  | 
                                                        
| 333 | 333 | <div class="column">  | 
                                                        
| 334 | - <?php echo Give()->html->donor_dropdown( array(  | 
                                                        |
| 334 | + <?php echo Give()->html->donor_dropdown(array(  | 
                                                        |
| 335 | 335 | 'selected' => $customer->id,  | 
                                                        
| 336 | 336 | 'name' => 'customer-id'  | 
                                                        
| 337 | - ) ); ?>  | 
                                                        |
| 337 | + )); ?>  | 
                                                        |
| 338 | 338 | </div>  | 
                                                        
| 339 | 339 | <div class="column">  | 
                                                        
| 340 | 340 | <input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/>  | 
                                                        
| 341 | 341 | </div>  | 
                                                        
| 342 | 342 | <div class="column">  | 
                                                        
| 343 | - <?php if ( ! empty( $customer->id ) ) : ?>  | 
                                                        |
| 344 | - <?php $customer_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); ?>  | 
                                                        |
| 345 | - <a href="<?php echo $customer_url; ?>" title="<?php esc_attr_e( 'View Donor Details', 'give' ); ?>"><?php esc_html_e( 'View Donor Details', 'give' ); ?></a>  | 
                                                        |
| 343 | + <?php if ( ! empty($customer->id)) : ?>  | 
                                                        |
| 344 | +													<?php $customer_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); ?> | 
                                                        |
| 345 | +													<a href="<?php echo $customer_url; ?>" title="<?php esc_attr_e('View Donor Details', 'give'); ?>"><?php esc_html_e('View Donor Details', 'give'); ?></a> | 
                                                        |
| 346 | 346 |  |   | 
                                                        
| 347 | 347 | <?php endif; ?>  | 
                                                        
| 348 | - <a href="#new" class="give-payment-new-customer" title="<?php esc_attr_e( 'New Donor', 'give' ); ?>"><?php esc_html_e( 'New Donor', 'give' ); ?></a>  | 
                                                        |
| 348 | +												<a href="#new" class="give-payment-new-customer" title="<?php esc_attr_e('New Donor', 'give'); ?>"><?php esc_html_e('New Donor', 'give'); ?></a> | 
                                                        |
| 349 | 349 | </div>  | 
                                                        
| 350 | 350 | </div>  | 
                                                        
| 351 | 351 | |
| 352 | 352 | <div class="column-container new-customer" style="display: none">  | 
                                                        
| 353 | 353 | <div class="column">  | 
                                                        
| 354 | - <label for="give-new-customer-name"><?php esc_html_e( 'Name:', 'give' ); ?></label>   | 
                                                        |
| 354 | +												<label for="give-new-customer-name"><?php esc_html_e('Name:', 'give'); ?></label>  | 
                                                        |
| 355 | 355 | <input id="give-new-customer-name" type="text" name="give-new-customer-name" value="" class="medium-text"/>  | 
                                                        
| 356 | 356 | </div>  | 
                                                        
| 357 | 357 | <div class="column">  | 
                                                        
| 358 | - <label for="give-new-customer-email"><?php esc_html_e( 'Email:', 'give' ); ?></label>   | 
                                                        |
| 358 | +												<label for="give-new-customer-email"><?php esc_html_e('Email:', 'give'); ?></label>  | 
                                                        |
| 359 | 359 | <input id="give-new-customer-email" type="email" name="give-new-customer-email" value="" class="medium-text"/>  | 
                                                        
| 360 | 360 | </div>  | 
                                                        
| 361 | 361 | <div class="column">  | 
                                                        
| 362 | 362 | <input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/>  | 
                                                        
| 363 | - <a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>  | 
                                                        |
| 363 | +												<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a> | 
                                                        |
| 364 | 364 | </div>  | 
                                                        
| 365 | 365 | <div class="column">  | 
                                                        
| 366 | 366 | <small>  | 
                                                        
| 367 | - <em>*<?php esc_html_e( 'Click "Save Payment" to create new donor', 'give' ); ?></em>  | 
                                                        |
| 367 | +													<em>*<?php esc_html_e('Click "Save Payment" to create new donor', 'give'); ?></em> | 
                                                        |
| 368 | 368 | </small>  | 
                                                        
| 369 | 369 | </div>  | 
                                                        
| 370 | 370 | </div>  | 
                                                        
| 371 | 371 | |
| 372 | 372 | <?php  | 
                                                        
| 373 | 373 | // The give_payment_personal_details_list hook is left here for backwards compatibility  | 
                                                        
| 374 | - do_action( 'give_payment_personal_details_list', $payment_meta, $user_info );  | 
                                                        |
| 375 | - do_action( 'give_payment_view_details', $payment_id );  | 
                                                        |
| 374 | +										do_action('give_payment_personal_details_list', $payment_meta, $user_info); | 
                                                        |
| 375 | +										do_action('give_payment_view_details', $payment_id); | 
                                                        |
| 376 | 376 | ?>  | 
                                                        
| 377 | 377 | |
| 378 | 378 | </div>  | 
                                                        
@@ -383,7 +383,7 @@ discard block  | 
                                                    ||
| 383 | 383 | |
| 384 | 384 | <div id="give-billing-details" class="postbox">  | 
                                                        
| 385 | 385 | <h3 class="hndle">  | 
                                                        
| 386 | - <span><?php esc_html_e( 'Billing Address', 'give' ); ?></span>  | 
                                                        |
| 386 | +										<span><?php esc_html_e('Billing Address', 'give'); ?></span> | 
                                                        |
| 387 | 387 | </h3>  | 
                                                        
| 388 | 388 | |
| 389 | 389 | <div class="inside give-clearfix">  | 
                                                        
@@ -394,62 +394,62 @@ discard block  | 
                                                    ||
| 394 | 394 | <div class="data column-container">  | 
                                                        
| 395 | 395 | <div class="column">  | 
                                                        
| 396 | 396 | <div class="give-wrap-address-line1">  | 
                                                        
| 397 | - <label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Street Address Line 1:', 'give' ); ?></label>  | 
                                                        |
| 398 | - <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/>  | 
                                                        |
| 397 | +															<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e('Street Address Line 1:', 'give'); ?></label> | 
                                                        |
| 398 | + <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/>  | 
                                                        |
| 399 | 399 | </div>  | 
                                                        
| 400 | 400 | |
| 401 | 401 | <div class="give-wrap-address-line2">  | 
                                                        
| 402 | - <label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Street Address Line 2:', 'give' ); ?></label>  | 
                                                        |
| 403 | - <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/>  | 
                                                        |
| 402 | +															<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e('Street Address Line 2:', 'give'); ?></label> | 
                                                        |
| 403 | + <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/>  | 
                                                        |
| 404 | 404 | </div>  | 
                                                        
| 405 | 405 | |
| 406 | 406 | </div>  | 
                                                        
| 407 | 407 | <div class="column">  | 
                                                        
| 408 | 408 | <div class="give-wrap-address-city">  | 
                                                        
| 409 | - <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label>  | 
                                                        |
| 410 | - <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/>  | 
                                                        |
| 409 | +															<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label> | 
                                                        |
| 410 | + <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/>  | 
                                                        |
| 411 | 411 | |
| 412 | 412 | </div>  | 
                                                        
| 413 | 413 | |
| 414 | 414 | <div class="give-wrap-address-zip">  | 
                                                        
| 415 | - <label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label>  | 
                                                        |
| 416 | - <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/>  | 
                                                        |
| 415 | +															<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></label> | 
                                                        |
| 416 | + <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/>  | 
                                                        |
| 417 | 417 | |
| 418 | 418 | </div>  | 
                                                        
| 419 | 419 | </div>  | 
                                                        
| 420 | 420 | <div class="column">  | 
                                                        
| 421 | 421 | <div id="give-order-address-country-wrap">  | 
                                                        
| 422 | - <label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label>  | 
                                                        |
| 422 | +															<label class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></label> | 
                                                        |
| 423 | 423 | <?php  | 
                                                        
| 424 | - echo Give()->html->select( array(  | 
                                                        |
| 424 | + echo Give()->html->select(array(  | 
                                                        |
| 425 | 425 | 'options' => give_get_country_list(),  | 
                                                        
| 426 | 426 | 'name' => 'give-payment-address[0][country]',  | 
                                                        
| 427 | 427 | 'selected' => $address['country'],  | 
                                                        
| 428 | 428 | 'show_option_all' => false,  | 
                                                        
| 429 | 429 | 'show_option_none' => false,  | 
                                                        
| 430 | 430 | 'chosen' => true,  | 
                                                        
| 431 | - 'placeholder' => esc_attr__( 'Select a country', 'give' )  | 
                                                        |
| 432 | - ) );  | 
                                                        |
| 431 | +																'placeholder'      => esc_attr__('Select a country', 'give') | 
                                                        |
| 432 | + ));  | 
                                                        |
| 433 | 433 | ?>  | 
                                                        
| 434 | 434 | </div>  | 
                                                        
| 435 | 435 | |
| 436 | 436 | <div id="give-order-address-state-wrap">  | 
                                                        
| 437 | - <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></label>  | 
                                                        |
| 437 | +															<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province:', 'give'); ?></label> | 
                                                        |
| 438 | 438 | <?php  | 
                                                        
| 439 | - $states = give_get_states( $address['country'] );  | 
                                                        |
| 440 | -															if ( ! empty( $states ) ) { | 
                                                        |
| 441 | - echo Give()->html->select( array(  | 
                                                        |
| 439 | + $states = give_get_states($address['country']);  | 
                                                        |
| 440 | +															if ( ! empty($states)) { | 
                                                        |
| 441 | + echo Give()->html->select(array(  | 
                                                        |
| 442 | 442 | 'options' => $states,  | 
                                                        
| 443 | 443 | 'name' => 'give-payment-address[0][state]',  | 
                                                        
| 444 | 444 | 'selected' => $address['state'],  | 
                                                        
| 445 | 445 | 'show_option_all' => false,  | 
                                                        
| 446 | 446 | 'show_option_none' => false,  | 
                                                        
| 447 | 447 | 'chosen' => true,  | 
                                                        
| 448 | - 'placeholder' => esc_attr__( 'Select a state', 'give' )  | 
                                                        |
| 449 | - ) );  | 
                                                        |
| 448 | +																	'placeholder'      => esc_attr__('Select a state', 'give') | 
                                                        |
| 449 | + ));  | 
                                                        |
| 450 | 450 |  															} else { | 
                                                        
| 451 | 451 | ?>  | 
                                                        
| 452 | - <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/>  | 
                                                        |
| 452 | + <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/>  | 
                                                        |
| 453 | 453 | <?php  | 
                                                        
| 454 | 454 | } ?>  | 
                                                        
| 455 | 455 | </div>  | 
                                                        
@@ -459,38 +459,38 @@ discard block  | 
                                                    ||
| 459 | 459 | </div>  | 
                                                        
| 460 | 460 | <!-- /#give-order-address -->  | 
                                                        
| 461 | 461 | |
| 462 | - <?php do_action( 'give_payment_billing_details', $payment_id ); ?>  | 
                                                        |
| 462 | +										<?php do_action('give_payment_billing_details', $payment_id); ?> | 
                                                        |
| 463 | 463 | |
| 464 | 464 | </div>  | 
                                                        
| 465 | 465 | <!-- /.inside -->  | 
                                                        
| 466 | 466 | </div>  | 
                                                        
| 467 | 467 | <!-- /#give-billing-details -->  | 
                                                        
| 468 | 468 | <?php } ?>  | 
                                                        
| 469 | - <?php do_action( 'give_view_order_details_billing_after', $payment_id ); ?>  | 
                                                        |
| 469 | +							<?php do_action('give_view_order_details_billing_after', $payment_id); ?> | 
                                                        |
| 470 | 470 | |
| 471 | 471 | <div id="give-payment-notes" class="postbox">  | 
                                                        
| 472 | - <h3 class="hndle"><span><?php esc_html_e( 'Payment Notes', 'give' ); ?></span></h3>  | 
                                                        |
| 472 | +								<h3 class="hndle"><span><?php esc_html_e('Payment Notes', 'give'); ?></span></h3> | 
                                                        |
| 473 | 473 | |
| 474 | 474 | <div class="inside">  | 
                                                        
| 475 | 475 | <div id="give-payment-notes-inner">  | 
                                                        
| 476 | 476 | <?php  | 
                                                        
| 477 | - $notes = give_get_payment_notes( $payment_id );  | 
                                                        |
| 478 | - if ( ! empty( $notes ) ) :  | 
                                                        |
| 477 | + $notes = give_get_payment_notes($payment_id);  | 
                                                        |
| 478 | + if ( ! empty($notes)) :  | 
                                                        |
| 479 | 479 | $no_notes_display = ' style="display:none;"';  | 
                                                        
| 480 | - foreach ( $notes as $note ) :  | 
                                                        |
| 480 | + foreach ($notes as $note) :  | 
                                                        |
| 481 | 481 | |
| 482 | - echo give_get_payment_note_html( $note, $payment_id );  | 
                                                        |
| 482 | + echo give_get_payment_note_html($note, $payment_id);  | 
                                                        |
| 483 | 483 | |
| 484 | 484 | endforeach;  | 
                                                        
| 485 | 485 | else :  | 
                                                        
| 486 | 486 | $no_notes_display = '';  | 
                                                        
| 487 | 487 | endif;  | 
                                                        
| 488 | - echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No payment notes', 'give' ) . '</p>'; ?>  | 
                                                        |
| 488 | +										echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No payment notes', 'give').'</p>'; ?> | 
                                                        |
| 489 | 489 | </div>  | 
                                                        
| 490 | 490 | <textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea>  | 
                                                        
| 491 | 491 | |
| 492 | 492 | <div class="give-clearfix">  | 
                                                        
| 493 | - <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button>  | 
                                                        |
| 493 | +										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php esc_html_e('Add Note', 'give'); ?></button> | 
                                                        |
| 494 | 494 | </div>  | 
                                                        
| 495 | 495 | |
| 496 | 496 | </div>  | 
                                                        
@@ -498,7 +498,7 @@ discard block  | 
                                                    ||
| 498 | 498 | </div>  | 
                                                        
| 499 | 499 | <!-- /#give-payment-notes -->  | 
                                                        
| 500 | 500 | |
| 501 | - <?php do_action( 'give_view_order_details_main_after', $payment_id ); ?>  | 
                                                        |
| 501 | +							<?php do_action('give_view_order_details_main_after', $payment_id); ?> | 
                                                        |
| 502 | 502 | </div>  | 
                                                        
| 503 | 503 | <!-- /#normal-sortables -->  | 
                                                        
| 504 | 504 | </div>  | 
                                                        
@@ -509,10 +509,10 @@ discard block  | 
                                                    ||
| 509 | 509 | <!-- #give-dashboard-widgets-wrap -->  | 
                                                        
| 510 | 510 | </div>  | 
                                                        
| 511 | 511 | <!-- /#post-stuff -->  | 
                                                        
| 512 | - <?php do_action( 'give_view_order_details_form_bottom', $payment_id ); ?>  | 
                                                        |
| 513 | - <?php wp_nonce_field( 'give_update_payment_details_nonce' ); ?>  | 
                                                        |
| 514 | - <input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/>  | 
                                                        |
| 512 | +		<?php do_action('give_view_order_details_form_bottom', $payment_id); ?> | 
                                                        |
| 513 | +		<?php wp_nonce_field('give_update_payment_details_nonce'); ?> | 
                                                        |
| 514 | + <input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/>  | 
                                                        |
| 515 | 515 | <input type="hidden" name="give_action" value="update_payment_details"/>  | 
                                                        
| 516 | 516 | </form>  | 
                                                        
| 517 | - <?php do_action( 'give_view_order_details_after', $payment_id ); ?>  | 
                                                        |
| 517 | +	<?php do_action('give_view_order_details_after', $payment_id); ?> | 
                                                        |
| 518 | 518 | </div><!-- /.wrap -->  |