Test Failed
Push — master ( 7af02d...c58786 )
by Devin
04:53
created
includes/admin/class-addon-activation-banner.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 // Exit if accessed directly.
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 	 *                               'testing'           => false, // (required) Never leave as "true" in production!!!
33 33
 	 *                               }
34 34
 	 */
35
-	function __construct( $_banner_details ) {
35
+	function __construct($_banner_details) {
36 36
 		$current_user = wp_get_current_user();
37 37
 
38 38
 		$this->plugin_activate_by   = 0;
39 39
 		$this->banner_details       = $_banner_details;
40
-		$this->test_mode            = ( $this->banner_details['testing'] == 'true' ) ? true : false;
41
-		$this->nag_meta_key         = 'give_addon_activation_ignore_' . sanitize_title( $this->banner_details['name'] );
42
-		$this->activate_by_meta_key = 'give_addon_' . sanitize_title( $this->banner_details['name'] ) . '_active_by_user';
40
+		$this->test_mode            = ($this->banner_details['testing'] == 'true') ? true : false;
41
+		$this->nag_meta_key         = 'give_addon_activation_ignore_'.sanitize_title($this->banner_details['name']);
42
+		$this->activate_by_meta_key = 'give_addon_'.sanitize_title($this->banner_details['name']).'_active_by_user';
43 43
 
44 44
 		//Get current user
45 45
 		$this->user_id = $current_user->ID;
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
 	public function init() {
63 63
 
64 64
 		//Testing?
65
-		if ( $this->test_mode ) {
66
-			delete_user_meta( $this->user_id, $this->nag_meta_key );
65
+		if ($this->test_mode) {
66
+			delete_user_meta($this->user_id, $this->nag_meta_key);
67 67
 		}
68 68
 
69 69
 		//Get the current page to add the notice to
70
-		add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) );
71
-		add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) );
70
+		add_action('current_screen', array($this, 'give_addon_notice_ignore'));
71
+		add_action('admin_notices', array($this, 'give_addon_activation_admin_notice'));
72 72
 
73 73
 		// File path of addon must be included in banner detail other addon activate meta will not delete.
74 74
 		$file_name = $this->get_plugin_file_name();
75 75
 
76
-		if ( ! empty( $file_name ) ) {
77
-			add_action( 'deactivate_' . $file_name, array( $this, 'remove_addon_activate_meta' ) );
76
+		if ( ! empty($file_name)) {
77
+			add_action('deactivate_'.$file_name, array($this, 'remove_addon_activate_meta'));
78 78
 		}
79 79
 	}
80 80
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	private function is_plugin_page() {
90 90
 		$screen = get_current_screen();
91 91
 
92
-		return ( $screen->parent_file === 'plugins.php' );
92
+		return ($screen->parent_file === 'plugins.php');
93 93
 	}
94 94
 
95 95
 
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
 	public function give_addon_activation_admin_notice() {
103 103
 
104 104
 		// Bailout.
105
-		if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by ) {
105
+		if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by) {
106 106
 			return;
107 107
 		}
108 108
 
109 109
 		// If the user hasn't already dismissed the alert, output activation banner.
110
-		if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) {
110
+		if ( ! get_user_meta($this->user_id, $this->nag_meta_key)) {
111 111
 
112 112
 			$this->print_css();
113 113
 
@@ -125,44 +125,44 @@  discard block
 block discarded – undo
125 125
 					<h3><?php
126 126
 						printf(
127 127
 						/* translators: %s: Add-on name */
128
-							esc_html__( "Thank you for installing Give's %s Add-on!", 'give' ),
129
-							'<span>' . $this->banner_details['name'] . '</span>'
128
+							esc_html__("Thank you for installing Give's %s Add-on!", 'give'),
129
+							'<span>'.$this->banner_details['name'].'</span>'
130 130
 						);
131 131
 						?></h3>
132 132
 
133 133
 					<a href="<?php
134 134
 					//The Dismiss Button.
135
-					$nag_admin_dismiss_url = 'plugins.php?' . $this->nag_meta_key . '=0';
136
-					echo admin_url( $nag_admin_dismiss_url ); ?>" class="dismiss"><span
135
+					$nag_admin_dismiss_url = 'plugins.php?'.$this->nag_meta_key.'=0';
136
+					echo admin_url($nag_admin_dismiss_url); ?>" class="dismiss"><span
137 137
 							class="dashicons dashicons-dismiss"></span></a>
138 138
 
139 139
 					<div class="alert-actions">
140 140
 
141 141
 						<?php //Point them to your settings page.
142
-						if ( isset( $this->banner_details['settings_url'] ) ) { ?>
142
+						if (isset($this->banner_details['settings_url'])) { ?>
143 143
 							<a href="<?php echo $this->banner_details['settings_url']; ?>">
144
-								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e( 'Go to Settings', 'give' ); ?>
144
+								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e('Go to Settings', 'give'); ?>
145 145
 							</a>
146 146
 						<?php } ?>
147 147
 
148 148
 						<?php
149 149
 						// Show them how to configure the Addon.
150
-						if ( isset( $this->banner_details['documentation_url'] ) ) { ?>
150
+						if (isset($this->banner_details['documentation_url'])) { ?>
151 151
 							<a href="<?php echo $this->banner_details['documentation_url'] ?>" target="_blank">
152 152
 								<span class="dashicons dashicons-media-text"></span><?php
153 153
 								printf(
154 154
 								/* translators: %s: Add-on name */
155
-									esc_html__( 'Documentation: %s Add-on', 'give' ),
155
+									esc_html__('Documentation: %s Add-on', 'give'),
156 156
 									$this->banner_details['name']
157 157
 								);
158 158
 								?></a>
159 159
 						<?php } ?>
160 160
 						<?php
161 161
 						//Let them signup for plugin updates
162
-						if ( isset( $this->banner_details['support_url'] ) ) { ?>
162
+						if (isset($this->banner_details['support_url'])) { ?>
163 163
 
164 164
 							<a href="<?php echo $this->banner_details['support_url'] ?>" target="_blank">
165
-								<span class="dashicons dashicons-sos"></span><?php esc_html_e( 'Get Support', 'give' ); ?>
165
+								<span class="dashicons dashicons-sos"></span><?php esc_html_e('Get Support', 'give'); ?>
166 166
 							</a>
167 167
 
168 168
 						<?php } ?>
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
 			
177 177
 			
178 178
 			// Register notice.
179
-			Give()->notices->register_notice( array(
180
-				'id'          => 'give_' . sanitize_title( $this->banner_details['name'] ) . '_notice',
179
+			Give()->notices->register_notice(array(
180
+				'id'          => 'give_'.sanitize_title($this->banner_details['name']).'_notice',
181 181
 				'type'        => 'updated',
182 182
 				'description_html' => $notice_html,
183 183
 				'show'        => true,
184
-			) );
184
+			));
185 185
 		}
186 186
 	}
187 187
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 * @since 1.8.16
193 193
 	 * @access private
194 194
 	 */
195
-	private function print_css(){
195
+	private function print_css() {
196 196
 		?>
197 197
 		<style>
198 198
 			div.give-addon-alert.updated {
@@ -280,13 +280,13 @@  discard block
 block discarded – undo
280 280
 		 * If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not.
281 281
 		 * See here: http://codex.wordpress.org/Function_Reference/add_user_meta
282 282
 		 */
283
-		if ( isset( $_GET[ $this->nag_meta_key ] ) && '0' == $_GET[ $this->nag_meta_key ] ) {
283
+		if (isset($_GET[$this->nag_meta_key]) && '0' == $_GET[$this->nag_meta_key]) {
284 284
 
285 285
 			//Get the global user
286 286
 			$current_user = wp_get_current_user();
287 287
 			$user_id      = $current_user->ID;
288 288
 
289
-			add_user_meta( $user_id, $this->nag_meta_key, 'true', true );
289
+			add_user_meta($user_id, $this->nag_meta_key, 'true', true);
290 290
 		}
291 291
 	}
292 292
 
@@ -297,11 +297,11 @@  discard block
 block discarded – undo
297 297
 	 * @access private
298 298
 	 */
299 299
 	private function add_addon_activate_meta() {
300
-		$user_id                  = get_option( $this->activate_by_meta_key );
300
+		$user_id                  = get_option($this->activate_by_meta_key);
301 301
 		$this->plugin_activate_by = (int) $user_id;
302 302
 
303
-		if ( ! $user_id ) {
304
-			add_option( $this->activate_by_meta_key, $this->user_id, '', 'no' );
303
+		if ( ! $user_id) {
304
+			add_option($this->activate_by_meta_key, $this->user_id, '', 'no');
305 305
 			$this->plugin_activate_by = (int) $this->user_id;
306 306
 		}
307 307
 	}
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
 	 * @access public
315 315
 	 */
316 316
 	public function remove_addon_activate_meta() {
317
-		$user_id = get_option( $this->activate_by_meta_key );
317
+		$user_id = get_option($this->activate_by_meta_key);
318 318
 
319
-		if ( $user_id ) {
320
-			delete_option( $this->activate_by_meta_key );
319
+		if ($user_id) {
320
+			delete_option($this->activate_by_meta_key);
321 321
 		}
322 322
 	}
323 323
 
@@ -330,39 +330,39 @@  discard block
 block discarded – undo
330 330
 	 * @return mixed
331 331
 	 */
332 332
 	private function get_plugin_file_name() {
333
-		$active_plugins = get_option( 'active_plugins' );
333
+		$active_plugins = get_option('active_plugins');
334 334
 		$file_name      = '';
335 335
 
336 336
 		try {
337 337
 
338 338
 			// Check addon file path.
339
-			if ( ! empty( $this->banner_details['file'] ) ) {
339
+			if ( ! empty($this->banner_details['file'])) {
340 340
 				$file_name = '';
341
-				if ( $file_path = explode( '/plugins/', $this->banner_details['file'] ) ) {
342
-					$file_path = array_pop( $file_path );
343
-					$file_name = current( explode( '/', $file_path ) );
341
+				if ($file_path = explode('/plugins/', $this->banner_details['file'])) {
342
+					$file_path = array_pop($file_path);
343
+					$file_name = current(explode('/', $file_path));
344 344
 				}
345 345
 
346
-				if ( empty( $file_name ) ) {
346
+				if (empty($file_name)) {
347 347
 					return false;
348 348
 				}
349 349
 
350
-				foreach ( $active_plugins as $plugin ) {
351
-					if ( false !== strpos( $plugin, $file_name ) ) {
350
+				foreach ($active_plugins as $plugin) {
351
+					if (false !== strpos($plugin, $file_name)) {
352 352
 						$file_name = $plugin;
353 353
 						break;
354 354
 					}
355 355
 				}
356
-			} elseif ( WP_DEBUG ) {
357
-				throw new Exception( __( "File path must be added within the {$this->banner_details['name']} add-on in the banner details.", 'give' ) );
356
+			} elseif (WP_DEBUG) {
357
+				throw new Exception(__("File path must be added within the {$this->banner_details['name']} add-on in the banner details.", 'give'));
358 358
 			}
359 359
 
360 360
 			// Check plugin path calculated by addon file path.
361
-			if ( empty( $file_name ) && WP_DEBUG ) {
362
-				throw new Exception( __( "Empty add-on plugin path for {$this->banner_details['name']} add-on.", 'give' ) );
361
+			if (empty($file_name) && WP_DEBUG) {
362
+				throw new Exception(__("Empty add-on plugin path for {$this->banner_details['name']} add-on.", 'give'));
363 363
 			}
364 364
 
365
-		} catch ( Exception $e ) {
365
+		} catch (Exception $e) {
366 366
 			echo $e->getMessage();
367 367
 		}
368 368
 
Please login to merge, or discard this patch.
includes/admin/reports/graphing.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -819,12 +819,12 @@
 block discarded – undo
819 819
 	) ), 'give-refresh-reports' );
820 820
 
821 821
 	echo '<a href="'
822
-	     . esc_url_raw( $url )
823
-	     . '" data-tooltip="'. __( 'Clicking this will clear the reports cache.', 'give' )
824
-	     . '" data-tooltip-my-position="right center"  data-tooltip-target-position="left center" class="button alignright give-admin-button give-tooltip">'
825
-	     . '<span class="give-admin-button-icon give-admin-button-icon-update"></span>'
826
-	     . __( 'Refresh Report Data', 'give' )
827
-	     . '</a>';
822
+		 . esc_url_raw( $url )
823
+		 . '" data-tooltip="'. __( 'Clicking this will clear the reports cache.', 'give' )
824
+		 . '" data-tooltip-my-position="right center"  data-tooltip-target-position="left center" class="button alignright give-admin-button give-tooltip">'
825
+		 . '<span class="give-admin-button-icon give-admin-button-icon-update"></span>'
826
+		 . __( 'Refresh Report Data', 'give' )
827
+		 . '</a>';
828 828
 
829 829
 }
830 830
 
Please login to merge, or discard this patch.
Spacing   +247 added lines, -247 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
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	$dates = give_get_report_dates();
26 26
 
27 27
 	// Determine graph options.
28
-	switch ( $dates['range'] ) :
28
+	switch ($dates['range']) :
29 29
 		case 'today' :
30 30
 		case 'yesterday' :
31 31
 			$day_by_day = true;
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 			$day_by_day = false;
38 38
 			break;
39 39
 		case 'other' :
40
-			if ( $dates['m_end'] - $dates['m_start'] >= 2 || $dates['year_end'] > $dates['year'] && ( $dates['m_start'] != '12' && $dates['m_end'] != '1' ) ) {
40
+			if ($dates['m_end'] - $dates['m_start'] >= 2 || $dates['year_end'] > $dates['year'] && ($dates['m_start'] != '12' && $dates['m_end'] != '1')) {
41 41
 				$day_by_day = false;
42 42
 			} else {
43 43
 				$day_by_day = true;
@@ -54,57 +54,57 @@  discard block
 block discarded – undo
54 54
 	$earnings_data = array();
55 55
 	$sales_data    = array();
56 56
 
57
-	if ( $dates['range'] == 'today' || $dates['range'] == 'yesterday' ) {
57
+	if ($dates['range'] == 'today' || $dates['range'] == 'yesterday') {
58 58
 		// Hour by hour.
59 59
 		$hour  = 0;
60
-		$month = date( 'n', current_time( 'timestamp' ) );
61
-		while ( $hour <= 23 ) :
60
+		$month = date('n', current_time('timestamp'));
61
+		while ($hour <= 23) :
62 62
 
63
-			$sales    = give_get_sales_by_date( $dates['day'], $month, $dates['year'], $hour );
64
-			$earnings = give_get_earnings_by_date( $dates['day'], $month, $dates['year'], $hour );
63
+			$sales    = give_get_sales_by_date($dates['day'], $month, $dates['year'], $hour);
64
+			$earnings = give_get_earnings_by_date($dates['day'], $month, $dates['year'], $hour);
65 65
 
66 66
 			$sales_totals += $sales;
67 67
 			$earnings_totals += $earnings;
68 68
 
69
-			$date            = mktime( $hour, 0, 0, $month, $dates['day'], $dates['year'] ) * 1000;
69
+			$date            = mktime($hour, 0, 0, $month, $dates['day'], $dates['year']) * 1000;
70 70
 
71
-			$sales_data[]    = array( $date, $sales );
72
-			$earnings_data[] = array( $date, $earnings );
71
+			$sales_data[]    = array($date, $sales);
72
+			$earnings_data[] = array($date, $earnings);
73 73
 
74
-			$hour ++;
74
+			$hour++;
75 75
 		endwhile;
76 76
 
77
-	} elseif ( $dates['range'] == 'this_week' || $dates['range'] == 'last_week' ) {
77
+	} elseif ($dates['range'] == 'this_week' || $dates['range'] == 'last_week') {
78 78
 
79 79
 		// Day by day.
80 80
 		$day     = $dates['day'];
81 81
 		$day_end = $dates['day_end'];
82 82
 		$month   = $dates['m_start'];
83
-		while ( $day <= $day_end ) :
84
-			$sales = give_get_sales_by_date( $day, $month, $dates['year'] );
83
+		while ($day <= $day_end) :
84
+			$sales = give_get_sales_by_date($day, $month, $dates['year']);
85 85
 			$sales_totals += $sales;
86 86
 
87
-			$earnings = give_get_earnings_by_date( $day, $month, $dates['year'] );
87
+			$earnings = give_get_earnings_by_date($day, $month, $dates['year']);
88 88
 			$earnings_totals += $earnings;
89 89
 
90
-			$date            = mktime( 0, 0, 0, $month, $day, $dates['year'] ) * 1000;
91
-			$sales_data[]    = array( $date, $sales );
92
-			$earnings_data[] = array( $date, $earnings );
93
-			$day ++;
90
+			$date            = mktime(0, 0, 0, $month, $day, $dates['year']) * 1000;
91
+			$sales_data[]    = array($date, $sales);
92
+			$earnings_data[] = array($date, $earnings);
93
+			$day++;
94 94
 		endwhile;
95 95
 
96 96
 	} else {
97 97
 
98 98
 		$y = $dates['year'];
99
-		while ( $y <= $dates['year_end'] ) :
99
+		while ($y <= $dates['year_end']) :
100 100
 
101
-			if ( $dates['year'] == $dates['year_end'] ) {
101
+			if ($dates['year'] == $dates['year_end']) {
102 102
 				$month_start = $dates['m_start'];
103 103
 				$month_end   = $dates['m_end'];
104
-			} elseif ( $y == $dates['year'] ) {
104
+			} elseif ($y == $dates['year']) {
105 105
 				$month_start = $dates['m_start'];
106 106
 				$month_end   = 12;
107
-			} elseif ( $y == $dates['year_end'] ) {
107
+			} elseif ($y == $dates['year_end']) {
108 108
 				$month_start = 1;
109 109
 				$month_end   = $dates['m_end'];
110 110
 			} else {
@@ -113,48 +113,48 @@  discard block
 block discarded – undo
113 113
 			}
114 114
 
115 115
 			$i = $month_start;
116
-			while ( $i <= $month_end ) :
116
+			while ($i <= $month_end) :
117 117
 
118
-				if ( $day_by_day ) {
118
+				if ($day_by_day) {
119 119
 
120
-					if ( $i == $month_end ) {
120
+					if ($i == $month_end) {
121 121
 
122 122
 						$num_of_days = $dates['day_end'];
123 123
 
124 124
 					} else {
125 125
 
126
-						$num_of_days = cal_days_in_month( CAL_GREGORIAN, $i, $y );
126
+						$num_of_days = cal_days_in_month(CAL_GREGORIAN, $i, $y);
127 127
 
128 128
 					}
129 129
 
130 130
 					$d = $dates['day'];
131 131
 
132
-					while ( $d <= $num_of_days ) :
132
+					while ($d <= $num_of_days) :
133 133
 
134
-						$sales = give_get_sales_by_date( $d, $i, $y );
134
+						$sales = give_get_sales_by_date($d, $i, $y);
135 135
 						$sales_totals += $sales;
136 136
 
137
-						$earnings = give_get_earnings_by_date( $d, $i, $y );
137
+						$earnings = give_get_earnings_by_date($d, $i, $y);
138 138
 						$earnings_totals += $earnings;
139 139
 
140
-						$date            = mktime( 0, 0, 0, $i, $d, $y ) * 1000;
141
-						$sales_data[]    = array( $date, $sales );
142
-						$earnings_data[] = array( $date, $earnings );
143
-						$d ++;
140
+						$date            = mktime(0, 0, 0, $i, $d, $y) * 1000;
141
+						$sales_data[]    = array($date, $sales);
142
+						$earnings_data[] = array($date, $earnings);
143
+						$d++;
144 144
 
145 145
 					endwhile;
146 146
 
147 147
 				} else {
148 148
 
149
-					$sales = give_get_sales_by_date( null, $i, $y );
149
+					$sales = give_get_sales_by_date(null, $i, $y);
150 150
 					$sales_totals += $sales;
151 151
 
152
-					$earnings = give_get_earnings_by_date( null, $i, $y );
152
+					$earnings = give_get_earnings_by_date(null, $i, $y);
153 153
 					$earnings_totals += $earnings;
154 154
 
155
-					if ( $i == $month_end ) {
155
+					if ($i == $month_end) {
156 156
 
157
-						$num_of_days = cal_days_in_month( CAL_GREGORIAN, $i, $y );
157
+						$num_of_days = cal_days_in_month(CAL_GREGORIAN, $i, $y);
158 158
 
159 159
 					} else {
160 160
 
@@ -162,24 +162,24 @@  discard block
 block discarded – undo
162 162
 
163 163
 					}
164 164
 
165
-					$date            = mktime( 0, 0, 0, $i, $num_of_days, $y ) * 1000;
166
-					$sales_data[]    = array( $date, $sales );
167
-					$earnings_data[] = array( $date, $earnings );
165
+					$date            = mktime(0, 0, 0, $i, $num_of_days, $y) * 1000;
166
+					$sales_data[]    = array($date, $sales);
167
+					$earnings_data[] = array($date, $earnings);
168 168
 
169 169
 				}
170 170
 
171
-				$i ++;
171
+				$i++;
172 172
 
173 173
 			endwhile;
174 174
 
175
-			$y ++;
175
+			$y++;
176 176
 		endwhile;
177 177
 
178 178
 	}
179 179
 
180 180
 	$data = array(
181
-		__( 'Income', 'give' )    => $earnings_data,
182
-		__( 'Donations', 'give' ) => $sales_data
181
+		__('Income', 'give')    => $earnings_data,
182
+		__('Donations', 'give') => $sales_data
183 183
 	);
184 184
 
185 185
 	// start our own output buffer.
@@ -192,12 +192,12 @@  discard block
 block discarded – undo
192 192
 				<div class="inside">
193 193
 					<?php give_reports_graph_controls(); ?>
194 194
 					<?php
195
-					$graph = new Give_Graph( $data, array( 'dataType' => array( 'amount', 'count' ) ) );
196
-					$graph->set( 'x_mode', 'time' );
197
-					$graph->set( 'multiple_y_axes', true );
195
+					$graph = new Give_Graph($data, array('dataType' => array('amount', 'count')));
196
+					$graph->set('x_mode', 'time');
197
+					$graph->set('multiple_y_axes', true);
198 198
 					$graph->display();
199 199
 
200
-					if ( 'this_month' === $dates['range'] ) {
200
+					if ('this_month' === $dates['range']) {
201 201
 						$estimated = give_estimated_monthly_stats();
202 202
 					}
203 203
 					?>
@@ -206,21 +206,21 @@  discard block
 block discarded – undo
206 206
 			<table class="widefat reports-table alignleft" style="max-width:450px">
207 207
 				<tbody>
208 208
 				<tr>
209
-					<th scope="row"><strong><?php _e( 'Total income for period:', 'give' ); ?></strong></th>
210
-					<td><?php echo give_currency_filter( give_format_amount( $earnings_totals, array( 'sanitize' => false ) ) ); ?></td>
209
+					<th scope="row"><strong><?php _e('Total income for period:', 'give'); ?></strong></th>
210
+					<td><?php echo give_currency_filter(give_format_amount($earnings_totals, array('sanitize' => false))); ?></td>
211 211
 				</tr>
212 212
 				<tr class="alternate">
213
-					<th scope="row"><strong><?php _e( 'Total donations for period:', 'give' ); ?><strong></th>
213
+					<th scope="row"><strong><?php _e('Total donations for period:', 'give'); ?><strong></th>
214 214
 					<td><?php echo $sales_totals; ?></td>
215 215
 				</tr>
216
-				<?php if ( 'this_month' == $dates['range'] ) : ?>
216
+				<?php if ('this_month' == $dates['range']) : ?>
217 217
 					<tr>
218
-						<th scope="row"><strong><?php _e( 'Estimated monthly income:', 'give' ); ?></strong></th>
219
-						<td><?php echo give_currency_filter( give_format_amount( $estimated['earnings'], array( 'sanitize' => false ) ) ); ?></td>
218
+						<th scope="row"><strong><?php _e('Estimated monthly income:', 'give'); ?></strong></th>
219
+						<td><?php echo give_currency_filter(give_format_amount($estimated['earnings'], array('sanitize' => false))); ?></td>
220 220
 					</tr>
221 221
 					<tr class="alternate">
222
-						<th scope="row"><strong><?php _e( 'Estimated monthly donations:', 'give' ); ?></strong></th>
223
-						<td><?php echo floor( $estimated['sales'] ); ?></td>
222
+						<th scope="row"><strong><?php _e('Estimated monthly donations:', 'give'); ?></strong></th>
223
+						<td><?php echo floor($estimated['sales']); ?></td>
224 224
 					</tr>
225 225
 				<?php endif; ?>
226 226
 			</table>
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 			 *
234 234
 			 * @since 1.0
235 235
 			 */
236
-			do_action( 'give_reports_graph_additional_stats' );
236
+			do_action('give_reports_graph_additional_stats');
237 237
 			?>
238 238
 
239 239
 		</div>
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
  *
254 254
  * @return void
255 255
  */
256
-function give_reports_graph_of_form( $form_id = 0 ) {
256
+function give_reports_graph_of_form($form_id = 0) {
257 257
 	// Retrieve the queried dates.
258 258
 	$dates = give_get_report_dates();
259 259
 
260 260
 	// Determine graph options.
261
-	switch ( $dates['range'] ) :
261
+	switch ($dates['range']) :
262 262
 		case 'today' :
263 263
 		case 'yesterday' :
264 264
 			$day_by_day = true;
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 			$day_by_day = false;
277 277
 			break;
278 278
 		case 'other' :
279
-			if ( $dates['m_end'] - $dates['m_start'] >= 2 || $dates['year_end'] > $dates['year'] ) {
279
+			if ($dates['m_end'] - $dates['m_start'] >= 2 || $dates['year_end'] > $dates['year']) {
280 280
 				$day_by_day = false;
281 281
 			} else {
282 282
 				$day_by_day = true;
@@ -288,75 +288,75 @@  discard block
 block discarded – undo
288 288
 	endswitch;
289 289
 
290 290
 	$earnings_totals = (float) 0.00; // Total earnings for time period shown.
291
-	$sales_totals    = 0;            // Total sales for time period shown.
291
+	$sales_totals    = 0; // Total sales for time period shown.
292 292
 
293 293
 	$earnings_data = array();
294 294
 	$sales_data    = array();
295 295
 	$stats         = new Give_Payment_Stats;
296 296
 
297
-	if ( $dates['range'] == 'today' || $dates['range'] == 'yesterday' ) {
297
+	if ($dates['range'] == 'today' || $dates['range'] == 'yesterday') {
298 298
 
299 299
 		// Hour by hour
300 300
 		$month  = $dates['m_start'];
301 301
 		$hour   = 0;
302 302
 		$minute = 0;
303 303
 		$second = 0;
304
-		while ( $hour <= 23 ) :
304
+		while ($hour <= 23) :
305 305
 
306
-			if ( $hour == 23 ) {
306
+			if ($hour == 23) {
307 307
 				$minute = $second = 59;
308 308
 			}
309 309
 
310
-			$date     = mktime( $hour, $minute, $second, $month, $dates['day'], $dates['year'] );
311
-			$date_end = mktime( $hour + 1, $minute, $second, $month, $dates['day'], $dates['year'] );
310
+			$date     = mktime($hour, $minute, $second, $month, $dates['day'], $dates['year']);
311
+			$date_end = mktime($hour + 1, $minute, $second, $month, $dates['day'], $dates['year']);
312 312
 
313
-			$sales = $stats->get_sales( $form_id, $date, $date_end );
313
+			$sales = $stats->get_sales($form_id, $date, $date_end);
314 314
 			$sales_totals += $sales;
315 315
 
316
-			$earnings = $stats->get_earnings( $form_id, $date, $date_end );
316
+			$earnings = $stats->get_earnings($form_id, $date, $date_end);
317 317
 			$earnings_totals += $earnings;
318 318
 
319
-			$sales_data[]    = array( $date * 1000, $sales );
320
-			$earnings_data[] = array( $date * 1000, $earnings );
319
+			$sales_data[]    = array($date * 1000, $sales);
320
+			$earnings_data[] = array($date * 1000, $earnings);
321 321
 
322
-			$hour ++;
322
+			$hour++;
323 323
 		endwhile;
324 324
 
325
-	} elseif ( $dates['range'] == 'this_week' || $dates['range'] == 'last_week' ) {
325
+	} elseif ($dates['range'] == 'this_week' || $dates['range'] == 'last_week') {
326 326
 
327 327
 		//Day by day.
328 328
 		$day     = $dates['day'];
329 329
 		$day_end = $dates['day_end'];
330 330
 		$month   = $dates['m_start'];
331
-		while ( $day <= $day_end ) :
331
+		while ($day <= $day_end) :
332 332
 
333
-			$date     = mktime( 0, 0, 0, $month, $day, $dates['year'] );
334
-			$date_end = mktime( 0, 0, 0, $month, $day + 1, $dates['year'] );
335
-			$sales    = $stats->get_sales( $form_id, $date, $date_end );
333
+			$date     = mktime(0, 0, 0, $month, $day, $dates['year']);
334
+			$date_end = mktime(0, 0, 0, $month, $day + 1, $dates['year']);
335
+			$sales    = $stats->get_sales($form_id, $date, $date_end);
336 336
 			$sales_totals += $sales;
337 337
 
338
-			$earnings = $stats->get_earnings( $form_id, $date, $date_end );
338
+			$earnings = $stats->get_earnings($form_id, $date, $date_end);
339 339
 			$earnings_totals += $earnings;
340 340
 
341
-			$sales_data[]    = array( $date * 1000, $sales );
342
-			$earnings_data[] = array( $date * 1000, $earnings );
341
+			$sales_data[]    = array($date * 1000, $sales);
342
+			$earnings_data[] = array($date * 1000, $earnings);
343 343
 
344
-			$day ++;
344
+			$day++;
345 345
 		endwhile;
346 346
 
347 347
 	} else {
348 348
 
349 349
 		$y = $dates['year'];
350 350
 
351
-		while ( $y <= $dates['year_end'] ) :
351
+		while ($y <= $dates['year_end']) :
352 352
 
353 353
 			$last_year = false;
354 354
 
355
-			if ( $dates['year'] == $dates['year_end'] ) {
355
+			if ($dates['year'] == $dates['year_end']) {
356 356
 				$month_start = $dates['m_start'];
357 357
 				$month_end   = $dates['m_end'];
358 358
 				$last_year   = true;
359
-			} elseif ( $y == $dates['year'] ) {
359
+			} elseif ($y == $dates['year']) {
360 360
 				$month_start = $dates['m_start'];
361 361
 				$month_end   = 12;
362 362
 			} else {
@@ -365,76 +365,76 @@  discard block
 block discarded – undo
365 365
 			}
366 366
 
367 367
 			$i = $month_start;
368
-			while ( $i <= $month_end ) :
368
+			while ($i <= $month_end) :
369 369
 
370
-				if ( $day_by_day ) {
370
+				if ($day_by_day) {
371 371
 
372
-					if ( $i == $month_end && $last_year ) {
372
+					if ($i == $month_end && $last_year) {
373 373
 
374 374
 						$num_of_days = $dates['day_end'];
375 375
 
376 376
 					} else {
377 377
 
378
-						$num_of_days = cal_days_in_month( CAL_GREGORIAN, $i, $y );
378
+						$num_of_days = cal_days_in_month(CAL_GREGORIAN, $i, $y);
379 379
 
380 380
 					}
381 381
 
382 382
 					$d = $dates['day'];
383
-					while ( $d <= $num_of_days ) :
383
+					while ($d <= $num_of_days) :
384 384
 
385
-						$date     = mktime( 0, 0, 0, $i, $d, $y );
386
-						$end_date = mktime( 23, 59, 59, $i, $d, $y );
385
+						$date     = mktime(0, 0, 0, $i, $d, $y);
386
+						$end_date = mktime(23, 59, 59, $i, $d, $y);
387 387
 
388
-						$sales = $stats->get_sales( $form_id, $date, $end_date );
388
+						$sales = $stats->get_sales($form_id, $date, $end_date);
389 389
 						$sales_totals += $sales;
390 390
 
391
-						$earnings = $stats->get_earnings( $form_id, $date, $end_date );
391
+						$earnings = $stats->get_earnings($form_id, $date, $end_date);
392 392
 						$earnings_totals += $earnings;
393 393
 
394
-						$sales_data[]    = array( $date * 1000, $sales );
395
-						$earnings_data[] = array( $date * 1000, $earnings );
396
-						$d ++;
394
+						$sales_data[]    = array($date * 1000, $sales);
395
+						$earnings_data[] = array($date * 1000, $earnings);
396
+						$d++;
397 397
 
398 398
 					endwhile;
399 399
 
400 400
 				} else {
401 401
 
402
-					$num_of_days = cal_days_in_month( CAL_GREGORIAN, $i, $y );
402
+					$num_of_days = cal_days_in_month(CAL_GREGORIAN, $i, $y);
403 403
 
404
-					$date     = mktime( 0, 0, 0, $i, 1, $y );
405
-					$end_date = mktime( 23, 59, 59, $i, $num_of_days, $y );
404
+					$date     = mktime(0, 0, 0, $i, 1, $y);
405
+					$end_date = mktime(23, 59, 59, $i, $num_of_days, $y);
406 406
 
407
-					$sales = $stats->get_sales( $form_id, $date, $end_date );
407
+					$sales = $stats->get_sales($form_id, $date, $end_date);
408 408
 					$sales_totals += $sales;
409 409
 
410
-					$earnings = $stats->get_earnings( $form_id, $date, $end_date );
410
+					$earnings = $stats->get_earnings($form_id, $date, $end_date);
411 411
 					$earnings_totals += $earnings;
412 412
 
413
-					$sales_data[]    = array( $date * 1000, $sales );
414
-					$earnings_data[] = array( $date * 1000, $earnings );
413
+					$sales_data[]    = array($date * 1000, $sales);
414
+					$earnings_data[] = array($date * 1000, $earnings);
415 415
 
416 416
 				}
417 417
 
418
-				$i ++;
418
+				$i++;
419 419
 
420 420
 			endwhile;
421 421
 
422
-			$y ++;
422
+			$y++;
423 423
 		endwhile;
424 424
 
425 425
 	}
426 426
 
427 427
 	$data = array(
428
-		__( 'Income', 'give' )    => $earnings_data,
429
-		__( 'Donations', 'give' ) => $sales_data
428
+		__('Income', 'give')    => $earnings_data,
429
+		__('Donations', 'give') => $sales_data
430 430
 	);
431 431
 
432 432
 	?>
433 433
 	<h3><span><?php
434 434
 			printf(
435 435
 			/* translators: %s: form title */
436
-				esc_html__( 'Income Report for %s', 'give' ),
437
-				get_the_title( $form_id )
436
+				esc_html__('Income Report for %s', 'give'),
437
+				get_the_title($form_id)
438 438
 			);
439 439
 			?></span></h3>
440 440
 	<div id="give-dashboard-widgets-wrap">
@@ -443,9 +443,9 @@  discard block
 block discarded – undo
443 443
 				<div class="inside">
444 444
 					<?php give_reports_graph_controls(); ?>
445 445
 					<?php
446
-					$graph = new Give_Graph( $data, array( 'dataType' => array( 'amount', 'count' ) ) );
447
-					$graph->set( 'x_mode', 'time' );
448
-					$graph->set( 'multiple_y_axes', true );
446
+					$graph = new Give_Graph($data, array('dataType' => array('amount', 'count')));
447
+					$graph->set('x_mode', 'time');
448
+					$graph->set('multiple_y_axes', true);
449 449
 					$graph->display();
450 450
 					?>
451 451
 				</div>
@@ -454,20 +454,20 @@  discard block
 block discarded – undo
454 454
 			<table class="widefat reports-table alignleft" style="max-width:450px">
455 455
 				<tbody>
456 456
 				<tr>
457
-					<th scope="row"><strong><?php _e( 'Total income for period:', 'give' ); ?></strong></th>
458
-					<td><?php echo give_currency_filter( give_format_amount( $earnings_totals, array( 'sanitize' => false ) ) ); ?></td>
457
+					<th scope="row"><strong><?php _e('Total income for period:', 'give'); ?></strong></th>
458
+					<td><?php echo give_currency_filter(give_format_amount($earnings_totals, array('sanitize' => false))); ?></td>
459 459
 				</tr>
460 460
 				<tr class="alternate">
461
-					<th scope="row"><strong><?php _e( 'Total donations for period:', 'give' ); ?></strong></th>
461
+					<th scope="row"><strong><?php _e('Total donations for period:', 'give'); ?></strong></th>
462 462
 					<td><?php echo $sales_totals; ?></td>
463 463
 				</tr>
464 464
 				<tr>
465
-					<th scope="row"><strong><?php _e( 'Average monthly income:', 'give' ); ?></strong></th>
466
-					<td><?php echo give_currency_filter( give_format_amount( give_get_average_monthly_form_earnings( $form_id ), array( 'sanitize' => false ) ) ); ?></td>
465
+					<th scope="row"><strong><?php _e('Average monthly income:', 'give'); ?></strong></th>
466
+					<td><?php echo give_currency_filter(give_format_amount(give_get_average_monthly_form_earnings($form_id), array('sanitize' => false))); ?></td>
467 467
 				</tr>
468 468
 				<tr class="alternate">
469
-					<th scope="row"><strong><?php _e( 'Average monthly donations:', 'give' ); ?></strong></th>
470
-					<td><?php echo number_format( give_get_average_monthly_form_sales( $form_id ), 0 ); ?></td>
469
+					<th scope="row"><strong><?php _e('Average monthly donations:', 'give'); ?></strong></th>
470
+					<td><?php echo number_format(give_get_average_monthly_form_sales($form_id), 0); ?></td>
471 471
 				</tr>
472 472
 				</tbody>
473 473
 			</table>
@@ -486,26 +486,26 @@  discard block
 block discarded – undo
486 486
  * @return void
487 487
  */
488 488
 function give_reports_graph_controls() {
489
-	$date_options = apply_filters( 'give_report_date_options', array(
490
-		'today'        => __( 'Today', 'give' ),
491
-		'yesterday'    => __( 'Yesterday', 'give' ),
492
-		'this_week'    => __( 'This Week', 'give' ),
493
-		'last_week'    => __( 'Last Week', 'give' ),
494
-		'this_month'   => __( 'This Month', 'give' ),
495
-		'last_month'   => __( 'Last Month', 'give' ),
496
-		'this_quarter' => __( 'This Quarter', 'give' ),
497
-		'last_quarter' => __( 'Last Quarter', 'give' ),
498
-		'this_year'    => __( 'This Year', 'give' ),
499
-		'last_year'    => __( 'Last Year', 'give' ),
500
-		'other'        => __( 'Custom', 'give' )
501
-	) );
489
+	$date_options = apply_filters('give_report_date_options', array(
490
+		'today'        => __('Today', 'give'),
491
+		'yesterday'    => __('Yesterday', 'give'),
492
+		'this_week'    => __('This Week', 'give'),
493
+		'last_week'    => __('Last Week', 'give'),
494
+		'this_month'   => __('This Month', 'give'),
495
+		'last_month'   => __('Last Month', 'give'),
496
+		'this_quarter' => __('This Quarter', 'give'),
497
+		'last_quarter' => __('Last Quarter', 'give'),
498
+		'this_year'    => __('This Year', 'give'),
499
+		'last_year'    => __('Last Year', 'give'),
500
+		'other'        => __('Custom', 'give')
501
+	));
502 502
 
503 503
 	$dates   = give_get_report_dates();
504 504
 	$display = $dates['range'] == 'other' ? '' : 'display: none;';
505
-	$tab     = isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : 'earnings';
505
+	$tab     = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : 'earnings';
506 506
 
507
-	if ( empty( $dates['day_end'] ) ) {
508
-		$dates['day_end'] = cal_days_in_month( CAL_GREGORIAN, date( 'n' ), date( 'Y' ) );
507
+	if (empty($dates['day_end'])) {
508
+		$dates['day_end'] = cal_days_in_month(CAL_GREGORIAN, date('n'), date('Y'));
509 509
 	}
510 510
 
511 511
 	/**
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 	 *
514 514
 	 * @since 1.0
515 515
 	 */
516
-	do_action( 'give_report_graph_controls_before' );
516
+	do_action('give_report_graph_controls_before');
517 517
 	?>
518 518
 	<form id="give-graphs-filter" method="get">
519 519
 		<div class="tablenav top">
@@ -521,56 +521,56 @@  discard block
 block discarded – undo
521 521
 
522 522
 				<input type="hidden" name="post_type" value="give_forms" />
523 523
 				<input type="hidden" name="page" value="give-reports" />
524
-				<input type="hidden" name="tab" value="<?php echo esc_attr( $tab ); ?>" />
524
+				<input type="hidden" name="tab" value="<?php echo esc_attr($tab); ?>" />
525 525
 
526
-				<?php if ( isset( $_GET['form-id'] ) ) : ?>
527
-					<input type="hidden" name="form-id" value="<?php echo absint( $_GET['form-id'] ); ?>" />
526
+				<?php if (isset($_GET['form-id'])) : ?>
527
+					<input type="hidden" name="form-id" value="<?php echo absint($_GET['form-id']); ?>" />
528 528
 				<?php endif; ?>
529 529
 
530 530
 				<div id="give-graphs-date-options-wrap">
531 531
 					<select id="give-graphs-date-options" name="range">
532
-						<?php foreach ( $date_options as $key => $option ) : ?>
533
-							<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $dates['range'] ); ?>><?php echo esc_html( $option ); ?></option>
532
+						<?php foreach ($date_options as $key => $option) : ?>
533
+							<option value="<?php echo esc_attr($key); ?>"<?php selected($key, $dates['range']); ?>><?php echo esc_html($option); ?></option>
534 534
 						<?php endforeach; ?>
535 535
 					</select>
536 536
 
537
-					<div id="give-date-range-options" style="<?php echo esc_attr( $display ); ?>">
538
-						<span class="screen-reader-text"><?php _e( 'From', 'give' ); ?>&nbsp;</span>
537
+					<div id="give-date-range-options" style="<?php echo esc_attr($display); ?>">
538
+						<span class="screen-reader-text"><?php _e('From', 'give'); ?>&nbsp;</span>
539 539
 						<select id="give-graphs-month-start" name="m_start" aria-label="Start Month">
540
-							<?php for ( $i = 1; $i <= 12; $i ++ ) : ?>
541
-								<option value="<?php echo absint( $i ); ?>" <?php echo esc_attr( selected( $i, $dates['m_start'] ) ); ?>><?php echo esc_html( give_month_num_to_name( $i ) ); ?></option>
540
+							<?php for ($i = 1; $i <= 12; $i++) : ?>
541
+								<option value="<?php echo absint($i); ?>" <?php echo esc_attr(selected($i, $dates['m_start'])); ?>><?php echo esc_html(give_month_num_to_name($i)); ?></option>
542 542
 							<?php endfor; ?>
543 543
 						</select>
544 544
 						<select id="give-graphs-day-start" name="day" aria-label="Start Day">
545
-							<?php for ( $i = 1; $i <= 31; $i ++ ) : ?>
546
-								<option value="<?php echo absint( $i ); ?>" <?php echo esc_attr( selected( $i, $dates['day'] ) ); ?>><?php echo esc_html( $i ); ?></option>
545
+							<?php for ($i = 1; $i <= 31; $i++) : ?>
546
+								<option value="<?php echo absint($i); ?>" <?php echo esc_attr(selected($i, $dates['day'])); ?>><?php echo esc_html($i); ?></option>
547 547
 							<?php endfor; ?>
548 548
 						</select>
549 549
 						<select id="give-graphs-year-start" name="year" aria-label="Start Year">
550
-							<?php for ( $i = 2007; $i <= date( 'Y' ); $i ++ ) : ?>
551
-								<option value="<?php echo absint( $i ); ?>" <?php echo esc_attr( selected( $i, $dates['year'] ) ); ?>><?php echo esc_html( $i ); ?></option>
550
+							<?php for ($i = 2007; $i <= date('Y'); $i++) : ?>
551
+								<option value="<?php echo absint($i); ?>" <?php echo esc_attr(selected($i, $dates['year'])); ?>><?php echo esc_html($i); ?></option>
552 552
 							<?php endfor; ?>
553 553
 						</select>
554
-						<span class="screen-reader-text"><?php esc_html_e( 'To', 'give' ); ?>&nbsp;</span>
554
+						<span class="screen-reader-text"><?php esc_html_e('To', 'give'); ?>&nbsp;</span>
555 555
 						<span>&ndash;</span>
556 556
 						<select id="give-graphs-month-end" name="m_end" aria-label="End Month">
557
-							<?php for ( $i = 1; $i <= 12; $i ++ ) : ?>
558
-								<option value="<?php echo absint( $i ); ?>" <?php echo esc_attr( selected( $i, $dates['m_end'] ) ); ?>><?php echo esc_html( give_month_num_to_name( $i ) ); ?></option>
557
+							<?php for ($i = 1; $i <= 12; $i++) : ?>
558
+								<option value="<?php echo absint($i); ?>" <?php echo esc_attr(selected($i, $dates['m_end'])); ?>><?php echo esc_html(give_month_num_to_name($i)); ?></option>
559 559
 							<?php endfor; ?>
560 560
 						</select>
561 561
 						<select id="give-graphs-day-end" name="day_end" aria-label="End Day">
562
-							<?php for ( $i = 1; $i <= 31; $i ++ ) : ?>
563
-								<option value="<?php echo absint( $i ); ?>" <?php echo esc_attr( selected( $i, $dates['day_end'] ) ); ?>><?php echo esc_html( $i ); ?></option>
562
+							<?php for ($i = 1; $i <= 31; $i++) : ?>
563
+								<option value="<?php echo absint($i); ?>" <?php echo esc_attr(selected($i, $dates['day_end'])); ?>><?php echo esc_html($i); ?></option>
564 564
 							<?php endfor; ?>
565 565
 						</select>
566 566
 						<select id="give-graphs-year-end" name="year_end" aria-label="End Year">
567
-							<?php for ( $i = 2007; $i <= date( 'Y' ); $i ++ ) : ?>
568
-								<option value="<?php echo absint( $i ); ?>" <?php echo esc_attr( selected( $i, $dates['year_end'] ) ); ?>><?php echo esc_html( $i ); ?></option>
567
+							<?php for ($i = 2007; $i <= date('Y'); $i++) : ?>
568
+								<option value="<?php echo absint($i); ?>" <?php echo esc_attr(selected($i, $dates['year_end'])); ?>><?php echo esc_html($i); ?></option>
569 569
 							<?php endfor; ?>
570 570
 						</select>
571 571
 					</div>
572 572
 
573
-					<input type="submit" class="button-secondary" value="<?php _e( 'Filter', 'give' ); ?>" />
573
+					<input type="submit" class="button-secondary" value="<?php _e('Filter', 'give'); ?>" />
574 574
 				</div>
575 575
 
576 576
 				<input type="hidden" name="give_action" value="filter_reports" />
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 	 *
584 584
 	 * @since 1.0
585 585
 	 */
586
-	do_action( 'give_report_graph_controls_after' );
586
+	do_action('give_report_graph_controls_after');
587 587
 }
588 588
 
589 589
 /**
@@ -599,67 +599,67 @@  discard block
 block discarded – undo
599 599
 function give_get_report_dates() {
600 600
 	$dates = array();
601 601
 
602
-	$current_time = current_time( 'timestamp' );
602
+	$current_time = current_time('timestamp');
603 603
 
604
-	$dates['range']    = isset( $_GET['range'] ) ? $_GET['range'] : 'this_month';
605
-	$dates['year']     = isset( $_GET['year'] ) ? $_GET['year'] : date( 'Y' );
606
-	$dates['year_end'] = isset( $_GET['year_end'] ) ? $_GET['year_end'] : date( 'Y' );
607
-	$dates['m_start']  = isset( $_GET['m_start'] ) ? $_GET['m_start'] : 1;
608
-	$dates['m_end']    = isset( $_GET['m_end'] ) ? $_GET['m_end'] : 12;
609
-	$dates['day']      = isset( $_GET['day'] ) ? $_GET['day'] : 1;
610
-	$dates['day_end']  = isset( $_GET['day_end'] ) ? $_GET['day_end'] : cal_days_in_month( CAL_GREGORIAN, $dates['m_end'], $dates['year'] );
604
+	$dates['range']    = isset($_GET['range']) ? $_GET['range'] : 'this_month';
605
+	$dates['year']     = isset($_GET['year']) ? $_GET['year'] : date('Y');
606
+	$dates['year_end'] = isset($_GET['year_end']) ? $_GET['year_end'] : date('Y');
607
+	$dates['m_start']  = isset($_GET['m_start']) ? $_GET['m_start'] : 1;
608
+	$dates['m_end']    = isset($_GET['m_end']) ? $_GET['m_end'] : 12;
609
+	$dates['day']      = isset($_GET['day']) ? $_GET['day'] : 1;
610
+	$dates['day_end']  = isset($_GET['day_end']) ? $_GET['day_end'] : cal_days_in_month(CAL_GREGORIAN, $dates['m_end'], $dates['year']);
611 611
 
612 612
 	// Modify dates based on predefined ranges.
613
-	switch ( $dates['range'] ) :
613
+	switch ($dates['range']) :
614 614
 
615 615
 		case 'this_month' :
616
-			$dates['m_start']  = date( 'n', $current_time );
617
-			$dates['m_end']    = date( 'n', $current_time );
616
+			$dates['m_start']  = date('n', $current_time);
617
+			$dates['m_end']    = date('n', $current_time);
618 618
 			$dates['day']      = 1;
619
-			$dates['day_end']  = cal_days_in_month( CAL_GREGORIAN, $dates['m_end'], $dates['year'] );
620
-			$dates['year']     = date( 'Y' );
621
-			$dates['year_end'] = date( 'Y' );
619
+			$dates['day_end']  = cal_days_in_month(CAL_GREGORIAN, $dates['m_end'], $dates['year']);
620
+			$dates['year']     = date('Y');
621
+			$dates['year_end'] = date('Y');
622 622
 			break;
623 623
 
624 624
 		case 'last_month' :
625
-			if ( date( 'n' ) == 1 ) {
625
+			if (date('n') == 1) {
626 626
 				$dates['m_start']  = 12;
627 627
 				$dates['m_end']    = 12;
628
-				$dates['year']     = date( 'Y', $current_time ) - 1;
629
-				$dates['year_end'] = date( 'Y', $current_time ) - 1;
628
+				$dates['year']     = date('Y', $current_time) - 1;
629
+				$dates['year_end'] = date('Y', $current_time) - 1;
630 630
 			} else {
631
-				$dates['m_start']  = date( 'n' ) - 1;
632
-				$dates['m_end']    = date( 'n' ) - 1;
631
+				$dates['m_start']  = date('n') - 1;
632
+				$dates['m_end']    = date('n') - 1;
633 633
 				$dates['year_end'] = $dates['year'];
634 634
 			}
635
-			$dates['day_end'] = cal_days_in_month( CAL_GREGORIAN, $dates['m_end'], $dates['year'] );
635
+			$dates['day_end'] = cal_days_in_month(CAL_GREGORIAN, $dates['m_end'], $dates['year']);
636 636
 			break;
637 637
 
638 638
 		case 'today' :
639
-			$dates['day']      = date( 'd', $current_time );
640
-			$dates['day_end']  = date( 'd', $current_time );
641
-			$dates['m_start']  = date( 'n', $current_time );
642
-			$dates['m_end']    = date( 'n', $current_time );
643
-			$dates['year']     = date( 'Y', $current_time );
644
-			$dates['year_end'] = date( 'Y', $current_time );
639
+			$dates['day']      = date('d', $current_time);
640
+			$dates['day_end']  = date('d', $current_time);
641
+			$dates['m_start']  = date('n', $current_time);
642
+			$dates['m_end']    = date('n', $current_time);
643
+			$dates['year']     = date('Y', $current_time);
644
+			$dates['year_end'] = date('Y', $current_time);
645 645
 			break;
646 646
 
647 647
 		case 'yesterday' :
648 648
 
649
-			$year  = date( 'Y', $current_time );
650
-			$month = date( 'n', $current_time );
651
-			$day   = date( 'd', $current_time );
649
+			$year  = date('Y', $current_time);
650
+			$month = date('n', $current_time);
651
+			$day   = date('d', $current_time);
652 652
 
653
-			if ( $month == 1 && $day == 1 ) {
653
+			if ($month == 1 && $day == 1) {
654 654
 
655 655
 				$year -= 1;
656 656
 				$month = 12;
657
-				$day   = cal_days_in_month( CAL_GREGORIAN, $month, $year );
657
+				$day   = cal_days_in_month(CAL_GREGORIAN, $month, $year);
658 658
 
659
-			} elseif ( $month > 1 && $day == 1 ) {
659
+			} elseif ($month > 1 && $day == 1) {
660 660
 
661 661
 				$month -= 1;
662
-				$day = cal_days_in_month( CAL_GREGORIAN, $month, $year );
662
+				$day = cal_days_in_month(CAL_GREGORIAN, $month, $year);
663 663
 
664 664
 			} else {
665 665
 
@@ -675,91 +675,91 @@  discard block
 block discarded – undo
675 675
 			break;
676 676
 
677 677
 		case 'this_week' :
678
-			$dates['day'] = date( 'd', $current_time - ( date( 'w', $current_time ) - 1 ) * 60 * 60 * 24 ) - 1;
679
-			$dates['day'] += get_option( 'start_of_week' );
678
+			$dates['day'] = date('d', $current_time - (date('w', $current_time) - 1) * 60 * 60 * 24) - 1;
679
+			$dates['day'] += get_option('start_of_week');
680 680
 			$dates['day_end'] = $dates['day'] + 6;
681
-			$dates['m_start'] = date( 'n', $current_time );
682
-			$dates['m_end']   = date( 'n', $current_time );
683
-			$dates['year']    = date( 'Y', $current_time );
681
+			$dates['m_start'] = date('n', $current_time);
682
+			$dates['m_end']   = date('n', $current_time);
683
+			$dates['year']    = date('Y', $current_time);
684 684
 			break;
685 685
 
686 686
 		case 'last_week' :
687
-			$dates['day'] = date( 'd', $current_time - ( date( 'w' ) - 1 ) * 60 * 60 * 24 ) - 8;
688
-			$dates['day'] += get_option( 'start_of_week' );
687
+			$dates['day'] = date('d', $current_time - (date('w') - 1) * 60 * 60 * 24) - 8;
688
+			$dates['day'] += get_option('start_of_week');
689 689
 			$dates['day_end'] = $dates['day'] + 6;
690
-			$dates['year']    = date( 'Y' );
691
-
692
-			if ( date( 'j', $current_time ) <= 7 ) {
693
-				$dates['m_start'] = date( 'n', $current_time ) - 1;
694
-				$dates['m_end']   = date( 'n', $current_time ) - 1;
695
-				if ( $dates['m_start'] <= 1 ) {
696
-					$dates['year']     = date( 'Y', $current_time ) - 1;
697
-					$dates['year_end'] = date( 'Y', $current_time ) - 1;
690
+			$dates['year']    = date('Y');
691
+
692
+			if (date('j', $current_time) <= 7) {
693
+				$dates['m_start'] = date('n', $current_time) - 1;
694
+				$dates['m_end']   = date('n', $current_time) - 1;
695
+				if ($dates['m_start'] <= 1) {
696
+					$dates['year']     = date('Y', $current_time) - 1;
697
+					$dates['year_end'] = date('Y', $current_time) - 1;
698 698
 				}
699 699
 			} else {
700
-				$dates['m_start'] = date( 'n', $current_time );
701
-				$dates['m_end']   = date( 'n', $current_time );
700
+				$dates['m_start'] = date('n', $current_time);
701
+				$dates['m_end']   = date('n', $current_time);
702 702
 			}
703 703
 			break;
704 704
 
705 705
 		case 'this_quarter' :
706
-			$month_now = date( 'n', $current_time );
706
+			$month_now = date('n', $current_time);
707 707
 
708
-			if ( $month_now <= 3 ) {
708
+			if ($month_now <= 3) {
709 709
 
710 710
 				$dates['m_start'] = 1;
711 711
 				$dates['m_end']   = 4;
712
-				$dates['year']    = date( 'Y', $current_time );
712
+				$dates['year']    = date('Y', $current_time);
713 713
 
714
-			} else if ( $month_now <= 6 ) {
714
+			} else if ($month_now <= 6) {
715 715
 
716 716
 				$dates['m_start'] = 4;
717 717
 				$dates['m_end']   = 7;
718
-				$dates['year']    = date( 'Y', $current_time );
718
+				$dates['year']    = date('Y', $current_time);
719 719
 
720
-			} else if ( $month_now <= 9 ) {
720
+			} else if ($month_now <= 9) {
721 721
 
722 722
 				$dates['m_start'] = 7;
723 723
 				$dates['m_end']   = 10;
724
-				$dates['year']    = date( 'Y', $current_time );
724
+				$dates['year']    = date('Y', $current_time);
725 725
 
726 726
 			} else {
727 727
 
728 728
 				$dates['m_start']  = 10;
729 729
 				$dates['m_end']    = 1;
730
-				$dates['year']     = date( 'Y', $current_time );
731
-				$dates['year_end'] = date( 'Y', $current_time ) + 1;
730
+				$dates['year']     = date('Y', $current_time);
731
+				$dates['year_end'] = date('Y', $current_time) + 1;
732 732
 
733 733
 			}
734 734
 			break;
735 735
 
736 736
 		case 'last_quarter' :
737
-			$month_now = date( 'n' );
737
+			$month_now = date('n');
738 738
 
739
-			if ( $month_now <= 3 ) {
739
+			if ($month_now <= 3) {
740 740
 
741 741
 				$dates['m_start']  = 10;
742 742
 				$dates['m_end']    = 12;
743
-				$dates['year']     = date( 'Y', $current_time ) - 1; // Previous year
744
-				$dates['year_end'] = date( 'Y', $current_time ) - 1; // Previous year
743
+				$dates['year']     = date('Y', $current_time) - 1; // Previous year
744
+				$dates['year_end'] = date('Y', $current_time) - 1; // Previous year
745 745
 
746
-			} else if ( $month_now <= 6 ) {
746
+			} else if ($month_now <= 6) {
747 747
 
748 748
 				$dates['m_start'] = 1;
749 749
 				$dates['m_end']   = 3;
750
-				$dates['year']    = date( 'Y', $current_time );
750
+				$dates['year']    = date('Y', $current_time);
751 751
 
752
-			} else if ( $month_now <= 9 ) {
752
+			} else if ($month_now <= 9) {
753 753
 
754 754
 				$dates['m_start'] = 4;
755 755
 				$dates['m_end']   = 6;
756
-				$dates['year']    = date( 'Y', $current_time );
756
+				$dates['year']    = date('Y', $current_time);
757 757
 
758 758
 			} else {
759 759
 
760 760
 				$dates['m_start'] = 7;
761 761
 				$dates['m_end']   = 9;
762
-				$dates['year']    = date( 'Y', $current_time );
762
+				$dates['year']    = date('Y', $current_time);
763 763
 
764 764
 			}
765 765
 			break;
@@ -767,19 +767,19 @@  discard block
 block discarded – undo
767 767
 		case 'this_year' :
768 768
 			$dates['m_start'] = 1;
769 769
 			$dates['m_end']   = 12;
770
-			$dates['year']    = date( 'Y', $current_time );
770
+			$dates['year']    = date('Y', $current_time);
771 771
 			break;
772 772
 
773 773
 		case 'last_year' :
774 774
 			$dates['m_start']  = 1;
775 775
 			$dates['m_end']    = 12;
776
-			$dates['year']     = date( 'Y', $current_time ) - 1;
777
-			$dates['year_end'] = date( 'Y', $current_time ) - 1;
776
+			$dates['year']     = date('Y', $current_time) - 1;
777
+			$dates['year_end'] = date('Y', $current_time) - 1;
778 778
 			break;
779 779
 
780 780
 	endswitch;
781 781
 
782
-	return apply_filters( 'give_report_dates', $dates );
782
+	return apply_filters('give_report_dates', $dates);
783 783
 }
784 784
 
785 785
 /**
@@ -790,18 +790,18 @@  discard block
 block discarded – undo
790 790
  *
791 791
  * @param $data
792 792
  */
793
-function give_parse_report_dates( $data ) {
793
+function give_parse_report_dates($data) {
794 794
 	$dates = give_get_report_dates();
795 795
 
796 796
 	$view = give_get_reporting_view();
797
-	$tab  = isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : 'earnings';
798
-	$id   = isset( $_GET['form-id'] ) ? $_GET['form-id'] : null;
797
+	$tab  = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : 'earnings';
798
+	$id   = isset($_GET['form-id']) ? $_GET['form-id'] : null;
799 799
 
800
-	wp_redirect( add_query_arg( $dates, admin_url( 'edit.php?post_type=give_forms&page=give-reports&tab=' . esc_attr( $tab ) . '&view=' . esc_attr( $view ) . '&form-id=' . absint( $id ) ) ) );
800
+	wp_redirect(add_query_arg($dates, admin_url('edit.php?post_type=give_forms&page=give-reports&tab='.esc_attr($tab).'&view='.esc_attr($view).'&form-id='.absint($id))));
801 801
 	give_die();
802 802
 }
803 803
 
804
-add_action( 'give_filter_reports', 'give_parse_report_dates' );
804
+add_action('give_filter_reports', 'give_parse_report_dates');
805 805
 
806 806
 
807 807
 /**
@@ -813,22 +813,22 @@  discard block
 block discarded – undo
813 813
  */
814 814
 function give_reports_refresh_button() {
815 815
 
816
-	$url = wp_nonce_url( add_query_arg( array(
816
+	$url = wp_nonce_url(add_query_arg(array(
817 817
 		'give_action'  => 'refresh_reports_transients',
818 818
 		'give-message' => 'refreshed-reports'
819
-	) ), 'give-refresh-reports' );
819
+	)), 'give-refresh-reports');
820 820
 
821 821
 	echo '<a href="'
822
-	     . esc_url_raw( $url )
823
-	     . '" data-tooltip="'. __( 'Clicking this will clear the reports cache.', 'give' )
822
+	     . esc_url_raw($url)
823
+	     . '" data-tooltip="'.__('Clicking this will clear the reports cache.', 'give')
824 824
 	     . '" data-tooltip-my-position="right center"  data-tooltip-target-position="left center" class="button alignright give-admin-button give-tooltip">'
825 825
 	     . '<span class="give-admin-button-icon give-admin-button-icon-update"></span>'
826
-	     . __( 'Refresh Report Data', 'give' )
826
+	     . __('Refresh Report Data', 'give')
827 827
 	     . '</a>';
828 828
 
829 829
 }
830 830
 
831
-add_action( 'give_reports_graph_additional_stats', 'give_reports_refresh_button' );
831
+add_action('give_reports_graph_additional_stats', 'give_reports_refresh_button');
832 832
 
833 833
 /**
834 834
  * Trigger the refresh of reports transients
@@ -839,20 +839,20 @@  discard block
 block discarded – undo
839 839
  *
840 840
  * @return void
841 841
  */
842
-function give_run_refresh_reports_transients( $data ) {
842
+function give_run_refresh_reports_transients($data) {
843 843
 
844
-	if ( ! wp_verify_nonce( $data['_wpnonce'], 'give-refresh-reports' ) ) {
844
+	if ( ! wp_verify_nonce($data['_wpnonce'], 'give-refresh-reports')) {
845 845
 		return;
846 846
 	}
847 847
 
848 848
 	// Monthly stats.
849
-	Give_Cache::delete( Give_Cache::get_key( 'give_estimated_monthly_stats' ) );
849
+	Give_Cache::delete(Give_Cache::get_key('give_estimated_monthly_stats'));
850 850
 
851 851
 	// Total earning.
852
-	delete_option( 'give_earnings_total' );
852
+	delete_option('give_earnings_total');
853 853
 
854 854
 	// @todo: Refresh only range related stat cache
855 855
 	give_delete_donation_stats();
856 856
 }
857 857
 
858
-add_action( 'give_refresh_reports_transients', 'give_run_refresh_reports_transients' );
859 858
\ No newline at end of file
859
+add_action('give_refresh_reports_transients', 'give_run_refresh_reports_transients');
860 860
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/class-i18n-module.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -65,18 +65,18 @@  discard block
 block discarded – undo
65 65
 	 *
66 66
 	 * @param $args
67 67
 	 */
68
-	public function __construct( $args ) {
68
+	public function __construct($args) {
69 69
 
70 70
 		// Only for admins.
71
-		if ( ! is_admin() ) {
71
+		if ( ! is_admin()) {
72 72
 			return;
73 73
 		}
74 74
 
75
-		foreach ( $args as $key => $arg ) {
75
+		foreach ($args as $key => $arg) {
76 76
 			$this->$key = $arg;
77 77
 		}
78 78
 
79
-		add_action( 'admin_init', array( $this, 'init' ) );
79
+		add_action('admin_init', array($this, 'init'));
80 80
 
81 81
 
82 82
 	}
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 	function init() {
88 88
 
89 89
 		// First get user's locale (4.7+).
90
-		$this->locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
90
+		$this->locale = function_exists('get_user_locale') ? get_user_locale() : get_locale();
91 91
 
92 92
 		// This plugin is en_US native.
93
-		if ( 'en_US' === $this->locale ) {
93
+		if ('en_US' === $this->locale) {
94 94
 			return;
95 95
 		}
96 96
 
97 97
 		if (
98 98
 			! $this->hide_promo()
99
-			&& ( ! empty( $_GET['post_type'] ) && 'give_forms' === $_GET['post_type'] )
100
-			&& ( ! empty( $_GET['page'] ) && 'give-settings' === $_GET['page'] )
99
+			&& ( ! empty($_GET['post_type']) && 'give_forms' === $_GET['post_type'])
100
+			&& ( ! empty($_GET['page']) && 'give-settings' === $_GET['page'])
101 101
 		) {
102
-			add_action( $this->hook, array( $this, 'promo' ) );
102
+			add_action($this->hook, array($this, 'promo'));
103 103
 		}
104 104
 	}
105 105
 
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
 	 * @return bool
113 113
 	 */
114 114
 	private function hide_promo() {
115
-		$hide_promo = Give_Cache::get( 'give_i18n_give_promo_hide', true );
116
-		if ( ! $hide_promo ) {
117
-			if ( filter_input( INPUT_GET, 'remove_i18n_promo', FILTER_VALIDATE_INT ) === 1 ) {
115
+		$hide_promo = Give_Cache::get('give_i18n_give_promo_hide', true);
116
+		if ( ! $hide_promo) {
117
+			if (filter_input(INPUT_GET, 'remove_i18n_promo', FILTER_VALIDATE_INT) === 1) {
118 118
 				// No expiration time, so this would normally not expire, but it wouldn't be copied to other sites etc.
119
-				Give_Cache::set( 'give_i18n_give_promo_hide', true, null, true );
119
+				Give_Cache::set('give_i18n_give_promo_hide', true, null, true);
120 120
 				$hide_promo = true;
121 121
 			}
122 122
 		}
@@ -135,20 +135,20 @@  discard block
 block discarded – undo
135 135
 		$message = false;
136 136
 
137 137
 		// Using a translation less than 90% complete.
138
-		if ( $this->translation_exists && $this->translation_loaded && $this->percent_translated < 90 ) {
139
-			$message = __( 'As you can see, there is a translation of this plugin in %1$s. This translation is currently %3$d%% complete. We need your help to make it complete and to fix any errors. Please register at %4$s to help %5$s to %1$s!', 'give' );
140
-		} elseif ( ! $this->translation_loaded && $this->translation_exists ) {
141
-			$message = __( 'You\'re using WordPress in %1$s. While %2$s has been %3$d%% translated to %1$s, it has not been shipped with the plugin yet. You can help! Register at %4$s to help complete the translation to %1$s!', 'give' );
142
-		} elseif ( ! $this->translation_exists ) {
143
-			$message = __( 'You\'re using WordPress in a language we don\'t support yet. We\'d love for %2$s to be translated in that language too, but unfortunately, it isn\'t right now. You can change that! Register at %4$s to help translate it!', 'give' );
138
+		if ($this->translation_exists && $this->translation_loaded && $this->percent_translated < 90) {
139
+			$message = __('As you can see, there is a translation of this plugin in %1$s. This translation is currently %3$d%% complete. We need your help to make it complete and to fix any errors. Please register at %4$s to help %5$s to %1$s!', 'give');
140
+		} elseif ( ! $this->translation_loaded && $this->translation_exists) {
141
+			$message = __('You\'re using WordPress in %1$s. While %2$s has been %3$d%% translated to %1$s, it has not been shipped with the plugin yet. You can help! Register at %4$s to help complete the translation to %1$s!', 'give');
142
+		} elseif ( ! $this->translation_exists) {
143
+			$message = __('You\'re using WordPress in a language we don\'t support yet. We\'d love for %2$s to be translated in that language too, but unfortunately, it isn\'t right now. You can change that! Register at %4$s to help translate it!', 'give');
144 144
 		}
145 145
 
146 146
 		// Links.
147
-		$registration_link = sprintf( '<a href="%1$s" target="_blank">%2$s</a>', 'https://wordpress.org/support/register.php', esc_html__( 'WordPress.org', 'give' ) );
148
-		$translations_link = sprintf( '<a href="%1$s" target="_blank">%2$s</a>', 'https://translate.wordpress.org/projects/wp-plugins/give', esc_html__( 'complete the translation', 'give' ) );
147
+		$registration_link = sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://wordpress.org/support/register.php', esc_html__('WordPress.org', 'give'));
148
+		$translations_link = sprintf('<a href="%1$s" target="_blank">%2$s</a>', 'https://translate.wordpress.org/projects/wp-plugins/give', esc_html__('complete the translation', 'give'));
149 149
 
150 150
 		// Message.
151
-		$message = sprintf( $message, $this->locale_name, 'Give', $this->percent_translated, $registration_link, $translations_link );
151
+		$message = sprintf($message, $this->locale_name, 'Give', $this->percent_translated, $registration_link, $translations_link);
152 152
 
153 153
 		return $message;
154 154
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		$this->translation_details();
163 163
 		$message = $this->promo_message();
164 164
 
165
-		if ( $message ) {
165
+		if ($message) {
166 166
 			$this->print_css();
167 167
 
168 168
 			ob_start();
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
 				                                                                                                                             style="font-size: 110px; text-decoration: none;"></span></a>
174 174
 
175 175
 				<div class="give-i18n-notice-content">
176
-					<a href="<?php echo esc_url( add_query_arg( array( 'remove_i18n_promo' => '1' ) ) ); ?>" class="dismiss"><span class="dashicons dashicons-dismiss"></span></a>
176
+					<a href="<?php echo esc_url(add_query_arg(array('remove_i18n_promo' => '1'))); ?>" class="dismiss"><span class="dashicons dashicons-dismiss"></span></a>
177 177
 
178
-					<h2 style="margin: 10px 0;"><?php printf( esc_html__( 'Help Translate Give to %s', 'give' ), $this->locale_name ); ?></h2>
178
+					<h2 style="margin: 10px 0;"><?php printf(esc_html__('Help Translate Give to %s', 'give'), $this->locale_name); ?></h2>
179 179
 					<p><?php echo $message; ?></p>
180 180
 					<p>
181
-						<a href="https://wordpress.org/support/register.php" target="_blank"><?php _e( 'Register now &raquo;', 'give' ); ?></a>
181
+						<a href="https://wordpress.org/support/register.php" target="_blank"><?php _e('Register now &raquo;', 'give'); ?></a>
182 182
 					</p>
183 183
 				</div>
184 184
 			</div>
@@ -187,12 +187,12 @@  discard block
 block discarded – undo
187 187
 			$notice_html = ob_get_clean();
188 188
 
189 189
 			// Register notice.
190
-			Give()->notices->register_notice( array(
190
+			Give()->notices->register_notice(array(
191 191
 				'id'          => 'give-i18n-notice',
192 192
 				'type'        => 'updated',
193 193
 				'description_html' => $notice_html,
194 194
 				'show'        => true,
195
-			) );
195
+			));
196 196
 		}
197 197
 	}
198 198
 
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
 	 */
275 275
 	private function find_or_initialize_translation_details() {
276 276
 
277
-		$set = Give_Cache::get( "give_i18n_give_{$this->locale}", true );
277
+		$set = Give_Cache::get("give_i18n_give_{$this->locale}", true);
278 278
 
279
-		if ( ! $set ) {
279
+		if ( ! $set) {
280 280
 			$set = $this->retrieve_translation_details();
281
-			Give_Cache::set( "give_i18n_give_{$this->locale}", $set, DAY_IN_SECONDS, true );
281
+			Give_Cache::set("give_i18n_give_{$this->locale}", $set, DAY_IN_SECONDS, true);
282 282
 		}
283 283
 
284 284
 		return $set;
@@ -292,10 +292,10 @@  discard block
 block discarded – undo
292 292
 	private function translation_details() {
293 293
 		$set = $this->find_or_initialize_translation_details();
294 294
 
295
-		$this->translation_exists = ! is_null( $set );
296
-		$this->translation_loaded = is_textdomain_loaded( 'give' );
295
+		$this->translation_exists = ! is_null($set);
296
+		$this->translation_loaded = is_textdomain_loaded('give');
297 297
 
298
-		$this->parse_translation_set( $set );
298
+		$this->parse_translation_set($set);
299 299
 	}
300 300
 
301 301
 	/**
@@ -307,26 +307,26 @@  discard block
 block discarded – undo
307 307
 	 */
308 308
 	private function retrieve_translation_details() {
309 309
 
310
-		$api_url = trailingslashit( $this->glotpress_url );
310
+		$api_url = trailingslashit($this->glotpress_url);
311 311
 
312
-		$resp = wp_remote_get( $api_url );
312
+		$resp = wp_remote_get($api_url);
313 313
 
314
-		if ( is_wp_error( $resp ) || wp_remote_retrieve_response_code( $resp ) === '404' ) {
314
+		if (is_wp_error($resp) || wp_remote_retrieve_response_code($resp) === '404') {
315 315
 			return null;
316 316
 		}
317 317
 
318
-		$body = wp_remote_retrieve_body( $resp );
319
-		unset( $resp );
318
+		$body = wp_remote_retrieve_body($resp);
319
+		unset($resp);
320 320
 
321
-		if ( $body ) {
322
-			$body = json_decode( $body );
321
+		if ($body) {
322
+			$body = json_decode($body);
323 323
 
324
-			foreach ( $body->translation_sets as $set ) {
325
-				if ( ! property_exists( $set, 'wp_locale' ) ) {
324
+			foreach ($body->translation_sets as $set) {
325
+				if ( ! property_exists($set, 'wp_locale')) {
326 326
 					continue;
327 327
 				}
328 328
 
329
-				if ( $this->locale == $set->wp_locale ) {
329
+				if ($this->locale == $set->wp_locale) {
330 330
 					return $set;
331 331
 				}
332 332
 			}
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
 	 *
343 343
 	 * @access private
344 344
 	 */
345
-	private function parse_translation_set( $set ) {
346
-		if ( $this->translation_exists && is_object( $set ) ) {
345
+	private function parse_translation_set($set) {
346
+		if ($this->translation_exists && is_object($set)) {
347 347
 			$this->locale_name        = $set->name;
348 348
 			$this->percent_translated = $set->percent_translated;
349 349
 		} else {
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 	}
354 354
 }
355 355
 
356
-$give_i18n = new Give_i18n_Banner( array(
356
+$give_i18n = new Give_i18n_Banner(array(
357 357
 		'hook'          => 'admin_notices',
358 358
 		'glotpress_url' => 'https://translate.wordpress.org/api/projects/wp-plugins/give/stable/',
359
-	) );
359
+	));
Please login to merge, or discard this patch.
includes/country-functions.php 1 patch
Spacing   +1066 added lines, -1066 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,9 +22,9 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_get_country() {
24 24
 	$give_options = give_get_settings();
25
-	$country      = isset( $give_options['base_country'] ) ? $give_options['base_country'] : 'US';
25
+	$country      = isset($give_options['base_country']) ? $give_options['base_country'] : 'US';
26 26
 
27
-	return apply_filters( 'give_give_country', $country );
27
+	return apply_filters('give_give_country', $country);
28 28
 }
29 29
 
30 30
 /**
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function give_get_state() {
37 37
 	$give_options = give_get_settings();
38
-	$state        = isset( $give_options['base_state'] ) ? $give_options['base_state'] : false;
38
+	$state        = isset($give_options['base_state']) ? $give_options['base_state'] : false;
39 39
 
40
-	return apply_filters( 'give_give_state', $state );
40
+	return apply_filters('give_give_state', $state);
41 41
 }
42 42
 
43 43
 /**
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
  *
50 50
  * @return mixed  A list of states for the site's base country.
51 51
  */
52
-function give_get_states( $country = null ) {
52
+function give_get_states($country = null) {
53 53
 	// If Country have no states return empty array.
54 54
 	$states = array();
55 55
 
56 56
 	// Check if Country Code is empty or not.
57
-	if ( empty( $country ) ) {
57
+	if (empty($country)) {
58 58
 		// Get defalut country code that is being set by the admin.
59 59
 		$country = give_get_country();
60 60
 	}
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 	$states_list = give_states_list();
64 64
 
65 65
 	// Check if $country code exists in the array key.
66
-	if ( array_key_exists( $country, $states_list ) ) {
67
-		$states = $states_list[ $country ];
66
+	if (array_key_exists($country, $states_list)) {
67
+		$states = $states_list[$country];
68 68
 	}
69 69
 
70 70
 	/**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param string $query Database count query
74 74
 	 */
75
-	return (array) apply_filters( 'give_give_states', $states );
75
+	return (array) apply_filters('give_give_states', $states);
76 76
 }
77 77
 
78 78
 /**
@@ -84,253 +84,253 @@  discard block
 block discarded – undo
84 84
 function give_get_country_list() {
85 85
 	$countries = array(
86 86
 		''   => '',
87
-		'US' => esc_html__( 'United States', 'give' ),
88
-		'CA' => esc_html__( 'Canada', 'give' ),
89
-		'GB' => esc_html__( 'United Kingdom', 'give' ),
90
-		'AF' => esc_html__( 'Afghanistan', 'give' ),
91
-		'AL' => esc_html__( 'Albania', 'give' ),
92
-		'DZ' => esc_html__( 'Algeria', 'give' ),
93
-		'AS' => esc_html__( 'American Samoa', 'give' ),
94
-		'AD' => esc_html__( 'Andorra', 'give' ),
95
-		'AO' => esc_html__( 'Angola', 'give' ),
96
-		'AI' => esc_html__( 'Anguilla', 'give' ),
97
-		'AQ' => esc_html__( 'Antarctica', 'give' ),
98
-		'AG' => esc_html__( 'Antigua and Barbuda', 'give' ),
99
-		'AR' => esc_html__( 'Argentina', 'give' ),
100
-		'AM' => esc_html__( 'Armenia', 'give' ),
101
-		'AW' => esc_html__( 'Aruba', 'give' ),
102
-		'AU' => esc_html__( 'Australia', 'give' ),
103
-		'AT' => esc_html__( 'Austria', 'give' ),
104
-		'AZ' => esc_html__( 'Azerbaijan', 'give' ),
105
-		'BS' => esc_html__( 'Bahamas', 'give' ),
106
-		'BH' => esc_html__( 'Bahrain', 'give' ),
107
-		'BD' => esc_html__( 'Bangladesh', 'give' ),
108
-		'BB' => esc_html__( 'Barbados', 'give' ),
109
-		'BY' => esc_html__( 'Belarus', 'give' ),
110
-		'BE' => esc_html__( 'Belgium', 'give' ),
111
-		'BZ' => esc_html__( 'Belize', 'give' ),
112
-		'BJ' => esc_html__( 'Benin', 'give' ),
113
-		'BM' => esc_html__( 'Bermuda', 'give' ),
114
-		'BT' => esc_html__( 'Bhutan', 'give' ),
115
-		'BO' => esc_html__( 'Bolivia', 'give' ),
116
-		'BA' => esc_html__( 'Bosnia and Herzegovina', 'give' ),
117
-		'BW' => esc_html__( 'Botswana', 'give' ),
118
-		'BV' => esc_html__( 'Bouvet Island', 'give' ),
119
-		'BR' => esc_html__( 'Brazil', 'give' ),
120
-		'IO' => esc_html__( 'British Indian Ocean Territory', 'give' ),
121
-		'BN' => esc_html__( 'Brunei Darrussalam', 'give' ),
122
-		'BG' => esc_html__( 'Bulgaria', 'give' ),
123
-		'BF' => esc_html__( 'Burkina Faso', 'give' ),
124
-		'BI' => esc_html__( 'Burundi', 'give' ),
125
-		'KH' => esc_html__( 'Cambodia', 'give' ),
126
-		'CM' => esc_html__( 'Cameroon', 'give' ),
127
-		'CV' => esc_html__( 'Cape Verde', 'give' ),
128
-		'KY' => esc_html__( 'Cayman Islands', 'give' ),
129
-		'CF' => esc_html__( 'Central African Republic', 'give' ),
130
-		'TD' => esc_html__( 'Chad', 'give' ),
131
-		'CL' => esc_html__( 'Chile', 'give' ),
132
-		'CN' => esc_html__( 'China', 'give' ),
133
-		'CX' => esc_html__( 'Christmas Island', 'give' ),
134
-		'CC' => esc_html__( 'Cocos Islands', 'give' ),
135
-		'CO' => esc_html__( 'Colombia', 'give' ),
136
-		'KM' => esc_html__( 'Comoros', 'give' ),
137
-		'CD' => esc_html__( 'Congo, Democratic People\'s Republic', 'give' ),
138
-		'CG' => esc_html__( 'Congo, Republic of', 'give' ),
139
-		'CK' => esc_html__( 'Cook Islands', 'give' ),
140
-		'CR' => esc_html__( 'Costa Rica', 'give' ),
141
-		'CI' => esc_html__( 'Cote d\'Ivoire', 'give' ),
142
-		'HR' => esc_html__( 'Croatia/Hrvatska', 'give' ),
143
-		'CU' => esc_html__( 'Cuba', 'give' ),
144
-		'CY' => esc_html__( 'Cyprus Island', 'give' ),
145
-		'CZ' => esc_html__( 'Czech Republic', 'give' ),
146
-		'DK' => esc_html__( 'Denmark', 'give' ),
147
-		'DJ' => esc_html__( 'Djibouti', 'give' ),
148
-		'DM' => esc_html__( 'Dominica', 'give' ),
149
-		'DO' => esc_html__( 'Dominican Republic', 'give' ),
150
-		'TP' => esc_html__( 'East Timor', 'give' ),
151
-		'EC' => esc_html__( 'Ecuador', 'give' ),
152
-		'EG' => esc_html__( 'Egypt', 'give' ),
153
-		'GQ' => esc_html__( 'Equatorial Guinea', 'give' ),
154
-		'SV' => esc_html__( 'El Salvador', 'give' ),
155
-		'ER' => esc_html__( 'Eritrea', 'give' ),
156
-		'EE' => esc_html__( 'Estonia', 'give' ),
157
-		'ET' => esc_html__( 'Ethiopia', 'give' ),
158
-		'FK' => esc_html__( 'Falkland Islands', 'give' ),
159
-		'FO' => esc_html__( 'Faroe Islands', 'give' ),
160
-		'FJ' => esc_html__( 'Fiji', 'give' ),
161
-		'FI' => esc_html__( 'Finland', 'give' ),
162
-		'FR' => esc_html__( 'France', 'give' ),
163
-		'GF' => esc_html__( 'French Guiana', 'give' ),
164
-		'PF' => esc_html__( 'French Polynesia', 'give' ),
165
-		'TF' => esc_html__( 'French Southern Territories', 'give' ),
166
-		'GA' => esc_html__( 'Gabon', 'give' ),
167
-		'GM' => esc_html__( 'Gambia', 'give' ),
168
-		'GE' => esc_html__( 'Georgia', 'give' ),
169
-		'DE' => esc_html__( 'Germany', 'give' ),
170
-		'GR' => esc_html__( 'Greece', 'give' ),
171
-		'GH' => esc_html__( 'Ghana', 'give' ),
172
-		'GI' => esc_html__( 'Gibraltar', 'give' ),
173
-		'GL' => esc_html__( 'Greenland', 'give' ),
174
-		'GD' => esc_html__( 'Grenada', 'give' ),
175
-		'GP' => esc_html__( 'Guadeloupe', 'give' ),
176
-		'GU' => esc_html__( 'Guam', 'give' ),
177
-		'GT' => esc_html__( 'Guatemala', 'give' ),
178
-		'GG' => esc_html__( 'Guernsey', 'give' ),
179
-		'GN' => esc_html__( 'Guinea', 'give' ),
180
-		'GW' => esc_html__( 'Guinea-Bissau', 'give' ),
181
-		'GY' => esc_html__( 'Guyana', 'give' ),
182
-		'HT' => esc_html__( 'Haiti', 'give' ),
183
-		'HM' => esc_html__( 'Heard and McDonald Islands', 'give' ),
184
-		'VA' => esc_html__( 'Holy See (City Vatican State)', 'give' ),
185
-		'HN' => esc_html__( 'Honduras', 'give' ),
186
-		'HK' => esc_html__( 'Hong Kong', 'give' ),
187
-		'HU' => esc_html__( 'Hungary', 'give' ),
188
-		'IS' => esc_html__( 'Iceland', 'give' ),
189
-		'IN' => esc_html__( 'India', 'give' ),
190
-		'ID' => esc_html__( 'Indonesia', 'give' ),
191
-		'IR' => esc_html__( 'Iran', 'give' ),
192
-		'IQ' => esc_html__( 'Iraq', 'give' ),
193
-		'IE' => esc_html__( 'Ireland', 'give' ),
194
-		'IM' => esc_html__( 'Isle of Man', 'give' ),
195
-		'IL' => esc_html__( 'Israel', 'give' ),
196
-		'IT' => esc_html__( 'Italy', 'give' ),
197
-		'JM' => esc_html__( 'Jamaica', 'give' ),
198
-		'JP' => esc_html__( 'Japan', 'give' ),
199
-		'JE' => esc_html__( 'Jersey', 'give' ),
200
-		'JO' => esc_html__( 'Jordan', 'give' ),
201
-		'KZ' => esc_html__( 'Kazakhstan', 'give' ),
202
-		'KE' => esc_html__( 'Kenya', 'give' ),
203
-		'KI' => esc_html__( 'Kiribati', 'give' ),
204
-		'KW' => esc_html__( 'Kuwait', 'give' ),
205
-		'KG' => esc_html__( 'Kyrgyzstan', 'give' ),
206
-		'LA' => esc_html__( 'Lao People\'s Democratic Republic', 'give' ),
207
-		'LV' => esc_html__( 'Latvia', 'give' ),
208
-		'LB' => esc_html__( 'Lebanon', 'give' ),
209
-		'LS' => esc_html__( 'Lesotho', 'give' ),
210
-		'LR' => esc_html__( 'Liberia', 'give' ),
211
-		'LY' => esc_html__( 'Libyan Arab Jamahiriya', 'give' ),
212
-		'LI' => esc_html__( 'Liechtenstein', 'give' ),
213
-		'LT' => esc_html__( 'Lithuania', 'give' ),
214
-		'LU' => esc_html__( 'Luxembourg', 'give' ),
215
-		'MO' => esc_html__( 'Macau', 'give' ),
216
-		'MK' => esc_html__( 'Macedonia', 'give' ),
217
-		'MG' => esc_html__( 'Madagascar', 'give' ),
218
-		'MW' => esc_html__( 'Malawi', 'give' ),
219
-		'MY' => esc_html__( 'Malaysia', 'give' ),
220
-		'MV' => esc_html__( 'Maldives', 'give' ),
221
-		'ML' => esc_html__( 'Mali', 'give' ),
222
-		'MT' => esc_html__( 'Malta', 'give' ),
223
-		'MH' => esc_html__( 'Marshall Islands', 'give' ),
224
-		'MQ' => esc_html__( 'Martinique', 'give' ),
225
-		'MR' => esc_html__( 'Mauritania', 'give' ),
226
-		'MU' => esc_html__( 'Mauritius', 'give' ),
227
-		'YT' => esc_html__( 'Mayotte', 'give' ),
228
-		'MX' => esc_html__( 'Mexico', 'give' ),
229
-		'FM' => esc_html__( 'Micronesia', 'give' ),
230
-		'MD' => esc_html__( 'Moldova, Republic of', 'give' ),
231
-		'MC' => esc_html__( 'Monaco', 'give' ),
232
-		'MN' => esc_html__( 'Mongolia', 'give' ),
233
-		'ME' => esc_html__( 'Montenegro', 'give' ),
234
-		'MS' => esc_html__( 'Montserrat', 'give' ),
235
-		'MA' => esc_html__( 'Morocco', 'give' ),
236
-		'MZ' => esc_html__( 'Mozambique', 'give' ),
237
-		'MM' => esc_html__( 'Myanmar', 'give' ),
238
-		'NA' => esc_html__( 'Namibia', 'give' ),
239
-		'NR' => esc_html__( 'Nauru', 'give' ),
240
-		'NP' => esc_html__( 'Nepal', 'give' ),
241
-		'NL' => esc_html__( 'Netherlands', 'give' ),
242
-		'AN' => esc_html__( 'Netherlands Antilles', 'give' ),
243
-		'NC' => esc_html__( 'New Caledonia', 'give' ),
244
-		'NZ' => esc_html__( 'New Zealand', 'give' ),
245
-		'NI' => esc_html__( 'Nicaragua', 'give' ),
246
-		'NE' => esc_html__( 'Niger', 'give' ),
247
-		'NG' => esc_html__( 'Nigeria', 'give' ),
248
-		'NU' => esc_html__( 'Niue', 'give' ),
249
-		'NF' => esc_html__( 'Norfolk Island', 'give' ),
250
-		'KP' => esc_html__( 'North Korea', 'give' ),
251
-		'MP' => esc_html__( 'Northern Mariana Islands', 'give' ),
252
-		'NO' => esc_html__( 'Norway', 'give' ),
253
-		'OM' => esc_html__( 'Oman', 'give' ),
254
-		'PK' => esc_html__( 'Pakistan', 'give' ),
255
-		'PW' => esc_html__( 'Palau', 'give' ),
256
-		'PS' => esc_html__( 'Palestinian Territories', 'give' ),
257
-		'PA' => esc_html__( 'Panama', 'give' ),
258
-		'PG' => esc_html__( 'Papua New Guinea', 'give' ),
259
-		'PY' => esc_html__( 'Paraguay', 'give' ),
260
-		'PE' => esc_html__( 'Peru', 'give' ),
261
-		'PH' => esc_html__( 'Philippines', 'give' ),
262
-		'PN' => esc_html__( 'Pitcairn Island', 'give' ),
263
-		'PL' => esc_html__( 'Poland', 'give' ),
264
-		'PT' => esc_html__( 'Portugal', 'give' ),
265
-		'PR' => esc_html__( 'Puerto Rico', 'give' ),
266
-		'QA' => esc_html__( 'Qatar', 'give' ),
267
-		'RE' => esc_html__( 'Reunion Island', 'give' ),
268
-		'RO' => esc_html__( 'Romania', 'give' ),
269
-		'RU' => esc_html__( 'Russian Federation', 'give' ),
270
-		'RW' => esc_html__( 'Rwanda', 'give' ),
271
-		'SH' => esc_html__( 'Saint Helena', 'give' ),
272
-		'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ),
273
-		'LC' => esc_html__( 'Saint Lucia', 'give' ),
274
-		'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ),
275
-		'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ),
276
-		'SM' => esc_html__( 'San Marino', 'give' ),
277
-		'ST' => esc_html__( 'Sao Tome and Principe', 'give' ),
278
-		'SA' => esc_html__( 'Saudi Arabia', 'give' ),
279
-		'SN' => esc_html__( 'Senegal', 'give' ),
280
-		'RS' => esc_html__( 'Serbia', 'give' ),
281
-		'SC' => esc_html__( 'Seychelles', 'give' ),
282
-		'SL' => esc_html__( 'Sierra Leone', 'give' ),
283
-		'SG' => esc_html__( 'Singapore', 'give' ),
284
-		'SK' => esc_html__( 'Slovak Republic', 'give' ),
285
-		'SI' => esc_html__( 'Slovenia', 'give' ),
286
-		'SB' => esc_html__( 'Solomon Islands', 'give' ),
287
-		'SO' => esc_html__( 'Somalia', 'give' ),
288
-		'ZA' => esc_html__( 'South Africa', 'give' ),
289
-		'GS' => esc_html__( 'South Georgia', 'give' ),
290
-		'KR' => esc_html__( 'South Korea', 'give' ),
291
-		'ES' => esc_html__( 'Spain', 'give' ),
292
-		'LK' => esc_html__( 'Sri Lanka', 'give' ),
293
-		'SD' => esc_html__( 'Sudan', 'give' ),
294
-		'SR' => esc_html__( 'Suriname', 'give' ),
295
-		'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ),
296
-		'SZ' => esc_html__( 'Swaziland', 'give' ),
297
-		'SE' => esc_html__( 'Sweden', 'give' ),
298
-		'CH' => esc_html__( 'Switzerland', 'give' ),
299
-		'SY' => esc_html__( 'Syrian Arab Republic', 'give' ),
300
-		'TW' => esc_html__( 'Taiwan', 'give' ),
301
-		'TJ' => esc_html__( 'Tajikistan', 'give' ),
302
-		'TZ' => esc_html__( 'Tanzania', 'give' ),
303
-		'TG' => esc_html__( 'Togo', 'give' ),
304
-		'TK' => esc_html__( 'Tokelau', 'give' ),
305
-		'TO' => esc_html__( 'Tonga', 'give' ),
306
-		'TH' => esc_html__( 'Thailand', 'give' ),
307
-		'TT' => esc_html__( 'Trinidad and Tobago', 'give' ),
308
-		'TN' => esc_html__( 'Tunisia', 'give' ),
309
-		'TR' => esc_html__( 'Turkey', 'give' ),
310
-		'TM' => esc_html__( 'Turkmenistan', 'give' ),
311
-		'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ),
312
-		'TV' => esc_html__( 'Tuvalu', 'give' ),
313
-		'UG' => esc_html__( 'Uganda', 'give' ),
314
-		'UA' => esc_html__( 'Ukraine', 'give' ),
315
-		'AE' => esc_html__( 'United Arab Emirates', 'give' ),
316
-		'UY' => esc_html__( 'Uruguay', 'give' ),
317
-		'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ),
318
-		'UZ' => esc_html__( 'Uzbekistan', 'give' ),
319
-		'VU' => esc_html__( 'Vanuatu', 'give' ),
320
-		'VE' => esc_html__( 'Venezuela', 'give' ),
321
-		'VN' => esc_html__( 'Vietnam', 'give' ),
322
-		'VG' => esc_html__( 'Virgin Islands (British)', 'give' ),
323
-		'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ),
324
-		'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ),
325
-		'EH' => esc_html__( 'Western Sahara', 'give' ),
326
-		'WS' => esc_html__( 'Western Samoa', 'give' ),
327
-		'YE' => esc_html__( 'Yemen', 'give' ),
328
-		'YU' => esc_html__( 'Yugoslavia', 'give' ),
329
-		'ZM' => esc_html__( 'Zambia', 'give' ),
330
-		'ZW' => esc_html__( 'Zimbabwe', 'give' ),
87
+		'US' => esc_html__('United States', 'give'),
88
+		'CA' => esc_html__('Canada', 'give'),
89
+		'GB' => esc_html__('United Kingdom', 'give'),
90
+		'AF' => esc_html__('Afghanistan', 'give'),
91
+		'AL' => esc_html__('Albania', 'give'),
92
+		'DZ' => esc_html__('Algeria', 'give'),
93
+		'AS' => esc_html__('American Samoa', 'give'),
94
+		'AD' => esc_html__('Andorra', 'give'),
95
+		'AO' => esc_html__('Angola', 'give'),
96
+		'AI' => esc_html__('Anguilla', 'give'),
97
+		'AQ' => esc_html__('Antarctica', 'give'),
98
+		'AG' => esc_html__('Antigua and Barbuda', 'give'),
99
+		'AR' => esc_html__('Argentina', 'give'),
100
+		'AM' => esc_html__('Armenia', 'give'),
101
+		'AW' => esc_html__('Aruba', 'give'),
102
+		'AU' => esc_html__('Australia', 'give'),
103
+		'AT' => esc_html__('Austria', 'give'),
104
+		'AZ' => esc_html__('Azerbaijan', 'give'),
105
+		'BS' => esc_html__('Bahamas', 'give'),
106
+		'BH' => esc_html__('Bahrain', 'give'),
107
+		'BD' => esc_html__('Bangladesh', 'give'),
108
+		'BB' => esc_html__('Barbados', 'give'),
109
+		'BY' => esc_html__('Belarus', 'give'),
110
+		'BE' => esc_html__('Belgium', 'give'),
111
+		'BZ' => esc_html__('Belize', 'give'),
112
+		'BJ' => esc_html__('Benin', 'give'),
113
+		'BM' => esc_html__('Bermuda', 'give'),
114
+		'BT' => esc_html__('Bhutan', 'give'),
115
+		'BO' => esc_html__('Bolivia', 'give'),
116
+		'BA' => esc_html__('Bosnia and Herzegovina', 'give'),
117
+		'BW' => esc_html__('Botswana', 'give'),
118
+		'BV' => esc_html__('Bouvet Island', 'give'),
119
+		'BR' => esc_html__('Brazil', 'give'),
120
+		'IO' => esc_html__('British Indian Ocean Territory', 'give'),
121
+		'BN' => esc_html__('Brunei Darrussalam', 'give'),
122
+		'BG' => esc_html__('Bulgaria', 'give'),
123
+		'BF' => esc_html__('Burkina Faso', 'give'),
124
+		'BI' => esc_html__('Burundi', 'give'),
125
+		'KH' => esc_html__('Cambodia', 'give'),
126
+		'CM' => esc_html__('Cameroon', 'give'),
127
+		'CV' => esc_html__('Cape Verde', 'give'),
128
+		'KY' => esc_html__('Cayman Islands', 'give'),
129
+		'CF' => esc_html__('Central African Republic', 'give'),
130
+		'TD' => esc_html__('Chad', 'give'),
131
+		'CL' => esc_html__('Chile', 'give'),
132
+		'CN' => esc_html__('China', 'give'),
133
+		'CX' => esc_html__('Christmas Island', 'give'),
134
+		'CC' => esc_html__('Cocos Islands', 'give'),
135
+		'CO' => esc_html__('Colombia', 'give'),
136
+		'KM' => esc_html__('Comoros', 'give'),
137
+		'CD' => esc_html__('Congo, Democratic People\'s Republic', 'give'),
138
+		'CG' => esc_html__('Congo, Republic of', 'give'),
139
+		'CK' => esc_html__('Cook Islands', 'give'),
140
+		'CR' => esc_html__('Costa Rica', 'give'),
141
+		'CI' => esc_html__('Cote d\'Ivoire', 'give'),
142
+		'HR' => esc_html__('Croatia/Hrvatska', 'give'),
143
+		'CU' => esc_html__('Cuba', 'give'),
144
+		'CY' => esc_html__('Cyprus Island', 'give'),
145
+		'CZ' => esc_html__('Czech Republic', 'give'),
146
+		'DK' => esc_html__('Denmark', 'give'),
147
+		'DJ' => esc_html__('Djibouti', 'give'),
148
+		'DM' => esc_html__('Dominica', 'give'),
149
+		'DO' => esc_html__('Dominican Republic', 'give'),
150
+		'TP' => esc_html__('East Timor', 'give'),
151
+		'EC' => esc_html__('Ecuador', 'give'),
152
+		'EG' => esc_html__('Egypt', 'give'),
153
+		'GQ' => esc_html__('Equatorial Guinea', 'give'),
154
+		'SV' => esc_html__('El Salvador', 'give'),
155
+		'ER' => esc_html__('Eritrea', 'give'),
156
+		'EE' => esc_html__('Estonia', 'give'),
157
+		'ET' => esc_html__('Ethiopia', 'give'),
158
+		'FK' => esc_html__('Falkland Islands', 'give'),
159
+		'FO' => esc_html__('Faroe Islands', 'give'),
160
+		'FJ' => esc_html__('Fiji', 'give'),
161
+		'FI' => esc_html__('Finland', 'give'),
162
+		'FR' => esc_html__('France', 'give'),
163
+		'GF' => esc_html__('French Guiana', 'give'),
164
+		'PF' => esc_html__('French Polynesia', 'give'),
165
+		'TF' => esc_html__('French Southern Territories', 'give'),
166
+		'GA' => esc_html__('Gabon', 'give'),
167
+		'GM' => esc_html__('Gambia', 'give'),
168
+		'GE' => esc_html__('Georgia', 'give'),
169
+		'DE' => esc_html__('Germany', 'give'),
170
+		'GR' => esc_html__('Greece', 'give'),
171
+		'GH' => esc_html__('Ghana', 'give'),
172
+		'GI' => esc_html__('Gibraltar', 'give'),
173
+		'GL' => esc_html__('Greenland', 'give'),
174
+		'GD' => esc_html__('Grenada', 'give'),
175
+		'GP' => esc_html__('Guadeloupe', 'give'),
176
+		'GU' => esc_html__('Guam', 'give'),
177
+		'GT' => esc_html__('Guatemala', 'give'),
178
+		'GG' => esc_html__('Guernsey', 'give'),
179
+		'GN' => esc_html__('Guinea', 'give'),
180
+		'GW' => esc_html__('Guinea-Bissau', 'give'),
181
+		'GY' => esc_html__('Guyana', 'give'),
182
+		'HT' => esc_html__('Haiti', 'give'),
183
+		'HM' => esc_html__('Heard and McDonald Islands', 'give'),
184
+		'VA' => esc_html__('Holy See (City Vatican State)', 'give'),
185
+		'HN' => esc_html__('Honduras', 'give'),
186
+		'HK' => esc_html__('Hong Kong', 'give'),
187
+		'HU' => esc_html__('Hungary', 'give'),
188
+		'IS' => esc_html__('Iceland', 'give'),
189
+		'IN' => esc_html__('India', 'give'),
190
+		'ID' => esc_html__('Indonesia', 'give'),
191
+		'IR' => esc_html__('Iran', 'give'),
192
+		'IQ' => esc_html__('Iraq', 'give'),
193
+		'IE' => esc_html__('Ireland', 'give'),
194
+		'IM' => esc_html__('Isle of Man', 'give'),
195
+		'IL' => esc_html__('Israel', 'give'),
196
+		'IT' => esc_html__('Italy', 'give'),
197
+		'JM' => esc_html__('Jamaica', 'give'),
198
+		'JP' => esc_html__('Japan', 'give'),
199
+		'JE' => esc_html__('Jersey', 'give'),
200
+		'JO' => esc_html__('Jordan', 'give'),
201
+		'KZ' => esc_html__('Kazakhstan', 'give'),
202
+		'KE' => esc_html__('Kenya', 'give'),
203
+		'KI' => esc_html__('Kiribati', 'give'),
204
+		'KW' => esc_html__('Kuwait', 'give'),
205
+		'KG' => esc_html__('Kyrgyzstan', 'give'),
206
+		'LA' => esc_html__('Lao People\'s Democratic Republic', 'give'),
207
+		'LV' => esc_html__('Latvia', 'give'),
208
+		'LB' => esc_html__('Lebanon', 'give'),
209
+		'LS' => esc_html__('Lesotho', 'give'),
210
+		'LR' => esc_html__('Liberia', 'give'),
211
+		'LY' => esc_html__('Libyan Arab Jamahiriya', 'give'),
212
+		'LI' => esc_html__('Liechtenstein', 'give'),
213
+		'LT' => esc_html__('Lithuania', 'give'),
214
+		'LU' => esc_html__('Luxembourg', 'give'),
215
+		'MO' => esc_html__('Macau', 'give'),
216
+		'MK' => esc_html__('Macedonia', 'give'),
217
+		'MG' => esc_html__('Madagascar', 'give'),
218
+		'MW' => esc_html__('Malawi', 'give'),
219
+		'MY' => esc_html__('Malaysia', 'give'),
220
+		'MV' => esc_html__('Maldives', 'give'),
221
+		'ML' => esc_html__('Mali', 'give'),
222
+		'MT' => esc_html__('Malta', 'give'),
223
+		'MH' => esc_html__('Marshall Islands', 'give'),
224
+		'MQ' => esc_html__('Martinique', 'give'),
225
+		'MR' => esc_html__('Mauritania', 'give'),
226
+		'MU' => esc_html__('Mauritius', 'give'),
227
+		'YT' => esc_html__('Mayotte', 'give'),
228
+		'MX' => esc_html__('Mexico', 'give'),
229
+		'FM' => esc_html__('Micronesia', 'give'),
230
+		'MD' => esc_html__('Moldova, Republic of', 'give'),
231
+		'MC' => esc_html__('Monaco', 'give'),
232
+		'MN' => esc_html__('Mongolia', 'give'),
233
+		'ME' => esc_html__('Montenegro', 'give'),
234
+		'MS' => esc_html__('Montserrat', 'give'),
235
+		'MA' => esc_html__('Morocco', 'give'),
236
+		'MZ' => esc_html__('Mozambique', 'give'),
237
+		'MM' => esc_html__('Myanmar', 'give'),
238
+		'NA' => esc_html__('Namibia', 'give'),
239
+		'NR' => esc_html__('Nauru', 'give'),
240
+		'NP' => esc_html__('Nepal', 'give'),
241
+		'NL' => esc_html__('Netherlands', 'give'),
242
+		'AN' => esc_html__('Netherlands Antilles', 'give'),
243
+		'NC' => esc_html__('New Caledonia', 'give'),
244
+		'NZ' => esc_html__('New Zealand', 'give'),
245
+		'NI' => esc_html__('Nicaragua', 'give'),
246
+		'NE' => esc_html__('Niger', 'give'),
247
+		'NG' => esc_html__('Nigeria', 'give'),
248
+		'NU' => esc_html__('Niue', 'give'),
249
+		'NF' => esc_html__('Norfolk Island', 'give'),
250
+		'KP' => esc_html__('North Korea', 'give'),
251
+		'MP' => esc_html__('Northern Mariana Islands', 'give'),
252
+		'NO' => esc_html__('Norway', 'give'),
253
+		'OM' => esc_html__('Oman', 'give'),
254
+		'PK' => esc_html__('Pakistan', 'give'),
255
+		'PW' => esc_html__('Palau', 'give'),
256
+		'PS' => esc_html__('Palestinian Territories', 'give'),
257
+		'PA' => esc_html__('Panama', 'give'),
258
+		'PG' => esc_html__('Papua New Guinea', 'give'),
259
+		'PY' => esc_html__('Paraguay', 'give'),
260
+		'PE' => esc_html__('Peru', 'give'),
261
+		'PH' => esc_html__('Philippines', 'give'),
262
+		'PN' => esc_html__('Pitcairn Island', 'give'),
263
+		'PL' => esc_html__('Poland', 'give'),
264
+		'PT' => esc_html__('Portugal', 'give'),
265
+		'PR' => esc_html__('Puerto Rico', 'give'),
266
+		'QA' => esc_html__('Qatar', 'give'),
267
+		'RE' => esc_html__('Reunion Island', 'give'),
268
+		'RO' => esc_html__('Romania', 'give'),
269
+		'RU' => esc_html__('Russian Federation', 'give'),
270
+		'RW' => esc_html__('Rwanda', 'give'),
271
+		'SH' => esc_html__('Saint Helena', 'give'),
272
+		'KN' => esc_html__('Saint Kitts and Nevis', 'give'),
273
+		'LC' => esc_html__('Saint Lucia', 'give'),
274
+		'PM' => esc_html__('Saint Pierre and Miquelon', 'give'),
275
+		'VC' => esc_html__('Saint Vincent and the Grenadines', 'give'),
276
+		'SM' => esc_html__('San Marino', 'give'),
277
+		'ST' => esc_html__('Sao Tome and Principe', 'give'),
278
+		'SA' => esc_html__('Saudi Arabia', 'give'),
279
+		'SN' => esc_html__('Senegal', 'give'),
280
+		'RS' => esc_html__('Serbia', 'give'),
281
+		'SC' => esc_html__('Seychelles', 'give'),
282
+		'SL' => esc_html__('Sierra Leone', 'give'),
283
+		'SG' => esc_html__('Singapore', 'give'),
284
+		'SK' => esc_html__('Slovak Republic', 'give'),
285
+		'SI' => esc_html__('Slovenia', 'give'),
286
+		'SB' => esc_html__('Solomon Islands', 'give'),
287
+		'SO' => esc_html__('Somalia', 'give'),
288
+		'ZA' => esc_html__('South Africa', 'give'),
289
+		'GS' => esc_html__('South Georgia', 'give'),
290
+		'KR' => esc_html__('South Korea', 'give'),
291
+		'ES' => esc_html__('Spain', 'give'),
292
+		'LK' => esc_html__('Sri Lanka', 'give'),
293
+		'SD' => esc_html__('Sudan', 'give'),
294
+		'SR' => esc_html__('Suriname', 'give'),
295
+		'SJ' => esc_html__('Svalbard and Jan Mayen Islands', 'give'),
296
+		'SZ' => esc_html__('Swaziland', 'give'),
297
+		'SE' => esc_html__('Sweden', 'give'),
298
+		'CH' => esc_html__('Switzerland', 'give'),
299
+		'SY' => esc_html__('Syrian Arab Republic', 'give'),
300
+		'TW' => esc_html__('Taiwan', 'give'),
301
+		'TJ' => esc_html__('Tajikistan', 'give'),
302
+		'TZ' => esc_html__('Tanzania', 'give'),
303
+		'TG' => esc_html__('Togo', 'give'),
304
+		'TK' => esc_html__('Tokelau', 'give'),
305
+		'TO' => esc_html__('Tonga', 'give'),
306
+		'TH' => esc_html__('Thailand', 'give'),
307
+		'TT' => esc_html__('Trinidad and Tobago', 'give'),
308
+		'TN' => esc_html__('Tunisia', 'give'),
309
+		'TR' => esc_html__('Turkey', 'give'),
310
+		'TM' => esc_html__('Turkmenistan', 'give'),
311
+		'TC' => esc_html__('Turks and Caicos Islands', 'give'),
312
+		'TV' => esc_html__('Tuvalu', 'give'),
313
+		'UG' => esc_html__('Uganda', 'give'),
314
+		'UA' => esc_html__('Ukraine', 'give'),
315
+		'AE' => esc_html__('United Arab Emirates', 'give'),
316
+		'UY' => esc_html__('Uruguay', 'give'),
317
+		'UM' => esc_html__('US Minor Outlying Islands', 'give'),
318
+		'UZ' => esc_html__('Uzbekistan', 'give'),
319
+		'VU' => esc_html__('Vanuatu', 'give'),
320
+		'VE' => esc_html__('Venezuela', 'give'),
321
+		'VN' => esc_html__('Vietnam', 'give'),
322
+		'VG' => esc_html__('Virgin Islands (British)', 'give'),
323
+		'VI' => esc_html__('Virgin Islands (USA)', 'give'),
324
+		'WF' => esc_html__('Wallis and Futuna Islands', 'give'),
325
+		'EH' => esc_html__('Western Sahara', 'give'),
326
+		'WS' => esc_html__('Western Samoa', 'give'),
327
+		'YE' => esc_html__('Yemen', 'give'),
328
+		'YU' => esc_html__('Yugoslavia', 'give'),
329
+		'ZM' => esc_html__('Zambia', 'give'),
330
+		'ZW' => esc_html__('Zimbabwe', 'give'),
331 331
 	);
332 332
 
333
-	return (array) apply_filters( 'give_countries', $countries );
333
+	return (array) apply_filters('give_countries', $countries);
334 334
 }
335 335
 
336 336
 /**
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 	 *
385 385
 	 * @param array $states Contain the list of states in array key format where key of the array is there respected country code.
386 386
 	 */
387
-	return (array) apply_filters( 'give_states_list', $states );
387
+	return (array) apply_filters('give_states_list', $states);
388 388
 }
389 389
 
390 390
 /**
@@ -399,9 +399,9 @@  discard block
 block discarded – undo
399 399
 function give_no_states_country_list() {
400 400
 	$country_list = array();
401 401
 	$locale       = give_get_country_locale();
402
-	foreach ( $locale as $key => $value ) {
403
-		if ( ! empty( $value['state'] ) && isset( $value['state']['hidden'] ) && true === $value['state']['hidden'] ) {
404
-			$country_list[ $key ] = $value['state'];
402
+	foreach ($locale as $key => $value) {
403
+		if ( ! empty($value['state']) && isset($value['state']['hidden']) && true === $value['state']['hidden']) {
404
+			$country_list[$key] = $value['state'];
405 405
 		}
406 406
 	}
407 407
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	 *
413 413
 	 * @param array $country Contain key as there country code & value as there country name.
414 414
 	 */
415
-	return (array) apply_filters( 'give_no_states_country_list', $country_list );
415
+	return (array) apply_filters('give_no_states_country_list', $country_list);
416 416
 }
417 417
 
418 418
 /**
@@ -427,9 +427,9 @@  discard block
 block discarded – undo
427 427
 function give_states_not_required_country_list() {
428 428
 	$country_list = array();
429 429
 	$locale       = give_get_country_locale();
430
-	foreach ( $locale as $key => $value ) {
431
-		if ( ! empty( $value['state'] ) && isset( $value['state']['required'] ) && false === $value['state']['required'] ) {
432
-			$country_list[ $key ] = $value['state'];
430
+	foreach ($locale as $key => $value) {
431
+		if ( ! empty($value['state']) && isset($value['state']['required']) && false === $value['state']['required']) {
432
+			$country_list[$key] = $value['state'];
433 433
 		}
434 434
 	}
435 435
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 	 *
441 441
 	 * @param array $country Contain key as there country code & value as there country name.
442 442
 	 */
443
-	return (array) apply_filters( 'give_states_not_required_country_list', $country_list );
443
+	return (array) apply_filters('give_states_not_required_country_list', $country_list);
444 444
 }
445 445
 
446 446
 /**
@@ -452,11 +452,11 @@  discard block
 block discarded – undo
452 452
  *
453 453
  * @return string|bool
454 454
  */
455
-function give_get_country_name_by_key( $key ) {
455
+function give_get_country_name_by_key($key) {
456 456
 	$country_list = give_get_country_list();
457 457
 
458
-	if ( array_key_exists( $key, $country_list ) ) {
459
-		return $country_list[ $key ];
458
+	if (array_key_exists($key, $country_list)) {
459
+		return $country_list[$key];
460 460
 	}
461 461
 
462 462
 	return false;
@@ -471,14 +471,14 @@  discard block
 block discarded – undo
471 471
  */
472 472
 function give_get_states_label() {
473 473
 	$country_states_label = array();
474
-	$default_label        = __( 'State', 'give' );
474
+	$default_label        = __('State', 'give');
475 475
 	$locale               = give_get_country_locale();
476
-	foreach ( $locale as $key => $value ) {
476
+	foreach ($locale as $key => $value) {
477 477
 		$label = $default_label;
478
-		if ( ! empty( $value['state'] ) && ! empty( $value['state']['label'] ) ) {
478
+		if ( ! empty($value['state']) && ! empty($value['state']['label'])) {
479 479
 			$label = $value['state']['label'];
480 480
 		}
481
-		$country_states_label[ $key ] = $label;
481
+		$country_states_label[$key] = $label;
482 482
 	}
483 483
 
484 484
 	/**
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 	 *
489 489
 	 * @param array $country Contain key as there country code & value as there country name.
490 490
 	 */
491
-	return (array) apply_filters( 'give_get_states_label', $country_states_label );
491
+	return (array) apply_filters('give_get_states_label', $country_states_label);
492 492
 }
493 493
 
494 494
 /**
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
  * @return array
500 500
  */
501 501
 function give_get_country_locale() {
502
-	return (array) apply_filters( 'give_get_country_locale', array(
502
+	return (array) apply_filters('give_get_country_locale', array(
503 503
 		'AE' => array(
504 504
 			'state' => array(
505 505
 				'required' => false,
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 		),
520 520
 		'AU' => array(
521 521
 			'state' => array(
522
-				'label' => __( 'State', 'give' ),
522
+				'label' => __('State', 'give'),
523 523
 			),
524 524
 		),
525 525
 		'AX' => array(
@@ -529,13 +529,13 @@  discard block
 block discarded – undo
529 529
 		),
530 530
 		'BD' => array(
531 531
 			'state' => array(
532
-				'label' => __( 'District', 'give' ),
532
+				'label' => __('District', 'give'),
533 533
 			),
534 534
 		),
535 535
 		'BE' => array(
536 536
 			'state' => array(
537 537
 				'required' => false,
538
-				'label'    => __( 'Province', 'give' ),
538
+				'label'    => __('Province', 'give'),
539 539
 				'hidden'   => true,
540 540
 			),
541 541
 		),
@@ -546,24 +546,24 @@  discard block
 block discarded – undo
546 546
 		),
547 547
 		'CA' => array(
548 548
 			'state' => array(
549
-				'label' => __( 'Province', 'give' ),
549
+				'label' => __('Province', 'give'),
550 550
 			),
551 551
 		),
552 552
 		'CH' => array(
553 553
 			'state' => array(
554
-				'label'    => __( 'Canton', 'give' ),
554
+				'label'    => __('Canton', 'give'),
555 555
 				'required' => false,
556 556
 				'hidden'   => true,
557 557
 			),
558 558
 		),
559 559
 		'CL' => array(
560 560
 			'state' => array(
561
-				'label' => __( 'Region', 'give' ),
561
+				'label' => __('Region', 'give'),
562 562
 			),
563 563
 		),
564 564
 		'CN' => array(
565 565
 			'state' => array(
566
-				'label' => __( 'Province', 'give' ),
566
+				'label' => __('Province', 'give'),
567 567
 			),
568 568
 		),
569 569
 		'CZ' => array(
@@ -614,23 +614,23 @@  discard block
 block discarded – undo
614 614
 		),
615 615
 		'HK' => array(
616 616
 			'state' => array(
617
-				'label' => __( 'Region', 'give' ),
617
+				'label' => __('Region', 'give'),
618 618
 			),
619 619
 		),
620 620
 		'HU' => array(
621 621
 			'state' => array(
622
-				'label'  => __( 'County', 'give' ),
622
+				'label'  => __('County', 'give'),
623 623
 				'hidden' => true,
624 624
 			),
625 625
 		),
626 626
 		'ID' => array(
627 627
 			'state' => array(
628
-				'label' => __( 'Province', 'give' ),
628
+				'label' => __('Province', 'give'),
629 629
 			),
630 630
 		),
631 631
 		'IE' => array(
632 632
 			'state' => array(
633
-				'label' => __( 'County', 'give' ),
633
+				'label' => __('County', 'give'),
634 634
 			),
635 635
 		),
636 636
 		'IS' => array(
@@ -647,12 +647,12 @@  discard block
 block discarded – undo
647 647
 		'IT' => array(
648 648
 			'state' => array(
649 649
 				'required' => true,
650
-				'label'    => __( 'Province', 'give' ),
650
+				'label'    => __('Province', 'give'),
651 651
 			),
652 652
 		),
653 653
 		'JP' => array(
654 654
 			'state' => array(
655
-				'label' => __( 'Prefecture', 'give' ),
655
+				'label' => __('Prefecture', 'give'),
656 656
 			),
657 657
 		),
658 658
 		'KR' => array(
@@ -678,13 +678,13 @@  discard block
 block discarded – undo
678 678
 		'NL' => array(
679 679
 			'state' => array(
680 680
 				'required' => false,
681
-				'label'    => __( 'Province', 'give' ),
681
+				'label'    => __('Province', 'give'),
682 682
 				'hidden'   => true,
683 683
 			),
684 684
 		),
685 685
 		'NZ' => array(
686 686
 			'state' => array(
687
-				'label'    => __( 'Region', 'give' ),
687
+				'label'    => __('Region', 'give'),
688 688
 			),
689 689
 		),
690 690
 		'NO' => array(
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 		),
696 696
 		'NP' => array(
697 697
 			'state' => array(
698
-				'label' => __( 'State / Zone', 'give' ),
698
+				'label' => __('State / Zone', 'give'),
699 699
 			),
700 700
 		),
701 701
 		'PL' => array(
@@ -739,12 +739,12 @@  discard block
 block discarded – undo
739 739
 		),
740 740
 		'ES' => array(
741 741
 			'state' => array(
742
-				'label' => __( 'Province', 'give' ),
742
+				'label' => __('Province', 'give'),
743 743
 			),
744 744
 		),
745 745
 		'LI' => array(
746 746
 			'state' => array(
747
-				'label'    => __( 'Municipality', 'give' ),
747
+				'label'    => __('Municipality', 'give'),
748 748
 				'required' => false,
749 749
 				'hidden'   => true,
750 750
 			),
@@ -762,17 +762,17 @@  discard block
 block discarded – undo
762 762
 		),
763 763
 		'TR' => array(
764 764
 			'state' => array(
765
-				'label' => __( 'Province', 'give' ),
765
+				'label' => __('Province', 'give'),
766 766
 			),
767 767
 		),
768 768
 		'US' => array(
769 769
 			'state' => array(
770
-				'label' => __( 'State', 'give' ),
770
+				'label' => __('State', 'give'),
771 771
 			),
772 772
 		),
773 773
 		'GB' => array(
774 774
 			'state' => array(
775
-				'label'    => __( 'County', 'give' ),
775
+				'label'    => __('County', 'give'),
776 776
 				'required' => false,
777 777
 			),
778 778
 		),
@@ -789,10 +789,10 @@  discard block
 block discarded – undo
789 789
 		),
790 790
 		'ZA' => array(
791 791
 			'state' => array(
792
-				'label' => __( 'Province', 'give' ),
792
+				'label' => __('Province', 'give'),
793 793
 			),
794 794
 		),
795
-	) );
795
+	));
796 796
 }
797 797
 
798 798
 /**
@@ -804,90 +804,90 @@  discard block
 block discarded – undo
804 804
 function give_get_turkey_states_list() {
805 805
 	$states = array(
806 806
 		''     => '',
807
-		'TR01' => __( 'Adana', 'give' ),
808
-		'TR02' => __( 'Ad&#305;yaman', 'give' ),
809
-		'TR03' => __( 'Afyon', 'give' ),
810
-		'TR04' => __( 'A&#287;r&#305;', 'give' ),
811
-		'TR05' => __( 'Amasya', 'give' ),
812
-		'TR06' => __( 'Ankara', 'give' ),
813
-		'TR07' => __( 'Antalya', 'give' ),
814
-		'TR08' => __( 'Artvin', 'give' ),
815
-		'TR09' => __( 'Ayd&#305;n', 'give' ),
816
-		'TR10' => __( 'Bal&#305;kesir', 'give' ),
817
-		'TR11' => __( 'Bilecik', 'give' ),
818
-		'TR12' => __( 'Bing&#246;l', 'give' ),
819
-		'TR13' => __( 'Bitlis', 'give' ),
820
-		'TR14' => __( 'Bolu', 'give' ),
821
-		'TR15' => __( 'Burdur', 'give' ),
822
-		'TR16' => __( 'Bursa', 'give' ),
823
-		'TR17' => __( '&#199;anakkale', 'give' ),
824
-		'TR18' => __( '&#199;ank&#305;r&#305;', 'give' ),
825
-		'TR19' => __( '&#199;orum', 'give' ),
826
-		'TR20' => __( 'Denizli', 'give' ),
827
-		'TR21' => __( 'Diyarbak&#305;r', 'give' ),
828
-		'TR22' => __( 'Edirne', 'give' ),
829
-		'TR23' => __( 'Elaz&#305;&#287;', 'give' ),
830
-		'TR24' => __( 'Erzincan', 'give' ),
831
-		'TR25' => __( 'Erzurum', 'give' ),
832
-		'TR26' => __( 'Eski&#351;ehir', 'give' ),
833
-		'TR27' => __( 'Gaziantep', 'give' ),
834
-		'TR28' => __( 'Giresun', 'give' ),
835
-		'TR29' => __( 'G&#252;m&#252;&#351;hane', 'give' ),
836
-		'TR30' => __( 'Hakkari', 'give' ),
837
-		'TR31' => __( 'Hatay', 'give' ),
838
-		'TR32' => __( 'Isparta', 'give' ),
839
-		'TR33' => __( '&#304;&#231;el', 'give' ),
840
-		'TR34' => __( '&#304;stanbul', 'give' ),
841
-		'TR35' => __( '&#304;zmir', 'give' ),
842
-		'TR36' => __( 'Kars', 'give' ),
843
-		'TR37' => __( 'Kastamonu', 'give' ),
844
-		'TR38' => __( 'Kayseri', 'give' ),
845
-		'TR39' => __( 'K&#305;rklareli', 'give' ),
846
-		'TR40' => __( 'K&#305;r&#351;ehir', 'give' ),
847
-		'TR41' => __( 'Kocaeli', 'give' ),
848
-		'TR42' => __( 'Konya', 'give' ),
849
-		'TR43' => __( 'K&#252;tahya', 'give' ),
850
-		'TR44' => __( 'Malatya', 'give' ),
851
-		'TR45' => __( 'Manisa', 'give' ),
852
-		'TR46' => __( 'Kahramanmara&#351;', 'give' ),
853
-		'TR47' => __( 'Mardin', 'give' ),
854
-		'TR48' => __( 'Mu&#287;la', 'give' ),
855
-		'TR49' => __( 'Mu&#351;', 'give' ),
856
-		'TR50' => __( 'Nev&#351;ehir', 'give' ),
857
-		'TR51' => __( 'Ni&#287;de', 'give' ),
858
-		'TR52' => __( 'Ordu', 'give' ),
859
-		'TR53' => __( 'Rize', 'give' ),
860
-		'TR54' => __( 'Sakarya', 'give' ),
861
-		'TR55' => __( 'Samsun', 'give' ),
862
-		'TR56' => __( 'Siirt', 'give' ),
863
-		'TR57' => __( 'Sinop', 'give' ),
864
-		'TR58' => __( 'Sivas', 'give' ),
865
-		'TR59' => __( 'Tekirda&#287;', 'give' ),
866
-		'TR60' => __( 'Tokat', 'give' ),
867
-		'TR61' => __( 'Trabzon', 'give' ),
868
-		'TR62' => __( 'Tunceli', 'give' ),
869
-		'TR63' => __( '&#350;anl&#305;urfa', 'give' ),
870
-		'TR64' => __( 'U&#351;ak', 'give' ),
871
-		'TR65' => __( 'Van', 'give' ),
872
-		'TR66' => __( 'Yozgat', 'give' ),
873
-		'TR67' => __( 'Zonguldak', 'give' ),
874
-		'TR68' => __( 'Aksaray', 'give' ),
875
-		'TR69' => __( 'Bayburt', 'give' ),
876
-		'TR70' => __( 'Karaman', 'give' ),
877
-		'TR71' => __( 'K&#305;r&#305;kkale', 'give' ),
878
-		'TR72' => __( 'Batman', 'give' ),
879
-		'TR73' => __( '&#350;&#305;rnak', 'give' ),
880
-		'TR74' => __( 'Bart&#305;n', 'give' ),
881
-		'TR75' => __( 'Ardahan', 'give' ),
882
-		'TR76' => __( 'I&#287;d&#305;r', 'give' ),
883
-		'TR77' => __( 'Yalova', 'give' ),
884
-		'TR78' => __( 'Karab&#252;k', 'give' ),
885
-		'TR79' => __( 'Kilis', 'give' ),
886
-		'TR80' => __( 'Osmaniye', 'give' ),
887
-		'TR81' => __( 'D&#252;zce', 'give' ),
807
+		'TR01' => __('Adana', 'give'),
808
+		'TR02' => __('Ad&#305;yaman', 'give'),
809
+		'TR03' => __('Afyon', 'give'),
810
+		'TR04' => __('A&#287;r&#305;', 'give'),
811
+		'TR05' => __('Amasya', 'give'),
812
+		'TR06' => __('Ankara', 'give'),
813
+		'TR07' => __('Antalya', 'give'),
814
+		'TR08' => __('Artvin', 'give'),
815
+		'TR09' => __('Ayd&#305;n', 'give'),
816
+		'TR10' => __('Bal&#305;kesir', 'give'),
817
+		'TR11' => __('Bilecik', 'give'),
818
+		'TR12' => __('Bing&#246;l', 'give'),
819
+		'TR13' => __('Bitlis', 'give'),
820
+		'TR14' => __('Bolu', 'give'),
821
+		'TR15' => __('Burdur', 'give'),
822
+		'TR16' => __('Bursa', 'give'),
823
+		'TR17' => __('&#199;anakkale', 'give'),
824
+		'TR18' => __('&#199;ank&#305;r&#305;', 'give'),
825
+		'TR19' => __('&#199;orum', 'give'),
826
+		'TR20' => __('Denizli', 'give'),
827
+		'TR21' => __('Diyarbak&#305;r', 'give'),
828
+		'TR22' => __('Edirne', 'give'),
829
+		'TR23' => __('Elaz&#305;&#287;', 'give'),
830
+		'TR24' => __('Erzincan', 'give'),
831
+		'TR25' => __('Erzurum', 'give'),
832
+		'TR26' => __('Eski&#351;ehir', 'give'),
833
+		'TR27' => __('Gaziantep', 'give'),
834
+		'TR28' => __('Giresun', 'give'),
835
+		'TR29' => __('G&#252;m&#252;&#351;hane', 'give'),
836
+		'TR30' => __('Hakkari', 'give'),
837
+		'TR31' => __('Hatay', 'give'),
838
+		'TR32' => __('Isparta', 'give'),
839
+		'TR33' => __('&#304;&#231;el', 'give'),
840
+		'TR34' => __('&#304;stanbul', 'give'),
841
+		'TR35' => __('&#304;zmir', 'give'),
842
+		'TR36' => __('Kars', 'give'),
843
+		'TR37' => __('Kastamonu', 'give'),
844
+		'TR38' => __('Kayseri', 'give'),
845
+		'TR39' => __('K&#305;rklareli', 'give'),
846
+		'TR40' => __('K&#305;r&#351;ehir', 'give'),
847
+		'TR41' => __('Kocaeli', 'give'),
848
+		'TR42' => __('Konya', 'give'),
849
+		'TR43' => __('K&#252;tahya', 'give'),
850
+		'TR44' => __('Malatya', 'give'),
851
+		'TR45' => __('Manisa', 'give'),
852
+		'TR46' => __('Kahramanmara&#351;', 'give'),
853
+		'TR47' => __('Mardin', 'give'),
854
+		'TR48' => __('Mu&#287;la', 'give'),
855
+		'TR49' => __('Mu&#351;', 'give'),
856
+		'TR50' => __('Nev&#351;ehir', 'give'),
857
+		'TR51' => __('Ni&#287;de', 'give'),
858
+		'TR52' => __('Ordu', 'give'),
859
+		'TR53' => __('Rize', 'give'),
860
+		'TR54' => __('Sakarya', 'give'),
861
+		'TR55' => __('Samsun', 'give'),
862
+		'TR56' => __('Siirt', 'give'),
863
+		'TR57' => __('Sinop', 'give'),
864
+		'TR58' => __('Sivas', 'give'),
865
+		'TR59' => __('Tekirda&#287;', 'give'),
866
+		'TR60' => __('Tokat', 'give'),
867
+		'TR61' => __('Trabzon', 'give'),
868
+		'TR62' => __('Tunceli', 'give'),
869
+		'TR63' => __('&#350;anl&#305;urfa', 'give'),
870
+		'TR64' => __('U&#351;ak', 'give'),
871
+		'TR65' => __('Van', 'give'),
872
+		'TR66' => __('Yozgat', 'give'),
873
+		'TR67' => __('Zonguldak', 'give'),
874
+		'TR68' => __('Aksaray', 'give'),
875
+		'TR69' => __('Bayburt', 'give'),
876
+		'TR70' => __('Karaman', 'give'),
877
+		'TR71' => __('K&#305;r&#305;kkale', 'give'),
878
+		'TR72' => __('Batman', 'give'),
879
+		'TR73' => __('&#350;&#305;rnak', 'give'),
880
+		'TR74' => __('Bart&#305;n', 'give'),
881
+		'TR75' => __('Ardahan', 'give'),
882
+		'TR76' => __('I&#287;d&#305;r', 'give'),
883
+		'TR77' => __('Yalova', 'give'),
884
+		'TR78' => __('Karab&#252;k', 'give'),
885
+		'TR79' => __('Kilis', 'give'),
886
+		'TR80' => __('Osmaniye', 'give'),
887
+		'TR81' => __('D&#252;zce', 'give'),
888 888
 	);
889 889
 
890
-	return apply_filters( 'give_turkey_states', $states );
890
+	return apply_filters('give_turkey_states', $states);
891 891
 }
892 892
 
893 893
 /**
@@ -899,51 +899,51 @@  discard block
 block discarded – undo
899 899
 function give_get_romania_states_list() {
900 900
 	$states = array(
901 901
 		''   => '',
902
-		'AB' => __( 'Alba', 'give' ),
903
-		'AR' => __( 'Arad', 'give' ),
904
-		'AG' => __( 'Arges', 'give' ),
905
-		'BC' => __( 'Bacau', 'give' ),
906
-		'BH' => __( 'Bihor', 'give' ),
907
-		'BN' => __( 'Bistrita-Nasaud', 'give' ),
908
-		'BT' => __( 'Botosani', 'give' ),
909
-		'BR' => __( 'Braila', 'give' ),
910
-		'BV' => __( 'Brasov', 'give' ),
911
-		'B'  => __( 'Bucuresti', 'give' ),
912
-		'BZ' => __( 'Buzau', 'give' ),
913
-		'CL' => __( 'Calarasi', 'give' ),
914
-		'CS' => __( 'Caras-Severin', 'give' ),
915
-		'CJ' => __( 'Cluj', 'give' ),
916
-		'CT' => __( 'Constanta', 'give' ),
917
-		'CV' => __( 'Covasna', 'give' ),
918
-		'DB' => __( 'Dambovita', 'give' ),
919
-		'DJ' => __( 'Dolj', 'give' ),
920
-		'GL' => __( 'Galati', 'give' ),
921
-		'GR' => __( 'Giurgiu', 'give' ),
922
-		'GJ' => __( 'Gorj', 'give' ),
923
-		'HR' => __( 'Harghita', 'give' ),
924
-		'HD' => __( 'Hunedoara', 'give' ),
925
-		'IL' => __( 'Ialomita', 'give' ),
926
-		'IS' => __( 'Iasi', 'give' ),
927
-		'IF' => __( 'Ilfov', 'give' ),
928
-		'MM' => __( 'Maramures', 'give' ),
929
-		'MH' => __( 'Mehedinti', 'give' ),
930
-		'MS' => __( 'Mures', 'give' ),
931
-		'NT' => __( 'Neamt', 'give' ),
932
-		'OT' => __( 'Olt', 'give' ),
933
-		'PH' => __( 'Prahova', 'give' ),
934
-		'SJ' => __( 'Salaj', 'give' ),
935
-		'SM' => __( 'Satu Mare', 'give' ),
936
-		'SB' => __( 'Sibiu', 'give' ),
937
-		'SV' => __( 'Suceava', 'give' ),
938
-		'TR' => __( 'Teleorman', 'give' ),
939
-		'TM' => __( 'Timis', 'give' ),
940
-		'TL' => __( 'Tulcea', 'give' ),
941
-		'VL' => __( 'Valcea', 'give' ),
942
-		'VS' => __( 'Vaslui', 'give' ),
943
-		'VN' => __( 'Vrancea', 'give' ),
902
+		'AB' => __('Alba', 'give'),
903
+		'AR' => __('Arad', 'give'),
904
+		'AG' => __('Arges', 'give'),
905
+		'BC' => __('Bacau', 'give'),
906
+		'BH' => __('Bihor', 'give'),
907
+		'BN' => __('Bistrita-Nasaud', 'give'),
908
+		'BT' => __('Botosani', 'give'),
909
+		'BR' => __('Braila', 'give'),
910
+		'BV' => __('Brasov', 'give'),
911
+		'B'  => __('Bucuresti', 'give'),
912
+		'BZ' => __('Buzau', 'give'),
913
+		'CL' => __('Calarasi', 'give'),
914
+		'CS' => __('Caras-Severin', 'give'),
915
+		'CJ' => __('Cluj', 'give'),
916
+		'CT' => __('Constanta', 'give'),
917
+		'CV' => __('Covasna', 'give'),
918
+		'DB' => __('Dambovita', 'give'),
919
+		'DJ' => __('Dolj', 'give'),
920
+		'GL' => __('Galati', 'give'),
921
+		'GR' => __('Giurgiu', 'give'),
922
+		'GJ' => __('Gorj', 'give'),
923
+		'HR' => __('Harghita', 'give'),
924
+		'HD' => __('Hunedoara', 'give'),
925
+		'IL' => __('Ialomita', 'give'),
926
+		'IS' => __('Iasi', 'give'),
927
+		'IF' => __('Ilfov', 'give'),
928
+		'MM' => __('Maramures', 'give'),
929
+		'MH' => __('Mehedinti', 'give'),
930
+		'MS' => __('Mures', 'give'),
931
+		'NT' => __('Neamt', 'give'),
932
+		'OT' => __('Olt', 'give'),
933
+		'PH' => __('Prahova', 'give'),
934
+		'SJ' => __('Salaj', 'give'),
935
+		'SM' => __('Satu Mare', 'give'),
936
+		'SB' => __('Sibiu', 'give'),
937
+		'SV' => __('Suceava', 'give'),
938
+		'TR' => __('Teleorman', 'give'),
939
+		'TM' => __('Timis', 'give'),
940
+		'TL' => __('Tulcea', 'give'),
941
+		'VL' => __('Valcea', 'give'),
942
+		'VS' => __('Vaslui', 'give'),
943
+		'VN' => __('Vrancea', 'give'),
944 944
 	);
945 945
 
946
-	return apply_filters( 'give_romania_states', $states );
946
+	return apply_filters('give_romania_states', $states);
947 947
 }
948 948
 
949 949
 /**
@@ -955,17 +955,17 @@  discard block
 block discarded – undo
955 955
 function give_get_pakistan_states_list() {
956 956
 	$states = array(
957 957
 		''   => '',
958
-		'JK' => __( 'Azad Kashmir', 'give' ),
959
-		'BA' => __( 'Balochistan', 'give' ),
960
-		'TA' => __( 'FATA', 'give' ),
961
-		'GB' => __( 'Gilgit Baltistan', 'give' ),
962
-		'IS' => __( 'Islamabad Capital Territory', 'give' ),
963
-		'KP' => __( 'Khyber Pakhtunkhwa', 'give' ),
964
-		'PB' => __( 'Punjab', 'give' ),
965
-		'SD' => __( 'Sindh', 'give' ),
958
+		'JK' => __('Azad Kashmir', 'give'),
959
+		'BA' => __('Balochistan', 'give'),
960
+		'TA' => __('FATA', 'give'),
961
+		'GB' => __('Gilgit Baltistan', 'give'),
962
+		'IS' => __('Islamabad Capital Territory', 'give'),
963
+		'KP' => __('Khyber Pakhtunkhwa', 'give'),
964
+		'PB' => __('Punjab', 'give'),
965
+		'SD' => __('Sindh', 'give'),
966 966
 	);
967 967
 
968
-	return apply_filters( 'give_pakistan_states', $states );
968
+	return apply_filters('give_pakistan_states', $states);
969 969
 }
970 970
 
971 971
 /**
@@ -977,91 +977,91 @@  discard block
 block discarded – undo
977 977
 function give_get_philippines_states_list() {
978 978
 	$states = array(
979 979
 		''    => '',
980
-		'ABR' => __( 'Abra', 'give' ),
981
-		'AGN' => __( 'Agusan del Norte', 'give' ),
982
-		'AGS' => __( 'Agusan del Sur', 'give' ),
983
-		'AKL' => __( 'Aklan', 'give' ),
984
-		'ALB' => __( 'Albay', 'give' ),
985
-		'ANT' => __( 'Antique', 'give' ),
986
-		'APA' => __( 'Apayao', 'give' ),
987
-		'AUR' => __( 'Aurora', 'give' ),
988
-		'BAS' => __( 'Basilan', 'give' ),
989
-		'BAN' => __( 'Bataan', 'give' ),
990
-		'BTN' => __( 'Batanes', 'give' ),
991
-		'BTG' => __( 'Batangas', 'give' ),
992
-		'BEN' => __( 'Benguet', 'give' ),
993
-		'BIL' => __( 'Biliran', 'give' ),
994
-		'BOH' => __( 'Bohol', 'give' ),
995
-		'BUK' => __( 'Bukidnon', 'give' ),
996
-		'BUL' => __( 'Bulacan', 'give' ),
997
-		'CAG' => __( 'Cagayan', 'give' ),
998
-		'CAN' => __( 'Camarines Norte', 'give' ),
999
-		'CAS' => __( 'Camarines Sur', 'give' ),
1000
-		'CAM' => __( 'Camiguin', 'give' ),
1001
-		'CAP' => __( 'Capiz', 'give' ),
1002
-		'CAT' => __( 'Catanduanes', 'give' ),
1003
-		'CAV' => __( 'Cavite', 'give' ),
1004
-		'CEB' => __( 'Cebu', 'give' ),
1005
-		'COM' => __( 'Compostela Valley', 'give' ),
1006
-		'NCO' => __( 'Cotabato', 'give' ),
1007
-		'DAV' => __( 'Davao del Norte', 'give' ),
1008
-		'DAS' => __( 'Davao del Sur', 'give' ),
1009
-		'DAC' => __( 'Davao Occidental', 'give' ), // TODO: Needs to be updated when ISO code is assigned
1010
-		'DAO' => __( 'Davao Oriental', 'give' ),
1011
-		'DIN' => __( 'Dinagat Islands', 'give' ),
1012
-		'EAS' => __( 'Eastern Samar', 'give' ),
1013
-		'GUI' => __( 'Guimaras', 'give' ),
1014
-		'IFU' => __( 'Ifugao', 'give' ),
1015
-		'ILN' => __( 'Ilocos Norte', 'give' ),
1016
-		'ILS' => __( 'Ilocos Sur', 'give' ),
1017
-		'ILI' => __( 'Iloilo', 'give' ),
1018
-		'ISA' => __( 'Isabela', 'give' ),
1019
-		'KAL' => __( 'Kalinga', 'give' ),
1020
-		'LUN' => __( 'La Union', 'give' ),
1021
-		'LAG' => __( 'Laguna', 'give' ),
1022
-		'LAN' => __( 'Lanao del Norte', 'give' ),
1023
-		'LAS' => __( 'Lanao del Sur', 'give' ),
1024
-		'LEY' => __( 'Leyte', 'give' ),
1025
-		'MAG' => __( 'Maguindanao', 'give' ),
1026
-		'MAD' => __( 'Marinduque', 'give' ),
1027
-		'MAS' => __( 'Masbate', 'give' ),
1028
-		'MSC' => __( 'Misamis Occidental', 'give' ),
1029
-		'MSR' => __( 'Misamis Oriental', 'give' ),
1030
-		'MOU' => __( 'Mountain Province', 'give' ),
1031
-		'NEC' => __( 'Negros Occidental', 'give' ),
1032
-		'NER' => __( 'Negros Oriental', 'give' ),
1033
-		'NSA' => __( 'Northern Samar', 'give' ),
1034
-		'NUE' => __( 'Nueva Ecija', 'give' ),
1035
-		'NUV' => __( 'Nueva Vizcaya', 'give' ),
1036
-		'MDC' => __( 'Occidental Mindoro', 'give' ),
1037
-		'MDR' => __( 'Oriental Mindoro', 'give' ),
1038
-		'PLW' => __( 'Palawan', 'give' ),
1039
-		'PAM' => __( 'Pampanga', 'give' ),
1040
-		'PAN' => __( 'Pangasinan', 'give' ),
1041
-		'QUE' => __( 'Quezon', 'give' ),
1042
-		'QUI' => __( 'Quirino', 'give' ),
1043
-		'RIZ' => __( 'Rizal', 'give' ),
1044
-		'ROM' => __( 'Romblon', 'give' ),
1045
-		'WSA' => __( 'Samar', 'give' ),
1046
-		'SAR' => __( 'Sarangani', 'give' ),
1047
-		'SIQ' => __( 'Siquijor', 'give' ),
1048
-		'SOR' => __( 'Sorsogon', 'give' ),
1049
-		'SCO' => __( 'South Cotabato', 'give' ),
1050
-		'SLE' => __( 'Southern Leyte', 'give' ),
1051
-		'SUK' => __( 'Sultan Kudarat', 'give' ),
1052
-		'SLU' => __( 'Sulu', 'give' ),
1053
-		'SUN' => __( 'Surigao del Norte', 'give' ),
1054
-		'SUR' => __( 'Surigao del Sur', 'give' ),
1055
-		'TAR' => __( 'Tarlac', 'give' ),
1056
-		'TAW' => __( 'Tawi-Tawi', 'give' ),
1057
-		'ZMB' => __( 'Zambales', 'give' ),
1058
-		'ZAN' => __( 'Zamboanga del Norte', 'give' ),
1059
-		'ZAS' => __( 'Zamboanga del Sur', 'give' ),
1060
-		'ZSI' => __( 'Zamboanga Sibugay', 'give' ),
1061
-		'00'  => __( 'Metro Manila', 'give' ),
980
+		'ABR' => __('Abra', 'give'),
981
+		'AGN' => __('Agusan del Norte', 'give'),
982
+		'AGS' => __('Agusan del Sur', 'give'),
983
+		'AKL' => __('Aklan', 'give'),
984
+		'ALB' => __('Albay', 'give'),
985
+		'ANT' => __('Antique', 'give'),
986
+		'APA' => __('Apayao', 'give'),
987
+		'AUR' => __('Aurora', 'give'),
988
+		'BAS' => __('Basilan', 'give'),
989
+		'BAN' => __('Bataan', 'give'),
990
+		'BTN' => __('Batanes', 'give'),
991
+		'BTG' => __('Batangas', 'give'),
992
+		'BEN' => __('Benguet', 'give'),
993
+		'BIL' => __('Biliran', 'give'),
994
+		'BOH' => __('Bohol', 'give'),
995
+		'BUK' => __('Bukidnon', 'give'),
996
+		'BUL' => __('Bulacan', 'give'),
997
+		'CAG' => __('Cagayan', 'give'),
998
+		'CAN' => __('Camarines Norte', 'give'),
999
+		'CAS' => __('Camarines Sur', 'give'),
1000
+		'CAM' => __('Camiguin', 'give'),
1001
+		'CAP' => __('Capiz', 'give'),
1002
+		'CAT' => __('Catanduanes', 'give'),
1003
+		'CAV' => __('Cavite', 'give'),
1004
+		'CEB' => __('Cebu', 'give'),
1005
+		'COM' => __('Compostela Valley', 'give'),
1006
+		'NCO' => __('Cotabato', 'give'),
1007
+		'DAV' => __('Davao del Norte', 'give'),
1008
+		'DAS' => __('Davao del Sur', 'give'),
1009
+		'DAC' => __('Davao Occidental', 'give'), // TODO: Needs to be updated when ISO code is assigned
1010
+		'DAO' => __('Davao Oriental', 'give'),
1011
+		'DIN' => __('Dinagat Islands', 'give'),
1012
+		'EAS' => __('Eastern Samar', 'give'),
1013
+		'GUI' => __('Guimaras', 'give'),
1014
+		'IFU' => __('Ifugao', 'give'),
1015
+		'ILN' => __('Ilocos Norte', 'give'),
1016
+		'ILS' => __('Ilocos Sur', 'give'),
1017
+		'ILI' => __('Iloilo', 'give'),
1018
+		'ISA' => __('Isabela', 'give'),
1019
+		'KAL' => __('Kalinga', 'give'),
1020
+		'LUN' => __('La Union', 'give'),
1021
+		'LAG' => __('Laguna', 'give'),
1022
+		'LAN' => __('Lanao del Norte', 'give'),
1023
+		'LAS' => __('Lanao del Sur', 'give'),
1024
+		'LEY' => __('Leyte', 'give'),
1025
+		'MAG' => __('Maguindanao', 'give'),
1026
+		'MAD' => __('Marinduque', 'give'),
1027
+		'MAS' => __('Masbate', 'give'),
1028
+		'MSC' => __('Misamis Occidental', 'give'),
1029
+		'MSR' => __('Misamis Oriental', 'give'),
1030
+		'MOU' => __('Mountain Province', 'give'),
1031
+		'NEC' => __('Negros Occidental', 'give'),
1032
+		'NER' => __('Negros Oriental', 'give'),
1033
+		'NSA' => __('Northern Samar', 'give'),
1034
+		'NUE' => __('Nueva Ecija', 'give'),
1035
+		'NUV' => __('Nueva Vizcaya', 'give'),
1036
+		'MDC' => __('Occidental Mindoro', 'give'),
1037
+		'MDR' => __('Oriental Mindoro', 'give'),
1038
+		'PLW' => __('Palawan', 'give'),
1039
+		'PAM' => __('Pampanga', 'give'),
1040
+		'PAN' => __('Pangasinan', 'give'),
1041
+		'QUE' => __('Quezon', 'give'),
1042
+		'QUI' => __('Quirino', 'give'),
1043
+		'RIZ' => __('Rizal', 'give'),
1044
+		'ROM' => __('Romblon', 'give'),
1045
+		'WSA' => __('Samar', 'give'),
1046
+		'SAR' => __('Sarangani', 'give'),
1047
+		'SIQ' => __('Siquijor', 'give'),
1048
+		'SOR' => __('Sorsogon', 'give'),
1049
+		'SCO' => __('South Cotabato', 'give'),
1050
+		'SLE' => __('Southern Leyte', 'give'),
1051
+		'SUK' => __('Sultan Kudarat', 'give'),
1052
+		'SLU' => __('Sulu', 'give'),
1053
+		'SUN' => __('Surigao del Norte', 'give'),
1054
+		'SUR' => __('Surigao del Sur', 'give'),
1055
+		'TAR' => __('Tarlac', 'give'),
1056
+		'TAW' => __('Tawi-Tawi', 'give'),
1057
+		'ZMB' => __('Zambales', 'give'),
1058
+		'ZAN' => __('Zamboanga del Norte', 'give'),
1059
+		'ZAS' => __('Zamboanga del Sur', 'give'),
1060
+		'ZSI' => __('Zamboanga Sibugay', 'give'),
1061
+		'00'  => __('Metro Manila', 'give'),
1062 1062
 	);
1063 1063
 
1064
-	return apply_filters( 'give_philippines_states', $states );
1064
+	return apply_filters('give_philippines_states', $states);
1065 1065
 }
1066 1066
 
1067 1067
 /**
@@ -1073,35 +1073,35 @@  discard block
 block discarded – undo
1073 1073
 function give_get_peru_states_list() {
1074 1074
 	$states = array(
1075 1075
 		''    => '',
1076
-		'CAL' => __( 'El Callao', 'give' ),
1077
-		'LMA' => __( 'Municipalidad Metropolitana de Lima', 'give' ),
1078
-		'AMA' => __( 'Amazonas', 'give' ),
1079
-		'ANC' => __( 'Ancash', 'give' ),
1080
-		'APU' => __( 'Apur&iacute;mac', 'give' ),
1081
-		'ARE' => __( 'Arequipa', 'give' ),
1082
-		'AYA' => __( 'Ayacucho', 'give' ),
1083
-		'CAJ' => __( 'Cajamarca', 'give' ),
1084
-		'CUS' => __( 'Cusco', 'give' ),
1085
-		'HUV' => __( 'Huancavelica', 'give' ),
1086
-		'HUC' => __( 'Hu&aacute;nuco', 'give' ),
1087
-		'ICA' => __( 'Ica', 'give' ),
1088
-		'JUN' => __( 'Jun&iacute;n', 'give' ),
1089
-		'LAL' => __( 'La Libertad', 'give' ),
1090
-		'LAM' => __( 'Lambayeque', 'give' ),
1091
-		'LIM' => __( 'Lima', 'give' ),
1092
-		'LOR' => __( 'Loreto', 'give' ),
1093
-		'MDD' => __( 'Madre de Dios', 'give' ),
1094
-		'MOQ' => __( 'Moquegua', 'give' ),
1095
-		'PAS' => __( 'Pasco', 'give' ),
1096
-		'PIU' => __( 'Piura', 'give' ),
1097
-		'PUN' => __( 'Puno', 'give' ),
1098
-		'SAM' => __( 'San Mart&iacute;n', 'give' ),
1099
-		'TAC' => __( 'Tacna', 'give' ),
1100
-		'TUM' => __( 'Tumbes', 'give' ),
1101
-		'UCA' => __( 'Ucayali', 'give' ),
1076
+		'CAL' => __('El Callao', 'give'),
1077
+		'LMA' => __('Municipalidad Metropolitana de Lima', 'give'),
1078
+		'AMA' => __('Amazonas', 'give'),
1079
+		'ANC' => __('Ancash', 'give'),
1080
+		'APU' => __('Apur&iacute;mac', 'give'),
1081
+		'ARE' => __('Arequipa', 'give'),
1082
+		'AYA' => __('Ayacucho', 'give'),
1083
+		'CAJ' => __('Cajamarca', 'give'),
1084
+		'CUS' => __('Cusco', 'give'),
1085
+		'HUV' => __('Huancavelica', 'give'),
1086
+		'HUC' => __('Hu&aacute;nuco', 'give'),
1087
+		'ICA' => __('Ica', 'give'),
1088
+		'JUN' => __('Jun&iacute;n', 'give'),
1089
+		'LAL' => __('La Libertad', 'give'),
1090
+		'LAM' => __('Lambayeque', 'give'),
1091
+		'LIM' => __('Lima', 'give'),
1092
+		'LOR' => __('Loreto', 'give'),
1093
+		'MDD' => __('Madre de Dios', 'give'),
1094
+		'MOQ' => __('Moquegua', 'give'),
1095
+		'PAS' => __('Pasco', 'give'),
1096
+		'PIU' => __('Piura', 'give'),
1097
+		'PUN' => __('Puno', 'give'),
1098
+		'SAM' => __('San Mart&iacute;n', 'give'),
1099
+		'TAC' => __('Tacna', 'give'),
1100
+		'TUM' => __('Tumbes', 'give'),
1101
+		'UCA' => __('Ucayali', 'give'),
1102 1102
 	);
1103 1103
 
1104
-	return apply_filters( 'give_peru_states', $states );
1104
+	return apply_filters('give_peru_states', $states);
1105 1105
 }
1106 1106
 
1107 1107
 /**
@@ -1113,23 +1113,23 @@  discard block
 block discarded – undo
1113 1113
 function give_get_nepal_states_list() {
1114 1114
 	$states = array(
1115 1115
 		''    => '',
1116
-		'BAG' => __( 'Bagmati', 'give' ),
1117
-		'BHE' => __( 'Bheri', 'give' ),
1118
-		'DHA' => __( 'Dhaulagiri', 'give' ),
1119
-		'GAN' => __( 'Gandaki', 'give' ),
1120
-		'JAN' => __( 'Janakpur', 'give' ),
1121
-		'KAR' => __( 'Karnali', 'give' ),
1122
-		'KOS' => __( 'Koshi', 'give' ),
1123
-		'LUM' => __( 'Lumbini', 'give' ),
1124
-		'MAH' => __( 'Mahakali', 'give' ),
1125
-		'MEC' => __( 'Mechi', 'give' ),
1126
-		'NAR' => __( 'Narayani', 'give' ),
1127
-		'RAP' => __( 'Rapti', 'give' ),
1128
-		'SAG' => __( 'Sagarmatha', 'give' ),
1129
-		'SET' => __( 'Seti', 'give' ),
1116
+		'BAG' => __('Bagmati', 'give'),
1117
+		'BHE' => __('Bheri', 'give'),
1118
+		'DHA' => __('Dhaulagiri', 'give'),
1119
+		'GAN' => __('Gandaki', 'give'),
1120
+		'JAN' => __('Janakpur', 'give'),
1121
+		'KAR' => __('Karnali', 'give'),
1122
+		'KOS' => __('Koshi', 'give'),
1123
+		'LUM' => __('Lumbini', 'give'),
1124
+		'MAH' => __('Mahakali', 'give'),
1125
+		'MEC' => __('Mechi', 'give'),
1126
+		'NAR' => __('Narayani', 'give'),
1127
+		'RAP' => __('Rapti', 'give'),
1128
+		'SAG' => __('Sagarmatha', 'give'),
1129
+		'SET' => __('Seti', 'give'),
1130 1130
 	);
1131 1131
 
1132
-	return apply_filters( 'give_nepal_states', $states );
1132
+	return apply_filters('give_nepal_states', $states);
1133 1133
 }
1134 1134
 
1135 1135
 /**
@@ -1141,46 +1141,46 @@  discard block
 block discarded – undo
1141 1141
 function give_get_nigerian_states_list() {
1142 1142
 	$states = array(
1143 1143
 		''   => '',
1144
-		'AB' => __( 'Abia', 'give' ),
1145
-		'FC' => __( 'Abuja', 'give' ),
1146
-		'AD' => __( 'Adamawa', 'give' ),
1147
-		'AK' => __( 'Akwa Ibom', 'give' ),
1148
-		'AN' => __( 'Anambra', 'give' ),
1149
-		'BA' => __( 'Bauchi', 'give' ),
1150
-		'BY' => __( 'Bayelsa', 'give' ),
1151
-		'BE' => __( 'Benue', 'give' ),
1152
-		'BO' => __( 'Borno', 'give' ),
1153
-		'CR' => __( 'Cross River', 'give' ),
1154
-		'DE' => __( 'Delta', 'give' ),
1155
-		'EB' => __( 'Ebonyi', 'give' ),
1156
-		'ED' => __( 'Edo', 'give' ),
1157
-		'EK' => __( 'Ekiti', 'give' ),
1158
-		'EN' => __( 'Enugu', 'give' ),
1159
-		'GO' => __( 'Gombe', 'give' ),
1160
-		'IM' => __( 'Imo', 'give' ),
1161
-		'JI' => __( 'Jigawa', 'give' ),
1162
-		'KD' => __( 'Kaduna', 'give' ),
1163
-		'KN' => __( 'Kano', 'give' ),
1164
-		'KT' => __( 'Katsina', 'give' ),
1165
-		'KE' => __( 'Kebbi', 'give' ),
1166
-		'KO' => __( 'Kogi', 'give' ),
1167
-		'KW' => __( 'Kwara', 'give' ),
1168
-		'LA' => __( 'Lagos', 'give' ),
1169
-		'NA' => __( 'Nasarawa', 'give' ),
1170
-		'NI' => __( 'Niger', 'give' ),
1171
-		'OG' => __( 'Ogun', 'give' ),
1172
-		'ON' => __( 'Ondo', 'give' ),
1173
-		'OS' => __( 'Osun', 'give' ),
1174
-		'OY' => __( 'Oyo', 'give' ),
1175
-		'PL' => __( 'Plateau', 'give' ),
1176
-		'RI' => __( 'Rivers', 'give' ),
1177
-		'SO' => __( 'Sokoto', 'give' ),
1178
-		'TA' => __( 'Taraba', 'give' ),
1179
-		'YO' => __( 'Yobe', 'give' ),
1180
-		'ZA' => __( 'Zamfara', 'give' ),
1144
+		'AB' => __('Abia', 'give'),
1145
+		'FC' => __('Abuja', 'give'),
1146
+		'AD' => __('Adamawa', 'give'),
1147
+		'AK' => __('Akwa Ibom', 'give'),
1148
+		'AN' => __('Anambra', 'give'),
1149
+		'BA' => __('Bauchi', 'give'),
1150
+		'BY' => __('Bayelsa', 'give'),
1151
+		'BE' => __('Benue', 'give'),
1152
+		'BO' => __('Borno', 'give'),
1153
+		'CR' => __('Cross River', 'give'),
1154
+		'DE' => __('Delta', 'give'),
1155
+		'EB' => __('Ebonyi', 'give'),
1156
+		'ED' => __('Edo', 'give'),
1157
+		'EK' => __('Ekiti', 'give'),
1158
+		'EN' => __('Enugu', 'give'),
1159
+		'GO' => __('Gombe', 'give'),
1160
+		'IM' => __('Imo', 'give'),
1161
+		'JI' => __('Jigawa', 'give'),
1162
+		'KD' => __('Kaduna', 'give'),
1163
+		'KN' => __('Kano', 'give'),
1164
+		'KT' => __('Katsina', 'give'),
1165
+		'KE' => __('Kebbi', 'give'),
1166
+		'KO' => __('Kogi', 'give'),
1167
+		'KW' => __('Kwara', 'give'),
1168
+		'LA' => __('Lagos', 'give'),
1169
+		'NA' => __('Nasarawa', 'give'),
1170
+		'NI' => __('Niger', 'give'),
1171
+		'OG' => __('Ogun', 'give'),
1172
+		'ON' => __('Ondo', 'give'),
1173
+		'OS' => __('Osun', 'give'),
1174
+		'OY' => __('Oyo', 'give'),
1175
+		'PL' => __('Plateau', 'give'),
1176
+		'RI' => __('Rivers', 'give'),
1177
+		'SO' => __('Sokoto', 'give'),
1178
+		'TA' => __('Taraba', 'give'),
1179
+		'YO' => __('Yobe', 'give'),
1180
+		'ZA' => __('Zamfara', 'give'),
1181 1181
 	);
1182 1182
 
1183
-	return apply_filters( 'give_nigerian_states', $states );
1183
+	return apply_filters('give_nigerian_states', $states);
1184 1184
 }
1185 1185
 
1186 1186
 /**
@@ -1192,41 +1192,41 @@  discard block
 block discarded – undo
1192 1192
 function give_get_mexico_states_list() {
1193 1193
 	$states = array(
1194 1194
 		''                    => '',
1195
-		'Distrito Federal'    => __( 'Distrito Federal', 'give' ),
1196
-		'Jalisco'             => __( 'Jalisco', 'give' ),
1197
-		'Nuevo Leon'          => __( 'Nuevo León', 'give' ),
1198
-		'Aguascalientes'      => __( 'Aguascalientes', 'give' ),
1199
-		'Baja California'     => __( 'Baja California', 'give' ),
1200
-		'Baja California Sur' => __( 'Baja California Sur', 'give' ),
1201
-		'Campeche'            => __( 'Campeche', 'give' ),
1202
-		'Chiapas'             => __( 'Chiapas', 'give' ),
1203
-		'Chihuahua'           => __( 'Chihuahua', 'give' ),
1204
-		'Coahuila'            => __( 'Coahuila', 'give' ),
1205
-		'Colima'              => __( 'Colima', 'give' ),
1206
-		'Durango'             => __( 'Durango', 'give' ),
1207
-		'Guanajuato'          => __( 'Guanajuato', 'give' ),
1208
-		'Guerrero'            => __( 'Guerrero', 'give' ),
1209
-		'Hidalgo'             => __( 'Hidalgo', 'give' ),
1210
-		'Estado de Mexico'    => __( 'Edo. de México', 'give' ),
1211
-		'Michoacan'           => __( 'Michoacán', 'give' ),
1212
-		'Morelos'             => __( 'Morelos', 'give' ),
1213
-		'Nayarit'             => __( 'Nayarit', 'give' ),
1214
-		'Oaxaca'              => __( 'Oaxaca', 'give' ),
1215
-		'Puebla'              => __( 'Puebla', 'give' ),
1216
-		'Queretaro'           => __( 'Querétaro', 'give' ),
1217
-		'Quintana Roo'        => __( 'Quintana Roo', 'give' ),
1218
-		'San Luis Potosi'     => __( 'San Luis Potosí', 'give' ),
1219
-		'Sinaloa'             => __( 'Sinaloa', 'give' ),
1220
-		'Sonora'              => __( 'Sonora', 'give' ),
1221
-		'Tabasco'             => __( 'Tabasco', 'give' ),
1222
-		'Tamaulipas'          => __( 'Tamaulipas', 'give' ),
1223
-		'Tlaxcala'            => __( 'Tlaxcala', 'give' ),
1224
-		'Veracruz'            => __( 'Veracruz', 'give' ),
1225
-		'Yucatan'             => __( 'Yucatán', 'give' ),
1226
-		'Zacatecas'           => __( 'Zacatecas', 'give' ),
1195
+		'Distrito Federal'    => __('Distrito Federal', 'give'),
1196
+		'Jalisco'             => __('Jalisco', 'give'),
1197
+		'Nuevo Leon'          => __('Nuevo León', 'give'),
1198
+		'Aguascalientes'      => __('Aguascalientes', 'give'),
1199
+		'Baja California'     => __('Baja California', 'give'),
1200
+		'Baja California Sur' => __('Baja California Sur', 'give'),
1201
+		'Campeche'            => __('Campeche', 'give'),
1202
+		'Chiapas'             => __('Chiapas', 'give'),
1203
+		'Chihuahua'           => __('Chihuahua', 'give'),
1204
+		'Coahuila'            => __('Coahuila', 'give'),
1205
+		'Colima'              => __('Colima', 'give'),
1206
+		'Durango'             => __('Durango', 'give'),
1207
+		'Guanajuato'          => __('Guanajuato', 'give'),
1208
+		'Guerrero'            => __('Guerrero', 'give'),
1209
+		'Hidalgo'             => __('Hidalgo', 'give'),
1210
+		'Estado de Mexico'    => __('Edo. de México', 'give'),
1211
+		'Michoacan'           => __('Michoacán', 'give'),
1212
+		'Morelos'             => __('Morelos', 'give'),
1213
+		'Nayarit'             => __('Nayarit', 'give'),
1214
+		'Oaxaca'              => __('Oaxaca', 'give'),
1215
+		'Puebla'              => __('Puebla', 'give'),
1216
+		'Queretaro'           => __('Querétaro', 'give'),
1217
+		'Quintana Roo'        => __('Quintana Roo', 'give'),
1218
+		'San Luis Potosi'     => __('San Luis Potosí', 'give'),
1219
+		'Sinaloa'             => __('Sinaloa', 'give'),
1220
+		'Sonora'              => __('Sonora', 'give'),
1221
+		'Tabasco'             => __('Tabasco', 'give'),
1222
+		'Tamaulipas'          => __('Tamaulipas', 'give'),
1223
+		'Tlaxcala'            => __('Tlaxcala', 'give'),
1224
+		'Veracruz'            => __('Veracruz', 'give'),
1225
+		'Yucatan'             => __('Yucatán', 'give'),
1226
+		'Zacatecas'           => __('Zacatecas', 'give'),
1227 1227
 	);
1228 1228
 
1229
-	return apply_filters( 'give_mexico_states', $states );
1229
+	return apply_filters('give_mexico_states', $states);
1230 1230
 }
1231 1231
 
1232 1232
 /**
@@ -1238,56 +1238,56 @@  discard block
 block discarded – undo
1238 1238
 function give_get_japan_states_list() {
1239 1239
 	$states = array(
1240 1240
 		''     => '',
1241
-		'JP01' => __( 'Hokkaido', 'give' ),
1242
-		'JP02' => __( 'Aomori', 'give' ),
1243
-		'JP03' => __( 'Iwate', 'give' ),
1244
-		'JP04' => __( 'Miyagi', 'give' ),
1245
-		'JP05' => __( 'Akita', 'give' ),
1246
-		'JP06' => __( 'Yamagata', 'give' ),
1247
-		'JP07' => __( 'Fukushima', 'give' ),
1248
-		'JP08' => __( 'Ibaraki', 'give' ),
1249
-		'JP09' => __( 'Tochigi', 'give' ),
1250
-		'JP10' => __( 'Gunma', 'give' ),
1251
-		'JP11' => __( 'Saitama', 'give' ),
1252
-		'JP12' => __( 'Chiba', 'give' ),
1253
-		'JP13' => __( 'Tokyo', 'give' ),
1254
-		'JP14' => __( 'Kanagawa', 'give' ),
1255
-		'JP15' => __( 'Niigata', 'give' ),
1256
-		'JP16' => __( 'Toyama', 'give' ),
1257
-		'JP17' => __( 'Ishikawa', 'give' ),
1258
-		'JP18' => __( 'Fukui', 'give' ),
1259
-		'JP19' => __( 'Yamanashi', 'give' ),
1260
-		'JP20' => __( 'Nagano', 'give' ),
1261
-		'JP21' => __( 'Gifu', 'give' ),
1262
-		'JP22' => __( 'Shizuoka', 'give' ),
1263
-		'JP23' => __( 'Aichi', 'give' ),
1264
-		'JP24' => __( 'Mie', 'give' ),
1265
-		'JP25' => __( 'Shiga', 'give' ),
1266
-		'JP26' => __( 'Kyoto', 'give' ),
1267
-		'JP27' => __( 'Osaka', 'give' ),
1268
-		'JP28' => __( 'Hyogo', 'give' ),
1269
-		'JP29' => __( 'Nara', 'give' ),
1270
-		'JP30' => __( 'Wakayama', 'give' ),
1271
-		'JP31' => __( 'Tottori', 'give' ),
1272
-		'JP32' => __( 'Shimane', 'give' ),
1273
-		'JP33' => __( 'Okayama', 'give' ),
1274
-		'JP34' => __( 'Hiroshima', 'give' ),
1275
-		'JP35' => __( 'Yamaguchi', 'give' ),
1276
-		'JP36' => __( 'Tokushima', 'give' ),
1277
-		'JP37' => __( 'Kagawa', 'give' ),
1278
-		'JP38' => __( 'Ehime', 'give' ),
1279
-		'JP39' => __( 'Kochi', 'give' ),
1280
-		'JP40' => __( 'Fukuoka', 'give' ),
1281
-		'JP41' => __( 'Saga', 'give' ),
1282
-		'JP42' => __( 'Nagasaki', 'give' ),
1283
-		'JP43' => __( 'Kumamoto', 'give' ),
1284
-		'JP44' => __( 'Oita', 'give' ),
1285
-		'JP45' => __( 'Miyazaki', 'give' ),
1286
-		'JP46' => __( 'Kagoshima', 'give' ),
1287
-		'JP47' => __( 'Okinawa', 'give' ),
1241
+		'JP01' => __('Hokkaido', 'give'),
1242
+		'JP02' => __('Aomori', 'give'),
1243
+		'JP03' => __('Iwate', 'give'),
1244
+		'JP04' => __('Miyagi', 'give'),
1245
+		'JP05' => __('Akita', 'give'),
1246
+		'JP06' => __('Yamagata', 'give'),
1247
+		'JP07' => __('Fukushima', 'give'),
1248
+		'JP08' => __('Ibaraki', 'give'),
1249
+		'JP09' => __('Tochigi', 'give'),
1250
+		'JP10' => __('Gunma', 'give'),
1251
+		'JP11' => __('Saitama', 'give'),
1252
+		'JP12' => __('Chiba', 'give'),
1253
+		'JP13' => __('Tokyo', 'give'),
1254
+		'JP14' => __('Kanagawa', 'give'),
1255
+		'JP15' => __('Niigata', 'give'),
1256
+		'JP16' => __('Toyama', 'give'),
1257
+		'JP17' => __('Ishikawa', 'give'),
1258
+		'JP18' => __('Fukui', 'give'),
1259
+		'JP19' => __('Yamanashi', 'give'),
1260
+		'JP20' => __('Nagano', 'give'),
1261
+		'JP21' => __('Gifu', 'give'),
1262
+		'JP22' => __('Shizuoka', 'give'),
1263
+		'JP23' => __('Aichi', 'give'),
1264
+		'JP24' => __('Mie', 'give'),
1265
+		'JP25' => __('Shiga', 'give'),
1266
+		'JP26' => __('Kyoto', 'give'),
1267
+		'JP27' => __('Osaka', 'give'),
1268
+		'JP28' => __('Hyogo', 'give'),
1269
+		'JP29' => __('Nara', 'give'),
1270
+		'JP30' => __('Wakayama', 'give'),
1271
+		'JP31' => __('Tottori', 'give'),
1272
+		'JP32' => __('Shimane', 'give'),
1273
+		'JP33' => __('Okayama', 'give'),
1274
+		'JP34' => __('Hiroshima', 'give'),
1275
+		'JP35' => __('Yamaguchi', 'give'),
1276
+		'JP36' => __('Tokushima', 'give'),
1277
+		'JP37' => __('Kagawa', 'give'),
1278
+		'JP38' => __('Ehime', 'give'),
1279
+		'JP39' => __('Kochi', 'give'),
1280
+		'JP40' => __('Fukuoka', 'give'),
1281
+		'JP41' => __('Saga', 'give'),
1282
+		'JP42' => __('Nagasaki', 'give'),
1283
+		'JP43' => __('Kumamoto', 'give'),
1284
+		'JP44' => __('Oita', 'give'),
1285
+		'JP45' => __('Miyazaki', 'give'),
1286
+		'JP46' => __('Kagoshima', 'give'),
1287
+		'JP47' => __('Okinawa', 'give'),
1288 1288
 	);
1289 1289
 
1290
-	return apply_filters( 'give_japan_states', $states );
1290
+	return apply_filters('give_japan_states', $states);
1291 1291
 }
1292 1292
 
1293 1293
 /**
@@ -1299,119 +1299,119 @@  discard block
 block discarded – undo
1299 1299
 function give_get_italy_states_list() {
1300 1300
 	$states = array(
1301 1301
 		''   => '',
1302
-		'AG' => __( 'Agrigento', 'give' ),
1303
-		'AL' => __( 'Alessandria', 'give' ),
1304
-		'AN' => __( 'Ancona', 'give' ),
1305
-		'AO' => __( 'Aosta', 'give' ),
1306
-		'AR' => __( 'Arezzo', 'give' ),
1307
-		'AP' => __( 'Ascoli Piceno', 'give' ),
1308
-		'AT' => __( 'Asti', 'give' ),
1309
-		'AV' => __( 'Avellino', 'give' ),
1310
-		'BA' => __( 'Bari', 'give' ),
1311
-		'BT' => __( 'Barletta-Andria-Trani', 'give' ),
1312
-		'BL' => __( 'Belluno', 'give' ),
1313
-		'BN' => __( 'Benevento', 'give' ),
1314
-		'BG' => __( 'Bergamo', 'give' ),
1315
-		'BI' => __( 'Biella', 'give' ),
1316
-		'BO' => __( 'Bologna', 'give' ),
1317
-		'BZ' => __( 'Bolzano', 'give' ),
1318
-		'BS' => __( 'Brescia', 'give' ),
1319
-		'BR' => __( 'Brindisi', 'give' ),
1320
-		'CA' => __( 'Cagliari', 'give' ),
1321
-		'CL' => __( 'Caltanissetta', 'give' ),
1322
-		'CB' => __( 'Campobasso', 'give' ),
1323
-		'CI' => __( 'Carbonia-Iglesias', 'give' ),
1324
-		'CE' => __( 'Caserta', 'give' ),
1325
-		'CT' => __( 'Catania', 'give' ),
1326
-		'CZ' => __( 'Catanzaro', 'give' ),
1327
-		'CH' => __( 'Chieti', 'give' ),
1328
-		'CO' => __( 'Como', 'give' ),
1329
-		'CS' => __( 'Cosenza', 'give' ),
1330
-		'CR' => __( 'Cremona', 'give' ),
1331
-		'KR' => __( 'Crotone', 'give' ),
1332
-		'CN' => __( 'Cuneo', 'give' ),
1333
-		'EN' => __( 'Enna', 'give' ),
1334
-		'FM' => __( 'Fermo', 'give' ),
1335
-		'FE' => __( 'Ferrara', 'give' ),
1336
-		'FI' => __( 'Firenze', 'give' ),
1337
-		'FG' => __( 'Foggia', 'give' ),
1338
-		'FC' => __( 'Forlì-Cesena', 'give' ),
1339
-		'FR' => __( 'Frosinone', 'give' ),
1340
-		'GE' => __( 'Genova', 'give' ),
1341
-		'GO' => __( 'Gorizia', 'give' ),
1342
-		'GR' => __( 'Grosseto', 'give' ),
1343
-		'IM' => __( 'Imperia', 'give' ),
1344
-		'IS' => __( 'Isernia', 'give' ),
1345
-		'SP' => __( 'La Spezia', 'give' ),
1346
-		'AQ' => __( "L'Aquila", 'give' ),
1347
-		'LT' => __( 'Latina', 'give' ),
1348
-		'LE' => __( 'Lecce', 'give' ),
1349
-		'LC' => __( 'Lecco', 'give' ),
1350
-		'LI' => __( 'Livorno', 'give' ),
1351
-		'LO' => __( 'Lodi', 'give' ),
1352
-		'LU' => __( 'Lucca', 'give' ),
1353
-		'MC' => __( 'Macerata', 'give' ),
1354
-		'MN' => __( 'Mantova', 'give' ),
1355
-		'MS' => __( 'Massa-Carrara', 'give' ),
1356
-		'MT' => __( 'Matera', 'give' ),
1357
-		'ME' => __( 'Messina', 'give' ),
1358
-		'MI' => __( 'Milano', 'give' ),
1359
-		'MO' => __( 'Modena', 'give' ),
1360
-		'MB' => __( 'Monza e della Brianza', 'give' ),
1361
-		'NA' => __( 'Napoli', 'give' ),
1362
-		'NO' => __( 'Novara', 'give' ),
1363
-		'NU' => __( 'Nuoro', 'give' ),
1364
-		'OT' => __( 'Olbia-Tempio', 'give' ),
1365
-		'OR' => __( 'Oristano', 'give' ),
1366
-		'PD' => __( 'Padova', 'give' ),
1367
-		'PA' => __( 'Palermo', 'give' ),
1368
-		'PR' => __( 'Parma', 'give' ),
1369
-		'PV' => __( 'Pavia', 'give' ),
1370
-		'PG' => __( 'Perugia', 'give' ),
1371
-		'PU' => __( 'Pesaro e Urbino', 'give' ),
1372
-		'PE' => __( 'Pescara', 'give' ),
1373
-		'PC' => __( 'Piacenza', 'give' ),
1374
-		'PI' => __( 'Pisa', 'give' ),
1375
-		'PT' => __( 'Pistoia', 'give' ),
1376
-		'PN' => __( 'Pordenone', 'give' ),
1377
-		'PZ' => __( 'Potenza', 'give' ),
1378
-		'PO' => __( 'Prato', 'give' ),
1379
-		'RG' => __( 'Ragusa', 'give' ),
1380
-		'RA' => __( 'Ravenna', 'give' ),
1381
-		'RC' => __( 'Reggio Calabria', 'give' ),
1382
-		'RE' => __( 'Reggio Emilia', 'give' ),
1383
-		'RI' => __( 'Rieti', 'give' ),
1384
-		'RN' => __( 'Rimini', 'give' ),
1385
-		'RM' => __( 'Roma', 'give' ),
1386
-		'RO' => __( 'Rovigo', 'give' ),
1387
-		'SA' => __( 'Salerno', 'give' ),
1388
-		'VS' => __( 'Medio Campidano', 'give' ),
1389
-		'SS' => __( 'Sassari', 'give' ),
1390
-		'SV' => __( 'Savona', 'give' ),
1391
-		'SI' => __( 'Siena', 'give' ),
1392
-		'SR' => __( 'Siracusa', 'give' ),
1393
-		'SO' => __( 'Sondrio', 'give' ),
1394
-		'TA' => __( 'Taranto', 'give' ),
1395
-		'TE' => __( 'Teramo', 'give' ),
1396
-		'TR' => __( 'Terni', 'give' ),
1397
-		'TO' => __( 'Torino', 'give' ),
1398
-		'OG' => __( 'Ogliastra', 'give' ),
1399
-		'TP' => __( 'Trapani', 'give' ),
1400
-		'TN' => __( 'Trento', 'give' ),
1401
-		'TV' => __( 'Treviso', 'give' ),
1402
-		'TS' => __( 'Trieste', 'give' ),
1403
-		'UD' => __( 'Udine', 'give' ),
1404
-		'VA' => __( 'Varese', 'give' ),
1405
-		'VE' => __( 'Venezia', 'give' ),
1406
-		'VB' => __( 'Verbano-Cusio-Ossola', 'give' ),
1407
-		'VC' => __( 'Vercelli', 'give' ),
1408
-		'VR' => __( 'Verona', 'give' ),
1409
-		'VV' => __( 'Vibo Valentia', 'give' ),
1410
-		'VI' => __( 'Vicenza', 'give' ),
1411
-		'VT' => __( 'Viterbo', 'give' ),
1302
+		'AG' => __('Agrigento', 'give'),
1303
+		'AL' => __('Alessandria', 'give'),
1304
+		'AN' => __('Ancona', 'give'),
1305
+		'AO' => __('Aosta', 'give'),
1306
+		'AR' => __('Arezzo', 'give'),
1307
+		'AP' => __('Ascoli Piceno', 'give'),
1308
+		'AT' => __('Asti', 'give'),
1309
+		'AV' => __('Avellino', 'give'),
1310
+		'BA' => __('Bari', 'give'),
1311
+		'BT' => __('Barletta-Andria-Trani', 'give'),
1312
+		'BL' => __('Belluno', 'give'),
1313
+		'BN' => __('Benevento', 'give'),
1314
+		'BG' => __('Bergamo', 'give'),
1315
+		'BI' => __('Biella', 'give'),
1316
+		'BO' => __('Bologna', 'give'),
1317
+		'BZ' => __('Bolzano', 'give'),
1318
+		'BS' => __('Brescia', 'give'),
1319
+		'BR' => __('Brindisi', 'give'),
1320
+		'CA' => __('Cagliari', 'give'),
1321
+		'CL' => __('Caltanissetta', 'give'),
1322
+		'CB' => __('Campobasso', 'give'),
1323
+		'CI' => __('Carbonia-Iglesias', 'give'),
1324
+		'CE' => __('Caserta', 'give'),
1325
+		'CT' => __('Catania', 'give'),
1326
+		'CZ' => __('Catanzaro', 'give'),
1327
+		'CH' => __('Chieti', 'give'),
1328
+		'CO' => __('Como', 'give'),
1329
+		'CS' => __('Cosenza', 'give'),
1330
+		'CR' => __('Cremona', 'give'),
1331
+		'KR' => __('Crotone', 'give'),
1332
+		'CN' => __('Cuneo', 'give'),
1333
+		'EN' => __('Enna', 'give'),
1334
+		'FM' => __('Fermo', 'give'),
1335
+		'FE' => __('Ferrara', 'give'),
1336
+		'FI' => __('Firenze', 'give'),
1337
+		'FG' => __('Foggia', 'give'),
1338
+		'FC' => __('Forlì-Cesena', 'give'),
1339
+		'FR' => __('Frosinone', 'give'),
1340
+		'GE' => __('Genova', 'give'),
1341
+		'GO' => __('Gorizia', 'give'),
1342
+		'GR' => __('Grosseto', 'give'),
1343
+		'IM' => __('Imperia', 'give'),
1344
+		'IS' => __('Isernia', 'give'),
1345
+		'SP' => __('La Spezia', 'give'),
1346
+		'AQ' => __("L'Aquila", 'give'),
1347
+		'LT' => __('Latina', 'give'),
1348
+		'LE' => __('Lecce', 'give'),
1349
+		'LC' => __('Lecco', 'give'),
1350
+		'LI' => __('Livorno', 'give'),
1351
+		'LO' => __('Lodi', 'give'),
1352
+		'LU' => __('Lucca', 'give'),
1353
+		'MC' => __('Macerata', 'give'),
1354
+		'MN' => __('Mantova', 'give'),
1355
+		'MS' => __('Massa-Carrara', 'give'),
1356
+		'MT' => __('Matera', 'give'),
1357
+		'ME' => __('Messina', 'give'),
1358
+		'MI' => __('Milano', 'give'),
1359
+		'MO' => __('Modena', 'give'),
1360
+		'MB' => __('Monza e della Brianza', 'give'),
1361
+		'NA' => __('Napoli', 'give'),
1362
+		'NO' => __('Novara', 'give'),
1363
+		'NU' => __('Nuoro', 'give'),
1364
+		'OT' => __('Olbia-Tempio', 'give'),
1365
+		'OR' => __('Oristano', 'give'),
1366
+		'PD' => __('Padova', 'give'),
1367
+		'PA' => __('Palermo', 'give'),
1368
+		'PR' => __('Parma', 'give'),
1369
+		'PV' => __('Pavia', 'give'),
1370
+		'PG' => __('Perugia', 'give'),
1371
+		'PU' => __('Pesaro e Urbino', 'give'),
1372
+		'PE' => __('Pescara', 'give'),
1373
+		'PC' => __('Piacenza', 'give'),
1374
+		'PI' => __('Pisa', 'give'),
1375
+		'PT' => __('Pistoia', 'give'),
1376
+		'PN' => __('Pordenone', 'give'),
1377
+		'PZ' => __('Potenza', 'give'),
1378
+		'PO' => __('Prato', 'give'),
1379
+		'RG' => __('Ragusa', 'give'),
1380
+		'RA' => __('Ravenna', 'give'),
1381
+		'RC' => __('Reggio Calabria', 'give'),
1382
+		'RE' => __('Reggio Emilia', 'give'),
1383
+		'RI' => __('Rieti', 'give'),
1384
+		'RN' => __('Rimini', 'give'),
1385
+		'RM' => __('Roma', 'give'),
1386
+		'RO' => __('Rovigo', 'give'),
1387
+		'SA' => __('Salerno', 'give'),
1388
+		'VS' => __('Medio Campidano', 'give'),
1389
+		'SS' => __('Sassari', 'give'),
1390
+		'SV' => __('Savona', 'give'),
1391
+		'SI' => __('Siena', 'give'),
1392
+		'SR' => __('Siracusa', 'give'),
1393
+		'SO' => __('Sondrio', 'give'),
1394
+		'TA' => __('Taranto', 'give'),
1395
+		'TE' => __('Teramo', 'give'),
1396
+		'TR' => __('Terni', 'give'),
1397
+		'TO' => __('Torino', 'give'),
1398
+		'OG' => __('Ogliastra', 'give'),
1399
+		'TP' => __('Trapani', 'give'),
1400
+		'TN' => __('Trento', 'give'),
1401
+		'TV' => __('Treviso', 'give'),
1402
+		'TS' => __('Trieste', 'give'),
1403
+		'UD' => __('Udine', 'give'),
1404
+		'VA' => __('Varese', 'give'),
1405
+		'VE' => __('Venezia', 'give'),
1406
+		'VB' => __('Verbano-Cusio-Ossola', 'give'),
1407
+		'VC' => __('Vercelli', 'give'),
1408
+		'VR' => __('Verona', 'give'),
1409
+		'VV' => __('Vibo Valentia', 'give'),
1410
+		'VI' => __('Vicenza', 'give'),
1411
+		'VT' => __('Viterbo', 'give'),
1412 1412
 	);
1413 1413
 
1414
-	return apply_filters( 'give_italy_states', $states );
1414
+	return apply_filters('give_italy_states', $states);
1415 1415
 }
1416 1416
 
1417 1417
 /**
@@ -1423,40 +1423,40 @@  discard block
 block discarded – undo
1423 1423
 function give_get_iran_states_list() {
1424 1424
 	$states = array(
1425 1425
 		''    => '',
1426
-		'KHZ' => __( 'Khuzestan  (خوزستان)', 'give' ),
1427
-		'THR' => __( 'Tehran  (تهران)', 'give' ),
1428
-		'ILM' => __( 'Ilaam (ایلام)', 'give' ),
1429
-		'BHR' => __( 'Bushehr (بوشهر)', 'give' ),
1430
-		'ADL' => __( 'Ardabil (اردبیل)', 'give' ),
1431
-		'ESF' => __( 'Isfahan (اصفهان)', 'give' ),
1432
-		'YZD' => __( 'Yazd (یزد)', 'give' ),
1433
-		'KRH' => __( 'Kermanshah (کرمانشاه)', 'give' ),
1434
-		'KRN' => __( 'Kerman (کرمان)', 'give' ),
1435
-		'HDN' => __( 'Hamadan (همدان)', 'give' ),
1436
-		'GZN' => __( 'Ghazvin (قزوین)', 'give' ),
1437
-		'ZJN' => __( 'Zanjan (زنجان)', 'give' ),
1438
-		'LRS' => __( 'Luristan (لرستان)', 'give' ),
1439
-		'ABZ' => __( 'Alborz (البرز)', 'give' ),
1440
-		'EAZ' => __( 'East Azarbaijan (آذربایجان شرقی)', 'give' ),
1441
-		'WAZ' => __( 'West Azarbaijan (آذربایجان غربی)', 'give' ),
1442
-		'CHB' => __( 'Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give' ),
1443
-		'SKH' => __( 'South Khorasan (خراسان جنوبی)', 'give' ),
1444
-		'RKH' => __( 'Razavi Khorasan (خراسان رضوی)', 'give' ),
1445
-		'NKH' => __( 'North Khorasan (خراسان جنوبی)', 'give' ),
1446
-		'SMN' => __( 'Semnan (سمنان)', 'give' ),
1447
-		'FRS' => __( 'Fars (فارس)', 'give' ),
1448
-		'QHM' => __( 'Qom (قم)', 'give' ),
1449
-		'KRD' => __( 'Kurdistan / کردستان)', 'give' ),
1450
-		'KBD' => __( 'Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give' ),
1451
-		'GLS' => __( 'Golestan (گلستان)', 'give' ),
1452
-		'GIL' => __( 'Gilan (گیلان)', 'give' ),
1453
-		'MZN' => __( 'Mazandaran (مازندران)', 'give' ),
1454
-		'MKZ' => __( 'Markazi (مرکزی)', 'give' ),
1455
-		'HRZ' => __( 'Hormozgan (هرمزگان)', 'give' ),
1456
-		'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'give' ),
1426
+		'KHZ' => __('Khuzestan  (خوزستان)', 'give'),
1427
+		'THR' => __('Tehran  (تهران)', 'give'),
1428
+		'ILM' => __('Ilaam (ایلام)', 'give'),
1429
+		'BHR' => __('Bushehr (بوشهر)', 'give'),
1430
+		'ADL' => __('Ardabil (اردبیل)', 'give'),
1431
+		'ESF' => __('Isfahan (اصفهان)', 'give'),
1432
+		'YZD' => __('Yazd (یزد)', 'give'),
1433
+		'KRH' => __('Kermanshah (کرمانشاه)', 'give'),
1434
+		'KRN' => __('Kerman (کرمان)', 'give'),
1435
+		'HDN' => __('Hamadan (همدان)', 'give'),
1436
+		'GZN' => __('Ghazvin (قزوین)', 'give'),
1437
+		'ZJN' => __('Zanjan (زنجان)', 'give'),
1438
+		'LRS' => __('Luristan (لرستان)', 'give'),
1439
+		'ABZ' => __('Alborz (البرز)', 'give'),
1440
+		'EAZ' => __('East Azarbaijan (آذربایجان شرقی)', 'give'),
1441
+		'WAZ' => __('West Azarbaijan (آذربایجان غربی)', 'give'),
1442
+		'CHB' => __('Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give'),
1443
+		'SKH' => __('South Khorasan (خراسان جنوبی)', 'give'),
1444
+		'RKH' => __('Razavi Khorasan (خراسان رضوی)', 'give'),
1445
+		'NKH' => __('North Khorasan (خراسان جنوبی)', 'give'),
1446
+		'SMN' => __('Semnan (سمنان)', 'give'),
1447
+		'FRS' => __('Fars (فارس)', 'give'),
1448
+		'QHM' => __('Qom (قم)', 'give'),
1449
+		'KRD' => __('Kurdistan / کردستان)', 'give'),
1450
+		'KBD' => __('Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give'),
1451
+		'GLS' => __('Golestan (گلستان)', 'give'),
1452
+		'GIL' => __('Gilan (گیلان)', 'give'),
1453
+		'MZN' => __('Mazandaran (مازندران)', 'give'),
1454
+		'MKZ' => __('Markazi (مرکزی)', 'give'),
1455
+		'HRZ' => __('Hormozgan (هرمزگان)', 'give'),
1456
+		'SBN' => __('Sistan and Baluchestan (سیستان و بلوچستان)', 'give'),
1457 1457
 	);
1458 1458
 
1459
-	return apply_filters( 'give_iran_states', $states );
1459
+	return apply_filters('give_iran_states', $states);
1460 1460
 }
1461 1461
 
1462 1462
 /**
@@ -1468,35 +1468,35 @@  discard block
 block discarded – undo
1468 1468
 function give_get_ireland_states_list() {
1469 1469
 	$states = array(
1470 1470
 		''   => '',
1471
-		'CE' => __( 'Clare', 'give' ),
1472
-		'CK' => __( 'Cork', 'give' ),
1473
-		'CN' => __( 'Cavan', 'give' ),
1474
-		'CW' => __( 'Carlow', 'give' ),
1475
-		'DL' => __( 'Donegal', 'give' ),
1476
-		'DN' => __( 'Dublin', 'give' ),
1477
-		'GY' => __( 'Galway', 'give' ),
1478
-		'KE' => __( 'Kildare', 'give' ),
1479
-		'KK' => __( 'Kilkenny', 'give' ),
1480
-		'KY' => __( 'Kerry', 'give' ),
1481
-		'LD' => __( 'Longford', 'give' ),
1482
-		'LH' => __( 'Louth', 'give' ),
1483
-		'LK' => __( 'Limerick', 'give' ),
1484
-		'LM' => __( 'Leitrim', 'give' ),
1485
-		'LS' => __( 'Laois', 'give' ),
1486
-		'MH' => __( 'Meath', 'give' ),
1487
-		'MN' => __( 'Monaghan', 'give' ),
1488
-		'MO' => __( 'Mayo', 'give' ),
1489
-		'OY' => __( 'Offaly', 'give' ),
1490
-		'RN' => __( 'Roscommon', 'give' ),
1491
-		'SO' => __( 'Sligo', 'give' ),
1492
-		'TY' => __( 'Tipperary', 'give' ),
1493
-		'WD' => __( 'Waterford', 'give' ),
1494
-		'WH' => __( 'Westmeath', 'give' ),
1495
-		'WW' => __( 'Wicklow', 'give' ),
1496
-		'WX' => __( 'Wexford', 'give' ),
1471
+		'CE' => __('Clare', 'give'),
1472
+		'CK' => __('Cork', 'give'),
1473
+		'CN' => __('Cavan', 'give'),
1474
+		'CW' => __('Carlow', 'give'),
1475
+		'DL' => __('Donegal', 'give'),
1476
+		'DN' => __('Dublin', 'give'),
1477
+		'GY' => __('Galway', 'give'),
1478
+		'KE' => __('Kildare', 'give'),
1479
+		'KK' => __('Kilkenny', 'give'),
1480
+		'KY' => __('Kerry', 'give'),
1481
+		'LD' => __('Longford', 'give'),
1482
+		'LH' => __('Louth', 'give'),
1483
+		'LK' => __('Limerick', 'give'),
1484
+		'LM' => __('Leitrim', 'give'),
1485
+		'LS' => __('Laois', 'give'),
1486
+		'MH' => __('Meath', 'give'),
1487
+		'MN' => __('Monaghan', 'give'),
1488
+		'MO' => __('Mayo', 'give'),
1489
+		'OY' => __('Offaly', 'give'),
1490
+		'RN' => __('Roscommon', 'give'),
1491
+		'SO' => __('Sligo', 'give'),
1492
+		'TY' => __('Tipperary', 'give'),
1493
+		'WD' => __('Waterford', 'give'),
1494
+		'WH' => __('Westmeath', 'give'),
1495
+		'WW' => __('Wicklow', 'give'),
1496
+		'WX' => __('Wexford', 'give'),
1497 1497
 	);
1498 1498
 
1499
-	return apply_filters( 'give_ireland_states', $states );
1499
+	return apply_filters('give_ireland_states', $states);
1500 1500
 }
1501 1501
 
1502 1502
 /**
@@ -1508,22 +1508,22 @@  discard block
 block discarded – undo
1508 1508
 function give_get_greek_states_list() {
1509 1509
 	$states = array(
1510 1510
 		''  => '',
1511
-		'I' => __( 'Αττική', 'give' ),
1512
-		'A' => __( 'Ανατολική Μακεδονία και Θράκη', 'give' ),
1513
-		'B' => __( 'Κεντρική Μακεδονία', 'give' ),
1514
-		'C' => __( 'Δυτική Μακεδονία', 'give' ),
1515
-		'D' => __( 'Ήπειρος', 'give' ),
1516
-		'E' => __( 'Θεσσαλία', 'give' ),
1517
-		'F' => __( 'Ιόνιοι Νήσοι', 'give' ),
1518
-		'G' => __( 'Δυτική Ελλάδα', 'give' ),
1519
-		'H' => __( 'Στερεά Ελλάδα', 'give' ),
1520
-		'J' => __( 'Πελοπόννησος', 'give' ),
1521
-		'K' => __( 'Βόρειο Αιγαίο', 'give' ),
1522
-		'L' => __( 'Νότιο Αιγαίο', 'give' ),
1523
-		'M' => __( 'Κρήτη', 'give' ),
1511
+		'I' => __('Αττική', 'give'),
1512
+		'A' => __('Ανατολική Μακεδονία και Θράκη', 'give'),
1513
+		'B' => __('Κεντρική Μακεδονία', 'give'),
1514
+		'C' => __('Δυτική Μακεδονία', 'give'),
1515
+		'D' => __('Ήπειρος', 'give'),
1516
+		'E' => __('Θεσσαλία', 'give'),
1517
+		'F' => __('Ιόνιοι Νήσοι', 'give'),
1518
+		'G' => __('Δυτική Ελλάδα', 'give'),
1519
+		'H' => __('Στερεά Ελλάδα', 'give'),
1520
+		'J' => __('Πελοπόννησος', 'give'),
1521
+		'K' => __('Βόρειο Αιγαίο', 'give'),
1522
+		'L' => __('Νότιο Αιγαίο', 'give'),
1523
+		'M' => __('Κρήτη', 'give'),
1524 1524
 	);
1525 1525
 
1526
-	return apply_filters( 'give_greek_states', $states );
1526
+	return apply_filters('give_greek_states', $states);
1527 1527
 }
1528 1528
 
1529 1529
 /**
@@ -1535,18 +1535,18 @@  discard block
 block discarded – undo
1535 1535
 function give_get_bolivian_states_list() {
1536 1536
 	$states = array(
1537 1537
 		''  => '',
1538
-		'B' => __( 'Chuquisaca', 'give' ),
1539
-		'H' => __( 'Beni', 'give' ),
1540
-		'C' => __( 'Cochabamba', 'give' ),
1541
-		'L' => __( 'La Paz', 'give' ),
1542
-		'O' => __( 'Oruro', 'give' ),
1543
-		'N' => __( 'Pando', 'give' ),
1544
-		'P' => __( 'Potosí', 'give' ),
1545
-		'S' => __( 'Santa Cruz', 'give' ),
1546
-		'T' => __( 'Tarija', 'give' ),
1538
+		'B' => __('Chuquisaca', 'give'),
1539
+		'H' => __('Beni', 'give'),
1540
+		'C' => __('Cochabamba', 'give'),
1541
+		'L' => __('La Paz', 'give'),
1542
+		'O' => __('Oruro', 'give'),
1543
+		'N' => __('Pando', 'give'),
1544
+		'P' => __('Potosí', 'give'),
1545
+		'S' => __('Santa Cruz', 'give'),
1546
+		'T' => __('Tarija', 'give'),
1547 1547
 	);
1548 1548
 
1549
-	return apply_filters( 'give_bolivian_states', $states );
1549
+	return apply_filters('give_bolivian_states', $states);
1550 1550
 }
1551 1551
 
1552 1552
 /**
@@ -1558,37 +1558,37 @@  discard block
 block discarded – undo
1558 1558
 function give_get_bulgarian_states_list() {
1559 1559
 	$states = array(
1560 1560
 		''      => '',
1561
-		'BG-01' => __( 'Blagoevgrad', 'give' ),
1562
-		'BG-02' => __( 'Burgas', 'give' ),
1563
-		'BG-08' => __( 'Dobrich', 'give' ),
1564
-		'BG-07' => __( 'Gabrovo', 'give' ),
1565
-		'BG-26' => __( 'Haskovo', 'give' ),
1566
-		'BG-09' => __( 'Kardzhali', 'give' ),
1567
-		'BG-10' => __( 'Kyustendil', 'give' ),
1568
-		'BG-11' => __( 'Lovech', 'give' ),
1569
-		'BG-12' => __( 'Montana', 'give' ),
1570
-		'BG-13' => __( 'Pazardzhik', 'give' ),
1571
-		'BG-14' => __( 'Pernik', 'give' ),
1572
-		'BG-15' => __( 'Pleven', 'give' ),
1573
-		'BG-16' => __( 'Plovdiv', 'give' ),
1574
-		'BG-17' => __( 'Razgrad', 'give' ),
1575
-		'BG-18' => __( 'Ruse', 'give' ),
1576
-		'BG-27' => __( 'Shumen', 'give' ),
1577
-		'BG-19' => __( 'Silistra', 'give' ),
1578
-		'BG-20' => __( 'Sliven', 'give' ),
1579
-		'BG-21' => __( 'Smolyan', 'give' ),
1580
-		'BG-23' => __( 'Sofia', 'give' ),
1581
-		'BG-22' => __( 'Sofia-Grad', 'give' ),
1582
-		'BG-24' => __( 'Stara Zagora', 'give' ),
1583
-		'BG-25' => __( 'Targovishte', 'give' ),
1584
-		'BG-03' => __( 'Varna', 'give' ),
1585
-		'BG-04' => __( 'Veliko Tarnovo', 'give' ),
1586
-		'BG-05' => __( 'Vidin', 'give' ),
1587
-		'BG-06' => __( 'Vratsa', 'give' ),
1588
-		'BG-28' => __( 'Yambol', 'give' ),
1561
+		'BG-01' => __('Blagoevgrad', 'give'),
1562
+		'BG-02' => __('Burgas', 'give'),
1563
+		'BG-08' => __('Dobrich', 'give'),
1564
+		'BG-07' => __('Gabrovo', 'give'),
1565
+		'BG-26' => __('Haskovo', 'give'),
1566
+		'BG-09' => __('Kardzhali', 'give'),
1567
+		'BG-10' => __('Kyustendil', 'give'),
1568
+		'BG-11' => __('Lovech', 'give'),
1569
+		'BG-12' => __('Montana', 'give'),
1570
+		'BG-13' => __('Pazardzhik', 'give'),
1571
+		'BG-14' => __('Pernik', 'give'),
1572
+		'BG-15' => __('Pleven', 'give'),
1573
+		'BG-16' => __('Plovdiv', 'give'),
1574
+		'BG-17' => __('Razgrad', 'give'),
1575
+		'BG-18' => __('Ruse', 'give'),
1576
+		'BG-27' => __('Shumen', 'give'),
1577
+		'BG-19' => __('Silistra', 'give'),
1578
+		'BG-20' => __('Sliven', 'give'),
1579
+		'BG-21' => __('Smolyan', 'give'),
1580
+		'BG-23' => __('Sofia', 'give'),
1581
+		'BG-22' => __('Sofia-Grad', 'give'),
1582
+		'BG-24' => __('Stara Zagora', 'give'),
1583
+		'BG-25' => __('Targovishte', 'give'),
1584
+		'BG-03' => __('Varna', 'give'),
1585
+		'BG-04' => __('Veliko Tarnovo', 'give'),
1586
+		'BG-05' => __('Vidin', 'give'),
1587
+		'BG-06' => __('Vratsa', 'give'),
1588
+		'BG-28' => __('Yambol', 'give'),
1589 1589
 	);
1590 1590
 
1591
-	return apply_filters( 'give_bulgarian_states', $states );
1591
+	return apply_filters('give_bulgarian_states', $states);
1592 1592
 }
1593 1593
 
1594 1594
 /**
@@ -1600,73 +1600,73 @@  discard block
 block discarded – undo
1600 1600
 function give_get_bangladeshi_states_list() {
1601 1601
 	$states = array(
1602 1602
 		''     => '',
1603
-		'BAG'  => __( 'Bagerhat', 'give' ),
1604
-		'BAN'  => __( 'Bandarban', 'give' ),
1605
-		'BAR'  => __( 'Barguna', 'give' ),
1606
-		'BARI' => __( 'Barisal', 'give' ),
1607
-		'BHO'  => __( 'Bhola', 'give' ),
1608
-		'BOG'  => __( 'Bogra', 'give' ),
1609
-		'BRA'  => __( 'Brahmanbaria', 'give' ),
1610
-		'CHA'  => __( 'Chandpur', 'give' ),
1611
-		'CHI'  => __( 'Chittagong', 'give' ),
1612
-		'CHU'  => __( 'Chuadanga', 'give' ),
1613
-		'COM'  => __( 'Comilla', 'give' ),
1614
-		'COX'  => __( "Cox's Bazar", 'give' ),
1615
-		'DHA'  => __( 'Dhaka', 'give' ),
1616
-		'DIN'  => __( 'Dinajpur', 'give' ),
1617
-		'FAR'  => __( 'Faridpur ', 'give' ),
1618
-		'FEN'  => __( 'Feni', 'give' ),
1619
-		'GAI'  => __( 'Gaibandha', 'give' ),
1620
-		'GAZI' => __( 'Gazipur', 'give' ),
1621
-		'GOP'  => __( 'Gopalganj', 'give' ),
1622
-		'HAB'  => __( 'Habiganj', 'give' ),
1623
-		'JAM'  => __( 'Jamalpur', 'give' ),
1624
-		'JES'  => __( 'Jessore', 'give' ),
1625
-		'JHA'  => __( 'Jhalokati', 'give' ),
1626
-		'JHE'  => __( 'Jhenaidah', 'give' ),
1627
-		'JOY'  => __( 'Joypurhat', 'give' ),
1628
-		'KHA'  => __( 'Khagrachhari', 'give' ),
1629
-		'KHU'  => __( 'Khulna', 'give' ),
1630
-		'KIS'  => __( 'Kishoreganj', 'give' ),
1631
-		'KUR'  => __( 'Kurigram', 'give' ),
1632
-		'KUS'  => __( 'Kushtia', 'give' ),
1633
-		'LAK'  => __( 'Lakshmipur', 'give' ),
1634
-		'LAL'  => __( 'Lalmonirhat', 'give' ),
1635
-		'MAD'  => __( 'Madaripur', 'give' ),
1636
-		'MAG'  => __( 'Magura', 'give' ),
1637
-		'MAN'  => __( 'Manikganj ', 'give' ),
1638
-		'MEH'  => __( 'Meherpur', 'give' ),
1639
-		'MOU'  => __( 'Moulvibazar', 'give' ),
1640
-		'MUN'  => __( 'Munshiganj', 'give' ),
1641
-		'MYM'  => __( 'Mymensingh', 'give' ),
1642
-		'NAO'  => __( 'Naogaon', 'give' ),
1643
-		'NAR'  => __( 'Narail', 'give' ),
1644
-		'NARG' => __( 'Narayanganj', 'give' ),
1645
-		'NARD' => __( 'Narsingdi', 'give' ),
1646
-		'NAT'  => __( 'Natore', 'give' ),
1647
-		'NAW'  => __( 'Nawabganj', 'give' ),
1648
-		'NET'  => __( 'Netrakona', 'give' ),
1649
-		'NIL'  => __( 'Nilphamari', 'give' ),
1650
-		'NOA'  => __( 'Noakhali', 'give' ),
1651
-		'PAB'  => __( 'Pabna', 'give' ),
1652
-		'PAN'  => __( 'Panchagarh', 'give' ),
1653
-		'PAT'  => __( 'Patuakhali', 'give' ),
1654
-		'PIR'  => __( 'Pirojpur', 'give' ),
1655
-		'RAJB' => __( 'Rajbari', 'give' ),
1656
-		'RAJ'  => __( 'Rajshahi', 'give' ),
1657
-		'RAN'  => __( 'Rangamati', 'give' ),
1658
-		'RANP' => __( 'Rangpur', 'give' ),
1659
-		'SAT'  => __( 'Satkhira', 'give' ),
1660
-		'SHA'  => __( 'Shariatpur', 'give' ),
1661
-		'SHE'  => __( 'Sherpur', 'give' ),
1662
-		'SIR'  => __( 'Sirajganj', 'give' ),
1663
-		'SUN'  => __( 'Sunamganj', 'give' ),
1664
-		'SYL'  => __( 'Sylhet', 'give' ),
1665
-		'TAN'  => __( 'Tangail', 'give' ),
1666
-		'THA'  => __( 'Thakurgaon', 'give' ),
1603
+		'BAG'  => __('Bagerhat', 'give'),
1604
+		'BAN'  => __('Bandarban', 'give'),
1605
+		'BAR'  => __('Barguna', 'give'),
1606
+		'BARI' => __('Barisal', 'give'),
1607
+		'BHO'  => __('Bhola', 'give'),
1608
+		'BOG'  => __('Bogra', 'give'),
1609
+		'BRA'  => __('Brahmanbaria', 'give'),
1610
+		'CHA'  => __('Chandpur', 'give'),
1611
+		'CHI'  => __('Chittagong', 'give'),
1612
+		'CHU'  => __('Chuadanga', 'give'),
1613
+		'COM'  => __('Comilla', 'give'),
1614
+		'COX'  => __("Cox's Bazar", 'give'),
1615
+		'DHA'  => __('Dhaka', 'give'),
1616
+		'DIN'  => __('Dinajpur', 'give'),
1617
+		'FAR'  => __('Faridpur ', 'give'),
1618
+		'FEN'  => __('Feni', 'give'),
1619
+		'GAI'  => __('Gaibandha', 'give'),
1620
+		'GAZI' => __('Gazipur', 'give'),
1621
+		'GOP'  => __('Gopalganj', 'give'),
1622
+		'HAB'  => __('Habiganj', 'give'),
1623
+		'JAM'  => __('Jamalpur', 'give'),
1624
+		'JES'  => __('Jessore', 'give'),
1625
+		'JHA'  => __('Jhalokati', 'give'),
1626
+		'JHE'  => __('Jhenaidah', 'give'),
1627
+		'JOY'  => __('Joypurhat', 'give'),
1628
+		'KHA'  => __('Khagrachhari', 'give'),
1629
+		'KHU'  => __('Khulna', 'give'),
1630
+		'KIS'  => __('Kishoreganj', 'give'),
1631
+		'KUR'  => __('Kurigram', 'give'),
1632
+		'KUS'  => __('Kushtia', 'give'),
1633
+		'LAK'  => __('Lakshmipur', 'give'),
1634
+		'LAL'  => __('Lalmonirhat', 'give'),
1635
+		'MAD'  => __('Madaripur', 'give'),
1636
+		'MAG'  => __('Magura', 'give'),
1637
+		'MAN'  => __('Manikganj ', 'give'),
1638
+		'MEH'  => __('Meherpur', 'give'),
1639
+		'MOU'  => __('Moulvibazar', 'give'),
1640
+		'MUN'  => __('Munshiganj', 'give'),
1641
+		'MYM'  => __('Mymensingh', 'give'),
1642
+		'NAO'  => __('Naogaon', 'give'),
1643
+		'NAR'  => __('Narail', 'give'),
1644
+		'NARG' => __('Narayanganj', 'give'),
1645
+		'NARD' => __('Narsingdi', 'give'),
1646
+		'NAT'  => __('Natore', 'give'),
1647
+		'NAW'  => __('Nawabganj', 'give'),
1648
+		'NET'  => __('Netrakona', 'give'),
1649
+		'NIL'  => __('Nilphamari', 'give'),
1650
+		'NOA'  => __('Noakhali', 'give'),
1651
+		'PAB'  => __('Pabna', 'give'),
1652
+		'PAN'  => __('Panchagarh', 'give'),
1653
+		'PAT'  => __('Patuakhali', 'give'),
1654
+		'PIR'  => __('Pirojpur', 'give'),
1655
+		'RAJB' => __('Rajbari', 'give'),
1656
+		'RAJ'  => __('Rajshahi', 'give'),
1657
+		'RAN'  => __('Rangamati', 'give'),
1658
+		'RANP' => __('Rangpur', 'give'),
1659
+		'SAT'  => __('Satkhira', 'give'),
1660
+		'SHA'  => __('Shariatpur', 'give'),
1661
+		'SHE'  => __('Sherpur', 'give'),
1662
+		'SIR'  => __('Sirajganj', 'give'),
1663
+		'SUN'  => __('Sunamganj', 'give'),
1664
+		'SYL'  => __('Sylhet', 'give'),
1665
+		'TAN'  => __('Tangail', 'give'),
1666
+		'THA'  => __('Thakurgaon', 'give'),
1667 1667
 	);
1668 1668
 
1669
-	return apply_filters( 'give_bangladeshi_states', $states );
1669
+	return apply_filters('give_bangladeshi_states', $states);
1670 1670
 }
1671 1671
 
1672 1672
 /**
@@ -1678,33 +1678,33 @@  discard block
 block discarded – undo
1678 1678
 function give_get_argentina_states_list() {
1679 1679
 	$states = array(
1680 1680
 		''  => '',
1681
-		'C' => __( 'Ciudad Aut&oacute;noma de Buenos Aires', 'give' ),
1682
-		'B' => __( 'Buenos Aires', 'give' ),
1683
-		'K' => __( 'Catamarca', 'give' ),
1684
-		'H' => __( 'Chaco', 'give' ),
1685
-		'U' => __( 'Chubut', 'give' ),
1686
-		'X' => __( 'C&oacute;rdoba', 'give' ),
1687
-		'W' => __( 'Corrientes', 'give' ),
1688
-		'E' => __( 'Entre R&iacute;os', 'give' ),
1689
-		'P' => __( 'Formosa', 'give' ),
1690
-		'Y' => __( 'Jujuy', 'give' ),
1691
-		'L' => __( 'La Pampa', 'give' ),
1692
-		'F' => __( 'La Rioja', 'give' ),
1693
-		'M' => __( 'Mendoza', 'give' ),
1694
-		'N' => __( 'Misiones', 'give' ),
1695
-		'Q' => __( 'Neuqu&eacute;n', 'give' ),
1696
-		'R' => __( 'R&iacute;o Negro', 'give' ),
1697
-		'A' => __( 'Salta', 'give' ),
1698
-		'J' => __( 'San Juan', 'give' ),
1699
-		'D' => __( 'San Luis', 'give' ),
1700
-		'Z' => __( 'Santa Cruz', 'give' ),
1701
-		'S' => __( 'Santa Fe', 'give' ),
1702
-		'G' => __( 'Santiago del Estero', 'give' ),
1703
-		'V' => __( 'Tierra del Fuego', 'give' ),
1704
-		'T' => __( 'Tucum&aacute;n', 'give' ),
1681
+		'C' => __('Ciudad Aut&oacute;noma de Buenos Aires', 'give'),
1682
+		'B' => __('Buenos Aires', 'give'),
1683
+		'K' => __('Catamarca', 'give'),
1684
+		'H' => __('Chaco', 'give'),
1685
+		'U' => __('Chubut', 'give'),
1686
+		'X' => __('C&oacute;rdoba', 'give'),
1687
+		'W' => __('Corrientes', 'give'),
1688
+		'E' => __('Entre R&iacute;os', 'give'),
1689
+		'P' => __('Formosa', 'give'),
1690
+		'Y' => __('Jujuy', 'give'),
1691
+		'L' => __('La Pampa', 'give'),
1692
+		'F' => __('La Rioja', 'give'),
1693
+		'M' => __('Mendoza', 'give'),
1694
+		'N' => __('Misiones', 'give'),
1695
+		'Q' => __('Neuqu&eacute;n', 'give'),
1696
+		'R' => __('R&iacute;o Negro', 'give'),
1697
+		'A' => __('Salta', 'give'),
1698
+		'J' => __('San Juan', 'give'),
1699
+		'D' => __('San Luis', 'give'),
1700
+		'Z' => __('Santa Cruz', 'give'),
1701
+		'S' => __('Santa Fe', 'give'),
1702
+		'G' => __('Santiago del Estero', 'give'),
1703
+		'V' => __('Tierra del Fuego', 'give'),
1704
+		'T' => __('Tucum&aacute;n', 'give'),
1705 1705
 	);
1706 1706
 
1707
-	return apply_filters( 'give_argentina_states', $states );
1707
+	return apply_filters('give_argentina_states', $states);
1708 1708
 }
1709 1709
 
1710 1710
 /**
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
 		'AP' => 'Armed Forces - Pacific',
1786 1786
 	);
1787 1787
 
1788
-	return apply_filters( 'give_us_states', $states );
1788
+	return apply_filters('give_us_states', $states);
1789 1789
 }
1790 1790
 
1791 1791
 /**
@@ -1798,22 +1798,22 @@  discard block
 block discarded – undo
1798 1798
 function give_get_provinces_list() {
1799 1799
 	$provinces = array(
1800 1800
 		''   => '',
1801
-		'AB' => esc_html__( 'Alberta', 'give' ),
1802
-		'BC' => esc_html__( 'British Columbia', 'give' ),
1803
-		'MB' => esc_html__( 'Manitoba', 'give' ),
1804
-		'NB' => esc_html__( 'New Brunswick', 'give' ),
1805
-		'NL' => esc_html__( 'Newfoundland and Labrador', 'give' ),
1806
-		'NS' => esc_html__( 'Nova Scotia', 'give' ),
1807
-		'NT' => esc_html__( 'Northwest Territories', 'give' ),
1808
-		'NU' => esc_html__( 'Nunavut', 'give' ),
1809
-		'ON' => esc_html__( 'Ontario', 'give' ),
1810
-		'PE' => esc_html__( 'Prince Edward Island', 'give' ),
1811
-		'QC' => esc_html__( 'Quebec', 'give' ),
1812
-		'SK' => esc_html__( 'Saskatchewan', 'give' ),
1813
-		'YT' => esc_html__( 'Yukon', 'give' ),
1801
+		'AB' => esc_html__('Alberta', 'give'),
1802
+		'BC' => esc_html__('British Columbia', 'give'),
1803
+		'MB' => esc_html__('Manitoba', 'give'),
1804
+		'NB' => esc_html__('New Brunswick', 'give'),
1805
+		'NL' => esc_html__('Newfoundland and Labrador', 'give'),
1806
+		'NS' => esc_html__('Nova Scotia', 'give'),
1807
+		'NT' => esc_html__('Northwest Territories', 'give'),
1808
+		'NU' => esc_html__('Nunavut', 'give'),
1809
+		'ON' => esc_html__('Ontario', 'give'),
1810
+		'PE' => esc_html__('Prince Edward Island', 'give'),
1811
+		'QC' => esc_html__('Quebec', 'give'),
1812
+		'SK' => esc_html__('Saskatchewan', 'give'),
1813
+		'YT' => esc_html__('Yukon', 'give'),
1814 1814
 	);
1815 1815
 
1816
-	return apply_filters( 'give_canada_provinces', $provinces );
1816
+	return apply_filters('give_canada_provinces', $provinces);
1817 1817
 }
1818 1818
 
1819 1819
 /**
@@ -1835,7 +1835,7 @@  discard block
 block discarded – undo
1835 1835
 		'WA'  => 'Western Australia',
1836 1836
 	);
1837 1837
 
1838
-	return apply_filters( 'give_australian_states', $states );
1838
+	return apply_filters('give_australian_states', $states);
1839 1839
 }
1840 1840
 
1841 1841
 /**
@@ -1876,7 +1876,7 @@  discard block
 block discarded – undo
1876 1876
 		'TO' => 'Tocantins',
1877 1877
 	);
1878 1878
 
1879
-	return apply_filters( 'give_brazil_states', $states );
1879
+	return apply_filters('give_brazil_states', $states);
1880 1880
 }
1881 1881
 
1882 1882
 /**
@@ -1893,7 +1893,7 @@  discard block
 block discarded – undo
1893 1893
 		'NEW TERRITORIES' => 'New Territories',
1894 1894
 	);
1895 1895
 
1896
-	return apply_filters( 'give_hong_kong_states', $states );
1896
+	return apply_filters('give_hong_kong_states', $states);
1897 1897
 }
1898 1898
 
1899 1899
 /**
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
 		'ZA' => 'Zala',
1928 1928
 	);
1929 1929
 
1930
-	return apply_filters( 'give_hungary_states', $states );
1930
+	return apply_filters('give_hungary_states', $states);
1931 1931
 }
1932 1932
 
1933 1933
 /**
@@ -1973,7 +1973,7 @@  discard block
 block discarded – undo
1973 1973
 		'CN32' => 'Xinjiang / &#26032;&#30086;',
1974 1974
 	);
1975 1975
 
1976
-	return apply_filters( 'give_chinese_states', $states );
1976
+	return apply_filters('give_chinese_states', $states);
1977 1977
 }
1978 1978
 
1979 1979
 /**
@@ -2002,7 +2002,7 @@  discard block
 block discarded – undo
2002 2002
 		'WC' => 'West Coast',
2003 2003
 	);
2004 2004
 
2005
-	return apply_filters( 'give_new_zealand_states', $states );
2005
+	return apply_filters('give_new_zealand_states', $states);
2006 2006
 }
2007 2007
 
2008 2008
 /**
@@ -2050,7 +2050,7 @@  discard block
 block discarded – undo
2050 2050
 		'PB' => 'Papua Barat',
2051 2051
 	);
2052 2052
 
2053
-	return apply_filters( 'give_indonesia_states', $states );
2053
+	return apply_filters('give_indonesia_states', $states);
2054 2054
 }
2055 2055
 
2056 2056
 /**
@@ -2100,7 +2100,7 @@  discard block
 block discarded – undo
2100 2100
 		'PY' => 'Pondicherry (Puducherry)',
2101 2101
 	);
2102 2102
 
2103
-	return apply_filters( 'give_indian_states', $states );
2103
+	return apply_filters('give_indian_states', $states);
2104 2104
 }
2105 2105
 
2106 2106
 /**
@@ -2130,7 +2130,7 @@  discard block
 block discarded – undo
2130 2130
 		'PJY' => 'W.P. Putrajaya',
2131 2131
 	);
2132 2132
 
2133
-	return apply_filters( 'give_malaysian_states', $states );
2133
+	return apply_filters('give_malaysian_states', $states);
2134 2134
 }
2135 2135
 
2136 2136
 /**
@@ -2153,7 +2153,7 @@  discard block
 block discarded – undo
2153 2153
 		'WC'  => 'Western Cape',
2154 2154
 	);
2155 2155
 
2156
-	return apply_filters( 'give_south_african_states', $states );
2156
+	return apply_filters('give_south_african_states', $states);
2157 2157
 }
2158 2158
 
2159 2159
 /**
@@ -2244,7 +2244,7 @@  discard block
 block discarded – undo
2244 2244
 		'TH-35' => 'Yasothon (&#3618;&#3650;&#3626;&#3608;&#3619;)',
2245 2245
 	);
2246 2246
 
2247
-	return apply_filters( 'give_thailand_states', $states );
2247
+	return apply_filters('give_thailand_states', $states);
2248 2248
 }
2249 2249
 
2250 2250
 /**
@@ -2256,59 +2256,59 @@  discard block
 block discarded – undo
2256 2256
 function give_get_spain_states_list() {
2257 2257
 	$states = array(
2258 2258
 		''   => '',
2259
-		'C'  => esc_html__( 'A Coru&ntilde;a', 'give' ),
2260
-		'VI' => esc_html__( 'Álava', 'give' ),
2261
-		'AB' => esc_html__( 'Albacete', 'give' ),
2262
-		'A'  => esc_html__( 'Alicante', 'give' ),
2263
-		'AL' => esc_html__( 'Almer&iacute;a', 'give' ),
2264
-		'O'  => esc_html__( 'Asturias', 'give' ),
2265
-		'AV' => esc_html__( '&Aacute;vila', 'give' ),
2266
-		'BA' => esc_html__( 'Badajoz', 'give' ),
2267
-		'PM' => esc_html__( 'Baleares', 'give' ),
2268
-		'B'  => esc_html__( 'Barcelona', 'give' ),
2269
-		'BU' => esc_html__( 'Burgos', 'give' ),
2270
-		'CC' => esc_html__( 'C&aacute;ceres', 'give' ),
2271
-		'CA' => esc_html__( 'C&aacute;diz', 'give' ),
2272
-		'S'  => esc_html__( 'Cantabria', 'give' ),
2273
-		'CS' => esc_html__( 'Castell&oacute;n', 'give' ),
2274
-		'CE' => esc_html__( 'Ceuta', 'give' ),
2275
-		'CR' => esc_html__( 'Ciudad Real', 'give' ),
2276
-		'CO' => esc_html__( 'C&oacute;rdoba', 'give' ),
2277
-		'CU' => esc_html__( 'Cuenca', 'give' ),
2278
-		'GI' => esc_html__( 'Girona', 'give' ),
2279
-		'GR' => esc_html__( 'Granada', 'give' ),
2280
-		'GU' => esc_html__( 'Guadalajara', 'give' ),
2281
-		'SS' => esc_html__( 'Gipuzkoa', 'give' ),
2282
-		'H'  => esc_html__( 'Huelva', 'give' ),
2283
-		'HU' => esc_html__( 'Huesca', 'give' ),
2284
-		'J'  => esc_html__( 'Ja&eacute;n', 'give' ),
2285
-		'LO' => esc_html__( 'La Rioja', 'give' ),
2286
-		'GC' => esc_html__( 'Las Palmas', 'give' ),
2287
-		'LE' => esc_html__( 'Le&oacute;n', 'give' ),
2288
-		'L'  => esc_html__( 'Lleida', 'give' ),
2289
-		'LU' => esc_html__( 'Lugo', 'give' ),
2290
-		'M'  => esc_html__( 'Madrid', 'give' ),
2291
-		'MA' => esc_html__( 'M&aacute;laga', 'give' ),
2292
-		'ML' => esc_html__( 'Melilla', 'give' ),
2293
-		'MU' => esc_html__( 'Murcia', 'give' ),
2294
-		'NA' => esc_html__( 'Navarra', 'give' ),
2295
-		'OR' => esc_html__( 'Ourense', 'give' ),
2296
-		'P'  => esc_html__( 'Palencia', 'give' ),
2297
-		'PO' => esc_html__( 'Pontevedra', 'give' ),
2298
-		'SA' => esc_html__( 'Salamanca', 'give' ),
2299
-		'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ),
2300
-		'SG' => esc_html__( 'Segovia', 'give' ),
2301
-		'SE' => esc_html__( 'Sevilla', 'give' ),
2302
-		'SO' => esc_html__( 'Soria', 'give' ),
2303
-		'T'  => esc_html__( 'Tarragona', 'give' ),
2304
-		'TE' => esc_html__( 'Teruel', 'give' ),
2305
-		'TO' => esc_html__( 'Toledo', 'give' ),
2306
-		'V'  => esc_html__( 'Valencia', 'give' ),
2307
-		'VA' => esc_html__( 'Valladolid', 'give' ),
2308
-		'BI' => esc_html__( 'Bizkaia', 'give' ),
2309
-		'ZA' => esc_html__( 'Zamora', 'give' ),
2310
-		'Z'  => esc_html__( 'Zaragoza', 'give' ),
2259
+		'C'  => esc_html__('A Coru&ntilde;a', 'give'),
2260
+		'VI' => esc_html__('Álava', 'give'),
2261
+		'AB' => esc_html__('Albacete', 'give'),
2262
+		'A'  => esc_html__('Alicante', 'give'),
2263
+		'AL' => esc_html__('Almer&iacute;a', 'give'),
2264
+		'O'  => esc_html__('Asturias', 'give'),
2265
+		'AV' => esc_html__('&Aacute;vila', 'give'),
2266
+		'BA' => esc_html__('Badajoz', 'give'),
2267
+		'PM' => esc_html__('Baleares', 'give'),
2268
+		'B'  => esc_html__('Barcelona', 'give'),
2269
+		'BU' => esc_html__('Burgos', 'give'),
2270
+		'CC' => esc_html__('C&aacute;ceres', 'give'),
2271
+		'CA' => esc_html__('C&aacute;diz', 'give'),
2272
+		'S'  => esc_html__('Cantabria', 'give'),
2273
+		'CS' => esc_html__('Castell&oacute;n', 'give'),
2274
+		'CE' => esc_html__('Ceuta', 'give'),
2275
+		'CR' => esc_html__('Ciudad Real', 'give'),
2276
+		'CO' => esc_html__('C&oacute;rdoba', 'give'),
2277
+		'CU' => esc_html__('Cuenca', 'give'),
2278
+		'GI' => esc_html__('Girona', 'give'),
2279
+		'GR' => esc_html__('Granada', 'give'),
2280
+		'GU' => esc_html__('Guadalajara', 'give'),
2281
+		'SS' => esc_html__('Gipuzkoa', 'give'),
2282
+		'H'  => esc_html__('Huelva', 'give'),
2283
+		'HU' => esc_html__('Huesca', 'give'),
2284
+		'J'  => esc_html__('Ja&eacute;n', 'give'),
2285
+		'LO' => esc_html__('La Rioja', 'give'),
2286
+		'GC' => esc_html__('Las Palmas', 'give'),
2287
+		'LE' => esc_html__('Le&oacute;n', 'give'),
2288
+		'L'  => esc_html__('Lleida', 'give'),
2289
+		'LU' => esc_html__('Lugo', 'give'),
2290
+		'M'  => esc_html__('Madrid', 'give'),
2291
+		'MA' => esc_html__('M&aacute;laga', 'give'),
2292
+		'ML' => esc_html__('Melilla', 'give'),
2293
+		'MU' => esc_html__('Murcia', 'give'),
2294
+		'NA' => esc_html__('Navarra', 'give'),
2295
+		'OR' => esc_html__('Ourense', 'give'),
2296
+		'P'  => esc_html__('Palencia', 'give'),
2297
+		'PO' => esc_html__('Pontevedra', 'give'),
2298
+		'SA' => esc_html__('Salamanca', 'give'),
2299
+		'TF' => esc_html__('Santa Cruz de Tenerife', 'give'),
2300
+		'SG' => esc_html__('Segovia', 'give'),
2301
+		'SE' => esc_html__('Sevilla', 'give'),
2302
+		'SO' => esc_html__('Soria', 'give'),
2303
+		'T'  => esc_html__('Tarragona', 'give'),
2304
+		'TE' => esc_html__('Teruel', 'give'),
2305
+		'TO' => esc_html__('Toledo', 'give'),
2306
+		'V'  => esc_html__('Valencia', 'give'),
2307
+		'VA' => esc_html__('Valladolid', 'give'),
2308
+		'BI' => esc_html__('Bizkaia', 'give'),
2309
+		'ZA' => esc_html__('Zamora', 'give'),
2310
+		'Z'  => esc_html__('Zaragoza', 'give'),
2311 2311
 	);
2312 2312
 
2313
-	return apply_filters( 'give_spain_states', $states );
2313
+	return apply_filters('give_spain_states', $states);
2314 2314
 }
Please login to merge, or discard this patch.
includes/admin/class-give-settings.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param $url
74 74
 	 *
75
-	 * @return mixed
75
+	 * @return string
76 76
 	 */
77 77
 	public function give_update_cmb_meta_box_url( $url ) {
78 78
 		// Path to Give's CMB
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
  * @since      1.3.5
936 936
  *
937 937
  * @param $array
938
- * @param $position |int|string Expects an array key or 'id' of the settings field to appear after
938
+ * @param string $position |int|string Expects an array key or 'id' of the settings field to appear after
939 939
  * @param $insert   |array a valid array of options to insert
940 940
  *
941 941
  * @return array
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
  * @since 1.0
975 975
  *
976 976
  * @param array $field_arr
977
- * @param array $saved_values
977
+ * @param string|boolean $saved_values
978 978
  *
979 979
  * @return void
980 980
  */
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
  * @since  1.0
1010 1010
  *
1011 1011
  * @param  array $field_arr
1012
- * @param  array $saved_value
1012
+ * @param  string|boolean $saved_value
1013 1013
  *
1014 1014
  * @return void
1015 1015
  */
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
  * @params $string text
1164 1164
  * @params $filter array
1165 1165
  *
1166
- * @return text $string
1166
+ * @return string $string
1167 1167
  */
1168 1168
 function give_slug_to_title( $string, $filters = array() ) {
1169 1169
 
Please login to merge, or discard this patch.
Spacing   +372 added lines, -372 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 	public function __construct() {
44 44
 
45 45
 		// Custom CMB2 Settings Fields
46
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
47
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
48
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
49
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
50
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
51
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
52
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
53
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
46
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
47
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
48
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
49
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
50
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
51
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
52
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
53
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
54 54
 	}
55 55
 
56 56
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * @since  1.0
61 61
 	 */
62 62
 	public function init() {
63
-		register_setting( $this->key, $this->key );
63
+		register_setting($this->key, $this->key);
64 64
 
65 65
 	}
66 66
 
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @return mixed
76 76
 	 */
77
-	public function give_update_cmb_meta_box_url( $url ) {
77
+	public function give_update_cmb_meta_box_url($url) {
78 78
 		// Path to Give's CMB
79
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
79
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
80 80
 	}
81 81
 
82 82
 
@@ -88,27 +88,27 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function give_get_settings_tabs() {
90 90
 
91
-		$settings = $this->give_settings( null );
91
+		$settings = $this->give_settings(null);
92 92
 
93 93
 		$tabs             = array();
94
-		$tabs['general']  = __( 'General', 'give' );
95
-		$tabs['gateways'] = __( 'Payment Gateways', 'give' );
96
-		$tabs['display']  = __( 'Display Options', 'give' );
97
-		$tabs['emails']   = __( 'Emails', 'give' );
94
+		$tabs['general']  = __('General', 'give');
95
+		$tabs['gateways'] = __('Payment Gateways', 'give');
96
+		$tabs['display']  = __('Display Options', 'give');
97
+		$tabs['emails']   = __('Emails', 'give');
98 98
 
99
-		if ( ! empty( $settings['addons']['fields'] ) ) {
100
-			$tabs['addons'] = __( 'Add-ons', 'give' );
99
+		if ( ! empty($settings['addons']['fields'])) {
100
+			$tabs['addons'] = __('Add-ons', 'give');
101 101
 		}
102 102
 
103
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
104
-			$tabs['licenses'] = __( 'Licenses', 'give' );
103
+		if ( ! empty($settings['licenses']['fields'])) {
104
+			$tabs['licenses'] = __('Licenses', 'give');
105 105
 		}
106 106
 
107
-		$tabs['advanced']    = __( 'Advanced', 'give' );
108
-		$tabs['api']         = __( 'API', 'give' );
109
-		$tabs['system_info'] = __( 'System Info', 'give' );
107
+		$tabs['advanced']    = __('Advanced', 'give');
108
+		$tabs['api']         = __('API', 'give');
109
+		$tabs['system_info'] = __('System Info', 'give');
110 110
 
111
-		return apply_filters( 'give_settings_tabs', $tabs );
111
+		return apply_filters('give_settings_tabs', $tabs);
112 112
 	}
113 113
 
114 114
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function admin_page_display() {
121 121
 
122
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
122
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
123 123
 
124 124
 		?>
125 125
 
@@ -129,22 +129,22 @@  discard block
 block discarded – undo
129 129
 
130 130
 			<h2 class="nav-tab-wrapper">
131 131
 				<?php
132
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
132
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
133 133
 
134
-					$tab_url = esc_url( add_query_arg( array(
134
+					$tab_url = esc_url(add_query_arg(array(
135 135
 						'settings-updated' => false,
136 136
 						'tab'              => $tab_id,
137
-					) ) );
137
+					)));
138 138
 
139 139
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
140 140
 
141
-					echo '<a href="' . esc_url( $tab_url ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>';
141
+					echo '<a href="'.esc_url($tab_url).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>';
142 142
 
143 143
 				}
144 144
 				?>
145 145
 			</h2>
146 146
 
147
-			<?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?>
147
+			<?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?>
148 148
 
149 149
 		</div><!-- .wrap -->
150 150
 
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
 	 *
167 167
 	 * @return string
168 168
 	 */
169
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
169
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
170 170
 
171 171
 		// only modify the give settings form
172
-		if ( 'give_settings' == $object_id ) {
172
+		if ('give_settings' == $object_id) {
173 173
 
174
-			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . esc_attr__( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
174
+			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.esc_attr__('Save Settings', 'give').'" class="button-primary"></div></form>';
175 175
 
176 176
 		}
177 177
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 *
189 189
 	 * @return array
190 190
 	 */
191
-	public function give_settings( $active_tab ) {
191
+	public function give_settings($active_tab) {
192 192
 
193 193
 		$give_settings = array(
194 194
 			/**
@@ -196,99 +196,99 @@  discard block
 block discarded – undo
196 196
 			 */
197 197
 			'general'     => array(
198 198
 				'id'         => 'general_settings',
199
-				'give_title' => __( 'General Settings', 'give' ),
200
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
201
-				'fields'     => apply_filters( 'give_settings_general', array(
199
+				'give_title' => __('General Settings', 'give'),
200
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
201
+				'fields'     => apply_filters('give_settings_general', array(
202 202
 						array(
203
-							'name' => __( 'General Settings', 'give' ),
203
+							'name' => __('General Settings', 'give'),
204 204
 							'desc' => '',
205 205
 							'type' => 'give_title',
206 206
 							'id'   => 'give_title_general_settings_1',
207 207
 						),
208 208
 						array(
209
-							'name'    => __( 'Success Page', 'give' ),
209
+							'name'    => __('Success Page', 'give'),
210 210
 							/* translators: %s: [give_receipt] */
211
-							'desc'    => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
211
+							'desc'    => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
212 212
 							'id'      => 'success_page',
213 213
 							'type'    => 'select',
214
-							'options' => give_cmb2_get_post_options( array(
214
+							'options' => give_cmb2_get_post_options(array(
215 215
 								'post_type'   => 'page',
216 216
 								'numberposts' => 999,
217
-							) ),
217
+							)),
218 218
 						),
219 219
 						array(
220
-							'name'    => __( 'Failed Donation Page', 'give' ),
221
-							'desc'    => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
220
+							'name'    => __('Failed Donation Page', 'give'),
221
+							'desc'    => __('The page donors are sent to if their donation is cancelled or fails.', 'give'),
222 222
 							'id'      => 'failure_page',
223 223
 							'type'    => 'select',
224
-							'options' => give_cmb2_get_post_options( array(
224
+							'options' => give_cmb2_get_post_options(array(
225 225
 								'post_type'   => 'page',
226 226
 								'numberposts' => 999,
227
-							) ),
227
+							)),
228 228
 						),
229 229
 						array(
230
-							'name'    => __( 'Donation History Page', 'give' ),
230
+							'name'    => __('Donation History Page', 'give'),
231 231
 							/* translators: %s: [donation_history] */
232
-							'desc'    => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
232
+							'desc'    => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
233 233
 							'id'      => 'history_page',
234 234
 							'type'    => 'select',
235
-							'options' => give_cmb2_get_post_options( array(
235
+							'options' => give_cmb2_get_post_options(array(
236 236
 								'post_type'   => 'page',
237 237
 								'numberposts' => 999,
238
-							) ),
238
+							)),
239 239
 						),
240 240
 						array(
241
-							'name'    => __( 'Base Country', 'give' ),
242
-							'desc'    => __( 'The country your site operates from.', 'give' ),
241
+							'name'    => __('Base Country', 'give'),
242
+							'desc'    => __('The country your site operates from.', 'give'),
243 243
 							'id'      => 'base_country',
244 244
 							'type'    => 'select',
245 245
 							'options' => give_get_country_list(),
246 246
 						),
247 247
 						array(
248
-							'name' => __( 'Currency Settings', 'give' ),
248
+							'name' => __('Currency Settings', 'give'),
249 249
 							'desc' => '',
250 250
 							'type' => 'give_title',
251 251
 							'id'   => 'give_title_general_settings_2',
252 252
 						),
253 253
 						array(
254
-							'name'    => __( 'Currency', 'give' ),
255
-							'desc'    => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
254
+							'name'    => __('Currency', 'give'),
255
+							'desc'    => __('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
256 256
 							'id'      => 'currency',
257 257
 							'type'    => 'select',
258 258
 							'options' => give_get_currencies(),
259 259
 							'default' => 'USD',
260 260
 						),
261 261
 						array(
262
-							'name'    => __( 'Currency Position', 'give' ),
263
-							'desc'    => __( 'The position of the currency symbol.', 'give' ),
262
+							'name'    => __('Currency Position', 'give'),
263
+							'desc'    => __('The position of the currency symbol.', 'give'),
264 264
 							'id'      => 'currency_position',
265 265
 							'type'    => 'select',
266 266
 							'options' => array(
267 267
 								/* translators: %s: currency symbol */
268
-								'before' => sprintf( __( 'Before - %s&#x200e;10', 'give' ), give_currency_symbol( give_get_currency() ) ),
268
+								'before' => sprintf(__('Before - %s&#x200e;10', 'give'), give_currency_symbol(give_get_currency())),
269 269
 								/* translators: %s: currency symbol */
270
-								'after'  => sprintf( __( 'After - 10%s&#x200f;', 'give' ), give_currency_symbol( give_get_currency() ) ),
270
+								'after'  => sprintf(__('After - 10%s&#x200f;', 'give'), give_currency_symbol(give_get_currency())),
271 271
 							),
272 272
 							'default' => 'before',
273 273
 						),
274 274
 						array(
275
-							'name'            => __( 'Thousands Separator', 'give' ),
276
-							'desc'            => __( 'The symbol (usually , or .) to separate thousands.', 'give' ),
275
+							'name'            => __('Thousands Separator', 'give'),
276
+							'desc'            => __('The symbol (usually , or .) to separate thousands.', 'give'),
277 277
 							'id'              => 'thousands_separator',
278 278
 							'type'            => 'text_small',
279 279
 							'sanitization_cb' => 'give_sanitize_thousand_separator',
280 280
 							'default'         => ',',
281 281
 						),
282 282
 						array(
283
-							'name'    => __( 'Decimal Separator', 'give' ),
284
-							'desc'    => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
283
+							'name'    => __('Decimal Separator', 'give'),
284
+							'desc'    => __('The symbol (usually , or .) to separate decimal points.', 'give'),
285 285
 							'id'      => 'decimal_separator',
286 286
 							'type'    => 'text_small',
287 287
 							'default' => '.',
288 288
 						),
289 289
 						array(
290
-							'name'            => __( 'Number of Decimals', 'give' ),
291
-							'desc'            => __( 'The number of decimal points displayed in amounts.', 'give' ),
290
+							'name'            => __('Number of Decimals', 'give'),
291
+							'desc'            => __('The number of decimal points displayed in amounts.', 'give'),
292 292
 							'id'              => 'number_decimals',
293 293
 							'type'            => 'text_small',
294 294
 							'default'         => 2,
@@ -302,83 +302,83 @@  discard block
 block discarded – undo
302 302
 			 */
303 303
 			'gateways'    => array(
304 304
 				'id'         => 'payment_gateways',
305
-				'give_title' => __( 'Payment Gateways', 'give' ),
306
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
307
-				'fields'     => apply_filters( 'give_settings_gateways', array(
305
+				'give_title' => __('Payment Gateways', 'give'),
306
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
307
+				'fields'     => apply_filters('give_settings_gateways', array(
308 308
 						array(
309
-							'name' => __( 'Gateways Settings', 'give' ),
309
+							'name' => __('Gateways Settings', 'give'),
310 310
 							'desc' => '',
311 311
 							'id'   => 'give_title_gateway_settings_1',
312 312
 							'type' => 'give_title',
313 313
 						),
314 314
 						array(
315
-							'name' => __( 'Test Mode', 'give' ),
316
-							'desc' => __( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
315
+							'name' => __('Test Mode', 'give'),
316
+							'desc' => __('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
317 317
 							'id'   => 'test_mode',
318 318
 							'type' => 'checkbox',
319 319
 						),
320 320
 						array(
321
-							'name' => __( 'Enabled Gateways', 'give' ),
322
-							'desc' => __( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
321
+							'name' => __('Enabled Gateways', 'give'),
322
+							'desc' => __('Enable your payment gateway. Can be ordered by dragging.', 'give'),
323 323
 							'id'   => 'gateways',
324 324
 							'type' => 'enabled_gateways',
325 325
 						),
326 326
 						array(
327
-							'name' => __( 'Default Gateway', 'give' ),
328
-							'desc' => __( 'The gateway that will be selected by default.', 'give' ),
327
+							'name' => __('Default Gateway', 'give'),
328
+							'desc' => __('The gateway that will be selected by default.', 'give'),
329 329
 							'id'   => 'default_gateway',
330 330
 							'type' => 'default_gateway',
331 331
 						),
332 332
 						array(
333
-							'name' => __( 'PayPal Standard', 'give' ),
333
+							'name' => __('PayPal Standard', 'give'),
334 334
 							'desc' => '',
335 335
 							'type' => 'give_title',
336 336
 							'id'   => 'give_title_gateway_settings_2',
337 337
 						),
338 338
 						array(
339
-							'name' => __( 'PayPal Email', 'give' ),
340
-							'desc' => __( 'Enter your PayPal account\'s email.', 'give' ),
339
+							'name' => __('PayPal Email', 'give'),
340
+							'desc' => __('Enter your PayPal account\'s email.', 'give'),
341 341
 							'id'   => 'paypal_email',
342 342
 							'type' => 'text_email',
343 343
 						),
344 344
 						array(
345
-							'name' => __( 'PayPal Page Style', 'give' ),
346
-							'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
345
+							'name' => __('PayPal Page Style', 'give'),
346
+							'desc' => __('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
347 347
 							'id'   => 'paypal_page_style',
348 348
 							'type' => 'text',
349 349
 						),
350 350
 						array(
351
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
352
-							'desc'    => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
351
+							'name'    => __('PayPal Transaction Type', 'give'),
352
+							'desc'    => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
353 353
 							'id'      => 'paypal_button_type',
354 354
 							'type'    => 'radio_inline',
355 355
 							'options' => array(
356
-								'donation' => __( 'Donation', 'give' ),
357
-								'standard' => __( 'Standard Transaction', 'give' ),
356
+								'donation' => __('Donation', 'give'),
357
+								'standard' => __('Standard Transaction', 'give'),
358 358
 							),
359 359
 							'default' => 'donation',
360 360
 						),
361 361
 						array(
362
-							'name' => __( 'Disable PayPal IPN Verification', 'give' ),
363
-							'desc' => __( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
362
+							'name' => __('Disable PayPal IPN Verification', 'give'),
363
+							'desc' => __('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
364 364
 							'id'   => 'disable_paypal_verification',
365 365
 							'type' => 'checkbox',
366 366
 						),
367 367
 						array(
368
-							'name' => __( 'Offline Donations', 'give' ),
368
+							'name' => __('Offline Donations', 'give'),
369 369
 							'desc' => '',
370 370
 							'type' => 'give_title',
371 371
 							'id'   => 'give_title_gateway_settings_3',
372 372
 						),
373 373
 						array(
374
-							'name' => __( 'Collect Billing Details', 'give' ),
375
-							'desc' => __( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
374
+							'name' => __('Collect Billing Details', 'give'),
375
+							'desc' => __('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
376 376
 							'id'   => 'give_offline_donation_enable_billing_fields',
377 377
 							'type' => 'checkbox',
378 378
 						),
379 379
 						array(
380
-							'name'    => __( 'Offline Donation Instructions', 'give' ),
381
-							'desc'    => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
380
+							'name'    => __('Offline Donation Instructions', 'give'),
381
+							'desc'    => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
382 382
 							'id'      => 'global_offline_donation_content',
383 383
 							'default' => give_get_default_offline_donation_content(),
384 384
 							'type'    => 'wysiwyg',
@@ -387,15 +387,15 @@  discard block
 block discarded – undo
387 387
 							),
388 388
 						),
389 389
 						array(
390
-							'name'    => __( 'Offline Donation Email Instructions Subject', 'give' ),
391
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
390
+							'name'    => __('Offline Donation Email Instructions Subject', 'give'),
391
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
392 392
 							'id'      => 'offline_donation_subject',
393
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
393
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
394 394
 							'type'    => 'text',
395 395
 						),
396 396
 						array(
397
-							'name'    => __( 'Offline Donation Email Instructions', 'give' ),
398
-							'desc'    => __( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
397
+							'name'    => __('Offline Donation Email Instructions', 'give'),
398
+							'desc'    => __('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
399 399
 							'id'      => 'global_offline_donation_email',
400 400
 							'default' => give_get_default_offline_donation_email_content(),
401 401
 							'type'    => 'wysiwyg',
@@ -409,104 +409,104 @@  discard block
 block discarded – undo
409 409
 			/** Display Settings */
410 410
 			'display'     => array(
411 411
 				'id'         => 'display_settings',
412
-				'give_title' => __( 'Display Settings', 'give' ),
413
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
414
-				'fields'     => apply_filters( 'give_settings_display', array(
412
+				'give_title' => __('Display Settings', 'give'),
413
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
414
+				'fields'     => apply_filters('give_settings_display', array(
415 415
 						array(
416
-							'name' => __( 'Display Settings', 'give' ),
416
+							'name' => __('Display Settings', 'give'),
417 417
 							'desc' => '',
418 418
 							'id'   => 'give_title_display_settings_1',
419 419
 							'type' => 'give_title',
420 420
 						),
421 421
 						array(
422
-							'name' => __( 'Disable CSS', 'give' ),
423
-							'desc' => __( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
422
+							'name' => __('Disable CSS', 'give'),
423
+							'desc' => __('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
424 424
 							'id'   => 'disable_css',
425 425
 							'type' => 'checkbox',
426 426
 						),
427 427
 						array(
428
-							'name' => __( 'Enable Floating Labels', 'give' ),
428
+							'name' => __('Enable Floating Labels', 'give'),
429 429
 							/* translators: %s: http://docs.givewp.com/form-floating-labels */
430
-							'desc' => sprintf( wp_kses( __( 'Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array(
430
+							'desc' => sprintf(wp_kses(__('Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array(
431 431
 								'a' => array(
432 432
 									'href'   => array(),
433 433
 									'target' => array(),
434 434
 								),
435
-							) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
435
+							)), esc_url('http://docs.givewp.com/form-floating-labels')),
436 436
 							'id'   => 'floatlabels',
437 437
 							'type' => 'checkbox',
438 438
 						),
439 439
 						array(
440
-							'name' => __( 'Disable Welcome Screen', 'give' ),
440
+							'name' => __('Disable Welcome Screen', 'give'),
441 441
 							/* translators: %s: about page URL */
442
-							'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give' ), array(
442
+							'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give'), array(
443 443
 								'a' => array(
444 444
 									'href'   => array(),
445 445
 									'target' => array(),
446 446
 								),
447
-							) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
447
+							)), esc_url(admin_url('index.php?page=give-about'))),
448 448
 							'id'   => 'disable_welcome',
449 449
 							'type' => 'checkbox',
450 450
 						),
451 451
 						array(
452
-							'name' => __( 'Post Types', 'give' ),
452
+							'name' => __('Post Types', 'give'),
453 453
 							'desc' => '',
454 454
 							'id'   => 'give_title_display_settings_2',
455 455
 							'type' => 'give_title',
456 456
 						),
457 457
 						array(
458
-							'name' => __( 'Disable Form Single Views', 'give' ),
459
-							'desc' => __( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
458
+							'name' => __('Disable Form Single Views', 'give'),
459
+							'desc' => __('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
460 460
 							'id'   => 'disable_forms_singular',
461 461
 							'type' => 'checkbox',
462 462
 						),
463 463
 						array(
464
-							'name' => __( 'Disable Form Archives', 'give' ),
465
-							'desc' => __( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
464
+							'name' => __('Disable Form Archives', 'give'),
465
+							'desc' => __('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
466 466
 							'id'   => 'disable_forms_archives',
467 467
 							'type' => 'checkbox',
468 468
 						),
469 469
 						array(
470
-							'name' => __( 'Disable Form Excerpts', 'give' ),
471
-							'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
470
+							'name' => __('Disable Form Excerpts', 'give'),
471
+							'desc' => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
472 472
 							'id'   => 'disable_forms_excerpt',
473 473
 							'type' => 'checkbox',
474 474
 						),
475 475
 						array(
476
-							'name'    => __( 'Featured Image Size', 'give' ),
477
-							'desc'    => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
476
+							'name'    => __('Featured Image Size', 'give'),
477
+							'desc'    => __('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'),
478 478
 							'id'      => 'featured_image_size',
479 479
 							'type'    => 'select',
480 480
 							'default' => 'large',
481 481
 							'options' => give_get_featured_image_sizes(),
482 482
 						),
483 483
 						array(
484
-							'name' => __( 'Disable Form Featured Image', 'give' ),
485
-							'desc' => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
484
+							'name' => __('Disable Form Featured Image', 'give'),
485
+							'desc' => __('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
486 486
 							'id'   => 'disable_form_featured_img',
487 487
 							'type' => 'checkbox',
488 488
 						),
489 489
 						array(
490
-							'name' => __( 'Disable Single Form Sidebar', 'give' ),
491
-							'desc' => __( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
490
+							'name' => __('Disable Single Form Sidebar', 'give'),
491
+							'desc' => __('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
492 492
 							'id'   => 'disable_form_sidebar',
493 493
 							'type' => 'checkbox',
494 494
 						),
495 495
 						array(
496
-							'name' => __( 'Taxonomies', 'give' ),
496
+							'name' => __('Taxonomies', 'give'),
497 497
 							'desc' => '',
498 498
 							'id'   => 'give_title_display_settings_3',
499 499
 							'type' => 'give_title',
500 500
 						),
501 501
 						array(
502
-							'name' => __( 'Enable Form Categories', 'give' ),
503
-							'desc' => __( 'Enables the "Category" taxonomy for all Give forms.', 'give' ),
502
+							'name' => __('Enable Form Categories', 'give'),
503
+							'desc' => __('Enables the "Category" taxonomy for all Give forms.', 'give'),
504 504
 							'id'   => 'categories',
505 505
 							'type' => 'checkbox',
506 506
 						),
507 507
 						array(
508
-							'name' => __( 'Enable Form Tags', 'give' ),
509
-							'desc' => __( 'Enables the "Tag" taxonomy for all Give forms.', 'give' ),
508
+							'name' => __('Enable Form Tags', 'give'),
509
+							'desc' => __('Enables the "Tag" taxonomy for all Give forms.', 'give'),
510 510
 							'id'   => 'tags',
511 511
 							'type' => 'checkbox',
512 512
 						),
@@ -519,101 +519,101 @@  discard block
 block discarded – undo
519 519
 			 */
520 520
 			'emails'      => array(
521 521
 				'id'         => 'email_settings',
522
-				'give_title' => __( 'Email Settings', 'give' ),
523
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
524
-				'fields'     => apply_filters( 'give_settings_emails', array(
522
+				'give_title' => __('Email Settings', 'give'),
523
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
524
+				'fields'     => apply_filters('give_settings_emails', array(
525 525
 						array(
526
-							'name' => __( 'Email Settings', 'give' ),
526
+							'name' => __('Email Settings', 'give'),
527 527
 							'desc' => '',
528 528
 							'id'   => 'give_title_email_settings_1',
529 529
 							'type' => 'give_title',
530 530
 						),
531 531
 						array(
532 532
 							'id'      => 'email_template',
533
-							'name'    => __( 'Email Template', 'give' ),
534
-							'desc'    => __( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
533
+							'name'    => __('Email Template', 'give'),
534
+							'desc'    => __('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
535 535
 							'type'    => 'select',
536 536
 							'options' => give_get_email_templates(),
537 537
 						),
538 538
 						array(
539 539
 							'id'   => 'email_logo',
540
-							'name' => __( 'Logo', 'give' ),
541
-							'desc' => __( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
540
+							'name' => __('Logo', 'give'),
541
+							'desc' => __('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
542 542
 							'type' => 'file',
543 543
 						),
544 544
 						array(
545 545
 							'id'      => 'from_name',
546
-							'name'    => __( 'From Name', 'give' ),
547
-							'desc'    => __( 'The name that appears in the "From" field in donation receipt emails.', 'give' ),
548
-							'default' => get_bloginfo( 'name' ),
546
+							'name'    => __('From Name', 'give'),
547
+							'desc'    => __('The name that appears in the "From" field in donation receipt emails.', 'give'),
548
+							'default' => get_bloginfo('name'),
549 549
 							'type'    => 'text',
550 550
 						),
551 551
 						array(
552 552
 							'id'      => 'from_email',
553
-							'name'    => __( 'From Email', 'give' ),
554
-							'desc'    => __( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
555
-							'default' => get_bloginfo( 'admin_email' ),
553
+							'name'    => __('From Email', 'give'),
554
+							'desc'    => __('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
555
+							'default' => get_bloginfo('admin_email'),
556 556
 							'type'    => 'text',
557 557
 						),
558 558
 						array(
559
-							'name' => __( 'Donation Receipt', 'give' ),
559
+							'name' => __('Donation Receipt', 'give'),
560 560
 							'desc' => '',
561 561
 							'id'   => 'give_title_email_settings_2',
562 562
 							'type' => 'give_title',
563 563
 						),
564 564
 						array(
565 565
 							'id'      => 'donation_subject',
566
-							'name'    => __( 'Donation Email Subject', 'give' ),
567
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
568
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
566
+							'name'    => __('Donation Email Subject', 'give'),
567
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
568
+							'default' => esc_attr__('Donation Receipt', 'give'),
569 569
 							'type'    => 'text',
570 570
 						),
571 571
 						array(
572 572
 							'id'      => 'donation_receipt',
573
-							'name'    => __( 'Donation Receipt', 'give' ),
573
+							'name'    => __('Donation Receipt', 'give'),
574 574
 							'desc'    => sprintf(
575 575
 							/* translators: %s: emails tags list */
576
-								__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ),
577
-								'<br/>' . give_get_emails_tags_list()
576
+								__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'),
577
+								'<br/>'.give_get_emails_tags_list()
578 578
 							),
579 579
 							'type'    => 'wysiwyg',
580 580
 							'default' => give_get_default_donation_receipt_email(),
581 581
 						),
582 582
 						array(
583
-							'name' => __( 'New Donation Notification', 'give' ),
583
+							'name' => __('New Donation Notification', 'give'),
584 584
 							'desc' => '',
585 585
 							'id'   => 'give_title_email_settings_3',
586 586
 							'type' => 'give_title',
587 587
 						),
588 588
 						array(
589 589
 							'id'      => 'donation_notification_subject',
590
-							'name'    => __( 'Donation Notification Subject', 'give' ),
591
-							'desc'    => __( 'Enter the subject line for the donation notification email.', 'give' ),
590
+							'name'    => __('Donation Notification Subject', 'give'),
591
+							'desc'    => __('Enter the subject line for the donation notification email.', 'give'),
592 592
 							'type'    => 'text',
593
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' ),
593
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give'),
594 594
 						),
595 595
 						array(
596 596
 							'id'      => 'donation_notification',
597
-							'name'    => __( 'Donation Notification', 'give' ),
597
+							'name'    => __('Donation Notification', 'give'),
598 598
 							'desc'    => sprintf(
599 599
 							/* translators: %s: emails tags list */
600
-								__( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ),
601
-								'<br/>' . give_get_emails_tags_list()
600
+								__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'),
601
+								'<br/>'.give_get_emails_tags_list()
602 602
 							),
603 603
 							'type'    => 'wysiwyg',
604 604
 							'default' => give_get_default_donation_notification_email(),
605 605
 						),
606 606
 						array(
607 607
 							'id'      => 'admin_notice_emails',
608
-							'name'    => __( 'Donation Notification Emails', 'give' ),
609
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
608
+							'name'    => __('Donation Notification Emails', 'give'),
609
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
610 610
 							'type'    => 'textarea',
611
-							'default' => get_bloginfo( 'admin_email' ),
611
+							'default' => get_bloginfo('admin_email'),
612 612
 						),
613 613
 						array(
614 614
 							'id'   => 'disable_admin_notices',
615
-							'name' => __( 'Disable Admin Notifications', 'give' ),
616
-							'desc' => __( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
615
+							'name' => __('Disable Admin Notifications', 'give'),
616
+							'desc' => __('Check this box if you do not want to receive emails when new donations are made.', 'give'),
617 617
 							'type' => 'checkbox',
618 618
 						),
619 619
 					)
@@ -622,99 +622,99 @@  discard block
 block discarded – undo
622 622
 			/** Extension Settings */
623 623
 			'addons'      => array(
624 624
 				'id'         => 'addons',
625
-				'give_title' => __( 'Give Add-ons Settings', 'give' ),
626
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
627
-				'fields'     => apply_filters( 'give_settings_addons', array()
625
+				'give_title' => __('Give Add-ons Settings', 'give'),
626
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
627
+				'fields'     => apply_filters('give_settings_addons', array()
628 628
 				),
629 629
 			),
630 630
 			/** Licenses Settings */
631 631
 			'licenses'    => array(
632 632
 				'id'         => 'licenses',
633
-				'give_title' => __( 'Give Licenses', 'give' ),
634
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
635
-				'fields'     => apply_filters( 'give_settings_licenses', array()
633
+				'give_title' => __('Give Licenses', 'give'),
634
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
635
+				'fields'     => apply_filters('give_settings_licenses', array()
636 636
 				),
637 637
 			),
638 638
 			/** Advanced Options */
639 639
 			'advanced'    => array(
640 640
 				'id'         => 'advanced_options',
641
-				'give_title' => __( 'Advanced Options', 'give' ),
642
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
643
-				'fields'     => apply_filters( 'give_settings_advanced', array(
641
+				'give_title' => __('Advanced Options', 'give'),
642
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
643
+				'fields'     => apply_filters('give_settings_advanced', array(
644 644
 						array(
645
-							'name' => __( 'Access Control', 'give' ),
645
+							'name' => __('Access Control', 'give'),
646 646
 							'desc' => '',
647 647
 							'id'   => 'give_title_session_control_1',
648 648
 							'type' => 'give_title',
649 649
 						),
650 650
 						array(
651 651
 							'id'      => 'session_lifetime',
652
-							'name'    => __( 'Session Lifetime', 'give' ),
653
-							'desc'    => __( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ),
652
+							'name'    => __('Session Lifetime', 'give'),
653
+							'desc'    => __('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'),
654 654
 							'type'    => 'select',
655 655
 							'options' => array(
656
-								'86400'  => __( '24 Hours', 'give' ),
657
-								'172800' => __( '48 Hours', 'give' ),
658
-								'259200' => __( '72 Hours', 'give' ),
659
-								'604800' => __( '1 Week', 'give' ),
656
+								'86400'  => __('24 Hours', 'give'),
657
+								'172800' => __('48 Hours', 'give'),
658
+								'259200' => __('72 Hours', 'give'),
659
+								'604800' => __('1 Week', 'give'),
660 660
 							),
661 661
 						),
662 662
 						array(
663
-							'name' => __( 'Email Access', 'give' ),
664
-							'desc' => __( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
663
+							'name' => __('Email Access', 'give'),
664
+							'desc' => __('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
665 665
 							'id'   => 'email_access',
666 666
 							'type' => 'checkbox',
667 667
 						),
668 668
 						array(
669 669
 							'id'      => 'recaptcha_key',
670
-							'name'    => __( 'reCAPTCHA Site Key', 'give' ),
670
+							'name'    => __('reCAPTCHA Site Key', 'give'),
671 671
 							/* translators: %s: https://www.google.com/recaptcha/ */
672
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'https://www.google.com/recaptcha/' ) ),
672
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('https://www.google.com/recaptcha/')),
673 673
 							'default' => '',
674 674
 							'type'    => 'text',
675 675
 						),
676 676
 						array(
677 677
 							'id'      => 'recaptcha_secret',
678
-							'name'    => __( 'reCAPTCHA Secret Key', 'give' ),
679
-							'desc'    => __( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
678
+							'name'    => __('reCAPTCHA Secret Key', 'give'),
679
+							'desc'    => __('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
680 680
 							'default' => '',
681 681
 							'type'    => 'text',
682 682
 						),
683 683
 						array(
684
-							'name' => __( 'Data Control', 'give' ),
684
+							'name' => __('Data Control', 'give'),
685 685
 							'desc' => '',
686 686
 							'id'   => 'give_title_data_control_2',
687 687
 							'type' => 'give_title',
688 688
 						),
689 689
 						array(
690
-							'name' => __( 'Remove All Data on Uninstall?', 'give' ),
691
-							'desc' => __( 'When the plugin is deleted, completely remove all Give data.', 'give' ),
690
+							'name' => __('Remove All Data on Uninstall?', 'give'),
691
+							'desc' => __('When the plugin is deleted, completely remove all Give data.', 'give'),
692 692
 							'id'   => 'uninstall_on_delete',
693 693
 							'type' => 'checkbox',
694 694
 						),
695 695
 						array(
696
-							'name' => __( 'Filter Control', 'give' ),
696
+							'name' => __('Filter Control', 'give'),
697 697
 							'desc' => '',
698 698
 							'id'   => 'give_title_filter_control',
699 699
 							'type' => 'give_title',
700 700
 						),
701 701
 						array(
702 702
 							/* translators: %s: the_content */
703
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
703
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
704 704
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
705
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
705
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
706 706
 							'id'   => 'disable_the_content_filter',
707 707
 							'type' => 'checkbox',
708 708
 						),
709 709
 						array(
710
-							'name' => __( 'Script Loading', 'give' ),
710
+							'name' => __('Script Loading', 'give'),
711 711
 							'desc' => '',
712 712
 							'id'   => 'give_title_script_control',
713 713
 							'type' => 'give_title',
714 714
 						),
715 715
 						array(
716
-							'name' => __( 'Load Scripts in Footer?', 'give' ),
717
-							'desc' => __( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
716
+							'name' => __('Load Scripts in Footer?', 'give'),
717
+							'desc' => __('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
718 718
 							'id'   => 'scripts_footer',
719 719
 							'type' => 'checkbox',
720 720
 						),
@@ -724,13 +724,13 @@  discard block
 block discarded – undo
724 724
 			/** API Settings */
725 725
 			'api'         => array(
726 726
 				'id'         => 'api',
727
-				'give_title' => __( 'API', 'give' ),
728
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
727
+				'give_title' => __('API', 'give'),
728
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
729 729
 				'show_names' => false, // Hide field names on the left
730
-				'fields'     => apply_filters( 'give_settings_system', array(
730
+				'fields'     => apply_filters('give_settings_system', array(
731 731
 						array(
732 732
 							'id'   => 'api',
733
-							'name' => __( 'API', 'give' ),
733
+							'name' => __('API', 'give'),
734 734
 							'type' => 'api',
735 735
 						),
736 736
 					)
@@ -739,13 +739,13 @@  discard block
 block discarded – undo
739 739
 			/** Licenses Settings */
740 740
 			'system_info' => array(
741 741
 				'id'         => 'system_info',
742
-				'give_title' => __( 'System Info', 'give' ),
743
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
744
-				'fields'     => apply_filters( 'give_settings_system', array(
742
+				'give_title' => __('System Info', 'give'),
743
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
744
+				'fields'     => apply_filters('give_settings_system', array(
745 745
 						array(
746 746
 							'id'   => 'system-info-textarea',
747
-							'name' => __( 'System Info', 'give' ),
748
-							'desc' => __( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
747
+							'name' => __('System Info', 'give'),
748
+							'desc' => __('Please copy and paste this information in your ticket when contacting support.', 'give'),
749 749
 							'type' => 'system_info',
750 750
 						),
751 751
 					)
@@ -753,15 +753,15 @@  discard block
 block discarded – undo
753 753
 			),
754 754
 		);
755 755
 
756
-		$give_settings = apply_filters( 'give_registered_settings', $give_settings );
756
+		$give_settings = apply_filters('give_registered_settings', $give_settings);
757 757
 
758 758
 		// Return all settings array if no active tab
759
-		if ( empty( $active_tab ) || ! isset( $give_settings[ $active_tab ] ) ) {
759
+		if (empty($active_tab) || ! isset($give_settings[$active_tab])) {
760 760
 			return $give_settings;
761 761
 		}
762 762
 
763 763
 		// Add other tabs and settings fields as needed
764
-		return $give_settings[ $active_tab ];
764
+		return $give_settings[$active_tab];
765 765
 
766 766
 	}
767 767
 
@@ -770,11 +770,11 @@  discard block
 block discarded – undo
770 770
 	 */
771 771
 	public function settings_notices() {
772 772
 
773
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
773
+		if ( ! isset($_POST['give_settings_saved'])) {
774 774
 			return;
775 775
 		}
776 776
 
777
-		add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' );
777
+		add_settings_error('give-notices', 'global-settings-updated', __('Settings updated.', 'give'), 'updated');
778 778
 
779 779
 	}
780 780
 
@@ -789,14 +789,14 @@  discard block
 block discarded – undo
789 789
 	 * @return mixed         Field value or exception is thrown.
790 790
 	 * @throws Exception     Throws an exception if the field is invalid.
791 791
 	 */
792
-	public function __get( $field ) {
792
+	public function __get($field) {
793 793
 
794 794
 		// Allowed fields to retrieve
795
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
795
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
796 796
 			return $this->{$field};
797 797
 		}
798 798
 
799
-		throw new Exception( sprintf( __( 'Invalid property: %s', 'give' ), $field ) );
799
+		throw new Exception(sprintf(__('Invalid property: %s', 'give'), $field));
800 800
 	}
801 801
 
802 802
 
@@ -815,12 +815,12 @@  discard block
 block discarded – undo
815 815
  *
816 816
  * @return mixed        Option value
817 817
  */
818
-function give_get_option( $key = '', $default = false ) {
818
+function give_get_option($key = '', $default = false) {
819 819
 	$give_options = give_get_settings();
820
-	$value        = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
821
-	$value        = apply_filters( 'give_get_option', $value, $key, $default );
820
+	$value        = ! empty($give_options[$key]) ? $give_options[$key] : $default;
821
+	$value        = apply_filters('give_get_option', $value, $key, $default);
822 822
 
823
-	return apply_filters( "give_get_option_{$key}", $value, $key, $default );
823
+	return apply_filters("give_get_option_{$key}", $value, $key, $default);
824 824
 }
825 825
 
826 826
 
@@ -838,33 +838,33 @@  discard block
 block discarded – undo
838 838
  *
839 839
  * @return boolean True if updated, false if not.
840 840
  */
841
-function give_update_option( $key = '', $value = false ) {
841
+function give_update_option($key = '', $value = false) {
842 842
 
843 843
 	// If no key, exit
844
-	if ( empty( $key ) ) {
844
+	if (empty($key)) {
845 845
 		return false;
846 846
 	}
847 847
 
848
-	if ( empty( $value ) ) {
849
-		$remove_option = give_delete_option( $key );
848
+	if (empty($value)) {
849
+		$remove_option = give_delete_option($key);
850 850
 
851 851
 		return $remove_option;
852 852
 	}
853 853
 
854 854
 	// First let's grab the current settings
855
-	$options = get_option( 'give_settings' );
855
+	$options = get_option('give_settings');
856 856
 
857 857
 	// Let's let devs alter that value coming in
858
-	$value = apply_filters( 'give_update_option', $value, $key );
858
+	$value = apply_filters('give_update_option', $value, $key);
859 859
 
860 860
 	// Next let's try to update the value
861
-	$options[ $key ] = $value;
862
-	$did_update      = update_option( 'give_settings', $options );
861
+	$options[$key] = $value;
862
+	$did_update      = update_option('give_settings', $options);
863 863
 
864 864
 	// If it updated, let's update the global variable
865
-	if ( $did_update ) {
865
+	if ($did_update) {
866 866
 		global $give_options;
867
-		$give_options[ $key ] = $value;
867
+		$give_options[$key] = $value;
868 868
 	}
869 869
 
870 870
 	return $did_update;
@@ -883,25 +883,25 @@  discard block
 block discarded – undo
883 883
  *
884 884
  * @return boolean True if updated, false if not.
885 885
  */
886
-function give_delete_option( $key = '' ) {
886
+function give_delete_option($key = '') {
887 887
 
888 888
 	// If no key, exit
889
-	if ( empty( $key ) ) {
889
+	if (empty($key)) {
890 890
 		return false;
891 891
 	}
892 892
 
893 893
 	// First let's grab the current settings
894
-	$options = get_option( 'give_settings' );
894
+	$options = get_option('give_settings');
895 895
 
896 896
 	// Next let's try to update the value
897
-	if ( isset( $options[ $key ] ) ) {
898
-		unset( $options[ $key ] );
897
+	if (isset($options[$key])) {
898
+		unset($options[$key]);
899 899
 	}
900 900
 
901
-	$did_update = update_option( 'give_settings', $options );
901
+	$did_update = update_option('give_settings', $options);
902 902
 
903 903
 	// If it updated, let's update the global variable
904
-	if ( $did_update ) {
904
+	if ($did_update) {
905 905
 		global $give_options;
906 906
 		$give_options = $options;
907 907
 	}
@@ -920,9 +920,9 @@  discard block
 block discarded – undo
920 920
  */
921 921
 function give_get_settings() {
922 922
 
923
-	$settings = get_option( 'give_settings' );
923
+	$settings = get_option('give_settings');
924 924
 
925
-	return (array) apply_filters( 'give_get_settings', $settings );
925
+	return (array) apply_filters('give_get_settings', $settings);
926 926
 
927 927
 }
928 928
 
@@ -940,25 +940,25 @@  discard block
 block discarded – undo
940 940
  *
941 941
  * @return array
942 942
  */
943
-function give_settings_array_insert( $array, $position, $insert ) {
944
-	if ( is_int( $position ) ) {
945
-		array_splice( $array, $position, 0, $insert );
943
+function give_settings_array_insert($array, $position, $insert) {
944
+	if (is_int($position)) {
945
+		array_splice($array, $position, 0, $insert);
946 946
 	} else {
947 947
 
948
-		foreach ( $array as $index => $subarray ) {
949
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
948
+		foreach ($array as $index => $subarray) {
949
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
950 950
 				$pos = $index;
951 951
 			}
952 952
 		}
953 953
 
954
-		if ( ! isset( $pos ) ) {
954
+		if ( ! isset($pos)) {
955 955
 			return $array;
956 956
 		}
957 957
 
958 958
 		$array = array_merge(
959
-			array_slice( $array, 0, $pos ),
959
+			array_slice($array, 0, $pos),
960 960
 			$insert,
961
-			array_slice( $array, $pos )
961
+			array_slice($array, $pos)
962 962
 		);
963 963
 	}
964 964
 
@@ -978,23 +978,23 @@  discard block
 block discarded – undo
978 978
  *
979 979
  * @return void
980 980
  */
981
-function give_enabled_gateways_callback( $field_arr, $saved_values = array() ) {
981
+function give_enabled_gateways_callback($field_arr, $saved_values = array()) {
982 982
 
983 983
 	$id       = $field_arr['id'];
984
-	$gateways = give_get_ordered_payment_gateways( give_get_payment_gateways() );
984
+	$gateways = give_get_ordered_payment_gateways(give_get_payment_gateways());
985 985
 
986 986
 	echo '<ul class="give-checklist-fields give-payment-gatways-list">';
987 987
 
988
-	foreach ( $gateways as $key => $option ) :
988
+	foreach ($gateways as $key => $option) :
989 989
 
990
-		if ( is_array( $saved_values ) && array_key_exists( $key, $saved_values ) ) {
990
+		if (is_array($saved_values) && array_key_exists($key, $saved_values)) {
991 991
 			$enabled = '1';
992 992
 		} else {
993 993
 			$enabled = null;
994 994
 		}
995 995
 
996
-		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
997
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
996
+		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
997
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
998 998
 
999 999
 	endforeach;
1000 1000
 
@@ -1013,16 +1013,16 @@  discard block
 block discarded – undo
1013 1013
  *
1014 1014
  * @return void
1015 1015
  */
1016
-function give_default_gateway_callback( $field_arr, $saved_value ) {
1016
+function give_default_gateway_callback($field_arr, $saved_value) {
1017 1017
 	$id          = $field_arr['id'];
1018 1018
 	$gateways    = give_get_enabled_payment_gateways();
1019
-	$saved_value = give_get_default_gateway( null );
1019
+	$saved_value = give_get_default_gateway(null);
1020 1020
 
1021
-	echo '<select class="give-select" name="' . $id . '" id="' . $id . '">';
1021
+	echo '<select class="give-select" name="'.$id.'" id="'.$id.'">';
1022 1022
 
1023
-	foreach ( $gateways as $key => $option ) :
1024
-		$selected = isset( $saved_value ) ? selected( $key, $saved_value, false ) : '';
1025
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1023
+	foreach ($gateways as $key => $option) :
1024
+		$selected = isset($saved_value) ? selected($key, $saved_value, false) : '';
1025
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1026 1026
 	endforeach;
1027 1027
 
1028 1028
 	echo '</select>';
@@ -1040,13 +1040,13 @@  discard block
 block discarded – undo
1040 1040
  *
1041 1041
  * @return void
1042 1042
  */
1043
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1043
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1044 1044
 
1045 1045
 	$id                = $field_type_object->field->args['id'];
1046 1046
 	$title             = $field_type_object->field->args['name'];
1047 1047
 	$field_description = $field_type_object->field->args['desc'];
1048 1048
 
1049
-	echo '<hr>' . $field_description;
1049
+	echo '<hr>'.$field_description;
1050 1050
 
1051 1051
 }
1052 1052
 
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
  *
1062 1062
  * @return void
1063 1063
  */
1064
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1064
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1065 1065
 
1066 1066
 	$id                = $field_type_object->field->args['id'];
1067 1067
 	$title             = $field_type_object->field->args['name'];
@@ -1080,25 +1080,25 @@  discard block
 block discarded – undo
1080 1080
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1081 1081
  * @return array An array of options that matches the CMB2 options array
1082 1082
  */
1083
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1083
+function give_cmb2_get_post_options($query_args, $force = false) {
1084 1084
 
1085
-	$post_options = array( '' => '' ); // Blank option
1085
+	$post_options = array('' => ''); // Blank option
1086 1086
 
1087
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1087
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1088 1088
 		return $post_options;
1089 1089
 	}
1090 1090
 
1091
-	$args = wp_parse_args( $query_args, array(
1091
+	$args = wp_parse_args($query_args, array(
1092 1092
 		'post_type'   => 'page',
1093 1093
 		'numberposts' => 10,
1094
-	) );
1094
+	));
1095 1095
 
1096
-	$posts = get_posts( $args );
1096
+	$posts = get_posts($args);
1097 1097
 
1098
-	if ( $posts ) {
1099
-		foreach ( $posts as $post ) {
1098
+	if ($posts) {
1099
+		foreach ($posts as $post) {
1100 1100
 
1101
-			$post_options[ $post->ID ] = $post->post_title;
1101
+			$post_options[$post->ID] = $post->post_title;
1102 1102
 
1103 1103
 		}
1104 1104
 	}
@@ -1123,33 +1123,33 @@  discard block
 block discarded – undo
1123 1123
 
1124 1124
 	$sizes            = array();
1125 1125
 	$get_sizes        = get_intermediate_image_sizes();
1126
-	$core_image_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' );
1126
+	$core_image_sizes = array('thumbnail', 'medium', 'medium_large', 'large');
1127 1127
 
1128 1128
 
1129 1129
 	// This will help us to filter special characters from a string
1130
-	$filter_slug_items = array( '_', '-' );
1130
+	$filter_slug_items = array('_', '-');
1131 1131
 
1132
-	foreach ( $get_sizes as $_size ) {
1132
+	foreach ($get_sizes as $_size) {
1133 1133
 
1134 1134
 		// Converting image size slug to title case
1135
-		$sizes[ $_size ] = give_slug_to_title( $_size, $filter_slug_items );
1135
+		$sizes[$_size] = give_slug_to_title($_size, $filter_slug_items);
1136 1136
 
1137
-		if ( in_array( $_size, $core_image_sizes ) ) {
1138
-			$sizes[ $_size ] .= ' (' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1139
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1140
-			$sizes[ $_size ] .= " ({$_wp_additional_image_sizes[ $_size ]['width']} x {$_wp_additional_image_sizes[ $_size ]['height']}";
1137
+		if (in_array($_size, $core_image_sizes)) {
1138
+			$sizes[$_size] .= ' ('.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1139
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1140
+			$sizes[$_size] .= " ({$_wp_additional_image_sizes[$_size]['width']} x {$_wp_additional_image_sizes[$_size]['height']}";
1141 1141
 		}
1142 1142
 
1143 1143
 		// Based on the above image height check, label the respective resolution as responsive
1144
-		if ( ( array_key_exists( $_size, $_wp_additional_image_sizes ) && ! $_wp_additional_image_sizes[ $_size ]['crop'] ) || ( in_array( $_size, $core_image_sizes ) && ! get_option( "{$_size}_crop" ) ) ) {
1145
-			$sizes[ $_size ] .= ' - responsive';
1144
+		if ((array_key_exists($_size, $_wp_additional_image_sizes) && ! $_wp_additional_image_sizes[$_size]['crop']) || (in_array($_size, $core_image_sizes) && ! get_option("{$_size}_crop"))) {
1145
+			$sizes[$_size] .= ' - responsive';
1146 1146
 		}
1147 1147
 
1148
-		$sizes[ $_size ] .= ')';
1148
+		$sizes[$_size] .= ')';
1149 1149
 
1150 1150
 	}
1151 1151
 
1152
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1152
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1153 1153
 }
1154 1154
 
1155 1155
 
@@ -1165,14 +1165,14 @@  discard block
 block discarded – undo
1165 1165
  *
1166 1166
  * @return text $string
1167 1167
  */
1168
-function give_slug_to_title( $string, $filters = array() ) {
1168
+function give_slug_to_title($string, $filters = array()) {
1169 1169
 
1170
-	foreach ( $filters as $filter_item ) {
1171
-		$string = str_replace( $filter_item, ' ', $string );
1170
+	foreach ($filters as $filter_item) {
1171
+		$string = str_replace($filter_item, ' ', $string);
1172 1172
 	}
1173 1173
 
1174 1174
 	// Return updated string after converting it to title case
1175
-	return ucwords( $string );
1175
+	return ucwords($string);
1176 1176
 
1177 1177
 }
1178 1178
 
@@ -1188,18 +1188,18 @@  discard block
 block discarded – undo
1188 1188
  *
1189 1189
  * @return void
1190 1190
  */
1191
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1191
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1192 1192
 	/* @var CMB2_Types $field_type_object */
1193 1193
 
1194 1194
 	$id                 = $field_type_object->field->args['id'];
1195 1195
 	$field_description  = $field_type_object->field->args['desc'];
1196 1196
 	$license            = $field_type_object->field->args['options']['license'];
1197 1197
 	$license_key        = $escaped_value;
1198
-	$is_license_key     = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) );
1199
-	$is_valid_license   = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) );
1198
+	$is_license_key     = apply_filters('give_is_license_key', (is_object($license) && ! empty($license)));
1199
+	$is_valid_license   = apply_filters('give_is_valid_license', ($is_license_key && property_exists($license, 'license') && 'valid' === $license->license));
1200 1200
 	$shortname          = $field_type_object->field->args['options']['shortname'];
1201 1201
 	$field_classes      = 'regular-text give-license-field';
1202
-	$type               = empty( $escaped_value ) || ! $is_valid_license ? 'text' : 'password';
1202
+	$type               = empty($escaped_value) || ! $is_valid_license ? 'text' : 'password';
1203 1203
 	$custom_html        = '';
1204 1204
 	$messages           = array();
1205 1205
 	$class              = '';
@@ -1211,83 +1211,83 @@  discard block
 block discarded – undo
1211 1211
 
1212 1212
 	// By default query on edd api url will return license object which contain status and message property, this can break below functionality.
1213 1213
 	// To combat that check if status is set to error or not, if yes then set $is_license_key to false.
1214
-	if ( $is_license_key && property_exists( $license, 'status' ) && 'error' === $license->status ) {
1214
+	if ($is_license_key && property_exists($license, 'status') && 'error' === $license->status) {
1215 1215
 		$is_license_key = false;
1216 1216
 	}
1217 1217
 
1218 1218
 	// Check if current license is part of subscription or not.
1219
-	$subscriptions = get_option( 'give_subscriptions' );
1219
+	$subscriptions = get_option('give_subscriptions');
1220 1220
 
1221
-	if ( $is_license_key && $subscriptions ) {
1222
-		foreach ( $subscriptions as $subscription ) {
1223
-			if ( in_array( $license_key, $subscription['licenses'] ) ) {
1221
+	if ($is_license_key && $subscriptions) {
1222
+		foreach ($subscriptions as $subscription) {
1223
+			if (in_array($license_key, $subscription['licenses'])) {
1224 1224
 				$is_in_subscription = $subscription['id'];
1225 1225
 				break;
1226 1226
 			}
1227 1227
 		}
1228 1228
 	}
1229 1229
 
1230
-	if ( $is_license_key ) {
1230
+	if ($is_license_key) {
1231 1231
 
1232
-		if ( empty( $license->success ) && property_exists( $license, 'error' ) ) {
1232
+		if (empty($license->success) && property_exists($license, 'error')) {
1233 1233
 
1234 1234
 			// activate_license 'invalid' on anything other than valid, so if there was an error capture it
1235
-			switch ( $license->error ) {
1235
+			switch ($license->error) {
1236 1236
 				case 'expired' :
1237 1237
 					$class          = $license->error;
1238 1238
 					$messages[]     = sprintf(
1239
-						__( 'Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give' ),
1240
-						date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1241
-						$checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1239
+						__('Your license key expired on %1$s. Please <a href="%2$s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give'),
1240
+						date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1241
+						$checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1242 1242
 					);
1243
-					$license_status = 'license-' . $class;
1243
+					$license_status = 'license-'.$class;
1244 1244
 					break;
1245 1245
 
1246 1246
 				case 'missing' :
1247 1247
 					$class          = $license->error;
1248 1248
 					$messages[]     = sprintf(
1249
-						__( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give' ),
1250
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1249
+						__('Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give'),
1250
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1251 1251
 					);
1252
-					$license_status = 'license-' . $class;
1252
+					$license_status = 'license-'.$class;
1253 1253
 					break;
1254 1254
 
1255 1255
 				case 'invalid' :
1256 1256
 					$class          = $license->error;
1257 1257
 					$messages[]     = sprintf(
1258
-						__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1258
+						__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1259 1259
 						$addon_name,
1260
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1260
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1261 1261
 					);
1262
-					$license_status = 'license-' . $class;
1262
+					$license_status = 'license-'.$class;
1263 1263
 					break;
1264 1264
 
1265 1265
 				case 'site_inactive' :
1266 1266
 					$class          = $license->error;
1267 1267
 					$messages[]     = sprintf(
1268
-						__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1268
+						__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1269 1269
 						$addon_name,
1270
-						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1270
+						$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1271 1271
 					);
1272
-					$license_status = 'license-' . $class;
1272
+					$license_status = 'license-'.$class;
1273 1273
 					break;
1274 1274
 
1275 1275
 				case 'item_name_mismatch' :
1276 1276
 					$class          = $license->error;
1277
-					$messages[]     = sprintf( __( 'This license %1$s does not belong to %2$s.', 'give' ), $license_key, $addon_name );
1278
-					$license_status = 'license-' . $class;
1277
+					$messages[]     = sprintf(__('This license %1$s does not belong to %2$s.', 'give'), $license_key, $addon_name);
1278
+					$license_status = 'license-'.$class;
1279 1279
 					break;
1280 1280
 
1281 1281
 				case 'no_activations_left':
1282 1282
 					$class          = $license->error;
1283
-					$messages[]     = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link );
1284
-					$license_status = 'license-' . $class;
1283
+					$messages[]     = sprintf(__('Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give'), $account_page_link);
1284
+					$license_status = 'license-'.$class;
1285 1285
 					break;
1286 1286
 
1287 1287
 				default:
1288 1288
 					$class          = $license->error;
1289 1289
 					$messages[]     = sprintf(
1290
-						__( 'Your license is not activated. Please <a href="%3$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs. %2$sError Code: %1$s.', 'give' ),
1290
+						__('Your license is not activated. Please <a href="%3$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs. %2$sError Code: %1$s.', 'give'),
1291 1291
 						$license->error,
1292 1292
 						'<br/>',
1293 1293
 						"{$account_page_link}?utm_campaign=admin&utm_source=licenses&utm_medium={$license->error}"
@@ -1296,74 +1296,74 @@  discard block
 block discarded – undo
1296 1296
 					break;
1297 1297
 			}
1298 1298
 
1299
-		} elseif ( $is_in_subscription ) {
1299
+		} elseif ($is_in_subscription) {
1300 1300
 
1301
-			$subscription_expires = strtotime( $subscriptions[ $is_in_subscription ]['expires'] );
1302
-			$subscription_status  = __( 'renew', 'give' );
1301
+			$subscription_expires = strtotime($subscriptions[$is_in_subscription]['expires']);
1302
+			$subscription_status  = __('renew', 'give');
1303 1303
 
1304
-			if ( ( 'active' !== $subscriptions[ $is_in_subscription ]['status'] ) ) {
1305
-				$subscription_status = __( 'expire', 'give' );
1304
+			if (('active' !== $subscriptions[$is_in_subscription]['status'])) {
1305
+				$subscription_status = __('expire', 'give');
1306 1306
 			}
1307 1307
 
1308
-			if ( $subscription_expires < current_time( 'timestamp', 1 ) ) {
1309
-				$messages[]     = sprintf(
1310
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ),
1311
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1312
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1313
-					$checkout_page_link . '?edd_license_key=' . $subscriptions[ $is_in_subscription ]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1308
+			if ($subscription_expires < current_time('timestamp', 1)) {
1309
+				$messages[] = sprintf(
1310
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%3$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give'),
1311
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1312
+					$subscriptions[$is_in_subscription]['payment_id'],
1313
+					$checkout_page_link.'?edd_license_key='.$subscriptions[$is_in_subscription]['license_key'].'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1314 1314
 				);
1315 1315
 				$license_status = 'license-expired';
1316
-			} elseif ( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) {
1316
+			} elseif (strtotime('- 7 days', $subscription_expires) < current_time('timestamp', 1)) {
1317 1317
 				$messages[]     = sprintf(
1318
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give' ),
1319
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1320
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1318
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s in %4$s.', 'give'),
1319
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1320
+					$subscriptions[$is_in_subscription]['payment_id'],
1321 1321
 					$subscription_status,
1322
-					human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[ $is_in_subscription ]['expires'] ) )
1322
+					human_time_diff(current_time('timestamp', 1), strtotime($subscriptions[$is_in_subscription]['expires']))
1323 1323
 				);
1324 1324
 				$license_status = 'license-expires-soon';
1325 1325
 			} else {
1326 1326
 				$messages[]     = sprintf(
1327
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give' ),
1328
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1329
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1327
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %3$s on %4$s.', 'give'),
1328
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1329
+					$subscriptions[$is_in_subscription]['payment_id'],
1330 1330
 					$subscription_status,
1331
-					date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[ $is_in_subscription ]['expires'], current_time( 'timestamp' ) ) )
1331
+					date_i18n(get_option('date_format'), strtotime($subscriptions[$is_in_subscription]['expires'], current_time('timestamp')))
1332 1332
 				);
1333 1333
 				$license_status = 'license-expiration-date';
1334 1334
 			}
1335 1335
 
1336
-		} elseif ( empty( $license->success ) ) {
1336
+		} elseif (empty($license->success)) {
1337 1337
 			$class          = 'invalid';
1338 1338
 			$messages[]     = sprintf(
1339
-				__( 'Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1339
+				__('Your %1$s is not active for this URL. Please <a href="%2$s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1340 1340
 				$addon_name,
1341
-				$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1341
+				$account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1342 1342
 			);
1343
-			$license_status = 'license-' . $class;
1343
+			$license_status = 'license-'.$class;
1344 1344
 
1345 1345
 		} else {
1346
-			switch ( $license->license ) {
1346
+			switch ($license->license) {
1347 1347
 				case 'valid' :
1348 1348
 				default:
1349 1349
 					$class      = 'valid';
1350
-					$now        = current_time( 'timestamp' );
1351
-					$expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1350
+					$now        = current_time('timestamp');
1351
+					$expiration = strtotime($license->expires, current_time('timestamp'));
1352 1352
 
1353
-					if ( 'lifetime' === $license->expires ) {
1354
-						$messages[]     = __( 'License key never expires.', 'give' );
1353
+					if ('lifetime' === $license->expires) {
1354
+						$messages[]     = __('License key never expires.', 'give');
1355 1355
 						$license_status = 'license-lifetime-notice';
1356
-					} elseif ( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1356
+					} elseif ($expiration > $now && $expiration - $now < (DAY_IN_SECONDS * 30)) {
1357 1357
 						$messages[]     = sprintf(
1358
-							__( 'Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ),
1359
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1360
-							$checkout_page_link . '?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1358
+							__('Your license key expires soon! It expires on %1$s. <a href="%2$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give'),
1359
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1360
+							$checkout_page_link.'?edd_license_key='.$license_key.'&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1361 1361
 						);
1362 1362
 						$license_status = 'license-expires-soon';
1363 1363
 					} else {
1364 1364
 						$messages[]     = sprintf(
1365
-							__( 'Your license key expires on %s.', 'give' ),
1366
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1365
+							__('Your license key expires on %s.', 'give'),
1366
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp')))
1367 1367
 						);
1368 1368
 						$license_status = 'license-expiration-date';
1369 1369
 					}
@@ -1371,15 +1371,15 @@  discard block
 block discarded – undo
1371 1371
 			}
1372 1372
 		}
1373 1373
 	} else {
1374
-		$messages[]     = sprintf(
1375
-			__( 'To receive updates, please enter your valid %s license key.', 'give' ),
1374
+		$messages[] = sprintf(
1375
+			__('To receive updates, please enter your valid %s license key.', 'give'),
1376 1376
 			$addon_name
1377 1377
 		);
1378 1378
 		$license_status = 'inactive';
1379 1379
 	}
1380 1380
 
1381 1381
 	// Add class for input field if license is active.
1382
-	if ( $is_valid_license ) {
1382
+	if ($is_valid_license) {
1383 1383
 		$field_classes .= ' give-license-active';
1384 1384
 	}
1385 1385
 
@@ -1387,33 +1387,33 @@  discard block
 block discarded – undo
1387 1387
 	$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\">";
1388 1388
 
1389 1389
 	// If license is active so show deactivate button.
1390
-	if ( $is_valid_license ) {
1390
+	if ($is_valid_license) {
1391 1391
 		// Get input field html.
1392 1392
 		$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\" readonly=\"readonly\">";
1393 1393
 
1394
-		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>';
1394
+		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>';
1395 1395
 
1396 1396
 	}
1397 1397
 
1398 1398
 	// Field description.
1399
-	$custom_html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1399
+	$custom_html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1400 1400
 
1401 1401
 	// If no messages found then inform user that to get updated in future register yourself.
1402
-	if ( empty( $messages ) ) {
1403
-		$messages[] = apply_filters( "{$shortname}_default_addon_notice", __( 'To receive updates, please enter your valid license key.', 'give' ) );
1402
+	if (empty($messages)) {
1403
+		$messages[] = apply_filters("{$shortname}_default_addon_notice", __('To receive updates, please enter your valid license key.', 'give'));
1404 1404
 	}
1405 1405
 
1406
-	foreach ( $messages as $message ) {
1407
-		$custom_html .= '<div class="give-license-status-notice give-' . $license_status . '">';
1408
-		$custom_html .= '<p>' . $message . '</p>';
1406
+	foreach ($messages as $message) {
1407
+		$custom_html .= '<div class="give-license-status-notice give-'.$license_status.'">';
1408
+		$custom_html .= '<p>'.$message.'</p>';
1409 1409
 		$custom_html .= '</div>';
1410 1410
 	}
1411 1411
 
1412 1412
 	// Field html.
1413
-	$custom_html = apply_filters( 'give_license_key_field_html', $input_field_html . $custom_html, $field_type_object );
1413
+	$custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object);
1414 1414
 
1415 1415
 	// Nonce.
1416
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1416
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1417 1417
 
1418 1418
 	// Print field html.
1419 1419
 	echo "<div class=\"give-license-key\"><label for=\"{$id}\">{$addon_name }</label></div><div class=\"give-license-block\">{$custom_html}</div>";
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
  */
1429 1429
 function give_api_callback() {
1430 1430
 
1431
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1431
+	if ( ! current_user_can('manage_give_settings')) {
1432 1432
 		return;
1433 1433
 	}
1434 1434
 
@@ -1437,9 +1437,9 @@  discard block
 block discarded – undo
1437 1437
 	 *
1438 1438
 	 * @since 1.0
1439 1439
 	 */
1440
-	do_action( 'give_tools_api_keys_before' );
1440
+	do_action('give_tools_api_keys_before');
1441 1441
 
1442
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1442
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1443 1443
 
1444 1444
 	$api_keys_table = new Give_API_Keys_Table();
1445 1445
 	$api_keys_table->prepare_items();
@@ -1448,9 +1448,9 @@  discard block
 block discarded – undo
1448 1448
 	<span class="cmb2-metabox-description api-description">
1449 1449
 		<?php echo sprintf(
1450 1450
 		/* translators: 1: http://docs.givewp.com/api 2: http://docs.givewp.com/addon-zapier */
1451
-			__( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ),
1452
-			esc_url( 'http://docs.givewp.com/api' ),
1453
-			esc_url( 'http://docs.givewp.com/addon-zapier' )
1451
+			__('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'),
1452
+			esc_url('http://docs.givewp.com/api'),
1453
+			esc_url('http://docs.givewp.com/addon-zapier')
1454 1454
 		); ?>
1455 1455
 	</span>
1456 1456
 	<?php
@@ -1460,10 +1460,10 @@  discard block
 block discarded – undo
1460 1460
 	 *
1461 1461
 	 * @since 1.0
1462 1462
 	 */
1463
-	do_action( 'give_tools_api_keys_after' );
1463
+	do_action('give_tools_api_keys_after');
1464 1464
 }
1465 1465
 
1466
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1466
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1467 1467
 
1468 1468
 /**
1469 1469
  * Hook Callback
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
  *
1477 1477
  * @return void
1478 1478
  */
1479
-function give_hook_callback( $args ) {
1479
+function give_hook_callback($args) {
1480 1480
 
1481 1481
 	$id = $args['id'];
1482 1482
 
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 	 *
1486 1486
 	 * @since 1.0
1487 1487
 	 */
1488
-	do_action( "give_{$id}" );
1488
+	do_action("give_{$id}");
1489 1489
 
1490 1490
 }
1491 1491
 
@@ -1500,19 +1500,19 @@  discard block
 block discarded – undo
1500 1500
  *
1501 1501
  * @return bool
1502 1502
  */
1503
-function give_is_setting_enabled( $value, $compare_with = null ) {
1504
-	if ( ! is_null( $compare_with ) ) {
1503
+function give_is_setting_enabled($value, $compare_with = null) {
1504
+	if ( ! is_null($compare_with)) {
1505 1505
 
1506
-		if ( is_array( $compare_with ) ) {
1506
+		if (is_array($compare_with)) {
1507 1507
 			// Output.
1508
-			return in_array( $value, $compare_with );
1508
+			return in_array($value, $compare_with);
1509 1509
 		}
1510 1510
 
1511 1511
 		// Output.
1512
-		return ( $value === $compare_with );
1512
+		return ($value === $compare_with);
1513 1513
 	}
1514 1514
 
1515 1515
 	// Backward compatibility: From version 1.8 most of setting is modified to enabled/disabled
1516 1516
 	// Output.
1517
-	return ( in_array( $value, array( 'enabled', 'on', 'yes' ) ) ? true : false );
1517
+	return (in_array($value, array('enabled', 'on', 'yes')) ? true : false);
1518 1518
 }
1519 1519
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/payments/class-payments-table.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 	/**
491 491
 	 * Get donor email html.
492 492
 	 *
493
-	 * @param object $payment Contains all the data of the payment.
493
+	 * @param Give_Payment $payment Contains all the data of the payment.
494 494
 	 *
495 495
 	 * @access public
496 496
 	 * @since  1.0
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 	/**
514 514
 	 * Get Row Actions
515 515
 	 *
516
-	 * @param object $payment Payment Data.
516
+	 * @param Give_Payment $payment Payment Data.
517 517
 	 *
518 518
 	 * @since 1.6
519 519
 	 *
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 	/**
566 566
 	 *  Get payment status html.
567 567
 	 *
568
-	 * @param object $payment Contains all the data of the payment.
568
+	 * @param Give_Payment $payment Contains all the data of the payment.
569 569
 	 *
570 570
 	 * @access public
571 571
 	 * @since  1.0
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 	/**
616 616
 	 * Get donor html.
617 617
 	 *
618
-	 * @param object $payment Contains all the data of the payment.
618
+	 * @param Give_Payment $payment Contains all the data of the payment.
619 619
 	 *
620 620
 	 * @access public
621 621
 	 * @since  1.0
Please login to merge, or discard this patch.
Spacing   +204 added lines, -205 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load WP_List_Table if not loaded.
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
 		// Set parent defaults.
137 137
 		parent::__construct(
138 138
 			array(
139
-				'singular' => give_get_forms_label_singular(),    // Singular name of the listed records.
140
-				'plural'   => give_get_forms_label_plural(),      // Plural name of the listed records.
141
-				'ajax'     => false,                              // Does this table support ajax?
139
+				'singular' => give_get_forms_label_singular(), // Singular name of the listed records.
140
+				'plural'   => give_get_forms_label_plural(), // Plural name of the listed records.
141
+				'ajax'     => false, // Does this table support ajax?
142 142
 			)
143 143
 		);
144 144
 
145 145
 		$this->process_bulk_action();
146 146
 		$this->get_payment_counts();
147
-		$this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
147
+		$this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
148 148
 	}
149 149
 
150 150
 	/**
@@ -153,31 +153,31 @@  discard block
 block discarded – undo
153 153
 	 * @return void
154 154
 	 */
155 155
 	public function advanced_filters() {
156
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
157
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null;
158
-		$status     = isset( $_GET['status'] ) ? sanitize_text_field( $_GET['status'] ) : '';
159
-		$donor      = isset( $_GET['donor'] ) ? sanitize_text_field( $_GET['donor'] ) : '';
160
-		$search     = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : '';
161
-		$form_id    = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : 0;
156
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
157
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null;
158
+		$status     = isset($_GET['status']) ? sanitize_text_field($_GET['status']) : '';
159
+		$donor      = isset($_GET['donor']) ? sanitize_text_field($_GET['donor']) : '';
160
+		$search     = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : '';
161
+		$form_id    = ! empty($_GET['form_id']) ? absint($_GET['form_id']) : 0;
162 162
 		?>
163 163
 		<div id="give-payment-filters" class="give-filters">
164
-			<?php $this->search_box( __( 'Search', 'give' ), 'give-payments' ); ?>
164
+			<?php $this->search_box(__('Search', 'give'), 'give-payments'); ?>
165 165
 			<div id="give-payment-date-filters">
166 166
 				<div class="give-filter give-filter-half">
167 167
 					<label for="start-date"
168
-						   class="give-start-date-label"><?php _e( 'Start Date', 'give' ); ?></label>
168
+						   class="give-start-date-label"><?php _e('Start Date', 'give'); ?></label>
169 169
 					<input type="text" id="start-date" name="start-date" class="give_datepicker"
170 170
 						   value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy" />
171 171
 				</div>
172 172
 				<div class="give-filter give-filter-half">
173
-					<label for="end-date" class="give-end-date-label"><?php _e( 'End Date', 'give' ); ?></label>
173
+					<label for="end-date" class="give-end-date-label"><?php _e('End Date', 'give'); ?></label>
174 174
 					<input type="text" id="end-date" name="end-date" class="give_datepicker"
175 175
 						   value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy" />
176 176
 				</div>
177 177
 			</div>
178 178
 			<div id="give-payment-form-filter" class="give-filter">
179 179
 				<label for="give-donation-forms-filter"
180
-					   class="give-donation-forms-filter-label"><?php _e( 'Form', 'give' ); ?></label>
180
+					   class="give-donation-forms-filter-label"><?php _e('Form', 'give'); ?></label>
181 181
 				<?php
182 182
 				// Filter Donations by Donation Forms.
183 183
 				echo Give()->html->forms_dropdown(
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 						'class'    => 'give-donation-forms-filter',
188 188
 						'selected' => $form_id, // Make sure to have $form_id set to 0, if there is no selection.
189 189
 						'chosen'   => true,
190
-						'number'   => - 1,
190
+						'number'   => -1,
191 191
 					)
192 192
 				);
193 193
 				?>
@@ -199,21 +199,21 @@  discard block
 block discarded – undo
199 199
 			 *
200 200
 			 * @since 1.8.18
201 201
 			 */
202
-			do_action( 'give_payment_table_advanced_filters' );
202
+			do_action('give_payment_table_advanced_filters');
203 203
 			?>
204 204
 
205
-			<?php if ( ! empty( $status ) ) : ?>
206
-				<input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>" />
205
+			<?php if ( ! empty($status)) : ?>
206
+				<input type="hidden" name="status" value="<?php echo esc_attr($status); ?>" />
207 207
 			<?php endif; ?>
208 208
 
209 209
 			<div class="give-filter">
210
-				<?php submit_button( __( 'Apply', 'give' ), 'secondary', '', false ); ?>
210
+				<?php submit_button(__('Apply', 'give'), 'secondary', '', false); ?>
211 211
 				<?php
212 212
 				// Clear active filters button.
213
-				if ( ! empty( $start_date ) || ! empty( $end_date ) || ! empty( $donor ) || ! empty( $search ) || ! empty( $status ) || ! empty( $form_id ) ) :
213
+				if ( ! empty($start_date) || ! empty($end_date) || ! empty($donor) || ! empty($search) || ! empty($status) || ! empty($form_id)) :
214 214
 				?>
215
-					<a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>"
216
-					   class="button give-clear-filters-button"><?php _e( 'Clear Filters', 'give' ); ?></a>
215
+					<a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>"
216
+					   class="button give-clear-filters-button"><?php _e('Clear Filters', 'give'); ?></a>
217 217
 				<?php endif; ?>
218 218
 			</div>
219 219
 		</div>
@@ -232,18 +232,18 @@  discard block
 block discarded – undo
232 232
 	 *
233 233
 	 * @return void
234 234
 	 */
235
-	public function search_box( $text, $input_id ) {
236
-		if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
235
+	public function search_box($text, $input_id) {
236
+		if (empty($_REQUEST['s']) && ! $this->has_items()) {
237 237
 			return;
238 238
 		}
239 239
 
240
-		$input_id = $input_id . '-search-input';
240
+		$input_id = $input_id.'-search-input';
241 241
 
242
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
243
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
242
+		if ( ! empty($_REQUEST['orderby'])) {
243
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
244 244
 		}
245
-		if ( ! empty( $_REQUEST['order'] ) ) {
246
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
245
+		if ( ! empty($_REQUEST['order'])) {
246
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
247 247
 		}
248 248
 		?>
249 249
 		<div class="give-filter give-filter-search" role="search">
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 			 *
256 256
 			 * @since 1.7
257 257
 			 */
258
-			do_action( 'give_payment_history_search' );
258
+			do_action('give_payment_history_search');
259 259
 			?>
260 260
 			<label class="screen-reader-text" for="<?php echo $input_id; ?>"><?php echo $text; ?>:</label>
261 261
 			<input type="search" id="<?php echo $input_id; ?>" name="s" value="<?php _admin_search_query(); ?>" />
@@ -281,48 +281,48 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	public function get_views() {
283 283
 
284
-		$current = isset( $_GET['status'] ) ? $_GET['status'] : '';
284
+		$current = isset($_GET['status']) ? $_GET['status'] : '';
285 285
 		$views   = array();
286 286
 		$tabs    = array(
287 287
 			'all'         => array(
288 288
 				'total_count',
289
-				__( 'All', 'give' ),
289
+				__('All', 'give'),
290 290
 			),
291 291
 			'publish'     => array(
292 292
 				'complete_count',
293
-				__( 'Completed', 'give' ),
293
+				__('Completed', 'give'),
294 294
 			),
295 295
 			'pending'     => array(
296 296
 				'pending_count',
297
-				__( 'Pending', 'give' ),
297
+				__('Pending', 'give'),
298 298
 			),
299 299
 			'processing'  => array(
300 300
 				'processing_count',
301
-				__( 'Processing', 'give' ),
301
+				__('Processing', 'give'),
302 302
 			),
303 303
 			'refunded'    => array(
304 304
 				'refunded_count',
305
-				__( 'Refunded', 'give' ),
305
+				__('Refunded', 'give'),
306 306
 			),
307 307
 			'revoked'     => array(
308 308
 				'revoked_count',
309
-				__( 'Revoked', 'give' ),
309
+				__('Revoked', 'give'),
310 310
 			),
311 311
 			'failed'      => array(
312 312
 				'failed_count',
313
-				__( 'Failed', 'give' ),
313
+				__('Failed', 'give'),
314 314
 			),
315 315
 			'cancelled'   => array(
316 316
 				'cancelled_count',
317
-				__( 'Cancelled', 'give' ),
317
+				__('Cancelled', 'give'),
318 318
 			),
319 319
 			'abandoned'   => array(
320 320
 				'abandoned_count',
321
-				__( 'Abandoned', 'give' ),
321
+				__('Abandoned', 'give'),
322 322
 			),
323 323
 			'preapproval' => array(
324 324
 				'preapproval_count',
325
-				__( 'Preapproval Pending', 'give' ),
325
+				__('Preapproval Pending', 'give'),
326 326
 			),
327 327
 		);
328 328
 
@@ -331,12 +331,12 @@  discard block
 block discarded – undo
331 331
 		 *
332 332
 		 * @since 1.8.18
333 333
 		 */
334
-		$args = (array) apply_filters( 'give_payments_table_status_remove_query_arg', array( 'paged', '_wpnonce', '_wp_http_referer' ) );
334
+		$args = (array) apply_filters('give_payments_table_status_remove_query_arg', array('paged', '_wpnonce', '_wp_http_referer'));
335 335
 
336 336
 		// Build URL.
337
-		$staus_url = remove_query_arg( $args );
337
+		$staus_url = remove_query_arg($args);
338 338
 
339
-		foreach ( $tabs as $key => $tab ) {
339
+		foreach ($tabs as $key => $tab) {
340 340
 			$count_key = $tab[0];
341 341
 			$name      = $tab[1];
342 342
 			$count     = $this->$count_key;
@@ -351,16 +351,15 @@  discard block
 block discarded – undo
351 351
 			 *
352 352
 			 * @since 1.8.12
353 353
 			 */
354
-			if ( 'all' === $key || $key === $current || apply_filters( 'give_payments_table_show_all_status', 0 < $count, $key, $count ) ) {
354
+			if ('all' === $key || $key === $current || apply_filters('give_payments_table_show_all_status', 0 < $count, $key, $count)) {
355 355
 
356 356
 				$staus_url = 'all' === $key ?
357
-					add_query_arg( array( 'status' => false ), apply_filters( 'give_payments_table_status_all_query_arg', $staus_url ) ) :
358
-					add_query_arg( array( 'status' => $key ), $staus_url );
357
+					add_query_arg(array('status' => false), apply_filters('give_payments_table_status_all_query_arg', $staus_url)) : add_query_arg(array('status' => $key), $staus_url);
359 358
 
360
-				$views[ $key ] = sprintf(
359
+				$views[$key] = sprintf(
361 360
 					'<a href="%s"%s>%s&nbsp;<span class="count">(%s)</span></a>',
362
-					esc_url( $staus_url ),
363
-					( ( 'all' === $key && empty( $current ) && apply_filters( 'give_payments_table_show_all_default_selected', true ) ) ) ? ' class="current"' : ( $current == $key ? 'class="current"' : '' ),
361
+					esc_url($staus_url),
362
+					(('all' === $key && empty($current) && apply_filters('give_payments_table_show_all_default_selected', true))) ? ' class="current"' : ($current == $key ? 'class="current"' : ''),
364 363
 					$name,
365 364
 					$count
366 365
 				);
@@ -375,7 +374,7 @@  discard block
 block discarded – undo
375 374
 		 * @param array $views
376 375
 		 * @param Give_Payment_History_Table 
377 376
 		 */
378
-		return apply_filters( 'give_payments_table_views', $views, $this );
377
+		return apply_filters('give_payments_table_views', $views, $this);
379 378
 	}
380 379
 
381 380
 	/**
@@ -389,18 +388,18 @@  discard block
 block discarded – undo
389 388
 	public function get_columns() {
390 389
 		$columns = array(
391 390
 			'cb'            => '<input type="checkbox" />', // Render a checkbox instead of text.
392
-			'donation'      => __( 'Donation', 'give' ),
393
-			'donation_form' => __( 'Donation Form', 'give' ),
394
-			'status'        => __( 'Status', 'give' ),
395
-			'date'          => __( 'Date', 'give' ),
396
-			'amount'        => __( 'Amount', 'give' ),
391
+			'donation'      => __('Donation', 'give'),
392
+			'donation_form' => __('Donation Form', 'give'),
393
+			'status'        => __('Status', 'give'),
394
+			'date'          => __('Date', 'give'),
395
+			'amount'        => __('Amount', 'give'),
397 396
 		);
398 397
 
399
-		if ( current_user_can( 'view_give_payments' ) ) {
400
-			$columns['details'] = __( 'Details', 'give' );
398
+		if (current_user_can('view_give_payments')) {
399
+			$columns['details'] = __('Details', 'give');
401 400
 		}
402 401
 
403
-		return apply_filters( 'give_payments_table_columns', $columns );
402
+		return apply_filters('give_payments_table_columns', $columns);
404 403
 	}
405 404
 
406 405
 	/**
@@ -413,14 +412,14 @@  discard block
 block discarded – undo
413 412
 	 */
414 413
 	public function get_sortable_columns() {
415 414
 		$columns = array(
416
-			'donation'      => array( 'ID', true ),
417
-			'donation_form' => array( 'donation_form', false ),
418
-			'status'        => array( 'status', false ),
419
-			'amount'        => array( 'amount', false ),
420
-			'date'          => array( 'date', false ),
415
+			'donation'      => array('ID', true),
416
+			'donation_form' => array('donation_form', false),
417
+			'status'        => array('status', false),
418
+			'amount'        => array('amount', false),
419
+			'date'          => array('date', false),
421 420
 		);
422 421
 
423
-		return apply_filters( 'give_payments_table_sortable_columns', $columns );
422
+		return apply_filters('give_payments_table_sortable_columns', $columns);
424 423
 	}
425 424
 
426 425
 	/**
@@ -446,62 +445,62 @@  discard block
 block discarded – undo
446 445
 	 *
447 446
 	 * @return string Column Name
448 447
 	 */
449
-	public function column_default( $payment, $column_name ) {
448
+	public function column_default($payment, $column_name) {
450 449
 
451
-		$single_donation_url = esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details' ) ) );
452
-		$row_actions         = $this->get_row_actions( $payment );
450
+		$single_donation_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details')));
451
+		$row_actions         = $this->get_row_actions($payment);
453 452
 		$value = '';
454 453
 
455
-		switch ( $column_name ) {
454
+		switch ($column_name) {
456 455
 			case 'donation':
457
-				if ( current_user_can( 'view_give_payments' ) ) {
458
-					$value = sprintf( '<a href="%1$s" data-tooltip="%2$s">#%3$s</a>&nbsp;%4$s&nbsp;%5$s<br>', $single_donation_url, sprintf( __( 'View Donation #%s', 'give' ), $payment->ID ), $payment->ID, __( 'by', 'give' ), $this->get_donor( $payment ) );
456
+				if (current_user_can('view_give_payments')) {
457
+					$value = sprintf('<a href="%1$s" data-tooltip="%2$s">#%3$s</a>&nbsp;%4$s&nbsp;%5$s<br>', $single_donation_url, sprintf(__('View Donation #%s', 'give'), $payment->ID), $payment->ID, __('by', 'give'), $this->get_donor($payment));
459 458
 				} else {
460
-					$value = sprintf( '#%1$s ' . __( 'by', 'give' ) . ' %2$s <br/>', $payment->ID, $this->get_donor( $payment ) );
459
+					$value = sprintf('#%1$s '.__('by', 'give').' %2$s <br/>', $payment->ID, $this->get_donor($payment));
461 460
 				}
462
-				$value .= $this->get_donor_email( $payment );
463
-				$value .= $this->row_actions( $row_actions );
461
+				$value .= $this->get_donor_email($payment);
462
+				$value .= $this->row_actions($row_actions);
464 463
 				break;
465 464
 
466 465
 			case 'amount':
467
-				$amount = ! empty( $payment->total ) ? $payment->total : 0;
468
-				$value  = give_donation_amount( $payment, true );
469
-				$value .= sprintf( '<br><small>%1$s %2$s</small>', __( 'via', 'give' ), give_get_gateway_admin_label( $payment->gateway ) );
466
+				$amount = ! empty($payment->total) ? $payment->total : 0;
467
+				$value  = give_donation_amount($payment, true);
468
+				$value .= sprintf('<br><small>%1$s %2$s</small>', __('via', 'give'), give_get_gateway_admin_label($payment->gateway));
470 469
 				break;
471 470
 
472 471
 			case 'donation_form':
473
-				$form_title = empty( $payment->form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $payment->form_id ) : $payment->form_title;
474
-				$value      = '<a href="' . admin_url( 'post.php?post=' . $payment->form_id . '&action=edit' ) . '">' . $form_title . '</a>';
475
-				$level      = give_get_payment_form_title( $payment->meta, true );
472
+				$form_title = empty($payment->form_title) ? sprintf(__('Untitled (#%s)', 'give'), $payment->form_id) : $payment->form_title;
473
+				$value      = '<a href="'.admin_url('post.php?post='.$payment->form_id.'&action=edit').'">'.$form_title.'</a>';
474
+				$level      = give_get_payment_form_title($payment->meta, true);
476 475
 
477
-				if ( ! empty( $level ) ) {
476
+				if ( ! empty($level)) {
478 477
 					$value .= $level;
479 478
 				}
480 479
 
481 480
 				break;
482 481
 
483 482
 			case 'date':
484
-				$date  = strtotime( $payment->date );
485
-				$value = date_i18n( give_date_format(), $date );
483
+				$date  = strtotime($payment->date);
484
+				$value = date_i18n(give_date_format(), $date);
486 485
 				break;
487 486
 
488 487
 			case 'status':
489
-				$value = $this->get_payment_status( $payment );
488
+				$value = $this->get_payment_status($payment);
490 489
 				break;
491 490
 
492 491
 			case 'details':
493
-				if ( current_user_can( 'view_give_payments' ) ) {
494
-					$value = sprintf( '<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>', $single_donation_url, sprintf( __( 'View Donation #%s', 'give' ), $payment->ID ) );
492
+				if (current_user_can('view_give_payments')) {
493
+					$value = sprintf('<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>', $single_donation_url, sprintf(__('View Donation #%s', 'give'), $payment->ID));
495 494
 				}
496 495
 				break;
497 496
 
498 497
 			default:
499
-				$value = isset( $payment->$column_name ) ? $payment->$column_name : '';
498
+				$value = isset($payment->$column_name) ? $payment->$column_name : '';
500 499
 				break;
501 500
 
502 501
 		}// End switch().
503 502
 
504
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name );
503
+		return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name);
505 504
 	}
506 505
 
507 506
 	/**
@@ -514,17 +513,17 @@  discard block
 block discarded – undo
514 513
 	 *
515 514
 	 * @return string Data shown in the Email column
516 515
 	 */
517
-	public function get_donor_email( $payment ) {
516
+	public function get_donor_email($payment) {
518 517
 
519
-		$email = give_get_payment_user_email( $payment->ID );
518
+		$email = give_get_payment_user_email($payment->ID);
520 519
 
521
-		if ( empty( $email ) ) {
522
-			$email = __( '(unknown)', 'give' );
520
+		if (empty($email)) {
521
+			$email = __('(unknown)', 'give');
523 522
 		}
524 523
 
525
-		$value = '<a href="mailto:' . $email . '" data-tooltip="' . __( 'Email donor', 'give' ) . '">' . $email . '</a>';
524
+		$value = '<a href="mailto:'.$email.'" data-tooltip="'.__('Email donor', 'give').'">'.$email.'</a>';
526 525
 
527
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' );
526
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'email');
528 527
 	}
529 528
 
530 529
 	/**
@@ -536,18 +535,18 @@  discard block
 block discarded – undo
536 535
 	 *
537 536
 	 * @return array $actions
538 537
 	 */
539
-	function get_row_actions( $payment ) {
538
+	function get_row_actions($payment) {
540 539
 
541 540
 		$actions = array();
542
-		$email   = give_get_payment_user_email( $payment->ID );
541
+		$email   = give_get_payment_user_email($payment->ID);
543 542
 
544 543
 		// Add search term string back to base URL.
545
-		$search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' );
546
-		if ( ! empty( $search_terms ) ) {
547
-			$this->base_url = add_query_arg( 's', $search_terms, $this->base_url );
544
+		$search_terms = (isset($_GET['s']) ? trim($_GET['s']) : '');
545
+		if ( ! empty($search_terms)) {
546
+			$this->base_url = add_query_arg('s', $search_terms, $this->base_url);
548 547
 		}
549 548
 
550
-		if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) {
549
+		if (give_is_payment_complete($payment->ID) && ! empty($email)) {
551 550
 
552 551
 			$actions['email_links'] = sprintf(
553 552
 				'<a class="resend-single-donation-receipt" href="%1$s" aria-label="%2$s">%3$s</a>', wp_nonce_url(
@@ -557,12 +556,12 @@  discard block
 block discarded – undo
557 556
 							'purchase_id' => $payment->ID,
558 557
 						), $this->base_url
559 558
 					), 'give_payment_nonce'
560
-				), sprintf( __( 'Resend Donation %s Receipt', 'give' ), $payment->ID ), __( 'Resend Receipt', 'give' )
559
+				), sprintf(__('Resend Donation %s Receipt', 'give'), $payment->ID), __('Resend Receipt', 'give')
561 560
 			);
562 561
 
563 562
 		}
564 563
 
565
-		if ( current_user_can( 'view_give_payments' ) ) {
564
+		if (current_user_can('view_give_payments')) {
566 565
 			$actions['delete'] = sprintf(
567 566
 				'<a class="delete-single-donation" href="%1$s" aria-label="%2$s">%3$s</a>', wp_nonce_url(
568 567
 					add_query_arg(
@@ -571,11 +570,11 @@  discard block
 block discarded – undo
571 570
 							'purchase_id' => $payment->ID,
572 571
 						), $this->base_url
573 572
 					), 'give_donation_nonce'
574
-				), sprintf( __( 'Delete Donation %s', 'give' ), $payment->ID ), __( 'Delete', 'give' )
573
+				), sprintf(__('Delete Donation %s', 'give'), $payment->ID), __('Delete', 'give')
575 574
 			);
576 575
 		}
577 576
 
578
-		return apply_filters( 'give_payment_row_actions', $actions, $payment );
577
+		return apply_filters('give_payment_row_actions', $actions, $payment);
579 578
 	}
580 579
 
581 580
 
@@ -589,14 +588,14 @@  discard block
 block discarded – undo
589 588
 	 *
590 589
 	 * @return string Data shown in the Email column
591 590
 	 */
592
-	function get_payment_status( $payment ) {
593
-		$value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>';
594
-		if ( 'test' === $payment->mode ) {
595
-			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . __( 'This donation was made in test mode.', 'give' ) . '">' . __( 'Test', 'give' ) . '</span>';
591
+	function get_payment_status($payment) {
592
+		$value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>';
593
+		if ('test' === $payment->mode) {
594
+			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.__('This donation was made in test mode.', 'give').'">'.__('Test', 'give').'</span>';
596 595
 		}
597 596
 
598
-		if ( true === $payment->import && true === (bool) apply_filters( 'give_payment_show_importer_label', false ) ) {
599
-			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . __( 'This donation was imported.', 'give' ) . '">' . __( 'Import', 'give' ) . '</span>';
597
+		if (true === $payment->import && true === (bool) apply_filters('give_payment_show_importer_label', false)) {
598
+			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.__('This donation was imported.', 'give').'">'.__('Import', 'give').'</span>';
600 599
 		}
601 600
 
602 601
 		return $value;
@@ -612,8 +611,8 @@  discard block
 block discarded – undo
612 611
 	 *
613 612
 	 * @return string Displays a checkbox.
614 613
 	 */
615
-	public function column_cb( $payment ) {
616
-		return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', 'payment', $payment->ID );
614
+	public function column_cb($payment) {
615
+		return sprintf('<input type="checkbox" name="%1$s[]" value="%2$s" />', 'payment', $payment->ID);
617 616
 	}
618 617
 
619 618
 	/**
@@ -625,8 +624,8 @@  discard block
 block discarded – undo
625 624
 	 *
626 625
 	 * @return string Displays a checkbox.
627 626
 	 */
628
-	public function get_payment_id( $payment ) {
629
-		return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>';
627
+	public function get_payment_id($payment) {
628
+		return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>';
630 629
 	}
631 630
 
632 631
 	/**
@@ -639,32 +638,32 @@  discard block
 block discarded – undo
639 638
 	 *
640 639
 	 * @return string Data shown in the User column
641 640
 	 */
642
-	public function get_donor( $payment ) {
641
+	public function get_donor($payment) {
643 642
 
644
-		$donor_id           = give_get_payment_donor_id( $payment->ID );
645
-		$donor_billing_name = give_get_donor_name_by( $payment->ID, 'donation' );
646
-		$donor_name         = give_get_donor_name_by( $donor_id, 'donor' );
643
+		$donor_id           = give_get_payment_donor_id($payment->ID);
644
+		$donor_billing_name = give_get_donor_name_by($payment->ID, 'donation');
645
+		$donor_name         = give_get_donor_name_by($donor_id, 'donor');
647 646
 
648 647
 		$value = '';
649
-		if ( ! empty( $donor_id ) ) {
648
+		if ( ! empty($donor_id)) {
650 649
 
651 650
 			// Check whether the donor name and WP_User name is same or not.
652
-			if ( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ) {
653
-				$value .= $donor_billing_name . ' (';
651
+			if (sanitize_title($donor_billing_name) != sanitize_title($donor_name)) {
652
+				$value .= $donor_billing_name.' (';
654 653
 			}
655 654
 
656
-			$value .= '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id" ) ) . '">' . $donor_name . '</a>';
655
+			$value .= '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id")).'">'.$donor_name.'</a>';
657 656
 
658 657
 			// Check whether the donor name and WP_User name is same or not.
659
-			if ( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ) {
658
+			if (sanitize_title($donor_billing_name) != sanitize_title($donor_name)) {
660 659
 				$value .= ')';
661 660
 			}
662 661
 		} else {
663
-			$email  = give_get_payment_user_email( $payment->ID );
664
-			$value .= '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . __( '(donor missing)', 'give' ) . '</a>';
662
+			$email  = give_get_payment_user_email($payment->ID);
663
+			$value .= '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.__('(donor missing)', 'give').'</a>';
665 664
 		}
666 665
 
667
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' );
666
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor');
668 667
 	}
669 668
 
670 669
 	/**
@@ -677,20 +676,20 @@  discard block
 block discarded – undo
677 676
 	 */
678 677
 	public function get_bulk_actions() {
679 678
 		$actions = array(
680
-			'delete'                 => __( 'Delete', 'give' ),
681
-			'set-status-publish'     => __( 'Set To Completed', 'give' ),
682
-			'set-status-pending'     => __( 'Set To Pending', 'give' ),
683
-			'set-status-processing'  => __( 'Set To Processing', 'give' ),
684
-			'set-status-refunded'    => __( 'Set To Refunded', 'give' ),
685
-			'set-status-revoked'     => __( 'Set To Revoked', 'give' ),
686
-			'set-status-failed'      => __( 'Set To Failed', 'give' ),
687
-			'set-status-cancelled'   => __( 'Set To Cancelled', 'give' ),
688
-			'set-status-abandoned'   => __( 'Set To Abandoned', 'give' ),
689
-			'set-status-preapproval' => __( 'Set To Preapproval', 'give' ),
690
-			'resend-receipt'         => __( 'Resend Email Receipts', 'give' ),
679
+			'delete'                 => __('Delete', 'give'),
680
+			'set-status-publish'     => __('Set To Completed', 'give'),
681
+			'set-status-pending'     => __('Set To Pending', 'give'),
682
+			'set-status-processing'  => __('Set To Processing', 'give'),
683
+			'set-status-refunded'    => __('Set To Refunded', 'give'),
684
+			'set-status-revoked'     => __('Set To Revoked', 'give'),
685
+			'set-status-failed'      => __('Set To Failed', 'give'),
686
+			'set-status-cancelled'   => __('Set To Cancelled', 'give'),
687
+			'set-status-abandoned'   => __('Set To Abandoned', 'give'),
688
+			'set-status-preapproval' => __('Set To Preapproval', 'give'),
689
+			'resend-receipt'         => __('Resend Email Receipts', 'give'),
691 690
 		);
692 691
 
693
-		return apply_filters( 'give_payments_table_bulk_actions', $actions );
692
+		return apply_filters('give_payments_table_bulk_actions', $actions);
694 693
 	}
695 694
 
696 695
 	/**
@@ -702,63 +701,63 @@  discard block
 block discarded – undo
702 701
 	 * @return void
703 702
 	 */
704 703
 	public function process_bulk_action() {
705
-		$ids    = isset( $_GET['payment'] ) ? $_GET['payment'] : false;
704
+		$ids    = isset($_GET['payment']) ? $_GET['payment'] : false;
706 705
 		$action = $this->current_action();
707 706
 
708
-		if ( ! is_array( $ids ) ) {
709
-			$ids = array( $ids );
707
+		if ( ! is_array($ids)) {
708
+			$ids = array($ids);
710 709
 		}
711 710
 
712
-		if ( empty( $action ) ) {
711
+		if (empty($action)) {
713 712
 			return;
714 713
 		}
715 714
 
716
-		foreach ( $ids as $id ) {
715
+		foreach ($ids as $id) {
717 716
 
718 717
 			// Detect when a bulk action is being triggered.
719
-			switch ( $this->current_action() ) {
718
+			switch ($this->current_action()) {
720 719
 
721 720
 				case 'delete':
722
-					give_delete_donation( $id );
721
+					give_delete_donation($id);
723 722
 					break;
724 723
 
725 724
 				case 'set-status-publish':
726
-					give_update_payment_status( $id, 'publish' );
725
+					give_update_payment_status($id, 'publish');
727 726
 					break;
728 727
 
729 728
 				case 'set-status-pending':
730
-					give_update_payment_status( $id, 'pending' );
729
+					give_update_payment_status($id, 'pending');
731 730
 					break;
732 731
 
733 732
 				case 'set-status-processing':
734
-					give_update_payment_status( $id, 'processing' );
733
+					give_update_payment_status($id, 'processing');
735 734
 					break;
736 735
 
737 736
 				case 'set-status-refunded':
738
-					give_update_payment_status( $id, 'refunded' );
737
+					give_update_payment_status($id, 'refunded');
739 738
 					break;
740 739
 				case 'set-status-revoked':
741
-					give_update_payment_status( $id, 'revoked' );
740
+					give_update_payment_status($id, 'revoked');
742 741
 					break;
743 742
 
744 743
 				case 'set-status-failed':
745
-					give_update_payment_status( $id, 'failed' );
744
+					give_update_payment_status($id, 'failed');
746 745
 					break;
747 746
 
748 747
 				case 'set-status-cancelled':
749
-					give_update_payment_status( $id, 'cancelled' );
748
+					give_update_payment_status($id, 'cancelled');
750 749
 					break;
751 750
 
752 751
 				case 'set-status-abandoned':
753
-					give_update_payment_status( $id, 'abandoned' );
752
+					give_update_payment_status($id, 'abandoned');
754 753
 					break;
755 754
 
756 755
 				case 'set-status-preapproval':
757
-					give_update_payment_status( $id, 'preapproval' );
756
+					give_update_payment_status($id, 'preapproval');
758 757
 					break;
759 758
 
760 759
 				case 'resend-receipt':
761
-					give_email_donation_receipt( $id, false );
760
+					give_email_donation_receipt($id, false);
762 761
 					break;
763 762
 			}// End switch().
764 763
 
@@ -770,7 +769,7 @@  discard block
 block discarded – undo
770 769
 			 *
771 770
 			 * @since 1.7
772 771
 			 */
773
-			do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() );
772
+			do_action('give_payments_table_do_bulk_action', $id, $this->current_action());
774 773
 		}// End foreach().
775 774
 
776 775
 	}
@@ -787,32 +786,32 @@  discard block
 block discarded – undo
787 786
 
788 787
 		$args = array();
789 788
 
790
-		if ( isset( $_GET['user'] ) ) {
791
-			$args['user'] = urldecode( $_GET['user'] );
792
-		} elseif ( isset( $_GET['donor'] ) ) {
793
-			$args['donor'] = absint( $_GET['donor'] );
794
-		} elseif ( isset( $_GET['s'] ) ) {
795
-			$is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false;
796
-			if ( $is_user ) {
797
-				$args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) );
798
-				unset( $args['s'] );
789
+		if (isset($_GET['user'])) {
790
+			$args['user'] = urldecode($_GET['user']);
791
+		} elseif (isset($_GET['donor'])) {
792
+			$args['donor'] = absint($_GET['donor']);
793
+		} elseif (isset($_GET['s'])) {
794
+			$is_user = strpos($_GET['s'], strtolower('user:')) !== false;
795
+			if ($is_user) {
796
+				$args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s']))));
797
+				unset($args['s']);
799 798
 			} else {
800
-				$args['s'] = sanitize_text_field( $_GET['s'] );
799
+				$args['s'] = sanitize_text_field($_GET['s']);
801 800
 			}
802 801
 		}
803 802
 
804
-		if ( ! empty( $_GET['start-date'] ) ) {
805
-			$args['start-date'] = urldecode( $_GET['start-date'] );
803
+		if ( ! empty($_GET['start-date'])) {
804
+			$args['start-date'] = urldecode($_GET['start-date']);
806 805
 		}
807 806
 
808
-		if ( ! empty( $_GET['end-date'] ) ) {
809
-			$args['end-date'] = urldecode( $_GET['end-date'] );
807
+		if ( ! empty($_GET['end-date'])) {
808
+			$args['end-date'] = urldecode($_GET['end-date']);
810 809
 		}
811 810
 
812
-		$args['form_id'] = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : null;
813
-		$args['gateway'] = ! empty( $_GET['gateway'] ) ? give_clean( $_GET['gateway'] ) : null;
811
+		$args['form_id'] = ! empty($_GET['form_id']) ? absint($_GET['form_id']) : null;
812
+		$args['gateway'] = ! empty($_GET['gateway']) ? give_clean($_GET['gateway']) : null;
814 813
 
815
-		$payment_count           = give_count_payments( $args );
814
+		$payment_count           = give_count_payments($args);
816 815
 		$this->complete_count    = $payment_count->publish;
817 816
 		$this->pending_count     = $payment_count->pending;
818 817
 		$this->processing_count  = $payment_count->processing;
@@ -823,7 +822,7 @@  discard block
 block discarded – undo
823 822
 		$this->abandoned_count   = $payment_count->abandoned;
824 823
 		$this->preapproval_count = $payment_count->preapproval;
825 824
 
826
-		foreach ( $payment_count as $count ) {
825
+		foreach ($payment_count as $count) {
827 826
 			$this->total_count += $count;
828 827
 		}
829 828
 
@@ -841,29 +840,29 @@  discard block
 block discarded – undo
841 840
 	public function payments_data() {
842 841
 
843 842
 		$per_page   = $this->per_page;
844
-		$orderby    = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID';
845
-		$order      = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC';
846
-		$user       = isset( $_GET['user'] ) ? $_GET['user'] : null;
847
-		$donor      = isset( $_GET['donor'] ) ? $_GET['donor'] : null;
848
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys();
849
-		$meta_key   = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null;
850
-		$year       = isset( $_GET['year'] ) ? $_GET['year'] : null;
851
-		$month      = isset( $_GET['m'] ) ? $_GET['m'] : null;
852
-		$day        = isset( $_GET['day'] ) ? $_GET['day'] : null;
853
-		$search     = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null;
854
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
855
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date;
856
-		$form_id    = ! empty( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : null;
857
-		$gateway    = ! empty( $_GET['gateway'] ) ? give_clean( $_GET['gateway'] ) : null;
858
-
859
-		if ( ! empty( $search ) ) {
843
+		$orderby    = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID';
844
+		$order      = isset($_GET['order']) ? $_GET['order'] : 'DESC';
845
+		$user       = isset($_GET['user']) ? $_GET['user'] : null;
846
+		$donor      = isset($_GET['donor']) ? $_GET['donor'] : null;
847
+		$status     = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys();
848
+		$meta_key   = isset($_GET['meta_key']) ? $_GET['meta_key'] : null;
849
+		$year       = isset($_GET['year']) ? $_GET['year'] : null;
850
+		$month      = isset($_GET['m']) ? $_GET['m'] : null;
851
+		$day        = isset($_GET['day']) ? $_GET['day'] : null;
852
+		$search     = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null;
853
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
854
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date;
855
+		$form_id    = ! empty($_GET['form_id']) ? absint($_GET['form_id']) : null;
856
+		$gateway    = ! empty($_GET['gateway']) ? give_clean($_GET['gateway']) : null;
857
+
858
+		if ( ! empty($search)) {
860 859
 			$status = 'any'; // Force all payment statuses when searching.
861 860
 		}
862 861
 
863 862
 		$args = array(
864 863
 			'output'     => 'payments',
865 864
 			'number'     => $per_page,
866
-			'page'       => isset( $_GET['paged'] ) ? $_GET['paged'] : null,
865
+			'page'       => isset($_GET['paged']) ? $_GET['paged'] : null,
867 866
 			'orderby'    => $orderby,
868 867
 			'order'      => $order,
869 868
 			'user'       => $user,
@@ -880,9 +879,9 @@  discard block
 block discarded – undo
880 879
 			'give_forms' => $form_id,
881 880
 		);
882 881
 
883
-		if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) {
882
+		if (is_string($search) && false !== strpos($search, 'txn:')) {
884 883
 			$args['search_in_notes'] = true;
885
-			$args['s']               = trim( str_replace( 'txn:', '', $args['s'] ) );
884
+			$args['s']               = trim(str_replace('txn:', '', $args['s']));
886 885
 		}
887 886
 
888 887
 		/**
@@ -890,9 +889,9 @@  discard block
 block discarded – undo
890 889
 		 *
891 890
 		 * @since 1.8.18
892 891
 		 */
893
-		$args = (array) apply_filters( 'give_payment_table_payments_query', $args );
892
+		$args = (array) apply_filters('give_payment_table_payments_query', $args);
894 893
 
895
-		$p_query = new Give_Payments_Query( $args );
894
+		$p_query = new Give_Payments_Query($args);
896 895
 
897 896
 		return $p_query->get_payments();
898 897
 
@@ -913,17 +912,17 @@  discard block
 block discarded – undo
913 912
 	 */
914 913
 	public function prepare_items() {
915 914
 
916
-		wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) );
915
+		wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's'));
917 916
 
918 917
 		$columns  = $this->get_columns();
919 918
 		$hidden   = array(); // No hidden columns.
920 919
 		$sortable = $this->get_sortable_columns();
921 920
 		$data     = $this->payments_data();
922
-		$status   = isset( $_GET['status'] ) ? $_GET['status'] : 'any';
921
+		$status   = isset($_GET['status']) ? $_GET['status'] : 'any';
923 922
 
924
-		$this->_column_headers = array( $columns, $hidden, $sortable );
923
+		$this->_column_headers = array($columns, $hidden, $sortable);
925 924
 
926
-		switch ( $status ) {
925
+		switch ($status) {
927 926
 			case 'publish':
928 927
 				$total_items = $this->complete_count;
929 928
 				break;
@@ -956,8 +955,8 @@  discard block
 block discarded – undo
956 955
 				break;
957 956
 			default:
958 957
 				// Retrieve the count of the non-default-Give status.
959
-				$count       = wp_count_posts( 'give_payment' );
960
-				$total_items = isset( $count->{$status} ) ? $count->{$status} : 0;
958
+				$count       = wp_count_posts('give_payment');
959
+				$total_items = isset($count->{$status} ) ? $count->{$status} : 0;
961 960
 				break;
962 961
 		}
963 962
 
@@ -969,7 +968,7 @@  discard block
 block discarded – undo
969 968
 				// We have to calculate the total number of items.
970 969
 				'per_page'    => $this->per_page,
971 970
 				// We have to determine how many items to show on a page.
972
-				'total_pages' => ceil( $total_items / $this->per_page ),
971
+				'total_pages' => ceil($total_items / $this->per_page),
973 972
 			// We have to calculate the total number of pages.
974 973
 			)
975 974
 		);
Please login to merge, or discard this patch.
includes/ajax-functions.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -521,7 +521,7 @@
 block discarded – undo
521 521
  *
522 522
  * @since 1.8.17
523 523
  *
524
- * @return bool
524
+ * @return false|null
525 525
  */
526 526
 function give_confirm_email_for_donation_access() {
527 527
 
Please login to merge, or discard this patch.
Spacing   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -26,26 +26,26 @@  discard block
 block discarded – undo
26 26
 function give_test_ajax_works() {
27 27
 
28 28
 	// Check if the Airplane Mode plugin is installed.
29
-	if ( class_exists( 'Airplane_Mode_Core' ) ) {
29
+	if (class_exists('Airplane_Mode_Core')) {
30 30
 
31 31
 		$airplane = Airplane_Mode_Core::getInstance();
32 32
 
33
-		if ( method_exists( $airplane, 'enabled' ) ) {
33
+		if (method_exists($airplane, 'enabled')) {
34 34
 
35
-			if ( $airplane->enabled() ) {
35
+			if ($airplane->enabled()) {
36 36
 				return true;
37 37
 			}
38 38
 		} else {
39 39
 
40
-			if ( 'on' === $airplane->check_status() ) {
40
+			if ('on' === $airplane->check_status()) {
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 ( Give_Cache::get( '_give_ajax_works', true ) ) {
48
+	if (Give_Cache::get('_give_ajax_works', true)) {
49 49
 		return true;
50 50
 	}
51 51
 
@@ -57,35 +57,35 @@  discard block
 block discarded – undo
57 57
 		),
58 58
 	);
59 59
 
60
-	$ajax = wp_remote_post( give_get_ajax_url(), $params );
60
+	$ajax = wp_remote_post(give_get_ajax_url(), $params);
61 61
 
62 62
 	$works = true;
63 63
 
64
-	if ( is_wp_error( $ajax ) ) {
64
+	if (is_wp_error($ajax)) {
65 65
 
66 66
 		$works = false;
67 67
 
68 68
 	} else {
69 69
 
70
-		if ( empty( $ajax['response'] ) ) {
70
+		if (empty($ajax['response'])) {
71 71
 			$works = false;
72 72
 		}
73 73
 
74
-		if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) {
74
+		if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) {
75 75
 			$works = false;
76 76
 		}
77 77
 
78
-		if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) {
78
+		if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) {
79 79
 			$works = false;
80 80
 		}
81 81
 
82
-		if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) {
82
+		if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) {
83 83
 			$works = false;
84 84
 		}
85 85
 	}
86 86
 
87
-	if ( $works ) {
88
-		Give_Cache::set( '_give_ajax_works', '1', DAY_IN_SECONDS, true );
87
+	if ($works) {
88
+		Give_Cache::set('_give_ajax_works', '1', DAY_IN_SECONDS, true);
89 89
 	}
90 90
 
91 91
 	return $works;
@@ -100,16 +100,16 @@  discard block
 block discarded – undo
100 100
  * @return string
101 101
  */
102 102
 function give_get_ajax_url() {
103
-	$scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin';
103
+	$scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin';
104 104
 
105 105
 	$current_url = give_get_current_page_url();
106
-	$ajax_url    = admin_url( 'admin-ajax.php', $scheme );
106
+	$ajax_url    = admin_url('admin-ajax.php', $scheme);
107 107
 
108
-	if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) {
109
-		$ajax_url = preg_replace( '/^http/', 'https', $ajax_url );
108
+	if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) {
109
+		$ajax_url = preg_replace('/^http/', 'https', $ajax_url);
110 110
 	}
111 111
 
112
-	return apply_filters( 'give_ajax_url', $ajax_url );
112
+	return apply_filters('give_ajax_url', $ajax_url);
113 113
 }
114 114
 
115 115
 /**
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @since 1.7
127 127
 	 */
128
-	do_action( 'give_donation_form_login_fields' );
128
+	do_action('give_donation_form_login_fields');
129 129
 
130 130
 	give_die();
131 131
 }
132 132
 
133
-add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' );
133
+add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields');
134 134
 
135 135
 /**
136 136
  * Load Checkout Fields
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
  * @return void
141 141
  */
142 142
 function give_load_checkout_fields() {
143
-	$form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : '';
143
+	$form_id = isset($_POST['form_id']) ? $_POST['form_id'] : '';
144 144
 
145 145
 	ob_start();
146 146
 
@@ -149,18 +149,18 @@  discard block
 block discarded – undo
149 149
 	 *
150 150
 	 * @since 1.7
151 151
 	 */
152
-	do_action( 'give_donation_form_register_login_fields', $form_id );
152
+	do_action('give_donation_form_register_login_fields', $form_id);
153 153
 
154 154
 	$fields = ob_get_clean();
155 155
 
156
-	wp_send_json( array(
157
-		'fields' => wp_json_encode( $fields ),
158
-		'submit' => wp_json_encode( give_get_donation_form_submit_button( $form_id ) ),
159
-	) );
156
+	wp_send_json(array(
157
+		'fields' => wp_json_encode($fields),
158
+		'submit' => wp_json_encode(give_get_donation_form_submit_button($form_id)),
159
+	));
160 160
 }
161 161
 
162
-add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' );
163
-add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' );
162
+add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields');
163
+add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields');
164 164
 
165 165
 /**
166 166
  * Get Form Title via AJAX (used only in WordPress Admin)
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
  * @return void
171 171
  */
172 172
 function give_ajax_get_form_title() {
173
-	if ( isset( $_POST['form_id'] ) ) {
174
-		$title = get_the_title( $_POST['form_id'] );
175
-		if ( $title ) {
173
+	if (isset($_POST['form_id'])) {
174
+		$title = get_the_title($_POST['form_id']);
175
+		if ($title) {
176 176
 			echo $title;
177 177
 		} else {
178 178
 			echo 'fail';
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 	give_die();
182 182
 }
183 183
 
184
-add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' );
185
-add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' );
184
+add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title');
185
+add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title');
186 186
 
187 187
 /**
188 188
  * Retrieve a states drop down
@@ -196,41 +196,41 @@  discard block
 block discarded – undo
196 196
 	$show_field     = true;
197 197
 	$states_require = true;
198 198
 	// Get the Country code from the $_POST.
199
-	$country = sanitize_text_field( $_POST['country'] );
199
+	$country = sanitize_text_field($_POST['country']);
200 200
 
201 201
 	// Get the field name from the $_POST.
202
-	$field_name = sanitize_text_field( $_POST['field_name'] );
202
+	$field_name = sanitize_text_field($_POST['field_name']);
203 203
 
204
-	$label        = __( 'State', 'give' );
204
+	$label        = __('State', 'give');
205 205
 	$states_label = give_get_states_label();
206 206
 
207 207
 	$default_state = '';
208
-	if ( $country === give_get_country() ) {
208
+	if ($country === give_get_country()) {
209 209
 		$default_state = give_get_state();
210 210
 	}
211 211
 
212 212
 	// Check if $country code exists in the array key for states label.
213
-	if ( array_key_exists( $country, $states_label ) ) {
214
-		$label = $states_label[ $country ];
213
+	if (array_key_exists($country, $states_label)) {
214
+		$label = $states_label[$country];
215 215
 	}
216 216
 
217
-	if ( empty( $country ) ) {
217
+	if (empty($country)) {
218 218
 		$country = give_get_country();
219 219
 	}
220 220
 
221
-	$states = give_get_states( $country );
222
-	if ( ! empty( $states ) ) {
223
-		$args         = array(
221
+	$states = give_get_states($country);
222
+	if ( ! empty($states)) {
223
+		$args = array(
224 224
 			'name'             => $field_name,
225 225
 			'id'               => $field_name,
226
-			'class'            => $field_name . '  give-select',
226
+			'class'            => $field_name.'  give-select',
227 227
 			'options'          => $states,
228 228
 			'show_option_all'  => false,
229 229
 			'show_option_none' => false,
230 230
 			'placeholder'      => $label,
231 231
 			'selected'         => $default_state,
232 232
 		);
233
-		$data         = Give()->html->select( $args );
233
+		$data         = Give()->html->select($args);
234 234
 		$states_found = true;
235 235
 	} else {
236 236
 		$data = 'nostates';
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		$no_states_country = give_no_states_country_list();
240 240
 
241 241
 		// Check if $country code exists in the array key.
242
-		if ( array_key_exists( $country, $no_states_country ) ) {
242
+		if (array_key_exists($country, $no_states_country)) {
243 243
 			$show_field = false;
244 244
 		}
245 245
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 		$states_not_required_country_list = give_states_not_required_country_list();
248 248
 
249 249
 		// Check if $country code exists in the array key.
250
-		if ( array_key_exists( $country, $states_not_required_country_list ) ) {
250
+		if (array_key_exists($country, $states_not_required_country_list)) {
251 251
 			$states_require = false;
252 252
 		}
253 253
 	}
@@ -260,11 +260,11 @@  discard block
 block discarded – undo
260 260
 		'data'           => $data,
261 261
 		'default_state'  => $default_state,
262 262
 	);
263
-	wp_send_json( $response );
263
+	wp_send_json($response);
264 264
 }
265 265
 
266
-add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' );
267
-add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' );
266
+add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field');
267
+add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field');
268 268
 
269 269
 /**
270 270
  * Retrieve donation forms via AJAX for chosen dropdown search field.
@@ -276,19 +276,19 @@  discard block
 block discarded – undo
276 276
 function give_ajax_form_search() {
277 277
 	global $wpdb;
278 278
 
279
-	$search   = esc_sql( sanitize_text_field( $_GET['s'] ) );
280
-	$excludes = ( isset( $_GET['current_id'] ) ? (array) $_GET['current_id'] : array() );
279
+	$search   = esc_sql(sanitize_text_field($_GET['s']));
280
+	$excludes = (isset($_GET['current_id']) ? (array) $_GET['current_id'] : array());
281 281
 
282 282
 	$results = array();
283
-	if ( current_user_can( 'edit_give_forms' ) ) {
284
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" );
283
+	if (current_user_can('edit_give_forms')) {
284
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50");
285 285
 	} else {
286
-		$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" );
286
+		$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");
287 287
 	}
288 288
 
289
-	if ( $items ) {
289
+	if ($items) {
290 290
 
291
-		foreach ( $items as $item ) {
291
+		foreach ($items as $item) {
292 292
 
293 293
 			$results[] = array(
294 294
 				'id'   => $item->ID,
@@ -299,18 +299,18 @@  discard block
 block discarded – undo
299 299
 
300 300
 		$items[] = array(
301 301
 			'id'   => 0,
302
-			'name' => __( 'No forms found.', 'give' ),
302
+			'name' => __('No forms found.', 'give'),
303 303
 		);
304 304
 
305 305
 	}
306 306
 
307
-	echo json_encode( $results );
307
+	echo json_encode($results);
308 308
 
309 309
 	give_die();
310 310
 }
311 311
 
312
-add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' );
313
-add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' );
312
+add_action('wp_ajax_give_form_search', 'give_ajax_form_search');
313
+add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search');
314 314
 
315 315
 /**
316 316
  * Search the donors database via Ajax
@@ -322,38 +322,38 @@  discard block
 block discarded – undo
322 322
 function give_ajax_donor_search() {
323 323
 	global $wpdb;
324 324
 
325
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
325
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
326 326
 	$results = array();
327
-	if ( ! current_user_can( 'view_give_reports' ) ) {
327
+	if ( ! current_user_can('view_give_reports')) {
328 328
 		$donors = array();
329 329
 	} else {
330
-		$donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" );
330
+		$donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50");
331 331
 	}
332 332
 
333
-	if ( $donors ) {
333
+	if ($donors) {
334 334
 
335
-		foreach ( $donors as $donor ) {
335
+		foreach ($donors as $donor) {
336 336
 
337 337
 			$results[] = array(
338 338
 				'id'   => $donor->id,
339
-				'name' => $donor->name . ' (' . $donor->email . ')',
339
+				'name' => $donor->name.' ('.$donor->email.')',
340 340
 			);
341 341
 		}
342 342
 	} else {
343 343
 
344 344
 		$donors[] = array(
345 345
 			'id'   => 0,
346
-			'name' => __( 'No donors found.', 'give' ),
346
+			'name' => __('No donors found.', 'give'),
347 347
 		);
348 348
 
349 349
 	}
350 350
 
351
-	echo json_encode( $results );
351
+	echo json_encode($results);
352 352
 
353 353
 	give_die();
354 354
 }
355 355
 
356
-add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' );
356
+add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search');
357 357
 
358 358
 
359 359
 /**
@@ -365,39 +365,39 @@  discard block
 block discarded – undo
365 365
  */
366 366
 function give_ajax_search_users() {
367 367
 
368
-	if ( current_user_can( 'manage_give_settings' ) ) {
368
+	if (current_user_can('manage_give_settings')) {
369 369
 
370
-		$search = esc_sql( sanitize_text_field( $_GET['s'] ) );
370
+		$search = esc_sql(sanitize_text_field($_GET['s']));
371 371
 
372 372
 		$get_users_args = array(
373 373
 			'number' => 9999,
374
-			'search' => $search . '*',
374
+			'search' => $search.'*',
375 375
 		);
376 376
 
377
-		$get_users_args = apply_filters( 'give_search_users_args', $get_users_args );
377
+		$get_users_args = apply_filters('give_search_users_args', $get_users_args);
378 378
 
379
-		$found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search );
379
+		$found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search);
380 380
 		$results     = array();
381 381
 
382
-		if ( $found_users ) {
382
+		if ($found_users) {
383 383
 
384
-			foreach ( $found_users as $user ) {
384
+			foreach ($found_users as $user) {
385 385
 
386 386
 				$results[] = array(
387 387
 					'id'   => $user->ID,
388
-					'name' => esc_html( $user->user_login . ' (' . $user->user_email . ')' ),
388
+					'name' => esc_html($user->user_login.' ('.$user->user_email.')'),
389 389
 				);
390 390
 			}
391 391
 		} else {
392 392
 
393 393
 			$results[] = array(
394 394
 				'id'   => 0,
395
-				'name' => __( 'No users found.', 'give' ),
395
+				'name' => __('No users found.', 'give'),
396 396
 			);
397 397
 
398 398
 		}
399 399
 
400
-		echo json_encode( $results );
400
+		echo json_encode($results);
401 401
 
402 402
 	}// End if().
403 403
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 
406 406
 }
407 407
 
408
-add_action( 'wp_ajax_give_user_search', 'give_ajax_search_users' );
408
+add_action('wp_ajax_give_user_search', 'give_ajax_search_users');
409 409
 
410 410
 
411 411
 /**
@@ -417,32 +417,32 @@  discard block
 block discarded – undo
417 417
  */
418 418
 function give_check_for_form_price_variations() {
419 419
 
420
-	if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
421
-		die( '-1' );
420
+	if ( ! current_user_can('edit_give_forms', get_current_user_id())) {
421
+		die('-1');
422 422
 	}
423 423
 
424
-	$form_id = intval( $_POST['form_id'] );
425
-	$form    = get_post( $form_id );
424
+	$form_id = intval($_POST['form_id']);
425
+	$form    = get_post($form_id);
426 426
 
427
-	if ( 'give_forms' != $form->post_type ) {
428
-		die( '-2' );
427
+	if ('give_forms' != $form->post_type) {
428
+		die('-2');
429 429
 	}
430 430
 
431
-	if ( give_has_variable_prices( $form_id ) ) {
432
-		$variable_prices = give_get_variable_prices( $form_id );
431
+	if (give_has_variable_prices($form_id)) {
432
+		$variable_prices = give_get_variable_prices($form_id);
433 433
 
434
-		if ( $variable_prices ) {
434
+		if ($variable_prices) {
435 435
 			$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';
436 436
 
437
-			if ( isset( $_POST['all_prices'] ) ) {
438
-				$ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>';
437
+			if (isset($_POST['all_prices'])) {
438
+				$ajax_response .= '<option value="all">'.esc_html__('All Levels', 'give').'</option>';
439 439
 			}
440 440
 
441
-			foreach ( $variable_prices as $key => $price ) {
441
+			foreach ($variable_prices as $key => $price) {
442 442
 
443
-				$level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) );
443
+				$level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false)));
444 444
 
445
-				$ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>';
445
+				$ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>';
446 446
 			}
447 447
 			$ajax_response .= '</select>';
448 448
 			echo $ajax_response;
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	give_die();
453 453
 }
454 454
 
455
-add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' );
455
+add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations');
456 456
 
457 457
 
458 458
 /**
@@ -463,28 +463,28 @@  discard block
 block discarded – undo
463 463
  * @return void
464 464
  */
465 465
 function give_check_for_form_price_variations_html() {
466
-	if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) {
466
+	if ( ! current_user_can('edit_give_payments', get_current_user_id())) {
467 467
 		wp_die();
468 468
 	}
469 469
 
470
-	$form_id    = ! empty( $_POST['form_id'] ) ? intval( $_POST['form_id'] ) : false;
471
-	$payment_id = ! empty( $_POST['payment_id'] ) ? intval( $_POST['payment_id'] ) : false;
472
-	if ( empty( $form_id ) || empty( $payment_id ) ) {
470
+	$form_id    = ! empty($_POST['form_id']) ? intval($_POST['form_id']) : false;
471
+	$payment_id = ! empty($_POST['payment_id']) ? intval($_POST['payment_id']) : false;
472
+	if (empty($form_id) || empty($payment_id)) {
473 473
 		wp_die();
474 474
 	}
475 475
 
476
-	$form = get_post( $form_id );
477
-	if ( ! empty( $form->post_type ) && 'give_forms' != $form->post_type ) {
476
+	$form = get_post($form_id);
477
+	if ( ! empty($form->post_type) && 'give_forms' != $form->post_type) {
478 478
 		wp_die();
479 479
 	}
480 480
 
481
-	if ( ! give_has_variable_prices( $form_id ) || ! $form_id ) {
482
-		esc_html_e( 'n/a', 'give' );
481
+	if ( ! give_has_variable_prices($form_id) || ! $form_id) {
482
+		esc_html_e('n/a', 'give');
483 483
 	} else {
484 484
 		$prices_atts = array();
485
-		if ( $variable_prices = give_get_variable_prices( $form_id ) ) {
486
-			foreach ( $variable_prices as $variable_price ) {
487
-				$prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'], array( 'sanitize' => false ) );
485
+		if ($variable_prices = give_get_variable_prices($form_id)) {
486
+			foreach ($variable_prices as $variable_price) {
487
+				$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount'], array('sanitize' => false));
488 488
 			}
489 489
 		}
490 490
 
@@ -495,12 +495,12 @@  discard block
 block discarded – undo
495 495
 			'chosen'           => true,
496 496
 			'show_option_all'  => '',
497 497
 			'show_option_none' => '',
498
-			'select_atts'      => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ),
498
+			'select_atts'      => 'data-prices='.esc_attr(json_encode($prices_atts)),
499 499
 		);
500 500
 
501
-		if ( $payment_id ) {
501
+		if ($payment_id) {
502 502
 			// Payment object.
503
-			$payment = new Give_Payment( $payment_id );
503
+			$payment = new Give_Payment($payment_id);
504 504
 
505 505
 			// Payment meta.
506 506
 			$payment_meta                               = $payment->get_meta();
@@ -508,13 +508,13 @@  discard block
 block discarded – undo
508 508
 		}
509 509
 
510 510
 		// Render variable prices select tag html.
511
-		give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
511
+		give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
512 512
 	}
513 513
 
514 514
 	give_die();
515 515
 }
516 516
 
517
-add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' );
517
+add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html');
518 518
 
519 519
 /**
520 520
  * Send Confirmation Email For Complete Donation History Access.
@@ -526,24 +526,24 @@  discard block
 block discarded – undo
526 526
 function give_confirm_email_for_donation_access() {
527 527
 
528 528
 	// Verify Security using Nonce.
529
-	if ( ! check_ajax_referer( 'give_ajax_nonce', 'nonce' ) ) {
529
+	if ( ! check_ajax_referer('give_ajax_nonce', 'nonce')) {
530 530
 		return false;
531 531
 	}
532 532
 
533 533
 	// Bail Out, if email is empty.
534
-	if ( empty( $_POST['email'] ) ) {
534
+	if (empty($_POST['email'])) {
535 535
 		return false;
536 536
 	}
537 537
 
538
-	$donor = Give()->donors->get_donor_by( 'email', give_clean( $_POST['email'] ) );
539
-	if ( Give()->email_access->can_send_email( $donor->id ) ) {
538
+	$donor = Give()->donors->get_donor_by('email', give_clean($_POST['email']));
539
+	if (Give()->email_access->can_send_email($donor->id)) {
540 540
 		$return     = array();
541
-		$email_sent = Give()->email_access->send_email( $donor->id, $donor->email );
541
+		$email_sent = Give()->email_access->send_email($donor->id, $donor->email);
542 542
 
543
-		if ( ! $email_sent ) {
543
+		if ( ! $email_sent) {
544 544
 			$return['status']  = 'error';
545 545
 			$return['message'] = Give()->notices->print_frontend_notice(
546
-				__( 'Unable to send email. Please try again.', 'give' ),
546
+				__('Unable to send email. Please try again.', 'give'),
547 547
 				false,
548 548
 				'error'
549 549
 			);
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 
552 552
 		$return['status']  = 'success';
553 553
 		$return['message'] = Give()->notices->print_frontend_notice(
554
-			__( 'Please check your email and click on the link to access your complete donation history.', 'give' ),
554
+			__('Please check your email and click on the link to access your complete donation history.', 'give'),
555 555
 			false,
556 556
 			'success'
557 557
 		);
@@ -562,16 +562,16 @@  discard block
 block discarded – undo
562 562
 		$return['status']  = 'error';
563 563
 		$return['message'] = Give()->notices->print_frontend_notice(
564 564
 			sprintf(
565
-				__( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ),
566
-				sprintf( _n( '%s minute', '%s minutes', $value, 'give' ), $value )
565
+				__('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'),
566
+				sprintf(_n('%s minute', '%s minutes', $value, 'give'), $value)
567 567
 			),
568 568
 			false,
569 569
 			'error'
570 570
 		);
571 571
 	}
572 572
 
573
-	echo json_encode( $return );
573
+	echo json_encode($return);
574 574
 	give_die();
575 575
 }
576 576
 
577
-add_action( 'wp_ajax_nopriv_give_confirm_email_for_donations_access', 'give_confirm_email_for_donation_access' );
578 577
\ No newline at end of file
578
+add_action('wp_ajax_nopriv_give_confirm_email_for_donations_access', 'give_confirm_email_for_donation_access');
579 579
\ No newline at end of file
Please login to merge, or discard this patch.
includes/class-give-email-access.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@
 block discarded – undo
242 242
 	 * @since  1.0
243 243
 	 * @access public
244 244
 	 *
245
-	 * @return bool
245
+	 * @return boolean|null
246 246
 	 */
247 247
 	public function check_for_token() {
248 248
 
Please login to merge, or discard this patch.
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	public function __construct() {
107 107
 
108 108
 		// get it started
109
-		add_action( 'init', array( $this, 'init' ) );
109
+		add_action('init', array($this, 'init'));
110 110
 	}
111 111
 
112 112
 	/**
@@ -122,28 +122,28 @@  discard block
 block discarded – undo
122 122
 	public function init() {
123 123
 
124 124
 		// Bail Out, if user is logged in.
125
-		if ( is_user_logged_in() ) {
125
+		if (is_user_logged_in()) {
126 126
 			return;
127 127
 		}
128 128
 
129 129
 		// Are db columns setup?
130
-		$column_exists = Give()->donors->does_column_exist( 'token' );
131
-		if ( ! $column_exists ) {
130
+		$column_exists = Give()->donors->does_column_exist('token');
131
+		if ( ! $column_exists) {
132 132
 			$this->create_columns();
133 133
 		}
134 134
 
135 135
 		// Timeouts.
136
-		$this->verify_throttle  = apply_filters( 'give_nl_verify_throttle', 300 );
137
-		$this->limit_throttle   = apply_filters( 'give_nl_limit_throttle', 3 );
138
-		$this->token_expiration = apply_filters( 'give_nl_token_expiration', 7200 );
136
+		$this->verify_throttle  = apply_filters('give_nl_verify_throttle', 300);
137
+		$this->limit_throttle   = apply_filters('give_nl_limit_throttle', 3);
138
+		$this->token_expiration = apply_filters('give_nl_token_expiration', 7200);
139 139
 
140 140
 		// Setup login.
141 141
 		$this->check_for_token();
142 142
 
143
-		if ( $this->token_exists ) {
144
-			add_filter( 'give_can_view_receipt', '__return_true' );
145
-			add_filter( 'give_user_pending_verification', '__return_false' );
146
-			add_filter( 'give_get_users_donations_args', array( $this, 'users_donations_args' ) );
143
+		if ($this->token_exists) {
144
+			add_filter('give_can_view_receipt', '__return_true');
145
+			add_filter('give_user_pending_verification', '__return_false');
146
+			add_filter('give_get_users_donations_args', array($this, 'users_donations_args'));
147 147
 		}
148 148
 
149 149
 	}
@@ -158,23 +158,23 @@  discard block
 block discarded – undo
158 158
 	 *
159 159
 	 * @return bool
160 160
 	 */
161
-	public function can_send_email( $donor_id ) {
161
+	public function can_send_email($donor_id) {
162 162
 
163
-		$donor = Give()->donors->get_donor_by( 'id', $donor_id );
163
+		$donor = Give()->donors->get_donor_by('id', $donor_id);
164 164
 
165
-		if ( is_object( $donor ) && count( $donor ) > 0 ) {
165
+		if (is_object($donor) && count($donor) > 0) {
166 166
 
167
-			$email_throttle_count = (int) give_get_meta( $donor_id, '_give_email_throttle_count', true );
167
+			$email_throttle_count = (int) give_get_meta($donor_id, '_give_email_throttle_count', true);
168 168
 
169 169
 			$cache_key = "give_cache_email_throttle_limit_exhausted_{$donor_id}";
170 170
 			if (
171 171
 				$email_throttle_count < $this->limit_throttle &&
172
-				true !== Give_Cache::get( $cache_key )
172
+				true !== Give_Cache::get($cache_key)
173 173
 			) {
174
-				give_update_meta( $donor_id, '_give_email_throttle_count', $email_throttle_count + 1 );
174
+				give_update_meta($donor_id, '_give_email_throttle_count', $email_throttle_count + 1);
175 175
 			} else {
176
-				give_update_meta( $donor_id, '_give_email_throttle_count', 0 );
177
-				Give_Cache::set( $cache_key, true, $this->verify_throttle );
176
+				give_update_meta($donor_id, '_give_email_throttle_count', 0);
177
+				Give_Cache::set($cache_key, true, $this->verify_throttle);
178 178
 				return false;
179 179
 			}
180 180
 
@@ -194,45 +194,45 @@  discard block
 block discarded – undo
194 194
 	 *
195 195
 	 * @return bool
196 196
 	 */
197
-	public function send_email( $customer_id, $email ) {
197
+	public function send_email($customer_id, $email) {
198 198
 
199
-		$verify_key = wp_generate_password( 20, false );
199
+		$verify_key = wp_generate_password(20, false);
200 200
 
201 201
 		// Generate a new verify key
202
-		$this->set_verify_key( $customer_id, $email, $verify_key );
202
+		$this->set_verify_key($customer_id, $email, $verify_key);
203 203
 
204
-		$access_url = add_query_arg( array(
204
+		$access_url = add_query_arg(array(
205 205
 			'give_nl' => $verify_key,
206
-		), give_get_history_page_uri() );
206
+		), give_get_history_page_uri());
207 207
 
208
-		if ( ! empty( $_GET['payment_key'] ) ) {
209
-			$access_url = add_query_arg( array(
210
-				'payment_key' => give_clean( $_GET['payment_key'] ),
211
-			), $access_url );
208
+		if ( ! empty($_GET['payment_key'])) {
209
+			$access_url = add_query_arg(array(
210
+				'payment_key' => give_clean($_GET['payment_key']),
211
+			), $access_url);
212 212
 		}
213 213
 
214 214
 		// Nice subject and message.
215
-		$subject = apply_filters( 'give_email_access_token_subject', sprintf( __( 'Please confirm your email for %s', 'give' ), get_bloginfo( 'url' ) ) );
215
+		$subject = apply_filters('give_email_access_token_subject', sprintf(__('Please confirm your email for %s', 'give'), get_bloginfo('url')));
216 216
 
217 217
 		$message = sprintf(
218
-			__( 'Please click the link to access your donation history on <a target="_blank" href="%1$s">%1$s</a>. If you did not request this email, please contact <a href="mailto:%2$s">%2$s</a>.', 'give' ),
219
-			get_bloginfo( 'url' ),
220
-			get_bloginfo( 'admin_email' )
221
-		) . "\n\n";
218
+			__('Please click the link to access your donation history on <a target="_blank" href="%1$s">%1$s</a>. If you did not request this email, please contact <a href="mailto:%2$s">%2$s</a>.', 'give'),
219
+			get_bloginfo('url'),
220
+			get_bloginfo('admin_email')
221
+		)."\n\n";
222 222
 		$message .= sprintf(
223
-			__( '<a href="%s" target="_blank">%s</a>', 'give' ),
224
-			esc_url( $access_url ),
225
-			__( 'View your donation history &raquo;', 'give' )
226
-		) . "\n\n";
223
+			__('<a href="%s" target="_blank">%s</a>', 'give'),
224
+			esc_url($access_url),
225
+			__('View your donation history &raquo;', 'give')
226
+		)."\n\n";
227 227
 		$message .= "\n\n";
228
-		$message .= __( 'Sincerely,', 'give' ) . "\n";
229
-		$message .= get_bloginfo( 'name' ) . "\n";
228
+		$message .= __('Sincerely,', 'give')."\n";
229
+		$message .= get_bloginfo('name')."\n";
230 230
 
231
-		$message = apply_filters( 'give_email_access_token_message', $message );
231
+		$message = apply_filters('give_email_access_token_message', $message);
232 232
 
233 233
 		// Send the email.
234
-		Give()->emails->__set( 'heading', apply_filters( 'give_email_access_token_heading', __( 'Confirm Email', 'give' ) ) );
235
-		return Give()->emails->send( $email, $subject, $message );
234
+		Give()->emails->__set('heading', apply_filters('give_email_access_token_heading', __('Confirm Email', 'give')));
235
+		return Give()->emails->send($email, $subject, $message);
236 236
 
237 237
 	}
238 238
 
@@ -246,28 +246,28 @@  discard block
 block discarded – undo
246 246
 	 */
247 247
 	public function check_for_token() {
248 248
 
249
-		$token = isset( $_GET['give_nl'] ) ? $_GET['give_nl'] : '';
249
+		$token = isset($_GET['give_nl']) ? $_GET['give_nl'] : '';
250 250
 
251 251
 		// Check for cookie.
252
-		if ( empty( $token ) ) {
253
-			$token = isset( $_COOKIE['give_nl'] ) ? $_COOKIE['give_nl'] : '';
252
+		if (empty($token)) {
253
+			$token = isset($_COOKIE['give_nl']) ? $_COOKIE['give_nl'] : '';
254 254
 		}
255 255
 
256 256
 		// Must have a token.
257
-		if ( ! empty( $token ) ) {
257
+		if ( ! empty($token)) {
258 258
 
259
-			if ( ! $this->is_valid_token( $token ) ) {
260
-				if ( ! $this->is_valid_verify_key( $token ) ) {
259
+			if ( ! $this->is_valid_token($token)) {
260
+				if ( ! $this->is_valid_verify_key($token)) {
261 261
 					return false;
262 262
 				}
263 263
 			}
264 264
 
265 265
 			// Set Receipt Access Session.
266
-			Give()->session->set( 'receipt_access', true );
266
+			Give()->session->set('receipt_access', true);
267 267
 			$this->token_exists = true;
268 268
 			// Set cookie.
269
-			$lifetime = current_time( 'timestamp' ) + Give()->session->set_expiration_time();
270
-			@setcookie( 'give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false );
269
+			$lifetime = current_time('timestamp') + Give()->session->set_expiration_time();
270
+			@setcookie('give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false);
271 271
 
272 272
 			return true;
273 273
 		}
@@ -283,26 +283,26 @@  discard block
 block discarded – undo
283 283
 	 *
284 284
 	 * @return bool
285 285
 	 */
286
-	public function is_valid_token( $token ) {
286
+	public function is_valid_token($token) {
287 287
 
288 288
 		global $wpdb;
289 289
 
290 290
 		// Make sure token isn't expired.
291
-		$expires = date( 'Y-m-d H:i:s', time() - $this->token_expiration );
291
+		$expires = date('Y-m-d H:i:s', time() - $this->token_expiration);
292 292
 
293 293
 		$email = $wpdb->get_var(
294
-			$wpdb->prepare( "SELECT email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s AND verify_throttle >= %s LIMIT 1", $token, $expires )
294
+			$wpdb->prepare("SELECT email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s AND verify_throttle >= %s LIMIT 1", $token, $expires)
295 295
 		);
296 296
 
297
-		if ( ! empty( $email ) ) {
297
+		if ( ! empty($email)) {
298 298
 			$this->token_email = $email;
299 299
 			$this->token       = $token;
300 300
 			return true;
301 301
 		}
302 302
 
303 303
 		// Set error only if email access form isn't being submitted.
304
-		if ( ! isset( $_POST['give_email'] ) && ! isset( $_POST['_wpnonce'] ) ) {
305
-			give_set_error( 'give_email_token_expired', apply_filters( 'give_email_token_expired_message', __( 'Your access token has expired. Please request a new one below:', 'give' ) ) );
304
+		if ( ! isset($_POST['give_email']) && ! isset($_POST['_wpnonce'])) {
305
+			give_set_error('give_email_token_expired', apply_filters('give_email_token_expired_message', __('Your access token has expired. Please request a new one below:', 'give')));
306 306
 		}
307 307
 
308 308
 		return false;
@@ -321,25 +321,25 @@  discard block
 block discarded – undo
321 321
 	 *
322 322
 	 * @return void
323 323
 	 */
324
-	public function set_verify_key( $customer_id, $email, $verify_key ) {
324
+	public function set_verify_key($customer_id, $email, $verify_key) {
325 325
 		global $wpdb;
326 326
 
327
-		$now = date( 'Y-m-d H:i:s' );
327
+		$now = date('Y-m-d H:i:s');
328 328
 
329 329
 		// Insert or update?
330 330
 		$row_id = (int) $wpdb->get_var(
331
-			$wpdb->prepare( "SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d LIMIT 1", $customer_id )
331
+			$wpdb->prepare("SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d LIMIT 1", $customer_id)
332 332
 		);
333 333
 
334 334
 		// Update.
335
-		if ( ! empty( $row_id ) ) {
335
+		if ( ! empty($row_id)) {
336 336
 			$wpdb->query(
337
-				$wpdb->prepare( "UPDATE {$wpdb->prefix}give_customers SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id )
337
+				$wpdb->prepare("UPDATE {$wpdb->prefix}give_customers SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id)
338 338
 			);
339 339
 		} // Insert.
340 340
 		else {
341 341
 			$wpdb->query(
342
-				$wpdb->prepare( "INSERT INTO {$wpdb->prefix}give_customers ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now )
342
+				$wpdb->prepare("INSERT INTO {$wpdb->prefix}give_customers ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now)
343 343
 			);
344 344
 		}
345 345
 	}
@@ -354,21 +354,21 @@  discard block
 block discarded – undo
354 354
 	 *
355 355
 	 * @return bool
356 356
 	 */
357
-	public function is_valid_verify_key( $token ) {
357
+	public function is_valid_verify_key($token) {
358 358
 		/* @var WPDB $wpdb */
359 359
 		global $wpdb;
360 360
 
361 361
 		// See if the verify_key exists.
362 362
 		$row = $wpdb->get_row(
363
-			$wpdb->prepare( "SELECT id, email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s LIMIT 1", $token )
363
+			$wpdb->prepare("SELECT id, email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s LIMIT 1", $token)
364 364
 		);
365 365
 
366
-		$now = date( 'Y-m-d H:i:s' );
366
+		$now = date('Y-m-d H:i:s');
367 367
 
368 368
 		// Set token and remove verify key.
369
-		if ( ! empty( $row ) ) {
369
+		if ( ! empty($row)) {
370 370
 			$wpdb->query(
371
-				$wpdb->prepare( "UPDATE {$wpdb->prefix}give_customers SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id )
371
+				$wpdb->prepare("UPDATE {$wpdb->prefix}give_customers SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id)
372 372
 			);
373 373
 
374 374
 			$this->token_email = $row->email;
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	 *
393 393
 	 * @return mixed
394 394
 	 */
395
-	public function users_donations_args( $args ) {
395
+	public function users_donations_args($args) {
396 396
 		$args['user'] = $this->token_email;
397 397
 
398 398
 		return $args;
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 		global $wpdb;
414 414
 
415 415
 		// Create columns in customers table.
416
-		$wpdb->query( "ALTER TABLE {$wpdb->prefix}give_customers ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`" );
416
+		$wpdb->query("ALTER TABLE {$wpdb->prefix}give_customers ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`");
417 417
 
418 418
 	}
419 419
 
Please login to merge, or discard this patch.
includes/forms/functions.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
  *
156 156
  * Used to redirect a user back to the donation form if there are errors present.
157 157
  *
158
- * @param array $args
158
+ * @param string $args
159 159
  *
160 160
  * @access public
161 161
  * @since  1.0
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
  * @since  1.0
302 302
  * @since  1.8.16 Add security check
303 303
  *
304
- * @return bool
304
+ * @return false|null
305 305
  */
306 306
 function give_listen_for_failed_payments() {
307 307
 
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
  *
750 750
  * @param int $form_id ID number of the form to retrieve the minimum price for
751 751
  *
752
- * @return mixed string|int Minimum price of the form
752
+ * @return string string|int Minimum price of the form
753 753
  */
754 754
 function give_get_form_minimum_price( $form_id = 0 ) {
755 755
 
Please login to merge, or discard this patch.
Spacing   +218 added lines, -220 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,14 +23,14 @@  discard block
 block discarded – undo
23 23
 
24 24
 	global $typenow;
25 25
 
26
-	if ( $typenow != 'give_forms' ) {
26
+	if ($typenow != 'give_forms') {
27 27
 		return true;
28 28
 	}
29 29
 
30 30
 	return false;
31 31
 }
32 32
 
33
-add_filter( 'give_shortcode_button_condition', 'give_shortcode_button_condition' );
33
+add_filter('give_shortcode_button_condition', 'give_shortcode_button_condition');
34 34
 
35 35
 
36 36
 /**
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
  *
41 41
  * @return int|false
42 42
  */
43
-function get_form_id_from_args( $args ) {
43
+function get_form_id_from_args($args) {
44 44
 
45
-	if ( isset( $args['form_id'] ) && $args['form_id'] != 0 ) {
45
+	if (isset($args['form_id']) && $args['form_id'] != 0) {
46 46
 
47
-		return intval( $args['form_id'] );
47
+		return intval($args['form_id']);
48 48
 	}
49 49
 
50 50
 	return false;
@@ -59,23 +59,23 @@  discard block
 block discarded – undo
59 59
  *
60 60
  * @return bool
61 61
  */
62
-function give_is_float_labels_enabled( $args ) {
62
+function give_is_float_labels_enabled($args) {
63 63
 
64 64
 	$float_labels = '';
65 65
 
66
-	if ( ! empty( $args['float_labels'] ) ) {
66
+	if ( ! empty($args['float_labels'])) {
67 67
 		$float_labels = $args['float_labels'];
68 68
 	}
69 69
 
70
-	if ( empty( $float_labels ) ) {
71
-		$float_labels = give_get_meta( $args['form_id'], '_give_form_floating_labels', true );
70
+	if (empty($float_labels)) {
71
+		$float_labels = give_get_meta($args['form_id'], '_give_form_floating_labels', true);
72 72
 	}
73 73
 
74
-	if ( empty( $float_labels ) || ( 'global' === $float_labels ) ) {
75
-		$float_labels = give_get_option( 'floatlabels', 'disabled' );
74
+	if (empty($float_labels) || ('global' === $float_labels)) {
75
+		$float_labels = give_get_option('floatlabels', 'disabled');
76 76
 	}
77 77
 
78
-	return give_is_setting_enabled( $float_labels );
78
+	return give_is_setting_enabled($float_labels);
79 79
 }
80 80
 
81 81
 /**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 	$can_checkout = true;
93 93
 
94
-	return (bool) apply_filters( 'give_can_checkout', $can_checkout );
94
+	return (bool) apply_filters('give_can_checkout', $can_checkout);
95 95
 }
96 96
 
97 97
 /**
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 function give_get_success_page_uri() {
106 106
 	$give_options = give_get_settings();
107 107
 
108
-	$success_page = isset( $give_options['success_page'] ) ? get_permalink( absint( $give_options['success_page'] ) ) : get_bloginfo( 'url' );
108
+	$success_page = isset($give_options['success_page']) ? get_permalink(absint($give_options['success_page'])) : get_bloginfo('url');
109 109
 
110
-	return apply_filters( 'give_get_success_page_uri', $success_page );
110
+	return apply_filters('give_get_success_page_uri', $success_page);
111 111
 }
112 112
 
113 113
 /**
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function give_is_success_page() {
121 121
 	$give_options    = give_get_settings();
122
-	$is_success_page = isset( $give_options['success_page'] ) ? is_page( $give_options['success_page'] ) : false;
122
+	$is_success_page = isset($give_options['success_page']) ? is_page($give_options['success_page']) : false;
123 123
 
124
-	return apply_filters( 'give_is_success_page', $is_success_page );
124
+	return apply_filters('give_is_success_page', $is_success_page);
125 125
 }
126 126
 
127 127
 /**
@@ -135,17 +135,17 @@  discard block
 block discarded – undo
135 135
  * @since       1.0
136 136
  * @return      void
137 137
  */
138
-function give_send_to_success_page( $query_string = null ) {
138
+function give_send_to_success_page($query_string = null) {
139 139
 
140 140
 	$redirect = give_get_success_page_uri();
141 141
 
142
-	if ( $query_string ) {
142
+	if ($query_string) {
143 143
 		$redirect .= $query_string;
144 144
 	}
145 145
 
146
-	$gateway = isset( $_REQUEST['give-gateway'] ) ? $_REQUEST['give-gateway'] : '';
146
+	$gateway = isset($_REQUEST['give-gateway']) ? $_REQUEST['give-gateway'] : '';
147 147
 
148
-	wp_redirect( apply_filters( 'give_success_page_redirect', $redirect, $gateway, $query_string ) );
148
+	wp_redirect(apply_filters('give_success_page_redirect', $redirect, $gateway, $query_string));
149 149
 	give_die();
150 150
 }
151 151
 
@@ -161,19 +161,19 @@  discard block
 block discarded – undo
161 161
  * @since  1.0
162 162
  * @return Void
163 163
  */
164
-function give_send_back_to_checkout( $args = array() ) {
164
+function give_send_back_to_checkout($args = array()) {
165 165
 
166
-	$url     = isset( $_POST['give-current-url'] ) ? sanitize_text_field( $_POST['give-current-url'] ) : '';
166
+	$url     = isset($_POST['give-current-url']) ? sanitize_text_field($_POST['give-current-url']) : '';
167 167
 	$form_id = 0;
168 168
 
169 169
 	// Set the form_id.
170
-	if ( isset( $_POST['give-form-id'] ) ) {
171
-		$form_id = sanitize_text_field( $_POST['give-form-id'] );
170
+	if (isset($_POST['give-form-id'])) {
171
+		$form_id = sanitize_text_field($_POST['give-form-id']);
172 172
 	}
173 173
 
174 174
 	// Need a URL to continue. If none, redirect back to single form.
175
-	if ( empty( $url ) ) {
176
-		wp_safe_redirect( get_permalink( $form_id ) );
175
+	if (empty($url)) {
176
+		wp_safe_redirect(get_permalink($form_id));
177 177
 		give_die();
178 178
 	}
179 179
 
@@ -182,41 +182,41 @@  discard block
 block discarded – undo
182 182
 	);
183 183
 
184 184
 	// Set the $level_id.
185
-	if ( isset( $_POST['give-price-id'] ) ) {
186
-		$defaults['level-id'] = sanitize_text_field( $_POST['give-price-id'] );
185
+	if (isset($_POST['give-price-id'])) {
186
+		$defaults['level-id'] = sanitize_text_field($_POST['give-price-id']);
187 187
 	}
188 188
 
189 189
 	// Check for backward compatibility.
190
-	if ( is_string( $args ) ) {
191
-		$args = str_replace( '?', '', $args );
190
+	if (is_string($args)) {
191
+		$args = str_replace('?', '', $args);
192 192
 	}
193 193
 
194
-	$args = wp_parse_args( $args, $defaults );
194
+	$args = wp_parse_args($args, $defaults);
195 195
 
196 196
 	// Merge URL query with $args to maintain third-party URL parameters after redirect.
197
-	$url_data = wp_parse_url( $url );
197
+	$url_data = wp_parse_url($url);
198 198
 
199 199
 	// Check if an array to prevent notices before parsing.
200
-	if ( isset( $url_data['query'] ) && ! empty( $url_data['query'] ) ) {
201
-		parse_str( $url_data['query'], $query );
200
+	if (isset($url_data['query']) && ! empty($url_data['query'])) {
201
+		parse_str($url_data['query'], $query);
202 202
 
203 203
 		// Precaution: don't allow any CC info.
204
-		unset( $query['card_number'] );
205
-		unset( $query['card_cvc'] );
204
+		unset($query['card_number']);
205
+		unset($query['card_cvc']);
206 206
 
207 207
 	} else {
208 208
 		// No $url_data so pass empty array.
209 209
 		$query = array();
210 210
 	}
211 211
 
212
-	$new_query        = array_merge( $args, $query );
213
-	$new_query_string = http_build_query( $new_query );
212
+	$new_query        = array_merge($args, $query);
213
+	$new_query_string = http_build_query($new_query);
214 214
 
215 215
 	// Assemble URL parts.
216
-	$redirect = home_url( '/' . $url_data['path'] . '?' . $new_query_string . '#give-form-' . $form_id . '-wrap' );
216
+	$redirect = home_url('/'.$url_data['path'].'?'.$new_query_string.'#give-form-'.$form_id.'-wrap');
217 217
 
218 218
 	// Redirect them.
219
-	wp_safe_redirect( apply_filters( 'give_send_back_to_checkout', $redirect, $args ) );
219
+	wp_safe_redirect(apply_filters('give_send_back_to_checkout', $redirect, $args));
220 220
 	give_die();
221 221
 
222 222
 }
@@ -232,16 +232,16 @@  discard block
 block discarded – undo
232 232
  * @since       1.0
233 233
  * @return      string
234 234
  */
235
-function give_get_success_page_url( $query_string = null ) {
235
+function give_get_success_page_url($query_string = null) {
236 236
 
237
-	$success_page = give_get_option( 'success_page', 0 );
238
-	$success_page = get_permalink( $success_page );
237
+	$success_page = give_get_option('success_page', 0);
238
+	$success_page = get_permalink($success_page);
239 239
 
240
-	if ( $query_string ) {
240
+	if ($query_string) {
241 241
 		$success_page .= $query_string;
242 242
 	}
243 243
 
244
-	return apply_filters( 'give_success_page_url', $success_page );
244
+	return apply_filters('give_success_page_url', $success_page);
245 245
 
246 246
 }
247 247
 
@@ -254,32 +254,31 @@  discard block
 block discarded – undo
254 254
  *
255 255
  * @return mixed Full URL to the Failed Donation Page, if present, home page if it doesn't exist.
256 256
  */
257
-function give_get_failed_transaction_uri( $extras = false ) {
257
+function give_get_failed_transaction_uri($extras = false) {
258 258
 	$give_options = give_get_settings();
259 259
 
260 260
 	// Remove question mark.
261
-	if ( 0 === strpos( $extras, '?' ) ) {
262
-		$extras = substr( $extras, 1 );
261
+	if (0 === strpos($extras, '?')) {
262
+		$extras = substr($extras, 1);
263 263
 	}
264 264
 
265
-	$extras_args = wp_parse_args( $extras );
265
+	$extras_args = wp_parse_args($extras);
266 266
 
267 267
 	// Set nonce if payment id exist in extra params.
268
-	if ( array_key_exists( 'payment-id', $extras_args ) ) {
269
-		$extras_args['_wpnonce'] = wp_create_nonce( "give-failed-donation-{$extras_args['payment-id']}" );
270
-		$extras                  = http_build_query( $extras_args );
268
+	if (array_key_exists('payment-id', $extras_args)) {
269
+		$extras_args['_wpnonce'] = wp_create_nonce("give-failed-donation-{$extras_args['payment-id']}");
270
+		$extras                  = http_build_query($extras_args);
271 271
 	}
272 272
 
273
-	$uri = ! empty( $give_options['failure_page'] ) ?
274
-		trailingslashit( get_permalink( $give_options['failure_page'] ) ) :
275
-		home_url();
273
+	$uri = ! empty($give_options['failure_page']) ?
274
+		trailingslashit(get_permalink($give_options['failure_page'])) : home_url();
276 275
 
277 276
 
278
-	if ( $extras ) {
277
+	if ($extras) {
279 278
 		$uri .= "?{$extras}";
280 279
 	}
281 280
 
282
-	return apply_filters( 'give_get_failed_transaction_uri', $uri );
281
+	return apply_filters('give_get_failed_transaction_uri', $uri);
283 282
 }
284 283
 
285 284
 /**
@@ -290,9 +289,9 @@  discard block
 block discarded – undo
290 289
  */
291 290
 function give_is_failed_transaction_page() {
292 291
 	$give_options = give_get_settings();
293
-	$ret          = isset( $give_options['failure_page'] ) ? is_page( $give_options['failure_page'] ) : false;
292
+	$ret          = isset($give_options['failure_page']) ? is_page($give_options['failure_page']) : false;
294 293
 
295
-	return apply_filters( 'give_is_failure_page', $ret );
294
+	return apply_filters('give_is_failure_page', $ret);
296 295
 }
297 296
 
298 297
 /**
@@ -305,25 +304,25 @@  discard block
 block discarded – undo
305 304
  */
306 305
 function give_listen_for_failed_payments() {
307 306
 
308
-	$failed_page = give_get_option( 'failure_page', 0 );
309
-	$payment_id  = ! empty( $_GET['payment-id'] ) ? absint( $_GET['payment-id'] ) : 0;
310
-	$nonce       = ! empty( $_GET['_wpnonce'] ) ? give_clean( $_GET['_wpnonce'] ) : false;
307
+	$failed_page = give_get_option('failure_page', 0);
308
+	$payment_id  = ! empty($_GET['payment-id']) ? absint($_GET['payment-id']) : 0;
309
+	$nonce       = ! empty($_GET['_wpnonce']) ? give_clean($_GET['_wpnonce']) : false;
311 310
 
312 311
 	// Bailout.
313
-	if ( ! $failed_page || ! is_page( $failed_page ) || ! $payment_id || ! $nonce ) {
312
+	if ( ! $failed_page || ! is_page($failed_page) || ! $payment_id || ! $nonce) {
314 313
 		return false;
315 314
 	}
316 315
 
317 316
 	// Security check.
318
-	if ( ! wp_verify_nonce( $nonce, "give-failed-donation-{$payment_id}" ) ) {
319
-		wp_die( __( 'Nonce verification failed.', 'give' ), __( 'Error', 'give' ) );
317
+	if ( ! wp_verify_nonce($nonce, "give-failed-donation-{$payment_id}")) {
318
+		wp_die(__('Nonce verification failed.', 'give'), __('Error', 'give'));
320 319
 	}
321 320
 
322 321
 	// Set payment status to failure
323
-	give_update_payment_status( $payment_id, 'failed' );
322
+	give_update_payment_status($payment_id, 'failed');
324 323
 }
325 324
 
326
-add_action( 'template_redirect', 'give_listen_for_failed_payments' );
325
+add_action('template_redirect', 'give_listen_for_failed_payments');
327 326
 
328 327
 /**
329 328
  * Retrieve the Donation History page URI
@@ -336,9 +335,9 @@  discard block
 block discarded – undo
336 335
 function give_get_history_page_uri() {
337 336
 	$give_options = give_get_settings();
338 337
 
339
-	$history_page = isset( $give_options['history_page'] ) ? get_permalink( absint( $give_options['history_page'] ) ) : get_bloginfo( 'url' );
338
+	$history_page = isset($give_options['history_page']) ? get_permalink(absint($give_options['history_page'])) : get_bloginfo('url');
340 339
 
341
-	return apply_filters( 'give_get_history_page_uri', $history_page );
340
+	return apply_filters('give_get_history_page_uri', $history_page);
342 341
 }
343 342
 
344 343
 /**
@@ -351,11 +350,11 @@  discard block
 block discarded – undo
351 350
  * @since       1.0
352 351
  * @return      bool
353 352
  */
354
-function give_field_is_required( $field = '', $form_id ) {
353
+function give_field_is_required($field = '', $form_id) {
355 354
 
356
-	$required_fields = give_get_required_fields( $form_id );
355
+	$required_fields = give_get_required_fields($form_id);
357 356
 
358
-	return array_key_exists( $field, $required_fields );
357
+	return array_key_exists($field, $required_fields);
359 358
 }
360 359
 
361 360
 /**
@@ -373,14 +372,14 @@  discard block
 block discarded – undo
373 372
  *
374 373
  * @return void
375 374
  */
376
-function give_record_donation_in_log( $give_form_id = 0, $payment_id, $price_id = false, $donation_date = null ) {
375
+function give_record_donation_in_log($give_form_id = 0, $payment_id, $price_id = false, $donation_date = null) {
377 376
 	global $give_logs;
378 377
 
379 378
 	$log_data = array(
380 379
 		'post_parent'   => $give_form_id,
381 380
 		'log_type'      => 'sale',
382
-		'post_date'     => isset( $donation_date ) ? $donation_date : null,
383
-		'post_date_gmt' => isset( $donation_date ) ? $donation_date : null,
381
+		'post_date'     => isset($donation_date) ? $donation_date : null,
382
+		'post_date_gmt' => isset($donation_date) ? $donation_date : null,
384 383
 	);
385 384
 
386 385
 	$log_meta = array(
@@ -388,7 +387,7 @@  discard block
 block discarded – undo
388 387
 		'price_id'   => (int) $price_id,
389 388
 	);
390 389
 
391
-	$give_logs->insert_log( $log_data, $log_meta );
390
+	$give_logs->insert_log($log_data, $log_meta);
392 391
 }
393 392
 
394 393
 
@@ -402,11 +401,11 @@  discard block
 block discarded – undo
402 401
  *
403 402
  * @return bool|int
404 403
  */
405
-function give_increase_donation_count( $form_id = 0, $quantity = 1 ) {
404
+function give_increase_donation_count($form_id = 0, $quantity = 1) {
406 405
 	$quantity = (int) $quantity;
407
-	$form     = new Give_Donate_Form( $form_id );
406
+	$form     = new Give_Donate_Form($form_id);
408 407
 
409
-	return $form->increase_sales( $quantity );
408
+	return $form->increase_sales($quantity);
410 409
 }
411 410
 
412 411
 /**
@@ -419,11 +418,11 @@  discard block
 block discarded – undo
419 418
  *
420 419
  * @return bool|int
421 420
  */
422
-function give_decrease_donation_count( $form_id = 0, $quantity = 1 ) {
421
+function give_decrease_donation_count($form_id = 0, $quantity = 1) {
423 422
 	$quantity = (int) $quantity;
424
-	$form     = new Give_Donate_Form( $form_id );
423
+	$form     = new Give_Donate_Form($form_id);
425 424
 
426
-	return $form->decrease_sales( $quantity );
425
+	return $form->decrease_sales($quantity);
427 426
 }
428 427
 
429 428
 /**
@@ -436,10 +435,10 @@  discard block
 block discarded – undo
436 435
  *
437 436
  * @return bool|int
438 437
  */
439
-function give_increase_earnings( $give_form_id = 0, $amount ) {
440
-	$form = new Give_Donate_Form( $give_form_id );
438
+function give_increase_earnings($give_form_id = 0, $amount) {
439
+	$form = new Give_Donate_Form($give_form_id);
441 440
 
442
-	return $form->increase_earnings( $amount );
441
+	return $form->increase_earnings($amount);
443 442
 }
444 443
 
445 444
 /**
@@ -454,11 +453,11 @@  discard block
 block discarded – undo
454 453
  *
455 454
  * @return bool|int
456 455
  */
457
-function give_decrease_form_earnings( $form_id = 0, $amount ) {
456
+function give_decrease_form_earnings($form_id = 0, $amount) {
458 457
 
459
-	$form = new Give_Donate_Form( $form_id );
458
+	$form = new Give_Donate_Form($form_id);
460 459
 
461
-	return $form->decrease_earnings( $amount );
460
+	return $form->decrease_earnings($amount);
462 461
 }
463 462
 
464 463
 
@@ -471,15 +470,15 @@  discard block
 block discarded – undo
471 470
  *
472 471
  * @return int $earnings Earnings for a certain form
473 472
  */
474
-function give_get_form_earnings_stats( $form_id = 0 ) {
475
-	$give_form = new Give_Donate_Form( $form_id );
473
+function give_get_form_earnings_stats($form_id = 0) {
474
+	$give_form = new Give_Donate_Form($form_id);
476 475
 
477 476
 	/**
478 477
 	 * Filter the form earnings
479 478
 	 *
480 479
 	 * @since 1.8.17
481 480
 	 */
482
-	return apply_filters( 'give_get_form_earnings_stats', $give_form->earnings, $form_id, $give_form );
481
+	return apply_filters('give_get_form_earnings_stats', $give_form->earnings, $form_id, $give_form);
483 482
 }
484 483
 
485 484
 
@@ -492,8 +491,8 @@  discard block
 block discarded – undo
492 491
  *
493 492
  * @return int $sales Amount of sales for a certain form
494 493
  */
495
-function give_get_form_sales_stats( $give_form_id = 0 ) {
496
-	$give_form = new Give_Donate_Form( $give_form_id );
494
+function give_get_form_sales_stats($give_form_id = 0) {
495
+	$give_form = new Give_Donate_Form($give_form_id);
497 496
 
498 497
 	return $give_form->sales;
499 498
 }
@@ -508,16 +507,16 @@  discard block
 block discarded – undo
508 507
  *
509 508
  * @return float $sales Average monthly sales
510 509
  */
511
-function give_get_average_monthly_form_sales( $form_id = 0 ) {
512
-	$sales        = give_get_form_sales_stats( $form_id );
513
-	$release_date = get_post_field( 'post_date', $form_id );
510
+function give_get_average_monthly_form_sales($form_id = 0) {
511
+	$sales        = give_get_form_sales_stats($form_id);
512
+	$release_date = get_post_field('post_date', $form_id);
514 513
 
515
-	$diff = abs( current_time( 'timestamp' ) - strtotime( $release_date ) );
514
+	$diff = abs(current_time('timestamp') - strtotime($release_date));
516 515
 
517
-	$months = floor( $diff / ( 30 * 60 * 60 * 24 ) ); // Number of months since publication
516
+	$months = floor($diff / (30 * 60 * 60 * 24)); // Number of months since publication
518 517
 
519
-	if ( $months > 0 ) {
520
-		$sales = ( $sales / $months );
518
+	if ($months > 0) {
519
+		$sales = ($sales / $months);
521 520
 	}
522 521
 
523 522
 	return $sales;
@@ -533,16 +532,16 @@  discard block
 block discarded – undo
533 532
  *
534 533
  * @return float $earnings Average monthly earnings
535 534
  */
536
-function give_get_average_monthly_form_earnings( $form_id = 0 ) {
537
-	$earnings     = give_get_form_earnings_stats( $form_id );
538
-	$release_date = get_post_field( 'post_date', $form_id );
535
+function give_get_average_monthly_form_earnings($form_id = 0) {
536
+	$earnings     = give_get_form_earnings_stats($form_id);
537
+	$release_date = get_post_field('post_date', $form_id);
539 538
 
540
-	$diff = abs( current_time( 'timestamp' ) - strtotime( $release_date ) );
539
+	$diff = abs(current_time('timestamp') - strtotime($release_date));
541 540
 
542
-	$months = floor( $diff / ( 30 * 60 * 60 * 24 ) ); // Number of months since publication
541
+	$months = floor($diff / (30 * 60 * 60 * 24)); // Number of months since publication
543 542
 
544
-	if ( $months > 0 ) {
545
-		$earnings = ( $earnings / $months );
543
+	if ($months > 0) {
544
+		$earnings = ($earnings / $months);
546 545
 	}
547 546
 
548 547
 	return $earnings < 0 ? 0 : $earnings;
@@ -563,35 +562,34 @@  discard block
 block discarded – undo
563 562
  *
564 563
  * @return string $price_name Name of the price option
565 564
  */
566
-function give_get_price_option_name( $form_id = 0, $price_id = 0, $payment_id = 0, $use_fallback = true ) {
565
+function give_get_price_option_name($form_id = 0, $price_id = 0, $payment_id = 0, $use_fallback = true) {
567 566
 
568
-	$prices     = give_get_variable_prices( $form_id );
567
+	$prices     = give_get_variable_prices($form_id);
569 568
 	$price_name = '';
570 569
 
571
-	if ( false === $prices ) {
570
+	if (false === $prices) {
572 571
 		return $price_name;
573 572
 	}
574 573
 
575
-	foreach ( $prices as $price ) {
574
+	foreach ($prices as $price) {
576 575
 
577
-		if ( intval( $price['_give_id']['level_id'] ) == intval( $price_id ) ) {
576
+		if (intval($price['_give_id']['level_id']) == intval($price_id)) {
578 577
 
579
-			$price_text     = isset( $price['_give_text'] ) ? $price['_give_text'] : '';
578
+			$price_text     = isset($price['_give_text']) ? $price['_give_text'] : '';
580 579
 			$price_fallback = $use_fallback ?
581 580
 				give_currency_filter(
582 581
 					give_format_amount(
583 582
 						$price['_give_amount'],
584
-						array( 'sanitize' => false )
583
+						array('sanitize' => false)
585 584
 					),
586
-					array( 'decode_currency' => true )
587
-				) :
588
-				'';
589
-			$price_name     = ! empty( $price_text ) ? $price_text : $price_fallback;
585
+					array('decode_currency' => true)
586
+				) : '';
587
+			$price_name = ! empty($price_text) ? $price_text : $price_fallback;
590 588
 
591 589
 		}
592 590
 	}
593 591
 
594
-	return apply_filters( 'give_get_price_option_name', $price_name, $form_id, $payment_id, $price_id );
592
+	return apply_filters('give_get_price_option_name', $price_name, $form_id, $payment_id, $price_id);
595 593
 }
596 594
 
597 595
 
@@ -605,25 +603,25 @@  discard block
 block discarded – undo
605 603
  *
606 604
  * @return string $range A fully formatted price range
607 605
  */
608
-function give_price_range( $form_id = 0, $formatted = true ) {
609
-	$low        = give_get_lowest_price_option( $form_id );
610
-	$high       = give_get_highest_price_option( $form_id );
611
-	$order_type = ! empty( $_REQUEST['order'] ) ? $_REQUEST['order'] : 'asc';
606
+function give_price_range($form_id = 0, $formatted = true) {
607
+	$low        = give_get_lowest_price_option($form_id);
608
+	$high       = give_get_highest_price_option($form_id);
609
+	$order_type = ! empty($_REQUEST['order']) ? $_REQUEST['order'] : 'asc';
612 610
 
613 611
 	$range = sprintf(
614 612
 		'<span class="give_price_range_%1$s">%2$s</span><span class="give_price_range_sep">&nbsp;&ndash;&nbsp;</span><span class="give_price_range_%3$s">%4$s</span>',
615 613
 		'asc' === $order_type ? 'low' : 'high',
616
-		'asc' === $order_type ? give_currency_filter( give_format_amount( $low, array( 'sanitize' => false ) ) ) : give_currency_filter( give_format_amount( $high, array( 'sanitize' => false ) ) ),
614
+		'asc' === $order_type ? give_currency_filter(give_format_amount($low, array('sanitize' => false))) : give_currency_filter(give_format_amount($high, array('sanitize' => false))),
617 615
 		'asc' === $order_type ? 'high' : 'low',
618
-		'asc' === $order_type ? give_currency_filter( give_format_amount( $high, array( 'sanitize' => false ) ) ) : give_currency_filter( give_format_amount( $low, array( 'sanitize' => false ) ) )
616
+		'asc' === $order_type ? give_currency_filter(give_format_amount($high, array('sanitize' => false))) : give_currency_filter(give_format_amount($low, array('sanitize' => false)))
619 617
 
620 618
 	);
621 619
 
622
-	if ( ! $formatted ) {
623
-		$range = wp_strip_all_tags( $range );
620
+	if ( ! $formatted) {
621
+		$range = wp_strip_all_tags($range);
624 622
 	}
625 623
 
626
-	return apply_filters( 'give_price_range', $range, $form_id, $low, $high );
624
+	return apply_filters('give_price_range', $range, $form_id, $low, $high);
627 625
 }
628 626
 
629 627
 
@@ -638,35 +636,35 @@  discard block
 block discarded – undo
638 636
  *
639 637
  * @return int ID of the lowest price
640 638
  */
641
-function give_get_lowest_price_id( $form_id = 0 ) {
639
+function give_get_lowest_price_id($form_id = 0) {
642 640
 
643
-	if ( empty( $form_id ) ) {
641
+	if (empty($form_id)) {
644 642
 		$form_id = get_the_ID();
645 643
 	}
646 644
 
647
-	if ( ! give_has_variable_prices( $form_id ) ) {
648
-		return give_get_form_price( $form_id );
645
+	if ( ! give_has_variable_prices($form_id)) {
646
+		return give_get_form_price($form_id);
649 647
 	}
650 648
 
651
-	$prices = give_get_variable_prices( $form_id );
649
+	$prices = give_get_variable_prices($form_id);
652 650
 
653 651
 	$min = $min_id = 0;
654 652
 
655
-	if ( ! empty( $prices ) ) {
653
+	if ( ! empty($prices)) {
656 654
 
657
-		foreach ( $prices as $key => $price ) {
655
+		foreach ($prices as $key => $price) {
658 656
 
659
-			if ( empty( $price['_give_amount'] ) ) {
657
+			if (empty($price['_give_amount'])) {
660 658
 				continue;
661 659
 			}
662 660
 
663
-			if ( ! isset( $min ) ) {
661
+			if ( ! isset($min)) {
664 662
 				$min = $price['_give_amount'];
665 663
 			} else {
666
-				$min = min( $min, $price['_give_amount'] );
664
+				$min = min($min, $price['_give_amount']);
667 665
 			}
668 666
 
669
-			if ( $price['_give_amount'] == $min ) {
667
+			if ($price['_give_amount'] == $min) {
670 668
 				$min_id = $price['_give_id']['level_id'];
671 669
 			}
672 670
 		}
@@ -684,22 +682,22 @@  discard block
 block discarded – undo
684 682
  *
685 683
  * @return float Amount of the lowest price
686 684
  */
687
-function give_get_lowest_price_option( $form_id = 0 ) {
688
-	if ( empty( $form_id ) ) {
685
+function give_get_lowest_price_option($form_id = 0) {
686
+	if (empty($form_id)) {
689 687
 		$form_id = get_the_ID();
690 688
 	}
691 689
 
692
-	if ( ! give_has_variable_prices( $form_id ) ) {
693
-		return give_get_form_price( $form_id );
690
+	if ( ! give_has_variable_prices($form_id)) {
691
+		return give_get_form_price($form_id);
694 692
 	}
695 693
 
696
-	if ( ! ( $low = get_post_meta( $form_id, '_give_levels_minimum_amount', true ) ) ) {
694
+	if ( ! ($low = get_post_meta($form_id, '_give_levels_minimum_amount', true))) {
697 695
 		// Backward compatibility.
698
-		$prices = wp_list_pluck( give_get_variable_prices( $form_id ), '_give_amount' );
699
-		$low    = ! empty( $prices ) ? min( $prices ) : 0;
696
+		$prices = wp_list_pluck(give_get_variable_prices($form_id), '_give_amount');
697
+		$low    = ! empty($prices) ? min($prices) : 0;
700 698
 	}
701 699
 
702
-	return give_maybe_sanitize_amount( $low );
700
+	return give_maybe_sanitize_amount($low);
703 701
 }
704 702
 
705 703
 /**
@@ -711,23 +709,23 @@  discard block
 block discarded – undo
711 709
  *
712 710
  * @return float Amount of the highest price
713 711
  */
714
-function give_get_highest_price_option( $form_id = 0 ) {
712
+function give_get_highest_price_option($form_id = 0) {
715 713
 
716
-	if ( empty( $form_id ) ) {
714
+	if (empty($form_id)) {
717 715
 		$form_id = get_the_ID();
718 716
 	}
719 717
 
720
-	if ( ! give_has_variable_prices( $form_id ) ) {
721
-		return give_get_form_price( $form_id );
718
+	if ( ! give_has_variable_prices($form_id)) {
719
+		return give_get_form_price($form_id);
722 720
 	}
723 721
 
724
-	if ( ! ( $high = get_post_meta( $form_id, '_give_levels_maximum_amount', true ) ) ) {
722
+	if ( ! ($high = get_post_meta($form_id, '_give_levels_maximum_amount', true))) {
725 723
 		// Backward compatibility.
726
-		$prices = wp_list_pluck( give_get_variable_prices( $form_id ), '_give_amount' );
727
-		$high   = ! empty( $prices ) ? max( $prices ) : 0;
724
+		$prices = wp_list_pluck(give_get_variable_prices($form_id), '_give_amount');
725
+		$high   = ! empty($prices) ? max($prices) : 0;
728 726
 	}
729 727
 
730
-	return give_maybe_sanitize_amount( $high );
728
+	return give_maybe_sanitize_amount($high);
731 729
 }
732 730
 
733 731
 /**
@@ -739,15 +737,15 @@  discard block
 block discarded – undo
739 737
  *
740 738
  * @return mixed string|int Price of the form
741 739
  */
742
-function give_get_form_price( $form_id = 0 ) {
740
+function give_get_form_price($form_id = 0) {
743 741
 
744
-	if ( empty( $form_id ) ) {
742
+	if (empty($form_id)) {
745 743
 		return false;
746 744
 	}
747 745
 
748
-	$form = new Give_Donate_Form( $form_id );
746
+	$form = new Give_Donate_Form($form_id);
749 747
 
750
-	return $form->__get( 'price' );
748
+	return $form->__get('price');
751 749
 }
752 750
 
753 751
 /**
@@ -759,13 +757,13 @@  discard block
 block discarded – undo
759 757
  *
760 758
  * @return mixed string|int Minimum price of the form
761 759
  */
762
-function give_get_form_minimum_price( $form_id = 0 ) {
760
+function give_get_form_minimum_price($form_id = 0) {
763 761
 
764
-	if ( empty( $form_id ) ) {
762
+	if (empty($form_id)) {
765 763
 		return false;
766 764
 	}
767 765
 
768
-	$form = new Give_Donate_Form( $form_id );
766
+	$form = new Give_Donate_Form($form_id);
769 767
 
770 768
 	return $form->get_minimum_price();
771 769
 
@@ -782,48 +780,48 @@  discard block
 block discarded – undo
782 780
  *
783 781
  * @return int $formatted_price
784 782
  */
785
-function give_price( $form_id = 0, $echo = true, $price_id = false ) {
783
+function give_price($form_id = 0, $echo = true, $price_id = false) {
786 784
 	$price = 0;
787 785
 
788
-	if ( empty( $form_id ) ) {
786
+	if (empty($form_id)) {
789 787
 		$form_id = get_the_ID();
790 788
 	}
791 789
 
792
-	if ( give_has_variable_prices( $form_id ) ) {
790
+	if (give_has_variable_prices($form_id)) {
793 791
 
794
-		$prices = give_get_variable_prices( $form_id );
792
+		$prices = give_get_variable_prices($form_id);
795 793
 
796
-		if ( false !== $price_id ) {
794
+		if (false !== $price_id) {
797 795
 
798 796
 			// loop through multi-prices to see which is default
799
-			foreach ( $prices as $price ) {
797
+			foreach ($prices as $price) {
800 798
 				// this is the default price
801
-				if ( isset( $price['_give_default'] ) && $price['_give_default'] === 'default' ) {
799
+				if (isset($price['_give_default']) && $price['_give_default'] === 'default') {
802 800
 					$price = (float) $price['_give_amount'];
803 801
 				};
804 802
 			}
805 803
 		} else {
806 804
 
807
-			$price = give_get_lowest_price_option( $form_id );
805
+			$price = give_get_lowest_price_option($form_id);
808 806
 		}
809 807
 	} else {
810 808
 
811
-		$price = give_get_form_price( $form_id );
809
+		$price = give_get_form_price($form_id);
812 810
 	}
813 811
 
814
-	$price           = apply_filters( 'give_form_price', give_maybe_sanitize_amount( $price ), $form_id );
815
-	$formatted_price = '<span class="give_price" id="give_price_' . $form_id . '">' . $price . '</span>';
816
-	$formatted_price = apply_filters( 'give_form_price_after_html', $formatted_price, $form_id, $price );
812
+	$price           = apply_filters('give_form_price', give_maybe_sanitize_amount($price), $form_id);
813
+	$formatted_price = '<span class="give_price" id="give_price_'.$form_id.'">'.$price.'</span>';
814
+	$formatted_price = apply_filters('give_form_price_after_html', $formatted_price, $form_id, $price);
817 815
 
818
-	if ( $echo ) {
816
+	if ($echo) {
819 817
 		echo $formatted_price;
820 818
 	} else {
821 819
 		return $formatted_price;
822 820
 	}
823 821
 }
824 822
 
825
-add_filter( 'give_form_price', 'give_format_amount', 10 );
826
-add_filter( 'give_form_price', 'give_currency_filter', 20 );
823
+add_filter('give_form_price', 'give_format_amount', 10);
824
+add_filter('give_form_price', 'give_currency_filter', 20);
827 825
 
828 826
 
829 827
 /**
@@ -836,19 +834,19 @@  discard block
 block discarded – undo
836 834
  *
837 835
  * @return float $amount Amount of the price option
838 836
  */
839
-function give_get_price_option_amount( $form_id = 0, $price_id = 0 ) {
840
-	$prices = give_get_variable_prices( $form_id );
837
+function give_get_price_option_amount($form_id = 0, $price_id = 0) {
838
+	$prices = give_get_variable_prices($form_id);
841 839
 
842 840
 	$amount = 0.00;
843 841
 
844
-	foreach ( $prices as $price ) {
845
-		if ( isset( $price['_give_id']['level_id'] ) && $price['_give_id']['level_id'] == $price_id ) {
846
-			$amount = isset( $price['_give_amount'] ) ? $price['_give_amount'] : 0.00;
842
+	foreach ($prices as $price) {
843
+		if (isset($price['_give_id']['level_id']) && $price['_give_id']['level_id'] == $price_id) {
844
+			$amount = isset($price['_give_amount']) ? $price['_give_amount'] : 0.00;
847 845
 			break;
848 846
 		};
849 847
 	}
850 848
 
851
-	return apply_filters( 'give_get_price_option_amount', give_maybe_sanitize_amount( $amount ), $form_id, $price_id );
849
+	return apply_filters('give_get_price_option_amount', give_maybe_sanitize_amount($amount), $form_id, $price_id);
852 850
 }
853 851
 
854 852
 /**
@@ -860,13 +858,13 @@  discard block
 block discarded – undo
860 858
  *
861 859
  * @return mixed string|int Goal of the form
862 860
  */
863
-function give_get_form_goal( $form_id = 0 ) {
861
+function give_get_form_goal($form_id = 0) {
864 862
 
865
-	if ( empty( $form_id ) ) {
863
+	if (empty($form_id)) {
866 864
 		return false;
867 865
 	}
868 866
 
869
-	$form = new Give_Donate_Form( $form_id );
867
+	$form = new Give_Donate_Form($form_id);
870 868
 
871 869
 	return $form->goal;
872 870
 
@@ -882,27 +880,27 @@  discard block
 block discarded – undo
882 880
  *
883 881
  * @return string $formatted_goal
884 882
  */
885
-function give_goal( $form_id = 0, $echo = true ) {
883
+function give_goal($form_id = 0, $echo = true) {
886 884
 
887
-	if ( empty( $form_id ) ) {
885
+	if (empty($form_id)) {
888 886
 		$form_id = get_the_ID();
889 887
 	}
890 888
 
891
-	$goal = give_get_form_goal( $form_id );
889
+	$goal = give_get_form_goal($form_id);
892 890
 
893
-	$goal           = apply_filters( 'give_form_goal', give_maybe_sanitize_amount( $goal ), $form_id );
894
-	$formatted_goal = '<span class="give_price" id="give_price_' . $form_id . '">' . $goal . '</span>';
895
-	$formatted_goal = apply_filters( 'give_form_price_after_html', $formatted_goal, $form_id, $goal );
891
+	$goal           = apply_filters('give_form_goal', give_maybe_sanitize_amount($goal), $form_id);
892
+	$formatted_goal = '<span class="give_price" id="give_price_'.$form_id.'">'.$goal.'</span>';
893
+	$formatted_goal = apply_filters('give_form_price_after_html', $formatted_goal, $form_id, $goal);
896 894
 
897
-	if ( $echo ) {
895
+	if ($echo) {
898 896
 		echo $formatted_goal;
899 897
 	} else {
900 898
 		return $formatted_goal;
901 899
 	}
902 900
 }
903 901
 
904
-add_filter( 'give_form_goal', 'give_format_amount', 10 );
905
-add_filter( 'give_form_goal', 'give_currency_filter', 20 );
902
+add_filter('give_form_goal', 'give_format_amount', 10);
903
+add_filter('give_form_goal', 'give_currency_filter', 20);
906 904
 
907 905
 
908 906
 /**
@@ -914,15 +912,15 @@  discard block
 block discarded – undo
914 912
  *
915 913
  * @return bool  $ret Whether or not the logged_in_only setting is set
916 914
  */
917
-function give_logged_in_only( $form_id ) {
915
+function give_logged_in_only($form_id) {
918 916
 	// If _give_logged_in_only is set to enable then guest can donate from that specific form.
919 917
 	// Otherwise it is member only donation form.
920
-	$val = give_get_meta( $form_id, '_give_logged_in_only', true );
921
-	$val = ! empty( $val ) ? $val : 'enabled';
918
+	$val = give_get_meta($form_id, '_give_logged_in_only', true);
919
+	$val = ! empty($val) ? $val : 'enabled';
922 920
 
923
-	$ret = ! give_is_setting_enabled( $val );
921
+	$ret = ! give_is_setting_enabled($val);
924 922
 
925
-	return (bool) apply_filters( 'give_logged_in_only', $ret, $form_id );
923
+	return (bool) apply_filters('give_logged_in_only', $ret, $form_id);
926 924
 }
927 925
 
928 926
 
@@ -935,11 +933,11 @@  discard block
 block discarded – undo
935 933
  *
936 934
  * @return string
937 935
  */
938
-function give_show_login_register_option( $form_id ) {
936
+function give_show_login_register_option($form_id) {
939 937
 
940
-	$show_register_form = give_get_meta( $form_id, '_give_show_register_form', true );
938
+	$show_register_form = give_get_meta($form_id, '_give_show_register_form', true);
941 939
 
942
-	return apply_filters( 'give_show_register_form', $show_register_form, $form_id );
940
+	return apply_filters('give_show_register_form', $show_register_form, $form_id);
943 941
 
944 942
 }
945 943
 
@@ -955,12 +953,12 @@  discard block
 block discarded – undo
955 953
  *
956 954
  * @return array
957 955
  */
958
-function _give_get_prefill_form_field_values( $form_id ) {
956
+function _give_get_prefill_form_field_values($form_id) {
959 957
 	$logged_in_donor_info = array();
960 958
 
961
-	if ( is_user_logged_in() ) :
962
-		$donor_data    = get_userdata( get_current_user_id() );
963
-		$donor_address = get_user_meta( get_current_user_id(), '_give_user_address', true );
959
+	if (is_user_logged_in()) :
960
+		$donor_data    = get_userdata(get_current_user_id());
961
+		$donor_address = get_user_meta(get_current_user_id(), '_give_user_address', true);
964 962
 
965 963
 		$logged_in_donor_info = array(
966 964
 			// First name.
@@ -973,42 +971,42 @@  discard block
 block discarded – undo
973 971
 			'give_email'      => $donor_data->user_email,
974 972
 
975 973
 			// Street address 1.
976
-			'card_address'    => ( ! empty( $donor_address['line1'] ) ? $donor_address['line1'] : '' ),
974
+			'card_address'    => ( ! empty($donor_address['line1']) ? $donor_address['line1'] : ''),
977 975
 
978 976
 			// Street address 2.
979
-			'card_address_2'  => ( ! empty( $donor_address['line2'] ) ? $donor_address['line2'] : '' ),
977
+			'card_address_2'  => ( ! empty($donor_address['line2']) ? $donor_address['line2'] : ''),
980 978
 
981 979
 			// Country.
982
-			'billing_country' => ( ! empty( $donor_address['country'] ) ? $donor_address['country'] : '' ),
980
+			'billing_country' => ( ! empty($donor_address['country']) ? $donor_address['country'] : ''),
983 981
 
984 982
 			// State.
985
-			'card_state'      => ( ! empty( $donor_address['state'] ) ? $donor_address['state'] : '' ),
983
+			'card_state'      => ( ! empty($donor_address['state']) ? $donor_address['state'] : ''),
986 984
 
987 985
 			// City.
988
-			'card_city'       => ( ! empty( $donor_address['city'] ) ? $donor_address['city'] : '' ),
986
+			'card_city'       => ( ! empty($donor_address['city']) ? $donor_address['city'] : ''),
989 987
 
990 988
 			// Zipcode
991
-			'card_zip'        => ( ! empty( $donor_address['zip'] ) ? $donor_address['zip'] : '' ),
989
+			'card_zip'        => ( ! empty($donor_address['zip']) ? $donor_address['zip'] : ''),
992 990
 		);
993 991
 	endif;
994 992
 
995 993
 	// Bailout: Auto fill form field values only form form which donor is donating.
996 994
 	if (
997
-		empty( $_GET['form-id'] )
995
+		empty($_GET['form-id'])
998 996
 		|| ! $form_id
999
-		|| ( $form_id !== absint( $_GET['form-id'] ) )
997
+		|| ($form_id !== absint($_GET['form-id']))
1000 998
 	) {
1001 999
 		return $logged_in_donor_info;
1002 1000
 	}
1003 1001
 
1004 1002
 	// Get purchase data.
1005
-	$give_purchase_data = Give()->session->get( 'give_purchase' );
1003
+	$give_purchase_data = Give()->session->get('give_purchase');
1006 1004
 
1007 1005
 	// Get donor info from form data.
1008
-	$give_donor_info_in_session = empty( $give_purchase_data['post_data'] )
1006
+	$give_donor_info_in_session = empty($give_purchase_data['post_data'])
1009 1007
 		? array()
1010 1008
 		: $give_purchase_data['post_data'];
1011 1009
 
1012 1010
 	// Output.
1013
-	return wp_parse_args( $give_donor_info_in_session, $logged_in_donor_info );
1011
+	return wp_parse_args($give_donor_info_in_session, $logged_in_donor_info);
1014 1012
 }
Please login to merge, or discard this patch.