Completed
Pull Request — master (#1619)
by Ravinder
17:48
created
includes/admin/reporting/export/export-actions.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @license     https://opensource.org/licenses/gpl-license GNU Public License
11 11
  */
12 12
 
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_process_batch_export_form() {
24 24
 
25
-	if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'give-batch-export' ) ) {
26
-		wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
25
+	if ( ! wp_verify_nonce($_REQUEST['nonce'], 'give-batch-export')) {
26
+		wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
27 27
 	}
28 28
 
29
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php';
29
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php';
30 30
 
31 31
 	/**
32 32
 	 * Fires before batch export.
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @param string $class Export class.
37 37
 	 */
38
-	do_action( 'give_batch_export_class_include', $_REQUEST['class'] );
38
+	do_action('give_batch_export_class_include', $_REQUEST['class']);
39 39
 
40 40
 	$export = new $_REQUEST['class'];
41 41
 	$export->export();
42 42
 
43 43
 }
44 44
 
45
-add_action( 'give_form_batch_export', 'give_process_batch_export_form' );
45
+add_action('give_form_batch_export', 'give_process_batch_export_form');
46 46
 
47 47
 /**
48 48
  * Exports earnings for a specified time period
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
  * @return void
54 54
  */
55 55
 function give_export_earnings() {
56
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-earnings.php';
56
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export-earnings.php';
57 57
 
58 58
 	$earnings_export = new Give_Earnings_Export();
59 59
 
60 60
 	$earnings_export->export();
61 61
 }
62 62
 
63
-add_action( 'give_earnings_export', 'give_export_earnings' );
63
+add_action('give_earnings_export', 'give_export_earnings');
64 64
 
65 65
 
66 66
 /**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
  * @return void
71 71
  */
72 72
 function give_register_batch_exporters() {
73
-	if ( is_admin() ) {
73
+	if (is_admin()) {
74 74
 		/**
75 75
 		 * Fires in the admin, while plugins loaded.
76 76
 		 *
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 		 *
81 81
 		 * @param string $class Export class.
82 82
 		 */
83
-		do_action( 'give_register_batch_exporter' );
83
+		do_action('give_register_batch_exporter');
84 84
 	}
85 85
 }
86 86
 
87
-add_action( 'plugins_loaded', 'give_register_batch_exporters' );
87
+add_action('plugins_loaded', 'give_register_batch_exporters');
88 88
 
89 89
 /**
90 90
  * Register the payments batch exporter
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
  * @since  1.5
93 93
  */
94 94
 function give_register_payments_batch_export() {
95
-	add_action( 'give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1 );
95
+	add_action('give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1);
96 96
 }
97 97
 
98
-add_action( 'give_register_batch_exporter', 'give_register_payments_batch_export', 10 );
98
+add_action('give_register_batch_exporter', 'give_register_payments_batch_export', 10);
99 99
 
100 100
 /**
101 101
  * Loads the payments batch process if needed
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
  *
107 107
  * @return void
108 108
  */
109
-function give_include_payments_batch_processor( $class ) {
109
+function give_include_payments_batch_processor($class) {
110 110
 
111
-	if ( 'Give_Batch_Payments_Export' === $class ) {
112
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-payments.php';
111
+	if ('Give_Batch_Payments_Export' === $class) {
112
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-payments.php';
113 113
 	}
114 114
 
115 115
 }
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
  * @since  1.5.2
121 121
  */
122 122
 function give_register_customers_batch_export() {
123
-	add_action( 'give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1 );
123
+	add_action('give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1);
124 124
 }
125 125
 
126
-add_action( 'give_register_batch_exporter', 'give_register_customers_batch_export', 10 );
126
+add_action('give_register_batch_exporter', 'give_register_customers_batch_export', 10);
127 127
 
128 128
 /**
129 129
  * Loads the customers batch process if needed
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
  *
135 135
  * @return void
136 136
  */
137
-function give_include_customers_batch_processor( $class ) {
137
+function give_include_customers_batch_processor($class) {
138 138
 
139
-	if ( 'Give_Batch_Customers_Export' === $class ) {
140
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-customers.php';
139
+	if ('Give_Batch_Customers_Export' === $class) {
140
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-customers.php';
141 141
 	}
142 142
 
143 143
 }
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
  * @since  1.5
149 149
  */
150 150
 function give_register_forms_batch_export() {
151
-	add_action( 'give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1 );
151
+	add_action('give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1);
152 152
 }
153 153
 
154
-add_action( 'give_register_batch_exporter', 'give_register_forms_batch_export', 10 );
154
+add_action('give_register_batch_exporter', 'give_register_forms_batch_export', 10);
155 155
 
156 156
 /**
157 157
  * Loads the file downloads batch process if needed
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
  *
163 163
  * @return void
164 164
  */
165
-function give_include_forms_batch_processor( $class ) {
165
+function give_include_forms_batch_processor($class) {
166 166
 
167
-	if ( 'Give_Batch_Forms_Export' === $class ) {
168
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-forms.php';
167
+	if ('Give_Batch_Forms_Export' === $class) {
168
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-forms.php';
169 169
 	}
170 170
 
171 171
 }
Please login to merge, or discard this patch.
includes/ajax-functions.php 1 patch
Spacing   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -26,26 +26,26 @@  discard block
 block discarded – undo
26 26
 function give_test_ajax_works() {
27 27
 
28 28
 	// Check if the Airplane Mode plugin is installed
29
-	if ( class_exists( 'Airplane_Mode_Core' ) ) {
29
+	if (class_exists('Airplane_Mode_Core')) {
30 30
 
31 31
 		$airplane = Airplane_Mode_Core::getInstance();
32 32
 
33
-		if ( method_exists( $airplane, 'enabled' ) ) {
33
+		if (method_exists($airplane, 'enabled')) {
34 34
 
35
-			if ( $airplane->enabled() ) {
35
+			if ($airplane->enabled()) {
36 36
 				return true;
37 37
 			}
38 38
 		} else {
39 39
 
40
-			if ( $airplane->check_status() == 'on' ) {
40
+			if ($airplane->check_status() == 'on') {
41 41
 				return true;
42 42
 			}
43 43
 		}
44 44
 	}
45 45
 
46
-	add_filter( 'block_local_requests', '__return_false' );
46
+	add_filter('block_local_requests', '__return_false');
47 47
 
48
-	if ( get_transient( '_give_ajax_works' ) ) {
48
+	if (get_transient('_give_ajax_works')) {
49 49
 		return true;
50 50
 	}
51 51
 
@@ -57,35 +57,35 @@  discard block
 block discarded – undo
57 57
 		),
58 58
 	);
59 59
 
60
-	$ajax = wp_remote_post( give_get_ajax_url(), $params );
60
+	$ajax = wp_remote_post(give_get_ajax_url(), $params);
61 61
 
62 62
 	$works = true;
63 63
 
64
-	if ( is_wp_error( $ajax ) ) {
64
+	if (is_wp_error($ajax)) {
65 65
 
66 66
 		$works = false;
67 67
 
68 68
 	} else {
69 69
 
70
-		if ( empty( $ajax['response'] ) ) {
70
+		if (empty($ajax['response'])) {
71 71
 			$works = false;
72 72
 		}
73 73
 
74
-		if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) {
74
+		if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) {
75 75
 			$works = false;
76 76
 		}
77 77
 
78
-		if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) {
78
+		if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) {
79 79
 			$works = false;
80 80
 		}
81 81
 
82
-		if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) {
82
+		if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) {
83 83
 			$works = false;
84 84
 		}
85 85
 	}
86 86
 
87
-	if ( $works ) {
88
-		set_transient( '_give_ajax_works', '1', DAY_IN_SECONDS );
87
+	if ($works) {
88
+		set_transient('_give_ajax_works', '1', DAY_IN_SECONDS);
89 89
 	}
90 90
 
91 91
 	return $works;
@@ -100,16 +100,16 @@  discard block
 block discarded – undo
100 100
  * @return string
101 101
  */
102 102
 function give_get_ajax_url() {
103
-	$scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin';
103
+	$scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin';
104 104
 
105 105
 	$current_url = give_get_current_page_url();
106
-	$ajax_url    = admin_url( 'admin-ajax.php', $scheme );
106
+	$ajax_url    = admin_url('admin-ajax.php', $scheme);
107 107
 
108
-	if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) {
109
-		$ajax_url = preg_replace( '/^http/', 'https', $ajax_url );
108
+	if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) {
109
+		$ajax_url = preg_replace('/^http/', 'https', $ajax_url);
110 110
 	}
111 111
 
112
-	return apply_filters( 'give_ajax_url', $ajax_url );
112
+	return apply_filters('give_ajax_url', $ajax_url);
113 113
 }
114 114
 
115 115
 /**
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @since 1.7
127 127
 	 */
128
-	do_action( 'give_donation_form_login_fields' );
128
+	do_action('give_donation_form_login_fields');
129 129
 
130 130
 	give_die();
131 131
 }
132 132
 
133
-add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' );
133
+add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields');
134 134
 
135 135
 /**
136 136
  * Load Checkout Fields
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
  * @return void
141 141
  */
142 142
 function give_load_checkout_fields() {
143
-	$form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : '';
143
+	$form_id = isset($_POST['form_id']) ? $_POST['form_id'] : '';
144 144
 
145 145
 	ob_start();
146 146
 
@@ -149,18 +149,18 @@  discard block
 block discarded – undo
149 149
 	 *
150 150
 	 * @since 1.7
151 151
 	 */
152
-	do_action( 'give_donation_form_register_login_fields', $form_id );
152
+	do_action('give_donation_form_register_login_fields', $form_id);
153 153
 
154 154
 	$fields = ob_get_clean();
155 155
 
156
-	wp_send_json( array(
157
-		'fields' => wp_json_encode( $fields ),
158
-		'submit' => wp_json_encode( give_checkout_button_purchase( $form_id ) ),
159
-	) );
156
+	wp_send_json(array(
157
+		'fields' => wp_json_encode($fields),
158
+		'submit' => wp_json_encode(give_checkout_button_purchase($form_id)),
159
+	));
160 160
 }
161 161
 
162
-add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' );
163
-add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' );
162
+add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields');
163
+add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields');
164 164
 
165 165
 /**
166 166
  * Get Form Title via AJAX (used only in WordPress Admin)
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
  * @return void
171 171
  */
172 172
 function give_ajax_get_form_title() {
173
-	if ( isset( $_POST['form_id'] ) ) {
174
-		$title = get_the_title( $_POST['form_id'] );
175
-		if ( $title ) {
173
+	if (isset($_POST['form_id'])) {
174
+		$title = get_the_title($_POST['form_id']);
175
+		if ($title) {
176 176
 			echo $title;
177 177
 		} else {
178 178
 			echo 'fail';
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 	give_die();
182 182
 }
183 183
 
184
-add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' );
185
-add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' );
184
+add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title');
185
+add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title');
186 186
 
187 187
 /**
188 188
  * Retrieve a states drop down
@@ -193,23 +193,23 @@  discard block
 block discarded – undo
193 193
  */
194 194
 function give_ajax_get_states_field() {
195 195
 
196
-	if ( empty( $_POST['country'] ) ) {
196
+	if (empty($_POST['country'])) {
197 197
 		$_POST['country'] = give_get_country();
198 198
 	}
199
-	$states = give_get_states( $_POST['country'] );
199
+	$states = give_get_states($_POST['country']);
200 200
 
201
-	if ( ! empty( $states ) ) {
201
+	if ( ! empty($states)) {
202 202
 
203 203
 		$args = array(
204 204
 			'name'             => $_POST['field_name'],
205 205
 			'id'               => $_POST['field_name'],
206
-			'class'            => $_POST['field_name'] . '  give-select',
207
-			'options'          => give_get_states( $_POST['country'] ),
206
+			'class'            => $_POST['field_name'].'  give-select',
207
+			'options'          => give_get_states($_POST['country']),
208 208
 			'show_option_all'  => false,
209 209
 			'show_option_none' => false,
210 210
 		);
211 211
 
212
-		$response = Give()->html->select( $args );
212
+		$response = Give()->html->select($args);
213 213
 
214 214
 	} else {
215 215
 
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 	give_die();
222 222
 }
223 223
 
224
-add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' );
225
-add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' );
224
+add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field');
225
+add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field');
226 226
 
227 227
 /**
228 228
  * Retrieve a states drop down
@@ -234,17 +234,17 @@  discard block
 block discarded – undo
234 234
 function give_ajax_form_search() {
235 235
 	global $wpdb;
236 236
 
237
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
237
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
238 238
 	$results = array();
239
-	if ( current_user_can( 'edit_give_forms' ) ) {
240
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" );
239
+	if (current_user_can('edit_give_forms')) {
240
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50");
241 241
 	} else {
242
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50" );
242
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50");
243 243
 	}
244 244
 
245
-	if ( $items ) {
245
+	if ($items) {
246 246
 
247
-		foreach ( $items as $item ) {
247
+		foreach ($items as $item) {
248 248
 
249 249
 			$results[] = array(
250 250
 				'id'   => $item->ID,
@@ -255,18 +255,18 @@  discard block
 block discarded – undo
255 255
 
256 256
 		$items[] = array(
257 257
 			'id'   => 0,
258
-			'name' => esc_html__( 'No forms found.', 'give' ),
258
+			'name' => esc_html__('No forms found.', 'give'),
259 259
 		);
260 260
 
261 261
 	}
262 262
 
263
-	echo json_encode( $results );
263
+	echo json_encode($results);
264 264
 
265 265
 	give_die();
266 266
 }
267 267
 
268
-add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' );
269
-add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' );
268
+add_action('wp_ajax_give_form_search', 'give_ajax_form_search');
269
+add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search');
270 270
 
271 271
 /**
272 272
  * Search the donors database via Ajax
@@ -278,38 +278,38 @@  discard block
 block discarded – undo
278 278
 function give_ajax_donor_search() {
279 279
 	global $wpdb;
280 280
 
281
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
281
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
282 282
 	$results = array();
283
-	if ( ! current_user_can( 'view_give_reports' ) ) {
283
+	if ( ! current_user_can('view_give_reports')) {
284 284
 		$donors = array();
285 285
 	} else {
286
-		$donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" );
286
+		$donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50");
287 287
 	}
288 288
 
289
-	if ( $donors ) {
289
+	if ($donors) {
290 290
 
291
-		foreach ( $donors as $donor ) {
291
+		foreach ($donors as $donor) {
292 292
 
293 293
 			$results[] = array(
294 294
 				'id'   => $donor->id,
295
-				'name' => $donor->name . '(' . $donor->email . ')',
295
+				'name' => $donor->name.'('.$donor->email.')',
296 296
 			);
297 297
 		}
298 298
 	} else {
299 299
 
300 300
 		$donors[] = array(
301 301
 			'id'   => 0,
302
-			'name' => esc_html__( 'No donors found.', 'give' ),
302
+			'name' => esc_html__('No donors found.', 'give'),
303 303
 		);
304 304
 
305 305
 	}
306 306
 
307
-	echo json_encode( $results );
307
+	echo json_encode($results);
308 308
 
309 309
 	give_die();
310 310
 }
311 311
 
312
-add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' );
312
+add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search');
313 313
 
314 314
 
315 315
 /**
@@ -321,42 +321,42 @@  discard block
 block discarded – undo
321 321
  */
322 322
 function give_ajax_search_users() {
323 323
 
324
-	if ( current_user_can( 'manage_give_settings' ) ) {
324
+	if (current_user_can('manage_give_settings')) {
325 325
 
326
-		$search_query = trim( $_POST['user_name'] );
327
-		$exclude      = trim( $_POST['exclude'] );
326
+		$search_query = trim($_POST['user_name']);
327
+		$exclude      = trim($_POST['exclude']);
328 328
 
329 329
 		$get_users_args = array(
330 330
 			'number' => 9999,
331
-			'search' => $search_query . '*',
331
+			'search' => $search_query.'*',
332 332
 		);
333 333
 
334
-		if ( ! empty( $exclude ) ) {
335
-			$exclude_array             = explode( ',', $exclude );
334
+		if ( ! empty($exclude)) {
335
+			$exclude_array             = explode(',', $exclude);
336 336
 			$get_users_args['exclude'] = $exclude_array;
337 337
 		}
338 338
 
339
-		$get_users_args = apply_filters( 'give_search_users_args', $get_users_args );
339
+		$get_users_args = apply_filters('give_search_users_args', $get_users_args);
340 340
 
341
-		$found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search_query );
341
+		$found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search_query);
342 342
 
343 343
 		$user_list = '<ul>';
344
-		if ( $found_users ) {
345
-			foreach ( $found_users as $user ) {
346
-				$user_list .= '<li><a href="#" data-userid="' . esc_attr( $user->ID ) . '" data-login="' . esc_attr( $user->user_login ) . '">' . esc_html( $user->user_login ) . '</a></li>';
344
+		if ($found_users) {
345
+			foreach ($found_users as $user) {
346
+				$user_list .= '<li><a href="#" data-userid="'.esc_attr($user->ID).'" data-login="'.esc_attr($user->user_login).'">'.esc_html($user->user_login).'</a></li>';
347 347
 			}
348 348
 		} else {
349
-			$user_list .= '<li>' . esc_html__( 'No users found.', 'give' ) . '</li>';
349
+			$user_list .= '<li>'.esc_html__('No users found.', 'give').'</li>';
350 350
 		}
351 351
 		$user_list .= '</ul>';
352 352
 
353
-		echo json_encode( array( 'results' => $user_list ) );
353
+		echo json_encode(array('results' => $user_list));
354 354
 
355 355
 	}
356 356
 	die();
357 357
 }
358 358
 
359
-add_action( 'wp_ajax_give_search_users', 'give_ajax_search_users' );
359
+add_action('wp_ajax_give_search_users', 'give_ajax_search_users');
360 360
 
361 361
 
362 362
 /**
@@ -368,32 +368,32 @@  discard block
 block discarded – undo
368 368
  */
369 369
 function give_check_for_form_price_variations() {
370 370
 
371
-	if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
372
-		die( '-1' );
371
+	if ( ! current_user_can('edit_give_forms', get_current_user_id())) {
372
+		die('-1');
373 373
 	}
374 374
 
375
-	$form_id = intval( $_POST['form_id'] );
376
-	$form    = get_post( $form_id );
375
+	$form_id = intval($_POST['form_id']);
376
+	$form    = get_post($form_id);
377 377
 
378
-	if ( 'give_forms' != $form->post_type ) {
379
-		die( '-2' );
378
+	if ('give_forms' != $form->post_type) {
379
+		die('-2');
380 380
 	}
381 381
 
382
-	if ( give_has_variable_prices( $form_id ) ) {
383
-		$variable_prices = give_get_variable_prices( $form_id );
382
+	if (give_has_variable_prices($form_id)) {
383
+		$variable_prices = give_get_variable_prices($form_id);
384 384
 
385
-		if ( $variable_prices ) {
385
+		if ($variable_prices) {
386 386
 			$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';
387 387
 
388
-			if ( isset( $_POST['all_prices'] ) ) {
389
-				$ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>';
388
+			if (isset($_POST['all_prices'])) {
389
+				$ajax_response .= '<option value="all">'.esc_html__('All Levels', 'give').'</option>';
390 390
 			}
391 391
 
392
-			foreach ( $variable_prices as $key => $price ) {
392
+			foreach ($variable_prices as $key => $price) {
393 393
 
394
-				$level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'] ) );
394
+				$level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount']));
395 395
 
396
-				$ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>';
396
+				$ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>';
397 397
 			}
398 398
 			$ajax_response .= '</select>';
399 399
 			echo $ajax_response;
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 	give_die();
404 404
 }
405 405
 
406
-add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' );
406
+add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations');
407 407
 
408 408
 
409 409
 /**
@@ -414,25 +414,25 @@  discard block
 block discarded – undo
414 414
  * @return void
415 415
  */
416 416
 function give_check_for_form_price_variations_html() {
417
-	if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) {
417
+	if ( ! current_user_can('edit_give_payments', get_current_user_id())) {
418 418
 		wp_die();
419 419
 	}
420 420
 
421
-	$form_id    = ! empty( $_POST['form_id']  ) ? intval( $_POST['form_id'] ) : 0;
422
-	$payment_id = ! empty( $_POST['payment_id'] ) ? intval( $_POST['payment_id'] ) : 0;
423
-	$form       = get_post( $form_id );
421
+	$form_id    = ! empty($_POST['form_id']) ? intval($_POST['form_id']) : 0;
422
+	$payment_id = ! empty($_POST['payment_id']) ? intval($_POST['payment_id']) : 0;
423
+	$form       = get_post($form_id);
424 424
 
425
-	if ( 'give_forms' != $form->post_type ) {
425
+	if ('give_forms' != $form->post_type) {
426 426
 		wp_die();
427 427
 	}
428 428
 
429
-	if ( ! give_has_variable_prices( $form_id ) || ! $form_id ) {
430
-		esc_html_e( 'n/a', 'give' );
429
+	if ( ! give_has_variable_prices($form_id) || ! $form_id) {
430
+		esc_html_e('n/a', 'give');
431 431
 	} else {
432 432
 		$prices_atts = '';
433
-		if( $variable_prices = give_get_variable_prices( $form_id ) ) {
434
-			foreach ( $variable_prices as $variable_price ) {
435
-				$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount( $variable_price['_give_amount'] );
433
+		if ($variable_prices = give_get_variable_prices($form_id)) {
434
+			foreach ($variable_prices as $variable_price) {
435
+				$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount']);
436 436
 			}
437 437
 		}
438 438
 
@@ -443,12 +443,12 @@  discard block
 block discarded – undo
443 443
 			'chosen'           => true,
444 444
 			'show_option_all'  => '',
445 445
 			'show_option_none' => '',
446
-			'select_atts'      => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ),
446
+			'select_atts'      => 'data-prices='.esc_attr(json_encode($prices_atts)),
447 447
 		);
448 448
 
449
-		if( $payment_id ) {
449
+		if ($payment_id) {
450 450
 			// Payment object.
451
-			$payment = new Give_Payment( $payment_id );
451
+			$payment = new Give_Payment($payment_id);
452 452
 
453 453
 			// Payment meta.
454 454
 			$payment_meta = $payment->get_meta();
@@ -456,10 +456,10 @@  discard block
 block discarded – undo
456 456
 		}
457 457
 
458 458
 		// Render variable prices select tag html.
459
-		give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
459
+		give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
460 460
 	}
461 461
 
462 462
 	give_die();
463 463
 }
464 464
 
465
-add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' );
465
+add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html');
Please login to merge, or discard this patch.
includes/formatting.php 1 patch
Spacing   +101 added lines, -101 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,7 +23,7 @@  discard block
 block discarded – undo
23 23
  * @return mixed
24 24
  */
25 25
 function give_get_price_decimals() {
26
-	return apply_filters( 'give_sanitize_amount_decimals', give_get_option( 'number_decimals', 0 ) );
26
+	return apply_filters('give_sanitize_amount_decimals', give_get_option('number_decimals', 0));
27 27
 }
28 28
 
29 29
 /**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  * @return mixed
35 35
  */
36 36
 function give_get_price_thousand_separator() {
37
-	return give_get_option( 'thousands_separator', ',' );
37
+	return give_get_option('thousands_separator', ',');
38 38
 }
39 39
 
40 40
 /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
  * @return mixed
46 46
  */
47 47
 function give_get_price_decimal_separator() {
48
-	return give_get_option( 'decimal_separator', '.' );
48
+	return give_get_option('decimal_separator', '.');
49 49
 }
50 50
 
51 51
 /**
@@ -61,67 +61,67 @@  discard block
 block discarded – undo
61 61
  *
62 62
  * @return string $amount Newly sanitized amount
63 63
  */
64
-function give_sanitize_amount( $number, $dp = false, $trim_zeros = false ) {
64
+function give_sanitize_amount($number, $dp = false, $trim_zeros = false) {
65 65
 
66 66
 	// Bailout.
67
-	if ( empty( $number ) ) {
67
+	if (empty($number)) {
68 68
 		return $number;
69 69
 	}
70 70
 
71 71
 	// Remove slash from amount.
72 72
 	// If thousand or decimal separator is set to ' then in $_POST or $_GET param we will get an escaped number.
73 73
 	// To prevent notices and warning remove slash from amount/number.
74
-	$number = wp_unslash( $number );
74
+	$number = wp_unslash($number);
75 75
 
76 76
 	$thousand_separator = give_get_price_thousand_separator();
77 77
 
78 78
 	$locale   = localeconv();
79
-	$decimals = array( give_get_price_decimal_separator(), $locale['decimal_point'], $locale['mon_decimal_point'] );
79
+	$decimals = array(give_get_price_decimal_separator(), $locale['decimal_point'], $locale['mon_decimal_point']);
80 80
 
81 81
 	// Remove locale from string
82
-	if ( ! is_float( $number ) ) {
83
-		$number = str_replace( $decimals, '.', $number );
82
+	if ( ! is_float($number)) {
83
+		$number = str_replace($decimals, '.', $number);
84 84
 	}
85 85
 
86 86
 	// Remove thousand amount formatting if amount has.
87 87
 	// This condition use to add backward compatibility to version before 1.6, because before version 1.6 we were saving formatted amount to db.
88 88
 	// Do not replace thousand separator from price if it is same as decimal separator, because it will be already replace by above code.
89
-	if ( ! in_array( $thousand_separator, $decimals ) && ( false !== strpos( $number, $thousand_separator ) ) ) {
90
-		$number = str_replace( $thousand_separator, '', $number );
91
-	} elseif ( in_array( $thousand_separator, $decimals ) ) {
92
-		$number = preg_replace( '/\.(?=.*\.)/', '', $number );
89
+	if ( ! in_array($thousand_separator, $decimals) && (false !== strpos($number, $thousand_separator))) {
90
+		$number = str_replace($thousand_separator, '', $number);
91
+	} elseif (in_array($thousand_separator, $decimals)) {
92
+		$number = preg_replace('/\.(?=.*\.)/', '', $number);
93 93
 	}
94 94
 
95 95
 	// Remove non numeric entity before decimal separator.
96
-	$number     = preg_replace( '/[^0-9\.]/', '', $number );
96
+	$number     = preg_replace('/[^0-9\.]/', '', $number);
97 97
 	$default_dp = give_get_price_decimals();
98 98
 
99 99
 	// Reset negative amount to zero.
100
-	if ( 0 > $number ) {
101
-		$number = number_format( 0, $default_dp, '.' );
100
+	if (0 > $number) {
101
+		$number = number_format(0, $default_dp, '.');
102 102
 	}
103 103
 
104 104
 	// If number does not have decimal then add number of decimals to it.
105 105
 	if (
106
-		false === strpos( $number, '.' )
107
-		|| ( $default_dp > strlen( substr( $number, strpos( $number, '.' ) + 1 ) ) )
106
+		false === strpos($number, '.')
107
+		|| ($default_dp > strlen(substr($number, strpos($number, '.') + 1)))
108 108
 	) {
109
-		$number = number_format( $number, $default_dp, '.', '' );
109
+		$number = number_format($number, $default_dp, '.', '');
110 110
 	}
111 111
 
112 112
 	// Format number by custom number of decimals.
113
-	if ( false !== $dp ) {
114
-		$dp     = intval( is_bool( $dp ) ? $default_dp : $dp );
115
-		$dp     = apply_filters( 'give_sanitize_amount_decimals', $dp, $number );
116
-		$number = number_format( floatval( $number ), $dp, '.', '' );
113
+	if (false !== $dp) {
114
+		$dp     = intval(is_bool($dp) ? $default_dp : $dp);
115
+		$dp     = apply_filters('give_sanitize_amount_decimals', $dp, $number);
116
+		$number = number_format(floatval($number), $dp, '.', '');
117 117
 	}
118 118
 
119 119
 	// Trim zeros.
120
-	if ( $trim_zeros && strstr( $number, '.' ) ) {
121
-		$number = rtrim( rtrim( $number, '0' ), '.' );
120
+	if ($trim_zeros && strstr($number, '.')) {
121
+		$number = rtrim(rtrim($number, '0'), '.');
122 122
 	}
123 123
 
124
-	return apply_filters( 'give_sanitize_amount', $number );
124
+	return apply_filters('give_sanitize_amount', $number);
125 125
 }
126 126
 
127 127
 /**
@@ -134,22 +134,22 @@  discard block
 block discarded – undo
134 134
  *
135 135
  * @return string $amount   Newly formatted amount or Price Not Available
136 136
  */
137
-function give_format_amount( $amount, $decimals = true ) {
138
-	$thousands_sep = give_get_option( 'thousands_separator', ',' );
139
-	$decimal_sep   = give_get_option( 'decimal_separator', '.' );
137
+function give_format_amount($amount, $decimals = true) {
138
+	$thousands_sep = give_get_option('thousands_separator', ',');
139
+	$decimal_sep   = give_get_option('decimal_separator', '.');
140 140
 
141
-	if ( empty( $amount ) ) {
141
+	if (empty($amount)) {
142 142
 		$amount = 0;
143 143
 	} else {
144 144
 		// Sanitize amount before formatting.
145
-		$amount = give_sanitize_amount( $amount );
145
+		$amount = give_sanitize_amount($amount);
146 146
 	}
147 147
 
148 148
 	$decimals = $decimals ? give_get_price_decimals() : 0;
149 149
 
150
-	$formatted = number_format( $amount, $decimals, $decimal_sep, $thousands_sep );
150
+	$formatted = number_format($amount, $decimals, $decimal_sep, $thousands_sep);
151 151
 
152
-	return apply_filters( 'give_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep );
152
+	return apply_filters('give_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep);
153 153
 }
154 154
 
155 155
 
@@ -166,33 +166,33 @@  discard block
 block discarded – undo
166 166
  *
167 167
  * @return float|string  formatted amount number with large number names.
168 168
  */
169
-function give_human_format_large_amount( $amount ) {
169
+function give_human_format_large_amount($amount) {
170 170
 
171 171
 	// Get thousand separator.
172 172
 	$thousands_sep = give_get_price_thousand_separator();
173 173
 
174 174
 	// Sanitize amount.
175
-	$sanitize_amount = give_sanitize_amount( $amount );
175
+	$sanitize_amount = give_sanitize_amount($amount);
176 176
 
177 177
 	// Explode amount to calculate name of large numbers.
178
-	$amount_array = explode( $thousands_sep, $amount );
178
+	$amount_array = explode($thousands_sep, $amount);
179 179
 
180 180
 	// Calculate amount parts count.
181
-	$amount_count_parts = count( $amount_array );
181
+	$amount_count_parts = count($amount_array);
182 182
 
183 183
 	// Human format amount (default).
184 184
 	$human_format_amount = $amount;
185 185
 
186 186
 	// Calculate large number formatted amount.
187
-	if ( 4 < $amount_count_parts ) {
188
-		$human_format_amount = sprintf( esc_html__( '%s trillion', 'give' ), round( ( $sanitize_amount / 1000000000000 ), 2 ) );
189
-	} elseif ( 3 < $amount_count_parts ) {
190
-		$human_format_amount = sprintf( esc_html__( '%s billion', 'give' ), round( ( $sanitize_amount / 1000000000 ), 2 ) );
191
-	} elseif ( 2 < $amount_count_parts ) {
192
-		$human_format_amount = sprintf( esc_html__( '%s million', 'give' ), round( ( $sanitize_amount / 1000000 ), 2 ) );
187
+	if (4 < $amount_count_parts) {
188
+		$human_format_amount = sprintf(esc_html__('%s trillion', 'give'), round(($sanitize_amount / 1000000000000), 2));
189
+	} elseif (3 < $amount_count_parts) {
190
+		$human_format_amount = sprintf(esc_html__('%s billion', 'give'), round(($sanitize_amount / 1000000000), 2));
191
+	} elseif (2 < $amount_count_parts) {
192
+		$human_format_amount = sprintf(esc_html__('%s million', 'give'), round(($sanitize_amount / 1000000), 2));
193 193
 	}
194 194
 
195
-	return apply_filters( 'give_human_format_large_amount', $human_format_amount, $amount, $sanitize_amount );
195
+	return apply_filters('give_human_format_large_amount', $human_format_amount, $amount, $sanitize_amount);
196 196
 }
197 197
 
198 198
 /**
@@ -205,15 +205,15 @@  discard block
 block discarded – undo
205 205
  *
206 206
  * @return string $amount Newly formatted amount or Price Not Available
207 207
  */
208
-function give_format_decimal( $amount, $dp = false ) {
208
+function give_format_decimal($amount, $dp = false) {
209 209
 	$decimal_separator = give_get_price_decimal_separator();
210
-	$formatted_amount  = give_sanitize_amount( $amount, $dp );
210
+	$formatted_amount  = give_sanitize_amount($amount, $dp);
211 211
 
212
-	if ( false !== strpos( $formatted_amount, '.' ) ) {
213
-		$formatted_amount = str_replace( '.', $decimal_separator, $formatted_amount );
212
+	if (false !== strpos($formatted_amount, '.')) {
213
+		$formatted_amount = str_replace('.', $decimal_separator, $formatted_amount);
214 214
 	}
215 215
 
216
-	return apply_filters( 'give_format_decimal', $formatted_amount, $amount, $decimal_separator );
216
+	return apply_filters('give_format_decimal', $formatted_amount, $amount, $decimal_separator);
217 217
 }
218 218
 
219 219
 /**
@@ -226,24 +226,24 @@  discard block
 block discarded – undo
226 226
  *
227 227
  * @return mixed|string
228 228
  */
229
-function give_currency_filter( $price = '', $currency = '' ) {
229
+function give_currency_filter($price = '', $currency = '') {
230 230
 
231
-	if ( empty( $currency ) ) {
231
+	if (empty($currency)) {
232 232
 		$currency = give_get_currency();
233 233
 	}
234 234
 
235
-	$position = give_get_option( 'currency_position', 'before' );
235
+	$position = give_get_option('currency_position', 'before');
236 236
 
237 237
 	$negative = $price < 0;
238 238
 
239
-	if ( $negative ) {
239
+	if ($negative) {
240 240
 		// Remove proceeding "-".
241
-		$price = substr( $price, 1 );
241
+		$price = substr($price, 1);
242 242
 	}
243 243
 
244
-	$symbol = give_currency_symbol( $currency );
244
+	$symbol = give_currency_symbol($currency);
245 245
 
246
-	switch ( $currency ) :
246
+	switch ($currency) :
247 247
 		case 'GBP' :
248 248
 		case 'BRL' :
249 249
 		case 'EUR' :
@@ -272,13 +272,13 @@  discard block
 block discarded – undo
272 272
 		case 'MAD' :
273 273
 		case 'KRW' :
274 274
 		case 'ZAR' :
275
-			$formatted = ( 'before' === $position ? $symbol . $price : $price . $symbol );
275
+			$formatted = ('before' === $position ? $symbol.$price : $price.$symbol);
276 276
 			break;
277 277
 		case 'NOK' :
278
-			$formatted = ( 'before' === $position ? $symbol . ' ' . $price : $price . ' ' . $symbol );
278
+			$formatted = ('before' === $position ? $symbol.' '.$price : $price.' '.$symbol);
279 279
 			break;
280 280
 		default :
281
-			$formatted = ( 'before' === $position ? $currency . ' ' . $price : $price . ' ' . $currency );
281
+			$formatted = ('before' === $position ? $currency.' '.$price : $price.' '.$currency);
282 282
 			break;
283 283
 	endswitch;
284 284
 
@@ -293,11 +293,11 @@  discard block
 block discarded – undo
293 293
 	 *           and if currency is USD and currency position is after then
294 294
 	 *           filter name will be give_usd_currency_filter_after
295 295
 	 */
296
-	$formatted = apply_filters( 'give_' . strtolower( $currency ) . "_currency_filter_{$position}", $formatted, $currency, $price );
296
+	$formatted = apply_filters('give_'.strtolower($currency)."_currency_filter_{$position}", $formatted, $currency, $price);
297 297
 
298
-	if ( $negative ) {
298
+	if ($negative) {
299 299
 		// Prepend the minus sign before the currency sign.
300
-		$formatted = '-' . $formatted;
300
+		$formatted = '-'.$formatted;
301 301
 	}
302 302
 
303 303
 	return $formatted;
@@ -313,21 +313,21 @@  discard block
 block discarded – undo
313 313
  */
314 314
 function give_currency_decimal_filter() {
315 315
 
316
-	remove_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' );
316
+	remove_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter');
317 317
 
318 318
 	// Set default number of decimals.
319 319
 	$decimals = give_get_price_decimals();
320 320
 
321
-	add_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' );
321
+	add_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter');
322 322
 
323 323
 	// Get number of decimals with backward compatibility ( version < 1.6 )
324
-	if ( 1 <= func_num_args() ) {
325
-		$decimals = ( false === func_get_arg( 0 ) ? $decimals : absint( func_get_arg( 0 ) ) );
324
+	if (1 <= func_num_args()) {
325
+		$decimals = (false === func_get_arg(0) ? $decimals : absint(func_get_arg(0)));
326 326
 	}
327 327
 
328 328
 	$currency = give_get_currency();
329 329
 
330
-	switch ( $currency ) {
330
+	switch ($currency) {
331 331
 		case 'RIAL' :
332 332
 		case 'JPY' :
333 333
 		case 'TWD' :
@@ -337,11 +337,11 @@  discard block
 block discarded – undo
337 337
 			break;
338 338
 	}
339 339
 
340
-	return apply_filters( 'give_currency_decimal_count', $decimals, $currency );
340
+	return apply_filters('give_currency_decimal_count', $decimals, $currency);
341 341
 }
342 342
 
343
-add_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' );
344
-add_filter( 'give_format_amount_decimals', 'give_currency_decimal_filter' );
343
+add_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter');
344
+add_filter('give_format_amount_decimals', 'give_currency_decimal_filter');
345 345
 
346 346
 
347 347
 /**
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
  *
354 354
  * @return string                  Date format string
355 355
  */
356
-function give_date_format( $date_context = '' ) {
356
+function give_date_format($date_context = '') {
357 357
 	/**
358 358
 	 * Filter the date context
359 359
 	 *
@@ -374,19 +374,19 @@  discard block
 block discarded – undo
374 374
 	 *
375 375
 	 *    }
376 376
 	 */
377
-	$date_format_contexts = apply_filters( 'give_date_format_contexts', array() );
377
+	$date_format_contexts = apply_filters('give_date_format_contexts', array());
378 378
 
379 379
 	// Set date format to default date format.
380
-	$date_format = get_option( 'date_format' );
380
+	$date_format = get_option('date_format');
381 381
 
382 382
 	// Update date format if we have non empty date format context array and non empty date format string for that context.
383
-	if ( $date_context && ! empty( $date_format_contexts ) && array_key_exists( $date_context, $date_format_contexts ) ) {
384
-		$date_format = ! empty( $date_format_contexts[ $date_context ] )
385
-			? $date_format_contexts[ $date_context ]
383
+	if ($date_context && ! empty($date_format_contexts) && array_key_exists($date_context, $date_format_contexts)) {
384
+		$date_format = ! empty($date_format_contexts[$date_context])
385
+			? $date_format_contexts[$date_context]
386 386
 			: $date_format;
387 387
 	}
388 388
 
389
-	return apply_filters( 'give_date_format', $date_format );
389
+	return apply_filters('give_date_format', $date_format);
390 390
 }
391 391
 
392 392
 /**
@@ -399,13 +399,13 @@  discard block
 block discarded – undo
399 399
  *
400 400
  * @return string
401 401
  */
402
-function give_get_cache_key( $action, $query_args ) {
402
+function give_get_cache_key($action, $query_args) {
403 403
 	// Bailout.
404
-	if ( ! is_array( $query_args ) || empty( $query_args ) ) {
404
+	if ( ! is_array($query_args) || empty($query_args)) {
405 405
 		return '';
406 406
 	}
407 407
 
408
-	return "give_cache_{$action}_" . substr( md5( serialize( $query_args ) ), 0, 15 );
408
+	return "give_cache_{$action}_".substr(md5(serialize($query_args)), 0, 15);
409 409
 }
410 410
 
411 411
 /**
@@ -418,11 +418,11 @@  discard block
 block discarded – undo
418 418
  *
419 419
  * @return string|array
420 420
  */
421
-function give_clean( $var ) {
422
-	if ( is_array( $var ) ) {
423
-		return array_map( 'give_clean', $var );
421
+function give_clean($var) {
422
+	if (is_array($var)) {
423
+		return array_map('give_clean', $var);
424 424
 	} else {
425
-		return is_scalar( $var ) ? sanitize_text_field( $var ) : $var;
425
+		return is_scalar($var) ? sanitize_text_field($var) : $var;
426 426
 	}
427 427
 }
428 428
 
@@ -435,10 +435,10 @@  discard block
 block discarded – undo
435 435
  *
436 436
  * @return int
437 437
  */
438
-function give_let_to_num( $size ) {
439
-	$l   = substr( $size, - 1 );
440
-	$ret = substr( $size, 0, - 1 );
441
-	switch ( strtoupper( $l ) ) {
438
+function give_let_to_num($size) {
439
+	$l   = substr($size, - 1);
440
+	$ret = substr($size, 0, - 1);
441
+	switch (strtoupper($l)) {
442 442
 		case 'P':
443 443
 			$ret *= 1024;
444 444
 		case 'T':
@@ -463,17 +463,17 @@  discard block
 block discarded – undo
463 463
  * @param int   $action
464 464
  * @param array $wp_die_args
465 465
  */
466
-function give_validate_nonce( $nonce, $action = - 1, $wp_die_args = array() ) {
466
+function give_validate_nonce($nonce, $action = - 1, $wp_die_args = array()) {
467 467
 
468 468
 	$default_wp_die_args = array(
469
-		'message' => esc_html__( 'Nonce verification has failed.', 'give' ),
470
-		'title'   => esc_html__( 'Error', 'give' ),
471
-		'args'    => array( 'response' => 403 ),
469
+		'message' => esc_html__('Nonce verification has failed.', 'give'),
470
+		'title'   => esc_html__('Error', 'give'),
471
+		'args'    => array('response' => 403),
472 472
 	);
473 473
 
474
-	$wp_die_args = wp_parse_args( $wp_die_args, $default_wp_die_args );
474
+	$wp_die_args = wp_parse_args($wp_die_args, $default_wp_die_args);
475 475
 
476
-	if ( ! wp_verify_nonce( $nonce, $action ) ) {
476
+	if ( ! wp_verify_nonce($nonce, $action)) {
477 477
 		wp_die(
478 478
 			$wp_die_args['message'],
479 479
 			$wp_die_args['title'],
@@ -495,23 +495,23 @@  discard block
 block discarded – undo
495 495
  *
496 496
  * @return mixed
497 497
  */
498
-function give_check_variable( $variable, $conditional = '', $default = false ) {
498
+function give_check_variable($variable, $conditional = '', $default = false) {
499 499
 
500
-	switch ( $conditional ) {
500
+	switch ($conditional) {
501 501
 		case 'isset_empty':
502
-			$variable = ( isset( $variable ) && ! empty( $variable ) ) ? $variable : $default;
502
+			$variable = (isset($variable) && ! empty($variable)) ? $variable : $default;
503 503
 			break;
504 504
 
505 505
 		case 'empty':
506
-			$variable = ! empty( $variable ) ? $variable : $default;
506
+			$variable = ! empty($variable) ? $variable : $default;
507 507
 			break;
508 508
 
509 509
 		case 'null':
510
-			$variable = ! is_null( $variable ) ? $variable : $default;
510
+			$variable = ! is_null($variable) ? $variable : $default;
511 511
 			break;
512 512
 
513 513
 		default:
514
-			$variable = isset( $variable ) ? $variable : $default;
514
+			$variable = isset($variable) ? $variable : $default;
515 515
 
516 516
 	}
517 517
 
Please login to merge, or discard this patch.
includes/admin/class-give-settings.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param $url
74 74
 	 *
75
-	 * @return mixed
75
+	 * @return string
76 76
 	 */
77 77
 	public function give_update_cmb_meta_box_url( $url ) {
78 78
 		// Path to Give's CMB
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
  * @since 1.0
835 835
  *
836 836
  * @param string          $key   The Key to update
837
- * @param string|bool|int $value The value to set the key to
837
+ * @param integer $value The value to set the key to
838 838
  *
839 839
  * @return boolean True if updated, false if not.
840 840
  */
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
  * @since      1.3.5
938 938
  *
939 939
  * @param $array
940
- * @param $position |int|string Expects an array key or 'id' of the settings field to appear after
940
+ * @param string $position |int|string Expects an array key or 'id' of the settings field to appear after
941 941
  * @param $insert   |array a valid array of options to insert
942 942
  *
943 943
  * @return array
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
  * @since 1.0
977 977
  *
978 978
  * @param array $field_arr
979
- * @param array $saved_values
979
+ * @param string|boolean $saved_values
980 980
  *
981 981
  * @return void
982 982
  */
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
  * @since  1.0
1012 1012
  *
1013 1013
  * @param  array $field_arr
1014
- * @param  array $saved_value
1014
+ * @param  string|boolean $saved_value
1015 1015
  *
1016 1016
  * @return void
1017 1017
  */
Please login to merge, or discard this patch.
Spacing   +362 added lines, -362 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 	public function __construct() {
44 44
 
45 45
 		// Custom CMB2 Settings Fields
46
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
47
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
48
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
49
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
50
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
51
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
52
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
53
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
46
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
47
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
48
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
49
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
50
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
51
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
52
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
53
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
54 54
 	}
55 55
 
56 56
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * @since  1.0
61 61
 	 */
62 62
 	public function init() {
63
-		register_setting( $this->key, $this->key );
63
+		register_setting($this->key, $this->key);
64 64
 
65 65
 	}
66 66
 
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @return mixed
76 76
 	 */
77
-	public function give_update_cmb_meta_box_url( $url ) {
77
+	public function give_update_cmb_meta_box_url($url) {
78 78
 		// Path to Give's CMB
79
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
79
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
80 80
 	}
81 81
 
82 82
 
@@ -88,27 +88,27 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function give_get_settings_tabs() {
90 90
 
91
-		$settings = $this->give_settings( null );
91
+		$settings = $this->give_settings(null);
92 92
 
93 93
 		$tabs             = array();
94
-		$tabs['general']  = esc_html__( 'General', 'give' );
95
-		$tabs['gateways'] = esc_html__( 'Payment Gateways', 'give' );
96
-		$tabs['display']  = esc_html__( 'Display Options', 'give' );
97
-		$tabs['emails']   = esc_html__( 'Emails', 'give' );
94
+		$tabs['general']  = esc_html__('General', 'give');
95
+		$tabs['gateways'] = esc_html__('Payment Gateways', 'give');
96
+		$tabs['display']  = esc_html__('Display Options', 'give');
97
+		$tabs['emails']   = esc_html__('Emails', 'give');
98 98
 
99
-		if ( ! empty( $settings['addons']['fields'] ) ) {
100
-			$tabs['addons'] = esc_html__( 'Add-ons', 'give' );
99
+		if ( ! empty($settings['addons']['fields'])) {
100
+			$tabs['addons'] = esc_html__('Add-ons', 'give');
101 101
 		}
102 102
 
103
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
104
-			$tabs['licenses'] = esc_html__( 'Licenses', 'give' );
103
+		if ( ! empty($settings['licenses']['fields'])) {
104
+			$tabs['licenses'] = esc_html__('Licenses', 'give');
105 105
 		}
106 106
 
107
-		$tabs['advanced']    = esc_html__( 'Advanced', 'give' );
108
-		$tabs['api']         = esc_html__( 'API', 'give' );
109
-		$tabs['system_info'] = esc_html__( 'System Info', 'give' );
107
+		$tabs['advanced']    = esc_html__('Advanced', 'give');
108
+		$tabs['api']         = esc_html__('API', 'give');
109
+		$tabs['system_info'] = esc_html__('System Info', 'give');
110 110
 
111
-		return apply_filters( 'give_settings_tabs', $tabs );
111
+		return apply_filters('give_settings_tabs', $tabs);
112 112
 	}
113 113
 
114 114
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function admin_page_display() {
121 121
 
122
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
122
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
123 123
 
124 124
 		?>
125 125
 
@@ -129,22 +129,22 @@  discard block
 block discarded – undo
129 129
 
130 130
 			<h2 class="nav-tab-wrapper">
131 131
 				<?php
132
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
132
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
133 133
 
134
-					$tab_url = esc_url( add_query_arg( array(
134
+					$tab_url = esc_url(add_query_arg(array(
135 135
 						'settings-updated' => false,
136 136
 						'tab'              => $tab_id,
137
-					) ) );
137
+					)));
138 138
 
139 139
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
140 140
 
141
-					echo '<a href="' . esc_url( $tab_url ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>';
141
+					echo '<a href="'.esc_url($tab_url).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>';
142 142
 
143 143
 				}
144 144
 				?>
145 145
 			</h2>
146 146
 
147
-			<?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?>
147
+			<?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?>
148 148
 
149 149
 		</div><!-- .wrap -->
150 150
 
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
 	 *
167 167
 	 * @return string
168 168
 	 */
169
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
169
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
170 170
 
171 171
 		// only modify the give settings form
172
-		if ( 'give_settings' == $object_id ) {
172
+		if ('give_settings' == $object_id) {
173 173
 
174
-			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . esc_attr__( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
174
+			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.esc_attr__('Save Settings', 'give').'" class="button-primary"></div></form>';
175 175
 
176 176
 		}
177 177
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 *
189 189
 	 * @return array
190 190
 	 */
191
-	public function give_settings( $active_tab ) {
191
+	public function give_settings($active_tab) {
192 192
 
193 193
 		$give_settings = array(
194 194
 			/**
@@ -196,99 +196,99 @@  discard block
 block discarded – undo
196 196
 			 */
197 197
 			'general'     => array(
198 198
 				'id'         => 'general_settings',
199
-				'give_title' => esc_html__( 'General Settings', 'give' ),
200
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
201
-				'fields'     => apply_filters( 'give_settings_general', array(
199
+				'give_title' => esc_html__('General Settings', 'give'),
200
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
201
+				'fields'     => apply_filters('give_settings_general', array(
202 202
 						array(
203
-							'name' => esc_html__( 'General Settings', 'give' ),
203
+							'name' => esc_html__('General Settings', 'give'),
204 204
 							'desc' => '',
205 205
 							'type' => 'give_title',
206 206
 							'id'   => 'give_title_general_settings_1',
207 207
 						),
208 208
 						array(
209
-							'name'    => esc_html__( 'Success Page', 'give' ),
209
+							'name'    => esc_html__('Success Page', 'give'),
210 210
 							/* translators: %s: [give_receipt] */
211
-							'desc'    => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
211
+							'desc'    => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
212 212
 							'id'      => 'success_page',
213 213
 							'type'    => 'select',
214
-							'options' => give_cmb2_get_post_options( array(
214
+							'options' => give_cmb2_get_post_options(array(
215 215
 								'post_type'   => 'page',
216
-								'numberposts' => - 1,
217
-							) ),
216
+								'numberposts' => -1,
217
+							)),
218 218
 						),
219 219
 						array(
220
-							'name'    => esc_html__( 'Failed Donation Page', 'give' ),
221
-							'desc'    => esc_html__( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
220
+							'name'    => esc_html__('Failed Donation Page', 'give'),
221
+							'desc'    => esc_html__('The page donors are sent to if their donation is cancelled or fails.', 'give'),
222 222
 							'id'      => 'failure_page',
223 223
 							'type'    => 'select',
224
-							'options' => give_cmb2_get_post_options( array(
224
+							'options' => give_cmb2_get_post_options(array(
225 225
 								'post_type'   => 'page',
226
-								'numberposts' => - 1,
227
-							) ),
226
+								'numberposts' => -1,
227
+							)),
228 228
 						),
229 229
 						array(
230
-							'name'    => esc_html__( 'Donation History Page', 'give' ),
230
+							'name'    => esc_html__('Donation History Page', 'give'),
231 231
 							/* translators: %s: [donation_history] */
232
-							'desc'    => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
232
+							'desc'    => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
233 233
 							'id'      => 'history_page',
234 234
 							'type'    => 'select',
235
-							'options' => give_cmb2_get_post_options( array(
235
+							'options' => give_cmb2_get_post_options(array(
236 236
 								'post_type'   => 'page',
237
-								'numberposts' => - 1,
238
-							) ),
237
+								'numberposts' => -1,
238
+							)),
239 239
 						),
240 240
 						array(
241
-							'name'    => esc_html__( 'Base Country', 'give' ),
242
-							'desc'    => esc_html__( 'The country your site operates from.', 'give' ),
241
+							'name'    => esc_html__('Base Country', 'give'),
242
+							'desc'    => esc_html__('The country your site operates from.', 'give'),
243 243
 							'id'      => 'base_country',
244 244
 							'type'    => 'select',
245 245
 							'options' => give_get_country_list(),
246 246
 						),
247 247
 						array(
248
-							'name' => esc_html__( 'Currency Settings', 'give' ),
248
+							'name' => esc_html__('Currency Settings', 'give'),
249 249
 							'desc' => '',
250 250
 							'type' => 'give_title',
251 251
 							'id'   => 'give_title_general_settings_2',
252 252
 						),
253 253
 						array(
254
-							'name'    => esc_html__( 'Currency', 'give' ),
255
-							'desc'    => esc_html__( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
254
+							'name'    => esc_html__('Currency', 'give'),
255
+							'desc'    => esc_html__('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
256 256
 							'id'      => 'currency',
257 257
 							'type'    => 'select',
258 258
 							'options' => give_get_currencies(),
259 259
 							'default' => 'USD',
260 260
 						),
261 261
 						array(
262
-							'name'    => esc_html__( 'Currency Position', 'give' ),
263
-							'desc'    => esc_html__( 'The position of the currency symbol.', 'give' ),
262
+							'name'    => esc_html__('Currency Position', 'give'),
263
+							'desc'    => esc_html__('The position of the currency symbol.', 'give'),
264 264
 							'id'      => 'currency_position',
265 265
 							'type'    => 'select',
266 266
 							'options' => array(
267 267
 								/* translators: %s: currency symbol */
268
-								'before' => sprintf( esc_html__( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
268
+								'before' => sprintf(esc_html__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
269 269
 								/* translators: %s: currency symbol */
270
-								'after'  => sprintf( esc_html__( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) ),
270
+								'after'  => sprintf(esc_html__('After - 10%s', 'give'), give_currency_symbol(give_get_currency())),
271 271
 							),
272 272
 							'default' => 'before',
273 273
 						),
274 274
 						array(
275
-							'name'            => esc_html__( 'Thousands Separator', 'give' ),
276
-							'desc'            => esc_html__( 'The symbol (usually , or .) to separate thousands.', 'give' ),
275
+							'name'            => esc_html__('Thousands Separator', 'give'),
276
+							'desc'            => esc_html__('The symbol (usually , or .) to separate thousands.', 'give'),
277 277
 							'id'              => 'thousands_separator',
278 278
 							'type'            => 'text_small',
279 279
 							'sanitization_cb' => 'give_sanitize_thousand_separator',
280 280
 							'default'         => ',',
281 281
 						),
282 282
 						array(
283
-							'name'    => esc_html__( 'Decimal Separator', 'give' ),
284
-							'desc'    => esc_html__( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
283
+							'name'    => esc_html__('Decimal Separator', 'give'),
284
+							'desc'    => esc_html__('The symbol (usually , or .) to separate decimal points.', 'give'),
285 285
 							'id'      => 'decimal_separator',
286 286
 							'type'    => 'text_small',
287 287
 							'default' => '.',
288 288
 						),
289 289
 						array(
290
-							'name'            => esc_html__( 'Number of Decimals', 'give' ),
291
-							'desc'            => esc_html__( 'The number of decimal points displayed in amounts.', 'give' ),
290
+							'name'            => esc_html__('Number of Decimals', 'give'),
291
+							'desc'            => esc_html__('The number of decimal points displayed in amounts.', 'give'),
292 292
 							'id'              => 'number_decimals',
293 293
 							'type'            => 'text_small',
294 294
 							'default'         => 2,
@@ -302,83 +302,83 @@  discard block
 block discarded – undo
302 302
 			 */
303 303
 			'gateways'    => array(
304 304
 				'id'         => 'payment_gateways',
305
-				'give_title' => esc_html__( 'Payment Gateways', 'give' ),
306
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
307
-				'fields'     => apply_filters( 'give_settings_gateways', array(
305
+				'give_title' => esc_html__('Payment Gateways', 'give'),
306
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
307
+				'fields'     => apply_filters('give_settings_gateways', array(
308 308
 						array(
309
-							'name' => esc_html__( 'Gateways Settings', 'give' ),
309
+							'name' => esc_html__('Gateways Settings', 'give'),
310 310
 							'desc' => '',
311 311
 							'id'   => 'give_title_gateway_settings_1',
312 312
 							'type' => 'give_title',
313 313
 						),
314 314
 						array(
315
-							'name' => esc_html__( 'Test Mode', 'give' ),
316
-							'desc' => esc_html__( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
315
+							'name' => esc_html__('Test Mode', 'give'),
316
+							'desc' => esc_html__('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
317 317
 							'id'   => 'test_mode',
318 318
 							'type' => 'checkbox',
319 319
 						),
320 320
 						array(
321
-							'name' => esc_html__( 'Enabled Gateways', 'give' ),
322
-							'desc' => esc_html__( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
321
+							'name' => esc_html__('Enabled Gateways', 'give'),
322
+							'desc' => esc_html__('Enable your payment gateway. Can be ordered by dragging.', 'give'),
323 323
 							'id'   => 'gateways',
324 324
 							'type' => 'enabled_gateways',
325 325
 						),
326 326
 						array(
327
-							'name' => esc_html__( 'Default Gateway', 'give' ),
328
-							'desc' => esc_html__( 'The gateway that will be selected by default.', 'give' ),
327
+							'name' => esc_html__('Default Gateway', 'give'),
328
+							'desc' => esc_html__('The gateway that will be selected by default.', 'give'),
329 329
 							'id'   => 'default_gateway',
330 330
 							'type' => 'default_gateway',
331 331
 						),
332 332
 						array(
333
-							'name' => esc_html__( 'PayPal Standard', 'give' ),
333
+							'name' => esc_html__('PayPal Standard', 'give'),
334 334
 							'desc' => '',
335 335
 							'type' => 'give_title',
336 336
 							'id'   => 'give_title_gateway_settings_2',
337 337
 						),
338 338
 						array(
339
-							'name' => esc_html__( 'PayPal Email', 'give' ),
340
-							'desc' => esc_html__( 'Enter your PayPal account\'s email.', 'give' ),
339
+							'name' => esc_html__('PayPal Email', 'give'),
340
+							'desc' => esc_html__('Enter your PayPal account\'s email.', 'give'),
341 341
 							'id'   => 'paypal_email',
342 342
 							'type' => 'text_email',
343 343
 						),
344 344
 						array(
345
-							'name' => esc_html__( 'PayPal Page Style', 'give' ),
346
-							'desc' => esc_html__( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
345
+							'name' => esc_html__('PayPal Page Style', 'give'),
346
+							'desc' => esc_html__('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
347 347
 							'id'   => 'paypal_page_style',
348 348
 							'type' => 'text',
349 349
 						),
350 350
 						array(
351
-							'name'    => esc_html__( 'PayPal Transaction Type', 'give' ),
352
-							'desc'    => esc_html__( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
351
+							'name'    => esc_html__('PayPal Transaction Type', 'give'),
352
+							'desc'    => esc_html__('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
353 353
 							'id'      => 'paypal_button_type',
354 354
 							'type'    => 'radio_inline',
355 355
 							'options' => array(
356
-								'donation' => esc_html__( 'Donation', 'give' ),
357
-								'standard' => esc_html__( 'Standard Transaction', 'give' ),
356
+								'donation' => esc_html__('Donation', 'give'),
357
+								'standard' => esc_html__('Standard Transaction', 'give'),
358 358
 							),
359 359
 							'default' => 'donation',
360 360
 						),
361 361
 						array(
362
-							'name' => esc_html__( 'Disable PayPal IPN Verification', 'give' ),
363
-							'desc' => esc_html__( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
362
+							'name' => esc_html__('Disable PayPal IPN Verification', 'give'),
363
+							'desc' => esc_html__('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
364 364
 							'id'   => 'disable_paypal_verification',
365 365
 							'type' => 'checkbox',
366 366
 						),
367 367
 						array(
368
-							'name' => esc_html__( 'Offline Donations', 'give' ),
368
+							'name' => esc_html__('Offline Donations', 'give'),
369 369
 							'desc' => '',
370 370
 							'type' => 'give_title',
371 371
 							'id'   => 'give_title_gateway_settings_3',
372 372
 						),
373 373
 						array(
374
-							'name' => esc_html__( 'Collect Billing Details', 'give' ),
375
-							'desc' => esc_html__( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
374
+							'name' => esc_html__('Collect Billing Details', 'give'),
375
+							'desc' => esc_html__('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
376 376
 							'id'   => 'give_offline_donation_enable_billing_fields',
377 377
 							'type' => 'checkbox',
378 378
 						),
379 379
 						array(
380
-							'name'    => esc_html__( 'Offline Donation Instructions', 'give' ),
381
-							'desc'    => esc_html__( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
380
+							'name'    => esc_html__('Offline Donation Instructions', 'give'),
381
+							'desc'    => esc_html__('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
382 382
 							'id'      => 'global_offline_donation_content',
383 383
 							'default' => give_get_default_offline_donation_content(),
384 384
 							'type'    => 'wysiwyg',
@@ -387,15 +387,15 @@  discard block
 block discarded – undo
387 387
 							),
388 388
 						),
389 389
 						array(
390
-							'name'    => esc_html__( 'Offline Donation Email Instructions Subject', 'give' ),
391
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
390
+							'name'    => esc_html__('Offline Donation Email Instructions Subject', 'give'),
391
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
392 392
 							'id'      => 'offline_donation_subject',
393
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
393
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
394 394
 							'type'    => 'text',
395 395
 						),
396 396
 						array(
397
-							'name'    => esc_html__( 'Offline Donation Email Instructions', 'give' ),
398
-							'desc'    => esc_html__( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
397
+							'name'    => esc_html__('Offline Donation Email Instructions', 'give'),
398
+							'desc'    => esc_html__('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
399 399
 							'id'      => 'global_offline_donation_email',
400 400
 							'default' => give_get_default_offline_donation_email_content(),
401 401
 							'type'    => 'wysiwyg',
@@ -409,104 +409,104 @@  discard block
 block discarded – undo
409 409
 			/** Display Settings */
410 410
 			'display'     => array(
411 411
 				'id'         => 'display_settings',
412
-				'give_title' => esc_html__( 'Display Settings', 'give' ),
413
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
414
-				'fields'     => apply_filters( 'give_settings_display', array(
412
+				'give_title' => esc_html__('Display Settings', 'give'),
413
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
414
+				'fields'     => apply_filters('give_settings_display', array(
415 415
 						array(
416
-							'name' => esc_html__( 'Display Settings', 'give' ),
416
+							'name' => esc_html__('Display Settings', 'give'),
417 417
 							'desc' => '',
418 418
 							'id'   => 'give_title_display_settings_1',
419 419
 							'type' => 'give_title',
420 420
 						),
421 421
 						array(
422
-							'name' => esc_html__( 'Disable CSS', 'give' ),
423
-							'desc' => esc_html__( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
422
+							'name' => esc_html__('Disable CSS', 'give'),
423
+							'desc' => esc_html__('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
424 424
 							'id'   => 'disable_css',
425 425
 							'type' => 'checkbox',
426 426
 						),
427 427
 						array(
428
-							'name' => esc_html__( 'Enable Floating Labels', 'give' ),
428
+							'name' => esc_html__('Enable Floating Labels', 'give'),
429 429
 							/* translators: %s: http://docs.givewp.com/form-floating-labels */
430
-							'desc' => sprintf( wp_kses( __( 'Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array(
430
+							'desc' => sprintf(wp_kses(__('Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array(
431 431
 								'a' => array(
432 432
 									'href'   => array(),
433 433
 									'target' => array(),
434 434
 								),
435
-							) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
435
+							)), esc_url('http://docs.givewp.com/form-floating-labels')),
436 436
 							'id'   => 'floatlabels',
437 437
 							'type' => 'checkbox',
438 438
 						),
439 439
 						array(
440
-							'name' => esc_html__( 'Disable Welcome Screen', 'give' ),
440
+							'name' => esc_html__('Disable Welcome Screen', 'give'),
441 441
 							/* translators: %s: about page URL */
442
-							'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give' ), array(
442
+							'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give'), array(
443 443
 								'a' => array(
444 444
 									'href'   => array(),
445 445
 									'target' => array(),
446 446
 								),
447
-							) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
447
+							)), esc_url(admin_url('index.php?page=give-about'))),
448 448
 							'id'   => 'disable_welcome',
449 449
 							'type' => 'checkbox',
450 450
 						),
451 451
 						array(
452
-							'name' => esc_html__( 'Post Types', 'give' ),
452
+							'name' => esc_html__('Post Types', 'give'),
453 453
 							'desc' => '',
454 454
 							'id'   => 'give_title_display_settings_2',
455 455
 							'type' => 'give_title',
456 456
 						),
457 457
 						array(
458
-							'name' => esc_html__( 'Disable Form Single Views', 'give' ),
459
-							'desc' => esc_html__( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
458
+							'name' => esc_html__('Disable Form Single Views', 'give'),
459
+							'desc' => esc_html__('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
460 460
 							'id'   => 'disable_forms_singular',
461 461
 							'type' => 'checkbox',
462 462
 						),
463 463
 						array(
464
-							'name' => esc_html__( 'Disable Form Archives', 'give' ),
465
-							'desc' => esc_html__( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
464
+							'name' => esc_html__('Disable Form Archives', 'give'),
465
+							'desc' => esc_html__('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
466 466
 							'id'   => 'disable_forms_archives',
467 467
 							'type' => 'checkbox',
468 468
 						),
469 469
 						array(
470
-							'name' => esc_html__( 'Disable Form Excerpts', 'give' ),
471
-							'desc' => esc_html__( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
470
+							'name' => esc_html__('Disable Form Excerpts', 'give'),
471
+							'desc' => esc_html__('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
472 472
 							'id'   => 'disable_forms_excerpt',
473 473
 							'type' => 'checkbox',
474 474
 						),
475 475
 						array(
476
-							'name'    => esc_html__( 'Featured Image Size', 'give' ),
477
-							'desc'    => esc_html__( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
476
+							'name'    => esc_html__('Featured Image Size', 'give'),
477
+							'desc'    => esc_html__('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'),
478 478
 							'id'      => 'featured_image_size',
479 479
 							'type'    => 'select',
480 480
 							'default' => 'large',
481 481
 							'options' => give_get_featured_image_sizes(),
482 482
 						),
483 483
 						array(
484
-							'name' => esc_html__( 'Disable Form Featured Image', 'give' ),
485
-							'desc' => esc_html__( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
484
+							'name' => esc_html__('Disable Form Featured Image', 'give'),
485
+							'desc' => esc_html__('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
486 486
 							'id'   => 'disable_form_featured_img',
487 487
 							'type' => 'checkbox',
488 488
 						),
489 489
 						array(
490
-							'name' => esc_html__( 'Disable Single Form Sidebar', 'give' ),
491
-							'desc' => esc_html__( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
490
+							'name' => esc_html__('Disable Single Form Sidebar', 'give'),
491
+							'desc' => esc_html__('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
492 492
 							'id'   => 'disable_form_sidebar',
493 493
 							'type' => 'checkbox',
494 494
 						),
495 495
 						array(
496
-							'name' => esc_html__( 'Taxonomies', 'give' ),
496
+							'name' => esc_html__('Taxonomies', 'give'),
497 497
 							'desc' => '',
498 498
 							'id'   => 'give_title_display_settings_3',
499 499
 							'type' => 'give_title',
500 500
 						),
501 501
 						array(
502
-							'name' => esc_html__( 'Enable Form Categories', 'give' ),
503
-							'desc' => esc_html__( 'Enables the "Category" taxonomy for all Give forms.', 'give' ),
502
+							'name' => esc_html__('Enable Form Categories', 'give'),
503
+							'desc' => esc_html__('Enables the "Category" taxonomy for all Give forms.', 'give'),
504 504
 							'id'   => 'categories',
505 505
 							'type' => 'checkbox',
506 506
 						),
507 507
 						array(
508
-							'name' => esc_html__( 'Enable Form Tags', 'give' ),
509
-							'desc' => esc_html__( 'Enables the "Tag" taxonomy for all Give forms.', 'give' ),
508
+							'name' => esc_html__('Enable Form Tags', 'give'),
509
+							'desc' => esc_html__('Enables the "Tag" taxonomy for all Give forms.', 'give'),
510 510
 							'id'   => 'tags',
511 511
 							'type' => 'checkbox',
512 512
 						),
@@ -519,101 +519,101 @@  discard block
 block discarded – undo
519 519
 			 */
520 520
 			'emails'      => array(
521 521
 				'id'         => 'email_settings',
522
-				'give_title' => esc_html__( 'Email Settings', 'give' ),
523
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
524
-				'fields'     => apply_filters( 'give_settings_emails', array(
522
+				'give_title' => esc_html__('Email Settings', 'give'),
523
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
524
+				'fields'     => apply_filters('give_settings_emails', array(
525 525
 						array(
526
-							'name' => esc_html__( 'Email Settings', 'give' ),
526
+							'name' => esc_html__('Email Settings', 'give'),
527 527
 							'desc' => '',
528 528
 							'id'   => 'give_title_email_settings_1',
529 529
 							'type' => 'give_title',
530 530
 						),
531 531
 						array(
532 532
 							'id'      => 'email_template',
533
-							'name'    => esc_html__( 'Email Template', 'give' ),
534
-							'desc'    => esc_html__( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
533
+							'name'    => esc_html__('Email Template', 'give'),
534
+							'desc'    => esc_html__('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
535 535
 							'type'    => 'select',
536 536
 							'options' => give_get_email_templates(),
537 537
 						),
538 538
 						array(
539 539
 							'id'   => 'email_logo',
540
-							'name' => esc_html__( 'Logo', 'give' ),
541
-							'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
540
+							'name' => esc_html__('Logo', 'give'),
541
+							'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
542 542
 							'type' => 'file',
543 543
 						),
544 544
 						array(
545 545
 							'id'      => 'from_name',
546
-							'name'    => esc_html__( 'From Name', 'give' ),
547
-							'desc'    => esc_html__( 'The name that appears in the "From" field in donation receipt emails.', 'give' ),
548
-							'default' => get_bloginfo( 'name' ),
546
+							'name'    => esc_html__('From Name', 'give'),
547
+							'desc'    => esc_html__('The name that appears in the "From" field in donation receipt emails.', 'give'),
548
+							'default' => get_bloginfo('name'),
549 549
 							'type'    => 'text',
550 550
 						),
551 551
 						array(
552 552
 							'id'      => 'from_email',
553
-							'name'    => esc_html__( 'From Email', 'give' ),
554
-							'desc'    => esc_html__( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
555
-							'default' => get_bloginfo( 'admin_email' ),
553
+							'name'    => esc_html__('From Email', 'give'),
554
+							'desc'    => esc_html__('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
555
+							'default' => get_bloginfo('admin_email'),
556 556
 							'type'    => 'text',
557 557
 						),
558 558
 						array(
559
-							'name' => esc_html__( 'Donation Receipt', 'give' ),
559
+							'name' => esc_html__('Donation Receipt', 'give'),
560 560
 							'desc' => '',
561 561
 							'id'   => 'give_title_email_settings_2',
562 562
 							'type' => 'give_title',
563 563
 						),
564 564
 						array(
565 565
 							'id'      => 'donation_subject',
566
-							'name'    => esc_html__( 'Donation Email Subject', 'give' ),
567
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
568
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
566
+							'name'    => esc_html__('Donation Email Subject', 'give'),
567
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
568
+							'default' => esc_attr__('Donation Receipt', 'give'),
569 569
 							'type'    => 'text',
570 570
 						),
571 571
 						array(
572 572
 							'id'      => 'donation_receipt',
573
-							'name'    => esc_html__( 'Donation Receipt', 'give' ),
573
+							'name'    => esc_html__('Donation Receipt', 'give'),
574 574
 							'desc'    => sprintf(
575 575
 								/* translators: %s: emails tags list */
576
-								esc_html__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ),
577
-								'<br/>' . give_get_emails_tags_list()
576
+								esc_html__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'),
577
+								'<br/>'.give_get_emails_tags_list()
578 578
 							),
579 579
 							'type'    => 'wysiwyg',
580 580
 							'default' => give_get_default_donation_receipt_email(),
581 581
 						),
582 582
 						array(
583
-							'name' => esc_html__( 'New Donation Notification', 'give' ),
583
+							'name' => esc_html__('New Donation Notification', 'give'),
584 584
 							'desc' => '',
585 585
 							'id'   => 'give_title_email_settings_3',
586 586
 							'type' => 'give_title',
587 587
 						),
588 588
 						array(
589 589
 							'id'      => 'donation_notification_subject',
590
-							'name'    => esc_html__( 'Donation Notification Subject', 'give' ),
591
-							'desc'    => esc_html__( 'Enter the subject line for the donation notification email.', 'give' ),
590
+							'name'    => esc_html__('Donation Notification Subject', 'give'),
591
+							'desc'    => esc_html__('Enter the subject line for the donation notification email.', 'give'),
592 592
 							'type'    => 'text',
593
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' ),
593
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give'),
594 594
 						),
595 595
 						array(
596 596
 							'id'      => 'donation_notification',
597
-							'name'    => esc_html__( 'Donation Notification', 'give' ),
597
+							'name'    => esc_html__('Donation Notification', 'give'),
598 598
 							'desc'    => sprintf(
599 599
 								/* translators: %s: emails tags list */
600
-								esc_html__( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ),
601
-								'<br/>' . give_get_emails_tags_list()
600
+								esc_html__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'),
601
+								'<br/>'.give_get_emails_tags_list()
602 602
 							),
603 603
 							'type'    => 'wysiwyg',
604 604
 							'default' => give_get_default_donation_notification_email(),
605 605
 						),
606 606
 						array(
607 607
 							'id'      => 'admin_notice_emails',
608
-							'name'    => esc_html__( 'Donation Notification Emails', 'give' ),
609
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
608
+							'name'    => esc_html__('Donation Notification Emails', 'give'),
609
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
610 610
 							'type'    => 'textarea',
611
-							'default' => get_bloginfo( 'admin_email' ),
611
+							'default' => get_bloginfo('admin_email'),
612 612
 						),
613 613
 						array(
614 614
 							'id'   => 'disable_admin_notices',
615
-							'name' => esc_html__( 'Disable Admin Notifications', 'give' ),
616
-							'desc' => esc_html__( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
615
+							'name' => esc_html__('Disable Admin Notifications', 'give'),
616
+							'desc' => esc_html__('Check this box if you do not want to receive emails when new donations are made.', 'give'),
617 617
 							'type' => 'checkbox',
618 618
 						),
619 619
 					)
@@ -622,99 +622,99 @@  discard block
 block discarded – undo
622 622
 			/** Extension Settings */
623 623
 			'addons'      => array(
624 624
 				'id'         => 'addons',
625
-				'give_title' => esc_html__( 'Give Add-ons Settings', 'give' ),
626
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
627
-				'fields'     => apply_filters( 'give_settings_addons', array()
625
+				'give_title' => esc_html__('Give Add-ons Settings', 'give'),
626
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
627
+				'fields'     => apply_filters('give_settings_addons', array()
628 628
 				),
629 629
 			),
630 630
 			/** Licenses Settings */
631 631
 			'licenses'    => array(
632 632
 				'id'         => 'licenses',
633
-				'give_title' => esc_html__( 'Give Licenses', 'give' ),
634
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
635
-				'fields'     => apply_filters( 'give_settings_licenses', array()
633
+				'give_title' => esc_html__('Give Licenses', 'give'),
634
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
635
+				'fields'     => apply_filters('give_settings_licenses', array()
636 636
 				),
637 637
 			),
638 638
 			/** Advanced Options */
639 639
 			'advanced'    => array(
640 640
 				'id'         => 'advanced_options',
641
-				'give_title' => esc_html__( 'Advanced Options', 'give' ),
642
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
643
-				'fields'     => apply_filters( 'give_settings_advanced', array(
641
+				'give_title' => esc_html__('Advanced Options', 'give'),
642
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
643
+				'fields'     => apply_filters('give_settings_advanced', array(
644 644
 						array(
645
-							'name' => esc_html__( 'Access Control', 'give' ),
645
+							'name' => esc_html__('Access Control', 'give'),
646 646
 							'desc' => '',
647 647
 							'id'   => 'give_title_session_control_1',
648 648
 							'type' => 'give_title',
649 649
 						),
650 650
 						array(
651 651
 							'id'      => 'session_lifetime',
652
-							'name'    => esc_html__( 'Session Lifetime', 'give' ),
653
-							'desc'    => esc_html__( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ),
652
+							'name'    => esc_html__('Session Lifetime', 'give'),
653
+							'desc'    => esc_html__('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'),
654 654
 							'type'    => 'select',
655 655
 							'options' => array(
656
-								'86400'  => esc_html__( '24 Hours', 'give' ),
657
-								'172800' => esc_html__( '48 Hours', 'give' ),
658
-								'259200' => esc_html__( '72 Hours', 'give' ),
659
-								'604800' => esc_html__( '1 Week', 'give' ),
656
+								'86400'  => esc_html__('24 Hours', 'give'),
657
+								'172800' => esc_html__('48 Hours', 'give'),
658
+								'259200' => esc_html__('72 Hours', 'give'),
659
+								'604800' => esc_html__('1 Week', 'give'),
660 660
 							),
661 661
 						),
662 662
 						array(
663
-							'name' => esc_html__( 'Email Access', 'give' ),
664
-							'desc' => esc_html__( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
663
+							'name' => esc_html__('Email Access', 'give'),
664
+							'desc' => esc_html__('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
665 665
 							'id'   => 'email_access',
666 666
 							'type' => 'checkbox',
667 667
 						),
668 668
 						array(
669 669
 							'id'      => 'recaptcha_key',
670
-							'name'    => esc_html__( 'reCAPTCHA Site Key', 'give' ),
670
+							'name'    => esc_html__('reCAPTCHA Site Key', 'give'),
671 671
 							/* translators: %s: https://www.google.com/recaptcha/ */
672
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'https://www.google.com/recaptcha/' ) ),
672
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('https://www.google.com/recaptcha/')),
673 673
 							'default' => '',
674 674
 							'type'    => 'text',
675 675
 						),
676 676
 						array(
677 677
 							'id'      => 'recaptcha_secret',
678
-							'name'    => esc_html__( 'reCAPTCHA Secret Key', 'give' ),
679
-							'desc'    => esc_html__( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
678
+							'name'    => esc_html__('reCAPTCHA Secret Key', 'give'),
679
+							'desc'    => esc_html__('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
680 680
 							'default' => '',
681 681
 							'type'    => 'text',
682 682
 						),
683 683
 						array(
684
-							'name' => esc_html__( 'Data Control', 'give' ),
684
+							'name' => esc_html__('Data Control', 'give'),
685 685
 							'desc' => '',
686 686
 							'id'   => 'give_title_data_control_2',
687 687
 							'type' => 'give_title',
688 688
 						),
689 689
 						array(
690
-							'name' => esc_html__( 'Remove All Data on Uninstall?', 'give' ),
691
-							'desc' => esc_html__( 'When the plugin is deleted, completely remove all Give data.', 'give' ),
690
+							'name' => esc_html__('Remove All Data on Uninstall?', 'give'),
691
+							'desc' => esc_html__('When the plugin is deleted, completely remove all Give data.', 'give'),
692 692
 							'id'   => 'uninstall_on_delete',
693 693
 							'type' => 'checkbox',
694 694
 						),
695 695
 						array(
696
-							'name' => esc_html__( 'Filter Control', 'give' ),
696
+							'name' => esc_html__('Filter Control', 'give'),
697 697
 							'desc' => '',
698 698
 							'id'   => 'give_title_filter_control',
699 699
 							'type' => 'give_title',
700 700
 						),
701 701
 						array(
702 702
 							/* translators: %s: the_content */
703
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
703
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
704 704
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
705
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
705
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
706 706
 							'id'   => 'disable_the_content_filter',
707 707
 							'type' => 'checkbox',
708 708
 						),
709 709
 						array(
710
-							'name' => esc_html__( 'Script Loading', 'give' ),
710
+							'name' => esc_html__('Script Loading', 'give'),
711 711
 							'desc' => '',
712 712
 							'id'   => 'give_title_script_control',
713 713
 							'type' => 'give_title',
714 714
 						),
715 715
 						array(
716
-							'name' => esc_html__( 'Load Scripts in Footer?', 'give' ),
717
-							'desc' => esc_html__( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
716
+							'name' => esc_html__('Load Scripts in Footer?', 'give'),
717
+							'desc' => esc_html__('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
718 718
 							'id'   => 'scripts_footer',
719 719
 							'type' => 'checkbox',
720 720
 						),
@@ -724,13 +724,13 @@  discard block
 block discarded – undo
724 724
 			/** API Settings */
725 725
 			'api'         => array(
726 726
 				'id'         => 'api',
727
-				'give_title' => esc_html__( 'API', 'give' ),
728
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
727
+				'give_title' => esc_html__('API', 'give'),
728
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
729 729
 				'show_names' => false, // Hide field names on the left
730
-				'fields'     => apply_filters( 'give_settings_system', array(
730
+				'fields'     => apply_filters('give_settings_system', array(
731 731
 						array(
732 732
 							'id'   => 'api',
733
-							'name' => esc_html__( 'API', 'give' ),
733
+							'name' => esc_html__('API', 'give'),
734 734
 							'type' => 'api',
735 735
 						),
736 736
 					)
@@ -739,13 +739,13 @@  discard block
 block discarded – undo
739 739
 			/** Licenses Settings */
740 740
 			'system_info' => array(
741 741
 				'id'         => 'system_info',
742
-				'give_title' => esc_html__( 'System Info', 'give' ),
743
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
744
-				'fields'     => apply_filters( 'give_settings_system', array(
742
+				'give_title' => esc_html__('System Info', 'give'),
743
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
744
+				'fields'     => apply_filters('give_settings_system', array(
745 745
 						array(
746 746
 							'id'   => 'system-info-textarea',
747
-							'name' => esc_html__( 'System Info', 'give' ),
748
-							'desc' => esc_html__( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
747
+							'name' => esc_html__('System Info', 'give'),
748
+							'desc' => esc_html__('Please copy and paste this information in your ticket when contacting support.', 'give'),
749 749
 							'type' => 'system_info',
750 750
 						),
751 751
 					)
@@ -753,15 +753,15 @@  discard block
 block discarded – undo
753 753
 			),
754 754
 		);
755 755
 
756
-		$give_settings = apply_filters( 'give_registered_settings', $give_settings );
756
+		$give_settings = apply_filters('give_registered_settings', $give_settings);
757 757
 
758 758
 		// Return all settings array if no active tab
759
-		if ( empty( $active_tab ) || ! isset( $give_settings[ $active_tab ] ) ) {
759
+		if (empty($active_tab) || ! isset($give_settings[$active_tab])) {
760 760
 			return $give_settings;
761 761
 		}
762 762
 
763 763
 		// Add other tabs and settings fields as needed
764
-		return $give_settings[ $active_tab ];
764
+		return $give_settings[$active_tab];
765 765
 
766 766
 	}
767 767
 
@@ -770,11 +770,11 @@  discard block
 block discarded – undo
770 770
 	 */
771 771
 	public function settings_notices() {
772 772
 
773
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
773
+		if ( ! isset($_POST['give_settings_saved'])) {
774 774
 			return;
775 775
 		}
776 776
 
777
-		add_settings_error( 'give-notices', 'global-settings-updated', esc_html__( 'Settings updated.', 'give' ), 'updated' );
777
+		add_settings_error('give-notices', 'global-settings-updated', esc_html__('Settings updated.', 'give'), 'updated');
778 778
 
779 779
 	}
780 780
 
@@ -789,14 +789,14 @@  discard block
 block discarded – undo
789 789
 	 * @return mixed         Field value or exception is thrown.
790 790
 	 * @throws Exception     Throws an exception if the field is invalid.
791 791
 	 */
792
-	public function __get( $field ) {
792
+	public function __get($field) {
793 793
 
794 794
 		// Allowed fields to retrieve
795
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
795
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
796 796
 			return $this->{$field};
797 797
 		}
798 798
 
799
-		throw new Exception( sprintf( esc_html__( 'Invalid property: %s', 'give' ), $field ) );
799
+		throw new Exception(sprintf(esc_html__('Invalid property: %s', 'give'), $field));
800 800
 	}
801 801
 
802 802
 
@@ -815,12 +815,12 @@  discard block
 block discarded – undo
815 815
  *
816 816
  * @return mixed        Option value
817 817
  */
818
-function give_get_option( $key = '', $default = false ) {
818
+function give_get_option($key = '', $default = false) {
819 819
 	$give_options = give_get_settings();
820
-	$value        = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
821
-	$value        = apply_filters( 'give_get_option', $value, $key, $default );
820
+	$value        = ! empty($give_options[$key]) ? $give_options[$key] : $default;
821
+	$value        = apply_filters('give_get_option', $value, $key, $default);
822 822
 
823
-	return apply_filters( "give_get_option_{$key}", $value, $key, $default );
823
+	return apply_filters("give_get_option_{$key}", $value, $key, $default);
824 824
 }
825 825
 
826 826
 
@@ -838,33 +838,33 @@  discard block
 block discarded – undo
838 838
  *
839 839
  * @return boolean True if updated, false if not.
840 840
  */
841
-function give_update_option( $key = '', $value = false ) {
841
+function give_update_option($key = '', $value = false) {
842 842
 
843 843
 	// If no key, exit
844
-	if ( empty( $key ) ) {
844
+	if (empty($key)) {
845 845
 		return false;
846 846
 	}
847 847
 
848
-	if ( empty( $value ) ) {
849
-		$remove_option = give_delete_option( $key );
848
+	if (empty($value)) {
849
+		$remove_option = give_delete_option($key);
850 850
 
851 851
 		return $remove_option;
852 852
 	}
853 853
 
854 854
 	// First let's grab the current settings
855
-	$options = get_option( 'give_settings' );
855
+	$options = get_option('give_settings');
856 856
 
857 857
 	// Let's let devs alter that value coming in
858
-	$value = apply_filters( 'give_update_option', $value, $key );
858
+	$value = apply_filters('give_update_option', $value, $key);
859 859
 
860 860
 	// Next let's try to update the value
861
-	$options[ $key ] = $value;
862
-	$did_update      = update_option( 'give_settings', $options );
861
+	$options[$key] = $value;
862
+	$did_update      = update_option('give_settings', $options);
863 863
 
864 864
 	// If it updated, let's update the global variable
865
-	if ( $did_update ) {
865
+	if ($did_update) {
866 866
 		global $give_options;
867
-		$give_options[ $key ] = $value;
867
+		$give_options[$key] = $value;
868 868
 	}
869 869
 
870 870
 	return $did_update;
@@ -883,27 +883,27 @@  discard block
 block discarded – undo
883 883
  *
884 884
  * @return boolean True if updated, false if not.
885 885
  */
886
-function give_delete_option( $key = '' ) {
886
+function give_delete_option($key = '') {
887 887
 
888 888
 	// If no key, exit
889
-	if ( empty( $key ) ) {
889
+	if (empty($key)) {
890 890
 		return false;
891 891
 	}
892 892
 
893 893
 	// First let's grab the current settings
894
-	$options = get_option( 'give_settings' );
894
+	$options = get_option('give_settings');
895 895
 
896 896
 	// Next let's try to update the value
897
-	if ( isset( $options[ $key ] ) ) {
897
+	if (isset($options[$key])) {
898 898
 
899
-		unset( $options[ $key ] );
899
+		unset($options[$key]);
900 900
 
901 901
 	}
902 902
 
903
-	$did_update = update_option( 'give_settings', $options );
903
+	$did_update = update_option('give_settings', $options);
904 904
 
905 905
 	// If it updated, let's update the global variable
906
-	if ( $did_update ) {
906
+	if ($did_update) {
907 907
 		global $give_options;
908 908
 		$give_options = $options;
909 909
 	}
@@ -922,9 +922,9 @@  discard block
 block discarded – undo
922 922
  */
923 923
 function give_get_settings() {
924 924
 
925
-	$settings = get_option( 'give_settings' );
925
+	$settings = get_option('give_settings');
926 926
 
927
-	return (array) apply_filters( 'give_get_settings', $settings );
927
+	return (array) apply_filters('give_get_settings', $settings);
928 928
 
929 929
 }
930 930
 
@@ -942,25 +942,25 @@  discard block
 block discarded – undo
942 942
  *
943 943
  * @return array
944 944
  */
945
-function give_settings_array_insert( $array, $position, $insert ) {
946
-	if ( is_int( $position ) ) {
947
-		array_splice( $array, $position, 0, $insert );
945
+function give_settings_array_insert($array, $position, $insert) {
946
+	if (is_int($position)) {
947
+		array_splice($array, $position, 0, $insert);
948 948
 	} else {
949 949
 
950
-		foreach ( $array as $index => $subarray ) {
951
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
950
+		foreach ($array as $index => $subarray) {
951
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
952 952
 				$pos = $index;
953 953
 			}
954 954
 		}
955 955
 
956
-		if ( ! isset( $pos ) ) {
956
+		if ( ! isset($pos)) {
957 957
 			return $array;
958 958
 		}
959 959
 
960 960
 		$array = array_merge(
961
-			array_slice( $array, 0, $pos ),
961
+			array_slice($array, 0, $pos),
962 962
 			$insert,
963
-			array_slice( $array, $pos )
963
+			array_slice($array, $pos)
964 964
 		);
965 965
 	}
966 966
 
@@ -980,23 +980,23 @@  discard block
 block discarded – undo
980 980
  *
981 981
  * @return void
982 982
  */
983
-function give_enabled_gateways_callback( $field_arr, $saved_values = array() ) {
983
+function give_enabled_gateways_callback($field_arr, $saved_values = array()) {
984 984
 
985 985
 	$id       = $field_arr['id'];
986
-	$gateways = give_get_ordered_payment_gateways( give_get_payment_gateways() );
986
+	$gateways = give_get_ordered_payment_gateways(give_get_payment_gateways());
987 987
 
988 988
 	echo '<ul class="give-checklist-fields give-payment-gatways-list">';
989 989
 
990
-	foreach ( $gateways as $key => $option ) :
990
+	foreach ($gateways as $key => $option) :
991 991
 
992
-		if ( is_array( $saved_values ) && array_key_exists( $key, $saved_values ) ) {
992
+		if (is_array($saved_values) && array_key_exists($key, $saved_values)) {
993 993
 			$enabled = '1';
994 994
 		} else {
995 995
 			$enabled = null;
996 996
 		}
997 997
 
998
-		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
999
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
998
+		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
999
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
1000 1000
 
1001 1001
 	endforeach;
1002 1002
 
@@ -1015,16 +1015,16 @@  discard block
 block discarded – undo
1015 1015
  *
1016 1016
  * @return void
1017 1017
  */
1018
-function give_default_gateway_callback( $field_arr, $saved_value ) {
1018
+function give_default_gateway_callback($field_arr, $saved_value) {
1019 1019
 	$id          = $field_arr['id'];
1020 1020
 	$gateways    = give_get_enabled_payment_gateways();
1021
-	$saved_value = give_get_default_gateway( null );
1021
+	$saved_value = give_get_default_gateway(null);
1022 1022
 
1023
-	echo '<select class="give-select" name="' . $id . '" id="' . $id . '">';
1023
+	echo '<select class="give-select" name="'.$id.'" id="'.$id.'">';
1024 1024
 
1025
-	foreach ( $gateways as $key => $option ) :
1026
-		$selected = isset( $saved_value ) ? selected( $key, $saved_value, false ) : '';
1027
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1025
+	foreach ($gateways as $key => $option) :
1026
+		$selected = isset($saved_value) ? selected($key, $saved_value, false) : '';
1027
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1028 1028
 	endforeach;
1029 1029
 
1030 1030
 	echo '</select>';
@@ -1042,13 +1042,13 @@  discard block
 block discarded – undo
1042 1042
  *
1043 1043
  * @return void
1044 1044
  */
1045
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1045
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1046 1046
 
1047 1047
 	$id                = $field_type_object->field->args['id'];
1048 1048
 	$title             = $field_type_object->field->args['name'];
1049 1049
 	$field_description = $field_type_object->field->args['desc'];
1050 1050
 
1051
-	echo '<hr>' . $field_description;
1051
+	echo '<hr>'.$field_description;
1052 1052
 
1053 1053
 }
1054 1054
 
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
  *
1064 1064
  * @return void
1065 1065
  */
1066
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1066
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1067 1067
 
1068 1068
 	$id                = $field_type_object->field->args['id'];
1069 1069
 	$title             = $field_type_object->field->args['name'];
@@ -1082,25 +1082,25 @@  discard block
 block discarded – undo
1082 1082
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1083 1083
  * @return array An array of options that matches the CMB2 options array
1084 1084
  */
1085
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1085
+function give_cmb2_get_post_options($query_args, $force = false) {
1086 1086
 
1087
-	$post_options = array( '' => '' ); // Blank option
1087
+	$post_options = array('' => ''); // Blank option
1088 1088
 
1089
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1089
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1090 1090
 		return $post_options;
1091 1091
 	}
1092 1092
 
1093
-	$args = wp_parse_args( $query_args, array(
1093
+	$args = wp_parse_args($query_args, array(
1094 1094
 		'post_type'   => 'page',
1095 1095
 		'numberposts' => 10,
1096
-	) );
1096
+	));
1097 1097
 
1098
-	$posts = get_posts( $args );
1098
+	$posts = get_posts($args);
1099 1099
 
1100
-	if ( $posts ) {
1101
-		foreach ( $posts as $post ) {
1100
+	if ($posts) {
1101
+		foreach ($posts as $post) {
1102 1102
 
1103
-			$post_options[ $post->ID ] = $post->post_title;
1103
+			$post_options[$post->ID] = $post->post_title;
1104 1104
 
1105 1105
 		}
1106 1106
 	}
@@ -1126,20 +1126,20 @@  discard block
 block discarded – undo
1126 1126
 	$get_sizes = get_intermediate_image_sizes();
1127 1127
 
1128 1128
 	// check whether intermediate image sizes exist first
1129
-	if ( empty( $get_sizes ) ) {
1130
-		$get_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' );
1129
+	if (empty($get_sizes)) {
1130
+		$get_sizes = array('thumbnail', 'medium', 'medium_large', 'large');
1131 1131
 	}
1132 1132
 
1133
-	foreach ( $get_sizes as $_size ) {
1133
+	foreach ($get_sizes as $_size) {
1134 1134
 
1135
-		if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
1136
-			$sizes[ $_size ] = $_size . ' - ' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1137
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1138
-			$sizes[ $_size ] = $_size . ' - ' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height'];
1135
+		if (in_array($_size, array('thumbnail', 'medium', 'medium_large', 'large'))) {
1136
+			$sizes[$_size] = $_size.' - '.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1137
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1138
+			$sizes[$_size] = $_size.' - '.$_wp_additional_image_sizes[$_size]['width'].'x'.$_wp_additional_image_sizes[$_size]['height'];
1139 1139
 		}
1140 1140
 	}
1141 1141
 
1142
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1142
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1143 1143
 }
1144 1144
 
1145 1145
 
@@ -1154,18 +1154,18 @@  discard block
 block discarded – undo
1154 1154
  *
1155 1155
  * @return void
1156 1156
  */
1157
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1157
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1158 1158
 	/* @var CMB2_Types $field_type_object */
1159 1159
 
1160 1160
 	$id                 = $field_type_object->field->args['id'];
1161 1161
 	$field_description  = $field_type_object->field->args['desc'];
1162 1162
 	$license            = $field_type_object->field->args['options']['license'];
1163 1163
 	$license_key        = $escaped_value;
1164
-	$is_license_key     = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) );
1165
-	$is_valid_license   = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) );
1164
+	$is_license_key     = apply_filters('give_is_license_key', (is_object($license) && ! empty($license)));
1165
+	$is_valid_license   = apply_filters('give_is_valid_license', ($is_license_key && property_exists($license, 'license') && 'valid' === $license->license));
1166 1166
 	$shortname          = $field_type_object->field->args['options']['shortname'];
1167 1167
 	$field_classes      = 'regular-text give-license-field';
1168
-	$type               = empty( $escaped_value ) || ! $is_valid_license ? 'text' : 'password';
1168
+	$type               = empty($escaped_value) || ! $is_valid_license ? 'text' : 'password';
1169 1169
 	$custom_html        = '';
1170 1170
 	$messages           = array();
1171 1171
 	$class              = '';
@@ -1177,135 +1177,135 @@  discard block
 block discarded – undo
1177 1177
 
1178 1178
 	// By default query on edd api url will return license object which contain status and message property, this can break below functionality.
1179 1179
 	// To combat that check if status is set to error or not, if yes then set $is_license_key to false.
1180
-	if ( $is_license_key && property_exists( $license, 'status' ) && 'error' === $license->status ) {
1180
+	if ($is_license_key && property_exists($license, 'status') && 'error' === $license->status) {
1181 1181
 		$is_license_key = false;
1182 1182
 	}
1183 1183
 
1184 1184
 	// Check if current license is part of subscription or not.
1185
-	$subscriptions = get_option( 'give_subscriptions' );
1185
+	$subscriptions = get_option('give_subscriptions');
1186 1186
 
1187
-	if ( $is_license_key && $subscriptions ) {
1188
-		foreach ( $subscriptions as $subscription ) {
1189
-			if ( in_array( $license_key, $subscription['licenses'] ) ) {
1187
+	if ($is_license_key && $subscriptions) {
1188
+		foreach ($subscriptions as $subscription) {
1189
+			if (in_array($license_key, $subscription['licenses'])) {
1190 1190
 				$is_in_subscription = $subscription['id'];
1191 1191
 				break;
1192 1192
 			}
1193 1193
 		}
1194 1194
 	}
1195 1195
 
1196
-	if ( $is_license_key ) {
1197
-		if ( $is_in_subscription ) {
1198
-			$subscription_expires = strtotime( $subscriptions[ $is_in_subscription ]['expires'] );
1199
-			$subscription_status  = esc_html__( 'renew', 'give' );
1196
+	if ($is_license_key) {
1197
+		if ($is_in_subscription) {
1198
+			$subscription_expires = strtotime($subscriptions[$is_in_subscription]['expires']);
1199
+			$subscription_status  = esc_html__('renew', 'give');
1200 1200
 
1201
-			if ( ( 'active' !== $subscriptions[ $is_in_subscription ]['status'] ) ) {
1202
-				$subscription_status = esc_html__( 'expire', 'give' );
1201
+			if (('active' !== $subscriptions[$is_in_subscription]['status'])) {
1202
+				$subscription_status = esc_html__('expire', 'give');
1203 1203
 			}
1204 1204
 
1205
-			if ( $subscription_expires < current_time( 'timestamp', 1 ) ) {
1206
-				$messages[]     = sprintf(
1207
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ),
1208
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1209
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1210
-					$checkout_page_link . '?edd_license_key=' . $subscriptions[ $is_in_subscription ]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1205
+			if ($subscription_expires < current_time('timestamp', 1)) {
1206
+				$messages[] = sprintf(
1207
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give'),
1208
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1209
+					$subscriptions[$is_in_subscription]['payment_id'],
1210
+					$checkout_page_link.'?edd_license_key='.$subscriptions[$is_in_subscription]['license_key'].'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1211 1211
 				);
1212 1212
 				$license_status = 'license-expired';
1213
-			} elseif ( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) {
1213
+			} elseif (strtotime('- 7 days', $subscription_expires) < current_time('timestamp', 1)) {
1214 1214
 				$messages[]     = sprintf(
1215
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give' ),
1216
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1217
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1215
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give'),
1216
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1217
+					$subscriptions[$is_in_subscription]['payment_id'],
1218 1218
 					$subscription_status,
1219
-					human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[ $is_in_subscription ]['expires'] ) )
1219
+					human_time_diff(current_time('timestamp', 1), strtotime($subscriptions[$is_in_subscription]['expires']))
1220 1220
 				);
1221 1221
 				$license_status = 'license-expires-soon';
1222 1222
 			} else {
1223 1223
 				$messages[]     = sprintf(
1224
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give' ),
1225
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1226
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1224
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give'),
1225
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1226
+					$subscriptions[$is_in_subscription]['payment_id'],
1227 1227
 					$subscription_status,
1228
-					date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[ $is_in_subscription ]['expires'], current_time( 'timestamp' ) ) )
1228
+					date_i18n(get_option('date_format'), strtotime($subscriptions[$is_in_subscription]['expires'], current_time('timestamp')))
1229 1229
 				);
1230 1230
 				$license_status = 'license-expiration-date';
1231 1231
 			}
1232
-		} elseif ( empty( $license->success ) && property_exists( $license, 'error' ) ) {
1232
+		} elseif (empty($license->success) && property_exists($license, 'error')) {
1233 1233
 
1234 1234
 			// activate_license 'invalid' on anything other than valid, so if there was an error capture it
1235
-			switch ( $license->error ) {
1235
+			switch ($license->error) {
1236 1236
 				case 'expired' :
1237 1237
 					$class          = $license->error;
1238 1238
 					$messages[]     = sprintf(
1239
-						__( 'Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give' ),
1240
-						date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1241
-						$checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1239
+						__('Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give'),
1240
+						date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1241
+						$checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1242 1242
 					);
1243
-					$license_status = 'license-' . $class;
1243
+					$license_status = 'license-'.$class;
1244 1244
 					break;
1245 1245
 
1246 1246
 				case 'missing' :
1247 1247
 					$class          = $license->error;
1248 1248
 					$messages[]     = sprintf(
1249
-						__( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give' ),
1250
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1249
+						__('Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give'),
1250
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1251 1251
 					);
1252
-					$license_status = 'license-' . $class;
1252
+					$license_status = 'license-'.$class;
1253 1253
 					break;
1254 1254
 
1255 1255
 				case 'invalid' :
1256 1256
 					$class          = $license->error;
1257 1257
 					$messages[]     = sprintf(
1258
-						__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1258
+						__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1259 1259
 						$addon_name,
1260
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1260
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1261 1261
 					);
1262
-					$license_status = 'license-' . $class;
1262
+					$license_status = 'license-'.$class;
1263 1263
 					break;
1264 1264
 
1265 1265
 				case 'site_inactive' :
1266 1266
 					$class          = $license->error;
1267 1267
 					$messages[]     = sprintf(
1268
-						__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1268
+						__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1269 1269
 						$addon_name,
1270
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1270
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1271 1271
 					);
1272
-					$license_status = 'license-' . $class;
1272
+					$license_status = 'license-'.$class;
1273 1273
 					break;
1274 1274
 
1275 1275
 				case 'item_name_mismatch' :
1276 1276
 					$class          = $license->error;
1277
-					$messages[]     = sprintf( __( 'This license %1$s does not belong to %2$s.', 'give' ), $license_key, $addon_name );
1278
-					$license_status = 'license-' . $class;
1277
+					$messages[]     = sprintf(__('This license %1$s does not belong to %2$s.', 'give'), $license_key, $addon_name);
1278
+					$license_status = 'license-'.$class;
1279 1279
 					break;
1280 1280
 
1281 1281
 				case 'no_activations_left':
1282 1282
 					$class          = $license->error;
1283
-					$messages[]     = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link );
1284
-					$license_status = 'license-' . $class;
1283
+					$messages[]     = sprintf(__('Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give'), $account_page_link);
1284
+					$license_status = 'license-'.$class;
1285 1285
 					break;
1286 1286
 			}
1287 1287
 		} else {
1288
-			switch ( $license->license ) {
1288
+			switch ($license->license) {
1289 1289
 				case 'valid' :
1290 1290
 				default:
1291 1291
 					$class      = 'valid';
1292
-					$now        = current_time( 'timestamp' );
1293
-					$expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1292
+					$now        = current_time('timestamp');
1293
+					$expiration = strtotime($license->expires, current_time('timestamp'));
1294 1294
 
1295
-					if ( 'lifetime' === $license->expires ) {
1296
-						$messages[]     = esc_html__( 'License key never expires.', 'give' );
1295
+					if ('lifetime' === $license->expires) {
1296
+						$messages[]     = esc_html__('License key never expires.', 'give');
1297 1297
 						$license_status = 'license-lifetime-notice';
1298
-					} elseif ( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1298
+					} elseif ($expiration > $now && $expiration - $now < (DAY_IN_SECONDS * 30)) {
1299 1299
 						$messages[]     = sprintf(
1300
-							__( 'Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ),
1301
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1302
-							$checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1300
+							__('Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give'),
1301
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1302
+							$checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1303 1303
 						);
1304 1304
 						$license_status = 'license-expires-soon';
1305 1305
 					} else {
1306 1306
 						$messages[]     = sprintf(
1307
-							__( 'Your license key expires on %s.', 'give' ),
1308
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1307
+							__('Your license key expires on %s.', 'give'),
1308
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp')))
1309 1309
 						);
1310 1310
 						$license_status = 'license-expiration-date';
1311 1311
 					}
@@ -1313,15 +1313,15 @@  discard block
 block discarded – undo
1313 1313
 			}
1314 1314
 		}
1315 1315
 	} else {
1316
-		$messages[]     = sprintf(
1317
-			__( 'To receive updates, please enter your valid %s license key.', 'give' ),
1316
+		$messages[] = sprintf(
1317
+			__('To receive updates, please enter your valid %s license key.', 'give'),
1318 1318
 			$addon_name
1319 1319
 		);
1320 1320
 		$license_status = 'inactive';
1321 1321
 	}
1322 1322
 
1323 1323
 	// Add class for input field if license is active.
1324
-	if ( $is_valid_license ) {
1324
+	if ($is_valid_license) {
1325 1325
 		$field_classes .= ' give-license-active';
1326 1326
 	}
1327 1327
 
@@ -1329,33 +1329,33 @@  discard block
 block discarded – undo
1329 1329
 	$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\">";
1330 1330
 
1331 1331
 	// If license is active so show deactivate button.
1332
-	if ( $is_valid_license ) {
1332
+	if ($is_valid_license) {
1333 1333
 		// Get input field html.
1334 1334
 		$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\" readonly=\"readonly\">";
1335 1335
 
1336
-		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>';
1336
+		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>';
1337 1337
 
1338 1338
 	}
1339 1339
 
1340 1340
 	// Field description.
1341
-	$custom_html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1341
+	$custom_html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1342 1342
 
1343 1343
 	// If no messages found then inform user that to get updated in future register yourself.
1344
-	if ( empty( $messages ) ) {
1345
-		$messages[] = apply_filters( "{$shortname}_default_addon_notice", esc_html__( 'To receive updates, please enter your valid license key.', 'give' ) );
1344
+	if (empty($messages)) {
1345
+		$messages[] = apply_filters("{$shortname}_default_addon_notice", esc_html__('To receive updates, please enter your valid license key.', 'give'));
1346 1346
 	}
1347 1347
 
1348
-	foreach ( $messages as $message ) {
1349
-		$custom_html .= '<div class="give-license-status-notice give-' . $license_status . '">';
1350
-		$custom_html .= '<p>' . $message . '</p>';
1348
+	foreach ($messages as $message) {
1349
+		$custom_html .= '<div class="give-license-status-notice give-'.$license_status.'">';
1350
+		$custom_html .= '<p>'.$message.'</p>';
1351 1351
 		$custom_html .= '</div>';
1352 1352
 	}
1353 1353
 
1354 1354
 	// Field html.
1355
-	$custom_html = apply_filters( 'give_license_key_field_html', $input_field_html . $custom_html, $field_type_object );
1355
+	$custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object);
1356 1356
 
1357 1357
 	// Nonce.
1358
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1358
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1359 1359
 
1360 1360
 	// Print field html.
1361 1361
 	echo "<div class=\"give-license-key\"><label for=\"{$id}\">{$addon_name }</label></div><div class=\"give-license-block\">{$custom_html}</div>";
@@ -1370,7 +1370,7 @@  discard block
 block discarded – undo
1370 1370
  */
1371 1371
 function give_api_callback() {
1372 1372
 
1373
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1373
+	if ( ! current_user_can('manage_give_settings')) {
1374 1374
 		return;
1375 1375
 	}
1376 1376
 
@@ -1379,9 +1379,9 @@  discard block
 block discarded – undo
1379 1379
 	 *
1380 1380
 	 * @since 1.0
1381 1381
 	 */
1382
-	do_action( 'give_tools_api_keys_before' );
1382
+	do_action('give_tools_api_keys_before');
1383 1383
 
1384
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1384
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1385 1385
 
1386 1386
 	$api_keys_table = new Give_API_Keys_Table();
1387 1387
 	$api_keys_table->prepare_items();
@@ -1390,9 +1390,9 @@  discard block
 block discarded – undo
1390 1390
 	<span class="cmb2-metabox-description api-description">
1391 1391
 		<?php echo sprintf(
1392 1392
 			/* translators: 1: http://docs.givewp.com/api 2: http://docs.givewp.com/addon-zapier */
1393
-			__( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ),
1394
-			esc_url( 'http://docs.givewp.com/api' ),
1395
-			esc_url( 'http://docs.givewp.com/addon-zapier' )
1393
+			__('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'),
1394
+			esc_url('http://docs.givewp.com/api'),
1395
+			esc_url('http://docs.givewp.com/addon-zapier')
1396 1396
 		); ?>
1397 1397
 	</span>
1398 1398
 	<?php
@@ -1402,10 +1402,10 @@  discard block
 block discarded – undo
1402 1402
 	 *
1403 1403
 	 * @since 1.0
1404 1404
 	 */
1405
-	do_action( 'give_tools_api_keys_after' );
1405
+	do_action('give_tools_api_keys_after');
1406 1406
 }
1407 1407
 
1408
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1408
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1409 1409
 
1410 1410
 /**
1411 1411
  * Hook Callback
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
  *
1419 1419
  * @return void
1420 1420
  */
1421
-function give_hook_callback( $args ) {
1421
+function give_hook_callback($args) {
1422 1422
 
1423 1423
 	$id = $args['id'];
1424 1424
 
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
 	 *
1428 1428
 	 * @since 1.0
1429 1429
 	 */
1430
-	do_action( "give_{$id}" );
1430
+	do_action("give_{$id}");
1431 1431
 
1432 1432
 }
1433 1433
 
@@ -1442,19 +1442,19 @@  discard block
 block discarded – undo
1442 1442
  *
1443 1443
  * @return bool
1444 1444
  */
1445
-function give_is_setting_enabled( $value, $compare_with = null ) {
1446
-	if ( ! is_null( $compare_with ) ) {
1445
+function give_is_setting_enabled($value, $compare_with = null) {
1446
+	if ( ! is_null($compare_with)) {
1447 1447
 
1448
-		if ( is_array( $compare_with ) ) {
1448
+		if (is_array($compare_with)) {
1449 1449
 			// Output.
1450
-			return in_array( $value, $compare_with );
1450
+			return in_array($value, $compare_with);
1451 1451
 		}
1452 1452
 
1453 1453
 		// Output.
1454
-		return ( $value === $compare_with );
1454
+		return ($value === $compare_with);
1455 1455
 	}
1456 1456
 
1457 1457
 	// Backward compatibility: From version 1.8 most of setting is modified to enabled/disabled
1458 1458
 	// Output.
1459
-	return ( in_array( $value, array( 'enabled', 'on', 'yes' ) ) ? true : false );
1459
+	return (in_array($value, array('enabled', 'on', 'yes')) ? true : false);
1460 1460
 }
Please login to merge, or discard this patch.
includes/admin/payments/class-payments-table.php 1 patch
Spacing   +188 added lines, -188 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
 /**
@@ -118,15 +118,15 @@  discard block
 block discarded – undo
118 118
 	public function __construct() {
119 119
 
120 120
 		// Set parent defaults.
121
-		parent::__construct( array(
122
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records.
123
-			'plural'   => give_get_forms_label_plural(),      // Plural name of the listed records.
124
-			'ajax'     => false,                              // Does this table support ajax?
125
-		) );
121
+		parent::__construct(array(
122
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records.
123
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records.
124
+			'ajax'     => false, // Does this table support ajax?
125
+		));
126 126
 
127 127
 		$this->get_payment_counts();
128 128
 		$this->process_bulk_action();
129
-		$this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
129
+		$this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
130 130
 	}
131 131
 
132 132
 	/**
@@ -135,29 +135,29 @@  discard block
 block discarded – undo
135 135
 	 * @return void
136 136
 	 */
137 137
 	public function advanced_filters() {
138
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
139
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null;
140
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : '';
138
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
139
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null;
140
+		$status     = isset($_GET['status']) ? $_GET['status'] : '';
141 141
 		?>
142 142
         <div id="give-payment-filters">
143 143
 			<span id="give-payment-date-filters">
144 144
 				<label for="start-date"
145
-                       class="give-start-date-label"><?php esc_html_e( 'Start Date:', 'give' ); ?></label>
145
+                       class="give-start-date-label"><?php esc_html_e('Start Date:', 'give'); ?></label>
146 146
 				<input type="text" id="start-date" name="start-date" class="give_datepicker"
147 147
                        value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy"/>
148
-				<label for="end-date" class="give-end-date-label"><?php esc_html_e( 'End Date:', 'give' ); ?></label>
148
+				<label for="end-date" class="give-end-date-label"><?php esc_html_e('End Date:', 'give'); ?></label>
149 149
 				<input type="text" id="end-date" name="end-date" class="give_datepicker"
150 150
                        value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy"/>
151
-				<input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Apply', 'give' ); ?>"/>
151
+				<input type="submit" class="button-secondary" value="<?php esc_attr_e('Apply', 'give'); ?>"/>
152 152
 			</span>
153
-			<?php if ( ! empty( $status ) ) : ?>
154
-                <input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>"/>
153
+			<?php if ( ! empty($status)) : ?>
154
+                <input type="hidden" name="status" value="<?php echo esc_attr($status); ?>"/>
155 155
 			<?php endif; ?>
156
-			<?php if ( ! empty( $start_date ) || ! empty( $end_date ) ) : ?>
157
-                <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>"
158
-                   class="button-secondary"><?php esc_html_e( 'Clear Filter', 'give' ); ?></a>
156
+			<?php if ( ! empty($start_date) || ! empty($end_date)) : ?>
157
+                <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>"
158
+                   class="button-secondary"><?php esc_html_e('Clear Filter', 'give'); ?></a>
159 159
 			<?php endif; ?>
160
-			<?php $this->search_box( esc_html__( 'Search', 'give' ), 'give-payments' ); ?>
160
+			<?php $this->search_box(esc_html__('Search', 'give'), 'give-payments'); ?>
161 161
         </div>
162 162
 
163 163
 		<?php
@@ -174,18 +174,18 @@  discard block
 block discarded – undo
174 174
 	 *
175 175
 	 * @return void
176 176
 	 */
177
-	public function search_box( $text, $input_id ) {
178
-		if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
177
+	public function search_box($text, $input_id) {
178
+		if (empty($_REQUEST['s']) && ! $this->has_items()) {
179 179
 			return;
180 180
 		}
181 181
 
182
-		$input_id = $input_id . '-search-input';
182
+		$input_id = $input_id.'-search-input';
183 183
 
184
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
185
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
184
+		if ( ! empty($_REQUEST['orderby'])) {
185
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
186 186
 		}
187
-		if ( ! empty( $_REQUEST['order'] ) ) {
188
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
187
+		if ( ! empty($_REQUEST['order'])) {
188
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
189 189
 		}
190 190
 		?>
191 191
         <p class="search-box" role="search">
@@ -197,11 +197,11 @@  discard block
 block discarded – undo
197 197
 			 *
198 198
 			 * @since 1.7
199 199
 			 */
200
-			do_action( 'give_payment_history_search' );
200
+			do_action('give_payment_history_search');
201 201
 			?>
202 202
             <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
203 203
             <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
204
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?><br/>
204
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?><br/>
205 205
         </p>
206 206
 		<?php
207 207
 	}
@@ -215,52 +215,52 @@  discard block
 block discarded – undo
215 215
 	 */
216 216
 	public function get_views() {
217 217
 
218
-		$current         = isset( $_GET['status'] ) ? $_GET['status'] : '';
219
-		$total_count     = '&nbsp;<span class="count">(' . $this->total_count . ')</span>';
220
-		$complete_count  = '&nbsp;<span class="count">(' . $this->complete_count . ')</span>';
221
-		$cancelled_count = '&nbsp;<span class="count">(' . $this->cancelled_count . ')</span>';
222
-		$pending_count   = '&nbsp;<span class="count">(' . $this->pending_count . ')</span>';
223
-		$refunded_count  = '&nbsp;<span class="count">(' . $this->refunded_count . ')</span>';
224
-		$failed_count    = '&nbsp;<span class="count">(' . $this->failed_count . ')</span>';
225
-		$abandoned_count = '&nbsp;<span class="count">(' . $this->abandoned_count . ')</span>';
226
-		$revoked_count   = '&nbsp;<span class="count">(' . $this->revoked_count . ')</span>';
218
+		$current         = isset($_GET['status']) ? $_GET['status'] : '';
219
+		$total_count     = '&nbsp;<span class="count">('.$this->total_count.')</span>';
220
+		$complete_count  = '&nbsp;<span class="count">('.$this->complete_count.')</span>';
221
+		$cancelled_count = '&nbsp;<span class="count">('.$this->cancelled_count.')</span>';
222
+		$pending_count   = '&nbsp;<span class="count">('.$this->pending_count.')</span>';
223
+		$refunded_count  = '&nbsp;<span class="count">('.$this->refunded_count.')</span>';
224
+		$failed_count    = '&nbsp;<span class="count">('.$this->failed_count.')</span>';
225
+		$abandoned_count = '&nbsp;<span class="count">('.$this->abandoned_count.')</span>';
226
+		$revoked_count   = '&nbsp;<span class="count">('.$this->revoked_count.')</span>';
227 227
 
228 228
 		$views = array(
229
-			'all'       => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array(
229
+			'all'       => sprintf('<a href="%s"%s>%s</a>', remove_query_arg(array(
230 230
 				'status',
231 231
 				'paged',
232
-			) ), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__( 'All', 'give' ) . $total_count ),
233
-			'publish'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
232
+			)), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__('All', 'give').$total_count),
233
+			'publish'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
234 234
 				'status' => 'publish',
235 235
 				'paged'  => false,
236
-			) ) ), $current === 'publish' ? ' class="current"' : '', esc_html__( 'Completed', 'give' ) . $complete_count ),
237
-			'pending'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
236
+			))), $current === 'publish' ? ' class="current"' : '', esc_html__('Completed', 'give').$complete_count),
237
+			'pending'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
238 238
 				'status' => 'pending',
239 239
 				'paged'  => false,
240
-			) ) ), $current === 'pending' ? ' class="current"' : '', esc_html__( 'Pending', 'give' ) . $pending_count ),
241
-			'refunded'  => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
240
+			))), $current === 'pending' ? ' class="current"' : '', esc_html__('Pending', 'give').$pending_count),
241
+			'refunded'  => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
242 242
 				'status' => 'refunded',
243 243
 				'paged'  => false,
244
-			) ) ), $current === 'refunded' ? ' class="current"' : '', esc_html__( 'Refunded', 'give' ) . $refunded_count ),
245
-			'revoked'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
244
+			))), $current === 'refunded' ? ' class="current"' : '', esc_html__('Refunded', 'give').$refunded_count),
245
+			'revoked'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
246 246
 				'status' => 'revoked',
247 247
 				'paged'  => false,
248
-			) ) ), $current === 'revoked' ? ' class="current"' : '', esc_html__( 'Revoked', 'give' ) . $revoked_count ),
249
-			'failed'    => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
248
+			))), $current === 'revoked' ? ' class="current"' : '', esc_html__('Revoked', 'give').$revoked_count),
249
+			'failed'    => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
250 250
 				'status' => 'failed',
251 251
 				'paged'  => false,
252
-			) ) ), $current === 'failed' ? ' class="current"' : '', esc_html__( 'Failed', 'give' ) . $failed_count ),
253
-			'cancelled' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
252
+			))), $current === 'failed' ? ' class="current"' : '', esc_html__('Failed', 'give').$failed_count),
253
+			'cancelled' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
254 254
 				'status' => 'cancelled',
255 255
 				'paged'  => false,
256
-			) ) ), $current === 'cancelled' ? ' class="current"' : '', esc_html__( 'Cancelled', 'give' ) . $cancelled_count ),
257
-			'abandoned' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
256
+			))), $current === 'cancelled' ? ' class="current"' : '', esc_html__('Cancelled', 'give').$cancelled_count),
257
+			'abandoned' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
258 258
 				'status' => 'abandoned',
259 259
 				'paged'  => false,
260
-			) ) ), $current === 'abandoned' ? ' class="current"' : '', esc_html__( 'Abandoned', 'give' ) . $abandoned_count ),
260
+			))), $current === 'abandoned' ? ' class="current"' : '', esc_html__('Abandoned', 'give').$abandoned_count),
261 261
 		);
262 262
 
263
-		return apply_filters( 'give_payments_table_views', $views );
263
+		return apply_filters('give_payments_table_views', $views);
264 264
 	}
265 265
 
266 266
 	/**
@@ -273,15 +273,15 @@  discard block
 block discarded – undo
273 273
 	public function get_columns() {
274 274
 		$columns = array(
275 275
 			'cb'            => '<input type="checkbox" />', // Render a checkbox instead of text.
276
-			'donation'      => esc_html__( 'Donation', 'give' ),
277
-			'donation_form' => esc_html__( 'Donation Form', 'give' ),
278
-			'status'        => esc_html__( 'Status', 'give' ),
279
-			'date'          => esc_html__( 'Date', 'give' ),
280
-			'amount'        => esc_html__( 'Amount', 'give' ),
281
-			'details'       => esc_html__( 'Details', 'give' ),
276
+			'donation'      => esc_html__('Donation', 'give'),
277
+			'donation_form' => esc_html__('Donation Form', 'give'),
278
+			'status'        => esc_html__('Status', 'give'),
279
+			'date'          => esc_html__('Date', 'give'),
280
+			'amount'        => esc_html__('Amount', 'give'),
281
+			'details'       => esc_html__('Details', 'give'),
282 282
 		);
283 283
 
284
-		return apply_filters( 'give_payments_table_columns', $columns );
284
+		return apply_filters('give_payments_table_columns', $columns);
285 285
 	}
286 286
 
287 287
 	/**
@@ -293,14 +293,14 @@  discard block
 block discarded – undo
293 293
 	 */
294 294
 	public function get_sortable_columns() {
295 295
 		$columns = array(
296
-			'donation'      => array( 'ID', true ),
297
-			'donation_form' => array( 'donation_form', false ),
298
-			'status'        => array( 'status', false ),
299
-			'amount'        => array( 'amount', false ),
300
-			'date'          => array( 'date', false ),
296
+			'donation'      => array('ID', true),
297
+			'donation_form' => array('donation_form', false),
298
+			'status'        => array('status', false),
299
+			'amount'        => array('amount', false),
300
+			'date'          => array('date', false),
301 301
 		);
302 302
 
303
-		return apply_filters( 'give_payments_table_sortable_columns', $columns );
303
+		return apply_filters('give_payments_table_sortable_columns', $columns);
304 304
 	}
305 305
 
306 306
 	/**
@@ -326,65 +326,65 @@  discard block
 block discarded – undo
326 326
 	 *
327 327
 	 * @return string Column Name
328 328
 	 */
329
-	public function column_default( $payment, $column_name ) {
329
+	public function column_default($payment, $column_name) {
330 330
 
331
-		$single_donation_url = esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details' ) ) );
332
-		$row_actions         = $this->get_row_actions( $payment );
331
+		$single_donation_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details')));
332
+		$row_actions         = $this->get_row_actions($payment);
333 333
 
334
-		switch ( $column_name ) {
334
+		switch ($column_name) {
335 335
 			case 'donation' :
336 336
 				$value = sprintf(
337 337
 					'<a href="%1$s" data-tooltip="%2$s">#%3$s</a>&nbsp;%4$s&nbsp;%5$s<br>',
338 338
 					$single_donation_url,
339
-					sprintf( esc_attr__( 'View Donation %s', 'give' ), $payment->ID ),
339
+					sprintf(esc_attr__('View Donation %s', 'give'), $payment->ID),
340 340
 					$payment->ID,
341
-					esc_html__( 'by', 'give' ),
342
-					$this->get_donor( $payment )
341
+					esc_html__('by', 'give'),
342
+					$this->get_donor($payment)
343 343
 				);
344
-				$value .= $this->get_donor_email( $payment );
345
-				$value .= $this->row_actions( $row_actions );
344
+				$value .= $this->get_donor_email($payment);
345
+				$value .= $this->row_actions($row_actions);
346 346
 				break;
347 347
 
348 348
 			case 'amount' :
349
-				$amount = ! empty( $payment->total ) ? $payment->total : 0;
350
-				$value  = give_currency_filter( give_format_amount( $amount ), give_get_payment_currency_code( $payment->ID ) );
349
+				$amount = ! empty($payment->total) ? $payment->total : 0;
350
+				$value  = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID));
351 351
 				break;
352 352
 
353 353
 			case 'donation_form' :
354
-				$form_title = empty( $payment->form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $payment->form_id ) : $payment->form_title;
355
-				$value      = '<a href="' . admin_url( 'post.php?post=' . $payment->form_id . '&action=edit' ) . '">' . $form_title . '</a>';
356
-				$level      = give_get_payment_form_title( $payment->meta, true );
354
+				$form_title = empty($payment->form_title) ? sprintf(__('Untitled (#%s)', 'give'), $payment->form_id) : $payment->form_title;
355
+				$value      = '<a href="'.admin_url('post.php?post='.$payment->form_id.'&action=edit').'">'.$form_title.'</a>';
356
+				$level      = give_get_payment_form_title($payment->meta, true);
357 357
 
358
-				if ( ! empty( $level ) ) {
358
+				if ( ! empty($level)) {
359 359
 					$value .= $level;
360 360
 				}
361 361
 
362 362
 				break;
363 363
 
364 364
 			case 'date' :
365
-				$date  = strtotime( $payment->date );
366
-				$value = date_i18n( give_date_format(), $date );
365
+				$date  = strtotime($payment->date);
366
+				$value = date_i18n(give_date_format(), $date);
367 367
 				break;
368 368
 
369 369
 			case 'status' :
370
-				$value = $this->get_payment_status( $payment );
370
+				$value = $this->get_payment_status($payment);
371 371
 				break;
372 372
 
373 373
 			case 'details' :
374 374
 				$value = sprintf(
375 375
 					'<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>',
376 376
 					$single_donation_url,
377
-					sprintf( esc_attr__( 'View Donation %s', 'give' ), $payment->ID )
377
+					sprintf(esc_attr__('View Donation %s', 'give'), $payment->ID)
378 378
 				);
379 379
 				break;
380 380
 
381 381
 			default:
382
-				$value = isset( $payment->$column_name ) ? $payment->$column_name : '';
382
+				$value = isset($payment->$column_name) ? $payment->$column_name : '';
383 383
 				break;
384 384
 
385 385
 		}
386 386
 
387
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name );
387
+		return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name);
388 388
 	}
389 389
 
390 390
 	/**
@@ -397,17 +397,17 @@  discard block
 block discarded – undo
397 397
 	 *
398 398
 	 * @return string                Data shown in the Email column
399 399
 	 */
400
-	public function get_donor_email( $payment ) {
400
+	public function get_donor_email($payment) {
401 401
 
402
-		$email = give_get_payment_user_email( $payment->ID );
402
+		$email = give_get_payment_user_email($payment->ID);
403 403
 
404
-		if ( empty( $email ) ) {
405
-			$email = esc_html__( '(unknown)', 'give' );
404
+		if (empty($email)) {
405
+			$email = esc_html__('(unknown)', 'give');
406 406
 		}
407 407
 
408
-		$value = '<a href="mailto:' . $email . '" data-tooltip="' . esc_attr__( 'Email donor', 'give' ) . '">' . $email . '</a>';
408
+		$value = '<a href="mailto:'.$email.'" data-tooltip="'.esc_attr__('Email donor', 'give').'">'.$email.'</a>';
409 409
 
410
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' );
410
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'email');
411 411
 	}
412 412
 
413 413
 	/**
@@ -419,18 +419,18 @@  discard block
 block discarded – undo
419 419
 	 *
420 420
 	 * @return array $actions
421 421
 	 */
422
-	function get_row_actions( $payment ) {
422
+	function get_row_actions($payment) {
423 423
 
424 424
 		$actions = array();
425
-		$email   = give_get_payment_user_email( $payment->ID );
425
+		$email   = give_get_payment_user_email($payment->ID);
426 426
 
427 427
 		// Add search term string back to base URL.
428
-		$search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' );
429
-		if ( ! empty( $search_terms ) ) {
430
-			$this->base_url = add_query_arg( 's', $search_terms, $this->base_url );
428
+		$search_terms = (isset($_GET['s']) ? trim($_GET['s']) : '');
429
+		if ( ! empty($search_terms)) {
430
+			$this->base_url = add_query_arg('s', $search_terms, $this->base_url);
431 431
 		}
432 432
 
433
-		if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) {
433
+		if (give_is_payment_complete($payment->ID) && ! empty($email)) {
434 434
 
435 435
 			$actions['email_links'] = sprintf(
436 436
 				'<a href="%1$s" aria-label="%2$s">%3$s</a>',
@@ -444,8 +444,8 @@  discard block
 block discarded – undo
444 444
 					),
445 445
 					'give_payment_nonce'
446 446
 				),
447
-				sprintf( esc_attr__( 'Resend Donation %s Receipt', 'give' ), $payment->ID ),
448
-				esc_html__( 'Resend Receipt', 'give' )
447
+				sprintf(esc_attr__('Resend Donation %s Receipt', 'give'), $payment->ID),
448
+				esc_html__('Resend Receipt', 'give')
449 449
 			);
450 450
 
451 451
 		}
@@ -462,11 +462,11 @@  discard block
 block discarded – undo
462 462
 				),
463 463
 				'give_donation_nonce'
464 464
 			),
465
-			sprintf( esc_attr__( 'Delete Donation %s', 'give' ), $payment->ID ),
466
-			esc_html__( 'Delete', 'give' )
465
+			sprintf(esc_attr__('Delete Donation %s', 'give'), $payment->ID),
466
+			esc_html__('Delete', 'give')
467 467
 		);
468 468
 
469
-		return apply_filters( 'give_payment_row_actions', $actions, $payment );
469
+		return apply_filters('give_payment_row_actions', $actions, $payment);
470 470
 	}
471 471
 
472 472
 
@@ -480,10 +480,10 @@  discard block
 block discarded – undo
480 480
 	 *
481 481
 	 * @return string                Data shown in the Email column
482 482
 	 */
483
-	function get_payment_status( $payment ) {
484
-		$value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>';
485
-		if ( $payment->mode == 'test' ) {
486
-			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '">' . esc_html__( 'Test', 'give' ) . '</span>';
483
+	function get_payment_status($payment) {
484
+		$value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>';
485
+		if ($payment->mode == 'test') {
486
+			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'">'.esc_html__('Test', 'give').'</span>';
487 487
 		}
488 488
 
489 489
 		return $value;
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 	 *
500 500
 	 * @return string Displays a checkbox.
501 501
 	 */
502
-	public function column_cb( $payment ) {
502
+	public function column_cb($payment) {
503 503
 		return sprintf(
504 504
 			'<input type="checkbox" name="%1$s[]" value="%2$s" />',
505 505
 			'payment',
@@ -517,8 +517,8 @@  discard block
 block discarded – undo
517 517
 	 *
518 518
 	 * @return string Displays a checkbox.
519 519
 	 */
520
-	public function get_payment_id( $payment ) {
521
-		return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>';
520
+	public function get_payment_id($payment) {
521
+		return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>';
522 522
 	}
523 523
 
524 524
 	/**
@@ -531,19 +531,19 @@  discard block
 block discarded – undo
531 531
 	 *
532 532
 	 * @return string Data shown in the User column
533 533
 	 */
534
-	public function get_donor( $payment ) {
534
+	public function get_donor($payment) {
535 535
 
536
-		$customer_id = give_get_payment_customer_id( $payment->ID );
536
+		$customer_id = give_get_payment_customer_id($payment->ID);
537 537
 
538
-		if ( ! empty( $customer_id ) ) {
539
-			$customer = new Give_Customer( $customer_id );
540
-			$value    = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id" ) ) . '">' . $customer->name . '</a>';
538
+		if ( ! empty($customer_id)) {
539
+			$customer = new Give_Customer($customer_id);
540
+			$value    = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id")).'">'.$customer->name.'</a>';
541 541
 		} else {
542
-			$email = give_get_payment_user_email( $payment->ID );
543
-			$value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . esc_html__( '(donor missing)', 'give' ) . '</a>';
542
+			$email = give_get_payment_user_email($payment->ID);
543
+			$value = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.esc_html__('(donor missing)', 'give').'</a>';
544 544
 		}
545 545
 
546
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' );
546
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor');
547 547
 	}
548 548
 
549 549
 	/**
@@ -555,18 +555,18 @@  discard block
 block discarded – undo
555 555
 	 */
556 556
 	public function get_bulk_actions() {
557 557
 		$actions = array(
558
-			'delete'               => esc_html__( 'Delete', 'give' ),
559
-			'set-status-publish'   => esc_html__( 'Set To Completed', 'give' ),
560
-			'set-status-pending'   => esc_html__( 'Set To Pending', 'give' ),
561
-			'set-status-refunded'  => esc_html__( 'Set To Refunded', 'give' ),
562
-			'set-status-revoked'   => esc_html__( 'Set To Revoked', 'give' ),
563
-			'set-status-failed'    => esc_html__( 'Set To Failed', 'give' ),
564
-			'set-status-cancelled' => esc_html__( 'Set To Cancelled', 'give' ),
565
-			'set-status-abandoned' => esc_html__( 'Set To Abandoned', 'give' ),
566
-			'resend-receipt'       => esc_html__( 'Resend Email Receipts', 'give' ),
558
+			'delete'               => esc_html__('Delete', 'give'),
559
+			'set-status-publish'   => esc_html__('Set To Completed', 'give'),
560
+			'set-status-pending'   => esc_html__('Set To Pending', 'give'),
561
+			'set-status-refunded'  => esc_html__('Set To Refunded', 'give'),
562
+			'set-status-revoked'   => esc_html__('Set To Revoked', 'give'),
563
+			'set-status-failed'    => esc_html__('Set To Failed', 'give'),
564
+			'set-status-cancelled' => esc_html__('Set To Cancelled', 'give'),
565
+			'set-status-abandoned' => esc_html__('Set To Abandoned', 'give'),
566
+			'resend-receipt'       => esc_html__('Resend Email Receipts', 'give'),
567 567
 		);
568 568
 
569
-		return apply_filters( 'give_payments_table_bulk_actions', $actions );
569
+		return apply_filters('give_payments_table_bulk_actions', $actions);
570 570
 	}
571 571
 
572 572
 	/**
@@ -577,59 +577,59 @@  discard block
 block discarded – undo
577 577
 	 * @return void
578 578
 	 */
579 579
 	public function process_bulk_action() {
580
-		$ids    = isset( $_GET['payment'] ) ? $_GET['payment'] : false;
580
+		$ids    = isset($_GET['payment']) ? $_GET['payment'] : false;
581 581
 		$action = $this->current_action();
582 582
 
583
-		if ( ! is_array( $ids ) ) {
584
-			$ids = array( $ids );
583
+		if ( ! is_array($ids)) {
584
+			$ids = array($ids);
585 585
 		}
586 586
 
587
-		if ( empty( $action ) ) {
587
+		if (empty($action)) {
588 588
 			return;
589 589
 		}
590 590
 
591
-		foreach ( $ids as $id ) {
591
+		foreach ($ids as $id) {
592 592
 
593 593
 			// Detect when a bulk action is being triggered.
594
-			switch ( $this->current_action() ) {
594
+			switch ($this->current_action()) {
595 595
 
596 596
 				case'delete':
597
-					give_delete_purchase( $id );
597
+					give_delete_purchase($id);
598 598
 					break;
599 599
 
600 600
 				case 'set-status-publish':
601
-					give_update_payment_status( $id, 'publish' );
601
+					give_update_payment_status($id, 'publish');
602 602
 					break;
603 603
 
604 604
 				case 'set-status-pending':
605
-					give_update_payment_status( $id, 'pending' );
605
+					give_update_payment_status($id, 'pending');
606 606
 					break;
607 607
 
608 608
 				case 'set-status-refunded':
609
-					give_update_payment_status( $id, 'refunded' );
609
+					give_update_payment_status($id, 'refunded');
610 610
 					break;
611 611
 				case 'set-status-revoked':
612
-					give_update_payment_status( $id, 'revoked' );
612
+					give_update_payment_status($id, 'revoked');
613 613
 					break;
614 614
 
615 615
 				case 'set-status-failed':
616
-					give_update_payment_status( $id, 'failed' );
616
+					give_update_payment_status($id, 'failed');
617 617
 					break;
618 618
 
619 619
 				case 'set-status-cancelled':
620
-					give_update_payment_status( $id, 'cancelled' );
620
+					give_update_payment_status($id, 'cancelled');
621 621
 					break;
622 622
 
623 623
 				case 'set-status-abandoned':
624
-					give_update_payment_status( $id, 'abandoned' );
624
+					give_update_payment_status($id, 'abandoned');
625 625
 					break;
626 626
 
627 627
 				case 'set-status-preapproval':
628
-					give_update_payment_status( $id, 'preapproval' );
628
+					give_update_payment_status($id, 'preapproval');
629 629
 					break;
630 630
 
631 631
 				case 'resend-receipt':
632
-					give_email_donation_receipt( $id, false );
632
+					give_email_donation_receipt($id, false);
633 633
 					break;
634 634
 			}
635 635
 
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 			 * @param int    $id             The ID of the payment.
642 642
 			 * @param string $current_action The action that is being triggered.
643 643
 			 */
644
-			do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() );
644
+			do_action('give_payments_table_do_bulk_action', $id, $this->current_action());
645 645
 		}
646 646
 
647 647
 	}
@@ -657,27 +657,27 @@  discard block
 block discarded – undo
657 657
 
658 658
 		$args = array();
659 659
 
660
-		if ( isset( $_GET['user'] ) ) {
661
-			$args['user'] = urldecode( $_GET['user'] );
662
-		} elseif ( isset( $_GET['s'] ) ) {
663
-			$is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false;
664
-			if ( $is_user ) {
665
-				$args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) );
666
-				unset( $args['s'] );
660
+		if (isset($_GET['user'])) {
661
+			$args['user'] = urldecode($_GET['user']);
662
+		} elseif (isset($_GET['s'])) {
663
+			$is_user = strpos($_GET['s'], strtolower('user:')) !== false;
664
+			if ($is_user) {
665
+				$args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s']))));
666
+				unset($args['s']);
667 667
 			} else {
668
-				$args['s'] = sanitize_text_field( $_GET['s'] );
668
+				$args['s'] = sanitize_text_field($_GET['s']);
669 669
 			}
670 670
 		}
671 671
 
672
-		if ( ! empty( $_GET['start-date'] ) ) {
673
-			$args['start-date'] = urldecode( $_GET['start-date'] );
672
+		if ( ! empty($_GET['start-date'])) {
673
+			$args['start-date'] = urldecode($_GET['start-date']);
674 674
 		}
675 675
 
676
-		if ( ! empty( $_GET['end-date'] ) ) {
677
-			$args['end-date'] = urldecode( $_GET['end-date'] );
676
+		if ( ! empty($_GET['end-date'])) {
677
+			$args['end-date'] = urldecode($_GET['end-date']);
678 678
 		}
679 679
 
680
-		$payment_count         = give_count_payments( $args );
680
+		$payment_count         = give_count_payments($args);
681 681
 		$this->complete_count  = $payment_count->publish;
682 682
 		$this->pending_count   = $payment_count->pending;
683 683
 		$this->refunded_count  = $payment_count->refunded;
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 		$this->cancelled_count = $payment_count->cancelled;
687 687
 		$this->abandoned_count = $payment_count->abandoned;
688 688
 
689
-		foreach ( $payment_count as $count ) {
689
+		foreach ($payment_count as $count) {
690 690
 			$this->total_count += $count;
691 691
 		}
692 692
 	}
@@ -701,26 +701,26 @@  discard block
 block discarded – undo
701 701
 	public function payments_data() {
702 702
 
703 703
 		$per_page   = $this->per_page;
704
-		$orderby    = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID';
705
-		$order      = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC';
706
-		$user       = isset( $_GET['user'] ) ? $_GET['user'] : null;
707
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys();
708
-		$meta_key   = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null;
709
-		$year       = isset( $_GET['year'] ) ? $_GET['year'] : null;
710
-		$month      = isset( $_GET['m'] ) ? $_GET['m'] : null;
711
-		$day        = isset( $_GET['day'] ) ? $_GET['day'] : null;
712
-		$search     = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null;
713
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
714
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date;
715
-
716
-		if ( ! empty( $search ) ) {
704
+		$orderby    = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID';
705
+		$order      = isset($_GET['order']) ? $_GET['order'] : 'DESC';
706
+		$user       = isset($_GET['user']) ? $_GET['user'] : null;
707
+		$status     = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys();
708
+		$meta_key   = isset($_GET['meta_key']) ? $_GET['meta_key'] : null;
709
+		$year       = isset($_GET['year']) ? $_GET['year'] : null;
710
+		$month      = isset($_GET['m']) ? $_GET['m'] : null;
711
+		$day        = isset($_GET['day']) ? $_GET['day'] : null;
712
+		$search     = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null;
713
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
714
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date;
715
+
716
+		if ( ! empty($search)) {
717 717
 			$status = 'any'; // Force all payment statuses when searching.
718 718
 		}
719 719
 
720 720
 		$args = array(
721 721
 			'output'     => 'payments',
722 722
 			'number'     => $per_page,
723
-			'page'       => isset( $_GET['paged'] ) ? $_GET['paged'] : null,
723
+			'page'       => isset($_GET['paged']) ? $_GET['paged'] : null,
724 724
 			'orderby'    => $orderby,
725 725
 			'order'      => $order,
726 726
 			'user'       => $user,
@@ -734,12 +734,12 @@  discard block
 block discarded – undo
734 734
 			'end_date'   => $end_date,
735 735
 		);
736 736
 
737
-		if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) {
737
+		if (is_string($search) && false !== strpos($search, 'txn:')) {
738 738
 			$args['search_in_notes'] = true;
739
-			$args['s']               = trim( str_replace( 'txn:', '', $args['s'] ) );
739
+			$args['s']               = trim(str_replace('txn:', '', $args['s']));
740 740
 		}
741 741
 
742
-		$p_query = new Give_Payments_Query( $args );
742
+		$p_query = new Give_Payments_Query($args);
743 743
 
744 744
 		return $p_query->get_payments();
745 745
 
@@ -759,17 +759,17 @@  discard block
 block discarded – undo
759 759
 	 */
760 760
 	public function prepare_items() {
761 761
 
762
-		wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) );
762
+		wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's'));
763 763
 
764 764
 		$columns  = $this->get_columns();
765 765
 		$hidden   = array(); // No hidden columns.
766 766
 		$sortable = $this->get_sortable_columns();
767 767
 		$data     = $this->payments_data();
768
-		$status   = isset( $_GET['status'] ) ? $_GET['status'] : 'any';
768
+		$status   = isset($_GET['status']) ? $_GET['status'] : 'any';
769 769
 
770
-		$this->_column_headers = array( $columns, $hidden, $sortable );
770
+		$this->_column_headers = array($columns, $hidden, $sortable);
771 771
 
772
-		switch ( $status ) {
772
+		switch ($status) {
773 773
 			case 'publish':
774 774
 				$total_items = $this->complete_count;
775 775
 				break;
@@ -796,19 +796,19 @@  discard block
 block discarded – undo
796 796
 				break;
797 797
 			default:
798 798
 				// Retrieve the count of the non-default-Give status.
799
-				$count       = wp_count_posts( 'give_payment' );
800
-				$total_items = isset( $count->{$status} ) ? $count->{$status} : 0;
799
+				$count       = wp_count_posts('give_payment');
800
+				$total_items = isset($count->{$status} ) ? $count->{$status} : 0;
801 801
 				break;
802 802
 		}
803 803
 
804 804
 		$this->items = $data;
805 805
 
806
-		$this->set_pagination_args( array(
806
+		$this->set_pagination_args(array(
807 807
 				'total_items' => $total_items,
808 808
 				// We have to calculate the total number of items.
809 809
 				'per_page'    => $this->per_page,
810 810
 				// We have to determine how many items to show on a page.
811
-				'total_pages' => ceil( $total_items / $this->per_page ),
811
+				'total_pages' => ceil($total_items / $this->per_page),
812 812
 				// We have to calculate the total number of pages.
813 813
 			)
814 814
 		);
Please login to merge, or discard this patch.