Completed
Pull Request — master (#779)
by
unknown
20:35
created
includes/ajax-functions.php 1 patch
Spacing   +91 added lines, -91 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
 
@@ -25,27 +25,27 @@  discard block
 block discarded – undo
25 25
 function give_test_ajax_works() {
26 26
 
27 27
 	// Check if the Airplane Mode plugin is installed
28
-	if ( class_exists( 'Airplane_Mode_Core' ) ) {
28
+	if (class_exists('Airplane_Mode_Core')) {
29 29
 
30 30
 		$airplane = Airplane_Mode_Core::getInstance();
31 31
 
32
-		if ( method_exists( $airplane, 'enabled' ) ) {
32
+		if (method_exists($airplane, 'enabled')) {
33 33
 
34
-			if ( $airplane->enabled() ) {
34
+			if ($airplane->enabled()) {
35 35
 				return true;
36 36
 			}
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
 	$works = true;
62 62
 
63
-	if ( is_wp_error( $ajax ) ) {
63
+	if (is_wp_error($ajax)) {
64 64
 
65 65
 		$works = false;
66 66
 
67 67
 	} else {
68 68
 
69
-		if ( empty( $ajax['response'] ) ) {
69
+		if (empty($ajax['response'])) {
70 70
 			$works = false;
71 71
 		}
72 72
 
73
-		if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) {
73
+		if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) {
74 74
 			$works = false;
75 75
 		}
76 76
 
77
-		if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) {
77
+		if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) {
78 78
 			$works = false;
79 79
 		}
80 80
 
81
-		if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) {
81
+		if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) {
82 82
 			$works = false;
83 83
 		}
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;
@@ -99,16 +99,16 @@  discard block
 block discarded – undo
99 99
  * @return string
100 100
  */
101 101
 function give_get_ajax_url() {
102
-	$scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin';
102
+	$scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin';
103 103
 
104 104
 	$current_url = give_get_current_page_url();
105
-	$ajax_url    = admin_url( 'admin-ajax.php', $scheme );
105
+	$ajax_url    = admin_url('admin-ajax.php', $scheme);
106 106
 
107
-	if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) {
108
-		$ajax_url = preg_replace( '/^http/', 'https', $ajax_url );
107
+	if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) {
108
+		$ajax_url = preg_replace('/^http/', 'https', $ajax_url);
109 109
 	}
110 110
 
111
-	return apply_filters( 'give_ajax_url', $ajax_url );
111
+	return apply_filters('give_ajax_url', $ajax_url);
112 112
 }
113 113
 
114 114
 /**
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
  * @return void
119 119
  */
120 120
 function give_load_checkout_login_fields() {
121
-	do_action( 'give_purchase_form_login_fields' );
121
+	do_action('give_purchase_form_login_fields');
122 122
 	give_die();
123 123
 }
124 124
 
125
-add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' );
125
+add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields');
126 126
 
127 127
 /**
128 128
  * Load Checkout Fields
@@ -131,22 +131,22 @@  discard block
 block discarded – undo
131 131
  * @return void
132 132
  */
133 133
 function give_load_checkout_fields() {
134
-	$form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : '';
134
+	$form_id = isset($_POST['form_id']) ? $_POST['form_id'] : '';
135 135
 
136 136
 	ob_start();
137 137
 
138
-	do_action( 'give_purchase_form_register_login_fields', $form_id );
138
+	do_action('give_purchase_form_register_login_fields', $form_id);
139 139
 
140 140
 	$fields = ob_get_clean();
141 141
 
142
-	wp_send_json( array(
143
-		'fields' => wp_json_encode( $fields ),
144
-		'submit' => wp_json_encode( give_checkout_button_purchase( $form_id ) ),
145
-	) );
142
+	wp_send_json(array(
143
+		'fields' => wp_json_encode($fields),
144
+		'submit' => wp_json_encode(give_checkout_button_purchase($form_id)),
145
+	));
146 146
 }
147 147
 
148
-add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' );
149
-add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' );
148
+add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields');
149
+add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields');
150 150
 
151 151
 /**
152 152
  * Get Form Title via AJAX (used only in WordPress Admin)
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
  * @return void
156 156
  */
157 157
 function give_ajax_get_form_title() {
158
-	if ( isset( $_POST['form_id'] ) ) {
159
-		$title = get_the_title( $_POST['form_id'] );
160
-		if ( $title ) {
158
+	if (isset($_POST['form_id'])) {
159
+		$title = get_the_title($_POST['form_id']);
160
+		if ($title) {
161 161
 			echo $title;
162 162
 		} else {
163 163
 			echo 'fail';
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
 	give_die();
167 167
 }
168 168
 
169
-add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' );
170
-add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' );
169
+add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title');
170
+add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title');
171 171
 
172 172
 /**
173 173
  * Retrieve a states drop down
@@ -177,23 +177,23 @@  discard block
 block discarded – undo
177 177
  */
178 178
 function give_ajax_get_states_field() {
179 179
 
180
-	if ( empty( $_POST['country'] ) ) {
180
+	if (empty($_POST['country'])) {
181 181
 		$_POST['country'] = give_get_country();
182 182
 	}
183
-	$states = give_get_states( $_POST['country'] );
183
+	$states = give_get_states($_POST['country']);
184 184
 
185
-	if ( ! empty( $states ) ) {
185
+	if ( ! empty($states)) {
186 186
 
187 187
 		$args = array(
188 188
 			'name'             => $_POST['field_name'],
189 189
 			'id'               => $_POST['field_name'],
190
-			'class'            => $_POST['field_name'] . '  give-select',
191
-			'options'          => give_get_states( $_POST['country'] ),
190
+			'class'            => $_POST['field_name'].'  give-select',
191
+			'options'          => give_get_states($_POST['country']),
192 192
 			'show_option_all'  => false,
193 193
 			'show_option_none' => false
194 194
 		);
195 195
 
196
-		$response = Give()->html->select( $args );
196
+		$response = Give()->html->select($args);
197 197
 
198 198
 	} else {
199 199
 
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 	give_die();
206 206
 }
207 207
 
208
-add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' );
209
-add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' );
208
+add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field');
209
+add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field');
210 210
 
211 211
 /**
212 212
  * Retrieve a states drop down
@@ -217,17 +217,17 @@  discard block
 block discarded – undo
217 217
 function give_ajax_form_search() {
218 218
 	global $wpdb;
219 219
 
220
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
220
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
221 221
 	$results = array();
222
-	if ( current_user_can( 'edit_give_forms' ) ) {
223
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" );
222
+	if (current_user_can('edit_give_forms')) {
223
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50");
224 224
 	} else {
225
-		$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" );
225
+		$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");
226 226
 	}
227 227
 
228
-	if ( $items ) {
228
+	if ($items) {
229 229
 
230
-		foreach ( $items as $item ) {
230
+		foreach ($items as $item) {
231 231
 
232 232
 			$results[] = array(
233 233
 				'id'   => $item->ID,
@@ -239,18 +239,18 @@  discard block
 block discarded – undo
239 239
 
240 240
 		$items[] = array(
241 241
 			'id'   => 0,
242
-			'name' => esc_html( 'No results found', 'give' )
242
+			'name' => esc_html('No results found', 'give')
243 243
 		);
244 244
 
245 245
 	}
246 246
 
247
-	echo json_encode( $results );
247
+	echo json_encode($results);
248 248
 
249 249
 	give_die();
250 250
 }
251 251
 
252
-add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' );
253
-add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' );
252
+add_action('wp_ajax_give_form_search', 'give_ajax_form_search');
253
+add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search');
254 254
 
255 255
 /**
256 256
  * Search the donors database via Ajax
@@ -261,21 +261,21 @@  discard block
 block discarded – undo
261 261
 function give_ajax_donor_search() {
262 262
 	global $wpdb;
263 263
 
264
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
264
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
265 265
 	$results = array();
266
-	if ( ! current_user_can( 'view_give_reports' ) ) {
266
+	if ( ! current_user_can('view_give_reports')) {
267 267
 		$donors = array();
268 268
 	} else {
269
-		$donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" );
269
+		$donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50");
270 270
 	}
271 271
 
272
-	if ( $donors ) {
272
+	if ($donors) {
273 273
 
274
-		foreach ( $donors as $donor ) {
274
+		foreach ($donors as $donor) {
275 275
 
276 276
 			$results[] = array(
277 277
 				'id'   => $donor->id,
278
-				'name' => $donor->name . '(' . $donor->email . ')'
278
+				'name' => $donor->name.'('.$donor->email.')'
279 279
 			);
280 280
 		}
281 281
 
@@ -283,17 +283,17 @@  discard block
 block discarded – undo
283 283
 
284 284
 		$donors[] = array(
285 285
 			'id'   => 0,
286
-			'name' => esc_html( 'No results found', 'give' )
286
+			'name' => esc_html('No results found', 'give')
287 287
 		);
288 288
 
289 289
 	}
290 290
 
291
-	echo json_encode( $results );
291
+	echo json_encode($results);
292 292
 
293 293
 	give_die();
294 294
 }
295 295
 
296
-add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' );
296
+add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search');
297 297
 
298 298
 
299 299
 /**
@@ -304,42 +304,42 @@  discard block
 block discarded – undo
304 304
  */
305 305
 function give_ajax_search_users() {
306 306
 
307
-	if ( current_user_can( 'manage_give_settings' ) ) {
307
+	if (current_user_can('manage_give_settings')) {
308 308
 
309
-		$search_query = trim( $_POST['user_name'] );
310
-		$exclude      = trim( $_POST['exclude'] );
309
+		$search_query = trim($_POST['user_name']);
310
+		$exclude      = trim($_POST['exclude']);
311 311
 
312 312
 		$get_users_args = array(
313 313
 			'number' => 9999,
314
-			'search' => $search_query . '*'
314
+			'search' => $search_query.'*'
315 315
 		);
316 316
 
317
-		if ( ! empty( $exclude ) ) {
318
-			$exclude_array             = explode( ',', $exclude );
317
+		if ( ! empty($exclude)) {
318
+			$exclude_array             = explode(',', $exclude);
319 319
 			$get_users_args['exclude'] = $exclude_array;
320 320
 		}
321 321
 
322
-		$get_users_args = apply_filters( 'give_search_users_args', $get_users_args );
322
+		$get_users_args = apply_filters('give_search_users_args', $get_users_args);
323 323
 
324
-		$found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search_query );
324
+		$found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search_query);
325 325
 
326 326
 		$user_list = '<ul>';
327
-		if ( $found_users ) {
328
-			foreach ( $found_users as $user ) {
329
-				$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>';
327
+		if ($found_users) {
328
+			foreach ($found_users as $user) {
329
+				$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>';
330 330
 			}
331 331
 		} else {
332
-			$user_list .= '<li>' . esc_html( 'No users found', 'give' ) . '</li>';
332
+			$user_list .= '<li>'.esc_html('No users found', 'give').'</li>';
333 333
 		}
334 334
 		$user_list .= '</ul>';
335 335
 
336
-		echo json_encode( array( 'results' => $user_list ) );
336
+		echo json_encode(array('results' => $user_list));
337 337
 
338 338
 	}
339 339
 	die();
340 340
 }
341 341
 
342
-add_action( 'wp_ajax_give_search_users', 'give_ajax_search_users' );
342
+add_action('wp_ajax_give_search_users', 'give_ajax_search_users');
343 343
 
344 344
 
345 345
 /**
@@ -350,32 +350,32 @@  discard block
 block discarded – undo
350 350
  */
351 351
 function give_check_for_form_price_variations() {
352 352
 
353
-	if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
354
-		die( '-1' );
353
+	if ( ! current_user_can('edit_give_forms', get_current_user_id())) {
354
+		die('-1');
355 355
 	}
356 356
 
357
-	$form_id = intval( $_POST['form_id'] );
358
-	$form    = get_post( $form_id );
357
+	$form_id = intval($_POST['form_id']);
358
+	$form    = get_post($form_id);
359 359
 
360
-	if ( 'give_forms' != $form->post_type ) {
361
-		die( '-2' );
360
+	if ('give_forms' != $form->post_type) {
361
+		die('-2');
362 362
 	}
363 363
 
364
-	if ( give_has_variable_prices( $form_id ) ) {
365
-		$variable_prices = give_get_variable_prices( $form_id );
364
+	if (give_has_variable_prices($form_id)) {
365
+		$variable_prices = give_get_variable_prices($form_id);
366 366
 
367
-		if ( $variable_prices ) {
367
+		if ($variable_prices) {
368 368
 			$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';
369 369
 
370
-			if ( isset( $_POST['all_prices'] ) ) {
371
-				$ajax_response .= '<option value="">' . esc_html( 'All Levels', 'give' ) . '</option>';
370
+			if (isset($_POST['all_prices'])) {
371
+				$ajax_response .= '<option value="">'.esc_html('All Levels', 'give').'</option>';
372 372
 			}
373 373
 
374
-			foreach ( $variable_prices as $key => $price ) {
374
+			foreach ($variable_prices as $key => $price) {
375 375
 
376
-				$level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'] ) );
376
+				$level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount']));
377 377
 				
378
-				$ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>';
378
+				$ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>';
379 379
 			}
380 380
 			$ajax_response .= '</select>';
381 381
 			echo $ajax_response;
@@ -386,4 +386,4 @@  discard block
 block discarded – undo
386 386
 	give_die();
387 387
 }
388 388
 
389
-add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' );
389
+add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations');
Please login to merge, or discard this patch.
includes/post-types.php 1 patch
Spacing   +135 added lines, -135 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,40 +23,40 @@  discard block
 block discarded – undo
23 23
 function give_setup_post_types() {
24 24
 
25 25
 	/** Give Forms Post Type */
26
-	$give_forms_singular = give_get_option( 'disable_forms_singular' ) !== 'on' ? true : false;
26
+	$give_forms_singular = give_get_option('disable_forms_singular') !== 'on' ? true : false;
27 27
 
28
-	$give_forms_archives = give_get_option( 'disable_forms_archives' ) !== 'on' ? true : false;
28
+	$give_forms_archives = give_get_option('disable_forms_archives') !== 'on' ? true : false;
29 29
 
30
-	$give_forms_slug = defined( 'GIVE_SLUG' ) ? GIVE_SLUG : 'donations';
30
+	$give_forms_slug = defined('GIVE_SLUG') ? GIVE_SLUG : 'donations';
31 31
 	//support for old 'GIVE_FORMS_SLUG' constant
32
-	if ( defined( 'GIVE_FORMS_SLUG' ) ) {
32
+	if (defined('GIVE_FORMS_SLUG')) {
33 33
 		$give_forms_slug = GIVE_FORMS_SLUG;
34 34
 	}
35 35
 
36
-	$give_forms_rewrite = defined( 'GIVE_DISABLE_FORMS_REWRITE' ) && GIVE_DISABLE_FORMS_REWRITE ? false : array(
36
+	$give_forms_rewrite = defined('GIVE_DISABLE_FORMS_REWRITE') && GIVE_DISABLE_FORMS_REWRITE ? false : array(
37 37
 		'slug'       => $give_forms_slug,
38 38
 		'with_front' => false
39 39
 	);
40 40
 
41
-	$give_forms_labels = apply_filters( 'give_forms_labels', array(
42
-		'name'               => esc_html( 'Donation %2$s', 'give' ),
41
+	$give_forms_labels = apply_filters('give_forms_labels', array(
42
+		'name'               => esc_html('Donation %2$s', 'give'),
43 43
 		'singular_name'      => '%1$s',
44
-		'add_new'            => esc_html( 'Add %1$s', 'give' ),
45
-		'add_new_item'       => esc_html( 'Add New Donation %1$s', 'give' ),
46
-		'edit_item'          => esc_html( 'Edit Donation %1$s', 'give' ),
47
-		'new_item'           => esc_html( 'New %1$s', 'give' ),
48
-		'all_items'          => esc_html( 'All %2$s', 'give' ),
49
-		'view_item'          => esc_html( 'View %1$s', 'give' ),
50
-		'search_items'       => esc_html( 'Search %2$s', 'give' ),
51
-		'not_found'          => esc_html( 'No %2$s found', 'give' ),
52
-		'not_found_in_trash' => esc_html( 'No %2$s found in Trash', 'give' ),
44
+		'add_new'            => esc_html('Add %1$s', 'give'),
45
+		'add_new_item'       => esc_html('Add New Donation %1$s', 'give'),
46
+		'edit_item'          => esc_html('Edit Donation %1$s', 'give'),
47
+		'new_item'           => esc_html('New %1$s', 'give'),
48
+		'all_items'          => esc_html('All %2$s', 'give'),
49
+		'view_item'          => esc_html('View %1$s', 'give'),
50
+		'search_items'       => esc_html('Search %2$s', 'give'),
51
+		'not_found'          => esc_html('No %2$s found', 'give'),
52
+		'not_found_in_trash' => esc_html('No %2$s found in Trash', 'give'),
53 53
 		'parent_item_colon'  => '',
54
-		'menu_name'          => apply_filters( 'give_menu_name', esc_html( 'Donations', 'give' ) ),
55
-		'name_admin_bar'     => apply_filters( 'give_name_admin_bar_name', esc_html( 'Donation Form', 'give' ) )
56
-	) );
54
+		'menu_name'          => apply_filters('give_menu_name', esc_html('Donations', 'give')),
55
+		'name_admin_bar'     => apply_filters('give_name_admin_bar_name', esc_html('Donation Form', 'give'))
56
+	));
57 57
 
58
-	foreach ( $give_forms_labels as $key => $value ) {
59
-		$give_forms_labels[ $key ] = sprintf( $value, give_get_forms_label_singular(), give_get_forms_label_plural() );
58
+	foreach ($give_forms_labels as $key => $value) {
59
+		$give_forms_labels[$key] = sprintf($value, give_get_forms_label_singular(), give_get_forms_label_plural());
60 60
 	}
61 61
 
62 62
 	//Default give_forms supports
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
 	);
70 70
 
71 71
 	//Has the user disabled the excerpt
72
-	if ( give_get_option( 'disable_forms_excerpt' ) === 'on' ) {
73
-		unset( $give_form_supports[2] );
72
+	if (give_get_option('disable_forms_excerpt') === 'on') {
73
+		unset($give_form_supports[2]);
74 74
 	}
75 75
 
76 76
 	//Has user disabled the featured image?
77
-	if ( give_get_option( 'disable_form_featured_img' ) === 'on' ) {
78
-		unset( $give_form_supports[1] );
79
-		remove_action( 'give_before_single_form_summary', 'give_show_form_images' );
77
+	if (give_get_option('disable_form_featured_img') === 'on') {
78
+		unset($give_form_supports[1]);
79
+		remove_action('give_before_single_form_summary', 'give_show_form_images');
80 80
 	}
81 81
 
82 82
 	$give_forms_args = array(
@@ -92,42 +92,42 @@  discard block
 block discarded – undo
92 92
 		'has_archive'        => $give_forms_archives,
93 93
 		'menu_icon'          => 'dashicons-give',
94 94
 		'hierarchical'       => false,
95
-		'supports'           => apply_filters( 'give_forms_supports', $give_form_supports ),
95
+		'supports'           => apply_filters('give_forms_supports', $give_form_supports),
96 96
 	);
97
-	register_post_type( 'give_forms', apply_filters( 'give_forms_post_type_args', $give_forms_args ) );
97
+	register_post_type('give_forms', apply_filters('give_forms_post_type_args', $give_forms_args));
98 98
 	
99 99
 	/** Payment Post Type */
100 100
 	$payment_labels = array(
101
-		'name'               => _x( 'Donations', 'post type general name', 'give' ),
102
-		'singular_name'      => _x( 'Donation', 'post type singular name', 'give' ),
103
-		'add_new'            => esc_html( 'Add New', 'give' ),
104
-		'add_new_item'       => esc_html( 'Add New Donation', 'give' ),
105
-		'edit_item'          => esc_html( 'Edit Donation', 'give' ),
106
-		'new_item'           => esc_html( 'New Donation', 'give' ),
107
-		'all_items'          => esc_html( 'All Donations', 'give' ),
108
-		'view_item'          => esc_html( 'View Donation', 'give' ),
109
-		'search_items'       => esc_html( 'Search Donations', 'give' ),
110
-		'not_found'          => esc_html( 'No Donations found', 'give' ),
111
-		'not_found_in_trash' => esc_html( 'No Donations found in Trash', 'give' ),
101
+		'name'               => _x('Donations', 'post type general name', 'give'),
102
+		'singular_name'      => _x('Donation', 'post type singular name', 'give'),
103
+		'add_new'            => esc_html('Add New', 'give'),
104
+		'add_new_item'       => esc_html('Add New Donation', 'give'),
105
+		'edit_item'          => esc_html('Edit Donation', 'give'),
106
+		'new_item'           => esc_html('New Donation', 'give'),
107
+		'all_items'          => esc_html('All Donations', 'give'),
108
+		'view_item'          => esc_html('View Donation', 'give'),
109
+		'search_items'       => esc_html('Search Donations', 'give'),
110
+		'not_found'          => esc_html('No Donations found', 'give'),
111
+		'not_found_in_trash' => esc_html('No Donations found in Trash', 'give'),
112 112
 		'parent_item_colon'  => '',
113
-		'menu_name'          => esc_html( 'Transactions', 'give' )
113
+		'menu_name'          => esc_html('Transactions', 'give')
114 114
 	);
115 115
 
116 116
 	$payment_args = array(
117
-		'labels'          => apply_filters( 'give_payment_labels', $payment_labels ),
117
+		'labels'          => apply_filters('give_payment_labels', $payment_labels),
118 118
 		'public'          => false,
119 119
 		'query_var'       => false,
120 120
 		'rewrite'         => false,
121 121
 		'map_meta_cap'    => true,
122 122
 		'capability_type' => 'give_payment',
123
-		'supports'        => array( 'title' ),
123
+		'supports'        => array('title'),
124 124
 		'can_export'      => true
125 125
 	);
126
-	register_post_type( 'give_payment', $payment_args );
126
+	register_post_type('give_payment', $payment_args);
127 127
 
128 128
 }
129 129
 
130
-add_action( 'init', 'give_setup_post_types', 1 );
130
+add_action('init', 'give_setup_post_types', 1);
131 131
 
132 132
 
133 133
 /**
@@ -140,32 +140,32 @@  discard block
 block discarded – undo
140 140
  */
141 141
 function give_setup_taxonomies() {
142 142
 
143
-	$slug = defined( 'GIVE_FORMS_SLUG' ) ? GIVE_FORMS_SLUG : 'donations';
143
+	$slug = defined('GIVE_FORMS_SLUG') ? GIVE_FORMS_SLUG : 'donations';
144 144
 
145 145
 	/** Categories */
146 146
 	$category_labels = array(
147 147
 		/* translators: %s: form singular label */
148
-		'name'              => sprintf( _x( '%s Categories', 'taxonomy general name', 'give' ), give_get_forms_label_singular() ),
149
-		'singular_name'     => _x( 'Category', 'taxonomy singular name', 'give' ),
150
-		'search_items'      => esc_html( 'Search Categories', 'give' ),
151
-		'all_items'         => esc_html( 'All Categories', 'give' ),
152
-		'parent_item'       => esc_html( 'Parent Category', 'give' ),
153
-		'parent_item_colon' => esc_html( 'Parent Category:', 'give' ),
154
-		'edit_item'         => esc_html( 'Edit Category', 'give' ),
155
-		'update_item'       => esc_html( 'Update Category', 'give' ),
148
+		'name'              => sprintf(_x('%s Categories', 'taxonomy general name', 'give'), give_get_forms_label_singular()),
149
+		'singular_name'     => _x('Category', 'taxonomy singular name', 'give'),
150
+		'search_items'      => esc_html('Search Categories', 'give'),
151
+		'all_items'         => esc_html('All Categories', 'give'),
152
+		'parent_item'       => esc_html('Parent Category', 'give'),
153
+		'parent_item_colon' => esc_html('Parent Category:', 'give'),
154
+		'edit_item'         => esc_html('Edit Category', 'give'),
155
+		'update_item'       => esc_html('Update Category', 'give'),
156 156
 		/* translators: %s: form singular label */
157
-		'add_new_item'      => sprintf( esc_html( 'Add New %s Category', 'give' ), give_get_forms_label_singular() ),
158
-		'new_item_name'     => esc_html( 'New Category Name', 'give' ),
159
-		'menu_name'         => esc_html( 'Categories', 'give' ),
157
+		'add_new_item'      => sprintf(esc_html('Add New %s Category', 'give'), give_get_forms_label_singular()),
158
+		'new_item_name'     => esc_html('New Category Name', 'give'),
159
+		'menu_name'         => esc_html('Categories', 'give'),
160 160
 	);
161 161
 
162
-	$category_args = apply_filters( 'give_forms_category_args', array(
162
+	$category_args = apply_filters('give_forms_category_args', array(
163 163
 			'hierarchical' => true,
164
-			'labels'       => apply_filters( 'give_forms_category_labels', $category_labels ),
164
+			'labels'       => apply_filters('give_forms_category_labels', $category_labels),
165 165
 			'show_ui'      => true,
166 166
 			'query_var'    => 'give_forms_category',
167 167
 			'rewrite'      => array(
168
-				'slug'         => $slug . '/category',
168
+				'slug'         => $slug.'/category',
169 169
 				'with_front'   => false,
170 170
 				'hierarchical' => true
171 171
 			),
@@ -179,36 +179,36 @@  discard block
 block discarded – undo
179 179
 	);
180 180
 
181 181
 	//Does the user want categories?
182
-	if ( give_get_option( 'enable_categories' ) == 'on' ) {
183
-		register_taxonomy( 'give_forms_category', array( 'give_forms' ), $category_args );
184
-		register_taxonomy_for_object_type( 'give_forms_category', 'give_forms' );
182
+	if (give_get_option('enable_categories') == 'on') {
183
+		register_taxonomy('give_forms_category', array('give_forms'), $category_args);
184
+		register_taxonomy_for_object_type('give_forms_category', 'give_forms');
185 185
 	}
186 186
 
187 187
 
188 188
 	/** Tags */
189 189
 	$tag_labels = array(
190 190
 		/* translators: %s: form singular label */
191
-		'name'                  => sprintf( _x( '%s Tags', 'taxonomy general name', 'give' ), give_get_forms_label_singular() ),
192
-		'singular_name'         => _x( 'Tag', 'taxonomy singular name', 'give' ),
193
-		'search_items'          => esc_html( 'Search Tags', 'give' ),
194
-		'all_items'             => esc_html( 'All Tags', 'give' ),
195
-		'parent_item'           => esc_html( 'Parent Tag', 'give' ),
196
-		'parent_item_colon'     => esc_html( 'Parent Tag:', 'give' ),
197
-		'edit_item'             => esc_html( 'Edit Tag', 'give' ),
198
-		'update_item'           => esc_html( 'Update Tag', 'give' ),
199
-		'add_new_item'          => esc_html( 'Add New Tag', 'give' ),
200
-		'new_item_name'         => esc_html( 'New Tag Name', 'give' ),
201
-		'menu_name'             => esc_html( 'Tags', 'give' ),
191
+		'name'                  => sprintf(_x('%s Tags', 'taxonomy general name', 'give'), give_get_forms_label_singular()),
192
+		'singular_name'         => _x('Tag', 'taxonomy singular name', 'give'),
193
+		'search_items'          => esc_html('Search Tags', 'give'),
194
+		'all_items'             => esc_html('All Tags', 'give'),
195
+		'parent_item'           => esc_html('Parent Tag', 'give'),
196
+		'parent_item_colon'     => esc_html('Parent Tag:', 'give'),
197
+		'edit_item'             => esc_html('Edit Tag', 'give'),
198
+		'update_item'           => esc_html('Update Tag', 'give'),
199
+		'add_new_item'          => esc_html('Add New Tag', 'give'),
200
+		'new_item_name'         => esc_html('New Tag Name', 'give'),
201
+		'menu_name'             => esc_html('Tags', 'give'),
202 202
 		/* translators: %s: form singular label */
203
-		'choose_from_most_used' => sprintf( esc_html( 'Choose from most used %s tags.', 'give' ), give_get_forms_label_singular() ),
203
+		'choose_from_most_used' => sprintf(esc_html('Choose from most used %s tags.', 'give'), give_get_forms_label_singular()),
204 204
 	);
205 205
 
206
-	$tag_args = apply_filters( 'give_forms_tag_args', array(
206
+	$tag_args = apply_filters('give_forms_tag_args', array(
207 207
 			'hierarchical' => false,
208
-			'labels'       => apply_filters( 'give_forms_tag_labels', $tag_labels ),
208
+			'labels'       => apply_filters('give_forms_tag_labels', $tag_labels),
209 209
 			'show_ui'      => true,
210 210
 			'query_var'    => 'give_forms_tag',
211
-			'rewrite'      => array( 'slug' => $slug . '/tag', 'with_front' => false, 'hierarchical' => true ),
211
+			'rewrite'      => array('slug' => $slug.'/tag', 'with_front' => false, 'hierarchical' => true),
212 212
 			'capabilities' => array(
213 213
 				'manage_terms' => 'manage_give_forms_terms',
214 214
 				'edit_terms'   => 'edit_give_forms_terms',
@@ -219,15 +219,15 @@  discard block
 block discarded – undo
219 219
 		)
220 220
 	);
221 221
 
222
-	if ( give_get_option( 'enable_tags' ) == 'on' ) {
223
-		register_taxonomy( 'give_forms_tag', array( 'give_forms' ), $tag_args );
224
-		register_taxonomy_for_object_type( 'give_forms_tag', 'give_forms' );
222
+	if (give_get_option('enable_tags') == 'on') {
223
+		register_taxonomy('give_forms_tag', array('give_forms'), $tag_args);
224
+		register_taxonomy_for_object_type('give_forms_tag', 'give_forms');
225 225
 	}
226 226
 
227 227
 
228 228
 }
229 229
 
230
-add_action( 'init', 'give_setup_taxonomies', 0 );
230
+add_action('init', 'give_setup_taxonomies', 0);
231 231
 
232 232
 
233 233
 /**
@@ -238,11 +238,11 @@  discard block
 block discarded – undo
238 238
  */
239 239
 function give_get_default_form_labels() {
240 240
 	$defaults = array(
241
-		'singular' => esc_html( 'Form', 'give' ),
242
-		'plural'   => esc_html( 'Forms', 'give' )
241
+		'singular' => esc_html('Form', 'give'),
242
+		'plural'   => esc_html('Forms', 'give')
243 243
 	);
244 244
 
245
-	return apply_filters( 'give_default_form_name', $defaults );
245
+	return apply_filters('give_default_form_name', $defaults);
246 246
 }
247 247
 
248 248
 /**
@@ -254,10 +254,10 @@  discard block
 block discarded – undo
254 254
  *
255 255
  * @return string $defaults['singular'] Singular label
256 256
  */
257
-function give_get_forms_label_singular( $lowercase = false ) {
257
+function give_get_forms_label_singular($lowercase = false) {
258 258
 	$defaults = give_get_default_form_labels();
259 259
 
260
-	return ( $lowercase ) ? strtolower( $defaults['singular'] ) : $defaults['singular'];
260
+	return ($lowercase) ? strtolower($defaults['singular']) : $defaults['singular'];
261 261
 }
262 262
 
263 263
 /**
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
  * @since 1.0
267 267
  * @return string $defaults['plural'] Plural label
268 268
  */
269
-function give_get_forms_label_plural( $lowercase = false ) {
269
+function give_get_forms_label_plural($lowercase = false) {
270 270
 	$defaults = give_get_default_form_labels();
271 271
 
272
-	return ( $lowercase ) ? strtolower( $defaults['plural'] ) : $defaults['plural'];
272
+	return ($lowercase) ? strtolower($defaults['plural']) : $defaults['plural'];
273 273
 }
274 274
 
275 275
 /**
@@ -281,12 +281,12 @@  discard block
 block discarded – undo
281 281
  *
282 282
  * @return string $title New placeholder text
283 283
  */
284
-function give_change_default_title( $title ) {
284
+function give_change_default_title($title) {
285 285
 	// If a frontend plugin uses this filter (check extensions before changing this function)
286
-	if ( ! is_admin() ) {
286
+	if ( ! is_admin()) {
287 287
 		$title = sprintf(
288 288
 			/* translators: %s: form singular label */
289
-			esc_html( 'Enter %s title here', 'give' ),
289
+			esc_html('Enter %s title here', 'give'),
290 290
 			give_get_forms_label_singular()
291 291
 		);
292 292
 
@@ -295,10 +295,10 @@  discard block
 block discarded – undo
295 295
 
296 296
 	$screen = get_current_screen();
297 297
 
298
-	if ( 'give_forms' == $screen->post_type ) {
298
+	if ('give_forms' == $screen->post_type) {
299 299
 		$title = sprintf(
300 300
 			/* translators: %s: form singular label */
301
-			esc_html( 'Enter %s title here', 'give' ),
301
+			esc_html('Enter %s title here', 'give'),
302 302
 			give_get_forms_label_singular()
303 303
 		);
304 304
 	}
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	return $title;
307 307
 }
308 308
 
309
-add_filter( 'enter_title_here', 'give_change_default_title' );
309
+add_filter('enter_title_here', 'give_change_default_title');
310 310
 
311 311
 /**
312 312
  * Registers Custom Post Statuses which are used by the Payments
@@ -316,50 +316,50 @@  discard block
 block discarded – undo
316 316
  */
317 317
 function give_register_post_type_statuses() {
318 318
 	// Payment Statuses
319
-	register_post_status( 'refunded', array(
320
-		'label'                     => _x( 'Refunded', 'Refunded payment status', 'give' ),
319
+	register_post_status('refunded', array(
320
+		'label'                     => _x('Refunded', 'Refunded payment status', 'give'),
321 321
 		'public'                    => true,
322 322
 		'exclude_from_search'       => false,
323 323
 		'show_in_admin_all_list'    => true,
324 324
 		'show_in_admin_status_list' => true,
325
-		'label_count'               => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give' )
326
-	) );
327
-	register_post_status( 'failed', array(
328
-		'label'                     => _x( 'Failed', 'Failed payment status', 'give' ),
325
+		'label_count'               => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give')
326
+	));
327
+	register_post_status('failed', array(
328
+		'label'                     => _x('Failed', 'Failed payment status', 'give'),
329 329
 		'public'                    => true,
330 330
 		'exclude_from_search'       => false,
331 331
 		'show_in_admin_all_list'    => true,
332 332
 		'show_in_admin_status_list' => true,
333
-		'label_count'               => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give' )
334
-	) );
335
-	register_post_status( 'revoked', array(
336
-		'label'                     => _x( 'Revoked', 'Revoked payment status', 'give' ),
333
+		'label_count'               => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give')
334
+	));
335
+	register_post_status('revoked', array(
336
+		'label'                     => _x('Revoked', 'Revoked payment status', 'give'),
337 337
 		'public'                    => true,
338 338
 		'exclude_from_search'       => false,
339 339
 		'show_in_admin_all_list'    => true,
340 340
 		'show_in_admin_status_list' => true,
341
-		'label_count'               => _n_noop( 'Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give' )
342
-	) );
343
-	register_post_status( 'cancelled', array(
344
-		'label'                     => _x( 'Cancelled', 'Cancelled payment status', 'give' ),
341
+		'label_count'               => _n_noop('Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give')
342
+	));
343
+	register_post_status('cancelled', array(
344
+		'label'                     => _x('Cancelled', 'Cancelled payment status', 'give'),
345 345
 		'public'                    => true,
346 346
 		'exclude_from_search'       => false,
347 347
 		'show_in_admin_all_list'    => true,
348 348
 		'show_in_admin_status_list' => true,
349
-		'label_count'               => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give' )
350
-	) );
351
-	register_post_status( 'abandoned', array(
352
-		'label'                     => _x( 'Abandoned', 'Abandoned payment status', 'give' ),
349
+		'label_count'               => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give')
350
+	));
351
+	register_post_status('abandoned', array(
352
+		'label'                     => _x('Abandoned', 'Abandoned payment status', 'give'),
353 353
 		'public'                    => true,
354 354
 		'exclude_from_search'       => false,
355 355
 		'show_in_admin_all_list'    => true,
356 356
 		'show_in_admin_status_list' => true,
357
-		'label_count'               => _n_noop( 'Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give' )
358
-	) );
357
+		'label_count'               => _n_noop('Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give')
358
+	));
359 359
 
360 360
 }
361 361
 
362
-add_action( 'init', 'give_register_post_type_statuses' );
362
+add_action('init', 'give_register_post_type_statuses');
363 363
 
364 364
 /**
365 365
  * Updated Messages
@@ -372,43 +372,43 @@  discard block
 block discarded – undo
372 372
  *
373 373
  * @return array $messages New post updated messages
374 374
  */
375
-function give_updated_messages( $messages ) {
375
+function give_updated_messages($messages) {
376 376
 	global $post, $post_ID;
377 377
 
378
-	$url1 = '<a href="' . get_permalink( $post_ID ) . '">';
378
+	$url1 = '<a href="'.get_permalink($post_ID).'">';
379 379
 	$url2 = give_get_forms_label_singular();
380 380
 	$url3 = '</a>';
381 381
 
382 382
 	$messages['give_forms'] = array(
383
-		1 => sprintf( __( '%2$s updated. %1$sView %2$s%3$s.', 'give' ), $url1, $url2, $url3 ),
384
-		4 => sprintf( __( '%2$s updated. %1$sView %2$s%3$s.', 'give' ), $url1, $url2, $url3 ),
385
-		6 => sprintf( __( '%2$s published. %1$sView %2$s%3$s.', 'give' ), $url1, $url2, $url3 ),
386
-		7 => sprintf( __( '%2$s saved. %1$sView %2$s%3$s.', 'give' ), $url1, $url2, $url3 ),
387
-		8 => sprintf( __( '%2$s submitted. %1$sView %2$s%3$s.', 'give' ), $url1, $url2, $url3 )
383
+		1 => sprintf(__('%2$s updated. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3),
384
+		4 => sprintf(__('%2$s updated. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3),
385
+		6 => sprintf(__('%2$s published. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3),
386
+		7 => sprintf(__('%2$s saved. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3),
387
+		8 => sprintf(__('%2$s submitted. %1$sView %2$s%3$s.', 'give'), $url1, $url2, $url3)
388 388
 	);
389 389
 
390 390
 	return $messages;
391 391
 }
392 392
 
393
-add_filter( 'post_updated_messages', 'give_updated_messages' );
393
+add_filter('post_updated_messages', 'give_updated_messages');
394 394
 
395 395
 
396 396
 /**
397 397
  * Setup Post Type Images
398 398
  */
399
-add_action( 'after_setup_theme', 'give_add_thumbnail_support', 10 );
399
+add_action('after_setup_theme', 'give_add_thumbnail_support', 10);
400 400
 
401 401
 /**
402 402
  * Ensure post thumbnail support is turned on
403 403
  */
404 404
 function give_add_thumbnail_support() {
405
-	if ( give_get_option( 'disable_form_featured_img' ) === 'on' ) {
405
+	if (give_get_option('disable_form_featured_img') === 'on') {
406 406
 		return;
407 407
 	}
408
-	if ( ! current_theme_supports( 'post-thumbnails' ) ) {
409
-		add_theme_support( 'post-thumbnails' );
408
+	if ( ! current_theme_supports('post-thumbnails')) {
409
+		add_theme_support('post-thumbnails');
410 410
 	}
411
-	add_post_type_support( 'give_forms', 'thumbnail' );
411
+	add_post_type_support('give_forms', 'thumbnail');
412 412
 }
413 413
 
414 414
 /**
@@ -420,19 +420,19 @@  discard block
 block discarded – undo
420 420
 function give_widgets_init() {
421 421
 
422 422
 	//Single Give Forms (disabled if single turned off in settings)
423
-	if ( give_get_option( 'disable_forms_singular' ) !== 'on' && give_get_option( 'disable_form_sidebar' ) !== 'on' ) {
423
+	if (give_get_option('disable_forms_singular') !== 'on' && give_get_option('disable_form_sidebar') !== 'on') {
424 424
 
425
-		register_sidebar( apply_filters( 'give_forms_single_sidebar', array(
426
-			'name'          => esc_html( 'Give Single Form Sidebar', 'give' ),
425
+		register_sidebar(apply_filters('give_forms_single_sidebar', array(
426
+			'name'          => esc_html('Give Single Form Sidebar', 'give'),
427 427
 			'id'            => 'give-forms-sidebar',
428
-			'description'   => esc_html( 'Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give' ),
428
+			'description'   => esc_html('Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give'),
429 429
 			'before_widget' => '<div id="%1$s" class="widget %2$s">',
430 430
 			'after_widget'  => '</div>',
431 431
 			'before_title'  => '<h3 class="widgettitle widget-title">',
432 432
 			'after_title'   => '</h3>',
433
-		) ) );
433
+		)));
434 434
 
435 435
 	}
436 436
 }
437 437
 
438
-add_action( 'widgets_init', 'give_widgets_init', 999 );
438
+add_action('widgets_init', 'give_widgets_init', 999);
Please login to merge, or discard this patch.
includes/scripts.php 1 patch
Spacing   +137 added lines, -137 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
 
@@ -28,94 +28,94 @@  discard block
 block discarded – undo
28 28
 
29 29
 	global $give_options;
30 30
 
31
-	$js_dir         = GIVE_PLUGIN_URL . 'assets/js/frontend/';
32
-	$js_plugins     = GIVE_PLUGIN_URL . 'assets/js/plugins/';
33
-	$scripts_footer = ( give_get_option( 'scripts_footer' ) == 'on' ) ? true : false;
31
+	$js_dir         = GIVE_PLUGIN_URL.'assets/js/frontend/';
32
+	$js_plugins     = GIVE_PLUGIN_URL.'assets/js/plugins/';
33
+	$scripts_footer = (give_get_option('scripts_footer') == 'on') ? true : false;
34 34
 
35 35
 	// Use minified libraries if SCRIPT_DEBUG is turned off
36
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
36
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
37 37
 
38 38
 	//Localize / PHP to AJAX vars
39
-	$localize_give_checkout = apply_filters( 'give_global_script_vars', array(
39
+	$localize_give_checkout = apply_filters('give_global_script_vars', array(
40 40
 		'ajaxurl'             => give_get_ajax_url(),
41
-		'checkout_nonce'      => wp_create_nonce( 'give_checkout_nonce' ),
42
-		'currency_sign'       => give_currency_filter( '' ),
41
+		'checkout_nonce'      => wp_create_nonce('give_checkout_nonce'),
42
+		'currency_sign'       => give_currency_filter(''),
43 43
 		'currency_pos'        => give_get_currency_position(),
44
-		'thousands_separator' => isset( $give_options['thousands_separator'] ) ? $give_options['thousands_separator'] : ',',
45
-		'decimal_separator'   => isset( $give_options['decimal_separator'] ) ? $give_options['decimal_separator'] : '.',
46
-		'no_gateway'          => esc_html( 'Please select a payment method.', 'give' ),
47
-		'bad_minimum'         => esc_html( 'The minimum donation amount for this form is', 'give' ),
48
-		'general_loading'     => esc_html( 'Loading...', 'give' ),
49
-		'purchase_loading'    => esc_html( 'Please Wait...', 'give' ),
50
-		'number_decimals'  => apply_filters( 'give_format_amount_decimals', 2 ),
44
+		'thousands_separator' => isset($give_options['thousands_separator']) ? $give_options['thousands_separator'] : ',',
45
+		'decimal_separator'   => isset($give_options['decimal_separator']) ? $give_options['decimal_separator'] : '.',
46
+		'no_gateway'          => esc_html('Please select a payment method.', 'give'),
47
+		'bad_minimum'         => esc_html('The minimum donation amount for this form is', 'give'),
48
+		'general_loading'     => esc_html('Loading...', 'give'),
49
+		'purchase_loading'    => esc_html('Please Wait...', 'give'),
50
+		'number_decimals'  => apply_filters('give_format_amount_decimals', 2),
51 51
 		'give_version'        => GIVE_VERSION
52
-	) );
53
-	$localize_give_ajax     = apply_filters( 'give_global_ajax_vars', array(
52
+	));
53
+	$localize_give_ajax = apply_filters('give_global_ajax_vars', array(
54 54
 		'ajaxurl'          => give_get_ajax_url(),
55
-		'loading'          => esc_html( 'Loading', 'give' ),
55
+		'loading'          => esc_html('Loading', 'give'),
56 56
 		// General loading message
57
-		'select_option'    => esc_html( 'Please select an option', 'give' ),
57
+		'select_option'    => esc_html('Please select an option', 'give'),
58 58
 		// Variable pricing error with multi-purchase option enabled
59
-		'default_gateway'  => give_get_default_gateway( null ),
60
-		'permalinks'       => get_option( 'permalink_structure' ) ? '1' : '0',
61
-		'number_decimals'  => apply_filters( 'give_format_amount_decimals', 2 )
62
-	) );
59
+		'default_gateway'  => give_get_default_gateway(null),
60
+		'permalinks'       => get_option('permalink_structure') ? '1' : '0',
61
+		'number_decimals'  => apply_filters('give_format_amount_decimals', 2)
62
+	));
63 63
 
64 64
 	//DEBUG is On
65
-	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
65
+	if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
66 66
 
67
-		if ( give_is_cc_verify_enabled() ) {
68
-			wp_register_script( 'give-cc-validator', $js_plugins . 'jquery.payment' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
69
-			wp_enqueue_script( 'give-cc-validator' );
67
+		if (give_is_cc_verify_enabled()) {
68
+			wp_register_script('give-cc-validator', $js_plugins.'jquery.payment'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
69
+			wp_enqueue_script('give-cc-validator');
70 70
 		}
71 71
 
72
-		wp_register_script( 'give-float-labels', $js_plugins . 'float-labels' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
73
-		wp_enqueue_script( 'give-float-labels' );
72
+		wp_register_script('give-float-labels', $js_plugins.'float-labels'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
73
+		wp_enqueue_script('give-float-labels');
74 74
 
75
-		wp_register_script( 'give-blockui', $js_plugins . 'jquery.blockUI' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
76
-		wp_enqueue_script( 'give-blockui' );
75
+		wp_register_script('give-blockui', $js_plugins.'jquery.blockUI'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
76
+		wp_enqueue_script('give-blockui');
77 77
 
78
-		wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
79
-		wp_enqueue_script( 'give-qtip' );
78
+		wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
79
+		wp_enqueue_script('give-qtip');
80 80
 
81
-		wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
82
-		wp_enqueue_script( 'give-accounting' );
81
+		wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
82
+		wp_enqueue_script('give-accounting');
83 83
 
84
-		wp_register_script( 'give-magnific', $js_plugins . 'jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
85
-		wp_enqueue_script( 'give-magnific' );
84
+		wp_register_script('give-magnific', $js_plugins.'jquery.magnific-popup'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
85
+		wp_enqueue_script('give-magnific');
86 86
 
87
-		wp_register_script( 'give-checkout-global', $js_dir . 'give-checkout-global' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
88
-		wp_enqueue_script( 'give-checkout-global' );
87
+		wp_register_script('give-checkout-global', $js_dir.'give-checkout-global'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
88
+		wp_enqueue_script('give-checkout-global');
89 89
 
90 90
 		//General scripts
91
-		wp_register_script( 'give-scripts', $js_dir . 'give' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
92
-		wp_enqueue_script( 'give-scripts' );
91
+		wp_register_script('give-scripts', $js_dir.'give'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
92
+		wp_enqueue_script('give-scripts');
93 93
 
94 94
 		// Load AJAX scripts, if enabled
95
-		wp_register_script( 'give-ajax', $js_dir . 'give-ajax' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
96
-		wp_enqueue_script( 'give-ajax' );
95
+		wp_register_script('give-ajax', $js_dir.'give-ajax'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
96
+		wp_enqueue_script('give-ajax');
97 97
 
98 98
 		//Localize / Pass AJAX vars from PHP
99
-		wp_localize_script( 'give-checkout-global', 'give_global_vars', $localize_give_checkout );
100
-		wp_localize_script( 'give-ajax', 'give_scripts', $localize_give_ajax );
99
+		wp_localize_script('give-checkout-global', 'give_global_vars', $localize_give_checkout);
100
+		wp_localize_script('give-ajax', 'give_scripts', $localize_give_ajax);
101 101
 
102 102
 
103 103
 	} else {
104 104
 
105 105
 		//DEBUG is OFF (one JS file to rule them all!)
106
-		wp_register_script( 'give', $js_dir . 'give.all.min.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
107
-		wp_enqueue_script( 'give' );
106
+		wp_register_script('give', $js_dir.'give.all.min.js', array('jquery'), GIVE_VERSION, $scripts_footer);
107
+		wp_enqueue_script('give');
108 108
 
109 109
 		//Localize / Pass AJAX vars from PHP
110
-		wp_localize_script( 'give', 'give_global_vars', $localize_give_checkout );
111
-		wp_localize_script( 'give', 'give_scripts', $localize_give_ajax );
110
+		wp_localize_script('give', 'give_global_vars', $localize_give_checkout);
111
+		wp_localize_script('give', 'give_scripts', $localize_give_ajax);
112 112
 
113 113
 	}
114 114
 
115 115
 
116 116
 }
117 117
 
118
-add_action( 'wp_enqueue_scripts', 'give_load_scripts' );
118
+add_action('wp_enqueue_scripts', 'give_load_scripts');
119 119
 
120 120
 /**
121 121
  * Register Styles
@@ -127,47 +127,47 @@  discard block
 block discarded – undo
127 127
  */
128 128
 function give_register_styles() {
129 129
 
130
-	if ( give_get_option( 'disable_css', false ) ) {
130
+	if (give_get_option('disable_css', false)) {
131 131
 		return;
132 132
 	}
133 133
 
134 134
 	// Use minified libraries if SCRIPT_DEBUG is turned off
135
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
135
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
136 136
 
137
-	$file          = 'give' . $suffix . '.css';
137
+	$file          = 'give'.$suffix.'.css';
138 138
 	$templates_dir = give_get_theme_template_dir_name();
139 139
 
140
-	$child_theme_style_sheet    = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file;
141
-	$child_theme_style_sheet_2  = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give.css';
142
-	$parent_theme_style_sheet   = trailingslashit( get_template_directory() ) . $templates_dir . $file;
143
-	$parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give.css';
144
-	$give_plugin_style_sheet    = trailingslashit( give_get_templates_dir() ) . $file;
140
+	$child_theme_style_sheet    = trailingslashit(get_stylesheet_directory()).$templates_dir.$file;
141
+	$child_theme_style_sheet_2  = trailingslashit(get_stylesheet_directory()).$templates_dir.'give.css';
142
+	$parent_theme_style_sheet   = trailingslashit(get_template_directory()).$templates_dir.$file;
143
+	$parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give.css';
144
+	$give_plugin_style_sheet    = trailingslashit(give_get_templates_dir()).$file;
145 145
 
146 146
 	// Look in the child theme directory first, followed by the parent theme, followed by the Give core templates directory
147 147
 	// Also look for the min version first, followed by non minified version, even if SCRIPT_DEBUG is not enabled.
148 148
 	// This allows users to copy just give.css to their theme
149
-	if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) {
150
-		if ( ! empty( $nonmin ) ) {
151
-			$url = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give.css';
149
+	if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) {
150
+		if ( ! empty($nonmin)) {
151
+			$url = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give.css';
152 152
 		} else {
153
-			$url = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file;
153
+			$url = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file;
154 154
 		}
155
-	} elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) {
156
-		if ( ! empty( $nonmin ) ) {
157
-			$url = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give.css';
155
+	} elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) {
156
+		if ( ! empty($nonmin)) {
157
+			$url = trailingslashit(get_template_directory_uri()).$templates_dir.'give.css';
158 158
 		} else {
159
-			$url = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file;
159
+			$url = trailingslashit(get_template_directory_uri()).$templates_dir.$file;
160 160
 		}
161
-	} elseif ( file_exists( $give_plugin_style_sheet ) || file_exists( $give_plugin_style_sheet ) ) {
162
-		$url = trailingslashit( give_get_templates_url() ) . $file;
161
+	} elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) {
162
+		$url = trailingslashit(give_get_templates_url()).$file;
163 163
 	}
164 164
 
165
-	wp_register_style( 'give-styles', $url, array(), GIVE_VERSION, 'all' );
166
-	wp_enqueue_style( 'give-styles' );
165
+	wp_register_style('give-styles', $url, array(), GIVE_VERSION, 'all');
166
+	wp_enqueue_style('give-styles');
167 167
 
168 168
 }
169 169
 
170
-add_action( 'wp_enqueue_scripts', 'give_register_styles' );
170
+add_action('wp_enqueue_scripts', 'give_register_styles');
171 171
 
172 172
 /**
173 173
  * Load Admin Scripts
@@ -181,107 +181,107 @@  discard block
 block discarded – undo
181 181
  *
182 182
  * @return void
183 183
  */
184
-function give_load_admin_scripts( $hook ) {
184
+function give_load_admin_scripts($hook) {
185 185
 
186 186
 	global $wp_version, $post, $post_type;
187 187
 
188 188
 	//Directories of assets
189
-	$js_dir     = GIVE_PLUGIN_URL . 'assets/js/admin/';
190
-	$js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/';
191
-	$css_dir    = GIVE_PLUGIN_URL . 'assets/css/';
189
+	$js_dir     = GIVE_PLUGIN_URL.'assets/js/admin/';
190
+	$js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/';
191
+	$css_dir    = GIVE_PLUGIN_URL.'assets/css/';
192 192
 
193 193
 	// Use minified libraries if SCRIPT_DEBUG is turned off
194
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
194
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
195 195
 
196 196
 	//Global Admin:
197
-	wp_register_style( 'give-admin-bar-notification', $css_dir . 'adminbar-style.css' );
198
-	wp_enqueue_style( 'give-admin-bar-notification' );
197
+	wp_register_style('give-admin-bar-notification', $css_dir.'adminbar-style.css');
198
+	wp_enqueue_style('give-admin-bar-notification');
199 199
 
200 200
 	//Give Admin Only:
201
-	if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) {
201
+	if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
202 202
 		return;
203 203
 	}
204 204
 
205 205
 	//CSS
206
-	wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css' );
207
-	wp_enqueue_style( 'jquery-ui-css' );
208
-	wp_register_style( 'give-admin', $css_dir . 'give-admin' . $suffix . '.css', GIVE_VERSION );
209
-	wp_enqueue_style( 'give-admin' );
210
-	wp_register_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION );
211
-	wp_enqueue_style( 'jquery-chosen' );
212
-	wp_enqueue_style( 'thickbox' );
206
+	wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css');
207
+	wp_enqueue_style('jquery-ui-css');
208
+	wp_register_style('give-admin', $css_dir.'give-admin'.$suffix.'.css', GIVE_VERSION);
209
+	wp_enqueue_style('give-admin');
210
+	wp_register_style('jquery-chosen', $css_dir.'chosen'.$suffix.'.css', array(), GIVE_VERSION);
211
+	wp_enqueue_style('jquery-chosen');
212
+	wp_enqueue_style('thickbox');
213 213
 
214 214
 	//JS
215
-	wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION );
216
-	wp_enqueue_script( 'jquery-chosen' );
215
+	wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION);
216
+	wp_enqueue_script('jquery-chosen');
217 217
 
218
-	wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
219
-	wp_enqueue_script( 'give-admin-scripts' );
218
+	wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
219
+	wp_enqueue_script('give-admin-scripts');
220 220
 
221
-	wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' );
222
-	wp_enqueue_script( 'jquery-flot' );
221
+	wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js');
222
+	wp_enqueue_script('jquery-flot');
223 223
 
224
-	wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
225
-	wp_enqueue_script( 'give-qtip' );
224
+	wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
225
+	wp_enqueue_script('give-qtip');
226 226
 
227
-	wp_enqueue_script( 'jquery-ui-datepicker' );
228
-	wp_enqueue_script( 'thickbox' );
227
+	wp_enqueue_script('jquery-ui-datepicker');
228
+	wp_enqueue_script('thickbox');
229 229
 
230 230
 	//Forms CPT Script
231
-	if ( $post_type === 'give_forms' ) {
232
-		wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
233
-		wp_enqueue_script( 'give-admin-forms-scripts' );
231
+	if ($post_type === 'give_forms') {
232
+		wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
233
+		wp_enqueue_script('give-admin-forms-scripts');
234 234
 	}
235 235
 
236 236
 	//Settings Scripts
237
-	if (isset($_GET['page']) && $_GET['page'] == 'give-settings'  ) {
237
+	if (isset($_GET['page']) && $_GET['page'] == 'give-settings') {
238 238
 		wp_enqueue_script('jquery-ui-sortable');
239
-		wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
240
-		wp_enqueue_script( 'give-admin-settings-scripts' );
239
+		wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
240
+		wp_enqueue_script('give-admin-settings-scripts');
241 241
 	}
242 242
 
243 243
 	//Localize strings & variables for JS
244
-	wp_localize_script( 'give-admin-scripts', 'give_vars', array(
245
-		'post_id'                 => isset( $post->ID ) ? $post->ID : null,
244
+	wp_localize_script('give-admin-scripts', 'give_vars', array(
245
+		'post_id'                 => isset($post->ID) ? $post->ID : null,
246 246
 		'give_version'            => GIVE_VERSION,
247
-		'quick_edit_warning'      => esc_html( 'Sorry, not available for variable priced forms.', 'give' ),
248
-		'delete_payment'          => esc_html( 'Are you sure you wish to delete this payment?', 'give' ),
249
-		'delete_payment_note'     => esc_html( 'Are you sure you wish to delete this note?', 'give' ),
250
-		'revoke_api_key'          => esc_html( 'Are you sure you wish to revoke this API key?', 'give' ),
251
-		'regenerate_api_key'      => esc_html( 'Are you sure you wish to regenerate this API key?', 'give' ),
252
-		'resend_receipt'          => esc_html( 'Are you sure you wish to resend the donation receipt?', 'give' ),
253
-		'copy_download_link_text' => esc_html( 'Copy these links to your clipboard and give them to your donor.', 'give' ),
247
+		'quick_edit_warning'      => esc_html('Sorry, not available for variable priced forms.', 'give'),
248
+		'delete_payment'          => esc_html('Are you sure you wish to delete this payment?', 'give'),
249
+		'delete_payment_note'     => esc_html('Are you sure you wish to delete this note?', 'give'),
250
+		'revoke_api_key'          => esc_html('Are you sure you wish to revoke this API key?', 'give'),
251
+		'regenerate_api_key'      => esc_html('Are you sure you wish to regenerate this API key?', 'give'),
252
+		'resend_receipt'          => esc_html('Are you sure you wish to resend the donation receipt?', 'give'),
253
+		'copy_download_link_text' => esc_html('Copy these links to your clipboard and give them to your donor.', 'give'),
254 254
 		/* translators: %s: form singular label */
255
-		'delete_payment_download' => sprintf( esc_html( 'Are you sure you wish to delete this %s?', 'give' ), give_get_forms_label_singular() ),
256
-		'one_price_min'           => esc_html( 'You must have at least one price.', 'give' ),
257
-		'one_file_min'            => esc_html( 'You must have at least one file.', 'give' ),
258
-		'one_field_min'           => esc_html( 'You must have at least one field.', 'give' ),
255
+		'delete_payment_download' => sprintf(esc_html('Are you sure you wish to delete this %s?', 'give'), give_get_forms_label_singular()),
256
+		'one_price_min'           => esc_html('You must have at least one price.', 'give'),
257
+		'one_file_min'            => esc_html('You must have at least one file.', 'give'),
258
+		'one_field_min'           => esc_html('You must have at least one field.', 'give'),
259 259
 		/* translators: %s: form singular label */
260
-		'one_option'              => sprintf( esc_html( 'Choose a %s', 'give' ), give_get_forms_label_singular() ),
260
+		'one_option'              => sprintf(esc_html('Choose a %s', 'give'), give_get_forms_label_singular()),
261 261
 		/* translators: %s: form plural label */
262
-		'one_or_more_option'      => sprintf( esc_html( 'Choose one or more %s', 'give' ), give_get_forms_label_plural() ),
263
-		'numeric_item_price'      => esc_html( 'Item price must be numeric.', 'give' ),
264
-		'numeric_quantity'        => esc_html( 'Quantity must be numeric.', 'give' ),
265
-		'currency_sign'           => give_currency_filter( '' ),
266
-		'currency_pos'            => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
262
+		'one_or_more_option'      => sprintf(esc_html('Choose one or more %s', 'give'), give_get_forms_label_plural()),
263
+		'numeric_item_price'      => esc_html('Item price must be numeric.', 'give'),
264
+		'numeric_quantity'        => esc_html('Quantity must be numeric.', 'give'),
265
+		'currency_sign'           => give_currency_filter(''),
266
+		'currency_pos'            => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
267 267
 		'currency_decimals'       => give_currency_decimal_filter(),
268
-		'new_media_ui'            => apply_filters( 'give_use_35_media_ui', 1 ),
269
-		'remove_text'             => esc_html( 'Remove', 'give' ),
268
+		'new_media_ui'            => apply_filters('give_use_35_media_ui', 1),
269
+		'remove_text'             => esc_html('Remove', 'give'),
270 270
 		/* translators: %s: form plural label */
271
-		'type_to_search'          => sprintf( esc_html( 'Type to search %s', 'give' ), give_get_forms_label_plural() ),
272
-		'batch_export_no_class'   => esc_html( 'You must choose a method.', 'give' ),
273
-		'batch_export_no_reqs'    => esc_html( 'Required fields not completed.', 'give' ),
274
-		'reset_stats_warn'        => __( 'Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give' ),
275
-	) );
271
+		'type_to_search'          => sprintf(esc_html('Type to search %s', 'give'), give_get_forms_label_plural()),
272
+		'batch_export_no_class'   => esc_html('You must choose a method.', 'give'),
273
+		'batch_export_no_reqs'    => esc_html('Required fields not completed.', 'give'),
274
+		'reset_stats_warn'        => __('Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give'),
275
+	));
276 276
 
277
-	if ( function_exists( 'wp_enqueue_media' ) && version_compare( $wp_version, '3.5', '>=' ) ) {
277
+	if (function_exists('wp_enqueue_media') && version_compare($wp_version, '3.5', '>=')) {
278 278
 		//call for new media manager
279 279
 		wp_enqueue_media();
280 280
 	}
281 281
 
282 282
 }
283 283
 
284
-add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 );
284
+add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100);
285 285
 
286 286
 /**
287 287
  * Admin Give Icon
@@ -298,14 +298,14 @@  discard block
 block discarded – undo
298 298
 	?>
299 299
 	<style type="text/css" media="screen">
300 300
 
301
-		<?php if( version_compare( $wp_version, '3.8-RC', '>=' ) || version_compare( $wp_version, '3.8', '>=' ) ) { ?>
301
+		<?php if (version_compare($wp_version, '3.8-RC', '>=') || version_compare($wp_version, '3.8', '>=')) { ?>
302 302
 		@font-face {
303 303
 			font-family: 'give-icomoon';
304
-			src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?-ngjl88'; ?>');
305
-			src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'),
306
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'),
307
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.ttf?-ngjl88'; ?>') format('truetype'),
308
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg');
304
+			src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?-ngjl88'; ?>');
305
+			src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'),
306
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'),
307
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.ttf?-ngjl88'; ?>') format('truetype'),
308
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg');
309 309
 			font-weight: normal;
310 310
 			font-style: normal;
311 311
 		}
@@ -324,4 +324,4 @@  discard block
 block discarded – undo
324 324
 	<?php
325 325
 }
326 326
 
327
-add_action( 'admin_head', 'give_admin_icon' );
327
+add_action('admin_head', 'give_admin_icon');
Please login to merge, or discard this patch.
includes/admin/welcome.php 1 patch
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	 * @since 1.0
36 36
 	 */
37 37
 	public function __construct() {
38
-		add_action( 'admin_menu', array( $this, 'admin_menus' ) );
39
-		add_action( 'admin_head', array( $this, 'admin_head' ) );
40
-		add_action( 'admin_init', array( $this, 'welcome' ) );
38
+		add_action('admin_menu', array($this, 'admin_menus'));
39
+		add_action('admin_head', array($this, 'admin_head'));
40
+		add_action('admin_init', array($this, 'welcome'));
41 41
 	}
42 42
 
43 43
 	/**
@@ -51,38 +51,38 @@  discard block
 block discarded – undo
51 51
 	public function admin_menus() {
52 52
 		// About Page
53 53
 		add_dashboard_page(
54
-			esc_html( 'Welcome to Give', 'give' ),
55
-			esc_html( 'Welcome to Give', 'give' ),
54
+			esc_html('Welcome to Give', 'give'),
55
+			esc_html('Welcome to Give', 'give'),
56 56
 			$this->minimum_capability,
57 57
 			'give-about',
58
-			array( $this, 'about_screen' )
58
+			array($this, 'about_screen')
59 59
 		);
60 60
 
61 61
 		// Changelog Page
62 62
 		add_dashboard_page(
63
-			esc_html( 'Give Changelog', 'give' ),
64
-			esc_html( 'Give Changelog', 'give' ),
63
+			esc_html('Give Changelog', 'give'),
64
+			esc_html('Give Changelog', 'give'),
65 65
 			$this->minimum_capability,
66 66
 			'give-changelog',
67
-			array( $this, 'changelog_screen' )
67
+			array($this, 'changelog_screen')
68 68
 		);
69 69
 
70 70
 		// Getting Started Page
71 71
 		add_dashboard_page(
72
-			esc_html( 'Getting started with Give', 'give' ),
73
-			esc_html( 'Getting started with Give', 'give' ),
72
+			esc_html('Getting started with Give', 'give'),
73
+			esc_html('Getting started with Give', 'give'),
74 74
 			$this->minimum_capability,
75 75
 			'give-getting-started',
76
-			array( $this, 'getting_started_screen' )
76
+			array($this, 'getting_started_screen')
77 77
 		);
78 78
 
79 79
 		// Credits Page
80 80
 		add_dashboard_page(
81
-			esc_html( 'The people that build Give', 'give' ),
82
-			esc_html( 'The people that build Give', 'give' ),
81
+			esc_html('The people that build Give', 'give'),
82
+			esc_html('The people that build Give', 'give'),
83 83
 			$this->minimum_capability,
84 84
 			'give-credits',
85
-			array( $this, 'credits_screen' )
85
+			array($this, 'credits_screen')
86 86
 		);
87 87
 	}
88 88
 
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function admin_head() {
97 97
 
98
-		remove_submenu_page( 'index.php', 'give-about' );
99
-		remove_submenu_page( 'index.php', 'give-changelog' );
100
-		remove_submenu_page( 'index.php', 'give-getting-started' );
101
-		remove_submenu_page( 'index.php', 'give-credits' );
98
+		remove_submenu_page('index.php', 'give-about');
99
+		remove_submenu_page('index.php', 'give-changelog');
100
+		remove_submenu_page('index.php', 'give-getting-started');
101
+		remove_submenu_page('index.php', 'give-credits');
102 102
 
103 103
 		// Badge for welcome page
104
-		$badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png';
104
+		$badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png';
105 105
 
106 106
 		?>
107 107
 		<style type="text/css" media="screen">
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
 	 * @return void
216 216
 	 */
217 217
 	public function tabs() {
218
-		$selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
218
+		$selected = isset($_GET['page']) ? $_GET['page'] : 'give-about';
219 219
 		?>
220 220
 		<h1 class="nav-tab-wrapper">
221
-			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>">
222
-				<?php esc_html_e( "About Give", 'give' ); ?>
221
+			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>">
222
+				<?php esc_html_e("About Give", 'give'); ?>
223 223
 			</a>
224
-			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>">
225
-				<?php esc_html_e( 'Getting Started', 'give' ); ?>
224
+			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>">
225
+				<?php esc_html_e('Getting Started', 'give'); ?>
226 226
 			</a>
227
-			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>">
228
-				<?php esc_html_e( 'Credits', 'give' ); ?>
227
+			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>">
228
+				<?php esc_html_e('Credits', 'give'); ?>
229 229
 			</a>
230
-			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
-				<?php esc_html_e( 'Add-ons', 'give' ); ?>
230
+			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
+				<?php esc_html_e('Add-ons', 'give'); ?>
232 232
 			</a>
233 233
 		</h1>
234 234
 	<?php
@@ -242,13 +242,13 @@  discard block
 block discarded – undo
242 242
 	 * @return void
243 243
 	 */
244 244
 	public function about_screen() {
245
-		list( $display_version ) = explode( '-', GIVE_VERSION );
245
+		list($display_version) = explode('-', GIVE_VERSION);
246 246
 		?>
247 247
 		<div class="wrap about-wrap">
248 248
 			<h1 class="welcome-h1"><?php
249 249
 				printf(
250 250
 					/* translators: %s: Give version */
251
-					esc_html( 'Welcome to Give %s', 'give' ),
251
+					esc_html('Welcome to Give %s', 'give'),
252 252
 					$display_version
253 253
 				);
254 254
 			?></h1>
@@ -258,20 +258,20 @@  discard block
 block discarded – undo
258 258
 			<div class="about-text"><?php
259 259
 				printf(
260 260
 					/* translators: 1: https://givewp.com/documenation/ 2: title attribute text */
261
-					__( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ),
262
-					esc_url( 'https://givewp.com/documenation/' ),
263
-					esc_attr( 'View the Give plugin documentation online', 'give' )
261
+					__('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'),
262
+					esc_url('https://givewp.com/documenation/'),
263
+					esc_attr('View the Give plugin documentation online', 'give')
264 264
 				);
265 265
 			?></div>
266 266
 
267
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
267
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
268 268
 
269 269
 			<?php give_get_newsletter() ?>
270 270
 
271 271
 			<div class="give-badge"><?php
272 272
 				printf(
273 273
 					/* translators: %s: Give version */
274
-					esc_html( 'Version %s', 'give' ),
274
+					esc_html('Version %s', 'give'),
275 275
 					$display_version
276 276
 				);
277 277
 			?></div>
@@ -283,15 +283,15 @@  discard block
 block discarded – undo
283 283
 			<div class="feature-section clearfix introduction">
284 284
 
285 285
 				<div class="video feature-section-item">
286
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
286
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
287 287
 
288 288
 				</div>
289 289
 
290 290
 				<div class="content feature-section-item last-feature">
291 291
 
292
-					<h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3>
292
+					<h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3>
293 293
 
294
-					<p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p>
294
+					<p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p>
295 295
 					<a href="https://givewp.com" target="_blank" class="button-secondary" title="Visit the Give Website">Learn More
296 296
 						<span class="dashicons dashicons-external"></span></a>
297 297
 
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
 
305 305
 				<div class="content feature-section-item">
306 306
 
307
-					<h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
307
+					<h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3>
308 308
 
309
-					<p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p>
309
+					<p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p>
310 310
 					<a href="https://givewp.com/documentation" target="_blank" class="button-secondary" title="Visit the Give Website">View Documentation
311 311
 						<span class="dashicons dashicons-external"></span></a>
312 312
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
 				<div class="content  feature-section-item last-feature">
316 316
 
317
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
317
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
318 318
 
319 319
 				</div>
320 320
 
@@ -334,22 +334,22 @@  discard block
 block discarded – undo
334 334
 	 * @return void
335 335
 	 */
336 336
 	public function changelog_screen() {
337
-		list( $display_version ) = explode( '-', GIVE_VERSION );
337
+		list($display_version) = explode('-', GIVE_VERSION);
338 338
 		?>
339 339
 		<div class="wrap about-wrap">
340
-			<h1><?php esc_html_e( 'Give Changelog', 'give' ); ?></h1>
340
+			<h1><?php esc_html_e('Give Changelog', 'give'); ?></h1>
341 341
 
342 342
 			<div class="about-text"><?php
343 343
 				printf(
344 344
 					/* translators: %s: Give version */
345
-					esc_html( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
345
+					esc_html('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'),
346 346
 					$display_version
347 347
 				);
348 348
 			?></div>
349 349
 			<div class="give-badge"><?php
350 350
 				printf(
351 351
 					/* translators: %s: Give version */
352
-					esc_html( 'Version %s', 'give' ),
352
+					esc_html('Version %s', 'give'),
353 353
 					$display_version
354 354
 				);
355 355
 			?></div>
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 			<?php $this->tabs(); ?>
358 358
 
359 359
 			<div class="changelog">
360
-				<h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
360
+				<h3><?php esc_html_e('Full Changelog', 'give'); ?></h3>
361 361
 
362 362
 				<div class="feature-section">
363 363
 					<?php echo $this->parse_readme(); ?>
@@ -365,10 +365,10 @@  discard block
 block discarded – undo
365 365
 			</div>
366 366
 
367 367
 			<div class="return-to-dashboard">
368
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array(
368
+				<a href="<?php echo esc_url(admin_url(add_query_arg(array(
369 369
 					'post_type' => 'give_forms',
370 370
 					'page'      => 'give-settings'
371
-				), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Go to Give Settings', 'give' ); ?></a>
371
+				), 'edit.php'))); ?>"><?php esc_html_e('Go to Give Settings', 'give'); ?></a>
372 372
 			</div>
373 373
 		</div>
374 374
 	<?php
@@ -382,29 +382,29 @@  discard block
 block discarded – undo
382 382
 	 * @return void
383 383
 	 */
384 384
 	public function getting_started_screen() {
385
-		list( $display_version ) = explode( '-', GIVE_VERSION );
385
+		list($display_version) = explode('-', GIVE_VERSION);
386 386
 		?>
387 387
 		<div class="wrap about-wrap get-started">
388 388
 			<h1 class="welcome-h1"><?php
389 389
 				printf(
390 390
 					/* translators: %s: Give version */
391
-					esc_html( 'Give %s - Getting Started Guide', 'give' ),
391
+					esc_html('Give %s - Getting Started Guide', 'give'),
392 392
 					$display_version
393 393
 				);
394 394
 			?></h1>
395 395
 
396 396
 			<?php give_social_media_elements() ?>
397 397
 
398
-			<div class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></div>
398
+			<div class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></div>
399 399
 
400
-			<p class="newsletter-intro"><?php esc_html_e( 'Don\'t forget to sign up for the newsletter!', 'give' ); ?>.</p>
400
+			<p class="newsletter-intro"><?php esc_html_e('Don\'t forget to sign up for the newsletter!', 'give'); ?>.</p>
401 401
 
402 402
 			<?php give_get_newsletter() ?>
403 403
 
404 404
 			<div class="give-badge"><?php
405 405
 				printf(
406 406
 					/* translators: %s: Give version */
407
-					esc_html( 'Version %s', 'give' ),
407
+					esc_html('Version %s', 'give'),
408 408
 					$display_version
409 409
 				);
410 410
 			?></div>
@@ -412,17 +412,17 @@  discard block
 block discarded – undo
412 412
 			<?php $this->tabs(); ?>
413 413
 
414 414
 
415
-			<div class="about-text"><?php printf( esc_html( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></div>
415
+			<div class="about-text"><?php printf(esc_html('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></div>
416 416
 
417 417
 
418 418
 			<div class="feature-section clearfix">
419 419
 
420 420
 				<div class="content feature-section-item">
421
-					<h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
421
+					<h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3>
422 422
 
423
-					<p><?php esc_html_e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p>
423
+					<p><?php esc_html_e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p>
424 424
 
425
-					<p><?php esc_html_e( 'But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give' ); ?></p>
425
+					<p><?php esc_html_e('But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give'); ?></p>
426 426
 				</div>
427 427
 
428 428
 				<div class="content feature-section-item last-feature">
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
 				</div>
440 440
 
441 441
 				<div class="content feature-section-item last-feature">
442
-					<h3><?php esc_html_e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3>
442
+					<h3><?php esc_html_e('STEP 2: Choose Your Levels', 'give'); ?></h3>
443 443
 
444
-					<p><?php esc_html_e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p>
444
+					<p><?php esc_html_e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p>
445 445
 				</div>
446 446
 
447 447
 			</div>
@@ -450,11 +450,11 @@  discard block
 block discarded – undo
450 450
 			<div class="feature-section clearfix">
451 451
 
452 452
 				<div class="content feature-section-item add-content">
453
-					<h3><?php esc_html_e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3>
453
+					<h3><?php esc_html_e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3>
454 454
 
455
-					<p><?php esc_html_e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p>
455
+					<p><?php esc_html_e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p>
456 456
 
457
-					<p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p>
457
+					<p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p>
458 458
 				</div>
459 459
 
460 460
 				<div class="content feature-section-item last-feature">
@@ -471,9 +471,9 @@  discard block
 block discarded – undo
471 471
 				</div>
472 472
 
473 473
 				<div class="content feature-section-item last-feature">
474
-					<h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
474
+					<h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3>
475 475
 
476
-					<p><?php esc_html_e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p>
476
+					<p><?php esc_html_e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p>
477 477
 				</div>
478 478
 
479 479
 
@@ -493,38 +493,38 @@  discard block
 block discarded – undo
493 493
 	 * @return void
494 494
 	 */
495 495
 	public function credits_screen() {
496
-		list( $display_version ) = explode( '-', GIVE_VERSION );
496
+		list($display_version) = explode('-', GIVE_VERSION);
497 497
 		?>
498 498
 		<div class="wrap about-wrap">
499 499
 			<h1 class="welcome-h1"><?php
500 500
 				printf(
501 501
 					/* translators: %s: Give version */
502
-					esc_html( 'Give %s - Credits', 'give' ),
502
+					esc_html('Give %s - Credits', 'give'),
503 503
 					$display_version
504 504
 				);
505 505
 			?></h1>
506 506
 
507 507
 			<?php give_social_media_elements() ?>
508 508
 
509
-			<div class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly. ', 'give' ); ?></div>
509
+			<div class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly. ', 'give'); ?></div>
510 510
 
511
-			<div class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></div>
511
+			<div class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></div>
512 512
 
513
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
513
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
514 514
 
515 515
 			<?php give_get_newsletter() ?>
516 516
 
517 517
 			<div class="give-badge"><?php
518 518
 				printf(
519 519
 					/* translators: %s: Give version */
520
-					esc_html( 'Version %s', 'give' ),
520
+					esc_html('Version %s', 'give'),
521 521
 					$display_version
522 522
 				);
523 523
 			?></div>
524 524
 
525 525
 			<?php $this->tabs(); ?>
526 526
 
527
-			<p class="about-description"><?php printf( __( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ), esc_url( 'https://github.com/WordImpress/give' ) ); ?></p>
527
+			<p class="about-description"><?php printf(__('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'), esc_url('https://github.com/WordImpress/give')); ?></p>
528 528
 
529 529
 			<?php echo $this->contributors(); ?>
530 530
 		</div>
@@ -539,21 +539,21 @@  discard block
 block discarded – undo
539 539
 	 * @return string $readme HTML formatted readme file
540 540
 	 */
541 541
 	public function parse_readme() {
542
-		$file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
542
+		$file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null;
543 543
 
544
-		if ( ! $file ) {
545
-			$readme = '<p>' . esc_html( 'No valid changlog was found.', 'give' ) . '</p>';
544
+		if ( ! $file) {
545
+			$readme = '<p>'.esc_html('No valid changlog was found.', 'give').'</p>';
546 546
 		} else {
547
-			$readme = file_get_contents( $file );
548
-			$readme = nl2br( esc_html( $readme ) );
549
-			$readme = explode( '== Changelog ==', $readme );
550
-			$readme = end( $readme );
551
-
552
-			$readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
553
-			$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
554
-			$readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
555
-			$readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
556
-			$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
547
+			$readme = file_get_contents($file);
548
+			$readme = nl2br(esc_html($readme));
549
+			$readme = explode('== Changelog ==', $readme);
550
+			$readme = end($readme);
551
+
552
+			$readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme);
553
+			$readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme);
554
+			$readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme);
555
+			$readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme);
556
+			$readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme);
557 557
 		}
558 558
 
559 559
 		return $readme;
@@ -570,27 +570,27 @@  discard block
 block discarded – undo
570 570
 	public function contributors() {
571 571
 		$contributors = $this->get_contributors();
572 572
 
573
-		if ( empty( $contributors ) ) {
573
+		if (empty($contributors)) {
574 574
 			return '';
575 575
 		}
576 576
 
577 577
 		$contributor_list = '<ul class="wp-people-group">';
578 578
 
579
-		foreach ( $contributors as $contributor ) {
579
+		foreach ($contributors as $contributor) {
580 580
 			$contributor_list .= '<li class="wp-person">';
581
-			$contributor_list .= sprintf( '<a href="%s" title="%s">',
582
-				esc_url( 'https://github.com/' . $contributor->login ),
581
+			$contributor_list .= sprintf('<a href="%s" title="%s">',
582
+				esc_url('https://github.com/'.$contributor->login),
583 583
 				esc_html(
584 584
 					sprintf(
585 585
 						/* translators: %s: github contributor */
586
-						esc_html( 'View %s', 'give' ),
586
+						esc_html('View %s', 'give'),
587 587
 						$contributor->login
588 588
 					)
589 589
 				)
590 590
 			);
591
-			$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
591
+			$contributor_list .= sprintf('<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url($contributor->avatar_url), esc_html($contributor->login));
592 592
 			$contributor_list .= '</a>';
593
-			$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
593
+			$contributor_list .= sprintf('<a class="web" href="%s">%s</a>', esc_url('https://github.com/'.$contributor->login), esc_html($contributor->login));
594 594
 			$contributor_list .= '</a>';
595 595
 			$contributor_list .= '</li>';
596 596
 		}
@@ -608,25 +608,25 @@  discard block
 block discarded – undo
608 608
 	 * @return array $contributors List of contributors
609 609
 	 */
610 610
 	public function get_contributors() {
611
-		$contributors = get_transient( 'give_contributors' );
611
+		$contributors = get_transient('give_contributors');
612 612
 
613
-		if ( false !== $contributors ) {
613
+		if (false !== $contributors) {
614 614
 			return $contributors;
615 615
 		}
616 616
 
617
-		$response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
617
+		$response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false));
618 618
 
619
-		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
619
+		if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) {
620 620
 			return array();
621 621
 		}
622 622
 
623
-		$contributors = json_decode( wp_remote_retrieve_body( $response ) );
623
+		$contributors = json_decode(wp_remote_retrieve_body($response));
624 624
 
625
-		if ( ! is_array( $contributors ) ) {
625
+		if ( ! is_array($contributors)) {
626 626
 			return array();
627 627
 		}
628 628
 
629
-		set_transient( 'give_contributors', $contributors, 3600 );
629
+		set_transient('give_contributors', $contributors, 3600);
630 630
 
631 631
 		return $contributors;
632 632
 	}
@@ -645,24 +645,24 @@  discard block
 block discarded – undo
645 645
 
646 646
 
647 647
 		// Bail if no activation redirect
648
-		if ( ! get_transient( '_give_activation_redirect' ) ) {
648
+		if ( ! get_transient('_give_activation_redirect')) {
649 649
 			return;
650 650
 		}
651 651
 
652 652
 		// Delete the redirect transient
653
-		delete_transient( '_give_activation_redirect' );
653
+		delete_transient('_give_activation_redirect');
654 654
 
655 655
 		// Bail if activating from network, or bulk
656
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
656
+		if (is_network_admin() || isset($_GET['activate-multi'])) {
657 657
 			return;
658 658
 		}
659 659
 
660
-		$upgrade = get_option( 'give_version_upgraded_from' );
660
+		$upgrade = get_option('give_version_upgraded_from');
661 661
 
662
-		if ( ! $upgrade ) { // First time install
663
-			wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
662
+		if ( ! $upgrade) { // First time install
663
+			wp_safe_redirect(admin_url('index.php?page=give-about'));
664 664
 			exit;
665
-		} elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings
665
+		} elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings
666 666
 
667 667
 		} else { // Welcome is NOT disabled in settings
668 668
 			wp_safe_redirect(admin_url('index.php?page=give-about'));
Please login to merge, or discard this patch.
includes/admin/reporting/tools.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -22,80 +22,80 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_tools_recount_stats_display() {
24 24
 
25
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
25
+	if ( ! current_user_can('manage_give_settings')) {
26 26
 		return;
27 27
 	}
28 28
 
29
-	do_action( 'give_tools_recount_stats_before' );
29
+	do_action('give_tools_recount_stats_before');
30 30
 	?>
31 31
 	<div id="poststuff">
32 32
 		<div class="postbox">
33 33
 
34
-			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Recount Stats', 'give' ); ?></span></h2>
34
+			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e('Recount Stats', 'give'); ?></span></h2>
35 35
 
36 36
 			<div class="inside recount-stats-controls">
37
-				<p><?php esc_html_e( 'Use these tools to recount stats, delete test transactions, or reset stats.', 'give' ); ?></p>
37
+				<p><?php esc_html_e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give'); ?></p>
38 38
 				<form method="post" id="give-tools-recount-form" class="give-export-form">
39 39
 
40
-					<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
40
+					<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
41 41
 
42 42
 					<select name="give-export-class" id="recount-stats-type">
43
-						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e( 'Please select an option', 'give' ); ?></option>
44
-						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e( 'Recalculate Total Donation Income Amount', 'give' ); ?></option>
45
-						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for a Form', 'give' ); ?></option>
46
-						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for All Forms', 'give' ); ?></option>
47
-						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e( 'Recalculate Donor Statistics', 'give' ); ?></option>
48
-						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e( 'Delete Test Transactions', 'give' ); ?></option>
49
-						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e( 'Delete All Data', 'give' ); ?></option>
50
-						<?php do_action( 'give_recount_tool_options' ); ?>
43
+						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e('Please select an option', 'give'); ?></option>
44
+						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e('Recalculate Total Donation Income Amount', 'give'); ?></option>
45
+						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for a Form', 'give'); ?></option>
46
+						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for All Forms', 'give'); ?></option>
47
+						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e('Recalculate Donor Statistics', 'give'); ?></option>
48
+						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e('Delete Test Transactions', 'give'); ?></option>
49
+						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e('Delete All Data', 'give'); ?></option>
50
+						<?php do_action('give_recount_tool_options'); ?>
51 51
 					</select>
52 52
 
53 53
 					<span id="tools-form-dropdown" style="display: none">
54 54
 						<?php
55 55
 						$args = array(
56 56
 							'name'   => 'form_id',
57
-							'number' => - 1,
57
+							'number' => -1,
58 58
 							'chosen' => true,
59 59
 						);
60
-						echo Give()->html->forms_dropdown( $args );
60
+						echo Give()->html->forms_dropdown($args);
61 61
 						?>
62 62
 					</span>
63 63
 
64
-					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e( 'Submit', 'give' ); ?>" class="button-secondary"/>
64
+					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e('Submit', 'give'); ?>" class="button-secondary"/>
65 65
 
66 66
 					<br/>
67 67
 
68 68
 					<span class="give-recount-stats-descriptions">
69
-						<span id="recount-stats"><?php esc_html_e( 'Recalculates the overall donation income amount.', 'give' ); ?></span>
69
+						<span id="recount-stats"><?php esc_html_e('Recalculates the overall donation income amount.', 'give'); ?></span>
70 70
 						<span id="recount-form"><?php
71 71
 							printf(
72 72
 								/* translators: %s: form singular label */
73
-								esc_html( 'Recalculates the donation and income stats for a specific %s.', 'give' ),
74
-								give_get_forms_label_singular( true )
73
+								esc_html('Recalculates the donation and income stats for a specific %s.', 'give'),
74
+								give_get_forms_label_singular(true)
75 75
 							);
76 76
 						?></span>
77 77
 						<span id="recount-all"><?php
78 78
 							printf(
79 79
 								/* translators: %s: form plural label */
80
-								esc_html( 'Recalculates the earnings and sales stats for all %s.', 'give' ),
81
-								give_get_forms_label_plural( true )
80
+								esc_html('Recalculates the earnings and sales stats for all %s.', 'give'),
81
+								give_get_forms_label_plural(true)
82 82
 							);
83 83
 						?></span>
84
-						<span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and donation counts for all donors.', 'give' ); ?></span>
85
-						<?php do_action( 'give_recount_tool_descriptions' ); ?>
86
-						<span id="delete-test-transactions"><?php _e( '<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give' ); ?></span>
87
-						<span id="reset-stats"><?php _e( '<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give' ); ?></span>
84
+						<span id="recount-customer-stats"><?php esc_html_e('Recalculates the lifetime value and donation counts for all donors.', 'give'); ?></span>
85
+						<?php do_action('give_recount_tool_descriptions'); ?>
86
+						<span id="delete-test-transactions"><?php _e('<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give'); ?></span>
87
+						<span id="reset-stats"><?php _e('<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give'); ?></span>
88 88
 					</span>
89 89
 
90 90
 					<span class="spinner"></span>
91 91
 
92 92
 				</form>
93
-				<?php do_action( 'give_tools_recount_forms' ); ?>
93
+				<?php do_action('give_tools_recount_forms'); ?>
94 94
 			</div><!-- .inside -->
95 95
 		</div><!-- .postbox -->
96 96
 	</div><!-- #poststuff -->
97 97
 	<?php
98
-	do_action( 'give_tools_recount_stats_after' );
98
+	do_action('give_tools_recount_stats_after');
99 99
 }
100 100
 
101
-add_action( 'give_reports_tab_tools', 'give_tools_recount_stats_display' );
101
+add_action('give_reports_tab_tools', 'give_tools_recount_stats_display');
Please login to merge, or discard this patch.