Completed
Pull Request — master (#1613)
by Devin
20:01
created
includes/admin/class-give-settings.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param $url
74 74
 	 *
75
-	 * @return mixed
75
+	 * @return string
76 76
 	 */
77 77
 	public function give_update_cmb_meta_box_url( $url ) {
78 78
 		// Path to Give's CMB
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
  * @since 1.0
835 835
  *
836 836
  * @param string          $key   The Key to update
837
- * @param string|bool|int $value The value to set the key to
837
+ * @param integer $value The value to set the key to
838 838
  *
839 839
  * @return boolean True if updated, false if not.
840 840
  */
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
  * @since      1.3.5
938 938
  *
939 939
  * @param $array
940
- * @param $position |int|string Expects an array key or 'id' of the settings field to appear after
940
+ * @param string $position |int|string Expects an array key or 'id' of the settings field to appear after
941 941
  * @param $insert   |array a valid array of options to insert
942 942
  *
943 943
  * @return array
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
  * @since 1.0
977 977
  *
978 978
  * @param array $field_arr
979
- * @param array $saved_values
979
+ * @param string|boolean $saved_values
980 980
  *
981 981
  * @return void
982 982
  */
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
  * @since  1.0
1012 1012
  *
1013 1013
  * @param  array $field_arr
1014
- * @param  array $saved_value
1014
+ * @param  string|boolean $saved_value
1015 1015
  *
1016 1016
  * @return void
1017 1017
  */
Please login to merge, or discard this patch.
Spacing   +362 added lines, -362 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 	public function __construct() {
44 44
 
45 45
 		// Custom CMB2 Settings Fields
46
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
47
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
48
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
49
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
50
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
51
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
52
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
53
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
46
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
47
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
48
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
49
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
50
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
51
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
52
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
53
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
54 54
 	}
55 55
 
56 56
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * @since  1.0
61 61
 	 */
62 62
 	public function init() {
63
-		register_setting( $this->key, $this->key );
63
+		register_setting($this->key, $this->key);
64 64
 
65 65
 	}
66 66
 
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @return mixed
76 76
 	 */
77
-	public function give_update_cmb_meta_box_url( $url ) {
77
+	public function give_update_cmb_meta_box_url($url) {
78 78
 		// Path to Give's CMB
79
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
79
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
80 80
 	}
81 81
 
82 82
 
@@ -88,27 +88,27 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function give_get_settings_tabs() {
90 90
 
91
-		$settings = $this->give_settings( null );
91
+		$settings = $this->give_settings(null);
92 92
 
93 93
 		$tabs             = array();
94
-		$tabs['general']  = esc_html__( 'General', 'give' );
95
-		$tabs['gateways'] = esc_html__( 'Payment Gateways', 'give' );
96
-		$tabs['display']  = esc_html__( 'Display Options', 'give' );
97
-		$tabs['emails']   = esc_html__( 'Emails', 'give' );
94
+		$tabs['general']  = esc_html__('General', 'give');
95
+		$tabs['gateways'] = esc_html__('Payment Gateways', 'give');
96
+		$tabs['display']  = esc_html__('Display Options', 'give');
97
+		$tabs['emails']   = esc_html__('Emails', 'give');
98 98
 
99
-		if ( ! empty( $settings['addons']['fields'] ) ) {
100
-			$tabs['addons'] = esc_html__( 'Add-ons', 'give' );
99
+		if ( ! empty($settings['addons']['fields'])) {
100
+			$tabs['addons'] = esc_html__('Add-ons', 'give');
101 101
 		}
102 102
 
103
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
104
-			$tabs['licenses'] = esc_html__( 'Licenses', 'give' );
103
+		if ( ! empty($settings['licenses']['fields'])) {
104
+			$tabs['licenses'] = esc_html__('Licenses', 'give');
105 105
 		}
106 106
 
107
-		$tabs['advanced']    = esc_html__( 'Advanced', 'give' );
108
-		$tabs['api']         = esc_html__( 'API', 'give' );
109
-		$tabs['system_info'] = esc_html__( 'System Info', 'give' );
107
+		$tabs['advanced']    = esc_html__('Advanced', 'give');
108
+		$tabs['api']         = esc_html__('API', 'give');
109
+		$tabs['system_info'] = esc_html__('System Info', 'give');
110 110
 
111
-		return apply_filters( 'give_settings_tabs', $tabs );
111
+		return apply_filters('give_settings_tabs', $tabs);
112 112
 	}
113 113
 
114 114
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function admin_page_display() {
121 121
 
122
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
122
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
123 123
 
124 124
 		?>
125 125
 
@@ -129,22 +129,22 @@  discard block
 block discarded – undo
129 129
 
130 130
 			<h2 class="nav-tab-wrapper">
131 131
 				<?php
132
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
132
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
133 133
 
134
-					$tab_url = esc_url( add_query_arg( array(
134
+					$tab_url = esc_url(add_query_arg(array(
135 135
 						'settings-updated' => false,
136 136
 						'tab'              => $tab_id,
137
-					) ) );
137
+					)));
138 138
 
139 139
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
140 140
 
141
-					echo '<a href="' . esc_url( $tab_url ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>';
141
+					echo '<a href="'.esc_url($tab_url).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>';
142 142
 
143 143
 				}
144 144
 				?>
145 145
 			</h2>
146 146
 
147
-			<?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?>
147
+			<?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?>
148 148
 
149 149
 		</div><!-- .wrap -->
150 150
 
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
 	 *
167 167
 	 * @return string
168 168
 	 */
169
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
169
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
170 170
 
171 171
 		// only modify the give settings form
172
-		if ( 'give_settings' == $object_id ) {
172
+		if ('give_settings' == $object_id) {
173 173
 
174
-			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . esc_attr__( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
174
+			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.esc_attr__('Save Settings', 'give').'" class="button-primary"></div></form>';
175 175
 
176 176
 		}
177 177
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 *
189 189
 	 * @return array
190 190
 	 */
191
-	public function give_settings( $active_tab ) {
191
+	public function give_settings($active_tab) {
192 192
 
193 193
 		$give_settings = array(
194 194
 			/**
@@ -196,99 +196,99 @@  discard block
 block discarded – undo
196 196
 			 */
197 197
 			'general'     => array(
198 198
 				'id'         => 'general_settings',
199
-				'give_title' => esc_html__( 'General Settings', 'give' ),
200
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
201
-				'fields'     => apply_filters( 'give_settings_general', array(
199
+				'give_title' => esc_html__('General Settings', 'give'),
200
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
201
+				'fields'     => apply_filters('give_settings_general', array(
202 202
 						array(
203
-							'name' => esc_html__( 'General Settings', 'give' ),
203
+							'name' => esc_html__('General Settings', 'give'),
204 204
 							'desc' => '',
205 205
 							'type' => 'give_title',
206 206
 							'id'   => 'give_title_general_settings_1',
207 207
 						),
208 208
 						array(
209
-							'name'    => esc_html__( 'Success Page', 'give' ),
209
+							'name'    => esc_html__('Success Page', 'give'),
210 210
 							/* translators: %s: [give_receipt] */
211
-							'desc'    => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
211
+							'desc'    => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
212 212
 							'id'      => 'success_page',
213 213
 							'type'    => 'select',
214
-							'options' => give_cmb2_get_post_options( array(
214
+							'options' => give_cmb2_get_post_options(array(
215 215
 								'post_type'   => 'page',
216
-								'numberposts' => - 1,
217
-							) ),
216
+								'numberposts' => -1,
217
+							)),
218 218
 						),
219 219
 						array(
220
-							'name'    => esc_html__( 'Failed Donation Page', 'give' ),
221
-							'desc'    => esc_html__( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
220
+							'name'    => esc_html__('Failed Donation Page', 'give'),
221
+							'desc'    => esc_html__('The page donors are sent to if their donation is cancelled or fails.', 'give'),
222 222
 							'id'      => 'failure_page',
223 223
 							'type'    => 'select',
224
-							'options' => give_cmb2_get_post_options( array(
224
+							'options' => give_cmb2_get_post_options(array(
225 225
 								'post_type'   => 'page',
226
-								'numberposts' => - 1,
227
-							) ),
226
+								'numberposts' => -1,
227
+							)),
228 228
 						),
229 229
 						array(
230
-							'name'    => esc_html__( 'Donation History Page', 'give' ),
230
+							'name'    => esc_html__('Donation History Page', 'give'),
231 231
 							/* translators: %s: [donation_history] */
232
-							'desc'    => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
232
+							'desc'    => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
233 233
 							'id'      => 'history_page',
234 234
 							'type'    => 'select',
235
-							'options' => give_cmb2_get_post_options( array(
235
+							'options' => give_cmb2_get_post_options(array(
236 236
 								'post_type'   => 'page',
237
-								'numberposts' => - 1,
238
-							) ),
237
+								'numberposts' => -1,
238
+							)),
239 239
 						),
240 240
 						array(
241
-							'name'    => esc_html__( 'Base Country', 'give' ),
242
-							'desc'    => esc_html__( 'The country your site operates from.', 'give' ),
241
+							'name'    => esc_html__('Base Country', 'give'),
242
+							'desc'    => esc_html__('The country your site operates from.', 'give'),
243 243
 							'id'      => 'base_country',
244 244
 							'type'    => 'select',
245 245
 							'options' => give_get_country_list(),
246 246
 						),
247 247
 						array(
248
-							'name' => esc_html__( 'Currency Settings', 'give' ),
248
+							'name' => esc_html__('Currency Settings', 'give'),
249 249
 							'desc' => '',
250 250
 							'type' => 'give_title',
251 251
 							'id'   => 'give_title_general_settings_2',
252 252
 						),
253 253
 						array(
254
-							'name'    => esc_html__( 'Currency', 'give' ),
255
-							'desc'    => esc_html__( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
254
+							'name'    => esc_html__('Currency', 'give'),
255
+							'desc'    => esc_html__('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
256 256
 							'id'      => 'currency',
257 257
 							'type'    => 'select',
258 258
 							'options' => give_get_currencies(),
259 259
 							'default' => 'USD',
260 260
 						),
261 261
 						array(
262
-							'name'    => esc_html__( 'Currency Position', 'give' ),
263
-							'desc'    => esc_html__( 'The position of the currency symbol.', 'give' ),
262
+							'name'    => esc_html__('Currency Position', 'give'),
263
+							'desc'    => esc_html__('The position of the currency symbol.', 'give'),
264 264
 							'id'      => 'currency_position',
265 265
 							'type'    => 'select',
266 266
 							'options' => array(
267 267
 								/* translators: %s: currency symbol */
268
-								'before' => sprintf( esc_html__( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
268
+								'before' => sprintf(esc_html__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
269 269
 								/* translators: %s: currency symbol */
270
-								'after'  => sprintf( esc_html__( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) ),
270
+								'after'  => sprintf(esc_html__('After - 10%s', 'give'), give_currency_symbol(give_get_currency())),
271 271
 							),
272 272
 							'default' => 'before',
273 273
 						),
274 274
 						array(
275
-							'name'            => esc_html__( 'Thousands Separator', 'give' ),
276
-							'desc'            => esc_html__( 'The symbol (usually , or .) to separate thousands.', 'give' ),
275
+							'name'            => esc_html__('Thousands Separator', 'give'),
276
+							'desc'            => esc_html__('The symbol (usually , or .) to separate thousands.', 'give'),
277 277
 							'id'              => 'thousands_separator',
278 278
 							'type'            => 'text_small',
279 279
 							'sanitization_cb' => 'give_sanitize_thousand_separator',
280 280
 							'default'         => ',',
281 281
 						),
282 282
 						array(
283
-							'name'    => esc_html__( 'Decimal Separator', 'give' ),
284
-							'desc'    => esc_html__( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
283
+							'name'    => esc_html__('Decimal Separator', 'give'),
284
+							'desc'    => esc_html__('The symbol (usually , or .) to separate decimal points.', 'give'),
285 285
 							'id'      => 'decimal_separator',
286 286
 							'type'    => 'text_small',
287 287
 							'default' => '.',
288 288
 						),
289 289
 						array(
290
-							'name'            => esc_html__( 'Number of Decimals', 'give' ),
291
-							'desc'            => esc_html__( 'The number of decimal points displayed in amounts.', 'give' ),
290
+							'name'            => esc_html__('Number of Decimals', 'give'),
291
+							'desc'            => esc_html__('The number of decimal points displayed in amounts.', 'give'),
292 292
 							'id'              => 'number_decimals',
293 293
 							'type'            => 'text_small',
294 294
 							'default'         => 2,
@@ -302,83 +302,83 @@  discard block
 block discarded – undo
302 302
 			 */
303 303
 			'gateways'    => array(
304 304
 				'id'         => 'payment_gateways',
305
-				'give_title' => esc_html__( 'Payment Gateways', 'give' ),
306
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
307
-				'fields'     => apply_filters( 'give_settings_gateways', array(
305
+				'give_title' => esc_html__('Payment Gateways', 'give'),
306
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
307
+				'fields'     => apply_filters('give_settings_gateways', array(
308 308
 						array(
309
-							'name' => esc_html__( 'Gateways Settings', 'give' ),
309
+							'name' => esc_html__('Gateways Settings', 'give'),
310 310
 							'desc' => '',
311 311
 							'id'   => 'give_title_gateway_settings_1',
312 312
 							'type' => 'give_title',
313 313
 						),
314 314
 						array(
315
-							'name' => esc_html__( 'Test Mode', 'give' ),
316
-							'desc' => esc_html__( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
315
+							'name' => esc_html__('Test Mode', 'give'),
316
+							'desc' => esc_html__('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
317 317
 							'id'   => 'test_mode',
318 318
 							'type' => 'checkbox',
319 319
 						),
320 320
 						array(
321
-							'name' => esc_html__( 'Enabled Gateways', 'give' ),
322
-							'desc' => esc_html__( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
321
+							'name' => esc_html__('Enabled Gateways', 'give'),
322
+							'desc' => esc_html__('Enable your payment gateway. Can be ordered by dragging.', 'give'),
323 323
 							'id'   => 'gateways',
324 324
 							'type' => 'enabled_gateways',
325 325
 						),
326 326
 						array(
327
-							'name' => esc_html__( 'Default Gateway', 'give' ),
328
-							'desc' => esc_html__( 'The gateway that will be selected by default.', 'give' ),
327
+							'name' => esc_html__('Default Gateway', 'give'),
328
+							'desc' => esc_html__('The gateway that will be selected by default.', 'give'),
329 329
 							'id'   => 'default_gateway',
330 330
 							'type' => 'default_gateway',
331 331
 						),
332 332
 						array(
333
-							'name' => esc_html__( 'PayPal Standard', 'give' ),
333
+							'name' => esc_html__('PayPal Standard', 'give'),
334 334
 							'desc' => '',
335 335
 							'type' => 'give_title',
336 336
 							'id'   => 'give_title_gateway_settings_2',
337 337
 						),
338 338
 						array(
339
-							'name' => esc_html__( 'PayPal Email', 'give' ),
340
-							'desc' => esc_html__( 'Enter your PayPal account\'s email.', 'give' ),
339
+							'name' => esc_html__('PayPal Email', 'give'),
340
+							'desc' => esc_html__('Enter your PayPal account\'s email.', 'give'),
341 341
 							'id'   => 'paypal_email',
342 342
 							'type' => 'text_email',
343 343
 						),
344 344
 						array(
345
-							'name' => esc_html__( 'PayPal Page Style', 'give' ),
346
-							'desc' => esc_html__( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
345
+							'name' => esc_html__('PayPal Page Style', 'give'),
346
+							'desc' => esc_html__('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
347 347
 							'id'   => 'paypal_page_style',
348 348
 							'type' => 'text',
349 349
 						),
350 350
 						array(
351
-							'name'    => esc_html__( 'PayPal Transaction Type', 'give' ),
352
-							'desc'    => esc_html__( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
351
+							'name'    => esc_html__('PayPal Transaction Type', 'give'),
352
+							'desc'    => esc_html__('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
353 353
 							'id'      => 'paypal_button_type',
354 354
 							'type'    => 'radio_inline',
355 355
 							'options' => array(
356
-								'donation' => esc_html__( 'Donation', 'give' ),
357
-								'standard' => esc_html__( 'Standard Transaction', 'give' ),
356
+								'donation' => esc_html__('Donation', 'give'),
357
+								'standard' => esc_html__('Standard Transaction', 'give'),
358 358
 							),
359 359
 							'default' => 'donation',
360 360
 						),
361 361
 						array(
362
-							'name' => esc_html__( 'Disable PayPal IPN Verification', 'give' ),
363
-							'desc' => esc_html__( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
362
+							'name' => esc_html__('Disable PayPal IPN Verification', 'give'),
363
+							'desc' => esc_html__('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
364 364
 							'id'   => 'disable_paypal_verification',
365 365
 							'type' => 'checkbox',
366 366
 						),
367 367
 						array(
368
-							'name' => esc_html__( 'Offline Donations', 'give' ),
368
+							'name' => esc_html__('Offline Donations', 'give'),
369 369
 							'desc' => '',
370 370
 							'type' => 'give_title',
371 371
 							'id'   => 'give_title_gateway_settings_3',
372 372
 						),
373 373
 						array(
374
-							'name' => esc_html__( 'Collect Billing Details', 'give' ),
375
-							'desc' => esc_html__( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
374
+							'name' => esc_html__('Collect Billing Details', 'give'),
375
+							'desc' => esc_html__('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
376 376
 							'id'   => 'give_offline_donation_enable_billing_fields',
377 377
 							'type' => 'checkbox',
378 378
 						),
379 379
 						array(
380
-							'name'    => esc_html__( 'Offline Donation Instructions', 'give' ),
381
-							'desc'    => esc_html__( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
380
+							'name'    => esc_html__('Offline Donation Instructions', 'give'),
381
+							'desc'    => esc_html__('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
382 382
 							'id'      => 'global_offline_donation_content',
383 383
 							'default' => give_get_default_offline_donation_content(),
384 384
 							'type'    => 'wysiwyg',
@@ -387,15 +387,15 @@  discard block
 block discarded – undo
387 387
 							),
388 388
 						),
389 389
 						array(
390
-							'name'    => esc_html__( 'Offline Donation Email Instructions Subject', 'give' ),
391
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
390
+							'name'    => esc_html__('Offline Donation Email Instructions Subject', 'give'),
391
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
392 392
 							'id'      => 'offline_donation_subject',
393
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
393
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
394 394
 							'type'    => 'text',
395 395
 						),
396 396
 						array(
397
-							'name'    => esc_html__( 'Offline Donation Email Instructions', 'give' ),
398
-							'desc'    => esc_html__( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
397
+							'name'    => esc_html__('Offline Donation Email Instructions', 'give'),
398
+							'desc'    => esc_html__('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
399 399
 							'id'      => 'global_offline_donation_email',
400 400
 							'default' => give_get_default_offline_donation_email_content(),
401 401
 							'type'    => 'wysiwyg',
@@ -409,104 +409,104 @@  discard block
 block discarded – undo
409 409
 			/** Display Settings */
410 410
 			'display'     => array(
411 411
 				'id'         => 'display_settings',
412
-				'give_title' => esc_html__( 'Display Settings', 'give' ),
413
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
414
-				'fields'     => apply_filters( 'give_settings_display', array(
412
+				'give_title' => esc_html__('Display Settings', 'give'),
413
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
414
+				'fields'     => apply_filters('give_settings_display', array(
415 415
 						array(
416
-							'name' => esc_html__( 'Display Settings', 'give' ),
416
+							'name' => esc_html__('Display Settings', 'give'),
417 417
 							'desc' => '',
418 418
 							'id'   => 'give_title_display_settings_1',
419 419
 							'type' => 'give_title',
420 420
 						),
421 421
 						array(
422
-							'name' => esc_html__( 'Disable CSS', 'give' ),
423
-							'desc' => esc_html__( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
422
+							'name' => esc_html__('Disable CSS', 'give'),
423
+							'desc' => esc_html__('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
424 424
 							'id'   => 'disable_css',
425 425
 							'type' => 'checkbox',
426 426
 						),
427 427
 						array(
428
-							'name' => esc_html__( 'Enable Floating Labels', 'give' ),
428
+							'name' => esc_html__('Enable Floating Labels', 'give'),
429 429
 							/* translators: %s: http://docs.givewp.com/form-floating-labels */
430
-							'desc' => sprintf( wp_kses( __( 'Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array(
430
+							'desc' => sprintf(wp_kses(__('Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array(
431 431
 								'a' => array(
432 432
 									'href'   => array(),
433 433
 									'target' => array(),
434 434
 								),
435
-							) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
435
+							)), esc_url('http://docs.givewp.com/form-floating-labels')),
436 436
 							'id'   => 'floatlabels',
437 437
 							'type' => 'checkbox',
438 438
 						),
439 439
 						array(
440
-							'name' => esc_html__( 'Disable Welcome Screen', 'give' ),
440
+							'name' => esc_html__('Disable Welcome Screen', 'give'),
441 441
 							/* translators: %s: about page URL */
442
-							'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give' ), array(
442
+							'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give'), array(
443 443
 								'a' => array(
444 444
 									'href'   => array(),
445 445
 									'target' => array(),
446 446
 								),
447
-							) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
447
+							)), esc_url(admin_url('index.php?page=give-about'))),
448 448
 							'id'   => 'disable_welcome',
449 449
 							'type' => 'checkbox',
450 450
 						),
451 451
 						array(
452
-							'name' => esc_html__( 'Post Types', 'give' ),
452
+							'name' => esc_html__('Post Types', 'give'),
453 453
 							'desc' => '',
454 454
 							'id'   => 'give_title_display_settings_2',
455 455
 							'type' => 'give_title',
456 456
 						),
457 457
 						array(
458
-							'name' => esc_html__( 'Disable Form Single Views', 'give' ),
459
-							'desc' => esc_html__( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
458
+							'name' => esc_html__('Disable Form Single Views', 'give'),
459
+							'desc' => esc_html__('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
460 460
 							'id'   => 'disable_forms_singular',
461 461
 							'type' => 'checkbox',
462 462
 						),
463 463
 						array(
464
-							'name' => esc_html__( 'Disable Form Archives', 'give' ),
465
-							'desc' => esc_html__( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
464
+							'name' => esc_html__('Disable Form Archives', 'give'),
465
+							'desc' => esc_html__('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
466 466
 							'id'   => 'disable_forms_archives',
467 467
 							'type' => 'checkbox',
468 468
 						),
469 469
 						array(
470
-							'name' => esc_html__( 'Disable Form Excerpts', 'give' ),
471
-							'desc' => esc_html__( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
470
+							'name' => esc_html__('Disable Form Excerpts', 'give'),
471
+							'desc' => esc_html__('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
472 472
 							'id'   => 'disable_forms_excerpt',
473 473
 							'type' => 'checkbox',
474 474
 						),
475 475
 						array(
476
-							'name'    => esc_html__( 'Featured Image Size', 'give' ),
477
-							'desc'    => esc_html__( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
476
+							'name'    => esc_html__('Featured Image Size', 'give'),
477
+							'desc'    => esc_html__('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'),
478 478
 							'id'      => 'featured_image_size',
479 479
 							'type'    => 'select',
480 480
 							'default' => 'large',
481 481
 							'options' => give_get_featured_image_sizes(),
482 482
 						),
483 483
 						array(
484
-							'name' => esc_html__( 'Disable Form Featured Image', 'give' ),
485
-							'desc' => esc_html__( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
484
+							'name' => esc_html__('Disable Form Featured Image', 'give'),
485
+							'desc' => esc_html__('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
486 486
 							'id'   => 'disable_form_featured_img',
487 487
 							'type' => 'checkbox',
488 488
 						),
489 489
 						array(
490
-							'name' => esc_html__( 'Disable Single Form Sidebar', 'give' ),
491
-							'desc' => esc_html__( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
490
+							'name' => esc_html__('Disable Single Form Sidebar', 'give'),
491
+							'desc' => esc_html__('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
492 492
 							'id'   => 'disable_form_sidebar',
493 493
 							'type' => 'checkbox',
494 494
 						),
495 495
 						array(
496
-							'name' => esc_html__( 'Taxonomies', 'give' ),
496
+							'name' => esc_html__('Taxonomies', 'give'),
497 497
 							'desc' => '',
498 498
 							'id'   => 'give_title_display_settings_3',
499 499
 							'type' => 'give_title',
500 500
 						),
501 501
 						array(
502
-							'name' => esc_html__( 'Enable Form Categories', 'give' ),
503
-							'desc' => esc_html__( 'Enables the "Category" taxonomy for all Give forms.', 'give' ),
502
+							'name' => esc_html__('Enable Form Categories', 'give'),
503
+							'desc' => esc_html__('Enables the "Category" taxonomy for all Give forms.', 'give'),
504 504
 							'id'   => 'categories',
505 505
 							'type' => 'checkbox',
506 506
 						),
507 507
 						array(
508
-							'name' => esc_html__( 'Enable Form Tags', 'give' ),
509
-							'desc' => esc_html__( 'Enables the "Tag" taxonomy for all Give forms.', 'give' ),
508
+							'name' => esc_html__('Enable Form Tags', 'give'),
509
+							'desc' => esc_html__('Enables the "Tag" taxonomy for all Give forms.', 'give'),
510 510
 							'id'   => 'tags',
511 511
 							'type' => 'checkbox',
512 512
 						),
@@ -519,101 +519,101 @@  discard block
 block discarded – undo
519 519
 			 */
520 520
 			'emails'      => array(
521 521
 				'id'         => 'email_settings',
522
-				'give_title' => esc_html__( 'Email Settings', 'give' ),
523
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
524
-				'fields'     => apply_filters( 'give_settings_emails', array(
522
+				'give_title' => esc_html__('Email Settings', 'give'),
523
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
524
+				'fields'     => apply_filters('give_settings_emails', array(
525 525
 						array(
526
-							'name' => esc_html__( 'Email Settings', 'give' ),
526
+							'name' => esc_html__('Email Settings', 'give'),
527 527
 							'desc' => '',
528 528
 							'id'   => 'give_title_email_settings_1',
529 529
 							'type' => 'give_title',
530 530
 						),
531 531
 						array(
532 532
 							'id'      => 'email_template',
533
-							'name'    => esc_html__( 'Email Template', 'give' ),
534
-							'desc'    => esc_html__( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
533
+							'name'    => esc_html__('Email Template', 'give'),
534
+							'desc'    => esc_html__('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
535 535
 							'type'    => 'select',
536 536
 							'options' => give_get_email_templates(),
537 537
 						),
538 538
 						array(
539 539
 							'id'   => 'email_logo',
540
-							'name' => esc_html__( 'Logo', 'give' ),
541
-							'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
540
+							'name' => esc_html__('Logo', 'give'),
541
+							'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
542 542
 							'type' => 'file',
543 543
 						),
544 544
 						array(
545 545
 							'id'      => 'from_name',
546
-							'name'    => esc_html__( 'From Name', 'give' ),
547
-							'desc'    => esc_html__( 'The name that appears in the "From" field in donation receipt emails.', 'give' ),
548
-							'default' => get_bloginfo( 'name' ),
546
+							'name'    => esc_html__('From Name', 'give'),
547
+							'desc'    => esc_html__('The name that appears in the "From" field in donation receipt emails.', 'give'),
548
+							'default' => get_bloginfo('name'),
549 549
 							'type'    => 'text',
550 550
 						),
551 551
 						array(
552 552
 							'id'      => 'from_email',
553
-							'name'    => esc_html__( 'From Email', 'give' ),
554
-							'desc'    => esc_html__( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
555
-							'default' => get_bloginfo( 'admin_email' ),
553
+							'name'    => esc_html__('From Email', 'give'),
554
+							'desc'    => esc_html__('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
555
+							'default' => get_bloginfo('admin_email'),
556 556
 							'type'    => 'text',
557 557
 						),
558 558
 						array(
559
-							'name' => esc_html__( 'Donation Receipt', 'give' ),
559
+							'name' => esc_html__('Donation Receipt', 'give'),
560 560
 							'desc' => '',
561 561
 							'id'   => 'give_title_email_settings_2',
562 562
 							'type' => 'give_title',
563 563
 						),
564 564
 						array(
565 565
 							'id'      => 'donation_subject',
566
-							'name'    => esc_html__( 'Donation Email Subject', 'give' ),
567
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
568
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
566
+							'name'    => esc_html__('Donation Email Subject', 'give'),
567
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
568
+							'default' => esc_attr__('Donation Receipt', 'give'),
569 569
 							'type'    => 'text',
570 570
 						),
571 571
 						array(
572 572
 							'id'      => 'donation_receipt',
573
-							'name'    => esc_html__( 'Donation Receipt', 'give' ),
573
+							'name'    => esc_html__('Donation Receipt', 'give'),
574 574
 							'desc'    => sprintf(
575 575
 								/* translators: %s: emails tags list */
576
-								esc_html__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ),
577
-								'<br/>' . give_get_emails_tags_list()
576
+								esc_html__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'),
577
+								'<br/>'.give_get_emails_tags_list()
578 578
 							),
579 579
 							'type'    => 'wysiwyg',
580 580
 							'default' => give_get_default_donation_receipt_email(),
581 581
 						),
582 582
 						array(
583
-							'name' => esc_html__( 'New Donation Notification', 'give' ),
583
+							'name' => esc_html__('New Donation Notification', 'give'),
584 584
 							'desc' => '',
585 585
 							'id'   => 'give_title_email_settings_3',
586 586
 							'type' => 'give_title',
587 587
 						),
588 588
 						array(
589 589
 							'id'      => 'donation_notification_subject',
590
-							'name'    => esc_html__( 'Donation Notification Subject', 'give' ),
591
-							'desc'    => esc_html__( 'Enter the subject line for the donation notification email.', 'give' ),
590
+							'name'    => esc_html__('Donation Notification Subject', 'give'),
591
+							'desc'    => esc_html__('Enter the subject line for the donation notification email.', 'give'),
592 592
 							'type'    => 'text',
593
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' ),
593
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give'),
594 594
 						),
595 595
 						array(
596 596
 							'id'      => 'donation_notification',
597
-							'name'    => esc_html__( 'Donation Notification', 'give' ),
597
+							'name'    => esc_html__('Donation Notification', 'give'),
598 598
 							'desc'    => sprintf(
599 599
 								/* translators: %s: emails tags list */
600
-								esc_html__( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ),
601
-								'<br/>' . give_get_emails_tags_list()
600
+								esc_html__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'),
601
+								'<br/>'.give_get_emails_tags_list()
602 602
 							),
603 603
 							'type'    => 'wysiwyg',
604 604
 							'default' => give_get_default_donation_notification_email(),
605 605
 						),
606 606
 						array(
607 607
 							'id'      => 'admin_notice_emails',
608
-							'name'    => esc_html__( 'Donation Notification Emails', 'give' ),
609
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
608
+							'name'    => esc_html__('Donation Notification Emails', 'give'),
609
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
610 610
 							'type'    => 'textarea',
611
-							'default' => get_bloginfo( 'admin_email' ),
611
+							'default' => get_bloginfo('admin_email'),
612 612
 						),
613 613
 						array(
614 614
 							'id'   => 'disable_admin_notices',
615
-							'name' => esc_html__( 'Disable Admin Notifications', 'give' ),
616
-							'desc' => esc_html__( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
615
+							'name' => esc_html__('Disable Admin Notifications', 'give'),
616
+							'desc' => esc_html__('Check this box if you do not want to receive emails when new donations are made.', 'give'),
617 617
 							'type' => 'checkbox',
618 618
 						),
619 619
 					)
@@ -622,99 +622,99 @@  discard block
 block discarded – undo
622 622
 			/** Extension Settings */
623 623
 			'addons'      => array(
624 624
 				'id'         => 'addons',
625
-				'give_title' => esc_html__( 'Give Add-ons Settings', 'give' ),
626
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
627
-				'fields'     => apply_filters( 'give_settings_addons', array()
625
+				'give_title' => esc_html__('Give Add-ons Settings', 'give'),
626
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
627
+				'fields'     => apply_filters('give_settings_addons', array()
628 628
 				),
629 629
 			),
630 630
 			/** Licenses Settings */
631 631
 			'licenses'    => array(
632 632
 				'id'         => 'licenses',
633
-				'give_title' => esc_html__( 'Give Licenses', 'give' ),
634
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
635
-				'fields'     => apply_filters( 'give_settings_licenses', array()
633
+				'give_title' => esc_html__('Give Licenses', 'give'),
634
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
635
+				'fields'     => apply_filters('give_settings_licenses', array()
636 636
 				),
637 637
 			),
638 638
 			/** Advanced Options */
639 639
 			'advanced'    => array(
640 640
 				'id'         => 'advanced_options',
641
-				'give_title' => esc_html__( 'Advanced Options', 'give' ),
642
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
643
-				'fields'     => apply_filters( 'give_settings_advanced', array(
641
+				'give_title' => esc_html__('Advanced Options', 'give'),
642
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
643
+				'fields'     => apply_filters('give_settings_advanced', array(
644 644
 						array(
645
-							'name' => esc_html__( 'Access Control', 'give' ),
645
+							'name' => esc_html__('Access Control', 'give'),
646 646
 							'desc' => '',
647 647
 							'id'   => 'give_title_session_control_1',
648 648
 							'type' => 'give_title',
649 649
 						),
650 650
 						array(
651 651
 							'id'      => 'session_lifetime',
652
-							'name'    => esc_html__( 'Session Lifetime', 'give' ),
653
-							'desc'    => esc_html__( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ),
652
+							'name'    => esc_html__('Session Lifetime', 'give'),
653
+							'desc'    => esc_html__('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'),
654 654
 							'type'    => 'select',
655 655
 							'options' => array(
656
-								'86400'  => esc_html__( '24 Hours', 'give' ),
657
-								'172800' => esc_html__( '48 Hours', 'give' ),
658
-								'259200' => esc_html__( '72 Hours', 'give' ),
659
-								'604800' => esc_html__( '1 Week', 'give' ),
656
+								'86400'  => esc_html__('24 Hours', 'give'),
657
+								'172800' => esc_html__('48 Hours', 'give'),
658
+								'259200' => esc_html__('72 Hours', 'give'),
659
+								'604800' => esc_html__('1 Week', 'give'),
660 660
 							),
661 661
 						),
662 662
 						array(
663
-							'name' => esc_html__( 'Email Access', 'give' ),
664
-							'desc' => esc_html__( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
663
+							'name' => esc_html__('Email Access', 'give'),
664
+							'desc' => esc_html__('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
665 665
 							'id'   => 'email_access',
666 666
 							'type' => 'checkbox',
667 667
 						),
668 668
 						array(
669 669
 							'id'      => 'recaptcha_key',
670
-							'name'    => esc_html__( 'reCAPTCHA Site Key', 'give' ),
670
+							'name'    => esc_html__('reCAPTCHA Site Key', 'give'),
671 671
 							/* translators: %s: https://www.google.com/recaptcha/ */
672
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'https://www.google.com/recaptcha/' ) ),
672
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('https://www.google.com/recaptcha/')),
673 673
 							'default' => '',
674 674
 							'type'    => 'text',
675 675
 						),
676 676
 						array(
677 677
 							'id'      => 'recaptcha_secret',
678
-							'name'    => esc_html__( 'reCAPTCHA Secret Key', 'give' ),
679
-							'desc'    => esc_html__( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
678
+							'name'    => esc_html__('reCAPTCHA Secret Key', 'give'),
679
+							'desc'    => esc_html__('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
680 680
 							'default' => '',
681 681
 							'type'    => 'text',
682 682
 						),
683 683
 						array(
684
-							'name' => esc_html__( 'Data Control', 'give' ),
684
+							'name' => esc_html__('Data Control', 'give'),
685 685
 							'desc' => '',
686 686
 							'id'   => 'give_title_data_control_2',
687 687
 							'type' => 'give_title',
688 688
 						),
689 689
 						array(
690
-							'name' => esc_html__( 'Remove All Data on Uninstall?', 'give' ),
691
-							'desc' => esc_html__( 'When the plugin is deleted, completely remove all Give data.', 'give' ),
690
+							'name' => esc_html__('Remove All Data on Uninstall?', 'give'),
691
+							'desc' => esc_html__('When the plugin is deleted, completely remove all Give data.', 'give'),
692 692
 							'id'   => 'uninstall_on_delete',
693 693
 							'type' => 'checkbox',
694 694
 						),
695 695
 						array(
696
-							'name' => esc_html__( 'Filter Control', 'give' ),
696
+							'name' => esc_html__('Filter Control', 'give'),
697 697
 							'desc' => '',
698 698
 							'id'   => 'give_title_filter_control',
699 699
 							'type' => 'give_title',
700 700
 						),
701 701
 						array(
702 702
 							/* translators: %s: the_content */
703
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
703
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
704 704
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
705
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
705
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
706 706
 							'id'   => 'disable_the_content_filter',
707 707
 							'type' => 'checkbox',
708 708
 						),
709 709
 						array(
710
-							'name' => esc_html__( 'Script Loading', 'give' ),
710
+							'name' => esc_html__('Script Loading', 'give'),
711 711
 							'desc' => '',
712 712
 							'id'   => 'give_title_script_control',
713 713
 							'type' => 'give_title',
714 714
 						),
715 715
 						array(
716
-							'name' => esc_html__( 'Load Scripts in Footer?', 'give' ),
717
-							'desc' => esc_html__( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
716
+							'name' => esc_html__('Load Scripts in Footer?', 'give'),
717
+							'desc' => esc_html__('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
718 718
 							'id'   => 'scripts_footer',
719 719
 							'type' => 'checkbox',
720 720
 						),
@@ -724,13 +724,13 @@  discard block
 block discarded – undo
724 724
 			/** API Settings */
725 725
 			'api'         => array(
726 726
 				'id'         => 'api',
727
-				'give_title' => esc_html__( 'API', 'give' ),
728
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
727
+				'give_title' => esc_html__('API', 'give'),
728
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
729 729
 				'show_names' => false, // Hide field names on the left
730
-				'fields'     => apply_filters( 'give_settings_system', array(
730
+				'fields'     => apply_filters('give_settings_system', array(
731 731
 						array(
732 732
 							'id'   => 'api',
733
-							'name' => esc_html__( 'API', 'give' ),
733
+							'name' => esc_html__('API', 'give'),
734 734
 							'type' => 'api',
735 735
 						),
736 736
 					)
@@ -739,13 +739,13 @@  discard block
 block discarded – undo
739 739
 			/** Licenses Settings */
740 740
 			'system_info' => array(
741 741
 				'id'         => 'system_info',
742
-				'give_title' => esc_html__( 'System Info', 'give' ),
743
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key ) ),
744
-				'fields'     => apply_filters( 'give_settings_system', array(
742
+				'give_title' => esc_html__('System Info', 'give'),
743
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key)),
744
+				'fields'     => apply_filters('give_settings_system', array(
745 745
 						array(
746 746
 							'id'   => 'system-info-textarea',
747
-							'name' => esc_html__( 'System Info', 'give' ),
748
-							'desc' => esc_html__( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
747
+							'name' => esc_html__('System Info', 'give'),
748
+							'desc' => esc_html__('Please copy and paste this information in your ticket when contacting support.', 'give'),
749 749
 							'type' => 'system_info',
750 750
 						),
751 751
 					)
@@ -753,15 +753,15 @@  discard block
 block discarded – undo
753 753
 			),
754 754
 		);
755 755
 
756
-		$give_settings = apply_filters( 'give_registered_settings', $give_settings );
756
+		$give_settings = apply_filters('give_registered_settings', $give_settings);
757 757
 
758 758
 		// Return all settings array if no active tab
759
-		if ( empty( $active_tab ) || ! isset( $give_settings[ $active_tab ] ) ) {
759
+		if (empty($active_tab) || ! isset($give_settings[$active_tab])) {
760 760
 			return $give_settings;
761 761
 		}
762 762
 
763 763
 		// Add other tabs and settings fields as needed
764
-		return $give_settings[ $active_tab ];
764
+		return $give_settings[$active_tab];
765 765
 
766 766
 	}
767 767
 
@@ -770,11 +770,11 @@  discard block
 block discarded – undo
770 770
 	 */
771 771
 	public function settings_notices() {
772 772
 
773
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
773
+		if ( ! isset($_POST['give_settings_saved'])) {
774 774
 			return;
775 775
 		}
776 776
 
777
-		add_settings_error( 'give-notices', 'global-settings-updated', esc_html__( 'Settings updated.', 'give' ), 'updated' );
777
+		add_settings_error('give-notices', 'global-settings-updated', esc_html__('Settings updated.', 'give'), 'updated');
778 778
 
779 779
 	}
780 780
 
@@ -789,14 +789,14 @@  discard block
 block discarded – undo
789 789
 	 * @return mixed         Field value or exception is thrown.
790 790
 	 * @throws Exception     Throws an exception if the field is invalid.
791 791
 	 */
792
-	public function __get( $field ) {
792
+	public function __get($field) {
793 793
 
794 794
 		// Allowed fields to retrieve
795
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
795
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
796 796
 			return $this->{$field};
797 797
 		}
798 798
 
799
-		throw new Exception( sprintf( esc_html__( 'Invalid property: %s', 'give' ), $field ) );
799
+		throw new Exception(sprintf(esc_html__('Invalid property: %s', 'give'), $field));
800 800
 	}
801 801
 
802 802
 
@@ -815,12 +815,12 @@  discard block
 block discarded – undo
815 815
  *
816 816
  * @return mixed        Option value
817 817
  */
818
-function give_get_option( $key = '', $default = false ) {
818
+function give_get_option($key = '', $default = false) {
819 819
 	$give_options = give_get_settings();
820
-	$value        = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
821
-	$value        = apply_filters( 'give_get_option', $value, $key, $default );
820
+	$value        = ! empty($give_options[$key]) ? $give_options[$key] : $default;
821
+	$value        = apply_filters('give_get_option', $value, $key, $default);
822 822
 
823
-	return apply_filters( "give_get_option_{$key}", $value, $key, $default );
823
+	return apply_filters("give_get_option_{$key}", $value, $key, $default);
824 824
 }
825 825
 
826 826
 
@@ -838,33 +838,33 @@  discard block
 block discarded – undo
838 838
  *
839 839
  * @return boolean True if updated, false if not.
840 840
  */
841
-function give_update_option( $key = '', $value = false ) {
841
+function give_update_option($key = '', $value = false) {
842 842
 
843 843
 	// If no key, exit
844
-	if ( empty( $key ) ) {
844
+	if (empty($key)) {
845 845
 		return false;
846 846
 	}
847 847
 
848
-	if ( empty( $value ) ) {
849
-		$remove_option = give_delete_option( $key );
848
+	if (empty($value)) {
849
+		$remove_option = give_delete_option($key);
850 850
 
851 851
 		return $remove_option;
852 852
 	}
853 853
 
854 854
 	// First let's grab the current settings
855
-	$options = get_option( 'give_settings' );
855
+	$options = get_option('give_settings');
856 856
 
857 857
 	// Let's let devs alter that value coming in
858
-	$value = apply_filters( 'give_update_option', $value, $key );
858
+	$value = apply_filters('give_update_option', $value, $key);
859 859
 
860 860
 	// Next let's try to update the value
861
-	$options[ $key ] = $value;
862
-	$did_update      = update_option( 'give_settings', $options );
861
+	$options[$key] = $value;
862
+	$did_update      = update_option('give_settings', $options);
863 863
 
864 864
 	// If it updated, let's update the global variable
865
-	if ( $did_update ) {
865
+	if ($did_update) {
866 866
 		global $give_options;
867
-		$give_options[ $key ] = $value;
867
+		$give_options[$key] = $value;
868 868
 	}
869 869
 
870 870
 	return $did_update;
@@ -883,27 +883,27 @@  discard block
 block discarded – undo
883 883
  *
884 884
  * @return boolean True if updated, false if not.
885 885
  */
886
-function give_delete_option( $key = '' ) {
886
+function give_delete_option($key = '') {
887 887
 
888 888
 	// If no key, exit
889
-	if ( empty( $key ) ) {
889
+	if (empty($key)) {
890 890
 		return false;
891 891
 	}
892 892
 
893 893
 	// First let's grab the current settings
894
-	$options = get_option( 'give_settings' );
894
+	$options = get_option('give_settings');
895 895
 
896 896
 	// Next let's try to update the value
897
-	if ( isset( $options[ $key ] ) ) {
897
+	if (isset($options[$key])) {
898 898
 
899
-		unset( $options[ $key ] );
899
+		unset($options[$key]);
900 900
 
901 901
 	}
902 902
 
903
-	$did_update = update_option( 'give_settings', $options );
903
+	$did_update = update_option('give_settings', $options);
904 904
 
905 905
 	// If it updated, let's update the global variable
906
-	if ( $did_update ) {
906
+	if ($did_update) {
907 907
 		global $give_options;
908 908
 		$give_options = $options;
909 909
 	}
@@ -922,9 +922,9 @@  discard block
 block discarded – undo
922 922
  */
923 923
 function give_get_settings() {
924 924
 
925
-	$settings = get_option( 'give_settings' );
925
+	$settings = get_option('give_settings');
926 926
 
927
-	return (array) apply_filters( 'give_get_settings', $settings );
927
+	return (array) apply_filters('give_get_settings', $settings);
928 928
 
929 929
 }
930 930
 
@@ -942,25 +942,25 @@  discard block
 block discarded – undo
942 942
  *
943 943
  * @return array
944 944
  */
945
-function give_settings_array_insert( $array, $position, $insert ) {
946
-	if ( is_int( $position ) ) {
947
-		array_splice( $array, $position, 0, $insert );
945
+function give_settings_array_insert($array, $position, $insert) {
946
+	if (is_int($position)) {
947
+		array_splice($array, $position, 0, $insert);
948 948
 	} else {
949 949
 
950
-		foreach ( $array as $index => $subarray ) {
951
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
950
+		foreach ($array as $index => $subarray) {
951
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
952 952
 				$pos = $index;
953 953
 			}
954 954
 		}
955 955
 
956
-		if ( ! isset( $pos ) ) {
956
+		if ( ! isset($pos)) {
957 957
 			return $array;
958 958
 		}
959 959
 
960 960
 		$array = array_merge(
961
-			array_slice( $array, 0, $pos ),
961
+			array_slice($array, 0, $pos),
962 962
 			$insert,
963
-			array_slice( $array, $pos )
963
+			array_slice($array, $pos)
964 964
 		);
965 965
 	}
966 966
 
@@ -980,23 +980,23 @@  discard block
 block discarded – undo
980 980
  *
981 981
  * @return void
982 982
  */
983
-function give_enabled_gateways_callback( $field_arr, $saved_values = array() ) {
983
+function give_enabled_gateways_callback($field_arr, $saved_values = array()) {
984 984
 
985 985
 	$id       = $field_arr['id'];
986
-	$gateways = give_get_ordered_payment_gateways( give_get_payment_gateways() );
986
+	$gateways = give_get_ordered_payment_gateways(give_get_payment_gateways());
987 987
 
988 988
 	echo '<ul class="give-checklist-fields give-payment-gatways-list">';
989 989
 
990
-	foreach ( $gateways as $key => $option ) :
990
+	foreach ($gateways as $key => $option) :
991 991
 
992
-		if ( is_array( $saved_values ) && array_key_exists( $key, $saved_values ) ) {
992
+		if (is_array($saved_values) && array_key_exists($key, $saved_values)) {
993 993
 			$enabled = '1';
994 994
 		} else {
995 995
 			$enabled = null;
996 996
 		}
997 997
 
998
-		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
999
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
998
+		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
999
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
1000 1000
 
1001 1001
 	endforeach;
1002 1002
 
@@ -1015,16 +1015,16 @@  discard block
 block discarded – undo
1015 1015
  *
1016 1016
  * @return void
1017 1017
  */
1018
-function give_default_gateway_callback( $field_arr, $saved_value ) {
1018
+function give_default_gateway_callback($field_arr, $saved_value) {
1019 1019
 	$id          = $field_arr['id'];
1020 1020
 	$gateways    = give_get_enabled_payment_gateways();
1021
-	$saved_value = give_get_default_gateway( null );
1021
+	$saved_value = give_get_default_gateway(null);
1022 1022
 
1023
-	echo '<select class="give-select" name="' . $id . '" id="' . $id . '">';
1023
+	echo '<select class="give-select" name="'.$id.'" id="'.$id.'">';
1024 1024
 
1025
-	foreach ( $gateways as $key => $option ) :
1026
-		$selected = isset( $saved_value ) ? selected( $key, $saved_value, false ) : '';
1027
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1025
+	foreach ($gateways as $key => $option) :
1026
+		$selected = isset($saved_value) ? selected($key, $saved_value, false) : '';
1027
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1028 1028
 	endforeach;
1029 1029
 
1030 1030
 	echo '</select>';
@@ -1042,13 +1042,13 @@  discard block
 block discarded – undo
1042 1042
  *
1043 1043
  * @return void
1044 1044
  */
1045
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1045
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1046 1046
 
1047 1047
 	$id                = $field_type_object->field->args['id'];
1048 1048
 	$title             = $field_type_object->field->args['name'];
1049 1049
 	$field_description = $field_type_object->field->args['desc'];
1050 1050
 
1051
-	echo '<hr>' . $field_description;
1051
+	echo '<hr>'.$field_description;
1052 1052
 
1053 1053
 }
1054 1054
 
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
  *
1064 1064
  * @return void
1065 1065
  */
1066
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1066
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1067 1067
 
1068 1068
 	$id                = $field_type_object->field->args['id'];
1069 1069
 	$title             = $field_type_object->field->args['name'];
@@ -1082,25 +1082,25 @@  discard block
 block discarded – undo
1082 1082
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1083 1083
  * @return array An array of options that matches the CMB2 options array
1084 1084
  */
1085
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1085
+function give_cmb2_get_post_options($query_args, $force = false) {
1086 1086
 
1087
-	$post_options = array( '' => '' ); // Blank option
1087
+	$post_options = array('' => ''); // Blank option
1088 1088
 
1089
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1089
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1090 1090
 		return $post_options;
1091 1091
 	}
1092 1092
 
1093
-	$args = wp_parse_args( $query_args, array(
1093
+	$args = wp_parse_args($query_args, array(
1094 1094
 		'post_type'   => 'page',
1095 1095
 		'numberposts' => 10,
1096
-	) );
1096
+	));
1097 1097
 
1098
-	$posts = get_posts( $args );
1098
+	$posts = get_posts($args);
1099 1099
 
1100
-	if ( $posts ) {
1101
-		foreach ( $posts as $post ) {
1100
+	if ($posts) {
1101
+		foreach ($posts as $post) {
1102 1102
 
1103
-			$post_options[ $post->ID ] = $post->post_title;
1103
+			$post_options[$post->ID] = $post->post_title;
1104 1104
 
1105 1105
 		}
1106 1106
 	}
@@ -1126,20 +1126,20 @@  discard block
 block discarded – undo
1126 1126
 	$get_sizes = get_intermediate_image_sizes();
1127 1127
 
1128 1128
 	// check whether intermediate image sizes exist first
1129
-	if ( empty( $get_sizes ) ) {
1130
-		$get_sizes = array( 'thumbnail', 'medium', 'medium_large', 'large' );
1129
+	if (empty($get_sizes)) {
1130
+		$get_sizes = array('thumbnail', 'medium', 'medium_large', 'large');
1131 1131
 	}
1132 1132
 
1133
-	foreach ( $get_sizes as $_size ) {
1133
+	foreach ($get_sizes as $_size) {
1134 1134
 
1135
-		if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
1136
-			$sizes[ $_size ] = $_size . ' - ' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1137
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1138
-			$sizes[ $_size ] = $_size . ' - ' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height'];
1135
+		if (in_array($_size, array('thumbnail', 'medium', 'medium_large', 'large'))) {
1136
+			$sizes[$_size] = $_size.' - '.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1137
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1138
+			$sizes[$_size] = $_size.' - '.$_wp_additional_image_sizes[$_size]['width'].'x'.$_wp_additional_image_sizes[$_size]['height'];
1139 1139
 		}
1140 1140
 	}
1141 1141
 
1142
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1142
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1143 1143
 }
1144 1144
 
1145 1145
 
@@ -1154,18 +1154,18 @@  discard block
 block discarded – undo
1154 1154
  *
1155 1155
  * @return void
1156 1156
  */
1157
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1157
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1158 1158
 	/* @var CMB2_Types $field_type_object */
1159 1159
 
1160 1160
 	$id                 = $field_type_object->field->args['id'];
1161 1161
 	$field_description  = $field_type_object->field->args['desc'];
1162 1162
 	$license            = $field_type_object->field->args['options']['license'];
1163 1163
 	$license_key        = $escaped_value;
1164
-	$is_license_key     = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) );
1165
-	$is_valid_license   = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) );
1164
+	$is_license_key     = apply_filters('give_is_license_key', (is_object($license) && ! empty($license)));
1165
+	$is_valid_license   = apply_filters('give_is_valid_license', ($is_license_key && property_exists($license, 'license') && 'valid' === $license->license));
1166 1166
 	$shortname          = $field_type_object->field->args['options']['shortname'];
1167 1167
 	$field_classes      = 'regular-text give-license-field';
1168
-	$type               = empty( $escaped_value ) || ! $is_valid_license ? 'text' : 'password';
1168
+	$type               = empty($escaped_value) || ! $is_valid_license ? 'text' : 'password';
1169 1169
 	$custom_html        = '';
1170 1170
 	$messages           = array();
1171 1171
 	$class              = '';
@@ -1177,135 +1177,135 @@  discard block
 block discarded – undo
1177 1177
 
1178 1178
 	// By default query on edd api url will return license object which contain status and message property, this can break below functionality.
1179 1179
 	// To combat that check if status is set to error or not, if yes then set $is_license_key to false.
1180
-	if ( $is_license_key && property_exists( $license, 'status' ) && 'error' === $license->status ) {
1180
+	if ($is_license_key && property_exists($license, 'status') && 'error' === $license->status) {
1181 1181
 		$is_license_key = false;
1182 1182
 	}
1183 1183
 
1184 1184
 	// Check if current license is part of subscription or not.
1185
-	$subscriptions = get_option( 'give_subscriptions' );
1185
+	$subscriptions = get_option('give_subscriptions');
1186 1186
 
1187
-	if ( $is_license_key && $subscriptions ) {
1188
-		foreach ( $subscriptions as $subscription ) {
1189
-			if ( in_array( $license_key, $subscription['licenses'] ) ) {
1187
+	if ($is_license_key && $subscriptions) {
1188
+		foreach ($subscriptions as $subscription) {
1189
+			if (in_array($license_key, $subscription['licenses'])) {
1190 1190
 				$is_in_subscription = $subscription['id'];
1191 1191
 				break;
1192 1192
 			}
1193 1193
 		}
1194 1194
 	}
1195 1195
 
1196
-	if ( $is_license_key ) {
1197
-		if ( $is_in_subscription ) {
1198
-			$subscription_expires = strtotime( $subscriptions[ $is_in_subscription ]['expires'] );
1199
-			$subscription_status  = esc_html__( 'renew', 'give' );
1196
+	if ($is_license_key) {
1197
+		if ($is_in_subscription) {
1198
+			$subscription_expires = strtotime($subscriptions[$is_in_subscription]['expires']);
1199
+			$subscription_status  = esc_html__('renew', 'give');
1200 1200
 
1201
-			if ( ( 'active' !== $subscriptions[ $is_in_subscription ]['status'] ) ) {
1202
-				$subscription_status = esc_html__( 'expire', 'give' );
1201
+			if (('active' !== $subscriptions[$is_in_subscription]['status'])) {
1202
+				$subscription_status = esc_html__('expire', 'give');
1203 1203
 			}
1204 1204
 
1205
-			if ( $subscription_expires < current_time( 'timestamp', 1 ) ) {
1206
-				$messages[]     = sprintf(
1207
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%1$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ),
1208
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1209
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1210
-					$checkout_page_link . '?edd_license_key=' . $subscriptions[ $is_in_subscription ]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1205
+			if ($subscription_expires < current_time('timestamp', 1)) {
1206
+				$messages[] = sprintf(
1207
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) expired. Please <a href="%1$s" target="_blank" title="Renew your license key">renew your license key</a>', 'give'),
1208
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1209
+					$subscriptions[$is_in_subscription]['payment_id'],
1210
+					$checkout_page_link.'?edd_license_key='.$subscriptions[$is_in_subscription]['license_key'].'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1211 1211
 				);
1212 1212
 				$license_status = 'license-expired';
1213
-			} elseif ( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) {
1213
+			} elseif (strtotime('- 7 days', $subscription_expires) < current_time('timestamp', 1)) {
1214 1214
 				$messages[]     = sprintf(
1215
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %1$s in %1$s.', 'give' ),
1216
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1217
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1215
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %1$s in %1$s.', 'give'),
1216
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1217
+					$subscriptions[$is_in_subscription]['payment_id'],
1218 1218
 					$subscription_status,
1219
-					human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[ $is_in_subscription ]['expires'] ) )
1219
+					human_time_diff(current_time('timestamp', 1), strtotime($subscriptions[$is_in_subscription]['expires']))
1220 1220
 				);
1221 1221
 				$license_status = 'license-expires-soon';
1222 1222
 			} else {
1223 1223
 				$messages[]     = sprintf(
1224
-					__( 'Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %1$s on %1$s.', 'give' ),
1225
-					urldecode( $subscriptions[ $is_in_subscription ]['invoice_url'] ),
1226
-					$subscriptions[ $is_in_subscription ]['payment_id'],
1224
+					__('Your subscription (<a href="%1$s" target="_blank">#%2$d</a>) will %1$s on %1$s.', 'give'),
1225
+					urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1226
+					$subscriptions[$is_in_subscription]['payment_id'],
1227 1227
 					$subscription_status,
1228
-					date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[ $is_in_subscription ]['expires'], current_time( 'timestamp' ) ) )
1228
+					date_i18n(get_option('date_format'), strtotime($subscriptions[$is_in_subscription]['expires'], current_time('timestamp')))
1229 1229
 				);
1230 1230
 				$license_status = 'license-expiration-date';
1231 1231
 			}
1232
-		} elseif ( empty( $license->success ) && property_exists( $license, 'error' ) ) {
1232
+		} elseif (empty($license->success) && property_exists($license, 'error')) {
1233 1233
 
1234 1234
 			// activate_license 'invalid' on anything other than valid, so if there was an error capture it
1235
-			switch ( $license->error ) {
1235
+			switch ($license->error) {
1236 1236
 				case 'expired' :
1237 1237
 					$class          = $license->error;
1238 1238
 					$messages[]     = sprintf(
1239
-						__( 'Your license key expired on %1$s. Please <a href="%1$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="%1$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="%1$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="%1$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="%1$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="%1$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 %1$s.', 'give' ), $license_key, $addon_name );
1278
-					$license_status = 'license-' . $class;
1277
+					$messages[]     = sprintf(__('This license %1$s does not belong to %1$s.', 'give'), $license_key, $addon_name);
1278
+					$license_status = 'license-'.$class;
1279 1279
 					break;
1280 1280
 
1281 1281
 				case 'no_activations_left':
1282 1282
 					$class          = $license->error;
1283
-					$messages[]     = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link );
1284
-					$license_status = 'license-' . $class;
1283
+					$messages[]     = sprintf(__('Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give'), $account_page_link);
1284
+					$license_status = 'license-'.$class;
1285 1285
 					break;
1286 1286
 			}
1287 1287
 		} else {
1288
-			switch ( $license->license ) {
1288
+			switch ($license->license) {
1289 1289
 				case 'valid' :
1290 1290
 				default:
1291 1291
 					$class      = 'valid';
1292
-					$now        = current_time( 'timestamp' );
1293
-					$expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1292
+					$now        = current_time('timestamp');
1293
+					$expiration = strtotime($license->expires, current_time('timestamp'));
1294 1294
 
1295
-					if ( 'lifetime' === $license->expires ) {
1296
-						$messages[]     = esc_html__( 'License key never expires.', 'give' );
1295
+					if ('lifetime' === $license->expires) {
1296
+						$messages[]     = esc_html__('License key never expires.', 'give');
1297 1297
 						$license_status = 'license-lifetime-notice';
1298
-					} elseif ( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1298
+					} elseif ($expiration > $now && $expiration - $now < (DAY_IN_SECONDS * 30)) {
1299 1299
 						$messages[]     = sprintf(
1300
-							__( 'Your license key expires soon! It expires on %1$s. <a href="%1$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ),
1301
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1302
-							$checkout_page_link . '?edd_license_key=' . $value . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1300
+							__('Your license key expires soon! It expires on %1$s. <a href="%1$s" target="_blank" title="Renew license">Renew your license key</a>.', 'give'),
1301
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1302
+							$checkout_page_link.'?edd_license_key='.$value.'&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1303 1303
 						);
1304 1304
 						$license_status = 'license-expires-soon';
1305 1305
 					} else {
1306 1306
 						$messages[]     = sprintf(
1307
-							__( 'Your license key expires on %s.', 'give' ),
1308
-							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1307
+							__('Your license key expires on %s.', 'give'),
1308
+							date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp')))
1309 1309
 						);
1310 1310
 						$license_status = 'license-expiration-date';
1311 1311
 					}
@@ -1313,15 +1313,15 @@  discard block
 block discarded – undo
1313 1313
 			}
1314 1314
 		}
1315 1315
 	} else {
1316
-		$messages[]     = sprintf(
1317
-			__( 'To receive updates, please enter your valid %s license key.', 'give' ),
1316
+		$messages[] = sprintf(
1317
+			__('To receive updates, please enter your valid %s license key.', 'give'),
1318 1318
 			$addon_name
1319 1319
 		);
1320 1320
 		$license_status = 'inactive';
1321 1321
 	}
1322 1322
 
1323 1323
 	// Add class for input field if license is active.
1324
-	if ( $is_valid_license ) {
1324
+	if ($is_valid_license) {
1325 1325
 		$field_classes .= ' give-license-active';
1326 1326
 	}
1327 1327
 
@@ -1329,33 +1329,33 @@  discard block
 block discarded – undo
1329 1329
 	$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\">";
1330 1330
 
1331 1331
 	// If license is active so show deactivate button.
1332
-	if ( $is_valid_license ) {
1332
+	if ($is_valid_license) {
1333 1333
 		// Get input field html.
1334 1334
 		$input_field_html = "<input type=\"{$type}\" name=\"{$id}\" class=\"{$field_classes}\" value=\"{$license_key}\" readonly=\"readonly\">";
1335 1335
 
1336
-		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>';
1336
+		$custom_html = '<input type="submit" class="button button-small give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>';
1337 1337
 
1338 1338
 	}
1339 1339
 
1340 1340
 	// Field description.
1341
-	$custom_html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1341
+	$custom_html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1342 1342
 
1343 1343
 	// If no messages found then inform user that to get updated in future register yourself.
1344
-	if ( empty( $messages ) ) {
1345
-		$messages[] = apply_filters( "{$shortname}_default_addon_notice", esc_html__( 'To receive updates, please enter your valid license key.', 'give' ) );
1344
+	if (empty($messages)) {
1345
+		$messages[] = apply_filters("{$shortname}_default_addon_notice", esc_html__('To receive updates, please enter your valid license key.', 'give'));
1346 1346
 	}
1347 1347
 
1348
-	foreach ( $messages as $message ) {
1349
-		$custom_html .= '<div class="give-license-status-notice give-' . $license_status . '">';
1350
-		$custom_html .= '<p>' . $message . '</p>';
1348
+	foreach ($messages as $message) {
1349
+		$custom_html .= '<div class="give-license-status-notice give-'.$license_status.'">';
1350
+		$custom_html .= '<p>'.$message.'</p>';
1351 1351
 		$custom_html .= '</div>';
1352 1352
 	}
1353 1353
 
1354 1354
 	// Field html.
1355
-	$custom_html = apply_filters( 'give_license_key_field_html', $input_field_html . $custom_html, $field_type_object );
1355
+	$custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object);
1356 1356
 
1357 1357
 	// Nonce.
1358
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1358
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1359 1359
 
1360 1360
 	// Print field html.
1361 1361
 	echo "<div class=\"give-license-key\"><label for=\"{$id}\">{$addon_name }</label></div><div class=\"give-license-block\">{$custom_html}</div>";
@@ -1370,7 +1370,7 @@  discard block
 block discarded – undo
1370 1370
  */
1371 1371
 function give_api_callback() {
1372 1372
 
1373
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1373
+	if ( ! current_user_can('manage_give_settings')) {
1374 1374
 		return;
1375 1375
 	}
1376 1376
 
@@ -1379,9 +1379,9 @@  discard block
 block discarded – undo
1379 1379
 	 *
1380 1380
 	 * @since 1.0
1381 1381
 	 */
1382
-	do_action( 'give_tools_api_keys_before' );
1382
+	do_action('give_tools_api_keys_before');
1383 1383
 
1384
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1384
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1385 1385
 
1386 1386
 	$api_keys_table = new Give_API_Keys_Table();
1387 1387
 	$api_keys_table->prepare_items();
@@ -1390,9 +1390,9 @@  discard block
 block discarded – undo
1390 1390
 	<span class="cmb2-metabox-description api-description">
1391 1391
 		<?php echo sprintf(
1392 1392
 			/* translators: 1: http://docs.givewp.com/api 2: http://docs.givewp.com/addon-zapier */
1393
-			__( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ),
1394
-			esc_url( 'http://docs.givewp.com/api' ),
1395
-			esc_url( 'http://docs.givewp.com/addon-zapier' )
1393
+			__('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'),
1394
+			esc_url('http://docs.givewp.com/api'),
1395
+			esc_url('http://docs.givewp.com/addon-zapier')
1396 1396
 		); ?>
1397 1397
 	</span>
1398 1398
 	<?php
@@ -1402,10 +1402,10 @@  discard block
 block discarded – undo
1402 1402
 	 *
1403 1403
 	 * @since 1.0
1404 1404
 	 */
1405
-	do_action( 'give_tools_api_keys_after' );
1405
+	do_action('give_tools_api_keys_after');
1406 1406
 }
1407 1407
 
1408
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1408
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1409 1409
 
1410 1410
 /**
1411 1411
  * Hook Callback
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
  *
1419 1419
  * @return void
1420 1420
  */
1421
-function give_hook_callback( $args ) {
1421
+function give_hook_callback($args) {
1422 1422
 
1423 1423
 	$id = $args['id'];
1424 1424
 
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
 	 *
1428 1428
 	 * @since 1.0
1429 1429
 	 */
1430
-	do_action( "give_{$id}" );
1430
+	do_action("give_{$id}");
1431 1431
 
1432 1432
 }
1433 1433
 
@@ -1442,19 +1442,19 @@  discard block
 block discarded – undo
1442 1442
  *
1443 1443
  * @return bool
1444 1444
  */
1445
-function give_is_setting_enabled( $value, $compare_with = null ) {
1446
-	if ( ! is_null( $compare_with ) ) {
1445
+function give_is_setting_enabled($value, $compare_with = null) {
1446
+	if ( ! is_null($compare_with)) {
1447 1447
 
1448
-		if ( is_array( $compare_with ) ) {
1448
+		if (is_array($compare_with)) {
1449 1449
 			// Output.
1450
-			return in_array( $value, $compare_with );
1450
+			return in_array($value, $compare_with);
1451 1451
 		}
1452 1452
 
1453 1453
 		// Output.
1454
-		return ( $value === $compare_with );
1454
+		return ($value === $compare_with);
1455 1455
 	}
1456 1456
 
1457 1457
 	// Backward compatibility: From version 1.8 most of setting is modified to enabled/disabled
1458 1458
 	// Output.
1459
-	return ( in_array( $value, array( 'enabled', 'on', 'yes' ) ) ? true : false );
1459
+	return (in_array($value, array('enabled', 'on', 'yes')) ? true : false);
1460 1460
 }
Please login to merge, or discard this patch.
includes/class-give-customer.php 1 patch
Spacing   +169 added lines, -169 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
 
@@ -144,29 +144,29 @@  discard block
 block discarded – undo
144 144
 	 * @param  bool $_id_or_email
145 145
 	 * @param  bool $by_user_id
146 146
 	 */
147
-	public function __construct( $_id_or_email = false, $by_user_id = false ) {
147
+	public function __construct($_id_or_email = false, $by_user_id = false) {
148 148
 
149 149
 		$this->db = new Give_DB_Customers;
150 150
 
151
-		if ( false === $_id_or_email || ( is_numeric( $_id_or_email ) && (int) $_id_or_email !== absint( $_id_or_email ) ) ) {
151
+		if (false === $_id_or_email || (is_numeric($_id_or_email) && (int) $_id_or_email !== absint($_id_or_email))) {
152 152
 			return false;
153 153
 		}
154 154
 
155
-		$by_user_id = is_bool( $by_user_id ) ? $by_user_id : false;
155
+		$by_user_id = is_bool($by_user_id) ? $by_user_id : false;
156 156
 
157
-		if ( is_numeric( $_id_or_email ) ) {
157
+		if (is_numeric($_id_or_email)) {
158 158
 			$field = $by_user_id ? 'user_id' : 'id';
159 159
 		} else {
160 160
 			$field = 'email';
161 161
 		}
162 162
 
163
-		$customer = $this->db->get_customer_by( $field, $_id_or_email );
163
+		$customer = $this->db->get_customer_by($field, $_id_or_email);
164 164
 
165
-		if ( empty( $customer ) || ! is_object( $customer ) ) {
165
+		if (empty($customer) || ! is_object($customer)) {
166 166
 			return false;
167 167
 		}
168 168
 
169
-		$this->setup_customer( $customer );
169
+		$this->setup_customer($customer);
170 170
 
171 171
 	}
172 172
 
@@ -182,15 +182,15 @@  discard block
 block discarded – undo
182 182
 	 *
183 183
 	 * @return bool             If the setup was successful or not.
184 184
 	 */
185
-	private function setup_customer( $customer ) {
185
+	private function setup_customer($customer) {
186 186
 
187
-		if ( ! is_object( $customer ) ) {
187
+		if ( ! is_object($customer)) {
188 188
 			return false;
189 189
 		}
190 190
 
191
-		foreach ( $customer as $key => $value ) {
191
+		foreach ($customer as $key => $value) {
192 192
 
193
-			switch ( $key ) {
193
+			switch ($key) {
194 194
 
195 195
 				case 'notes':
196 196
 					$this->$key = $this->get_notes();
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
 		}
205 205
 
206 206
 		// Get donor's all email including primary email.
207
-		$this->emails   = (array) $this->get_meta( 'additional_email', false );
208
-		$this->emails = array( 'primary' => $this->email ) + $this->emails;
207
+		$this->emails = (array) $this->get_meta('additional_email', false);
208
+		$this->emails = array('primary' => $this->email) + $this->emails;
209 209
 
210 210
 		// Customer ID and email are the only things that are necessary, make sure they exist.
211
-		if ( ! empty( $this->id ) && ! empty( $this->email ) ) {
211
+		if ( ! empty($this->id) && ! empty($this->email)) {
212 212
 			return true;
213 213
 		}
214 214
 
@@ -222,16 +222,16 @@  discard block
 block discarded – undo
222 222
 	 * @since  1.0
223 223
 	 * @access public
224 224
 	 */
225
-	public function __get( $key ) {
225
+	public function __get($key) {
226 226
 
227
-		if ( method_exists( $this, 'get_' . $key ) ) {
227
+		if (method_exists($this, 'get_'.$key)) {
228 228
 
229
-			return call_user_func( array( $this, 'get_' . $key ) );
229
+			return call_user_func(array($this, 'get_'.$key));
230 230
 
231 231
 		} else {
232 232
 
233 233
 			/* translators: %s: property key */
234
-			return new WP_Error( 'give-customer-invalid-property', sprintf( esc_html__( 'Can\'t get property %s.', 'give' ), $key ) );
234
+			return new WP_Error('give-customer-invalid-property', sprintf(esc_html__('Can\'t get property %s.', 'give'), $key));
235 235
 
236 236
 		}
237 237
 
@@ -247,9 +247,9 @@  discard block
 block discarded – undo
247 247
 	 *
248 248
 	 * @return bool|int    False if not a valid creation, customer ID if user is found or valid creation.
249 249
 	 */
250
-	public function create( $data = array() ) {
250
+	public function create($data = array()) {
251 251
 
252
-		if ( $this->id != 0 || empty( $data ) ) {
252
+		if ($this->id != 0 || empty($data)) {
253 253
 			return false;
254 254
 		}
255 255
 
@@ -257,15 +257,15 @@  discard block
 block discarded – undo
257 257
 			'payment_ids' => '',
258 258
 		);
259 259
 
260
-		$args = wp_parse_args( $data, $defaults );
261
-		$args = $this->sanitize_columns( $args );
260
+		$args = wp_parse_args($data, $defaults);
261
+		$args = $this->sanitize_columns($args);
262 262
 
263
-		if ( empty( $args['email'] ) || ! is_email( $args['email'] ) ) {
263
+		if (empty($args['email']) || ! is_email($args['email'])) {
264 264
 			return false;
265 265
 		}
266 266
 
267
-		if ( ! empty( $args['payment_ids'] ) && is_array( $args['payment_ids'] ) ) {
268
-			$args['payment_ids'] = implode( ',', array_unique( array_values( $args['payment_ids'] ) ) );
267
+		if ( ! empty($args['payment_ids']) && is_array($args['payment_ids'])) {
268
+			$args['payment_ids'] = implode(',', array_unique(array_values($args['payment_ids'])));
269 269
 		}
270 270
 
271 271
 		/**
@@ -275,18 +275,18 @@  discard block
 block discarded – undo
275 275
 		 *
276 276
 		 * @param array $args Customer attributes.
277 277
 		 */
278
-		do_action( 'give_customer_pre_create', $args );
278
+		do_action('give_customer_pre_create', $args);
279 279
 
280 280
 		$created = false;
281 281
 
282 282
 		// The DB class 'add' implies an update if the customer being asked to be created already exists
283
-		if ( $this->db->add( $data ) ) {
283
+		if ($this->db->add($data)) {
284 284
 
285 285
 			// We've successfully added/updated the customer, reset the class vars with the new data
286
-			$customer = $this->db->get_customer_by( 'email', $args['email'] );
286
+			$customer = $this->db->get_customer_by('email', $args['email']);
287 287
 
288 288
 			// Setup the customer data with the values from DB
289
-			$this->setup_customer( $customer );
289
+			$this->setup_customer($customer);
290 290
 
291 291
 			$created = $this->id;
292 292
 		}
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 		 *                          customer ID if user is found or valid creation.
301 301
 		 * @param array    $args    Customer attributes.
302 302
 		 */
303
-		do_action( 'give_customer_post_create', $created, $args );
303
+		do_action('give_customer_post_create', $created, $args);
304 304
 
305 305
 		return $created;
306 306
 
@@ -316,13 +316,13 @@  discard block
 block discarded – undo
316 316
 	 *
317 317
 	 * @return bool        If the update was successful or not.
318 318
 	 */
319
-	public function update( $data = array() ) {
319
+	public function update($data = array()) {
320 320
 
321
-		if ( empty( $data ) ) {
321
+		if (empty($data)) {
322 322
 			return false;
323 323
 		}
324 324
 
325
-		$data = $this->sanitize_columns( $data );
325
+		$data = $this->sanitize_columns($data);
326 326
 
327 327
 		/**
328 328
 		 * Fires before updating customers.
@@ -332,14 +332,14 @@  discard block
 block discarded – undo
332 332
 		 * @param int   $customer_id Customer id.
333 333
 		 * @param array $data        Customer attributes.
334 334
 		 */
335
-		do_action( 'give_customer_pre_update', $this->id, $data );
335
+		do_action('give_customer_pre_update', $this->id, $data);
336 336
 
337 337
 		$updated = false;
338 338
 
339
-		if ( $this->db->update( $this->id, $data ) ) {
339
+		if ($this->db->update($this->id, $data)) {
340 340
 
341
-			$customer = $this->db->get_customer_by( 'id', $this->id );
342
-			$this->setup_customer( $customer );
341
+			$customer = $this->db->get_customer_by('id', $this->id);
342
+			$this->setup_customer($customer);
343 343
 
344 344
 			$updated = true;
345 345
 		}
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 		 * @param int   $customer_id Customer id.
354 354
 		 * @param array $data        Customer attributes.
355 355
 		 */
356
-		do_action( 'give_customer_post_update', $updated, $this->id, $data );
356
+		do_action('give_customer_post_update', $updated, $this->id, $data);
357 357
 
358 358
 		return $updated;
359 359
 	}
@@ -371,27 +371,27 @@  discard block
 block discarded – undo
371 371
 	 *
372 372
 	 * @return bool            If the attachment was successfuly.
373 373
 	 */
374
-	public function attach_payment( $payment_id = 0, $update_stats = true ) {
374
+	public function attach_payment($payment_id = 0, $update_stats = true) {
375 375
 
376
-		if ( empty( $payment_id ) ) {
376
+		if (empty($payment_id)) {
377 377
 			return false;
378 378
 		}
379 379
 
380
-		if ( empty( $this->payment_ids ) ) {
380
+		if (empty($this->payment_ids)) {
381 381
 
382 382
 			$new_payment_ids = $payment_id;
383 383
 
384 384
 		} else {
385 385
 
386
-			$payment_ids = array_map( 'absint', explode( ',', $this->payment_ids ) );
386
+			$payment_ids = array_map('absint', explode(',', $this->payment_ids));
387 387
 
388
-			if ( in_array( $payment_id, $payment_ids ) ) {
388
+			if (in_array($payment_id, $payment_ids)) {
389 389
 				$update_stats = false;
390 390
 			}
391 391
 
392 392
 			$payment_ids[] = $payment_id;
393 393
 
394
-			$new_payment_ids = implode( ',', array_unique( array_values( $payment_ids ) ) );
394
+			$new_payment_ids = implode(',', array_unique(array_values($payment_ids)));
395 395
 
396 396
 		}
397 397
 
@@ -403,20 +403,20 @@  discard block
 block discarded – undo
403 403
 		 * @param int $payment_id  Payment id.
404 404
 		 * @param int $customer_id Customer id.
405 405
 		 */
406
-		do_action( 'give_customer_pre_attach_payment', $payment_id, $this->id );
406
+		do_action('give_customer_pre_attach_payment', $payment_id, $this->id);
407 407
 
408
-		$payment_added = $this->update( array( 'payment_ids' => $new_payment_ids ) );
408
+		$payment_added = $this->update(array('payment_ids' => $new_payment_ids));
409 409
 
410
-		if ( $payment_added ) {
410
+		if ($payment_added) {
411 411
 
412 412
 			$this->payment_ids = $new_payment_ids;
413 413
 
414 414
 			// We added this payment successfully, increment the stats
415
-			if ( $update_stats ) {
416
-				$payment_amount = give_get_payment_amount( $payment_id );
415
+			if ($update_stats) {
416
+				$payment_amount = give_get_payment_amount($payment_id);
417 417
 
418
-				if ( ! empty( $payment_amount ) ) {
419
-					$this->increase_value( $payment_amount );
418
+				if ( ! empty($payment_amount)) {
419
+					$this->increase_value($payment_amount);
420 420
 				}
421 421
 
422 422
 				$this->increase_purchase_count();
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 		 * @param int  $payment_id    Payment id.
433 433
 		 * @param int  $customer_id   Customer id.
434 434
 		 */
435
-		do_action( 'give_customer_post_attach_payment', $payment_added, $payment_id, $this->id );
435
+		do_action('give_customer_post_attach_payment', $payment_added, $payment_id, $this->id);
436 436
 
437 437
 		return $payment_added;
438 438
 	}
@@ -450,33 +450,33 @@  discard block
 block discarded – undo
450 450
 	 *
451 451
 	 * @return boolean               If the removal was successful.
452 452
 	 */
453
-	public function remove_payment( $payment_id = 0, $update_stats = true ) {
453
+	public function remove_payment($payment_id = 0, $update_stats = true) {
454 454
 
455
-		if ( empty( $payment_id ) ) {
455
+		if (empty($payment_id)) {
456 456
 			return false;
457 457
 		}
458 458
 
459
-		$payment = new Give_Payment( $payment_id );
459
+		$payment = new Give_Payment($payment_id);
460 460
 
461
-		if ( 'publish' !== $payment->status && 'revoked' !== $payment->status ) {
461
+		if ('publish' !== $payment->status && 'revoked' !== $payment->status) {
462 462
 			$update_stats = false;
463 463
 		}
464 464
 
465 465
 		$new_payment_ids = '';
466 466
 
467
-		if ( ! empty( $this->payment_ids ) ) {
467
+		if ( ! empty($this->payment_ids)) {
468 468
 
469
-			$payment_ids = array_map( 'absint', explode( ',', $this->payment_ids ) );
469
+			$payment_ids = array_map('absint', explode(',', $this->payment_ids));
470 470
 
471
-			$pos = array_search( $payment_id, $payment_ids );
472
-			if ( false === $pos ) {
471
+			$pos = array_search($payment_id, $payment_ids);
472
+			if (false === $pos) {
473 473
 				return false;
474 474
 			}
475 475
 
476
-			unset( $payment_ids[ $pos ] );
477
-			$payment_ids = array_filter( $payment_ids );
476
+			unset($payment_ids[$pos]);
477
+			$payment_ids = array_filter($payment_ids);
478 478
 
479
-			$new_payment_ids = implode( ',', array_unique( array_values( $payment_ids ) ) );
479
+			$new_payment_ids = implode(',', array_unique(array_values($payment_ids)));
480 480
 
481 481
 		}
482 482
 
@@ -488,20 +488,20 @@  discard block
 block discarded – undo
488 488
 		 * @param int $payment_id  Payment id.
489 489
 		 * @param int $customer_id Customer id.
490 490
 		 */
491
-		do_action( 'give_customer_pre_remove_payment', $payment_id, $this->id );
491
+		do_action('give_customer_pre_remove_payment', $payment_id, $this->id);
492 492
 
493
-		$payment_removed = $this->update( array( 'payment_ids' => $new_payment_ids ) );
493
+		$payment_removed = $this->update(array('payment_ids' => $new_payment_ids));
494 494
 
495
-		if ( $payment_removed ) {
495
+		if ($payment_removed) {
496 496
 
497 497
 			$this->payment_ids = $new_payment_ids;
498 498
 
499
-			if ( $update_stats ) {
499
+			if ($update_stats) {
500 500
 				// We removed this payment successfully, decrement the stats
501
-				$payment_amount = give_get_payment_amount( $payment_id );
501
+				$payment_amount = give_get_payment_amount($payment_id);
502 502
 
503
-				if ( ! empty( $payment_amount ) ) {
504
-					$this->decrease_value( $payment_amount );
503
+				if ( ! empty($payment_amount)) {
504
+					$this->decrease_value($payment_amount);
505 505
 				}
506 506
 
507 507
 				$this->decrease_purchase_count();
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 		 * @param int  $payment_id      Payment id.
518 518
 		 * @param int  $customer_id     Customer id.
519 519
 		 */
520
-		do_action( 'give_customer_post_remove_payment', $payment_removed, $payment_id, $this->id );
520
+		do_action('give_customer_post_remove_payment', $payment_removed, $payment_id, $this->id);
521 521
 
522 522
 		return $payment_removed;
523 523
 
@@ -533,10 +533,10 @@  discard block
 block discarded – undo
533 533
 	 *
534 534
 	 * @return int        The donation count.
535 535
 	 */
536
-	public function increase_purchase_count( $count = 1 ) {
536
+	public function increase_purchase_count($count = 1) {
537 537
 
538 538
 		// Make sure it's numeric and not negative.
539
-		if ( ! is_numeric( $count ) || $count != absint( $count ) ) {
539
+		if ( ! is_numeric($count) || $count != absint($count)) {
540 540
 			return false;
541 541
 		}
542 542
 
@@ -550,9 +550,9 @@  discard block
 block discarded – undo
550 550
 		 * @param int $count       The number to increase by.
551 551
 		 * @param int $customer_id Customer id.
552 552
 		 */
553
-		do_action( 'give_customer_pre_increase_purchase_count', $count, $this->id );
553
+		do_action('give_customer_pre_increase_purchase_count', $count, $this->id);
554 554
 
555
-		if ( $this->update( array( 'purchase_count' => $new_total ) ) ) {
555
+		if ($this->update(array('purchase_count' => $new_total))) {
556 556
 			$this->purchase_count = $new_total;
557 557
 		}
558 558
 
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 		 * @param int $count          The number increased by.
566 566
 		 * @param int $customer_id    Customer id.
567 567
 		 */
568
-		do_action( 'give_customer_post_increase_purchase_count', $this->purchase_count, $count, $this->id );
568
+		do_action('give_customer_post_increase_purchase_count', $this->purchase_count, $count, $this->id);
569 569
 
570 570
 		return $this->purchase_count;
571 571
 	}
@@ -580,16 +580,16 @@  discard block
 block discarded – undo
580 580
 	 *
581 581
 	 * @return mixed      If successful, the new count, otherwise false.
582 582
 	 */
583
-	public function decrease_purchase_count( $count = 1 ) {
583
+	public function decrease_purchase_count($count = 1) {
584 584
 
585 585
 		// Make sure it's numeric and not negative
586
-		if ( ! is_numeric( $count ) || $count != absint( $count ) ) {
586
+		if ( ! is_numeric($count) || $count != absint($count)) {
587 587
 			return false;
588 588
 		}
589 589
 
590 590
 		$new_total = (int) $this->purchase_count - (int) $count;
591 591
 
592
-		if ( $new_total < 0 ) {
592
+		if ($new_total < 0) {
593 593
 			$new_total = 0;
594 594
 		}
595 595
 
@@ -601,9 +601,9 @@  discard block
 block discarded – undo
601 601
 		 * @param int $count       The number to decrease by.
602 602
 		 * @param int $customer_id Customer id.
603 603
 		 */
604
-		do_action( 'give_customer_pre_decrease_purchase_count', $count, $this->id );
604
+		do_action('give_customer_pre_decrease_purchase_count', $count, $this->id);
605 605
 
606
-		if ( $this->update( array( 'purchase_count' => $new_total ) ) ) {
606
+		if ($this->update(array('purchase_count' => $new_total))) {
607 607
 			$this->purchase_count = $new_total;
608 608
 		}
609 609
 
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 		 * @param int $count          The number decreased by.
617 617
 		 * @param int $customer_id    Customer id.
618 618
 		 */
619
-		do_action( 'give_customer_post_decrease_purchase_count', $this->purchase_count, $count, $this->id );
619
+		do_action('give_customer_post_decrease_purchase_count', $this->purchase_count, $count, $this->id);
620 620
 
621 621
 		return $this->purchase_count;
622 622
 	}
@@ -631,9 +631,9 @@  discard block
 block discarded – undo
631 631
 	 *
632 632
 	 * @return mixed        If successful, the new value, otherwise false.
633 633
 	 */
634
-	public function increase_value( $value = 0.00 ) {
634
+	public function increase_value($value = 0.00) {
635 635
 
636
-		$new_value = floatval( $this->purchase_value ) + $value;
636
+		$new_value = floatval($this->purchase_value) + $value;
637 637
 
638 638
 		/**
639 639
 		 * Fires before increasing customer lifetime value.
@@ -643,9 +643,9 @@  discard block
 block discarded – undo
643 643
 		 * @param float $value       The value to increase by.
644 644
 		 * @param int   $customer_id Customer id.
645 645
 		 */
646
-		do_action( 'give_customer_pre_increase_value', $value, $this->id );
646
+		do_action('give_customer_pre_increase_value', $value, $this->id);
647 647
 
648
-		if ( $this->update( array( 'purchase_value' => $new_value ) ) ) {
648
+		if ($this->update(array('purchase_value' => $new_value))) {
649 649
 			$this->purchase_value = $new_value;
650 650
 		}
651 651
 
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 		 * @param float $value          The value increased by.
659 659
 		 * @param int   $customer_id    Customer id.
660 660
 		 */
661
-		do_action( 'give_customer_post_increase_value', $this->purchase_value, $value, $this->id );
661
+		do_action('give_customer_post_increase_value', $this->purchase_value, $value, $this->id);
662 662
 
663 663
 		return $this->purchase_value;
664 664
 	}
@@ -673,11 +673,11 @@  discard block
 block discarded – undo
673 673
 	 *
674 674
 	 * @return mixed        If successful, the new value, otherwise false.
675 675
 	 */
676
-	public function decrease_value( $value = 0.00 ) {
676
+	public function decrease_value($value = 0.00) {
677 677
 
678
-		$new_value = floatval( $this->purchase_value ) - $value;
678
+		$new_value = floatval($this->purchase_value) - $value;
679 679
 
680
-		if ( $new_value < 0 ) {
680
+		if ($new_value < 0) {
681 681
 			$new_value = 0.00;
682 682
 		}
683 683
 
@@ -689,9 +689,9 @@  discard block
 block discarded – undo
689 689
 		 * @param float $value       The value to decrease by.
690 690
 		 * @param int   $customer_id Customer id.
691 691
 		 */
692
-		do_action( 'give_customer_pre_decrease_value', $value, $this->id );
692
+		do_action('give_customer_pre_decrease_value', $value, $this->id);
693 693
 
694
-		if ( $this->update( array( 'purchase_value' => $new_value ) ) ) {
694
+		if ($this->update(array('purchase_value' => $new_value))) {
695 695
 			$this->purchase_value = $new_value;
696 696
 		}
697 697
 
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 		 * @param float $value          The value decreased by.
705 705
 		 * @param int   $customer_id    Customer id.
706 706
 		 */
707
-		do_action( 'give_customer_post_decrease_value', $this->purchase_value, $value, $this->id );
707
+		do_action('give_customer_post_decrease_value', $this->purchase_value, $value, $this->id);
708 708
 
709 709
 		return $this->purchase_value;
710 710
 	}
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 	 *
724 724
 	 * @return mixed              If successful, the new donation stat value, otherwise false.
725 725
 	 */
726
-	public function update_donation_value( $curr_amount, $new_amount ) {
726
+	public function update_donation_value($curr_amount, $new_amount) {
727 727
 		/**
728 728
 		 * Payment total difference value can be:
729 729
 		 *  zero   (in case amount not change)
@@ -733,12 +733,12 @@  discard block
 block discarded – undo
733 733
 		$payment_total_diff = $new_amount - $curr_amount;
734 734
 
735 735
 		// We do not need to update donation stat if donation did not change.
736
-		if ( ! $payment_total_diff ) {
736
+		if ( ! $payment_total_diff) {
737 737
 			return false;
738 738
 		}
739 739
 
740
-		if ( $payment_total_diff > 0 ) {
741
-			$this->increase_value( $payment_total_diff );
740
+		if ($payment_total_diff > 0) {
741
+			$this->increase_value($payment_total_diff);
742 742
 		} else {
743 743
 			// Pass payment total difference as +ve value to decrease amount from user lifetime stat.
744 744
 			$this->decrease_value( -$payment_total_diff );
@@ -758,15 +758,15 @@  discard block
 block discarded – undo
758 758
 	 *
759 759
 	 * @return array       The notes requested.
760 760
 	 */
761
-	public function get_notes( $length = 20, $paged = 1 ) {
761
+	public function get_notes($length = 20, $paged = 1) {
762 762
 
763
-		$length = is_numeric( $length ) ? $length : 20;
764
-		$offset = is_numeric( $paged ) && $paged != 1 ? ( ( absint( $paged ) - 1 ) * $length ) : 0;
763
+		$length = is_numeric($length) ? $length : 20;
764
+		$offset = is_numeric($paged) && $paged != 1 ? ((absint($paged) - 1) * $length) : 0;
765 765
 
766 766
 		$all_notes   = $this->get_raw_notes();
767
-		$notes_array = array_reverse( array_filter( explode( "\n\n", $all_notes ) ) );
767
+		$notes_array = array_reverse(array_filter(explode("\n\n", $all_notes)));
768 768
 
769
-		$desired_notes = array_slice( $notes_array, $offset, $length );
769
+		$desired_notes = array_slice($notes_array, $offset, $length);
770 770
 
771 771
 		return $desired_notes;
772 772
 
@@ -783,9 +783,9 @@  discard block
 block discarded – undo
783 783
 	public function get_notes_count() {
784 784
 
785 785
 		$all_notes   = $this->get_raw_notes();
786
-		$notes_array = array_reverse( array_filter( explode( "\n\n", $all_notes ) ) );
786
+		$notes_array = array_reverse(array_filter(explode("\n\n", $all_notes)));
787 787
 
788
-		return count( $notes_array );
788
+		return count($notes_array);
789 789
 
790 790
 	}
791 791
 
@@ -799,22 +799,22 @@  discard block
 block discarded – undo
799 799
 	 *
800 800
 	 * @return string|boolean The new note if added successfully, false otherwise.
801 801
 	 */
802
-	public function add_note( $note = '' ) {
802
+	public function add_note($note = '') {
803 803
 
804
-		$note = trim( $note );
805
-		if ( empty( $note ) ) {
804
+		$note = trim($note);
805
+		if (empty($note)) {
806 806
 			return false;
807 807
 		}
808 808
 
809 809
 		$notes = $this->get_raw_notes();
810 810
 
811
-		if ( empty( $notes ) ) {
811
+		if (empty($notes)) {
812 812
 			$notes = '';
813 813
 		}
814 814
 
815
-		$note_string = date_i18n( 'F j, Y H:i:s', current_time( 'timestamp' ) ) . ' - ' . $note;
816
-		$new_note    = apply_filters( 'give_customer_add_note_string', $note_string );
817
-		$notes .= "\n\n" . $new_note;
815
+		$note_string = date_i18n('F j, Y H:i:s', current_time('timestamp')).' - '.$note;
816
+		$new_note    = apply_filters('give_customer_add_note_string', $note_string);
817
+		$notes .= "\n\n".$new_note;
818 818
 
819 819
 		/**
820 820
 		 * Fires before customer note added.
@@ -824,11 +824,11 @@  discard block
 block discarded – undo
824 824
 		 * @param string $new_note    New note to add.
825 825
 		 * @param int    $customer_id Customer id.
826 826
 		 */
827
-		do_action( 'give_customer_pre_add_note', $new_note, $this->id );
827
+		do_action('give_customer_pre_add_note', $new_note, $this->id);
828 828
 
829
-		$updated = $this->update( array( 'notes' => $notes ) );
829
+		$updated = $this->update(array('notes' => $notes));
830 830
 
831
-		if ( $updated ) {
831
+		if ($updated) {
832 832
 			$this->notes = $this->get_notes();
833 833
 		}
834 834
 
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
 		 * @param string $new_note       New note added.
842 842
 		 * @param int    $customer_id    Customer id.
843 843
 		 */
844
-		do_action( 'give_customer_post_add_note', $this->notes, $new_note, $this->id );
844
+		do_action('give_customer_post_add_note', $this->notes, $new_note, $this->id);
845 845
 
846 846
 		// Return the formatted note, so we can test, as well as update any displays
847 847
 		return $new_note;
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
 	 */
859 859
 	private function get_raw_notes() {
860 860
 
861
-		$all_notes = $this->db->get_column( 'notes', $this->id );
861
+		$all_notes = $this->db->get_column('notes', $this->id);
862 862
 
863 863
 		return $all_notes;
864 864
 
@@ -875,8 +875,8 @@  discard block
 block discarded – undo
875 875
 	 *
876 876
 	 * @return mixed            Will be an array if $single is false. Will be value of meta data field if $single is true.
877 877
 	 */
878
-	public function get_meta( $meta_key = '', $single = true ) {
879
-		return Give()->customer_meta->get_meta( $this->id, $meta_key, $single );
878
+	public function get_meta($meta_key = '', $single = true) {
879
+		return Give()->customer_meta->get_meta($this->id, $meta_key, $single);
880 880
 	}
881 881
 
882 882
 	/**
@@ -891,8 +891,8 @@  discard block
 block discarded – undo
891 891
 	 *
892 892
 	 * @return bool               False for failure. True for success.
893 893
 	 */
894
-	public function add_meta( $meta_key = '', $meta_value, $unique = false ) {
895
-		return Give()->customer_meta->add_meta( $this->id, $meta_key, $meta_value, $unique );
894
+	public function add_meta($meta_key = '', $meta_value, $unique = false) {
895
+		return Give()->customer_meta->add_meta($this->id, $meta_key, $meta_value, $unique);
896 896
 	}
897 897
 
898 898
 	/**
@@ -907,8 +907,8 @@  discard block
 block discarded – undo
907 907
 	 *
908 908
 	 * @return bool               False on failure, true if success.
909 909
 	 */
910
-	public function update_meta( $meta_key = '', $meta_value, $prev_value = '' ) {
911
-		return Give()->customer_meta->update_meta( $this->id, $meta_key, $meta_value, $prev_value );
910
+	public function update_meta($meta_key = '', $meta_value, $prev_value = '') {
911
+		return Give()->customer_meta->update_meta($this->id, $meta_key, $meta_value, $prev_value);
912 912
 	}
913 913
 
914 914
 	/**
@@ -922,8 +922,8 @@  discard block
 block discarded – undo
922 922
 	 *
923 923
 	 * @return bool               False for failure. True for success.
924 924
 	 */
925
-	public function delete_meta( $meta_key = '', $meta_value = '' ) {
926
-		return Give()->customer_meta->delete_meta( $this->id, $meta_key, $meta_value );
925
+	public function delete_meta($meta_key = '', $meta_value = '') {
926
+		return Give()->customer_meta->delete_meta($this->id, $meta_key, $meta_value);
927 927
 	}
928 928
 
929 929
 	/**
@@ -936,51 +936,51 @@  discard block
 block discarded – undo
936 936
 	 *
937 937
 	 * @return array       The sanitized data, based off column defaults.
938 938
 	 */
939
-	private function sanitize_columns( $data ) {
939
+	private function sanitize_columns($data) {
940 940
 
941 941
 		$columns        = $this->db->get_columns();
942 942
 		$default_values = $this->db->get_column_defaults();
943 943
 
944
-		foreach ( $columns as $key => $type ) {
944
+		foreach ($columns as $key => $type) {
945 945
 
946 946
 			// Only sanitize data that we were provided
947
-			if ( ! array_key_exists( $key, $data ) ) {
947
+			if ( ! array_key_exists($key, $data)) {
948 948
 				continue;
949 949
 			}
950 950
 
951
-			switch ( $type ) {
951
+			switch ($type) {
952 952
 
953 953
 				case '%s':
954
-					if ( 'email' == $key ) {
955
-						$data[ $key ] = sanitize_email( $data[ $key ] );
956
-					} elseif ( 'notes' == $key ) {
957
-						$data[ $key ] = strip_tags( $data[ $key ] );
954
+					if ('email' == $key) {
955
+						$data[$key] = sanitize_email($data[$key]);
956
+					} elseif ('notes' == $key) {
957
+						$data[$key] = strip_tags($data[$key]);
958 958
 					} else {
959
-						$data[ $key ] = sanitize_text_field( $data[ $key ] );
959
+						$data[$key] = sanitize_text_field($data[$key]);
960 960
 					}
961 961
 					break;
962 962
 
963 963
 				case '%d':
964
-					if ( ! is_numeric( $data[ $key ] ) || (int) $data[ $key ] !== absint( $data[ $key ] ) ) {
965
-						$data[ $key ] = $default_values[ $key ];
964
+					if ( ! is_numeric($data[$key]) || (int) $data[$key] !== absint($data[$key])) {
965
+						$data[$key] = $default_values[$key];
966 966
 					} else {
967
-						$data[ $key ] = absint( $data[ $key ] );
967
+						$data[$key] = absint($data[$key]);
968 968
 					}
969 969
 					break;
970 970
 
971 971
 				case '%f':
972 972
 					// Convert what was given to a float
973
-					$value = floatval( $data[ $key ] );
973
+					$value = floatval($data[$key]);
974 974
 
975
-					if ( ! is_float( $value ) ) {
976
-						$data[ $key ] = $default_values[ $key ];
975
+					if ( ! is_float($value)) {
976
+						$data[$key] = $default_values[$key];
977 977
 					} else {
978
-						$data[ $key ] = $value;
978
+						$data[$key] = $value;
979 979
 					}
980 980
 					break;
981 981
 
982 982
 				default:
983
-					$data[ $key ] = sanitize_text_field( $data[ $key ] );
983
+					$data[$key] = sanitize_text_field($data[$key]);
984 984
 					break;
985 985
 
986 986
 			}
@@ -1000,33 +1000,33 @@  discard block
 block discarded – undo
1000 1000
 	 *
1001 1001
 	 * @return bool            If the email was added successfully
1002 1002
 	 */
1003
-	public function add_email( $email = '', $primary = false ) {
1004
-		if ( ! is_email( $email ) ) {
1003
+	public function add_email($email = '', $primary = false) {
1004
+		if ( ! is_email($email)) {
1005 1005
 			return false;
1006 1006
 		}
1007
-		$existing = new Give_Customer( $email );
1007
+		$existing = new Give_Customer($email);
1008 1008
 
1009
-		if ( $existing->id > 0 ) {
1009
+		if ($existing->id > 0) {
1010 1010
 			// Email address already belongs to another customer
1011 1011
 			return false;
1012 1012
 		}
1013 1013
 
1014
-		if ( email_exists( $email ) ) {
1015
-			$user = get_user_by( 'email', $email );
1016
-			if ( $user->ID != $this->user_id ) {
1014
+		if (email_exists($email)) {
1015
+			$user = get_user_by('email', $email);
1016
+			if ($user->ID != $this->user_id) {
1017 1017
 				return false;
1018 1018
 			}
1019 1019
 		}
1020 1020
 
1021
-		do_action( 'give_donor_pre_add_email', $email, $this->id, $this );
1021
+		do_action('give_donor_pre_add_email', $email, $this->id, $this);
1022 1022
 
1023 1023
 		// Add is used to ensure duplicate emails are not added
1024
-		$ret = (bool) $this->add_meta( 'additional_email', $email );
1024
+		$ret = (bool) $this->add_meta('additional_email', $email);
1025 1025
 
1026
-		do_action( 'give_donor_post_add_email', $email, $this->id, $this );
1026
+		do_action('give_donor_post_add_email', $email, $this->id, $this);
1027 1027
 
1028
-		if ( $ret && true === $primary ) {
1029
-			$this->set_primary_email( $email );
1028
+		if ($ret && true === $primary) {
1029
+			$this->set_primary_email($email);
1030 1030
 		}
1031 1031
 
1032 1032
 		return $ret;
@@ -1042,16 +1042,16 @@  discard block
 block discarded – undo
1042 1042
 	 *
1043 1043
 	 * @return bool          If the email was removed successfully
1044 1044
 	 */
1045
-	public function remove_email( $email = '' ) {
1046
-		if ( ! is_email( $email ) ) {
1045
+	public function remove_email($email = '') {
1046
+		if ( ! is_email($email)) {
1047 1047
 			return false;
1048 1048
 		}
1049 1049
 
1050
-		do_action( 'give_donor_pre_remove_email', $email, $this->id, $this );
1050
+		do_action('give_donor_pre_remove_email', $email, $this->id, $this);
1051 1051
 
1052
-		$ret = (bool) $this->delete_meta( 'additional_email', $email );
1052
+		$ret = (bool) $this->delete_meta('additional_email', $email);
1053 1053
 
1054
-		do_action( 'give_donor_post_remove_email', $email, $this->id, $this );
1054
+		do_action('give_donor_post_remove_email', $email, $this->id, $this);
1055 1055
 
1056 1056
 		return $ret;
1057 1057
 	}
@@ -1068,16 +1068,16 @@  discard block
 block discarded – undo
1068 1068
 	 *
1069 1069
 	 * @return bool                      If the email was set as primary successfully
1070 1070
 	 */
1071
-	public function set_primary_email( $new_primary_email = '' ) {
1072
-		if ( ! is_email( $new_primary_email ) ) {
1071
+	public function set_primary_email($new_primary_email = '') {
1072
+		if ( ! is_email($new_primary_email)) {
1073 1073
 			return false;
1074 1074
 		}
1075 1075
 
1076
-		do_action( 'give_donor_pre_set_primary_email', $new_primary_email, $this->id, $this );
1076
+		do_action('give_donor_pre_set_primary_email', $new_primary_email, $this->id, $this);
1077 1077
 
1078
-		$existing = new Give_Customer( $new_primary_email );
1078
+		$existing = new Give_Customer($new_primary_email);
1079 1079
 
1080
-		if ( $existing->id > 0 && (int) $existing->id !== (int) $this->id ) {
1080
+		if ($existing->id > 0 && (int) $existing->id !== (int) $this->id) {
1081 1081
 			// This email belongs to another customer
1082 1082
 			return false;
1083 1083
 		}
@@ -1085,21 +1085,21 @@  discard block
 block discarded – undo
1085 1085
 		$old_email = $this->email;
1086 1086
 
1087 1087
 		// Update customer record with new email
1088
-		$update = $this->update( array( 'email' => $new_primary_email ) );
1088
+		$update = $this->update(array('email' => $new_primary_email));
1089 1089
 
1090 1090
 		// Remove new primary from list of additional emails
1091
-		$remove = $this->remove_email( $new_primary_email );
1091
+		$remove = $this->remove_email($new_primary_email);
1092 1092
 
1093 1093
 		// Add old email to additional emails list
1094
-		$add = $this->add_email( $old_email );
1094
+		$add = $this->add_email($old_email);
1095 1095
 
1096 1096
 		$ret = $update && $remove && $add;
1097 1097
 
1098
-		if ( $ret ) {
1098
+		if ($ret) {
1099 1099
 			$this->email = $new_primary_email;
1100 1100
 		}
1101 1101
 
1102
-		do_action( 'give_donor_post_set_primary_email', $new_primary_email, $this->id, $this );
1102
+		do_action('give_donor_post_set_primary_email', $new_primary_email, $this->id, $this);
1103 1103
 
1104 1104
 		return $ret;
1105 1105
 	}
Please login to merge, or discard this patch.