Test Failed
Push — master ( 7af02d...c58786 )
by Devin
04:53
created
includes/admin/tools/logs/class-gateway-error-logs-list-table.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 // Exit if accessed directly.
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
16 16
 // Load WP_List_Table if not loaded.
17
-if ( ! class_exists( 'WP_List_Table' ) ) {
18
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
17
+if ( ! class_exists('WP_List_Table')) {
18
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
19 19
 }
20 20
 
21 21
 /**
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public function __construct() {
46 46
 		// Set parent defaults.
47
-		parent::__construct( array(
48
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records.
49
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records.
47
+		parent::__construct(array(
48
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records.
49
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records.
50 50
 			'ajax'     => false                        // Does this table support ajax?.
51
-		) );
51
+		));
52 52
 	}
53 53
 
54 54
 	/**
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @return string Column Name.
64 64
 	 */
65
-	public function column_default( $item, $column_name ) {
65
+	public function column_default($item, $column_name) {
66 66
 
67
-		switch ( $column_name ) {
67
+		switch ($column_name) {
68 68
 			case 'ID' :
69 69
 				return $item['ID_label'];
70 70
 			case 'payment_id' :
71
-				return empty( $item['payment_id'] ) ? esc_html__( 'n/a', 'give' ) : sprintf( "<a href=\"%s\" target=\"_blank\">{$item['payment_id']}</a>", get_edit_post_link( $item['payment_id'] ) );
71
+				return empty($item['payment_id']) ? esc_html__('n/a', 'give') : sprintf("<a href=\"%s\" target=\"_blank\">{$item['payment_id']}</a>", get_edit_post_link($item['payment_id']));
72 72
 			case 'gateway' :
73
-				return empty( $item['gateway'] ) ? esc_html__( 'n/a', 'give' ) : $item['gateway'];
73
+				return empty($item['gateway']) ? esc_html__('n/a', 'give') : $item['gateway'];
74 74
 			case 'error' :
75
-				return get_the_title( $item['ID'] ) ? get_the_title( $item['ID'] ) : esc_html__( 'Payment Error', 'give' );
75
+				return get_the_title($item['ID']) ? get_the_title($item['ID']) : esc_html__('Payment Error', 'give');
76 76
 			default:
77
-				return $item[ $column_name ];
77
+				return $item[$column_name];
78 78
 		}
79 79
 	}
80 80
 
@@ -88,27 +88,27 @@  discard block
 block discarded – undo
88 88
 	 *
89 89
 	 * @return void
90 90
 	 */
91
-	public function column_message( $item ) { ?>
92
-		<a href="#TB_inline?width=640&amp;inlineId=log-message-<?php echo $item['ID']; ?>" class="thickbox give-error-log-details-link button button-small" data-tooltip="<?php esc_attr_e( 'View Log Message', 'give' ); ?>"><span class="dashicons dashicons-visibility"></span></a>
91
+	public function column_message($item) { ?>
92
+		<a href="#TB_inline?width=640&amp;inlineId=log-message-<?php echo $item['ID']; ?>" class="thickbox give-error-log-details-link button button-small" data-tooltip="<?php esc_attr_e('View Log Message', 'give'); ?>"><span class="dashicons dashicons-visibility"></span></a>
93 93
 		<div id="log-message-<?php echo $item['ID']; ?>" style="display:none;">
94 94
 			<?php
95 95
 
96
-			$log_message = get_post_field( 'post_content', $item['ID'] );
96
+			$log_message = get_post_field('post_content', $item['ID']);
97 97
 
98
-			$serialized = strpos( $log_message, '{"' );
98
+			$serialized = strpos($log_message, '{"');
99 99
 
100 100
 			// Check to see if the log message contains serialized information
101
-			if ( $serialized !== false ) {
102
-				$length = strlen( $log_message ) - $serialized;
103
-				$intro  = substr( $log_message, 0, - $length );
104
-				$data   = substr( $log_message, $serialized, strlen( $log_message ) - 1 );
101
+			if ($serialized !== false) {
102
+				$length = strlen($log_message) - $serialized;
103
+				$intro  = substr($log_message, 0, - $length);
104
+				$data   = substr($log_message, $serialized, strlen($log_message) - 1);
105 105
 
106
-				echo wpautop( $intro );
107
-				echo wpautop( '<strong>' . esc_html__( 'Log data:', 'give' ) . '</strong>' );
108
-				echo '<div style="word-wrap: break-word;">' . wpautop( $data ) . '</div>';
106
+				echo wpautop($intro);
107
+				echo wpautop('<strong>'.esc_html__('Log data:', 'give').'</strong>');
108
+				echo '<div style="word-wrap: break-word;">'.wpautop($data).'</div>';
109 109
 			} else {
110 110
 				// No serialized data found
111
-				echo wpautop( $log_message );
111
+				echo wpautop($log_message);
112 112
 			}
113 113
 			?>
114 114
 		</div>
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
 	 */
125 125
 	public function get_columns() {
126 126
 		$columns = array(
127
-			'ID'         => esc_html__( 'Log ID', 'give' ),
128
-			'error'      => esc_html__( 'Error', 'give' ),
129
-			'gateway'    => esc_html__( 'Gateway', 'give' ),
130
-			'payment_id' => esc_html__( 'Donation ID', 'give' ),
131
-			'date'       => esc_html__( 'Date', 'give' ),
132
-			'message'    => esc_html__( 'Details', 'give' )
127
+			'ID'         => esc_html__('Log ID', 'give'),
128
+			'error'      => esc_html__('Error', 'give'),
129
+			'gateway'    => esc_html__('Gateway', 'give'),
130
+			'payment_id' => esc_html__('Donation ID', 'give'),
131
+			'date'       => esc_html__('Date', 'give'),
132
+			'message'    => esc_html__('Details', 'give')
133 133
 		);
134 134
 
135 135
 		return $columns;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 * @return int Current page number
144 144
 	 */
145 145
 	public function get_paged() {
146
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
146
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
147 147
 	}
148 148
 
149 149
 	/**
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 * @since  1.0
154 154
 	 * @return void
155 155
 	 */
156
-	public function bulk_actions( $which = '' ) {
156
+	public function bulk_actions($which = '') {
157 157
 		give_log_views();
158 158
 	}
159 159
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
 		// Prevent the queries from getting cached.
173 173
 		// Without this there are occasional memory issues for some installs.
174
-		wp_suspend_cache_addition( true );
174
+		wp_suspend_cache_addition(true);
175 175
 
176 176
 		$logs_data = array();
177 177
 		$paged     = $this->get_paged();
@@ -181,17 +181,17 @@  discard block
 block discarded – undo
181 181
 			'posts_per_page' => $this->per_page,
182 182
 		);
183 183
 
184
-		$logs = $give_logs->get_connected_logs( $log_query );
184
+		$logs = $give_logs->get_connected_logs($log_query);
185 185
 
186
-		if ( $logs ) {
187
-			foreach ( $logs as $log ) {
186
+		if ($logs) {
187
+			foreach ($logs as $log) {
188 188
 
189 189
 				$logs_data[] = array(
190 190
 					'ID'         => $log->ID,
191
-					'ID_label'   => '<span class=\'give-item-label give-item-label-gray\'>' . $log->ID . '</span>',
191
+					'ID_label'   => '<span class=\'give-item-label give-item-label-gray\'>'.$log->ID.'</span>',
192 192
 					'payment_id' => $log->post_parent,
193 193
 					'error'      => 'error',
194
-					'gateway'    => give_get_payment_gateway( $log->post_parent ),
194
+					'gateway'    => give_get_payment_gateway($log->post_parent),
195 195
 					'date'       => $log->post_date
196 196
 				);
197 197
 			}
@@ -213,19 +213,19 @@  discard block
 block discarded – undo
213 213
 	 *
214 214
 	 * @param string $which
215 215
 	 */
216
-	protected function display_tablenav( $which ) {
217
-		if ( 'top' === $which ) {
218
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
216
+	protected function display_tablenav($which) {
217
+		if ('top' === $which) {
218
+			wp_nonce_field('bulk-'.$this->_args['plural']);
219 219
 		}
220 220
 		?>
221
-		<div class="tablenav <?php echo esc_attr( $which ); ?>">
221
+		<div class="tablenav <?php echo esc_attr($which); ?>">
222 222
 
223 223
 			<div class="alignleft actions bulkactions">
224
-				<?php $this->bulk_actions( $which ); ?>
224
+				<?php $this->bulk_actions($which); ?>
225 225
 			</div>
226 226
 			<?php
227
-			$this->extra_tablenav( $which );
228
-			$this->pagination( $which );
227
+			$this->extra_tablenav($which);
228
+			$this->pagination($which);
229 229
 			?>
230 230
 
231 231
 			<br class="clear"/>
@@ -252,14 +252,14 @@  discard block
 block discarded – undo
252 252
 		$columns               = $this->get_columns();
253 253
 		$hidden                = array(); // No hidden columns
254 254
 		$sortable              = $this->get_sortable_columns();
255
-		$this->_column_headers = array( $columns, $hidden, $sortable );
255
+		$this->_column_headers = array($columns, $hidden, $sortable);
256 256
 		$this->items           = $this->get_logs();
257
-		$total_items           = $give_logs->get_log_count( 0, 'gateway_error' );
257
+		$total_items           = $give_logs->get_log_count(0, 'gateway_error');
258 258
 
259
-		$this->set_pagination_args( array(
259
+		$this->set_pagination_args(array(
260 260
 				'total_items' => $total_items,
261 261
 				'per_page'    => $this->per_page,
262
-				'total_pages' => ceil( $total_items / $this->per_page ),
262
+				'total_pages' => ceil($total_items / $this->per_page),
263 263
 			)
264 264
 		);
265 265
 	}
Please login to merge, or discard this patch.
includes/admin/reports/class-donor-reports-table.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
143 143
 	 *
144 144
 	 * @access public
145 145
 	 * @since  1.0
146
-	 * @return mixed string If search is present, false otherwise
146
+	 * @return string|false string If search is present, false otherwise
147 147
 	 */
148 148
 	public function get_search() {
149 149
 		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
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
 /**
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 		global $status, $page;
63 63
 
64 64
 		// Set parent defaults
65
-		parent::__construct( array(
66
-			'singular' => esc_html__( 'Donor', 'give' ),     // Singular name of the listed records
67
-			'plural'   => esc_html__( 'Donors', 'give' ),    // Plural name of the listed records
68
-			'ajax'     => false,// Does this table support ajax?
69
-		) );
65
+		parent::__construct(array(
66
+			'singular' => esc_html__('Donor', 'give'), // Singular name of the listed records
67
+			'plural'   => esc_html__('Donors', 'give'), // Plural name of the listed records
68
+			'ajax'     => false, // Does this table support ajax?
69
+		));
70 70
 
71 71
 	}
72 72
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 *
84 84
 	 * @return false
85 85
 	 */
86
-	public function search_box( $text, $input_id ) {
86
+	public function search_box($text, $input_id) {
87 87
 		return false;
88 88
 	}
89 89
 
@@ -98,20 +98,20 @@  discard block
 block discarded – undo
98 98
 	 *
99 99
 	 * @return void
100 100
 	 */
101
-	public function give_search_box( $text, $input_id ) {
102
-		$input_id = $input_id . '-search-input';
101
+	public function give_search_box($text, $input_id) {
102
+		$input_id = $input_id.'-search-input';
103 103
 
104
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
105
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
104
+		if ( ! empty($_REQUEST['orderby'])) {
105
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
106 106
 		}
107
-		if ( ! empty( $_REQUEST['order'] ) ) {
108
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
107
+		if ( ! empty($_REQUEST['order'])) {
108
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
109 109
 		}
110 110
 		?>
111 111
 		<p class="search-box donor-search" role="search">
112 112
 			<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
113 113
 			<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
114
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?>
114
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?>
115 115
 		</p>
116 116
 	<?php
117 117
 	}
@@ -124,33 +124,33 @@  discard block
 block discarded – undo
124 124
 	 *
125 125
 	 * @param string $which
126 126
 	 */
127
-	protected function display_tablenav( $which ) {
127
+	protected function display_tablenav($which) {
128 128
 
129
-		if ( 'top' === $which ) {
130
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
129
+		if ('top' === $which) {
130
+			wp_nonce_field('bulk-'.$this->_args['plural']);
131 131
 		}
132 132
 		?>
133
-		<div class="tablenav give-clearfix <?php echo esc_attr( $which ); ?>">
133
+		<div class="tablenav give-clearfix <?php echo esc_attr($which); ?>">
134 134
 
135
-			<?php if ( 'top' === $which ) { ?>
135
+			<?php if ('top' === $which) { ?>
136 136
 				<h2 class="alignleft reports-earnings-title">
137
-					<?php esc_html_e( 'Donors Report', 'give' ); ?>
137
+					<?php esc_html_e('Donors Report', 'give'); ?>
138 138
 				</h2>
139 139
 			<?php } ?>
140 140
 
141 141
 			<div class="alignright tablenav-right">
142 142
 				<div class="actions bulkactions">
143 143
 					<?php
144
-					if ( 'top' === $which ) {
145
-						$this->give_search_box( esc_html__( 'Search Donors', 'give' ), 'give-donors-report-search' );
144
+					if ('top' === $which) {
145
+						$this->give_search_box(esc_html__('Search Donors', 'give'), 'give-donors-report-search');
146 146
 					}
147 147
 
148
-					$this->bulk_actions( $which ); ?>
148
+					$this->bulk_actions($which); ?>
149 149
 
150 150
 				</div>
151 151
 				<?php
152
-				$this->extra_tablenav( $which );
153
-				$this->pagination( $which );
152
+				$this->extra_tablenav($which);
153
+				$this->pagination($which);
154 154
 				?>
155 155
 			</div>
156 156
 
@@ -172,35 +172,35 @@  discard block
 block discarded – undo
172 172
 	 *
173 173
 	 * @return string Column Name
174 174
 	 */
175
-	public function column_default( $item, $column_name ) {
175
+	public function column_default($item, $column_name) {
176 176
 
177
-		switch ( $column_name ) {
177
+		switch ($column_name) {
178 178
 
179 179
 			case 'name' :
180
-				$name = '#' . $item['id'] . ' ';
181
-				$name .= ! empty( $item['name'] ) ? $item['name'] : '<em>' . esc_html__( 'Unnamed Donor', 'give' ) . '</em>';
182
-				$view_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $item['id'] );
183
-				$value    = '<a href="' . esc_url( $view_url ) . '">' . $name . '</a>';
180
+				$name = '#'.$item['id'].' ';
181
+				$name .= ! empty($item['name']) ? $item['name'] : '<em>'.esc_html__('Unnamed Donor', 'give').'</em>';
182
+				$view_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$item['id']);
183
+				$value    = '<a href="'.esc_url($view_url).'">'.$name.'</a>';
184 184
 				break;
185 185
 
186 186
 			case 'num_donations' :
187 187
 				$value = sprintf(
188 188
 					'<a href="%s">%s</a>',
189
-					admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $item['id'] ) ),
190
-						esc_html( $item['num_donations'] )
189
+					admin_url('edit.php?post_type=give_forms&page=give-payment-history&donor='.absint($item['id'])),
190
+						esc_html($item['num_donations'])
191 191
 					);
192 192
 				break;
193 193
 
194 194
 			case 'amount_spent' :
195
-				$value = give_currency_filter( give_format_amount( $item[ $column_name ], array( 'sanitize' => false ) ) );
195
+				$value = give_currency_filter(give_format_amount($item[$column_name], array('sanitize' => false)));
196 196
 				break;
197 197
 
198 198
 			default:
199
-				$value = isset( $item[ $column_name ] ) ? $item[ $column_name ] : null;
199
+				$value = isset($item[$column_name]) ? $item[$column_name] : null;
200 200
 				break;
201 201
 		}
202 202
 
203
-		return apply_filters( "give_report_column_{$column_name}", $value, $item['id'] );
203
+		return apply_filters("give_report_column_{$column_name}", $value, $item['id']);
204 204
 	}
205 205
 
206 206
 	/**
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	public function get_columns() {
214 214
 		$columns = array(
215
-			'name'          => __( 'Name', 'give' ),
216
-			'email'         => __( 'Email', 'give' ),
217
-			'num_donations' => __( 'Donations', 'give' ),
218
-			'amount_spent'  => __( 'Total Donated', 'give' ),
215
+			'name'          => __('Name', 'give'),
216
+			'email'         => __('Email', 'give'),
217
+			'num_donations' => __('Donations', 'give'),
218
+			'amount_spent'  => __('Total Donated', 'give'),
219 219
 		);
220 220
 
221
-		return apply_filters( 'give_report_donor_columns', $columns );
221
+		return apply_filters('give_report_donor_columns', $columns);
222 222
 
223 223
 	}
224 224
 
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
 	 */
232 232
 	public function get_sortable_columns() {
233 233
 		return array(
234
-			'id'            => array( 'id', true ),
235
-			'name'          => array( 'name', true ),
236
-			'num_donations' => array( 'purchase_count', false ),
237
-			'amount_spent'  => array( 'purchase_value', false ),
234
+			'id'            => array('id', true),
235
+			'name'          => array('name', true),
236
+			'num_donations' => array('purchase_count', false),
237
+			'amount_spent'  => array('purchase_value', false),
238 238
 		);
239 239
 	}
240 240
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	 * @since  1.0
246 246
 	 * @return void
247 247
 	 */
248
-	public function bulk_actions( $which = '' ) {
248
+	public function bulk_actions($which = '') {
249 249
 
250 250
 	}
251 251
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	 * @return int Current page number
258 258
 	 */
259 259
 	public function get_paged() {
260
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
260
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
261 261
 	}
262 262
 
263 263
 	/**
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 * @return mixed string If search is present, false otherwise
269 269
 	 */
270 270
 	public function get_search() {
271
-		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
271
+		return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false;
272 272
 	}
273 273
 
274 274
 	/**
@@ -287,15 +287,15 @@  discard block
 block discarded – undo
287 287
 
288 288
 		// Get donor query.
289 289
 		$args   = $this->get_donor_query();
290
-		$donors = Give()->donors->get_donors( $args );
290
+		$donors = Give()->donors->get_donors($args);
291 291
 
292
-		if ( $donors ) {
292
+		if ($donors) {
293 293
 
294
-			$this->count = count( $donors );
294
+			$this->count = count($donors);
295 295
 
296
-			foreach ( $donors as $donor ) {
296
+			foreach ($donors as $donor) {
297 297
 
298
-				$user_id = ! empty( $donor->user_id ) ? absint( $donor->user_id ) : 0;
298
+				$user_id = ! empty($donor->user_id) ? absint($donor->user_id) : 0;
299 299
 
300 300
 				$data[] = array(
301 301
 					'id'            => $donor->id,
@@ -323,9 +323,9 @@  discard block
 block discarded – undo
323 323
 
324 324
 		$_donor_query['number'] = -1;
325 325
 		$_donor_query['offset'] = 0;
326
-		$donors = Give()->donors->get_donors( $_donor_query );
326
+		$donors = Give()->donors->get_donors($_donor_query);
327 327
 
328
-		return count( $donors );
328
+		return count($donors);
329 329
 	}
330 330
 
331 331
 	/**
@@ -337,10 +337,10 @@  discard block
 block discarded – undo
337 337
 	 */
338 338
 	public function get_donor_query() {
339 339
 		$paged   = $this->get_paged();
340
-		$offset  = $this->per_page * ( $paged - 1 );
340
+		$offset  = $this->per_page * ($paged - 1);
341 341
 		$search  = $this->get_search();
342
-		$order   = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'DESC';
343
-		$orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'id';
342
+		$order   = isset($_GET['order']) ? sanitize_text_field($_GET['order']) : 'DESC';
343
+		$orderby = isset($_GET['orderby']) ? sanitize_text_field($_GET['orderby']) : 'id';
344 344
 
345 345
 		$args = array(
346 346
 			'number'  => $this->per_page,
@@ -349,10 +349,10 @@  discard block
 block discarded – undo
349 349
 			'orderby' => $orderby,
350 350
 		);
351 351
 
352
-		if( $search ) {
353
-			if ( is_email( $search ) ) {
352
+		if ($search) {
353
+			if (is_email($search)) {
354 354
 				$args['email'] = $search;
355
-			} elseif ( is_numeric( $search ) ) {
355
+			} elseif (is_numeric($search)) {
356 356
 				$args['id'] = $search;
357 357
 			} else {
358 358
 				$args['name'] = $search;
@@ -379,16 +379,16 @@  discard block
 block discarded – undo
379 379
 		$hidden   = array(); // No hidden columns
380 380
 		$sortable = $this->get_sortable_columns();
381 381
 
382
-		$this->_column_headers = array( $columns, $hidden, $sortable );
382
+		$this->_column_headers = array($columns, $hidden, $sortable);
383 383
 
384 384
 		$this->items = $this->reports_data();
385 385
 
386 386
 		$this->total = $this->get_donor_count();
387 387
 
388
-		$this->set_pagination_args( array(
388
+		$this->set_pagination_args(array(
389 389
 			'total_items' => $this->total,
390 390
 			'per_page'    => $this->per_page,
391
-			'total_pages' => ceil( $this->total / $this->per_page ),
392
-		) );
391
+			'total_pages' => ceil($this->total / $this->per_page),
392
+		));
393 393
 	}
394 394
 }
Please login to merge, or discard this patch.
includes/admin/tools/logs/logs.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_get_logs_tab() {
24 24
 
25
-	require( GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php' );
25
+	require(GIVE_PLUGIN_DIR.'includes/admin/tools/logs/logs.php');
26 26
 
27 27
 	// Get current section.
28 28
 	$current_section = $_GET['section'] = give_get_current_setting_section();
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @since 1.0
34 34
 	 */
35
-	do_action( "give_logs_view_{$current_section}" );
35
+	do_action("give_logs_view_{$current_section}");
36 36
 }
37 37
 
38 38
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
  */
47 47
 function give_logs_view_sales() {
48 48
 
49
-	include GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/class-sales-logs-list-table.php';
49
+	include GIVE_PLUGIN_DIR.'includes/admin/tools/logs/class-sales-logs-list-table.php';
50 50
 
51 51
 	$logs_table = new Give_Sales_Log_Table();
52 52
 	$logs_table->prepare_items();
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		 *
60 60
 		 * @since 1.8.12
61 61
 		 */
62
-		do_action( 'give_logs_donations_top' );
62
+		do_action('give_logs_donations_top');
63 63
 
64 64
 		$logs_table->display(); ?>
65 65
 		<input type="hidden" name="post_type" value="give_forms"/>
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
 		 *
74 74
 		 * @since 1.8.12
75 75
 		 */
76
-		do_action( 'give_logs_donations_bottom' );
76
+		do_action('give_logs_donations_bottom');
77 77
 		?>
78 78
 
79 79
 	</div>
80 80
 	<?php
81 81
 }
82 82
 
83
-add_action( 'give_logs_view_sales', 'give_logs_view_sales' );
83
+add_action('give_logs_view_sales', 'give_logs_view_sales');
84 84
 
85 85
 
86 86
 /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
  * @return void
93 93
  */
94 94
 function give_logs_view_gateway_errors() {
95
-	include( GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/class-gateway-error-logs-list-table.php' );
95
+	include(GIVE_PLUGIN_DIR.'includes/admin/tools/logs/class-gateway-error-logs-list-table.php');
96 96
 
97 97
 	$logs_table = new Give_Gateway_Error_Log_Table();
98 98
 	$logs_table->prepare_items();
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		 *
106 106
 		 * @since 1.8.12
107 107
 		 */
108
-		do_action( 'give_logs_payment_error_top' );
108
+		do_action('give_logs_payment_error_top');
109 109
 
110 110
 		$logs_table->display(); ?>
111 111
 		<input type="hidden" name="post_type" value="give_forms"/>
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
 		 *
120 120
 		 * @since 1.8.12
121 121
 		 */
122
-		do_action( 'give_logs_payment_error_bottom' );
122
+		do_action('give_logs_payment_error_bottom');
123 123
 		?>
124 124
 
125 125
 	</div>
126 126
 	<?php
127 127
 }
128 128
 
129
-add_action( 'give_logs_view_gateway_errors', 'give_logs_view_gateway_errors' );
129
+add_action('give_logs_view_gateway_errors', 'give_logs_view_gateway_errors');
130 130
 
131 131
 /**
132 132
  * API Request Logs
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
  * @return void
139 139
  */
140 140
 function give_logs_view_api_requests() {
141
-	include( GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/class-api-requests-logs-list-table.php' );
141
+	include(GIVE_PLUGIN_DIR.'includes/admin/tools/logs/class-api-requests-logs-list-table.php');
142 142
 
143 143
 	$logs_table = new Give_API_Request_Log_Table();
144 144
 	$logs_table->prepare_items();
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 		 *
152 152
 		 * @since 1.0
153 153
 		 */
154
-		do_action( 'give_logs_api_requests_top' );
154
+		do_action('give_logs_api_requests_top');
155 155
 
156
-		$logs_table->search_box( esc_html__( 'Search', 'give' ), 'give-api-requests' );
156
+		$logs_table->search_box(esc_html__('Search', 'give'), 'give-api-requests');
157 157
 		$logs_table->display();
158 158
 		?>
159 159
 		<input type="hidden" name="post_type" value="give_forms"/>
@@ -167,14 +167,14 @@  discard block
 block discarded – undo
167 167
 		 *
168 168
 		 * @since 1.0
169 169
 		 */
170
-		do_action( 'give_logs_api_requests_bottom' );
170
+		do_action('give_logs_api_requests_bottom');
171 171
 		?>
172 172
 
173 173
 	</div>
174 174
 	<?php
175 175
 }
176 176
 
177
-add_action( 'give_logs_view_api_requests', 'give_logs_view_api_requests' );
177
+add_action('give_logs_view_api_requests', 'give_logs_view_api_requests');
178 178
 
179 179
 /**
180 180
  * Renders the log views drop down.
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
 	$current_section = give_get_current_setting_section();
187 187
 
188 188
 	// If there are not any event attach to action then do not show form.
189
-	if ( ! has_action( 'give_log_view_actions' ) ) {
189
+	if ( ! has_action('give_log_view_actions')) {
190 190
 		return;
191 191
 	}
192 192
 	?>
193
-	<form id="give-logs-filter" method="get" action="<?php echo 'edit.php?post_type=give_forms&page=give-tools&tab=logs&section=' . $current_section; ?>">
193
+	<form id="give-logs-filter" method="get" action="<?php echo 'edit.php?post_type=give_forms&page=give-tools&tab=logs&section='.$current_section; ?>">
194 194
 		<?php
195 195
 		/**
196 196
 		 * Fires after displaying the reports page views drop down.
@@ -199,14 +199,14 @@  discard block
 block discarded – undo
199 199
 		 *
200 200
 		 * @since 1.0
201 201
 		 */
202
-		do_action( 'give_log_view_actions' );
202
+		do_action('give_log_view_actions');
203 203
 		?>
204 204
 
205 205
 		<input type="hidden" name="post_type" value="give_forms"/>
206 206
 		<input type="hidden" name="page" value="give-tools"/>
207 207
 		<input type="hidden" name="tab" value="logs"/>
208 208
 
209
-		<?php submit_button( esc_html__( 'Apply', 'give' ), 'secondary', 'submit', false ); ?>
209
+		<?php submit_button(esc_html__('Apply', 'give'), 'secondary', 'submit', false); ?>
210 210
 	</form>
211 211
 	<?php
212 212
 }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
  *
219 219
  * @return string
220 220
  */
221
-function give_tools_set_form_method( $method ) {
221
+function give_tools_set_form_method($method) {
222 222
 	return 'get';
223 223
 }
224
-add_filter( 'give-tools_form_method_tab_logs', 'give_tools_set_form_method', 10 );
224
+add_filter('give-tools_form_method_tab_logs', 'give_tools_set_form_method', 10);
Please login to merge, or discard this patch.
give.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -521,7 +521,7 @@
 block discarded – undo
521 521
  * Example: <?php $give = Give(); ?>
522 522
  *
523 523
  * @since 1.0
524
- * @return object|Give
524
+ * @return Give
525 525
  */
526 526
 function Give() {
527 527
 	return Give::instance();
Please login to merge, or discard this patch.
Spacing   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
  */
41 41
 
42 42
 // Exit if accessed directly.
43
-if ( ! defined( 'ABSPATH' ) ) {
43
+if ( ! defined('ABSPATH')) {
44 44
 	exit;
45 45
 }
46 46
 
47
-if ( ! class_exists( 'Give' ) ) :
47
+if ( ! class_exists('Give')) :
48 48
 
49 49
 	/**
50 50
 	 * Main Give Class
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		 * @return    Give
203 203
 		 */
204 204
 		public static function instance() {
205
-			if ( is_null( self::$_instance ) ) {
205
+			if (is_null(self::$_instance)) {
206 206
 				self::$_instance = new self();
207 207
 			}
208 208
 
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
 		 */
215 215
 		public function __construct() {
216 216
 			// PHP version
217
-			if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) {
218
-				define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' );
217
+			if ( ! defined('GIVE_REQUIRED_PHP_VERSION')) {
218
+				define('GIVE_REQUIRED_PHP_VERSION', '5.3');
219 219
 			}
220 220
 
221 221
 			// Bailout: Need minimum php version to load plugin.
222
-			if ( function_exists( 'phpversion' ) && version_compare( GIVE_REQUIRED_PHP_VERSION, phpversion(), '>' ) ) {
223
-				add_action( 'admin_notices', array( $this, 'minmum_phpversion_notice' ) );
222
+			if (function_exists('phpversion') && version_compare(GIVE_REQUIRED_PHP_VERSION, phpversion(), '>')) {
223
+				add_action('admin_notices', array($this, 'minmum_phpversion_notice'));
224 224
 
225 225
 				return;
226 226
 			}
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 			$this->includes();
231 231
 			$this->init_hooks();
232 232
 
233
-			do_action( 'give_loaded' );
233
+			do_action('give_loaded');
234 234
 		}
235 235
 
236 236
 		/**
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
 		 * @since  1.8.9
240 240
 		 */
241 241
 		private function init_hooks() {
242
-			register_activation_hook( __FILE__, 'give_install' );
243
-			add_action( 'plugins_loaded', array( $this, 'init' ), 0 );
242
+			register_activation_hook(__FILE__, 'give_install');
243
+			add_action('plugins_loaded', array($this, 'init'), 0);
244 244
 		}
245 245
 		/**
246 246
 		 * Init Give when WordPress Initializes.
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 			 *
255 255
 			 * @since 1.8.9
256 256
 			 */
257
-			do_action( 'before_give_init' );
257
+			do_action('before_give_init');
258 258
 
259 259
 			// Set up localization.
260 260
 			$this->load_textdomain();
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 			 *
280 280
 			 * @since 1.8.7
281 281
 			 */
282
-			do_action( 'give_init', $this );
282
+			do_action('give_init', $this);
283 283
 
284 284
 		}
285 285
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 		 */
297 297
 		public function __clone() {
298 298
 			// Cloning instances of the class is forbidden.
299
-			give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
299
+			give_doing_it_wrong(__FUNCTION__, __('Cheatin&#8217; huh?', 'give'), '1.0');
300 300
 		}
301 301
 
302 302
 		/**
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 		 */
310 310
 		public function __wakeup() {
311 311
 			// Unserializing instances of the class is forbidden.
312
-			give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
312
+			give_doing_it_wrong(__FUNCTION__, __('Cheatin&#8217; huh?', 'give'), '1.0');
313 313
 		}
314 314
 
315 315
 		/**
@@ -323,33 +323,33 @@  discard block
 block discarded – undo
323 323
 		private function setup_constants() {
324 324
 
325 325
 			// Plugin version
326
-			if ( ! defined( 'GIVE_VERSION' ) ) {
327
-				define( 'GIVE_VERSION', '1.8.18' );
326
+			if ( ! defined('GIVE_VERSION')) {
327
+				define('GIVE_VERSION', '1.8.18');
328 328
 			}
329 329
 
330 330
 			// Plugin Folder Path
331
-			if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
332
-				define( 'GIVE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
331
+			if ( ! defined('GIVE_PLUGIN_DIR')) {
332
+				define('GIVE_PLUGIN_DIR', plugin_dir_path(__FILE__));
333 333
 			}
334 334
 
335 335
 			// Plugin Folder URL
336
-			if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
337
-				define( 'GIVE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
336
+			if ( ! defined('GIVE_PLUGIN_URL')) {
337
+				define('GIVE_PLUGIN_URL', plugin_dir_url(__FILE__));
338 338
 			}
339 339
 
340 340
 			// Plugin Basename aka: "give/give.php"
341
-			if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
342
-				define( 'GIVE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
341
+			if ( ! defined('GIVE_PLUGIN_BASENAME')) {
342
+				define('GIVE_PLUGIN_BASENAME', plugin_basename(__FILE__));
343 343
 			}
344 344
 
345 345
 			// Plugin Root File
346
-			if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
347
-				define( 'GIVE_PLUGIN_FILE', __FILE__ );
346
+			if ( ! defined('GIVE_PLUGIN_FILE')) {
347
+				define('GIVE_PLUGIN_FILE', __FILE__);
348 348
 			}
349 349
 
350 350
 			// Make sure CAL_GREGORIAN is defined
351
-			if ( ! defined( 'CAL_GREGORIAN' ) ) {
352
-				define( 'CAL_GREGORIAN', 1 );
351
+			if ( ! defined('CAL_GREGORIAN')) {
352
+				define('CAL_GREGORIAN', 1);
353 353
 			}
354 354
 		}
355 355
 
@@ -364,133 +364,133 @@  discard block
 block discarded – undo
364 364
 		private function includes() {
365 365
 			global $give_options;
366 366
 
367
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
368
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php';
367
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-settings.php';
368
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-give-settings.php';
369 369
 			$give_options = give_get_settings();
370 370
 
371
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
372
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
373
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
374
-			require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
375
-			require_once GIVE_PLUGIN_DIR . 'includes/scripts.php';
376
-			require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
377
-			require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
378
-			require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
379
-			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
380
-			require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
381
-
382
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
383
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php';
384
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
385
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
386
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php';
387
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php';
388
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php';
389
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
390
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
391
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php';
392
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
393
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
394
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php';
395
-
396
-			require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
397
-			require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
398
-			require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
399
-			require_once GIVE_PLUGIN_DIR . 'includes/import-functions.php';
400
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
401
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
402
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
403
-			require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
404
-			require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
405
-			require_once GIVE_PLUGIN_DIR . 'includes/currency-functions.php';
406
-			require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
407
-			require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
408
-			require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
409
-			require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
410
-			require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
411
-			require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
412
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php';
413
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
414
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
415
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
416
-
417
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
418
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
419
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
420
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
421
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
422
-
423
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
424
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
425
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
426
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
427
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
428
-
429
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
430
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
431
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
432
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
433
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
434
-
435
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donors-query.php';
436
-
437
-			if ( defined( 'WP_CLI' ) && WP_CLI ) {
438
-				require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
371
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php';
372
+			require_once GIVE_PLUGIN_DIR.'includes/admin/give-metabox-functions.php';
373
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cache.php';
374
+			require_once GIVE_PLUGIN_DIR.'includes/post-types.php';
375
+			require_once GIVE_PLUGIN_DIR.'includes/scripts.php';
376
+			require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php';
377
+			require_once GIVE_PLUGIN_DIR.'includes/actions.php';
378
+			require_once GIVE_PLUGIN_DIR.'includes/filters.php';
379
+			require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php';
380
+			require_once GIVE_PLUGIN_DIR.'includes/class-notices.php';
381
+
382
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php';
383
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php';
384
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php';
385
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php';
386
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donors.php';
387
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donor-meta.php';
388
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donor.php';
389
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php';
390
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php';
391
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php';
392
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php';
393
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php';
394
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-email-access.php';
395
+
396
+			require_once GIVE_PLUGIN_DIR.'includes/country-functions.php';
397
+			require_once GIVE_PLUGIN_DIR.'includes/template-functions.php';
398
+			require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php';
399
+			require_once GIVE_PLUGIN_DIR.'includes/import-functions.php';
400
+			require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php';
401
+			require_once GIVE_PLUGIN_DIR.'includes/forms/template.php';
402
+			require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php';
403
+			require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php';
404
+			require_once GIVE_PLUGIN_DIR.'includes/formatting.php';
405
+			require_once GIVE_PLUGIN_DIR.'includes/currency-functions.php';
406
+			require_once GIVE_PLUGIN_DIR.'includes/price-functions.php';
407
+			require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php';
408
+			require_once GIVE_PLUGIN_DIR.'includes/process-donation.php';
409
+			require_once GIVE_PLUGIN_DIR.'includes/login-register.php';
410
+			require_once GIVE_PLUGIN_DIR.'includes/user-functions.php';
411
+			require_once GIVE_PLUGIN_DIR.'includes/plugin-compatibility.php';
412
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-classes.php';
413
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-functions.php';
414
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-actions.php';
415
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-filters.php';
416
+
417
+			require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php';
418
+			require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php';
419
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php';
420
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php';
421
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-payment.php';
422
+
423
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php';
424
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php';
425
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php';
426
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php';
427
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php';
428
+
429
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php';
430
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php';
431
+			require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php';
432
+			require_once GIVE_PLUGIN_DIR.'includes/emails/template.php';
433
+			require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php';
434
+
435
+			require_once GIVE_PLUGIN_DIR.'includes/donors/class-give-donors-query.php';
436
+
437
+			if (defined('WP_CLI') && WP_CLI) {
438
+				require_once GIVE_PLUGIN_DIR.'includes/class-give-cli-commands.php';
439 439
 			}
440 440
 
441
-			if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
441
+			if (is_admin() || (defined('WP_CLI') && WP_CLI)) {
442 442
 
443
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
444
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php';
445
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
446
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
447
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
448
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
449
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
450
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php';
451
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
452
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
453
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-blank-slate.php';
443
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php';
444
+				require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php';
445
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php';
446
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
447
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-i18n-module.php';
448
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php';
449
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-filters.php';
450
+				require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php';
451
+				require_once GIVE_PLUGIN_DIR.'includes/admin/plugins.php';
452
+				require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php';
453
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-blank-slate.php';
454 454
 
455
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
456
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
455
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php';
456
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php';
457 457
 
458
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php';
459
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php';
460
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php';
458
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donors.php';
459
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-functions.php';
460
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-actions.php';
461 461
 
462
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
463
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
464
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
462
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php';
463
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/class-metabox-form-data.php';
464
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php';
465 465
 
466
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
467
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
468
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
469
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';
466
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-functions.php';
467
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/class-export.php';
468
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-actions.php';
469
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/pdf-reports.php';
470 470
 
471
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/reports.php';
472
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/class-give-graph.php';
473
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/graphing.php';
471
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/reports.php';
472
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/class-give-graph.php';
473
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/graphing.php';
474 474
 
475
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php';
475
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/logs/logs.php';
476 476
 
477
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';
477
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/data/tools-actions.php';
478 478
 
479
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
480
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
481
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
482
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
483
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
484
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
485
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
486
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
487
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
479
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php';
480
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php';
481
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php';
482
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php';
483
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php';
484
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php';
485
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php';
486
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php';
487
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php';
488 488
 
489
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/class-give-updates.php';
489
+				require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/class-give-updates.php';
490 490
 
491 491
 			}// End if().
492 492
 
493
-			require_once GIVE_PLUGIN_DIR . 'includes/install.php';
493
+			require_once GIVE_PLUGIN_DIR.'includes/install.php';
494 494
 
495 495
 		}
496 496
 
@@ -505,16 +505,16 @@  discard block
 block discarded – undo
505 505
 		public function load_textdomain() {
506 506
 
507 507
 			// Set filter for Give's languages directory
508
-			$give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
509
-			$give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
508
+			$give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/';
509
+			$give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir);
510 510
 
511 511
 			// Traditional WordPress plugin locale filter.
512
-			$locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
513
-			$locale = apply_filters( 'plugin_locale', $locale, 'give' );
512
+			$locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale();
513
+			$locale = apply_filters('plugin_locale', $locale, 'give');
514 514
 
515
-			unload_textdomain( 'give' );
516
-			load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' );
517
-			load_plugin_textdomain( 'give', false, $give_lang_dir );
515
+			unload_textdomain('give');
516
+			load_textdomain('give', WP_LANG_DIR.'/give/give-'.$locale.'.mo');
517
+			load_plugin_textdomain('give', false, $give_lang_dir);
518 518
 
519 519
 		}
520 520
 
@@ -527,17 +527,17 @@  discard block
 block discarded – undo
527 527
 		 */
528 528
 		public function minmum_phpversion_notice() {
529 529
 			// Bailout.
530
-			if ( ! is_admin() ) {
530
+			if ( ! is_admin()) {
531 531
 				return;
532 532
 			}
533 533
 
534
-			$notice_desc = '<p><strong>' . __( 'Your site could be faster and more secure with a newer PHP version.', 'give' ) . '</strong></p>';
535
-			$notice_desc .= '<p>' . __( 'Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give' ) . '</p>';
536
-			$notice_desc .= '<p>' . __( 'Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give' ) . '</p>';
537
-			$notice_desc .= '<p><strong>' . __( 'To which version should I update?', 'give' ) . '</strong></p>';
538
-			$notice_desc .= '<p>' . __( 'You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give' ) . '</p>';
539
-			$notice_desc .= '<p><strong>' . __( 'Can\'t update? Ask your host!', 'give' ) . '</strong></p>';
540
-			$notice_desc .= '<p>' . sprintf( __( 'If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give' ), sprintf( '<a href="%1$s" target="_blank">', esc_url( 'https://wordpress.org/hosting/' ) ), '</a>' ) . '</p>';
534
+			$notice_desc = '<p><strong>'.__('Your site could be faster and more secure with a newer PHP version.', 'give').'</strong></p>';
535
+			$notice_desc .= '<p>'.__('Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give').'</p>';
536
+			$notice_desc .= '<p>'.__('Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give').'</p>';
537
+			$notice_desc .= '<p><strong>'.__('To which version should I update?', 'give').'</strong></p>';
538
+			$notice_desc .= '<p>'.__('You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give').'</p>';
539
+			$notice_desc .= '<p><strong>'.__('Can\'t update? Ask your host!', 'give').'</strong></p>';
540
+			$notice_desc .= '<p>'.sprintf(__('If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give'), sprintf('<a href="%1$s" target="_blank">', esc_url('https://wordpress.org/hosting/')), '</a>').'</p>';
541 541
 
542 542
 			echo sprintf(
543 543
 				'<div class="notice notice-error">%1$s</div>',
Please login to merge, or discard this patch.
includes/admin/tools/data/class-give-tools-delete-test-donors.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 * Return the calculated completion percentage.
217 217
 	 *
218 218
 	 * @since 1.8.12
219
-	 * @return int
219
+	 * @return double
220 220
 	 */
221 221
 	public function get_percentage_complete() {
222 222
 		return ceil( ( 100 * $this->step_completed ) / $this->total_step );
@@ -353,6 +353,9 @@  discard block
 block discarded – undo
353 353
 		return true;
354 354
 	}
355 355
 
356
+	/**
357
+	 * @param integer $page
358
+	 */
356 359
 	public function get_delete_ids( $donation_ids, $page ) {
357 360
 		$index            = $page --;
358 361
 		$count            = count( $donation_ids );
Please login to merge, or discard this patch.
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -109,32 +109,32 @@  discard block
 block discarded – undo
109 109
 		$donor_ids    = array();
110 110
 
111 111
 		// Check if the ajax request if running for the first time.
112
-		if ( 1 === (int) $this->step ) {
112
+		if (1 === (int) $this->step) {
113 113
 			// Delete all the donation ids.
114
-			$this->delete_option( $this->donation_key );
114
+			$this->delete_option($this->donation_key);
115 115
 			// Delete all the donor ids.
116
-			$this->delete_option( $this->donor_key );
116
+			$this->delete_option($this->donor_key);
117 117
 
118 118
 			// Delete all the step and set to 'count' which if the first step in the process of deleting the donors.
119
-			$this->update_option( $this->step_key, 'count' );
119
+			$this->update_option($this->step_key, 'count');
120 120
 
121 121
 			// Delete tha page count of the step.
122
-			$this->update_option( $this->step_on_key, '0' );
122
+			$this->update_option($this->step_on_key, '0');
123 123
 		} else {
124 124
 			// Get the old donors list.
125
-			$donor_ids = $this->get_option( $this->donor_key );
125
+			$donor_ids = $this->get_option($this->donor_key);
126 126
 
127 127
 			// Get the old donation list.
128
-			$donation_ids = $this->get_option( $this->donation_key );
128
+			$donation_ids = $this->get_option($this->donation_key);
129 129
 		}
130 130
 
131 131
 		// Get the step and check for it if it's on the first step( 'count' ) or not.
132 132
 		$step = (int) $this->get_step();
133
-		if ( 1 === $step ) {
133
+		if (1 === $step) {
134 134
 			/**
135 135
 			 * Will add or update the donation and donor data by running wp query.
136 136
 			 */
137
-			$this->count( $step, $donation_ids, $donor_ids );
137
+			$this->count($step, $donation_ids, $donor_ids);
138 138
 		}
139 139
 	}
140 140
 
@@ -145,17 +145,17 @@  discard block
 block discarded – undo
145 145
 	 * @param array $donation_ids Contain the list of all the donation id's that has being add before this
146 146
 	 * @param array $donor_ids Contain the list of all the donors id's that has being add before this
147 147
 	 */
148
-	private function count( $step, $donation_ids = array(), $donor_ids = array() ) {
148
+	private function count($step, $donation_ids = array(), $donor_ids = array()) {
149 149
 
150 150
 		// Get the Page count by default it's zero.
151 151
 		$paged = (int) $this->get_step_page();
152 152
 		// Incresed the page count by one.
153
-		++ $paged;
153
+		++$paged;
154 154
 
155 155
 		/**
156 156
 		 * Filter add to alter the argument before the wp quest run
157 157
 		 */
158
-		$args = apply_filters( 'give_tools_reset_stats_total_args', array(
158
+		$args = apply_filters('give_tools_reset_stats_total_args', array(
159 159
 			'post_type'      => 'give_payment',
160 160
 			'post_status'    => 'any',
161 161
 			'posts_per_page' => $this->per_step,
@@ -163,16 +163,16 @@  discard block
 block discarded – undo
163 163
 			// ONLY TEST MODE TRANSACTIONS!!!
164 164
 			'meta_key'       => '_give_payment_mode',
165 165
 			'meta_value'     => 'test',
166
-		) );
166
+		));
167 167
 
168 168
 		// Reset the post data.
169 169
 		wp_reset_postdata();
170 170
 		// Getting the new donation.
171
-		$donation_posts = new WP_Query( $args );
171
+		$donation_posts = new WP_Query($args);
172 172
 
173 173
 		// The Loop.
174
-		if ( $donation_posts->have_posts() ) {
175
-			while ( $donation_posts->have_posts() ) {
174
+		if ($donation_posts->have_posts()) {
175
+			while ($donation_posts->have_posts()) {
176 176
 				$donation_posts->the_post();
177 177
 				global $post;
178 178
 				// Add the donation id in side the array.
@@ -191,23 +191,23 @@  discard block
 block discarded – undo
191 191
 		$max_num_pages = (int) $donation_posts->max_num_pages;
192 192
 
193 193
 		// Check current page is less then max number of page or not
194
-		if ( $paged < $max_num_pages ) {
194
+		if ($paged < $max_num_pages) {
195 195
 			// Update the curretn page virable for the next step
196
-			$this->update_option( $this->step_on_key, $paged );
196
+			$this->update_option($this->step_on_key, $paged);
197 197
 
198 198
 			// Calculating percentage.
199 199
 			$page_remain          = $max_num_pages - $paged;
200
-			$this->total_step     = (int) $max_num_pages + ( $total_donation / $this->per_step ) + ( ( $page_remain * 2 ) * count( $donor_ids ) );
200
+			$this->total_step     = (int) $max_num_pages + ($total_donation / $this->per_step) + (($page_remain * 2) * count($donor_ids));
201 201
 			$this->step_completed = $paged;
202 202
 		} else {
203
-			$donation_ids_count = count( $donor_ids );
204
-			$this->update_option( $this->step_key, 'donation' );
205
-			$this->update_option( $this->step_on_key, '0' );
203
+			$donation_ids_count = count($donor_ids);
204
+			$this->update_option($this->step_key, 'donation');
205
+			$this->update_option($this->step_on_key, '0');
206 206
 		}
207 207
 
208
-		$donor_ids = array_unique( $donor_ids );
209
-		$this->update_option( $this->donor_key, $donor_ids );
210
-		$this->update_option( $this->donation_key, $donation_ids );
208
+		$donor_ids = array_unique($donor_ids);
209
+		$this->update_option($this->donor_key, $donor_ids);
210
+		$this->update_option($this->donation_key, $donation_ids);
211 211
 
212 212
 		wp_reset_postdata();
213 213
 	}
@@ -219,34 +219,34 @@  discard block
 block discarded – undo
219 219
 	 * @return int
220 220
 	 */
221 221
 	public function get_percentage_complete() {
222
-		return ceil( ( 100 * $this->step_completed ) / $this->total_step );
222
+		return ceil((100 * $this->step_completed) / $this->total_step);
223 223
 	}
224 224
 
225 225
 	public function process_step() {
226 226
 
227
-		if ( ! $this->can_export() ) {
228
-			wp_die( __( 'You do not have permission to delete test transactions.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
227
+		if ( ! $this->can_export()) {
228
+			wp_die(__('You do not have permission to delete test transactions.', 'give'), __('Error', 'give'), array('response' => 403));
229 229
 		}
230 230
 
231 231
 		$had_data = $this->get_data();
232 232
 
233
-		if ( $had_data ) {
233
+		if ($had_data) {
234 234
 			$this->done = false;
235 235
 
236 236
 			return true;
237 237
 		} else {
238
-			update_option( 'give_earnings_total', give_get_total_earnings( true ) );
239
-			Give_Cache::delete( Give_Cache::get_key( 'give_estimated_monthly_stats' ) );
238
+			update_option('give_earnings_total', give_get_total_earnings(true));
239
+			Give_Cache::delete(Give_Cache::get_key('give_estimated_monthly_stats'));
240 240
 
241
-			$this->delete_option( $this->donation_key );
241
+			$this->delete_option($this->donation_key);
242 242
 
243 243
 			// Reset the sequential order numbers
244
-			if ( give_get_option( 'enable_sequential' ) ) {
245
-				delete_option( 'give_last_payment_number' );
244
+			if (give_get_option('enable_sequential')) {
245
+				delete_option('give_last_payment_number');
246 246
 			}
247 247
 
248 248
 			$this->done    = true;
249
-			$this->message = __( 'Test donor and transactions successfully deleted.', 'give' );
249
+			$this->message = __('Test donor and transactions successfully deleted.', 'give');
250 250
 
251 251
 			return false;
252 252
 		}
@@ -264,12 +264,12 @@  discard block
 block discarded – undo
264 264
 	public function get_data() {
265 265
 
266 266
 		// Get the donation id's.
267
-		$donation_ids = $this->get_option( $this->donation_key );
267
+		$donation_ids = $this->get_option($this->donation_key);
268 268
 
269 269
 		/**
270 270
 		 * Return false id not test donation is found.
271 271
 		 */
272
-		if ( empty( $donation_ids ) ) {
272
+		if (empty($donation_ids)) {
273 273
 			$this->is_empty   = true;
274 274
 			$this->total_step = 1;
275 275
 
@@ -280,70 +280,70 @@  discard block
 block discarded – undo
280 280
 		$step = (int) $this->get_step();
281 281
 
282 282
 		// get teh donor ids.
283
-		$donor_ids = $this->get_option( $this->donor_key );
283
+		$donor_ids = $this->get_option($this->donor_key);
284 284
 
285 285
 		// In step to we delete all the donation in loop.
286
-		if ( 2 === $step ) {
286
+		if (2 === $step) {
287 287
 			$pass_to_donor = false;
288 288
 			$page          = (int) $this->get_step_page();
289
-			$page ++;
290
-			$count = count( $donation_ids );
289
+			$page++;
290
+			$count = count($donation_ids);
291 291
 
292
-			$this->total_step     = ( ( count( $donation_ids ) / $this->per_step ) * 2 ) + count( $donor_ids );
292
+			$this->total_step     = ((count($donation_ids) / $this->per_step) * 2) + count($donor_ids);
293 293
 			$this->step_completed = $page;
294 294
 
295 295
 
296
-			if ( $count > $this->per_step ) {
296
+			if ($count > $this->per_step) {
297 297
 
298
-				$this->update_option( $this->step_on_key, $page );
299
-				$donation_ids = $this->get_delete_ids( $donation_ids, $page );
300
-				$current_page = (int) ceil( $count / $this->per_step );
298
+				$this->update_option($this->step_on_key, $page);
299
+				$donation_ids = $this->get_delete_ids($donation_ids, $page);
300
+				$current_page = (int) ceil($count / $this->per_step);
301 301
 
302
-				if ( $page === $current_page ) {
302
+				if ($page === $current_page) {
303 303
 					$pass_to_donor = true;
304 304
 				}
305 305
 			} else {
306 306
 				$pass_to_donor = true;
307 307
 			}
308 308
 
309
-			if ( true === $pass_to_donor ) {
310
-				$this->update_option( $this->step_key, 'donor' );
311
-				$this->update_option( $this->step_on_key, '0' );
309
+			if (true === $pass_to_donor) {
310
+				$this->update_option($this->step_key, 'donor');
311
+				$this->update_option($this->step_on_key, '0');
312 312
 			}
313 313
 
314
-			foreach ( $donation_ids as $item ) {
314
+			foreach ($donation_ids as $item) {
315 315
 				// Delete the main payment.
316
-				give_delete_donation( absint( $item ) );
316
+				give_delete_donation(absint($item));
317 317
 			}
318
-			do_action( 'give_delete_log_cache' );
318
+			do_action('give_delete_log_cache');
319 319
 		}
320 320
 
321 321
 
322 322
 		// Here we delete all the donor
323
-		if ( 3 === $step ) {
323
+		if (3 === $step) {
324 324
 			$page  = (int) $this->get_step_page();
325
-			$count = count( $donor_ids );
325
+			$count = count($donor_ids);
326 326
 
327
-			$this->total_step     = ( ( count( $donation_ids ) / $this->per_step ) * 2 ) + count( $donor_ids );
328
-			$this->step_completed = $page + ( count( $donation_ids ) / $this->per_step );
327
+			$this->total_step     = ((count($donation_ids) / $this->per_step) * 2) + count($donor_ids);
328
+			$this->step_completed = $page + (count($donation_ids) / $this->per_step);
329 329
 
330
-			$args = apply_filters( 'give_tools_reset_stats_total_args', array(
330
+			$args = apply_filters('give_tools_reset_stats_total_args', array(
331 331
 				'post_type'      => 'give_payment',
332 332
 				'post_status'    => 'any',
333 333
 				'posts_per_page' => 1,
334 334
 				'meta_key'       => '_give_payment_mode',
335 335
 				'meta_value'     => 'live',
336
-				'author'         => $donor_ids[ $page ],
337
-			) );
336
+				'author'         => $donor_ids[$page],
337
+			));
338 338
 
339
-			$donation_posts = get_posts( $args );
340
-			if ( empty( $donation_posts ) ) {
341
-				Give()->donors->delete_by_user_id( $donor_ids[ $page ] );
339
+			$donation_posts = get_posts($args);
340
+			if (empty($donation_posts)) {
341
+				Give()->donors->delete_by_user_id($donor_ids[$page]);
342 342
 			}
343 343
 
344
-			$page ++;
345
-			$this->update_option( $this->step_on_key, $page );
346
-			if ( $count === $page ) {
344
+			$page++;
345
+			$this->update_option($this->step_on_key, $page);
346
+			if ($count === $page) {
347 347
 				$this->is_empty = false;
348 348
 
349 349
 				return false;
@@ -355,24 +355,24 @@  discard block
 block discarded – undo
355 355
 		return true;
356 356
 	}
357 357
 
358
-	public function get_delete_ids( $donation_ids, $page ) {
359
-		$index            = $page --;
360
-		$count            = count( $donation_ids );
358
+	public function get_delete_ids($donation_ids, $page) {
359
+		$index            = $page--;
360
+		$count            = count($donation_ids);
361 361
 		$temp             = 0;
362 362
 		$current_page     = 0;
363 363
 		$post_delete      = $this->per_step;
364 364
 		$page_donation_id = array();
365 365
 
366
-		foreach ( $donation_ids as $item ) {
367
-			$temp ++;
368
-			$page_donation_id[ $current_page ][] = $item;
369
-			if ( $temp === $post_delete ) {
370
-				$current_page ++;
366
+		foreach ($donation_ids as $item) {
367
+			$temp++;
368
+			$page_donation_id[$current_page][] = $item;
369
+			if ($temp === $post_delete) {
370
+				$current_page++;
371 371
 				$temp = 0;
372 372
 			}
373 373
 		}
374 374
 
375
-		return $page_donation_id[ $page ];
375
+		return $page_donation_id[$page];
376 376
 	}
377 377
 
378 378
 	/**
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
 	 *
385 385
 	 * @return mixed       Returns the data from the database
386 386
 	 */
387
-	public function get_option( $key, $defalut_value = false ) {
388
-		return get_option( $key, $defalut_value );
387
+	public function get_option($key, $defalut_value = false) {
388
+		return get_option($key, $defalut_value);
389 389
 	}
390 390
 
391 391
 	/**
@@ -398,8 +398,8 @@  discard block
 block discarded – undo
398 398
 	 *
399 399
 	 * @return void
400 400
 	 */
401
-	public function update_option( $key, $value ) {
402
-		update_option( $key, $value, false );
401
+	public function update_option($key, $value) {
402
+		update_option($key, $value, false);
403 403
 	}
404 404
 
405 405
 	/**
@@ -411,8 +411,8 @@  discard block
 block discarded – undo
411 411
 	 *
412 412
 	 * @return void
413 413
 	 */
414
-	public function delete_option( $key ) {
415
-		delete_option( $key );
414
+	public function delete_option($key) {
415
+		delete_option($key);
416 416
 	}
417 417
 
418 418
 	/**
@@ -423,12 +423,12 @@  discard block
 block discarded – undo
423 423
 	 * @return int|string
424 424
 	 */
425 425
 	private function get_step() {
426
-		$step_key = (string) $this->get_option( $this->step_key, false );
427
-		if ( 'count' === $step_key ) {
426
+		$step_key = (string) $this->get_option($this->step_key, false);
427
+		if ('count' === $step_key) {
428 428
 			return 1;
429
-		} elseif ( 'donation' === $step_key ) {
429
+		} elseif ('donation' === $step_key) {
430 430
 			return 2;
431
-		} elseif ( 'donor' === $step_key ) {
431
+		} elseif ('donor' === $step_key) {
432 432
 			return 3;
433 433
 		} else {
434 434
 			return $step_key;
@@ -439,6 +439,6 @@  discard block
 block discarded – undo
439 439
 	 * Get the current $page value in the ajax.
440 440
 	 */
441 441
 	private function get_step_page() {
442
-		return $this->get_option( $this->step_on_key, false );
442
+		return $this->get_option($this->step_on_key, false);
443 443
 	}
444 444
 }
Please login to merge, or discard this patch.
includes/formatting.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -340,7 +340,7 @@
 block discarded – undo
340 340
  * @since 1.0
341 341
  *
342 342
  * @param int|float|string $amount   Formatted or sanitized price
343
- * @param int|bool         $dp       number of decimals
343
+ * @param boolean         $dp       number of decimals
344 344
  * @param bool             $sanitize Whether or not sanitize number
345 345
  *
346 346
  * @return string $amount Newly formatted amount or Price Not Available
Please login to merge, or discard this patch.
Spacing   +171 added lines, -175 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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
 
@@ -23,37 +23,37 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return mixed
25 25
  */
26
-function give_get_currency_formatting_settings( $id_or_currency_code = null ) {
26
+function give_get_currency_formatting_settings($id_or_currency_code = null) {
27 27
 	$give_options = give_get_settings();
28 28
 	$setting      = array();
29 29
 
30
-	if ( ! empty( $id_or_currency_code ) ) {
31
-		$currencies = give_get_currencies( 'all' );
30
+	if ( ! empty($id_or_currency_code)) {
31
+		$currencies = give_get_currencies('all');
32 32
 
33 33
 		// Set default formatting setting only if currency not set as global currency.
34 34
 		if (
35
-			is_string( $id_or_currency_code ) &&
36
-			! empty( $give_options['currency'] ) &&
35
+			is_string($id_or_currency_code) &&
36
+			! empty($give_options['currency']) &&
37 37
 			$id_or_currency_code !== $give_options['currency'] &&
38
-			array_key_exists( $id_or_currency_code, $currencies )
38
+			array_key_exists($id_or_currency_code, $currencies)
39 39
 		) {
40
-			$setting = $currencies[ $id_or_currency_code ]['setting'];
41
-		} elseif ( is_numeric( $id_or_currency_code ) && 'give_payment' === get_post_type( $id_or_currency_code ) ) {
42
-			$donation_meta = give_get_meta( $id_or_currency_code, '_give_payment_meta', true );
40
+			$setting = $currencies[$id_or_currency_code]['setting'];
41
+		} elseif (is_numeric($id_or_currency_code) && 'give_payment' === get_post_type($id_or_currency_code)) {
42
+			$donation_meta = give_get_meta($id_or_currency_code, '_give_payment_meta', true);
43 43
 
44 44
 			if (
45
-				! empty( $donation_meta['currency'] ) &&
45
+				! empty($donation_meta['currency']) &&
46 46
 				$give_options['currency'] !== $donation_meta['currency']
47 47
 			) {
48
-				$setting = $currencies[ $donation_meta['currency'] ]['setting'];
48
+				$setting = $currencies[$donation_meta['currency']]['setting'];
49 49
 			}
50 50
 		}
51 51
 	}
52 52
 
53
-	if ( empty( $setting ) ) {
53
+	if (empty($setting)) {
54 54
 		// Set thousand separator.
55
-		$thousand_separator = isset( $give_options['thousands_separator'] ) ? $give_options['thousands_separator'] : ',';
56
-		$thousand_separator = empty( $thousand_separator ) ? ' ' : $thousand_separator;
55
+		$thousand_separator = isset($give_options['thousands_separator']) ? $give_options['thousands_separator'] : ',';
56
+		$thousand_separator = empty($thousand_separator) ? ' ' : $thousand_separator;
57 57
 
58 58
 		// Set decimal separator.
59 59
 		$default_decimal_separators = array(
@@ -61,17 +61,16 @@  discard block
 block discarded – undo
61 61
 			',' => '.',
62 62
 		);
63 63
 
64
-		$default_decimal_separator = in_array( $thousand_separator, $default_decimal_separators ) ?
65
-			$default_decimal_separators[ $thousand_separator ] :
66
-			'.';
64
+		$default_decimal_separator = in_array($thousand_separator, $default_decimal_separators) ?
65
+			$default_decimal_separators[$thousand_separator] : '.';
67 66
 
68
-		$decimal_separator = ! empty( $give_options['decimal_separator'] ) ? $give_options['decimal_separator'] : $default_decimal_separator;
67
+		$decimal_separator = ! empty($give_options['decimal_separator']) ? $give_options['decimal_separator'] : $default_decimal_separator;
69 68
 
70 69
 		$setting = array(
71
-			'currency_position'   => give_get_option( 'currency_position', 'before' ),
70
+			'currency_position'   => give_get_option('currency_position', 'before'),
72 71
 			'thousands_separator' => $thousand_separator,
73 72
 			'decimal_separator'   => $decimal_separator,
74
-			'number_decimals'     => give_get_option( 'number_decimals', 0 ),
73
+			'number_decimals'     => give_get_option('number_decimals', 0),
75 74
 		);
76 75
 	}
77 76
 
@@ -80,7 +79,7 @@  discard block
 block discarded – undo
80 79
 	 *
81 80
 	 * @since 1.8.15
82 81
 	 */
83
-	return apply_filters( 'give_get_currency_formatting_settings', $setting, $id_or_currency_code );
82
+	return apply_filters('give_get_currency_formatting_settings', $setting, $id_or_currency_code);
84 83
 }
85 84
 
86 85
 /**
@@ -92,16 +91,16 @@  discard block
 block discarded – undo
92 91
  *
93 92
  * @return mixed
94 93
  */
95
-function give_get_price_decimals( $id_or_currency_code = null ) {
94
+function give_get_price_decimals($id_or_currency_code = null) {
96 95
 	// Set currency on basis of donation id.
97
-	if ( empty( $id_or_currency_code ) ) {
96
+	if (empty($id_or_currency_code)) {
98 97
 		$id_or_currency_code = give_get_currency();
99 98
 	}
100 99
 
101 100
 	$number_of_decimals = 0;
102 101
 
103
-	if ( ! give_is_zero_based_currency( $id_or_currency_code ) ) {
104
-		$setting            = give_get_currency_formatting_settings( $id_or_currency_code );
102
+	if ( ! give_is_zero_based_currency($id_or_currency_code)) {
103
+		$setting            = give_get_currency_formatting_settings($id_or_currency_code);
105 104
 		$number_of_decimals = $setting['number_decimals'];
106 105
 	}
107 106
 
@@ -110,7 +109,7 @@  discard block
 block discarded – undo
110 109
 	 *
111 110
 	 * @since 1.6
112 111
 	 */
113
-	return apply_filters( 'give_sanitize_amount_decimals', $number_of_decimals, $id_or_currency_code );
112
+	return apply_filters('give_sanitize_amount_decimals', $number_of_decimals, $id_or_currency_code);
114 113
 }
115 114
 
116 115
 /**
@@ -122,15 +121,15 @@  discard block
 block discarded – undo
122 121
  *
123 122
  * @return mixed
124 123
  */
125
-function give_get_price_thousand_separator( $id_or_currency_code = null ) {
126
-	$setting = give_get_currency_formatting_settings( $id_or_currency_code );
124
+function give_get_price_thousand_separator($id_or_currency_code = null) {
125
+	$setting = give_get_currency_formatting_settings($id_or_currency_code);
127 126
 
128 127
 	/**
129 128
 	 * Filter the thousand separator
130 129
 	 *
131 130
 	 * @since 1.6
132 131
 	 */
133
-	return apply_filters( 'give_get_price_thousand_separator', $setting['thousands_separator'], $id_or_currency_code );
132
+	return apply_filters('give_get_price_thousand_separator', $setting['thousands_separator'], $id_or_currency_code);
134 133
 }
135 134
 
136 135
 /**
@@ -142,15 +141,15 @@  discard block
 block discarded – undo
142 141
  *
143 142
  * @return mixed
144 143
  */
145
-function give_get_price_decimal_separator( $id_or_currency_code = null ) {
146
-	$setting = give_get_currency_formatting_settings( $id_or_currency_code );
144
+function give_get_price_decimal_separator($id_or_currency_code = null) {
145
+	$setting = give_get_currency_formatting_settings($id_or_currency_code);
147 146
 
148 147
 	/**
149 148
 	 * Filter the thousand separator
150 149
 	 *
151 150
 	 * @since 1.6
152 151
 	 */
153
-	return apply_filters( 'give_get_price_decimal_separator', $setting['decimal_separator'], $id_or_currency_code );
152
+	return apply_filters('give_get_price_decimal_separator', $setting['decimal_separator'], $id_or_currency_code);
154 153
 }
155 154
 
156 155
 
@@ -163,8 +162,8 @@  discard block
 block discarded – undo
163 162
  *
164 163
  * @return string $amount Newly sanitized amount
165 164
  */
166
-function give_sanitize_amount_for_db( $number ) {
167
-	return give_maybe_sanitize_amount( $number, array( 'number_decimals' => 6 ) );
165
+function give_sanitize_amount_for_db($number) {
166
+	return give_maybe_sanitize_amount($number, array('number_decimals' => 6));
168 167
 }
169 168
 
170 169
 /**
@@ -177,19 +176,19 @@  discard block
 block discarded – undo
177 176
  *
178 177
  * @return string $amount Newly sanitized amount
179 178
  */
180
-function give_maybe_sanitize_amount( $number, $args = array() ) {
179
+function give_maybe_sanitize_amount($number, $args = array()) {
181 180
 	// Bailout.
182
-	if ( empty( $number ) || ( ! is_numeric( $number ) && ! is_string( $number ) ) ) {
181
+	if (empty($number) || ( ! is_numeric($number) && ! is_string($number))) {
183 182
 		return $number;
184 183
 	}
185 184
 
186 185
 	$func_args = func_get_args();
187 186
 
188 187
 	// Backward compatibility.
189
-	if ( isset( $func_args[1] ) && ( is_bool( $func_args[1] ) || is_numeric( $func_args[1] ) ) ) {
188
+	if (isset($func_args[1]) && (is_bool($func_args[1]) || is_numeric($func_args[1]))) {
190 189
 		$args = array(
191 190
 			'number_decimals' => $func_args[1],
192
-			'trim_zeros'      => isset( $func_args[2] ) ? $func_args[2] : false,
191
+			'trim_zeros'      => isset($func_args[2]) ? $func_args[2] : false,
193 192
 		);
194 193
 	}
195 194
 
@@ -202,23 +201,22 @@  discard block
 block discarded – undo
202 201
 		)
203 202
 	);
204 203
 
205
-	$thousand_separator = give_get_price_thousand_separator( $args['currency'] );
206
-	$decimal_separator  = give_get_price_decimal_separator( $args['currency'] );
207
-	$number_decimals    = is_bool( $args['number_decimals'] ) ?
208
-		give_get_price_decimals() :
209
-		$args['number_decimals'];
204
+	$thousand_separator = give_get_price_thousand_separator($args['currency']);
205
+	$decimal_separator  = give_get_price_decimal_separator($args['currency']);
206
+	$number_decimals    = is_bool($args['number_decimals']) ?
207
+		give_get_price_decimals() : $args['number_decimals'];
210 208
 
211 209
 	// Explode number by . decimal separator.
212
-	$number_parts = explode( '.', $number );
210
+	$number_parts = explode('.', $number);
213 211
 
214 212
 	// Remove currency symbols from number if any.
215
-	$number = trim( str_replace( give_currency_symbols( true ), '', $number ) );
213
+	$number = trim(str_replace(give_currency_symbols(true), '', $number));
216 214
 
217 215
 	if (
218 216
 		// Non formatted number.
219 217
 		(
220
-			( false === strpos( $number, $thousand_separator ) ) &&
221
-			( false === strpos( $number, $decimal_separator ) )
218
+			(false === strpos($number, $thousand_separator)) &&
219
+			(false === strpos($number, $decimal_separator))
222 220
 		) ||
223 221
 
224 222
 		// Decimal formatted number.
@@ -228,35 +226,35 @@  discard block
 block discarded – undo
228 226
 		(
229 227
 			$number_decimals &&
230 228
 			'.' === $thousand_separator &&
231
-			false !== strpos( $number, $thousand_separator ) &&
232
-			false === strpos( $number, $decimal_separator ) &&
233
-			2 === count( $number_parts ) &&
234
-			( $number_decimals >= strlen( $number_parts[1] ) )
229
+			false !== strpos($number, $thousand_separator) &&
230
+			false === strpos($number, $decimal_separator) &&
231
+			2 === count($number_parts) &&
232
+			($number_decimals >= strlen($number_parts[1]))
235 233
 		)
236 234
 	) {
237
-		return number_format( $number, $number_decimals, '.', '' );
235
+		return number_format($number, $number_decimals, '.', '');
238 236
 	}
239 237
 
240 238
 	// Handle thousand separator as '.'
241 239
 	// Handle sanitize database values.
242
-	$is_db_sanitize_val = ( 2 === count( $number_parts ) &&
243
-							is_numeric( $number_parts[0] ) &&
244
-							is_numeric( $number_parts[1] ) &&
245
-							( 6 === strlen( $number_parts[1] ) ) );
240
+	$is_db_sanitize_val = (2 === count($number_parts) &&
241
+							is_numeric($number_parts[0]) &&
242
+							is_numeric($number_parts[1]) &&
243
+							(6 === strlen($number_parts[1])));
246 244
 
247
-	if ( $is_db_sanitize_val ) {
245
+	if ($is_db_sanitize_val) {
248 246
 		// Sanitize database value.
249
-		return number_format( $number, $number_decimals, '.', '' );
247
+		return number_format($number, $number_decimals, '.', '');
250 248
 
251 249
 	} elseif (
252 250
 		'.' === $thousand_separator &&
253
-		false !== strpos( $number, $thousand_separator )
251
+		false !== strpos($number, $thousand_separator)
254 252
 	) {
255 253
 		// Fix point thousand separator value.
256
-		$number = str_replace( '.', '', $number );
254
+		$number = str_replace('.', '', $number);
257 255
 	}
258 256
 
259
-	return give_sanitize_amount( $number, $args );
257
+	return give_sanitize_amount($number, $args);
260 258
 }
261 259
 
262 260
 /**
@@ -273,10 +271,10 @@  discard block
 block discarded – undo
273 271
  *
274 272
  * @return string $amount Newly sanitized amount
275 273
  */
276
-function give_sanitize_amount( $number, $args = array() ) {
274
+function give_sanitize_amount($number, $args = array()) {
277 275
 
278 276
 	// Bailout.
279
-	if ( empty( $number ) || ( ! is_numeric( $number ) && ! is_string( $number ) ) ) {
277
+	if (empty($number) || ( ! is_numeric($number) && ! is_string($number))) {
280 278
 		return $number;
281 279
 	}
282 280
 
@@ -284,10 +282,10 @@  discard block
 block discarded – undo
284 282
 	$func_args = func_get_args();
285 283
 
286 284
 	// Backward compatibility.
287
-	if ( isset( $func_args[1] ) && ( is_bool( $func_args[1] ) || is_numeric( $func_args[1] ) ) ) {
285
+	if (isset($func_args[1]) && (is_bool($func_args[1]) || is_numeric($func_args[1]))) {
288 286
 		$args = array(
289 287
 			'number_decimals' => $func_args[1],
290
-			'trim_zeros'      => isset( $func_args[2] ) ? $func_args[2] : false,
288
+			'trim_zeros'      => isset($func_args[2]) ? $func_args[2] : false,
291 289
 		);
292 290
 	}
293 291
 
@@ -303,58 +301,58 @@  discard block
 block discarded – undo
303 301
 	// Remove slash from amount.
304 302
 	// If thousand or decimal separator is set to ' then in $_POST or $_GET param we will get an escaped number.
305 303
 	// To prevent notices and warning remove slash from amount/number.
306
-	$number = wp_unslash( $number );
304
+	$number = wp_unslash($number);
307 305
 
308
-	$thousand_separator = give_get_price_thousand_separator( $args['currency'] );
306
+	$thousand_separator = give_get_price_thousand_separator($args['currency']);
309 307
 
310 308
 	$locale   = localeconv();
311 309
 	$decimals = array(
312
-		give_get_price_decimal_separator( $args['currency'] ),
310
+		give_get_price_decimal_separator($args['currency']),
313 311
 		$locale['decimal_point'],
314 312
 		$locale['mon_decimal_point'],
315 313
 	);
316 314
 
317 315
 	// Remove locale from string
318
-	if ( ! is_float( $number ) ) {
319
-		$number = str_replace( $decimals, '.', $number );
316
+	if ( ! is_float($number)) {
317
+		$number = str_replace($decimals, '.', $number);
320 318
 	}
321 319
 
322 320
 	// Remove thousand amount formatting if amount has.
323 321
 	// This condition use to add backward compatibility to version before 1.6, because before version 1.6 we were saving formatted amount to db.
324 322
 	// Do not replace thousand separator from price if it is same as decimal separator, because it will be already replace by above code.
325
-	if ( ! in_array( $thousand_separator, $decimals ) && ( false !== strpos( $number, $thousand_separator ) ) ) {
326
-		$number = str_replace( $thousand_separator, '', $number );
327
-	} elseif ( in_array( $thousand_separator, $decimals ) ) {
328
-		$number = preg_replace( '/\.(?=.*\.)/', '', $number );
323
+	if ( ! in_array($thousand_separator, $decimals) && (false !== strpos($number, $thousand_separator))) {
324
+		$number = str_replace($thousand_separator, '', $number);
325
+	} elseif (in_array($thousand_separator, $decimals)) {
326
+		$number = preg_replace('/\.(?=.*\.)/', '', $number);
329 327
 	}
330 328
 
331 329
 	// Remove non numeric entity before decimal separator.
332
-	$number     = preg_replace( '/[^0-9\.]/', '', $number );
333
-	$default_dp = give_get_price_decimals( $args['currency'] );
330
+	$number     = preg_replace('/[^0-9\.]/', '', $number);
331
+	$default_dp = give_get_price_decimals($args['currency']);
334 332
 
335 333
 	// Reset negative amount to zero.
336
-	if ( 0 > $number ) {
337
-		$number = number_format( 0, $default_dp, '.' );
334
+	if (0 > $number) {
335
+		$number = number_format(0, $default_dp, '.');
338 336
 	}
339 337
 
340 338
 	// If number does not have decimal then add number of decimals to it.
341 339
 	if (
342
-		false === strpos( $number, '.' )
343
-		|| ( $default_dp > strlen( substr( $number, strpos( $number, '.' ) + 1 ) ) )
340
+		false === strpos($number, '.')
341
+		|| ($default_dp > strlen(substr($number, strpos($number, '.') + 1)))
344 342
 	) {
345
-		$number = number_format( $number, $default_dp, '.', '' );
343
+		$number = number_format($number, $default_dp, '.', '');
346 344
 	}
347 345
 
348 346
 	// Format number by custom number of decimals.
349
-	if ( false !== $args['number_decimals'] ) {
350
-		$dp     = intval( is_bool( $args['number_decimals'] ) ? $default_dp : $args['number_decimals'] );
351
-		$dp     = apply_filters( 'give_sanitize_amount_decimals', $dp, $number );
352
-		$number = number_format( floatval( $number ), $dp, '.', '' );
347
+	if (false !== $args['number_decimals']) {
348
+		$dp     = intval(is_bool($args['number_decimals']) ? $default_dp : $args['number_decimals']);
349
+		$dp     = apply_filters('give_sanitize_amount_decimals', $dp, $number);
350
+		$number = number_format(floatval($number), $dp, '.', '');
353 351
 	}
354 352
 
355 353
 	// Trim zeros.
356
-	if ( $args['trim_zeros'] && strstr( $number, '.' ) ) {
357
-		$number = rtrim( rtrim( $number, '0' ), '.' );
354
+	if ($args['trim_zeros'] && strstr($number, '.')) {
355
+		$number = rtrim(rtrim($number, '0'), '.');
358 356
 	}
359 357
 
360 358
 	/**
@@ -362,7 +360,7 @@  discard block
 block discarded – undo
362 360
 	 *
363 361
 	 * @since 1.0
364 362
 	 */
365
-	return apply_filters( 'give_sanitize_amount', $number );
363
+	return apply_filters('give_sanitize_amount', $number);
366 364
 }
367 365
 
368 366
 /**
@@ -375,9 +373,9 @@  discard block
 block discarded – undo
375 373
  *
376 374
  * @return string $amount   Newly formatted amount or Price Not Available
377 375
  */
378
-function give_format_amount( $amount, $args = array() ) {
376
+function give_format_amount($amount, $args = array()) {
379 377
 	// Backward compatibility.
380
-	if ( is_bool( $args ) ) {
378
+	if (is_bool($args)) {
381 379
 		$args = array(
382 380
 			'decimal' => $args,
383 381
 		);
@@ -390,61 +388,60 @@  discard block
 block discarded – undo
390 388
 		'currency'    => '',
391 389
 	);
392 390
 
393
-	$args = wp_parse_args( $args, $default_args );
391
+	$args = wp_parse_args($args, $default_args);
394 392
 
395 393
 	// Set Currency based on donation id, if required.
396
-	if ( $args['donation_id'] && empty( $args['currency'] ) ) {
397
-		$donation_meta    = give_get_meta( $args['donation_id'], '_give_payment_meta', true );
394
+	if ($args['donation_id'] && empty($args['currency'])) {
395
+		$donation_meta    = give_get_meta($args['donation_id'], '_give_payment_meta', true);
398 396
 		$args['currency'] = $donation_meta['currency'];
399 397
 	}
400 398
 
401 399
 	$formatted     = 0;
402
-	$currency      = ! empty( $args['currency'] ) ? $args['currency'] : give_get_currency( $args['donation_id'] );
403
-	$thousands_sep = give_get_price_thousand_separator( $currency );
404
-	$decimal_sep   = give_get_price_decimal_separator( $currency );
405
-	$decimals      = ! empty( $args['decimal'] ) ? give_get_price_decimals( $currency ) : 0;
400
+	$currency      = ! empty($args['currency']) ? $args['currency'] : give_get_currency($args['donation_id']);
401
+	$thousands_sep = give_get_price_thousand_separator($currency);
402
+	$decimal_sep   = give_get_price_decimal_separator($currency);
403
+	$decimals      = ! empty($args['decimal']) ? give_get_price_decimals($currency) : 0;
406 404
 
407
-	if ( ! empty( $amount ) ) {
405
+	if ( ! empty($amount)) {
408 406
 		// Sanitize amount before formatting.
409
-		$amount = ! empty( $args['sanitize'] ) ?
410
-			give_maybe_sanitize_amount( $amount, array( 'number_decimals' => $decimals, 'currency' => $currency ) ) :
411
-			number_format( $amount, $decimals, '.', '' );
407
+		$amount = ! empty($args['sanitize']) ?
408
+			give_maybe_sanitize_amount($amount, array('number_decimals' => $decimals, 'currency' => $currency)) : number_format($amount, $decimals, '.', '');
412 409
 
413
-		switch ( $currency ) {
410
+		switch ($currency) {
414 411
 			case 'INR':
415 412
 				$decimal_amount = '';
416 413
 
417 414
 				// Extract decimals from amount
418
-				if ( ( $pos = strpos( $amount, '.' ) ) !== false ) {
419
-					if ( ! empty( $decimals ) ) {
420
-						$decimal_amount = substr( round( substr( $amount, $pos ), $decimals ), 1 );
421
-						$amount         = substr( $amount, 0, $pos );
422
-
423
-						if ( ! $decimal_amount ) {
424
-							$decimal_amount = substr( "{$decimal_sep}0000000000", 0, ( $decimals + 1 ) );
425
-						} elseif ( ( $decimals + 1 ) > strlen( $decimal_amount ) ) {
426
-							$decimal_amount = substr( "{$decimal_amount}000000000", 0, ( $decimals + 1 ) );
415
+				if (($pos = strpos($amount, '.')) !== false) {
416
+					if ( ! empty($decimals)) {
417
+						$decimal_amount = substr(round(substr($amount, $pos), $decimals), 1);
418
+						$amount         = substr($amount, 0, $pos);
419
+
420
+						if ( ! $decimal_amount) {
421
+							$decimal_amount = substr("{$decimal_sep}0000000000", 0, ($decimals + 1));
422
+						} elseif (($decimals + 1) > strlen($decimal_amount)) {
423
+							$decimal_amount = substr("{$decimal_amount}000000000", 0, ($decimals + 1));
427 424
 						}
428 425
 					} else {
429
-						$amount = number_format( $amount, $decimals, $decimal_sep, '' );
426
+						$amount = number_format($amount, $decimals, $decimal_sep, '');
430 427
 					}
431 428
 				}
432 429
 
433 430
 				// Extract last 3 from amount
434
-				$result = substr( $amount, - 3 );
435
-				$amount = substr( $amount, 0, - 3 );
431
+				$result = substr($amount, - 3);
432
+				$amount = substr($amount, 0, - 3);
436 433
 
437 434
 				// Apply digits 2 by 2
438
-				while ( strlen( $amount ) > 0 ) {
439
-					$result = substr( $amount, - 2 ) . $thousands_sep . $result;
440
-					$amount = substr( $amount, 0, - 2 );
435
+				while (strlen($amount) > 0) {
436
+					$result = substr($amount, - 2).$thousands_sep.$result;
437
+					$amount = substr($amount, 0, - 2);
441 438
 				}
442 439
 
443
-				$formatted = $result . $decimal_amount;
440
+				$formatted = $result.$decimal_amount;
444 441
 				break;
445 442
 
446 443
 			default:
447
-				$formatted = number_format( $amount, $decimals, $decimal_sep, $thousands_sep );
444
+				$formatted = number_format($amount, $decimals, $decimal_sep, $thousands_sep);
448 445
 		}
449 446
 	}
450 447
 
@@ -453,7 +450,7 @@  discard block
 block discarded – undo
453 450
 	 *
454 451
 	 * @since 1.0
455 452
 	 */
456
-	return apply_filters( 'give_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep, $currency, $args );
453
+	return apply_filters('give_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep, $currency, $args);
457 454
 }
458 455
 
459 456
 
@@ -471,17 +468,17 @@  discard block
 block discarded – undo
471 468
  *
472 469
  * @return string  formatted amount number with large number names.
473 470
  */
474
-function give_human_format_large_amount( $amount, $args = array() ) {
471
+function give_human_format_large_amount($amount, $args = array()) {
475 472
 	// Sanitize amount.
476
-	$sanitize_amount = give_maybe_sanitize_amount( $amount );
473
+	$sanitize_amount = give_maybe_sanitize_amount($amount);
477 474
 
478 475
 	// Bailout.
479
-	if ( ! floatval( $sanitize_amount ) ) {
476
+	if ( ! floatval($sanitize_amount)) {
480 477
 		return '0';
481 478
 	};
482 479
 
483 480
 	// Set default currency;
484
-	if ( empty( $args['currency'] ) ) {
481
+	if (empty($args['currency'])) {
485 482
 		$args['currency'] = give_get_currency();
486 483
 	}
487 484
 
@@ -489,37 +486,37 @@  discard block
 block discarded – undo
489 486
 	$thousands_sep = give_get_price_thousand_separator();
490 487
 
491 488
 	// Explode amount to calculate name of large numbers.
492
-	$amount_array = explode( $thousands_sep, $amount );
489
+	$amount_array = explode($thousands_sep, $amount);
493 490
 
494 491
 	// Calculate amount parts count.
495
-	$amount_count_parts = count( $amount_array );
492
+	$amount_count_parts = count($amount_array);
496 493
 
497 494
 	// Human format amount (default).
498 495
 	$human_format_amount = $amount;
499 496
 
500
-	switch ( $args['currency'] ) {
497
+	switch ($args['currency']) {
501 498
 		case 'INR':
502 499
 			// Calculate large number formatted amount.
503
-			if ( 4 < $amount_count_parts ) {
504
-				$human_format_amount = sprintf( esc_html__( '%s arab', 'give' ), round( ( $sanitize_amount / 1000000000 ), 2 ) );
505
-			} elseif ( 3 < $amount_count_parts ) {
506
-				$human_format_amount = sprintf( esc_html__( '%s crore', 'give' ), round( ( $sanitize_amount / 10000000 ), 2 ) );
507
-			} elseif ( 2 < $amount_count_parts ) {
508
-				$human_format_amount = sprintf( esc_html__( '%s lakh', 'give' ), round( ( $sanitize_amount / 100000 ), 2 ) );
500
+			if (4 < $amount_count_parts) {
501
+				$human_format_amount = sprintf(esc_html__('%s arab', 'give'), round(($sanitize_amount / 1000000000), 2));
502
+			} elseif (3 < $amount_count_parts) {
503
+				$human_format_amount = sprintf(esc_html__('%s crore', 'give'), round(($sanitize_amount / 10000000), 2));
504
+			} elseif (2 < $amount_count_parts) {
505
+				$human_format_amount = sprintf(esc_html__('%s lakh', 'give'), round(($sanitize_amount / 100000), 2));
509 506
 			}
510 507
 			break;
511 508
 		default:
512 509
 			// Calculate large number formatted amount.
513
-			if ( 4 < $amount_count_parts ) {
514
-				$human_format_amount = sprintf( esc_html__( '%s trillion', 'give' ), round( ( $sanitize_amount / 1000000000000 ), 2 ) );
515
-			} elseif ( 3 < $amount_count_parts ) {
516
-				$human_format_amount = sprintf( esc_html__( '%s billion', 'give' ), round( ( $sanitize_amount / 1000000000 ), 2 ) );
517
-			} elseif ( 2 < $amount_count_parts ) {
518
-				$human_format_amount = sprintf( esc_html__( '%s million', 'give' ), round( ( $sanitize_amount / 1000000 ), 2 ) );
510
+			if (4 < $amount_count_parts) {
511
+				$human_format_amount = sprintf(esc_html__('%s trillion', 'give'), round(($sanitize_amount / 1000000000000), 2));
512
+			} elseif (3 < $amount_count_parts) {
513
+				$human_format_amount = sprintf(esc_html__('%s billion', 'give'), round(($sanitize_amount / 1000000000), 2));
514
+			} elseif (2 < $amount_count_parts) {
515
+				$human_format_amount = sprintf(esc_html__('%s million', 'give'), round(($sanitize_amount / 1000000), 2));
519 516
 			}
520 517
 	}
521 518
 
522
-	return apply_filters( 'give_human_format_large_amount', $human_format_amount, $amount, $sanitize_amount );
519
+	return apply_filters('give_human_format_large_amount', $human_format_amount, $amount, $sanitize_amount);
523 520
 }
524 521
 
525 522
 /**
@@ -533,17 +530,16 @@  discard block
 block discarded – undo
533 530
  *
534 531
  * @return string $amount Newly formatted amount or Price Not Available
535 532
  */
536
-function give_format_decimal( $amount, $dp = false, $sanitize = true ) {
533
+function give_format_decimal($amount, $dp = false, $sanitize = true) {
537 534
 	$decimal_separator = give_get_price_decimal_separator();
538 535
 	$formatted_amount  = $sanitize ?
539
-		give_maybe_sanitize_amount( $amount, array( 'number_decimals' => $dp ) ) :
540
-		number_format( $amount, ( is_bool( $dp ) ? give_get_price_decimals() : $dp ), '.', '' );
536
+		give_maybe_sanitize_amount($amount, array('number_decimals' => $dp)) : number_format($amount, (is_bool($dp) ? give_get_price_decimals() : $dp), '.', '');
541 537
 
542
-	if ( false !== strpos( $formatted_amount, '.' ) ) {
543
-		$formatted_amount = str_replace( '.', $decimal_separator, $formatted_amount );
538
+	if (false !== strpos($formatted_amount, '.')) {
539
+		$formatted_amount = str_replace('.', $decimal_separator, $formatted_amount);
544 540
 	}
545 541
 
546
-	return apply_filters( 'give_format_decimal', $formatted_amount, $amount, $decimal_separator );
542
+	return apply_filters('give_format_decimal', $formatted_amount, $amount, $decimal_separator);
547 543
 }
548 544
 
549 545
 /**
@@ -555,7 +551,7 @@  discard block
 block discarded – undo
555 551
  *
556 552
  * @return string                  Date format string
557 553
  */
558
-function give_date_format( $date_context = '' ) {
554
+function give_date_format($date_context = '') {
559 555
 	/**
560 556
 	 * Filter the date context
561 557
 	 *
@@ -576,19 +572,19 @@  discard block
 block discarded – undo
576 572
 	 *
577 573
 	 *    }
578 574
 	 */
579
-	$date_format_contexts = apply_filters( 'give_date_format_contexts', array() );
575
+	$date_format_contexts = apply_filters('give_date_format_contexts', array());
580 576
 
581 577
 	// Set date format to default date format.
582
-	$date_format = get_option( 'date_format' );
578
+	$date_format = get_option('date_format');
583 579
 
584 580
 	// Update date format if we have non empty date format context array and non empty date format string for that context.
585
-	if ( $date_context && ! empty( $date_format_contexts ) && array_key_exists( $date_context, $date_format_contexts ) ) {
586
-		$date_format = ! empty( $date_format_contexts[ $date_context ] )
587
-			? $date_format_contexts[ $date_context ]
581
+	if ($date_context && ! empty($date_format_contexts) && array_key_exists($date_context, $date_format_contexts)) {
582
+		$date_format = ! empty($date_format_contexts[$date_context])
583
+			? $date_format_contexts[$date_context]
588 584
 			: $date_format;
589 585
 	}
590 586
 
591
-	return apply_filters( 'give_date_format', $date_format );
587
+	return apply_filters('give_date_format', $date_format);
592 588
 }
593 589
 
594 590
 /**
@@ -602,8 +598,8 @@  discard block
 block discarded – undo
602 598
  *
603 599
  * @return string
604 600
  */
605
-function give_get_cache_key( $action, $query_args ) {
606
-	return Give_Cache::get_key( $action, $query_args );
601
+function give_get_cache_key($action, $query_args) {
602
+	return Give_Cache::get_key($action, $query_args);
607 603
 }
608 604
 
609 605
 /**
@@ -616,11 +612,11 @@  discard block
 block discarded – undo
616 612
  *
617 613
  * @return string|array
618 614
  */
619
-function give_clean( $var ) {
620
-	if ( is_array( $var ) ) {
621
-		return array_map( 'give_clean', $var );
615
+function give_clean($var) {
616
+	if (is_array($var)) {
617
+		return array_map('give_clean', $var);
622 618
 	} else {
623
-		return is_scalar( $var ) ? sanitize_text_field( $var ) : $var;
619
+		return is_scalar($var) ? sanitize_text_field($var) : $var;
624 620
 	}
625 621
 }
626 622
 
@@ -633,10 +629,10 @@  discard block
 block discarded – undo
633 629
  *
634 630
  * @return int
635 631
  */
636
-function give_let_to_num( $size ) {
637
-	$l   = substr( $size, - 1 );
638
-	$ret = substr( $size, 0, - 1 );
639
-	switch ( strtoupper( $l ) ) {
632
+function give_let_to_num($size) {
633
+	$l   = substr($size, - 1);
634
+	$ret = substr($size, 0, - 1);
635
+	switch (strtoupper($l)) {
640 636
 		case 'P':
641 637
 			$ret *= 1024;
642 638
 		case 'T':
@@ -661,19 +657,19 @@  discard block
 block discarded – undo
661 657
  * @param int   $action
662 658
  * @param array $wp_die_args
663 659
  */
664
-function give_validate_nonce( $nonce, $action = - 1, $wp_die_args = array() ) {
660
+function give_validate_nonce($nonce, $action = - 1, $wp_die_args = array()) {
665 661
 
666 662
 	$default_wp_die_args = array(
667
-		'message' => esc_html__( 'Nonce verification has failed.', 'give' ),
668
-		'title'   => esc_html__( 'Error', 'give' ),
663
+		'message' => esc_html__('Nonce verification has failed.', 'give'),
664
+		'title'   => esc_html__('Error', 'give'),
669 665
 		'args'    => array(
670 666
 			'response' => 403,
671 667
 		),
672 668
 	);
673 669
 
674
-	$wp_die_args = wp_parse_args( $wp_die_args, $default_wp_die_args );
670
+	$wp_die_args = wp_parse_args($wp_die_args, $default_wp_die_args);
675 671
 
676
-	if ( ! wp_verify_nonce( $nonce, $action ) ) {
672
+	if ( ! wp_verify_nonce($nonce, $action)) {
677 673
 		wp_die(
678 674
 			$wp_die_args['message'],
679 675
 			$wp_die_args['title'],
@@ -695,23 +691,23 @@  discard block
 block discarded – undo
695 691
  *
696 692
  * @return mixed
697 693
  */
698
-function give_check_variable( $variable, $conditional = '', $default = false ) {
694
+function give_check_variable($variable, $conditional = '', $default = false) {
699 695
 
700
-	switch ( $conditional ) {
696
+	switch ($conditional) {
701 697
 		case 'isset_empty':
702
-			$variable = ( isset( $variable ) && ! empty( $variable ) ) ? $variable : $default;
698
+			$variable = (isset($variable) && ! empty($variable)) ? $variable : $default;
703 699
 			break;
704 700
 
705 701
 		case 'empty':
706
-			$variable = ! empty( $variable ) ? $variable : $default;
702
+			$variable = ! empty($variable) ? $variable : $default;
707 703
 			break;
708 704
 
709 705
 		case 'null':
710
-			$variable = ! is_null( $variable ) ? $variable : $default;
706
+			$variable = ! is_null($variable) ? $variable : $default;
711 707
 			break;
712 708
 
713 709
 		default:
714
-			$variable = isset( $variable ) ? $variable : $default;
710
+			$variable = isset($variable) ? $variable : $default;
715 711
 
716 712
 	}
717 713
 
Please login to merge, or discard this patch.
includes/admin/upgrades/views/plugins-update-section.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* @var Give_Updates $give_updates */
3
-$plugins = $give_updates->get_updates( 'plugin' );
4
-if ( empty( $plugins ) ) {
3
+$plugins = $give_updates->get_updates('plugin');
4
+if (empty($plugins)) {
5 5
 	return;
6 6
 }
7 7
 
8 8
 ob_start();
9
-foreach ( $plugins as $plugin_data ) {
10
-	if ( 'active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type'] ) {
9
+foreach ($plugins as $plugin_data) {
10
+	if ('active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type']) {
11 11
 		continue;
12 12
 	}
13 13
 
@@ -15,36 +15,36 @@  discard block
 block discarded – undo
15 15
 	$author_name = $plugin_data['Author'];
16 16
 
17 17
 	// Link the plugin name to the plugin URL if available.
18
-	if ( ! empty( $plugin_data['PluginURI'] ) ) {
18
+	if ( ! empty($plugin_data['PluginURI'])) {
19 19
 		$plugin_name = sprintf(
20 20
 			'<a href="%s" title="%s">%s</a> (%s)',
21
-			esc_url( $plugin_data['PluginURI'] ),
22
-			esc_attr__( 'Visit plugin homepage', 'give' ),
21
+			esc_url($plugin_data['PluginURI']),
22
+			esc_attr__('Visit plugin homepage', 'give'),
23 23
 			$plugin_name,
24
-			esc_html( $plugin_data['Version'] )
24
+			esc_html($plugin_data['Version'])
25 25
 		);
26 26
 	}
27 27
 
28 28
 	// Link the author name to the author URL if available.
29
-	if ( ! empty( $plugin_data['AuthorURI'] ) ) {
29
+	if ( ! empty($plugin_data['AuthorURI'])) {
30 30
 		$author_name = sprintf(
31 31
 			'<a href="%s" title="%s">%s</a>',
32
-			esc_url( $plugin_data['AuthorURI'] ),
33
-			esc_attr__( 'Visit author homepage', 'give' ),
32
+			esc_url($plugin_data['AuthorURI']),
33
+			esc_attr__('Visit author homepage', 'give'),
34 34
 			$author_name
35 35
 		);
36 36
 	}
37 37
 	?>
38
-	<tr <?php echo( true !== $plugin_data['License'] ? 'data-tooltip="' . __( 'Unlicensed add-ons cannot be updated. Please purchase or renew a valid license.', 'give' ) . '"' : '' ); ?>>
39
-		<td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td>
38
+	<tr <?php echo(true !== $plugin_data['License'] ? 'data-tooltip="'.__('Unlicensed add-ons cannot be updated. Please purchase or renew a valid license.', 'give').'"' : ''); ?>>
39
+		<td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td>
40 40
 		<td>
41 41
 			<?php
42
-			echo ( true === $plugin_data['License'] ) ? '<span class="dashicons dashicons-yes"></span>' . __( 'Licensed', 'give' ) : '<span class="dashicons dashicons-no-alt"></span>' . __( 'Unlicensed', 'give' );
42
+			echo (true === $plugin_data['License']) ? '<span class="dashicons dashicons-yes"></span>'.__('Licensed', 'give') : '<span class="dashicons dashicons-no-alt"></span>'.__('Unlicensed', 'give');
43 43
 
44 44
 			echo sprintf(
45 45
 				' &ndash; %s &ndash; %s',
46
-				sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ),
47
-				sprintf( __( '(Latest Version: %s)' ), $plugin_data['update']->new_version )
46
+				sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))),
47
+				sprintf(__('(Latest Version: %s)'), $plugin_data['update']->new_version)
48 48
 			);
49 49
 			?>
50 50
 		</td>
Please login to merge, or discard this patch.
includes/admin/forms/dashboard-columns.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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
 
@@ -27,34 +27,34 @@  discard block
 block discarded – undo
27 27
  * @return array $form_columns Updated array of forms columns
28 28
  *  Post Type List Table
29 29
  */
30
-function give_form_columns( $give_form_columns ) {
30
+function give_form_columns($give_form_columns) {
31 31
 
32 32
 	// Standard columns
33 33
 	$give_form_columns = array(
34 34
 		'cb'            => '<input type="checkbox"/>',
35
-		'title'         => __( 'Name', 'give' ),
36
-		'form_category' => __( 'Categories', 'give' ),
37
-		'form_tag'      => __( 'Tags', 'give' ),
38
-		'price'         => __( 'Amount', 'give' ),
39
-		'goal'          => __( 'Goal', 'give' ),
40
-		'donations'     => __( 'Donations', 'give' ),
41
-		'earnings'      => __( 'Income', 'give' ),
42
-		'shortcode'     => __( 'Shortcode', 'give' ),
43
-		'date'          => __( 'Date', 'give' ),
35
+		'title'         => __('Name', 'give'),
36
+		'form_category' => __('Categories', 'give'),
37
+		'form_tag'      => __('Tags', 'give'),
38
+		'price'         => __('Amount', 'give'),
39
+		'goal'          => __('Goal', 'give'),
40
+		'donations'     => __('Donations', 'give'),
41
+		'earnings'      => __('Income', 'give'),
42
+		'shortcode'     => __('Shortcode', 'give'),
43
+		'date'          => __('Date', 'give'),
44 44
 	);
45 45
 
46 46
 	// Does the user want categories / tags?
47
-	if ( ! give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) ) ) {
48
-		unset( $give_form_columns['form_category'] );
47
+	if ( ! give_is_setting_enabled(give_get_option('categories', 'disabled'))) {
48
+		unset($give_form_columns['form_category']);
49 49
 	}
50
-	if ( ! give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) ) ) {
51
-		unset( $give_form_columns['form_tag'] );
50
+	if ( ! give_is_setting_enabled(give_get_option('tags', 'disabled'))) {
51
+		unset($give_form_columns['form_tag']);
52 52
 	}
53 53
 
54
-	return apply_filters( 'give_forms_columns', $give_form_columns );
54
+	return apply_filters('give_forms_columns', $give_form_columns);
55 55
 }
56 56
 
57
-add_filter( 'manage_edit-give_forms_columns', 'give_form_columns' );
57
+add_filter('manage_edit-give_forms_columns', 'give_form_columns');
58 58
 
59 59
 /**
60 60
  * Render Give Form Columns
@@ -66,59 +66,59 @@  discard block
 block discarded – undo
66 66
  *
67 67
  * @return void
68 68
  */
69
-function give_render_form_columns( $column_name, $post_id ) {
70
-	if ( get_post_type( $post_id ) == 'give_forms' ) {
69
+function give_render_form_columns($column_name, $post_id) {
70
+	if (get_post_type($post_id) == 'give_forms') {
71 71
 
72
-		switch ( $column_name ) {
72
+		switch ($column_name) {
73 73
 			case 'form_category':
74
-				echo get_the_term_list( $post_id, 'give_forms_category', '', ', ', '' );
74
+				echo get_the_term_list($post_id, 'give_forms_category', '', ', ', '');
75 75
 				break;
76 76
 			case 'form_tag':
77
-				echo get_the_term_list( $post_id, 'give_forms_tag', '', ', ', '' );
77
+				echo get_the_term_list($post_id, 'give_forms_tag', '', ', ', '');
78 78
 				break;
79 79
 			case 'price':
80
-				if ( give_has_variable_prices( $post_id ) ) {
81
-					echo give_price_range( $post_id );
80
+				if (give_has_variable_prices($post_id)) {
81
+					echo give_price_range($post_id);
82 82
 				} else {
83
-					echo give_price( $post_id, false );
84
-					echo '<input type="hidden" class="formprice-' . $post_id . '" value="' . give_get_form_price( $post_id ) . '" />';
83
+					echo give_price($post_id, false);
84
+					echo '<input type="hidden" class="formprice-'.$post_id.'" value="'.give_get_form_price($post_id).'" />';
85 85
 				}
86 86
 				break;
87 87
 			case 'goal':
88
-				if ( give_is_setting_enabled( give_get_meta( $post_id, '_give_goal_option', true ) ) ) {
89
-					echo give_goal( $post_id, false );
88
+				if (give_is_setting_enabled(give_get_meta($post_id, '_give_goal_option', true))) {
89
+					echo give_goal($post_id, false);
90 90
 				} else {
91
-					esc_html_e( 'No Goal Set', 'give' );
91
+					esc_html_e('No Goal Set', 'give');
92 92
 				}
93 93
 
94
-				echo '<input type="hidden" class="formgoal-' . $post_id . '" value="' . give_get_form_goal( $post_id ) . '" />';
94
+				echo '<input type="hidden" class="formgoal-'.$post_id.'" value="'.give_get_form_goal($post_id).'" />';
95 95
 				break;
96 96
 			case 'donations':
97
-				if ( current_user_can( 'view_give_form_stats', $post_id ) ) {
98
-					echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&form_id=' . $post_id ) ) . '">';
99
-					echo give_get_form_sales_stats( $post_id );
97
+				if (current_user_can('view_give_form_stats', $post_id)) {
98
+					echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-payment-history&form_id='.$post_id)).'">';
99
+					echo give_get_form_sales_stats($post_id);
100 100
 					echo '</a>';
101 101
 				} else {
102 102
 					echo '-';
103 103
 				}
104 104
 				break;
105 105
 			case 'earnings':
106
-				if ( current_user_can( 'view_give_form_stats', $post_id ) ) {
107
-					echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-reports&tab=forms&form-id=' . $post_id ) ) . '">';
108
-					echo give_currency_filter( give_format_amount( give_get_form_earnings_stats( $post_id ), array( 'sanitize' => false ) ) );
106
+				if (current_user_can('view_give_form_stats', $post_id)) {
107
+					echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-reports&tab=forms&form-id='.$post_id)).'">';
108
+					echo give_currency_filter(give_format_amount(give_get_form_earnings_stats($post_id), array('sanitize' => false)));
109 109
 					echo '</a>';
110 110
 				} else {
111 111
 					echo '-';
112 112
 				}
113 113
 				break;
114 114
 			case 'shortcode':
115
-				echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id=&#34;' . absint( $post_id ) . '&#34;]">';
115
+				echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id=&#34;'.absint($post_id).'&#34;]">';
116 116
 				break;
117 117
 		}// End switch().
118 118
 	}// End if().
119 119
 }
120 120
 
121
-add_action( 'manage_posts_custom_column', 'give_render_form_columns', 10, 2 );
121
+add_action('manage_posts_custom_column', 'give_render_form_columns', 10, 2);
122 122
 
123 123
 /**
124 124
  * Registers the sortable columns in the list table
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
  *
130 130
  * @return array $columns Array of sortable columns
131 131
  */
132
-function give_sortable_form_columns( $columns ) {
132
+function give_sortable_form_columns($columns) {
133 133
 	$columns['price']     = 'amount';
134 134
 	$columns['sales']     = 'sales';
135 135
 	$columns['earnings']  = 'earnings';
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	return $columns;
140 140
 }
141 141
 
142
-add_filter( 'manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns' );
142
+add_filter('manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns');
143 143
 
144 144
 /**
145 145
  * Sorts Columns in the Forms List Table
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
  *
151 151
  * @return array $vars Array of all the sort variables.
152 152
  */
153
-function give_sort_forms( $vars ) {
153
+function give_sort_forms($vars) {
154 154
 	// Check if we're viewing the "give_forms" post type.
155
-	if ( ! isset( $vars['post_type'] ) || ! isset( $vars['orderby'] ) || 'give_forms' !== $vars['post_type'] ) {
155
+	if ( ! isset($vars['post_type']) || ! isset($vars['orderby']) || 'give_forms' !== $vars['post_type']) {
156 156
 		return $vars;
157 157
 	}
158 158
 
159
-	switch ( $vars['orderby'] ) {
159
+	switch ($vars['orderby']) {
160 160
 		// Check if 'orderby' is set to "sales".
161 161
 		case 'sales':
162 162
 			$vars = array_merge(
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
 		// Check if "orderby" is set to "price/amount".
183 183
 		case 'amount':
184
-			$multi_level_meta_key = ( 'asc' === $vars['order'] ) ? '_give_levels_minimum_amount' : '_give_levels_maximum_amount';
184
+			$multi_level_meta_key = ('asc' === $vars['order']) ? '_give_levels_minimum_amount' : '_give_levels_maximum_amount';
185 185
 
186 186
 			$vars['orderby']    = 'meta_value_num';
187 187
 			$vars['meta_query'] = array(
@@ -233,17 +233,17 @@  discard block
 block discarded – undo
233 233
  *
234 234
  * @return array       Array of all sort variables.
235 235
  */
236
-function give_filter_forms( $vars ) {
237
-	if ( isset( $vars['post_type'] ) && 'give_forms' == $vars['post_type'] ) {
236
+function give_filter_forms($vars) {
237
+	if (isset($vars['post_type']) && 'give_forms' == $vars['post_type']) {
238 238
 
239 239
 		// If an author ID was passed, use it
240
-		if ( isset( $_REQUEST['author'] ) && ! current_user_can( 'view_give_reports' ) ) {
240
+		if (isset($_REQUEST['author']) && ! current_user_can('view_give_reports')) {
241 241
 
242 242
 			$author_id = $_REQUEST['author'];
243
-			if ( (int) $author_id !== get_current_user_id() ) {
244
-				wp_die( esc_html__( 'You do not have permission to view this data.', 'give' ), esc_html__( 'Error', 'give' ), array(
243
+			if ((int) $author_id !== get_current_user_id()) {
244
+				wp_die(esc_html__('You do not have permission to view this data.', 'give'), esc_html__('Error', 'give'), array(
245 245
 					'response' => 403,
246
-				) );
246
+				));
247 247
 			}
248 248
 			$vars = array_merge(
249 249
 				$vars,
@@ -267,11 +267,11 @@  discard block
 block discarded – undo
267 267
  * @return void
268 268
  */
269 269
 function give_forms_load() {
270
-	add_filter( 'request', 'give_sort_forms' );
271
-	add_filter( 'request', 'give_filter_forms' );
270
+	add_filter('request', 'give_sort_forms');
271
+	add_filter('request', 'give_filter_forms');
272 272
 }
273 273
 
274
-add_action( 'load-edit.php', 'give_forms_load', 9999 );
274
+add_action('load-edit.php', 'give_forms_load', 9999);
275 275
 
276 276
 /**
277 277
  * Remove Forms Month Filter
@@ -285,17 +285,17 @@  discard block
 block discarded – undo
285 285
  * @global      $typenow The post type we are viewing.
286 286
  * @return array Empty array disables the dropdown.
287 287
  */
288
-function give_remove_month_filter( $dates ) {
288
+function give_remove_month_filter($dates) {
289 289
 	global $typenow;
290 290
 
291
-	if ( $typenow == 'give_forms' ) {
291
+	if ($typenow == 'give_forms') {
292 292
 		$dates = array();
293 293
 	}
294 294
 
295 295
 	return $dates;
296 296
 }
297 297
 
298
-add_filter( 'months_dropdown_results', 'give_remove_month_filter', 99 );
298
+add_filter('months_dropdown_results', 'give_remove_month_filter', 99);
299 299
 
300 300
 /**
301 301
  * Updates price when saving post
@@ -306,23 +306,23 @@  discard block
 block discarded – undo
306 306
  *
307 307
  * @return int|null
308 308
  */
309
-function give_price_save_quick_edit( $post_id ) {
310
-	if ( ! isset( $_POST['post_type'] ) || 'give_forms' !== $_POST['post_type'] ) {
309
+function give_price_save_quick_edit($post_id) {
310
+	if ( ! isset($_POST['post_type']) || 'give_forms' !== $_POST['post_type']) {
311 311
 		return;
312 312
 	}
313
-	if ( ! current_user_can( 'edit_post', $post_id ) ) {
313
+	if ( ! current_user_can('edit_post', $post_id)) {
314 314
 		return $post_id;
315 315
 	}
316
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
316
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
317 317
 		return $post_id;
318 318
 	}
319 319
 
320
-	if ( isset( $_REQUEST['_give_regprice'] ) ) {
321
-		give_update_meta( $post_id, '_give_set_price', give_sanitize_amount_for_db( strip_tags( stripslashes( $_REQUEST['_give_regprice'] ) ) ) );
320
+	if (isset($_REQUEST['_give_regprice'])) {
321
+		give_update_meta($post_id, '_give_set_price', give_sanitize_amount_for_db(strip_tags(stripslashes($_REQUEST['_give_regprice']))));
322 322
 	}
323 323
 }
324 324
 
325
-add_action( 'save_post', 'give_price_save_quick_edit' );
325
+add_action('save_post', 'give_price_save_quick_edit');
326 326
 
327 327
 /**
328 328
  * Process bulk edit actions via AJAX
@@ -332,18 +332,18 @@  discard block
 block discarded – undo
332 332
  */
333 333
 function give_save_bulk_edit() {
334 334
 
335
-	$post_ids = ( isset( $_POST['post_ids'] ) && ! empty( $_POST['post_ids'] ) ) ? $_POST['post_ids'] : array();
335
+	$post_ids = (isset($_POST['post_ids']) && ! empty($_POST['post_ids'])) ? $_POST['post_ids'] : array();
336 336
 
337
-	if ( ! empty( $post_ids ) && is_array( $post_ids ) ) {
338
-		$price = isset( $_POST['price'] ) ? strip_tags( stripslashes( $_POST['price'] ) ) : 0;
339
-		foreach ( $post_ids as $post_id ) {
337
+	if ( ! empty($post_ids) && is_array($post_ids)) {
338
+		$price = isset($_POST['price']) ? strip_tags(stripslashes($_POST['price'])) : 0;
339
+		foreach ($post_ids as $post_id) {
340 340
 
341
-			if ( ! current_user_can( 'edit_post', $post_id ) ) {
341
+			if ( ! current_user_can('edit_post', $post_id)) {
342 342
 				continue;
343 343
 			}
344 344
 
345
-			if ( ! empty( $price ) ) {
346
-				give_update_meta( $post_id, '_give_set_price', give_sanitize_amount_for_db( $price ) );
345
+			if ( ! empty($price)) {
346
+				give_update_meta($post_id, '_give_set_price', give_sanitize_amount_for_db($price));
347 347
 			}
348 348
 		}
349 349
 	}
@@ -351,4 +351,4 @@  discard block
 block discarded – undo
351 351
 	die();
352 352
 }
353 353
 
354
-add_action( 'wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit' );
354
+add_action('wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit');
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-goal.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 // Exit if accessed directly.
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	public function __construct() {
25 25
 
26
-		$this->shortcode['title'] = esc_html__( 'Donation Form Goal', 'give' );
27
-		$this->shortcode['label'] = esc_html__( 'Donation Form Goal', 'give' );
26
+		$this->shortcode['title'] = esc_html__('Donation Form Goal', 'give');
27
+		$this->shortcode['label'] = esc_html__('Donation Form Goal', 'give');
28 28
 
29
-		parent::__construct( 'give_goal' );
29
+		parent::__construct('give_goal');
30 30
 	}
31 31
 
32 32
 	/**
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 
39 39
 		$create_form_link = sprintf(
40 40
 		/* translators: %s: create new form URL */
41
-			__( '<a href="%s">Create</a> a new Donation Form.', 'give' ),
42
-			admin_url( 'post-new.php?post_type=give_forms' )
41
+			__('<a href="%s">Create</a> a new Donation Form.', 'give'),
42
+			admin_url('post-new.php?post_type=give_forms')
43 43
 		);
44 44
 
45 45
 		return array(
@@ -51,35 +51,35 @@  discard block
 block discarded – undo
51 51
 					'meta_value' => 'enabled',
52 52
 				),
53 53
 				'name'        => 'id',
54
-				'tooltip'     => esc_attr__( 'Select a Donation Form', 'give' ),
55
-				'placeholder' => '- ' . esc_attr__( 'Select a Donation Form', 'give' ) . ' -',
54
+				'tooltip'     => esc_attr__('Select a Donation Form', 'give'),
55
+				'placeholder' => '- '.esc_attr__('Select a Donation Form', 'give').' -',
56 56
 				'required'    => array(
57
-					'alert' => esc_html__( 'You must first select a Form!', 'give' ),
58
-					'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__( 'No forms found.', 'give' ), $create_form_link ),
57
+					'alert' => esc_html__('You must first select a Form!', 'give'),
58
+					'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__('No forms found.', 'give'), $create_form_link),
59 59
 				),
60 60
 			),
61 61
 			array(
62 62
 				'type' => 'container',
63
-				'html' => sprintf( '<p class="strong margin-top">%s</p>', esc_html__( 'Optional settings', 'give' ) ),
63
+				'html' => sprintf('<p class="strong margin-top">%s</p>', esc_html__('Optional settings', 'give')),
64 64
 			),
65 65
 			array(
66 66
 				'type'    => 'listbox',
67 67
 				'name'    => 'show_text',
68
-				'label'   => esc_attr__( 'Show Text:', 'give' ),
69
-				'tooltip' => esc_attr__( 'This text displays the amount of income raised compared to the goal.', 'give' ),
68
+				'label'   => esc_attr__('Show Text:', 'give'),
69
+				'tooltip' => esc_attr__('This text displays the amount of income raised compared to the goal.', 'give'),
70 70
 				'options' => array(
71
-					'true'  => esc_html__( 'Show', 'give' ),
72
-					'false' => esc_html__( 'Hide', 'give' ),
71
+					'true'  => esc_html__('Show', 'give'),
72
+					'false' => esc_html__('Hide', 'give'),
73 73
 				),
74 74
 			),
75 75
 			array(
76 76
 				'type'    => 'listbox',
77 77
 				'name'    => 'show_bar',
78
-				'label'   => esc_attr__( 'Show Progress Bar:', 'give' ),
79
-				'tooltip' => esc_attr__( 'Do you want to display the goal\'s progress bar?', 'give' ),
78
+				'label'   => esc_attr__('Show Progress Bar:', 'give'),
79
+				'tooltip' => esc_attr__('Do you want to display the goal\'s progress bar?', 'give'),
80 80
 				'options' => array(
81
-					'true'  => esc_html__( 'Show', 'give' ),
82
-					'false' => esc_html__( 'Hide', 'give' ),
81
+					'true'  => esc_html__('Show', 'give'),
82
+					'false' => esc_html__('Hide', 'give'),
83 83
 				),
84 84
 			),
85 85
 		);
Please login to merge, or discard this patch.