Test Failed
Pull Request — master (#2814)
by Devin
05:29
created
includes/admin/shortcodes/shortcode-give-login.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,16 +42,16 @@
 block discarded – undo
42 42
 				'minWidth' => 320,
43 43
 				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ),
44 44
 			),
45
-            array(
46
-                'type' => 'container',
47
-                'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
48
-            ),
49
-            array(
50
-                'type'     => 'textbox',
51
-                'name'     => 'logout-redirect',
52
-                'minWidth' => 320,
53
-                'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
54
-            ),
45
+			array(
46
+				'type' => 'container',
47
+				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
48
+			),
49
+			array(
50
+				'type'     => 'textbox',
51
+				'name'     => 'logout-redirect',
52
+				'minWidth' => 320,
53
+				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
54
+			),
55 55
 		);
56 56
 	}
57 57
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 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
 
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['title'] = esc_html__( 'Login', 'give' );
25
-		$this->shortcode['label'] = esc_html__( 'Login', 'give' );
24
+		$this->shortcode['title'] = esc_html__('Login', 'give');
25
+		$this->shortcode['label'] = esc_html__('Login', 'give');
26 26
 
27
-		parent::__construct( 'give_login' );
27
+		parent::__construct('give_login');
28 28
 	}
29 29
 
30 30
 	/**
@@ -37,23 +37,23 @@  discard block
 block discarded – undo
37 37
 		return array(
38 38
 			array(
39 39
 				'type' => 'container',
40
-				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Login Redirect URL (optional):', 'give' ) ),
40
+				'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Login Redirect URL (optional):', 'give')),
41 41
 			),
42 42
 			array(
43 43
 				'type'     => 'textbox',
44 44
 				'name'     => 'login-redirect',
45 45
 				'minWidth' => 320,
46
-				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ),
46
+				'tooltip'  => esc_attr__('Enter an URL here to redirect to after login.', 'give'),
47 47
 			),
48 48
             array(
49 49
                 'type' => 'container',
50
-                'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
50
+                'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Logout Redirect URL (optional):', 'give')),
51 51
             ),
52 52
             array(
53 53
                 'type'     => 'textbox',
54 54
                 'name'     => 'logout-redirect',
55 55
                 'minWidth' => 320,
56
-                'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
56
+                'tooltip'  => esc_attr__('Enter an URL here to redirect to after logout.', 'give'),
57 57
             ),
58 58
 		);
59 59
 	}
Please login to merge, or discard this patch.
includes/admin/shortcodes/abstract-shortcode-generator.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -248,8 +248,8 @@
 block discarded – undo
248 248
 
249 249
 			// do not reindex array!
250 250
 			$field['options'] = array(
251
-				                    '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
252
-			                    ) + $field['options'];
251
+									'' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
252
+								) + $field['options'];
253 253
 
254 254
 			foreach ( $field['options'] as $value => $text ) {
255 255
 				$new_listbox['values'][] = array(
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @since 1.0
64 64
 	 */
65
-	public function __construct( $shortcode ) {
65
+	public function __construct($shortcode) {
66 66
 
67 67
 		$this->shortcode_tag = $shortcode;
68 68
 
69
-		add_action( 'admin_init', array( $this, 'init' ) );
69
+		add_action('admin_init', array($this, 'init'));
70 70
 
71 71
 	}
72 72
 
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	public function init() {
79 79
 
80
-		if ( $this->shortcode_tag ) {
80
+		if ($this->shortcode_tag) {
81 81
 
82
-			$this->self = get_class( $this );
82
+			$this->self = get_class($this);
83 83
 
84 84
 			$this->errors   = array();
85 85
 			$this->required = array();
@@ -88,18 +88,18 @@  discard block
 block discarded – undo
88 88
 			$fields = $this->get_fields();
89 89
 
90 90
 			$defaults = array(
91
-				'btn_close' => esc_html__( 'Close', 'give' ),
92
-				'btn_okay'  => esc_html__( 'Insert Shortcode', 'give' ),
91
+				'btn_close' => esc_html__('Close', 'give'),
92
+				'btn_okay'  => esc_html__('Insert Shortcode', 'give'),
93 93
 				'errors'    => $this->errors,
94 94
 				'fields'    => $fields,
95
-				'label'     => '[' . $this->shortcode_tag . ']',
95
+				'label'     => '['.$this->shortcode_tag.']',
96 96
 				'required'  => $this->required,
97
-				'title'     => esc_html__( 'Insert Shortcode', 'give' ),
97
+				'title'     => esc_html__('Insert Shortcode', 'give'),
98 98
 			);
99 99
 
100
-			if ( user_can_richedit() ) {
100
+			if (user_can_richedit()) {
101 101
 
102
-				Give_Shortcode_Button::$shortcodes[ $this->shortcode_tag ] = wp_parse_args( $this->shortcode, $defaults );
102
+				Give_Shortcode_Button::$shortcodes[$this->shortcode_tag] = wp_parse_args($this->shortcode, $defaults);
103 103
 
104 104
 			}
105 105
 		}
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 	 *
129 129
 	 * @since 1.0
130 130
 	 */
131
-	protected function generate_fields( $defined_fields ) {
131
+	protected function generate_fields($defined_fields) {
132 132
 
133 133
 		$fields = array();
134 134
 
135
-		if ( is_array( $defined_fields ) ) {
135
+		if (is_array($defined_fields)) {
136 136
 
137
-			foreach ( $defined_fields as $field ) {
137
+			foreach ($defined_fields as $field) {
138 138
 
139 139
 				$defaults = array(
140 140
 					'label'       => false,
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
 					'type'        => '',
146 146
 				);
147 147
 
148
-				$field  = wp_parse_args( (array) $field, $defaults );
149
-				$method = 'generate_' . strtolower( $field['type'] );
148
+				$field  = wp_parse_args((array) $field, $defaults);
149
+				$method = 'generate_'.strtolower($field['type']);
150 150
 
151
-				if ( method_exists( $this, $method ) ) {
151
+				if (method_exists($this, $method)) {
152 152
 
153
-					$field = call_user_func( array( $this, $method ), $field );
153
+					$field = call_user_func(array($this, $method), $field);
154 154
 
155
-					if ( $field ) {
155
+					if ($field) {
156 156
 						$fields[] = $field;
157 157
 					}
158 158
 				}
@@ -172,23 +172,23 @@  discard block
 block discarded – undo
172 172
 	protected function get_fields() {
173 173
 
174 174
 		$defined_fields   = $this->define_fields();
175
-		$generated_fields = $this->generate_fields( $defined_fields );
175
+		$generated_fields = $this->generate_fields($defined_fields);
176 176
 
177 177
 		$errors = array();
178 178
 
179
-		if ( ! empty( $this->errors ) ) {
180
-			foreach ( $this->required as $name => $alert ) {
179
+		if ( ! empty($this->errors)) {
180
+			foreach ($this->required as $name => $alert) {
181 181
 				// Using WordPress function in place of array_column wp_list_pluck as it support older version as well.
182
-				if ( false === array_search( $name, give_list_pluck( $generated_fields, 'name' ) ) ) {
182
+				if (false === array_search($name, give_list_pluck($generated_fields, 'name'))) {
183 183
 
184
-					$errors[] = $this->errors[ $name ];
184
+					$errors[] = $this->errors[$name];
185 185
 				}
186 186
 			}
187 187
 
188 188
 			$this->errors = $errors;
189 189
 		}
190 190
 
191
-		if ( ! empty( $errors ) ) {
191
+		if ( ! empty($errors)) {
192 192
 
193 193
 			return $errors;
194 194
 		}
@@ -205,9 +205,9 @@  discard block
 block discarded – undo
205 205
 	 *
206 206
 	 * @since 1.0
207 207
 	 */
208
-	protected function generate_container( $field ) {
208
+	protected function generate_container($field) {
209 209
 
210
-		if ( array_key_exists( 'html', $field ) ) {
210
+		if (array_key_exists('html', $field)) {
211 211
 
212 212
 			return array(
213 213
 				'type' => $field['type'],
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
 	 *
228 228
 	 * @since 1.0
229 229
 	 */
230
-	protected function generate_listbox( $field ) {
230
+	protected function generate_listbox($field) {
231 231
 
232
-		$listbox = shortcode_atts( array(
232
+		$listbox = shortcode_atts(array(
233 233
 			'label'    => '',
234 234
 			'minWidth' => '',
235 235
 			'name'     => false,
@@ -237,27 +237,27 @@  discard block
 block discarded – undo
237 237
 			'type'     => '',
238 238
 			'value'    => '',
239 239
 			'classes'  => ''
240
-		), $field );
240
+		), $field);
241 241
 
242
-		if ( $this->validate( $field ) ) {
242
+		if ($this->validate($field)) {
243 243
 
244 244
 			$new_listbox = array();
245 245
 
246
-			foreach ( $listbox as $key => $value ) {
246
+			foreach ($listbox as $key => $value) {
247 247
 
248
-				if ( $key == 'value' && empty( $value ) ) {
249
-					$new_listbox[ $key ] = $listbox['name'];
250
-				} else if ( $value ) {
251
-					$new_listbox[ $key ] = $value;
248
+				if ($key == 'value' && empty($value)) {
249
+					$new_listbox[$key] = $listbox['name'];
250
+				} else if ($value) {
251
+					$new_listbox[$key] = $value;
252 252
 				}
253 253
 			}
254 254
 
255 255
 			// do not reindex array!
256 256
 			$field['options'] = array(
257
-				                    '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
257
+				                    '' => ($field['placeholder'] ? $field['placeholder'] : esc_attr__('- Select -', 'give')),
258 258
 			                    ) + $field['options'];
259 259
 
260
-			foreach ( $field['options'] as $value => $text ) {
260
+			foreach ($field['options'] as $value => $text) {
261 261
 				$new_listbox['values'][] = array(
262 262
 					'text'  => $text,
263 263
 					'value' => $value,
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 *
280 280
 	 * @since 1.0
281 281
 	 */
282
-	protected function generate_post( $field ) {
282
+	protected function generate_post($field) {
283 283
 
284 284
 		$args = array(
285 285
 			'post_type'      => 'post',
@@ -289,26 +289,26 @@  discard block
 block discarded – undo
289 289
 			'posts_per_page' => 500,
290 290
 		);
291 291
 
292
-		$args    = wp_parse_args( (array) $field['query_args'], $args );
293
-		$posts   = new WP_Query( $args );
292
+		$args    = wp_parse_args((array) $field['query_args'], $args);
293
+		$posts   = new WP_Query($args);
294 294
 		$options = array();
295 295
 
296
-		if ( $posts->have_posts() ) {
297
-			while ( $posts->have_posts() ) {
296
+		if ($posts->have_posts()) {
297
+			while ($posts->have_posts()) {
298 298
 				$posts->the_post();
299 299
 				$post_title = get_the_title();
300 300
 				$post_id = get_the_ID();
301
-				$options[ absint( $post_id ) ] = ( empty( $post_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $post_id ) : $post_title );
301
+				$options[absint($post_id)] = (empty($post_title) ? sprintf(__('Untitled (#%s)', 'give'), $post_id) : $post_title);
302 302
 			}
303 303
 
304 304
 			$field['type']    = 'listbox';
305 305
 			$field['options'] = $options;
306 306
 
307
-			return $this->generate_listbox( $field );
307
+			return $this->generate_listbox($field);
308 308
 		}
309 309
 
310 310
 		// perform validation here before returning false
311
-		$this->validate( $field );
311
+		$this->validate($field);
312 312
 
313 313
 		return false;
314 314
 	}
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
 	 *
323 323
 	 * @since 1.0
324 324
 	 */
325
-	protected function generate_textbox( $field ) {
325
+	protected function generate_textbox($field) {
326 326
 
327
-		$textbox = shortcode_atts( array(
327
+		$textbox = shortcode_atts(array(
328 328
 			'label'     => '',
329 329
 			'maxLength' => '',
330 330
 			'minHeight' => '',
@@ -335,10 +335,10 @@  discard block
 block discarded – undo
335 335
 			'type'      => '',
336 336
 			'value'     => '',
337 337
 			'classes'   => ''
338
-		), $field );
338
+		), $field);
339 339
 
340
-		if ( $this->validate( $field ) ) {
341
-			return array_filter( $textbox, array( $this, 'return_textbox_value' ) );
340
+		if ($this->validate($field)) {
341
+			return array_filter($textbox, array($this, 'return_textbox_value'));
342 342
 		}
343 343
 
344 344
 		return false;
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 	 *
352 352
 	 * @return bool
353 353
 	 */
354
-	function return_textbox_value( $value ) {
354
+	function return_textbox_value($value) {
355 355
 		return $value !== '';
356 356
 	}
357 357
 
@@ -367,9 +367,9 @@  discard block
 block discarded – undo
367 367
 	 *
368 368
 	 * @since 1.0
369 369
 	 */
370
-	protected function validate( $field ) {
370
+	protected function validate($field) {
371 371
 
372
-		extract( shortcode_atts(
372
+		extract(shortcode_atts(
373 373
 				array(
374 374
 					'name'     => false,
375 375
 					'required' => false,
@@ -377,36 +377,36 @@  discard block
 block discarded – undo
377 377
 				), $field )
378 378
 		);
379 379
 
380
-		if ( $name ) {
380
+		if ($name) {
381 381
 
382
-			if ( isset( $required['error'] ) ) {
382
+			if (isset($required['error'])) {
383 383
 
384 384
 				$error = array(
385 385
 					'type' => 'container',
386 386
 					'html' => $required['error'],
387 387
 				);
388 388
 
389
-				$this->errors[ $name ] = $this->generate_container( $error );
389
+				$this->errors[$name] = $this->generate_container($error);
390 390
 			}
391 391
 
392
-			if ( ! ! $required || is_array( $required ) ) {
392
+			if ( ! ! $required || is_array($required)) {
393 393
 
394
-				$alert = esc_html__( 'Some of the shortcode options are required.', 'give' );
394
+				$alert = esc_html__('Some of the shortcode options are required.', 'give');
395 395
 
396
-				if ( isset( $required['alert'] ) ) {
396
+				if (isset($required['alert'])) {
397 397
 
398 398
 					$alert = $required['alert'];
399 399
 
400
-				} else if ( ! empty( $label ) ) {
400
+				} else if ( ! empty($label)) {
401 401
 
402 402
 					$alert = sprintf(
403 403
 					/* translators: %s: option label */
404
-						esc_html__( 'The "%s" option is required.', 'give' ),
405
-						str_replace( ':', '', $label )
404
+						esc_html__('The "%s" option is required.', 'give'),
405
+						str_replace(':', '', $label)
406 406
 					);
407 407
 				}
408 408
 
409
-				$this->required[ $name ] = $alert;
409
+				$this->required[$name] = $alert;
410 410
 			}
411 411
 
412 412
 			return true;
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-cmb2-backward-compatibility.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 		 *
86 86
 		 * @since  1.8
87 87
 		 *
88
-		 * @param  $setting_tab
88
+		 * @param  string $setting_tab
89 89
 		 *
90 90
 		 * @return string
91 91
 		 */
Please login to merge, or discard this patch.
Spacing   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! class_exists( 'Give_CMB2_Settings_Loader' ) ) :
12
+if ( ! class_exists('Give_CMB2_Settings_Loader')) :
13 13
 
14 14
 	/**
15 15
 	 * This class loads the cmb2 settings.
@@ -52,30 +52,30 @@  discard block
 block discarded – undo
52 52
 
53 53
 			// Get current tab.
54 54
 			$this->current_tab     = give_get_current_setting_tab();
55
-			$this->current_section = empty( $_REQUEST['section'] ) ? ( current( array_keys( $this->get_sections() ) ) ) : sanitize_title( $_REQUEST['section'] );
55
+			$this->current_section = empty($_REQUEST['section']) ? (current(array_keys($this->get_sections()))) : sanitize_title($_REQUEST['section']);
56 56
 
57 57
 			// Tab ID.
58 58
 			$this->id = $this->current_tab;
59 59
 
60 60
 			// Add addon tabs.
61
-			add_filter( 'give-settings_tabs_array', array( $this, 'add_addon_settings_page' ), 999999 );
61
+			add_filter('give-settings_tabs_array', array($this, 'add_addon_settings_page'), 999999);
62 62
 
63 63
 			// Add save hook to addons.
64
-			add_action( 'give-settings_get_settings_pages', array( $this, 'setup_addon_save_hook' ), 999999 );
64
+			add_action('give-settings_get_settings_pages', array($this, 'setup_addon_save_hook'), 999999);
65 65
 
66 66
 			// Add backward compatibility filters plugin settings.
67
-			$setting_tabs = array( 'general', 'gateways', 'display', 'emails', 'addons', 'licenses' );
67
+			$setting_tabs = array('general', 'gateways', 'display', 'emails', 'addons', 'licenses');
68 68
 
69 69
 			// Filter Payment Gateways settings.
70
-			if ( in_array( $this->current_tab, $setting_tabs ) ) {
71
-				add_filter( "give_get_settings_{$this->current_tab}", array(
70
+			if (in_array($this->current_tab, $setting_tabs)) {
71
+				add_filter("give_get_settings_{$this->current_tab}", array(
72 72
 					$this,
73 73
 					'get_filtered_addon_settings',
74
-				), 999999, 1 );
75
-				add_filter( "give_get_sections_{$this->current_tab}", array(
74
+				), 999999, 1);
75
+				add_filter("give_get_sections_{$this->current_tab}", array(
76 76
 					$this,
77 77
 					'get_filtered_addon_sections',
78
-				), 999999, 1 );
78
+				), 999999, 1);
79 79
 			}
80 80
 		}
81 81
 
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
 		 *
89 89
 		 * @return string
90 90
 		 */
91
-		function set_default_setting_tab( $setting_tab ) {
91
+		function set_default_setting_tab($setting_tab) {
92 92
 			$default_tab = '';
93 93
 
94 94
 			// Set default tab to first setting tab.
95
-			if ( $sections = array_keys( $this->get_sections() ) ) {
96
-				$default_tab = current( $sections );
95
+			if ($sections = array_keys($this->get_sections())) {
96
+				$default_tab = current($sections);
97 97
 			}
98 98
 
99 99
 			return $default_tab;
@@ -108,29 +108,29 @@  discard block
 block discarded – undo
108 108
 		 *
109 109
 		 * @return mixed
110 110
 		 */
111
-		function add_addon_settings_page( $pages ) {
111
+		function add_addon_settings_page($pages) {
112 112
 			// Previous setting page.
113 113
 			$previous_pages = $this->prev_settings->give_get_settings_tabs();
114 114
 
115 115
 			// API and System Info setting tab merge to Tools setting tab, so remove them from tabs.
116
-			unset( $previous_pages['api'] );
117
-			unset( $previous_pages['system_info'] );
116
+			unset($previous_pages['api']);
117
+			unset($previous_pages['system_info']);
118 118
 
119 119
 			// Tab is not register.
120
-			$pages_diff = array_keys( array_diff( $previous_pages, $pages ) );
120
+			$pages_diff = array_keys(array_diff($previous_pages, $pages));
121 121
 
122 122
 			// Merge old settings with new settings.
123
-			$pages = array_merge( $pages, $previous_pages );
123
+			$pages = array_merge($pages, $previous_pages);
124 124
 
125
-			if ( in_array( $this->current_tab, $pages_diff ) ) {
125
+			if (in_array($this->current_tab, $pages_diff)) {
126 126
 				// Filter & actions.
127
-				add_filter( "give_default_setting_tab_section_{$this->current_tab}", array(
127
+				add_filter("give_default_setting_tab_section_{$this->current_tab}", array(
128 128
 					$this,
129 129
 					'set_default_setting_tab',
130
-				), 10 );
131
-				add_action( "give-settings_sections_{$this->current_tab}_page", array( $this, 'output_sections' ) );
132
-				add_action( "give-settings_settings_{$this->current_tab}_page", array( $this, 'output' ), 10 );
133
-				add_action( "give-settings_save_{$this->current_tab}", array( $this, 'save' ) );
130
+				), 10);
131
+				add_action("give-settings_sections_{$this->current_tab}_page", array($this, 'output_sections'));
132
+				add_action("give-settings_settings_{$this->current_tab}_page", array($this, 'output'), 10);
133
+				add_action("give-settings_save_{$this->current_tab}", array($this, 'save'));
134 134
 			}
135 135
 
136 136
 			return $pages;
@@ -146,29 +146,29 @@  discard block
 block discarded – undo
146 146
 		 *
147 147
 		 * @return mixed
148 148
 		 */
149
-		function setup_addon_save_hook( $pages ) {
149
+		function setup_addon_save_hook($pages) {
150 150
 			$page_ids = array();
151 151
 
152
-			foreach ( $pages as $page ) {
153
-				$page_ids = $page->add_settings_page( $page_ids );
152
+			foreach ($pages as $page) {
153
+				$page_ids = $page->add_settings_page($page_ids);
154 154
 			}
155 155
 
156 156
 			// Previous setting page.
157 157
 			$previous_pages = $this->prev_settings->give_get_settings_tabs();
158 158
 
159 159
 			// API and System Info setting tab merge to Tools setting tab, so remove them from tabs.
160
-			unset( $previous_pages['api'] );
161
-			unset( $previous_pages['system_info'] );
160
+			unset($previous_pages['api']);
161
+			unset($previous_pages['system_info']);
162 162
 
163 163
 			// Tab is not register.
164
-			$pages_diff = array_keys( array_diff( $previous_pages, $page_ids ) );
164
+			$pages_diff = array_keys(array_diff($previous_pages, $page_ids));
165 165
 
166 166
 			// Merge old settings with new settings.
167 167
 			// $pages = array_merge( $page_ids, $previous_pages );
168 168
 
169
-			if ( in_array( $this->current_tab, $pages_diff ) ) {
169
+			if (in_array($this->current_tab, $pages_diff)) {
170 170
 				// Filter & actions.
171
-				add_action( "give-settings_save_{$this->current_tab}", array( $this, 'save' ) );
171
+				add_action("give-settings_save_{$this->current_tab}", array($this, 'save'));
172 172
 			}
173 173
 
174 174
 			return $pages;
@@ -183,16 +183,16 @@  discard block
 block discarded – undo
183 183
 		 *
184 184
 		 * @return string
185 185
 		 */
186
-		function get_section_name( $field_name ) {
186
+		function get_section_name($field_name) {
187 187
 			// Bailout.
188
-			if ( empty( $field_name ) ) {
188
+			if (empty($field_name)) {
189 189
 				return $field_name;
190 190
 			}
191 191
 
192
-			$section_name = explode( ' ', $field_name );
192
+			$section_name = explode(' ', $field_name);
193 193
 
194 194
 			// Output.
195
-			return strip_tags( implode( ' ', $section_name ) );
195
+			return strip_tags(implode(' ', $section_name));
196 196
 		}
197 197
 
198 198
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		 *
208 208
 		 * @return mixed
209 209
 		 */
210
-		public function en_translation( $translation, $text ) {
210
+		public function en_translation($translation, $text) {
211 211
 			return $text;
212 212
 		}
213 213
 
@@ -221,59 +221,59 @@  discard block
 block discarded – undo
221 221
 		 *
222 222
 		 * @return mixed
223 223
 		 */
224
-		function get_filtered_addon_sections( $sections = array() ) {
224
+		function get_filtered_addon_sections($sections = array()) {
225 225
 			// New sections.
226 226
 			$new_sections = array();
227
-			$sections_ID  = array_keys( $sections );
228
-			$setting_fields = $this->prev_settings->give_settings( $this->current_tab );
227
+			$sections_ID  = array_keys($sections);
228
+			$setting_fields = $this->prev_settings->give_settings($this->current_tab);
229 229
 
230 230
 			// We need untranslated settings for backward compatibility.
231
-			add_filter( 'gettext', array( $this, 'en_translation' ), 10, 2 );
232
-			$en_setting_fields = $this->prev_settings->give_settings( $this->current_tab );
233
-			remove_filter( 'gettext', array( $this, 'en_translation' ), 10 );
231
+			add_filter('gettext', array($this, 'en_translation'), 10, 2);
232
+			$en_setting_fields = $this->prev_settings->give_settings($this->current_tab);
233
+			remove_filter('gettext', array($this, 'en_translation'), 10);
234 234
 			
235
-			if ( ! empty( $setting_fields ) && ! empty( $setting_fields['fields'] ) ) {
235
+			if ( ! empty($setting_fields) && ! empty($setting_fields['fields'])) {
236 236
 
237
-				foreach ( $setting_fields['fields'] as $index => $field ) {
237
+				foreach ($setting_fields['fields'] as $index => $field) {
238 238
 					// Collect new sections from addons.
239
-					if ( 'give_title' !== $field['type'] ) {
239
+					if ('give_title' !== $field['type']) {
240 240
 						continue;
241 241
 					}
242 242
 
243 243
 					// Untranslated setting name.
244
-					$en_setting_field_name = isset( $en_setting_fields['fields'][ $index ]['name'] ) ? $en_setting_fields['fields'][ $index ]['name'] : '';
244
+					$en_setting_field_name = isset($en_setting_fields['fields'][$index]['name']) ? $en_setting_fields['fields'][$index]['name'] : '';
245 245
 
246 246
 					// Section name.
247
-					$field['name'] = isset( $field['name'] ) ? $field['name'] : '';
248
-					$section_name  = $this->get_section_name( $field['name'] );
247
+					$field['name'] = isset($field['name']) ? $field['name'] : '';
248
+					$section_name  = $this->get_section_name($field['name']);
249 249
 
250 250
 					// Check if section name exit and section title array is not empty.
251
-					if ( ! empty( $sections ) && ! empty( $en_setting_field_name ) ) {
251
+					if ( ! empty($sections) && ! empty($en_setting_field_name)) {
252 252
 
253 253
 						// Bailout: Do not load section if it is already exist.
254 254
 						if (
255
-							in_array( sanitize_title( $en_setting_field_name ), $sections_ID ) // Check section id.
256
-							|| in_array( $section_name, $sections )                            // Check section name.
255
+							in_array(sanitize_title($en_setting_field_name), $sections_ID) // Check section id.
256
+							|| in_array($section_name, $sections)                            // Check section name.
257 257
 						) {
258 258
 							continue;
259 259
 						}
260 260
 					}
261 261
 
262 262
 					// Collect new sections from addons.
263
-					$new_sections[ sanitize_title( $field['name'] ) ] = $section_name;
263
+					$new_sections[sanitize_title($field['name'])] = $section_name;
264 264
 				}
265 265
 			}
266 266
 
267 267
 			// Add new section.
268
-			if ( ! empty( $new_sections ) ) {
269
-				$sections = array_merge( $sections, $new_sections );
268
+			if ( ! empty($new_sections)) {
269
+				$sections = array_merge($sections, $new_sections);
270 270
 			}
271 271
 
272 272
 			// Remove section tab conditionally.
273
-			switch ( give_get_current_setting_tab() ) {
273
+			switch (give_get_current_setting_tab()) {
274 274
 				case 'emails':
275 275
 					// unset( $sections['donation-receipt'] );
276
-					unset( $sections['new-donation-notification'] );
276
+					unset($sections['new-donation-notification']);
277 277
 			}
278 278
 
279 279
 			// Output.
@@ -291,23 +291,23 @@  discard block
 block discarded – undo
291 291
 		 *
292 292
 		 * @return array
293 293
 		 */
294
-		function get_filtered_addon_settings( $settings, $setting_fields = array() ) {
294
+		function get_filtered_addon_settings($settings, $setting_fields = array()) {
295 295
 			global $wp_filter;
296 296
 
297 297
 			$new_setting_fields = array();
298 298
 
299
-			if ( ! empty( $settings ) ) {
299
+			if ( ! empty($settings)) {
300 300
 				// Bailout: If setting array contain first element of type title then it means it is already created with new setting api (skip this section ).
301
-				if ( isset( $settings[0]['type'] ) && 'title' == $settings[0]['type'] ) {
301
+				if (isset($settings[0]['type']) && 'title' == $settings[0]['type']) {
302 302
 					$last_sectionend_pos = 0;
303
-					foreach ( $settings as $index => $setting ) {
303
+					foreach ($settings as $index => $setting) {
304 304
 						// We need setting till last section end.
305
-						if ( 'sectionend' === $setting['type'] ) {
305
+						if ('sectionend' === $setting['type']) {
306 306
 							$last_sectionend_pos = ++ $index;
307 307
 						}
308 308
 					}
309 309
 
310
-					$settings = array_slice( $settings, 0, $last_sectionend_pos );
310
+					$settings = array_slice($settings, 0, $last_sectionend_pos);
311 311
 
312 312
 					return $settings;
313 313
 				}
@@ -316,24 +316,24 @@  discard block
 block discarded – undo
316 316
 				$prev_title_field_id = '';
317 317
 
318 318
 				// Create new setting fields.
319
-				foreach ( $settings as $index => $field ) {
319
+				foreach ($settings as $index => $field) {
320 320
 
321 321
 					// Bailout: Must need field type to process.
322
-					if ( ! isset( $field['type'] ) ) {
322
+					if ( ! isset($field['type'])) {
323 323
 						continue;
324 324
 					}
325 325
 
326 326
 					// Set wrapper class if any.
327
-					if ( ! empty( $field['row_classes'] ) ) {
327
+					if ( ! empty($field['row_classes'])) {
328 328
 						$field['wrapper_class'] = $field['row_classes'];
329
-						unset( $field['row_classes'] );
329
+						unset($field['row_classes']);
330 330
 					}
331 331
 
332
-					$field['name'] = ! isset( $field['name'] ) ? '' : $field['name'];
333
-					$field['desc'] = ! isset( $field['desc'] ) ? '' : $field['desc'];
332
+					$field['name'] = ! isset($field['name']) ? '' : $field['name'];
333
+					$field['desc'] = ! isset($field['desc']) ? '' : $field['desc'];
334 334
 
335 335
 					// Modify cmb2 setting fields.
336
-					switch ( $field['type'] ) {
336
+					switch ($field['type']) {
337 337
 						case 'text' :
338 338
 						case 'file' :
339 339
 							$field['css'] = 'width:25em;';
@@ -357,18 +357,18 @@  discard block
 block discarded – undo
357 357
 							$field['type'] = 'title';
358 358
 
359 359
 							// Since we are showing sections, so there now ned to show horizontal rules.
360
-							if ( '<hr>' === $field['desc'] ) {
360
+							if ('<hr>' === $field['desc']) {
361 361
 								$field['desc'] = '';
362 362
 							}
363 363
 
364 364
 							break;
365 365
 					}
366 366
 
367
-					if ( 'title' === $field['type'] ) {
367
+					if ('title' === $field['type']) {
368 368
 
369 369
 						// If we do not have first element as title then these field will be skip from frontend
370 370
 						// because there are not belong to any section, so put all abandon fields under first section.
371
-						if ( $index && empty( $prev_title_field_id ) ) {
371
+						if ($index && empty($prev_title_field_id)) {
372 372
 							array_unshift(
373 373
 								$new_setting_fields,
374 374
 								array(
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 							$prev_title_field_id = $field['id'];
383 383
 
384 384
 							continue;
385
-						} elseif ( $index ) {
385
+						} elseif ($index) {
386 386
 							// Section end.
387 387
 							$new_setting_fields[] = array(
388 388
 								'type' => 'sectionend',
@@ -414,52 +414,52 @@  discard block
 block discarded – undo
414 414
 
415 415
 				// Check if setting page has title section or not.
416 416
 				// If setting page does not have title section  then add title section to it and fix section end array id.
417
-				if ( 'title' !== $new_setting_fields[0]['type'] ) {
417
+				if ('title' !== $new_setting_fields[0]['type']) {
418 418
 					array_unshift(
419 419
 						$new_setting_fields,
420 420
 						array(
421
-							'title' => ( isset( $settings['give_title'] ) ? $settings['give_title'] : '' ),
421
+							'title' => (isset($settings['give_title']) ? $settings['give_title'] : ''),
422 422
 							'type'  => 'title',
423
-							'desc'  => ! empty( $setting_fields['desc'] ) ? $setting_fields['desc'] : '',
424
-							'id'    => ( isset( $settings['id'] ) ? $settings['id'] : '' ),
423
+							'desc'  => ! empty($setting_fields['desc']) ? $setting_fields['desc'] : '',
424
+							'id'    => (isset($settings['id']) ? $settings['id'] : ''),
425 425
 						)
426 426
 					);
427 427
 
428 428
 					// Update id in section end array if does not contain.
429
-					if ( empty( $new_setting_fields[ count( $new_setting_fields ) - 1 ]['id'] ) ) {
430
-						$new_setting_fields[ count( $new_setting_fields ) - 1 ]['id'] = ( isset( $settings['id'] ) ? $settings['id'] : '' );
429
+					if (empty($new_setting_fields[count($new_setting_fields) - 1]['id'])) {
430
+						$new_setting_fields[count($new_setting_fields) - 1]['id'] = (isset($settings['id']) ? $settings['id'] : '');
431 431
 					}
432 432
 				}
433 433
 
434 434
 				// Return only section related settings.
435
-				if ( $sections = $this->get_filtered_addon_sections() ) {
436
-					$new_setting_fields = $this->get_section_settings( $new_setting_fields );
435
+				if ($sections = $this->get_filtered_addon_sections()) {
436
+					$new_setting_fields = $this->get_section_settings($new_setting_fields);
437 437
 				}
438 438
 
439 439
 				// Third party plugin backward compatibility.
440
-				$wp_filter_keys = array_keys( $wp_filter );
441
-				foreach ( $new_setting_fields as $index => $field ) {
442
-					if ( ! isset( $field['type'] ) || in_array( $field['type'], array( 'title', 'sectionend' ) ) ) {
440
+				$wp_filter_keys = array_keys($wp_filter);
441
+				foreach ($new_setting_fields as $index => $field) {
442
+					if ( ! isset($field['type']) || in_array($field['type'], array('title', 'sectionend'))) {
443 443
 						continue;
444 444
 					}
445 445
 
446 446
 					$cmb2_filter_name = "cmb2_render_{$field['type']}";
447 447
 
448
-					if ( in_array( $cmb2_filter_name, $wp_filter_keys ) ) {
448
+					if (in_array($cmb2_filter_name, $wp_filter_keys)) {
449 449
 
450
-						if ( 0 >= version_compare( 4.7, get_bloginfo( 'version' ) ) && ! empty( $wp_filter[ $cmb2_filter_name ]->callbacks ) ) {
451
-							$cmb2_filter_arr = current( $wp_filter[ $cmb2_filter_name ]->callbacks );
450
+						if (0 >= version_compare(4.7, get_bloginfo('version')) && ! empty($wp_filter[$cmb2_filter_name]->callbacks)) {
451
+							$cmb2_filter_arr = current($wp_filter[$cmb2_filter_name]->callbacks);
452 452
 						} else {
453
-							$cmb2_filter_arr = current( $wp_filter[ $cmb2_filter_name ] );
453
+							$cmb2_filter_arr = current($wp_filter[$cmb2_filter_name]);
454 454
 						}
455 455
 
456
-						if ( ! empty( $cmb2_filter_arr ) ) {
456
+						if ( ! empty($cmb2_filter_arr)) {
457 457
 							// Note: function can be called either globally or with class object, it depends on how developer invoke it.
458
-							$new_setting_fields[ $index ]['func'] = current( $cmb2_filter_arr );
459
-							add_action( "give_admin_field_{$field['type']}", array(
458
+							$new_setting_fields[$index]['func'] = current($cmb2_filter_arr);
459
+							add_action("give_admin_field_{$field['type']}", array(
460 460
 								$this,
461 461
 								'addon_setting_field',
462
-							), 10, 2 );
462
+							), 10, 2);
463 463
 						}
464 464
 					}
465 465
 				}
@@ -480,31 +480,31 @@  discard block
 block discarded – undo
480 480
 		 *
481 481
 		 * @return array
482 482
 		 */
483
-		function get_section_settings( $tab_settings ) {
483
+		function get_section_settings($tab_settings) {
484 484
 			$current_section = give_get_current_setting_section();
485 485
 
486 486
 			// Note: If we are opening default tab for addon setting then it is possible that we will get empty string as current section
487 487
 			// because default section filter added after save hook fire, so we will always get problem to save first section [default] or if there are only on section
488 488
 			// This is hack to fix this.
489
-			if ( empty( $current_section ) ) {
490
-				$current_section = $this->set_default_setting_tab( $current_section );
489
+			if (empty($current_section)) {
490
+				$current_section = $this->set_default_setting_tab($current_section);
491 491
 			}
492 492
 
493 493
 			$section_start               = false;
494 494
 			$section_end                 = false;
495 495
 			$section_only_setting_fields = array();
496 496
 
497
-			foreach ( $tab_settings as $field ) {
498
-				if ( 'title' == $field['type'] && $current_section == sanitize_title( $field['title'] ) ) {
497
+			foreach ($tab_settings as $field) {
498
+				if ('title' == $field['type'] && $current_section == sanitize_title($field['title'])) {
499 499
 					$section_start = true;
500 500
 				}
501 501
 
502
-				if ( ! $section_start || $section_end ) {
502
+				if ( ! $section_start || $section_end) {
503 503
 					continue;
504 504
 				}
505 505
 
506
-				if ( $section_start && ! $section_end ) {
507
-					if ( 'sectionend' == $field['type'] ) {
506
+				if ($section_start && ! $section_end) {
507
+					if ('sectionend' == $field['type']) {
508 508
 						$section_end = true;
509 509
 					}
510 510
 					$section_only_setting_fields[] = $field;
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 			// Remove title from setting, prevent it from render in setting tab.
515 515
 			$section_only_setting_fields[0]['title'] = '';
516 516
 
517
-			return apply_filters( "give_get_settings_{$this->current_tab}_{$current_section}", $section_only_setting_fields, $tab_settings );
517
+			return apply_filters("give_get_settings_{$this->current_tab}_{$current_section}", $section_only_setting_fields, $tab_settings);
518 518
 		}
519 519
 
520 520
 
@@ -528,17 +528,17 @@  discard block
 block discarded – undo
528 528
 		 *
529 529
 		 * @return void
530 530
 		 */
531
-		function addon_setting_field( $field, $saved_value ) {
531
+		function addon_setting_field($field, $saved_value) {
532 532
 			// Create object for cmb2  function callback backward compatibility.
533 533
 			// Note: Do not call any cmb2 function on these objects
534
-			$field_obj      = (object) array( 'args' => $field );
535
-			$field_type_obj = (object) array( 'field' => $field_obj );
534
+			$field_obj      = (object) array('args' => $field);
535
+			$field_type_obj = (object) array('field' => $field_obj);
536 536
 
537
-			switch ( $this->current_tab ) :
537
+			switch ($this->current_tab) :
538 538
 				case 'licenses':
539 539
 					?>
540 540
 					<div class="give-settings-wrap give-settings-wrap-<?php echo $this->current_tab; ?>">
541
-						<?php $field['func']['function']( $field_obj, $saved_value, '', '', $field_type_obj ); ?>
541
+						<?php $field['func']['function']($field_obj, $saved_value, '', '', $field_type_obj); ?>
542 542
 					</div>
543 543
 					<?php break;
544 544
 
@@ -546,21 +546,21 @@  discard block
 block discarded – undo
546 546
 					$colspan = 'colspan="2"';
547 547
 					?>
548 548
 					<tr valign="top">
549
-						<?php if ( ! empty( $field['name'] ) && ! in_array( $field['name'], array( '&nbsp;' ) ) ) : ?>
549
+						<?php if ( ! empty($field['name']) && ! in_array($field['name'], array('&nbsp;'))) : ?>
550 550
 							<th scope="row" class="titledesc">
551
-								<label for="<?php echo esc_attr( $field['name'] ); ?>"><?php echo $field['title']; ?></label>
551
+								<label for="<?php echo esc_attr($field['name']); ?>"><?php echo $field['title']; ?></label>
552 552
 							</th>
553 553
 							<?php $colspan = ''; ?>
554 554
 						<?php endif; ?>
555 555
 						<td class="give-forminp" <?php echo $colspan; ?>>
556 556
 							<?php
557
-							if ( is_array( $field['func']['function'] ) ) {
557
+							if (is_array($field['func']['function'])) {
558 558
 								$classname = $field['func']['function'][0];
559 559
 								$function_name = $field['func']['function'][1];
560
-								$classname->$function_name( $field_obj, $saved_value, '', '', $field_type_obj );
560
+								$classname->$function_name($field_obj, $saved_value, '', '', $field_type_obj);
561 561
 							} else {
562 562
 								$function_name = $field['func']['function'];
563
-								$function_name( $field_obj, $saved_value, '', '', $field_type_obj );
563
+								$function_name($field_obj, $saved_value, '', '', $field_type_obj);
564 564
 							}
565 565
 							?>
566 566
 						</td>
@@ -578,10 +578,10 @@  discard block
 block discarded – undo
578 578
 		public function get_sections() {
579 579
 			$sections = array();
580 580
 
581
-			if ( ( $setting_fields = $this->prev_settings->give_settings( $this->current_tab ) ) && ! empty( $setting_fields['fields'] ) ) {
582
-				foreach ( $setting_fields['fields'] as $field ) {
583
-					if ( 'give_title' == $field['type'] ) {
584
-						$sections[ sanitize_title( $field['name'] ) ] = $this->get_section_name( $field['name'] );
581
+			if (($setting_fields = $this->prev_settings->give_settings($this->current_tab)) && ! empty($setting_fields['fields'])) {
582
+				foreach ($setting_fields['fields'] as $field) {
583
+					if ('give_title' == $field['type']) {
584
+						$sections[sanitize_title($field['name'])] = $this->get_section_name($field['name']);
585 585
 					}
586 586
 				}
587 587
 			}
@@ -601,16 +601,16 @@  discard block
 block discarded – undo
601 601
 
602 602
 			$new_setting_fields = array();
603 603
 
604
-			if ( $setting_fields = $this->prev_settings->give_settings( $this->current_tab ) ) {
605
-				if ( isset( $setting_fields['fields'] ) ) {
604
+			if ($setting_fields = $this->prev_settings->give_settings($this->current_tab)) {
605
+				if (isset($setting_fields['fields'])) {
606 606
 
607 607
 					$tab_data = array(
608 608
 						'id'         => $setting_fields['id'],
609 609
 						'give_title' => $setting_fields['give_title'],
610
-						'desc'       => ( isset( $setting_fields['desc'] ) ? $setting_fields['desc'] : '' ),
610
+						'desc'       => (isset($setting_fields['desc']) ? $setting_fields['desc'] : ''),
611 611
 					);
612 612
 
613
-					$new_setting_fields = $this->get_filtered_addon_settings( $setting_fields['fields'], $tab_data );
613
+					$new_setting_fields = $this->get_filtered_addon_settings($setting_fields['fields'], $tab_data);
614 614
 				}
615 615
 			}
616 616
 
@@ -627,24 +627,24 @@  discard block
 block discarded – undo
627 627
 			$sections = $this->get_sections();
628 628
 
629 629
 			// Show section settings only if setting section exist.
630
-			if ( $this->current_section && ! in_array( $this->current_section, array_keys( $sections ) ) ) {
631
-				echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>';
630
+			if ($this->current_section && ! in_array($this->current_section, array_keys($sections))) {
631
+				echo '<div class="error"><p>'.__('Oops, this settings page does not exist.', 'give').'</p></div>';
632 632
 				$GLOBALS['give_hide_save_button'] = true;
633 633
 
634 634
 				return;
635 635
 			}
636 636
 
637 637
 			// Bailout.
638
-			if ( empty( $sections ) ) {
638
+			if (empty($sections)) {
639 639
 				return;
640 640
 			}
641 641
 
642 642
 			echo '<ul class="subsubsub">';
643 643
 
644
-			$array_keys = array_keys( $sections );
644
+			$array_keys = array_keys($sections);
645 645
 
646
-			foreach ( $sections as $id => $label ) {
647
-				echo '<li><a href="' . admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=' . $this->current_tab . '&section=' . sanitize_title( $id ) ) . '" class="' . ( $this->current_section == $id ? 'current' : '' ) . '">' . strip_tags( $label ) . '</a> ' . ( end( $array_keys ) == $id ? '' : '|' ) . ' </li>';
646
+			foreach ($sections as $id => $label) {
647
+				echo '<li><a href="'.admin_url('edit.php?post_type=give_forms&page=give-settings&tab='.$this->current_tab.'&section='.sanitize_title($id)).'" class="'.($this->current_section == $id ? 'current' : '').'">'.strip_tags($label).'</a> '.(end($array_keys) == $id ? '' : '|').' </li>';
648 648
 			}
649 649
 
650 650
 			echo '</ul><br class="clear" /><hr>';
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 		public function output() {
660 660
 			$settings = $this->get_settings();
661 661
 
662
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
662
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
663 663
 		}
664 664
 
665 665
 		/**
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 		public function save() {
672 672
 			$settings = $this->get_settings();
673 673
 
674
-			Give_Admin_Settings::save_fields( $settings, 'give_settings' );
674
+			Give_Admin_Settings::save_fields($settings, 'give_settings');
675 675
 		}
676 676
 	}
677 677
 endif;
Please login to merge, or discard this patch.
includes/class-give-template-loader.php 1 patch
Spacing   +23 added lines, -23 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
 
@@ -36,29 +36,29 @@  discard block
 block discarded – undo
36 36
 		/**
37 37
 		 * Templates
38 38
 		 */
39
-		add_filter( 'template_include', array( __CLASS__, 'template_loader' ) );
39
+		add_filter('template_include', array(__CLASS__, 'template_loader'));
40 40
 
41 41
 		/**
42 42
 		 * Content Wrappers
43 43
 		 */
44
-		add_action( 'give_before_main_content', 'give_output_content_wrapper', 10 );
45
-		add_action( 'give_after_main_content', 'give_output_content_wrapper_end', 10 );
44
+		add_action('give_before_main_content', 'give_output_content_wrapper', 10);
45
+		add_action('give_after_main_content', 'give_output_content_wrapper_end', 10);
46 46
 
47 47
 		/**
48 48
 		 * Entry Summary Classes
49 49
 		 */
50
-		add_filter( 'give_forms_single_summary_classes', array( $this, 'give_set_single_summary_classes' ) );
50
+		add_filter('give_forms_single_summary_classes', array($this, 'give_set_single_summary_classes'));
51 51
 
52 52
 		/**
53 53
 		 * Sidebar
54 54
 		 */
55
-		add_action( 'give_before_single_form_summary', array( $this, 'give_output_sidebar_option' ), 1 );
55
+		add_action('give_before_single_form_summary', array($this, 'give_output_sidebar_option'), 1);
56 56
 
57 57
 		/**
58 58
 		 * Single Forms Summary Box
59 59
 		 */
60
-		add_action( 'give_single_form_summary', 'give_template_single_title', 5 );
61
-		add_action( 'give_single_form_summary', 'give_get_donation_form', 10 );
60
+		add_action('give_single_form_summary', 'give_template_single_title', 5);
61
+		add_action('give_single_form_summary', 'give_get_donation_form', 10);
62 62
 
63 63
 	}
64 64
 
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 	 *
74 74
 	 * @return string $classes List of space separated class names.
75 75
 	 */
76
-	public function give_set_single_summary_classes( $classes ) {
76
+	public function give_set_single_summary_classes($classes) {
77 77
 
78 78
 		//Add full width class when feature image is disabled AND no widgets are present
79
-		if ( ! give_is_setting_enabled( give_get_option( 'form_sidebar' ) ) ) {
79
+		if ( ! give_is_setting_enabled(give_get_option('form_sidebar'))) {
80 80
 			$classes .= ' give-full-width';
81 81
 		}
82 82
 
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
 	public function give_output_sidebar_option() {
98 98
 
99 99
 		//Add full width class when feature image is disabled AND no widgets are present
100
-		if ( give_is_setting_enabled( give_get_option( 'form_sidebar' ) ) ) {
101
-			add_action( 'give_before_single_form_summary', 'give_left_sidebar_pre_wrap', 5 );
102
-			add_action( 'give_before_single_form_summary', 'give_show_form_images', 10 );
103
-			add_action( 'give_before_single_form_summary', 'give_get_forms_sidebar', 20 );
104
-			add_action( 'give_before_single_form_summary', 'give_left_sidebar_post_wrap', 30 );
100
+		if (give_is_setting_enabled(give_get_option('form_sidebar'))) {
101
+			add_action('give_before_single_form_summary', 'give_left_sidebar_pre_wrap', 5);
102
+			add_action('give_before_single_form_summary', 'give_show_form_images', 10);
103
+			add_action('give_before_single_form_summary', 'give_get_forms_sidebar', 20);
104
+			add_action('give_before_single_form_summary', 'give_left_sidebar_post_wrap', 30);
105 105
 		}
106 106
 
107 107
 	}
@@ -123,20 +123,20 @@  discard block
 block discarded – undo
123 123
 	 *
124 124
 	 * @return string $template
125 125
 	 */
126
-	public static function template_loader( $template ) {
127
-		$find = array( 'give.php' );
126
+	public static function template_loader($template) {
127
+		$find = array('give.php');
128 128
 		$file = '';
129 129
 
130
-		if ( is_single() && get_post_type() == 'give_forms' ) {
130
+		if (is_single() && get_post_type() == 'give_forms') {
131 131
 			$file   = 'single-give-form.php';
132 132
 			$find[] = $file;
133
-			$find[] = apply_filters( 'give_template_path', 'give/' ) . $file;
133
+			$find[] = apply_filters('give_template_path', 'give/').$file;
134 134
 		}
135 135
 
136
-		if ( $file ) {
137
-			$template = locate_template( array_unique( $find ) );
138
-			if ( ! $template ) {
139
-				$template = GIVE_PLUGIN_DIR . '/templates/' . $file;
136
+		if ($file) {
137
+			$template = locate_template(array_unique($find));
138
+			if ( ! $template) {
139
+				$template = GIVE_PLUGIN_DIR.'/templates/'.$file;
140 140
 			}
141 141
 		}
142 142
 
Please login to merge, or discard this patch.
includes/admin/give-metabox-functions.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1283,7 +1283,7 @@
 block discarded – undo
1283 1283
  *
1284 1284
  * @param $field
1285 1285
  *
1286
- * @return string
1286
+ * @return integer
1287 1287
  */
1288 1288
 function _give_set_field_give_id_default_value( $field ) {
1289 1289
 	return 0;
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 				type="radio"
558 558
 				style="' . esc_attr( $field['style'] ) . '"
559 559
 				' . checked( esc_attr( $field['value'] ), esc_attr( $key ), false ) . ' '
560
-		     . give_get_custom_attributes( $field ) . '
560
+			 . give_get_custom_attributes( $field ) . '
561 561
 				/> ' . esc_html( $value ) . '</label>
562 562
 		</li>';
563 563
 	}
@@ -725,9 +725,9 @@  discard block
 block discarded – undo
725 725
 	$field['title'] = isset( $field['title'] ) ? $field['title'] : 'Documentation';
726 726
 
727 727
 	echo '<p class="give-docs-link"><a href="' . esc_url( $field['url'] )
728
-	     . '" target="_blank">'
729
-	     . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $field['title'] )
730
-	     . '<span class="dashicons dashicons-editor-help"></span></a></p>';
728
+		 . '" target="_blank">'
729
+		 . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $field['title'] )
730
+		 . '<span class="dashicons dashicons-editor-help"></span></a></p>';
731 731
 }
732 732
 
733 733
 
Please login to merge, or discard this patch.
Spacing   +315 added lines, -315 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 9
  * @since       1.8
10 10
  */
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit; // Exit if accessed directly
13 13
 }
14 14
 
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
  *
23 23
  * @return bool|string
24 24
  */
25
-function give_is_field_callback_exist( $field ) {
26
-	return ( give_get_field_callback( $field ) ? true : false );
25
+function give_is_field_callback_exist($field) {
26
+	return (give_get_field_callback($field) ? true : false);
27 27
 }
28 28
 
29 29
 /**
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
  *
36 36
  * @return bool|string
37 37
  */
38
-function give_get_field_callback( $field ) {
38
+function give_get_field_callback($field) {
39 39
 	$func_name_prefix = 'give';
40 40
 	$func_name        = '';
41 41
 
42 42
 	// Set callback function on basis of cmb2 field name.
43
-	switch ( $field['type'] ) {
43
+	switch ($field['type']) {
44 44
 		case 'radio_inline':
45 45
 			$func_name = "{$func_name_prefix}_radio";
46 46
 			break;
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 		default:
79 79
 
80 80
 			if (
81
-				array_key_exists( 'callback', $field )
82
-				&& ! empty( $field['callback'] )
81
+				array_key_exists('callback', $field)
82
+				&& ! empty($field['callback'])
83 83
 			) {
84 84
 				$func_name = $field['callback'];
85 85
 			} else {
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
 	 *
93 93
 	 * @since 1.8
94 94
 	 */
95
-	$func_name = apply_filters( 'give_get_field_callback', $func_name, $field );
95
+	$func_name = apply_filters('give_get_field_callback', $func_name, $field);
96 96
 
97 97
 	// Exit if not any function exist.
98 98
 	// Check if render callback exist or not.
99
-	if ( empty( $func_name ) ) {
99
+	if (empty($func_name)) {
100 100
 		return false;
101
-	} elseif ( is_string( $func_name ) && ! function_exists( "$func_name" ) ) {
101
+	} elseif (is_string($func_name) && ! function_exists("$func_name")) {
102 102
 		return false;
103
-	} elseif ( is_array( $func_name ) && ! method_exists( $func_name[0], "$func_name[1]" ) ) {
103
+	} elseif (is_array($func_name) && ! method_exists($func_name[0], "$func_name[1]")) {
104 104
 		return false;
105 105
 	}
106 106
 
@@ -116,35 +116,35 @@  discard block
 block discarded – undo
116 116
  *
117 117
  * @return bool
118 118
  */
119
-function give_render_field( $field ) {
119
+function give_render_field($field) {
120 120
 
121 121
 	// Check if render callback exist or not.
122
-	if ( ! ( $func_name = give_get_field_callback( $field ) ) ) {
122
+	if ( ! ($func_name = give_get_field_callback($field))) {
123 123
 		return false;
124 124
 	}
125 125
 
126 126
 	// CMB2 compatibility: Push all classes to attributes's class key
127
-	if ( empty( $field['class'] ) ) {
127
+	if (empty($field['class'])) {
128 128
 		$field['class'] = '';
129 129
 	}
130 130
 
131
-	if ( empty( $field['attributes']['class'] ) ) {
131
+	if (empty($field['attributes']['class'])) {
132 132
 		$field['attributes']['class'] = '';
133 133
 	}
134 134
 
135
-	$field['attributes']['class'] = trim( "give-field {$field['attributes']['class']} give-{$field['type']} {$field['class']}" );
136
-	unset( $field['class'] );
135
+	$field['attributes']['class'] = trim("give-field {$field['attributes']['class']} give-{$field['type']} {$field['class']}");
136
+	unset($field['class']);
137 137
 
138 138
 	// CMB2 compatibility: Set wrapper class if any.
139
-	if ( ! empty( $field['row_classes'] ) ) {
139
+	if ( ! empty($field['row_classes'])) {
140 140
 		$field['wrapper_class'] = $field['row_classes'];
141
-		unset( $field['row_classes'] );
141
+		unset($field['row_classes']);
142 142
 	}
143 143
 
144 144
 	// Set field params on basis of cmb2 field name.
145
-	switch ( $field['type'] ) {
145
+	switch ($field['type']) {
146 146
 		case 'radio_inline':
147
-			if ( empty( $field['wrapper_class'] ) ) {
147
+			if (empty($field['wrapper_class'])) {
148 148
 				$field['wrapper_class'] = '';
149 149
 			}
150 150
 			$field['wrapper_class'] .= ' give-inline-radio-fields';
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
 		case 'text-small' :
158 158
 		case 'text_small' :
159 159
 			// CMB2 compatibility: Set field type to text.
160
-			$field['type'] = isset( $field['attributes']['type'] ) ? $field['attributes']['type'] : 'text';
160
+			$field['type'] = isset($field['attributes']['type']) ? $field['attributes']['type'] : 'text';
161 161
 
162 162
 			// CMB2 compatibility: Set data type to price.
163 163
 			if (
164
-				empty( $field['data_type'] )
165
-				&& ! empty( $field['attributes']['class'] )
164
+				empty($field['data_type'])
165
+				&& ! empty($field['attributes']['class'])
166 166
 				&& (
167
-					false !== strpos( $field['attributes']['class'], 'money' )
168
-					|| false !== strpos( $field['attributes']['class'], 'amount' )
167
+					false !== strpos($field['attributes']['class'], 'money')
168
+					|| false !== strpos($field['attributes']['class'], 'amount')
169 169
 				)
170 170
 			) {
171 171
 				$field['data_type'] = 'decimal';
@@ -184,22 +184,22 @@  discard block
 block discarded – undo
184 184
 		case 'give_default_radio_inline':
185 185
 			$field['type']    = 'radio';
186 186
 			$field['options'] = array(
187
-				'default' => __( 'Default' ),
187
+				'default' => __('Default'),
188 188
 			);
189 189
 			break;
190 190
 	}
191 191
 
192 192
 	// CMB2 compatibility: Add support to define field description by desc & description param.
193 193
 	// We encourage you to use description param.
194
-	$field['description'] = ( ! empty( $field['description'] )
194
+	$field['description'] = ( ! empty($field['description'])
195 195
 		? $field['description']
196
-		: ( ! empty( $field['desc'] ) ? $field['desc'] : '' ) );
196
+		: ( ! empty($field['desc']) ? $field['desc'] : ''));
197 197
 
198 198
 	// Call render function.
199
-	if ( is_array( $func_name ) ) {
200
-		$func_name[0]->{$func_name[1]}( $field );
199
+	if (is_array($func_name)) {
200
+		$func_name[0]->{$func_name[1]}($field);
201 201
 	} else {
202
-		$func_name( $field );
202
+		$func_name($field);
203 203
 	}
204 204
 
205 205
 	return true;
@@ -229,29 +229,29 @@  discard block
 block discarded – undo
229 229
  * }
230 230
  * @return void
231 231
  */
232
-function give_text_input( $field ) {
232
+function give_text_input($field) {
233 233
 	global $thepostid, $post;
234 234
 
235
-	$thepostid              = empty( $thepostid ) ? $post->ID : $thepostid;
236
-	$field['style']         = isset( $field['style'] ) ? $field['style'] : '';
237
-	$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';
238
-	$field['value']         = give_get_field_value( $field, $thepostid );
239
-	$field['type']          = isset( $field['type'] ) ? $field['type'] : 'text';
235
+	$thepostid              = empty($thepostid) ? $post->ID : $thepostid;
236
+	$field['style']         = isset($field['style']) ? $field['style'] : '';
237
+	$field['wrapper_class'] = isset($field['wrapper_class']) ? $field['wrapper_class'] : '';
238
+	$field['value']         = give_get_field_value($field, $thepostid);
239
+	$field['type']          = isset($field['type']) ? $field['type'] : 'text';
240 240
 	$field['before_field']  = '';
241 241
 	$field['after_field']   = '';
242
-	$data_type              = empty( $field['data_type'] ) ? '' : $field['data_type'];
242
+	$data_type              = empty($field['data_type']) ? '' : $field['data_type'];
243 243
 
244
-	switch ( $data_type ) {
244
+	switch ($data_type) {
245 245
 		case 'price' :
246
-			$field['value'] = ( ! empty( $field['value'] ) ? give_format_amount( give_maybe_sanitize_amount( $field['value'] ), array( 'sanitize' => false ) ) : $field['value'] );
246
+			$field['value'] = ( ! empty($field['value']) ? give_format_amount(give_maybe_sanitize_amount($field['value']), array('sanitize' => false)) : $field['value']);
247 247
 
248
-			$field['before_field'] = ! empty( $field['before_field'] ) ? $field['before_field'] : ( give_get_option( 'currency_position', 'before' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '' );
249
-			$field['after_field']  = ! empty( $field['after_field'] ) ? $field['after_field'] : ( give_get_option( 'currency_position', 'before' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '' );
248
+			$field['before_field'] = ! empty($field['before_field']) ? $field['before_field'] : (give_get_option('currency_position', 'before') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '');
249
+			$field['after_field']  = ! empty($field['after_field']) ? $field['after_field'] : (give_get_option('currency_position', 'before') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '');
250 250
 			break;
251 251
 
252 252
 		case 'decimal' :
253 253
 			$field['attributes']['class'] .= ' give_input_decimal';
254
-			$field['value']               = ( ! empty( $field['value'] ) ? give_format_decimal( give_maybe_sanitize_amount( $field['value'] ), false, false ) : $field['value'] );
254
+			$field['value'] = ( ! empty($field['value']) ? give_format_decimal(give_maybe_sanitize_amount($field['value']), false, false) : $field['value']);
255 255
 			break;
256 256
 
257 257
 		default :
@@ -259,20 +259,20 @@  discard block
 block discarded – undo
259 259
 	}
260 260
 
261 261
 	?>
262
-	<p class="give-field-wrap <?php echo esc_attr( $field['id'] ); ?>_field <?php echo esc_attr( $field['wrapper_class'] ); ?>">
263
-	<label for="<?php echo give_get_field_name( $field ); ?>"><?php echo wp_kses_post( $field['name'] ); ?></label>
262
+	<p class="give-field-wrap <?php echo esc_attr($field['id']); ?>_field <?php echo esc_attr($field['wrapper_class']); ?>">
263
+	<label for="<?php echo give_get_field_name($field); ?>"><?php echo wp_kses_post($field['name']); ?></label>
264 264
 	<?php echo $field['before_field']; ?>
265 265
 	<input
266
-			type="<?php echo esc_attr( $field['type'] ); ?>"
267
-			style="<?php echo esc_attr( $field['style'] ); ?>"
268
-			name="<?php echo give_get_field_name( $field ); ?>"
269
-			id="<?php echo esc_attr( $field['id'] ); ?>"
270
-			value="<?php echo esc_attr( $field['value'] ); ?>"
271
-		<?php echo give_get_custom_attributes( $field ); ?>
266
+			type="<?php echo esc_attr($field['type']); ?>"
267
+			style="<?php echo esc_attr($field['style']); ?>"
268
+			name="<?php echo give_get_field_name($field); ?>"
269
+			id="<?php echo esc_attr($field['id']); ?>"
270
+			value="<?php echo esc_attr($field['value']); ?>"
271
+		<?php echo give_get_custom_attributes($field); ?>
272 272
 	/>
273 273
 	<?php echo $field['after_field']; ?>
274 274
 	<?php
275
-	echo give_get_field_description( $field );
275
+	echo give_get_field_description($field);
276 276
 	echo '</p>';
277 277
 }
278 278
 
@@ -294,29 +294,29 @@  discard block
 block discarded – undo
294 294
  * }
295 295
  * @return void
296 296
  */
297
-function give_hidden_input( $field ) {
297
+function give_hidden_input($field) {
298 298
 	global $thepostid, $post;
299 299
 
300
-	$thepostid      = empty( $thepostid ) ? $post->ID : $thepostid;
301
-	$field['value'] = give_get_field_value( $field, $thepostid );
300
+	$thepostid      = empty($thepostid) ? $post->ID : $thepostid;
301
+	$field['value'] = give_get_field_value($field, $thepostid);
302 302
 
303 303
 	// Custom attribute handling
304 304
 	$custom_attributes = array();
305 305
 
306
-	if ( ! empty( $field['attributes'] ) && is_array( $field['attributes'] ) ) {
306
+	if ( ! empty($field['attributes']) && is_array($field['attributes'])) {
307 307
 
308
-		foreach ( $field['attributes'] as $attribute => $value ) {
309
-			$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $value ) . '"';
308
+		foreach ($field['attributes'] as $attribute => $value) {
309
+			$custom_attributes[] = esc_attr($attribute).'="'.esc_attr($value).'"';
310 310
 		}
311 311
 	}
312 312
 	?>
313 313
 
314 314
 	<input
315 315
 			type="hidden"
316
-			name="<?php echo give_get_field_name( $field ); ?>"
317
-			id="<?php echo esc_attr( $field['id'] ); ?>"
318
-			value="<?php echo esc_attr( $field['value'] ); ?>"
319
-		<?php echo give_get_custom_attributes( $field ); ?>
316
+			name="<?php echo give_get_field_name($field); ?>"
317
+			id="<?php echo esc_attr($field['id']); ?>"
318
+			value="<?php echo esc_attr($field['value']); ?>"
319
+		<?php echo give_get_custom_attributes($field); ?>
320 320
 	/>
321 321
 	<?php
322 322
 }
@@ -342,27 +342,27 @@  discard block
 block discarded – undo
342 342
  * }
343 343
  * @return void
344 344
  */
345
-function give_textarea_input( $field ) {
345
+function give_textarea_input($field) {
346 346
 	global $thepostid, $post;
347 347
 
348
-	$thepostid              = empty( $thepostid ) ? $post->ID : $thepostid;
349
-	$field['style']         = isset( $field['style'] ) ? $field['style'] : '';
350
-	$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';
351
-	$field['value']         = give_get_field_value( $field, $thepostid );
348
+	$thepostid              = empty($thepostid) ? $post->ID : $thepostid;
349
+	$field['style']         = isset($field['style']) ? $field['style'] : '';
350
+	$field['wrapper_class'] = isset($field['wrapper_class']) ? $field['wrapper_class'] : '';
351
+	$field['value']         = give_get_field_value($field, $thepostid);
352 352
 
353 353
 	?>
354
-	<p class="give-field-wrap <?php echo esc_attr( $field['id'] ); ?>_field <?php echo esc_attr( $field['wrapper_class'] ); ?>">
355
-	<label for="<?php echo give_get_field_name( $field ); ?>"><?php echo wp_kses_post( $field['name'] ); ?></label>
354
+	<p class="give-field-wrap <?php echo esc_attr($field['id']); ?>_field <?php echo esc_attr($field['wrapper_class']); ?>">
355
+	<label for="<?php echo give_get_field_name($field); ?>"><?php echo wp_kses_post($field['name']); ?></label>
356 356
 	<textarea
357
-			style="<?php echo esc_attr( $field['style'] ); ?>"
358
-			name="<?php echo give_get_field_name( $field ); ?>"
359
-			id="<?php echo esc_attr( $field['id'] ); ?>"
357
+			style="<?php echo esc_attr($field['style']); ?>"
358
+			name="<?php echo give_get_field_name($field); ?>"
359
+			id="<?php echo esc_attr($field['id']); ?>"
360 360
 			rows="10"
361 361
 			cols="20"
362
-		<?php echo give_get_custom_attributes( $field ); ?>
363
-	><?php echo esc_textarea( $field['value'] ); ?></textarea>
362
+		<?php echo give_get_custom_attributes($field); ?>
363
+	><?php echo esc_textarea($field['value']); ?></textarea>
364 364
 	<?php
365
-	echo give_get_field_description( $field );
365
+	echo give_get_field_description($field);
366 366
 	echo '</p>';
367 367
 }
368 368
 
@@ -386,29 +386,29 @@  discard block
 block discarded – undo
386 386
  * }
387 387
  * @return void
388 388
  */
389
-function give_wysiwyg( $field ) {
389
+function give_wysiwyg($field) {
390 390
 	global $thepostid, $post;
391 391
 
392
-	$thepostid              = empty( $thepostid ) ? $post->ID : $thepostid;
393
-	$field['value']         = give_get_field_value( $field, $thepostid );
394
-	$field['style']         = isset( $field['style'] ) ? $field['style'] : '';
395
-	$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';
392
+	$thepostid              = empty($thepostid) ? $post->ID : $thepostid;
393
+	$field['value']         = give_get_field_value($field, $thepostid);
394
+	$field['style']         = isset($field['style']) ? $field['style'] : '';
395
+	$field['wrapper_class'] = isset($field['wrapper_class']) ? $field['wrapper_class'] : '';
396 396
 
397
-	$field['unique_field_id'] = give_get_field_name( $field );
397
+	$field['unique_field_id'] = give_get_field_name($field);
398 398
 	$editor_attributes        = array(
399
-		'textarea_name' => isset( $field['repeatable_field_id'] ) ? $field['repeatable_field_id'] : $field['id'],
399
+		'textarea_name' => isset($field['repeatable_field_id']) ? $field['repeatable_field_id'] : $field['id'],
400 400
 		'textarea_rows' => '10',
401
-		'editor_css'    => esc_attr( $field['style'] ),
401
+		'editor_css'    => esc_attr($field['style']),
402 402
 		'editor_class'  => $field['attributes']['class'],
403 403
 	);
404
-	$data_wp_editor           = ' data-wp-editor="' . base64_encode( json_encode( array(
404
+	$data_wp_editor = ' data-wp-editor="'.base64_encode(json_encode(array(
405 405
 			$field['value'],
406 406
 			$field['unique_field_id'],
407 407
 			$editor_attributes,
408
-		) ) ) . '"';
409
-	$data_wp_editor           = isset( $field['repeatable_field_id'] ) ? $data_wp_editor : '';
408
+		))).'"';
409
+	$data_wp_editor = isset($field['repeatable_field_id']) ? $data_wp_editor : '';
410 410
 
411
-	echo '<div class="give-field-wrap ' . $field['unique_field_id'] . '_field ' . esc_attr( $field['wrapper_class'] ) . '"' . $data_wp_editor . '><label for="' . $field['unique_field_id'] . '">' . wp_kses_post( $field['name'] ) . '</label>';
411
+	echo '<div class="give-field-wrap '.$field['unique_field_id'].'_field '.esc_attr($field['wrapper_class']).'"'.$data_wp_editor.'><label for="'.$field['unique_field_id'].'">'.wp_kses_post($field['name']).'</label>';
412 412
 
413 413
 	wp_editor(
414 414
 		$field['value'],
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 		$editor_attributes
417 417
 	);
418 418
 
419
-	echo give_get_field_description( $field );
419
+	echo give_get_field_description($field);
420 420
 	echo '</div>';
421 421
 }
422 422
 
@@ -441,29 +441,29 @@  discard block
 block discarded – undo
441 441
  * }
442 442
  * @return void
443 443
  */
444
-function give_checkbox( $field ) {
444
+function give_checkbox($field) {
445 445
 	global $thepostid, $post;
446 446
 
447
-	$thepostid              = empty( $thepostid ) ? $post->ID : $thepostid;
448
-	$field['style']         = isset( $field['style'] ) ? $field['style'] : '';
449
-	$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';
450
-	$field['value']         = give_get_field_value( $field, $thepostid );
451
-	$field['cbvalue']       = isset( $field['cbvalue'] ) ? $field['cbvalue'] : 'on';
452
-	$field['name']          = isset( $field['name'] ) ? $field['name'] : $field['id'];
447
+	$thepostid              = empty($thepostid) ? $post->ID : $thepostid;
448
+	$field['style']         = isset($field['style']) ? $field['style'] : '';
449
+	$field['wrapper_class'] = isset($field['wrapper_class']) ? $field['wrapper_class'] : '';
450
+	$field['value']         = give_get_field_value($field, $thepostid);
451
+	$field['cbvalue']       = isset($field['cbvalue']) ? $field['cbvalue'] : 'on';
452
+	$field['name']          = isset($field['name']) ? $field['name'] : $field['id'];
453 453
 	?>
454
-	<p class="give-field-wrap <?php echo esc_attr( $field['id'] ); ?>_field <?php echo esc_attr( $field['wrapper_class'] ); ?>">
455
-	<label for="<?php echo give_get_field_name( $field ); ?>"><?php echo wp_kses_post( $field['name'] ); ?></label>
454
+	<p class="give-field-wrap <?php echo esc_attr($field['id']); ?>_field <?php echo esc_attr($field['wrapper_class']); ?>">
455
+	<label for="<?php echo give_get_field_name($field); ?>"><?php echo wp_kses_post($field['name']); ?></label>
456 456
 	<input
457 457
 			type="checkbox"
458
-			style="<?php echo esc_attr( $field['style'] ); ?>"
459
-			name="<?php echo give_get_field_name( $field ); ?>"
460
-			id="<?php echo esc_attr( $field['id'] ); ?>"
461
-			value="<?php echo esc_attr( $field['cbvalue'] ); ?>"
462
-		<?php echo checked( $field['value'], $field['cbvalue'], false ); ?>
463
-		<?php echo give_get_custom_attributes( $field ); ?>
458
+			style="<?php echo esc_attr($field['style']); ?>"
459
+			name="<?php echo give_get_field_name($field); ?>"
460
+			id="<?php echo esc_attr($field['id']); ?>"
461
+			value="<?php echo esc_attr($field['cbvalue']); ?>"
462
+		<?php echo checked($field['value'], $field['cbvalue'], false); ?>
463
+		<?php echo give_get_custom_attributes($field); ?>
464 464
 	/>
465 465
 	<?php
466
-	echo give_get_field_description( $field );
466
+	echo give_get_field_description($field);
467 467
 	echo '</p>';
468 468
 }
469 469
 
@@ -489,29 +489,29 @@  discard block
 block discarded – undo
489 489
  * }
490 490
  * @return void
491 491
  */
492
-function give_select( $field ) {
492
+function give_select($field) {
493 493
 	global $thepostid, $post;
494 494
 
495
-	$thepostid              = empty( $thepostid ) ? $post->ID : $thepostid;
496
-	$field['style']         = isset( $field['style'] ) ? $field['style'] : '';
497
-	$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';
498
-	$field['value']         = give_get_field_value( $field, $thepostid );
499
-	$field['name']          = isset( $field['name'] ) ? $field['name'] : $field['id'];
495
+	$thepostid              = empty($thepostid) ? $post->ID : $thepostid;
496
+	$field['style']         = isset($field['style']) ? $field['style'] : '';
497
+	$field['wrapper_class'] = isset($field['wrapper_class']) ? $field['wrapper_class'] : '';
498
+	$field['value']         = give_get_field_value($field, $thepostid);
499
+	$field['name']          = isset($field['name']) ? $field['name'] : $field['id'];
500 500
 	?>
501
-	<p class="give-field-wrap <?php echo esc_attr( $field['id'] ); ?>_field <?php echo esc_attr( $field['wrapper_class'] ); ?>">
502
-	<label for="<?php echo give_get_field_name( $field ); ?>"><?php echo wp_kses_post( $field['name'] ); ?></label>
501
+	<p class="give-field-wrap <?php echo esc_attr($field['id']); ?>_field <?php echo esc_attr($field['wrapper_class']); ?>">
502
+	<label for="<?php echo give_get_field_name($field); ?>"><?php echo wp_kses_post($field['name']); ?></label>
503 503
 	<select
504
-	id="<?php echo esc_attr( $field['id'] ); ?>"
505
-	name="<?php echo give_get_field_name( $field ); ?>"
506
-	style="<?php echo esc_attr( $field['style'] ) ?>"
507
-	<?php echo give_get_custom_attributes( $field ); ?>
504
+	id="<?php echo esc_attr($field['id']); ?>"
505
+	name="<?php echo give_get_field_name($field); ?>"
506
+	style="<?php echo esc_attr($field['style']) ?>"
507
+	<?php echo give_get_custom_attributes($field); ?>
508 508
 	>
509 509
 	<?php
510
-	foreach ( $field['options'] as $key => $value ) {
511
-		echo '<option value="' . esc_attr( $key ) . '" ' . selected( esc_attr( $field['value'] ), esc_attr( $key ), false ) . '>' . esc_html( $value ) . '</option>';
510
+	foreach ($field['options'] as $key => $value) {
511
+		echo '<option value="'.esc_attr($key).'" '.selected(esc_attr($field['value']), esc_attr($key), false).'>'.esc_html($value).'</option>';
512 512
 	}
513 513
 	echo '</select>';
514
-	echo give_get_field_description( $field );
514
+	echo give_get_field_description($field);
515 515
 	echo '</p>';
516 516
 }
517 517
 
@@ -538,32 +538,32 @@  discard block
 block discarded – undo
538 538
  * }
539 539
  * @return void
540 540
  */
541
-function give_radio( $field ) {
541
+function give_radio($field) {
542 542
 	global $thepostid, $post;
543 543
 
544
-	$thepostid              = empty( $thepostid ) ? $post->ID : $thepostid;
545
-	$field['style']         = isset( $field['style'] ) ? $field['style'] : '';
546
-	$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';
547
-	$field['value']         = give_get_field_value( $field, $thepostid );
548
-	$field['name']          = isset( $field['name'] ) ? $field['name'] : $field['id'];
544
+	$thepostid              = empty($thepostid) ? $post->ID : $thepostid;
545
+	$field['style']         = isset($field['style']) ? $field['style'] : '';
546
+	$field['wrapper_class'] = isset($field['wrapper_class']) ? $field['wrapper_class'] : '';
547
+	$field['value']         = give_get_field_value($field, $thepostid);
548
+	$field['name']          = isset($field['name']) ? $field['name'] : $field['id'];
549 549
 
550
-	echo '<fieldset class="give-field-wrap ' . esc_attr( $field['id'] ) . '_field ' . esc_attr( $field['wrapper_class'] ) . '"><span class="give-field-label">' . wp_kses_post( $field['name'] ) . '</span><legend class="screen-reader-text">' . wp_kses_post( $field['name'] ) . '</legend><ul class="give-radios">';
550
+	echo '<fieldset class="give-field-wrap '.esc_attr($field['id']).'_field '.esc_attr($field['wrapper_class']).'"><span class="give-field-label">'.wp_kses_post($field['name']).'</span><legend class="screen-reader-text">'.wp_kses_post($field['name']).'</legend><ul class="give-radios">';
551 551
 
552
-	foreach ( $field['options'] as $key => $value ) {
552
+	foreach ($field['options'] as $key => $value) {
553 553
 
554 554
 		echo '<li><label><input
555
-				name="' . give_get_field_name( $field ) . '"
556
-				value="' . esc_attr( $key ) . '"
555
+				name="' . give_get_field_name($field).'"
556
+				value="' . esc_attr($key).'"
557 557
 				type="radio"
558
-				style="' . esc_attr( $field['style'] ) . '"
559
-				' . checked( esc_attr( $field['value'] ), esc_attr( $key ), false ) . ' '
560
-		     . give_get_custom_attributes( $field ) . '
561
-				/> ' . esc_html( $value ) . '</label>
558
+				style="' . esc_attr($field['style']).'"
559
+				' . checked(esc_attr($field['value']), esc_attr($key), false).' '
560
+		     . give_get_custom_attributes($field).'
561
+				/> ' . esc_html($value).'</label>
562 562
 		</li>';
563 563
 	}
564 564
 	echo '</ul>';
565 565
 
566
-	echo give_get_field_description( $field );
566
+	echo give_get_field_description($field);
567 567
 	echo '</fieldset>';
568 568
 }
569 569
 
@@ -587,27 +587,27 @@  discard block
 block discarded – undo
587 587
  * }
588 588
  * @return void
589 589
  */
590
-function give_colorpicker( $field ) {
590
+function give_colorpicker($field) {
591 591
 	global $thepostid, $post;
592 592
 
593
-	$thepostid              = empty( $thepostid ) ? $post->ID : $thepostid;
594
-	$field['style']         = isset( $field['style'] ) ? $field['style'] : '';
595
-	$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';
596
-	$field['value']         = give_get_field_value( $field, $thepostid );
597
-	$field['name']          = isset( $field['name'] ) ? $field['name'] : $field['id'];
593
+	$thepostid              = empty($thepostid) ? $post->ID : $thepostid;
594
+	$field['style']         = isset($field['style']) ? $field['style'] : '';
595
+	$field['wrapper_class'] = isset($field['wrapper_class']) ? $field['wrapper_class'] : '';
596
+	$field['value']         = give_get_field_value($field, $thepostid);
597
+	$field['name']          = isset($field['name']) ? $field['name'] : $field['id'];
598 598
 	$field['type']          = 'text';
599 599
 	?>
600
-	<p class="give-field-wrap <?php echo esc_attr( $field['id'] ); ?>_field <?php echo esc_attr( $field['wrapper_class'] ); ?>">
601
-	<label for="<?php echo give_get_field_name( $field ); ?>"><?php echo wp_kses_post( $field['name'] ); ?></label>
600
+	<p class="give-field-wrap <?php echo esc_attr($field['id']); ?>_field <?php echo esc_attr($field['wrapper_class']); ?>">
601
+	<label for="<?php echo give_get_field_name($field); ?>"><?php echo wp_kses_post($field['name']); ?></label>
602 602
 	<input
603
-			type="<?php echo esc_attr( $field['type'] ); ?>"
604
-			style="<?php echo esc_attr( $field['style'] ); ?>"
605
-			name="<?php echo give_get_field_name( $field ); ?>"
606
-			id="' . esc_attr( $field['id'] ) . '" value="<?php echo esc_attr( $field['value'] ); ?>"
607
-		<?php echo give_get_custom_attributes( $field ); ?>
603
+			type="<?php echo esc_attr($field['type']); ?>"
604
+			style="<?php echo esc_attr($field['style']); ?>"
605
+			name="<?php echo give_get_field_name($field); ?>"
606
+			id="' . esc_attr( $field['id'] ) . '" value="<?php echo esc_attr($field['value']); ?>"
607
+		<?php echo give_get_custom_attributes($field); ?>
608 608
 	/>
609 609
 	<?php
610
-	echo give_get_field_description( $field );
610
+	echo give_get_field_description($field);
611 611
 	echo '</p>';
612 612
 }
613 613
 
@@ -618,8 +618,8 @@  discard block
 block discarded – undo
618 618
  *
619 619
  * @param array $field
620 620
  */
621
-function give_file( $field ) {
622
-	give_media( $field );
621
+function give_file($field) {
622
+	give_media($field);
623 623
 }
624 624
 
625 625
 
@@ -630,37 +630,37 @@  discard block
 block discarded – undo
630 630
  *
631 631
  * @param array $field
632 632
  */
633
-function give_media( $field ) {
633
+function give_media($field) {
634 634
 	global $thepostid, $post;
635 635
 
636
-	$thepostid    = empty( $thepostid ) ? $post->ID : $thepostid;
637
-	$button_label = esc_html__( sprintf( 'Add or Upload %s', ( 'file' === $field['type'] ? 'File' : 'Image' ) ), 'give' );
636
+	$thepostid    = empty($thepostid) ? $post->ID : $thepostid;
637
+	$button_label = esc_html__(sprintf('Add or Upload %s', ('file' === $field['type'] ? 'File' : 'Image')), 'give');
638 638
 
639
-	$field['style']               = isset( $field['style'] ) ? $field['style'] : '';
640
-	$field['wrapper_class']       = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';
641
-	$field['value']               = give_get_field_value( $field, $thepostid );
642
-	$field['name']                = isset( $field['name'] ) ? $field['name'] : $field['id'];
639
+	$field['style']               = isset($field['style']) ? $field['style'] : '';
640
+	$field['wrapper_class']       = isset($field['wrapper_class']) ? $field['wrapper_class'] : '';
641
+	$field['value']               = give_get_field_value($field, $thepostid);
642
+	$field['name']                = isset($field['name']) ? $field['name'] : $field['id'];
643 643
 	$field['attributes']['class'] = "{$field['attributes']['class']} give-text-medium";
644 644
 
645 645
 	// Allow developer to save attachment ID or attachment url as metadata.
646
-	$field['fvalue'] = isset( $field['fvalue'] ) ? $field['fvalue'] : 'url';
646
+	$field['fvalue'] = isset($field['fvalue']) ? $field['fvalue'] : 'url';
647 647
 
648
-	$allow_media_preview_tags = array( 'jpg', 'jpeg', 'png', 'gif', 'ico' );
649
-	$preview_image_src        = $field['value'] ? ( 'id' === $field['fvalue'] ? wp_get_attachment_url( $field['value'] ) : $field['value'] ) : '#';
650
-	$preview_image_extension  = $preview_image_src ? pathinfo( $preview_image_src, PATHINFO_EXTENSION ) : '';
651
-	$is_show_preview          = in_array( $preview_image_extension, $allow_media_preview_tags );
648
+	$allow_media_preview_tags = array('jpg', 'jpeg', 'png', 'gif', 'ico');
649
+	$preview_image_src        = $field['value'] ? ('id' === $field['fvalue'] ? wp_get_attachment_url($field['value']) : $field['value']) : '#';
650
+	$preview_image_extension  = $preview_image_src ? pathinfo($preview_image_src, PATHINFO_EXTENSION) : '';
651
+	$is_show_preview          = in_array($preview_image_extension, $allow_media_preview_tags);
652 652
 	?>
653
-	<fieldset class="give-field-wrap <?php echo esc_attr( $field['id'] ); ?>_field <?php echo esc_attr( $field['wrapper_class'] ); ?>">
654
-		<label for="<?php echo give_get_field_name( $field ) ?>"><?php echo wp_kses_post( $field['name'] ); ?></label>
653
+	<fieldset class="give-field-wrap <?php echo esc_attr($field['id']); ?>_field <?php echo esc_attr($field['wrapper_class']); ?>">
654
+		<label for="<?php echo give_get_field_name($field) ?>"><?php echo wp_kses_post($field['name']); ?></label>
655 655
 		<input
656
-				name="<?php echo give_get_field_name( $field ); ?>"
657
-				id="<?php echo esc_attr( $field['id'] ); ?>"
656
+				name="<?php echo give_get_field_name($field); ?>"
657
+				id="<?php echo esc_attr($field['id']); ?>"
658 658
 				type="text"
659 659
 				value="<?php echo $field['value']; ?>"
660
-				style="<?php echo esc_attr( $field['style'] ); ?>"
661
-			<?php echo give_get_custom_attributes( $field ); ?>
660
+				style="<?php echo esc_attr($field['style']); ?>"
661
+			<?php echo give_get_custom_attributes($field); ?>
662 662
 		/>&nbsp;&nbsp;&nbsp;&nbsp;<input class="give-upload-button button" type="button" value="<?php echo $button_label; ?>" data-fvalue="<?php echo $field['fvalue']; ?>" data-field-type="<?php echo $field['type']; ?>">
663
-		<?php echo give_get_field_description( $field ); ?>
663
+		<?php echo give_get_field_description($field); ?>
664 664
 		<div class="give-image-thumb<?php echo ! $field['value'] || ! $is_show_preview ? ' give-hidden' : ''; ?>">
665 665
 			<span class="give-delete-image-thumb dashicons dashicons-no-alt"></span>
666 666
 			<img src="<?php echo $preview_image_src; ?>" alt="">
@@ -678,27 +678,27 @@  discard block
 block discarded – undo
678 678
  *
679 679
  * @return void
680 680
  */
681
-function give_default_gateway( $field ) {
681
+function give_default_gateway($field) {
682 682
 	global $thepostid, $post;
683 683
 
684 684
 	// get all active payment gateways.
685
-	$gateways         = give_get_enabled_payment_gateways( $thepostid );
685
+	$gateways         = give_get_enabled_payment_gateways($thepostid);
686 686
 	$field['options'] = array();
687 687
 
688 688
 	// Set field option value.
689
-	if ( ! empty( $gateways ) ) {
690
-		foreach ( $gateways as $key => $option ) {
691
-			$field['options'][ $key ] = $option['admin_label'];
689
+	if ( ! empty($gateways)) {
690
+		foreach ($gateways as $key => $option) {
691
+			$field['options'][$key] = $option['admin_label'];
692 692
 		}
693 693
 	}
694 694
 
695 695
 	// Add a field to the Give Form admin single post view of this field
696
-	if ( is_object( $post ) && 'give_forms' === $post->post_type ) {
697
-		$field['options'] = array_merge( array( 'global' => esc_html__( 'Global Default', 'give' ) ), $field['options'] );
696
+	if (is_object($post) && 'give_forms' === $post->post_type) {
697
+		$field['options'] = array_merge(array('global' => esc_html__('Global Default', 'give')), $field['options']);
698 698
 	}
699 699
 
700 700
 	// Render select field.
701
-	give_select( $field );
701
+	give_select($field);
702 702
 }
703 703
 
704 704
 /**
@@ -720,13 +720,13 @@  discard block
 block discarded – undo
720 720
  * @return void
721 721
  */
722 722
 
723
-function give_docs_link( $field ) {
724
-	$field['url']   = isset( $field['url'] ) ? $field['url'] : 'https://givewp.com/documentation';
725
-	$field['title'] = isset( $field['title'] ) ? $field['title'] : 'Documentation';
723
+function give_docs_link($field) {
724
+	$field['url']   = isset($field['url']) ? $field['url'] : 'https://givewp.com/documentation';
725
+	$field['title'] = isset($field['title']) ? $field['title'] : 'Documentation';
726 726
 
727
-	echo '<p class="give-docs-link"><a href="' . esc_url( $field['url'] )
727
+	echo '<p class="give-docs-link"><a href="'.esc_url($field['url'])
728 728
 	     . '" target="_blank">'
729
-	     . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $field['title'] )
729
+	     . sprintf(esc_html__('Need Help? See docs on "%s"', 'give'), $field['title'])
730 730
 	     . '<span class="dashicons dashicons-editor-help"></span></a></p>';
731 731
 }
732 732
 
@@ -737,15 +737,15 @@  discard block
 block discarded – undo
737 737
  * @since 2.0
738 738
  * @param $field
739 739
  */
740
-function give_email_preview_buttons( $field ) {
740
+function give_email_preview_buttons($field) {
741 741
 	/* @var WP_Post $post */
742 742
 	global $post;
743 743
 
744
-	$field_id = str_replace( array( '_give_', '_preview_buttons' ), '', $field['id'] );
744
+	$field_id = str_replace(array('_give_', '_preview_buttons'), '', $field['id']);
745 745
 
746 746
 	ob_start();
747 747
 
748
-	echo '<p class="give-field-wrap ' . esc_attr( $field['id'] ) . '_field"><label for="' . give_get_field_name( $field ) . '">' . wp_kses_post( $field['name'] ) . '</label>';
748
+	echo '<p class="give-field-wrap '.esc_attr($field['id']).'_field"><label for="'.give_get_field_name($field).'">'.wp_kses_post($field['name']).'</label>';
749 749
 
750 750
 	echo sprintf(
751 751
 		'<a href="%1$s" class="button-secondary" target="_blank">%2$s</a>',
@@ -773,12 +773,12 @@  discard block
 block discarded – undo
773 773
 					'form_id'      => $post->ID,
774 774
 				)
775 775
 			), 'give-send-preview-email' ),
776
-		esc_attr__( 'Send Test Email.', 'give' ),
777
-		esc_html__( 'Send Test Email', 'give' )
776
+		esc_attr__('Send Test Email.', 'give'),
777
+		esc_html__('Send Test Email', 'give')
778 778
 	);
779 779
 
780
-	if ( ! empty( $field['description'] ) ) {
781
-		echo '<span class="give-field-description">' . wp_kses_post( $field['desc'] ) . '</span>';
780
+	if ( ! empty($field['description'])) {
781
+		echo '<span class="give-field-description">'.wp_kses_post($field['desc']).'</span>';
782 782
 	}
783 783
 
784 784
 	echo '</p>';
@@ -798,13 +798,13 @@  discard block
 block discarded – undo
798 798
  *
799 799
  * @return mixed
800 800
  */
801
-function give_get_field_value( $field, $postid ) {
802
-	if ( isset( $field['attributes']['value'] ) ) {
801
+function give_get_field_value($field, $postid) {
802
+	if (isset($field['attributes']['value'])) {
803 803
 		return $field['attributes']['value'];
804 804
 	}
805 805
 
806 806
 	// Get value from db.
807
-	$field_value = give_get_meta( $postid, $field['id'], true );
807
+	$field_value = give_get_meta($postid, $field['id'], true);
808 808
 
809 809
 	/**
810 810
 	 * Filter the field value before apply default value.
@@ -813,10 +813,10 @@  discard block
 block discarded – undo
813 813
 	 *
814 814
 	 * @param mixed $field_value Field value.
815 815
 	 */
816
-	$field_value = apply_filters( "{$field['id']}_field_value", $field_value, $field, $postid );
816
+	$field_value = apply_filters("{$field['id']}_field_value", $field_value, $field, $postid);
817 817
 
818 818
 	// Set default value if no any data saved to db.
819
-	if ( ! $field_value && isset( $field['default'] ) ) {
819
+	if ( ! $field_value && isset($field['default'])) {
820 820
 		$field_value = $field['default'];
821 821
 	}
822 822
 
@@ -833,20 +833,20 @@  discard block
 block discarded – undo
833 833
  *
834 834
  * @return string
835 835
  */
836
-function give_get_field_description( $field ) {
836
+function give_get_field_description($field) {
837 837
 	$field_desc_html = '';
838 838
 	$description     = '';
839 839
 
840 840
 	// Check for both `description` and `desc`.
841
-	if ( isset( $field['description'] ) ) {
841
+	if (isset($field['description'])) {
842 842
 		$description = $field['description'];
843
-	} elseif ( isset( $field['desc'] ) ) {
843
+	} elseif (isset($field['desc'])) {
844 844
 		$description = $field['desc'];
845 845
 	}
846 846
 
847 847
 	// Set if there is a description.
848
-	if ( ! empty( $description ) ) {
849
-		$field_desc_html = '<span class="give-field-description">' . wp_kses_post( $description ) . '</span>';
848
+	if ( ! empty($description)) {
849
+		$field_desc_html = '<span class="give-field-description">'.wp_kses_post($description).'</span>';
850 850
 	}
851 851
 
852 852
 	return $field_desc_html;
@@ -866,8 +866,8 @@  discard block
 block discarded – undo
866 866
  *
867 867
  * @return string
868 868
  */
869
-function give_get_repeater_field_value( $field, $field_group, $fields ) {
870
-	$field_value = ( isset( $field_group[ $field['id'] ] ) ? $field_group[ $field['id'] ] : '' );
869
+function give_get_repeater_field_value($field, $field_group, $fields) {
870
+	$field_value = (isset($field_group[$field['id']]) ? $field_group[$field['id']] : '');
871 871
 
872 872
 	/**
873 873
 	 * Filter the specific repeater field value
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 	 *
877 877
 	 * @param string $field_id
878 878
 	 */
879
-	$field_value = apply_filters( "give_get_repeater_field_{$field['id']}_value", $field_value, $field, $field_group, $fields );
879
+	$field_value = apply_filters("give_get_repeater_field_{$field['id']}_value", $field_value, $field, $field_group, $fields);
880 880
 
881 881
 	/**
882 882
 	 * Filter the repeater field value
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 	 *
886 886
 	 * @param string $field_id
887 887
 	 */
888
-	$field_value = apply_filters( 'give_get_repeater_field_value', $field_value, $field, $field_group, $fields );
888
+	$field_value = apply_filters('give_get_repeater_field_value', $field_value, $field, $field_group, $fields);
889 889
 
890 890
 	return $field_value;
891 891
 }
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
  *
904 904
  * @return string
905 905
  */
906
-function give_get_repeater_field_id( $field, $fields, $default = false ) {
906
+function give_get_repeater_field_id($field, $fields, $default = false) {
907 907
 	$row_placeholder = false !== $default ? $default : '{{row-count-placeholder}}';
908 908
 
909 909
 	// Get field id.
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
 	 *
917 917
 	 * @param string $field_id
918 918
 	 */
919
-	$field_id = apply_filters( "give_get_repeater_field_{$field['id']}_id", $field_id, $field, $fields, $default );
919
+	$field_id = apply_filters("give_get_repeater_field_{$field['id']}_id", $field_id, $field, $fields, $default);
920 920
 
921 921
 	/**
922 922
 	 * Filter the repeater field id
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
 	 *
926 926
 	 * @param string $field_id
927 927
 	 */
928
-	$field_id = apply_filters( 'give_get_repeater_field_id', $field_id, $field, $fields, $default );
928
+	$field_id = apply_filters('give_get_repeater_field_id', $field_id, $field, $fields, $default);
929 929
 
930 930
 	return $field_id;
931 931
 }
@@ -940,8 +940,8 @@  discard block
 block discarded – undo
940 940
  *
941 941
  * @return string
942 942
  */
943
-function give_get_field_name( $field ) {
944
-	$field_name = esc_attr( empty( $field['repeat'] ) ? $field['id'] : $field['repeatable_field_id'] );
943
+function give_get_field_name($field) {
944
+	$field_name = esc_attr(empty($field['repeat']) ? $field['id'] : $field['repeatable_field_id']);
945 945
 
946 946
 	/**
947 947
 	 * Filter the field name.
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
 	 *
951 951
 	 * @param string $field_name
952 952
 	 */
953
-	$field_name = apply_filters( 'give_get_field_name', $field_name, $field );
953
+	$field_name = apply_filters('give_get_field_name', $field_name, $field);
954 954
 
955 955
 	return $field_name;
956 956
 }
@@ -967,40 +967,40 @@  discard block
 block discarded – undo
967 967
  *
968 968
  * @return void
969 969
  */
970
-function _give_metabox_form_data_repeater_fields( $fields ) {
970
+function _give_metabox_form_data_repeater_fields($fields) {
971 971
 	global $thepostid, $post;
972 972
 
973 973
 	// Bailout.
974
-	if ( ! isset( $fields['fields'] ) || empty( $fields['fields'] ) ) {
974
+	if ( ! isset($fields['fields']) || empty($fields['fields'])) {
975 975
 		return;
976 976
 	}
977 977
 
978
-	$group_numbering = isset( $fields['options']['group_numbering'] ) ? (int) $fields['options']['group_numbering'] : 0;
979
-	$close_tabs      = isset( $fields['options']['close_tabs'] ) ? (int) $fields['options']['close_tabs'] : 0;
980
-	$wrapper_class   = isset( $fields['wrapper_class'] ) ? $fields['wrapper_class'] : '';
978
+	$group_numbering = isset($fields['options']['group_numbering']) ? (int) $fields['options']['group_numbering'] : 0;
979
+	$close_tabs      = isset($fields['options']['close_tabs']) ? (int) $fields['options']['close_tabs'] : 0;
980
+	$wrapper_class   = isset($fields['wrapper_class']) ? $fields['wrapper_class'] : '';
981 981
 	?>
982
-	<div class="give-repeatable-field-section <?php echo esc_attr( $wrapper_class ); ?>" id="<?php echo "{$fields['id']}_field"; ?>"
982
+	<div class="give-repeatable-field-section <?php echo esc_attr($wrapper_class); ?>" id="<?php echo "{$fields['id']}_field"; ?>"
983 983
 		 data-group-numbering="<?php echo $group_numbering; ?>" data-close-tabs="<?php echo $close_tabs; ?>">
984
-		<?php if ( ! empty( $fields['name'] ) ) : ?>
984
+		<?php if ( ! empty($fields['name'])) : ?>
985 985
 			<p class="give-repeater-field-name"><?php echo $fields['name']; ?></p>
986 986
 		<?php endif; ?>
987 987
 
988
-		<?php if ( ! empty( $fields['description'] ) ) : ?>
988
+		<?php if ( ! empty($fields['description'])) : ?>
989 989
 			<p class="give-repeater-field-description"><?php echo $fields['description']; ?></p>
990 990
 		<?php endif; ?>
991 991
 
992 992
 		<table class="give-repeatable-fields-section-wrapper" cellspacing="0">
993 993
 			<?php
994
-			$repeater_field_values = give_get_meta( $thepostid, $fields['id'], true );
995
-			$header_title          = isset( $fields['options']['header_title'] )
994
+			$repeater_field_values = give_get_meta($thepostid, $fields['id'], true);
995
+			$header_title          = isset($fields['options']['header_title'])
996 996
 				? $fields['options']['header_title']
997
-				: esc_attr__( 'Group', 'give' );
997
+				: esc_attr__('Group', 'give');
998 998
 
999 999
 			$add_default_donation_field = false;
1000 1000
 
1001 1001
 			// Check if level is not created or we have to add default level.
1002
-			if ( is_array( $repeater_field_values ) && ( $fields_count = count( $repeater_field_values ) ) ) {
1003
-				$repeater_field_values = array_values( $repeater_field_values );
1002
+			if (is_array($repeater_field_values) && ($fields_count = count($repeater_field_values))) {
1003
+				$repeater_field_values = array_values($repeater_field_values);
1004 1004
 			} else {
1005 1005
 				$fields_count               = 1;
1006 1006
 				$add_default_donation_field = true;
@@ -1013,77 +1013,77 @@  discard block
 block discarded – undo
1013 1013
 						<div class="give-row-head give-move">
1014 1014
 							<button type="button" class="handlediv button-link"><span class="toggle-indicator"></span>
1015 1015
 							</button>
1016
-							<span class="give-remove" title="<?php esc_html_e( 'Remove Group', 'give' ); ?>">-</span>
1016
+							<span class="give-remove" title="<?php esc_html_e('Remove Group', 'give'); ?>">-</span>
1017 1017
 							<h2>
1018 1018
 								<span data-header-title="<?php echo $header_title; ?>"><?php echo $header_title; ?></span>
1019 1019
 							</h2>
1020 1020
 						</div>
1021 1021
 						<div class="give-row-body">
1022
-							<?php foreach ( $fields['fields'] as $field ) : ?>
1022
+							<?php foreach ($fields['fields'] as $field) : ?>
1023 1023
 								<?php
1024
-								if ( ! give_is_field_callback_exist( $field ) ) {
1024
+								if ( ! give_is_field_callback_exist($field)) {
1025 1025
 									continue;
1026 1026
 								}
1027 1027
 								?>
1028 1028
 								<?php
1029 1029
 								$field['repeat']              = true;
1030
-								$field['repeatable_field_id'] = give_get_repeater_field_id( $field, $fields );
1030
+								$field['repeatable_field_id'] = give_get_repeater_field_id($field, $fields);
1031 1031
 								$field['id']                  = str_replace(
1032
-									array( '[', ']' ),
1033
-									array( '_', '', ),
1032
+									array('[', ']'),
1033
+									array('_', '',),
1034 1034
 									$field['repeatable_field_id']
1035 1035
 								);
1036 1036
 								?>
1037
-								<?php give_render_field( $field ); ?>
1037
+								<?php give_render_field($field); ?>
1038 1038
 							<?php endforeach; ?>
1039 1039
 						</div>
1040 1040
 					</td>
1041 1041
 				</tr>
1042 1042
 
1043
-				<?php if ( ! empty( $repeater_field_values ) ) : ?>
1043
+				<?php if ( ! empty($repeater_field_values)) : ?>
1044 1044
 					<!--Stored repeater field group-->
1045
-					<?php foreach ( $repeater_field_values as $index => $field_group ) : ?>
1045
+					<?php foreach ($repeater_field_values as $index => $field_group) : ?>
1046 1046
 						<tr class="give-row">
1047 1047
 							<td class="give-repeater-field-wrap give-column" colspan="2">
1048 1048
 								<div class="give-row-head give-move">
1049 1049
 									<button type="button" class="handlediv button-link">
1050 1050
 										<span class="toggle-indicator"></span></button>
1051
-									<span class="give-remove" title="<?php esc_html_e( 'Remove Group', 'give' ); ?>">-
1051
+									<span class="give-remove" title="<?php esc_html_e('Remove Group', 'give'); ?>">-
1052 1052
 								</span>
1053 1053
 									<h2>
1054 1054
 										<span data-header-title="<?php echo $header_title; ?>"><?php echo $header_title; ?></span>
1055 1055
 									</h2>
1056 1056
 								</div>
1057 1057
 								<div class="give-row-body">
1058
-									<?php foreach ( $fields['fields'] as $field ) : ?>
1059
-										<?php if ( ! give_is_field_callback_exist( $field ) ) {
1058
+									<?php foreach ($fields['fields'] as $field) : ?>
1059
+										<?php if ( ! give_is_field_callback_exist($field)) {
1060 1060
 											continue;
1061 1061
 										} ?>
1062 1062
 										<?php
1063 1063
 										$field['repeat']              = true;
1064
-										$field['repeatable_field_id'] = give_get_repeater_field_id( $field, $fields, $index );
1065
-										$field['attributes']['value'] = give_get_repeater_field_value( $field, $field_group, $fields );
1064
+										$field['repeatable_field_id'] = give_get_repeater_field_id($field, $fields, $index);
1065
+										$field['attributes']['value'] = give_get_repeater_field_value($field, $field_group, $fields);
1066 1066
 										$field['id']                  = str_replace(
1067
-											array( '[', ']' ),
1068
-											array( '_', '', ),
1067
+											array('[', ']'),
1068
+											array('_', '',),
1069 1069
 											$field['repeatable_field_id']
1070 1070
 										);
1071 1071
 										?>
1072
-										<?php give_render_field( $field ); ?>
1072
+										<?php give_render_field($field); ?>
1073 1073
 									<?php endforeach; ?>
1074 1074
 								</div>
1075 1075
 							</td>
1076 1076
 						</tr>
1077
-					<?php endforeach;; ?>
1077
+					<?php endforeach; ; ?>
1078 1078
 
1079
-				<?php elseif ( $add_default_donation_field ) : ?>
1079
+				<?php elseif ($add_default_donation_field) : ?>
1080 1080
 					<!--Default repeater field group-->
1081 1081
 					<tr class="give-row">
1082 1082
 						<td class="give-repeater-field-wrap give-column" colspan="2">
1083 1083
 							<div class="give-row-head give-move">
1084 1084
 								<button type="button" class="handlediv button-link">
1085 1085
 									<span class="toggle-indicator"></span></button>
1086
-								<span class="give-remove" title="<?php esc_html_e( 'Remove Group', 'give' ); ?>">-
1086
+								<span class="give-remove" title="<?php esc_html_e('Remove Group', 'give'); ?>">-
1087 1087
 							</span>
1088 1088
 								<h2>
1089 1089
 									<span data-header-title="<?php echo $header_title; ?>"><?php echo $header_title; ?></span>
@@ -1091,25 +1091,25 @@  discard block
 block discarded – undo
1091 1091
 							</div>
1092 1092
 							<div class="give-row-body">
1093 1093
 								<?php
1094
-								foreach ( $fields['fields'] as $field ) :
1095
-									if ( ! give_is_field_callback_exist( $field ) ) {
1094
+								foreach ($fields['fields'] as $field) :
1095
+									if ( ! give_is_field_callback_exist($field)) {
1096 1096
 										continue;
1097 1097
 									}
1098 1098
 
1099 1099
 									$field['repeat']              = true;
1100
-									$field['repeatable_field_id'] = give_get_repeater_field_id( $field, $fields, 0 );
1100
+									$field['repeatable_field_id'] = give_get_repeater_field_id($field, $fields, 0);
1101 1101
 									$field['attributes']['value'] = apply_filters(
1102 1102
 										"give_default_field_group_field_{$field['id']}_value",
1103
-										( ! empty( $field['default'] ) ? $field['default'] : '' ),
1103
+										( ! empty($field['default']) ? $field['default'] : ''),
1104 1104
 										$field,
1105 1105
 										$fields
1106 1106
 									);
1107
-									$field['id']                  = str_replace(
1108
-										array( '[', ']' ),
1109
-										array( '_', '', ),
1107
+									$field['id'] = str_replace(
1108
+										array('[', ']'),
1109
+										array('_', '',),
1110 1110
 										$field['repeatable_field_id']
1111 1111
 									);
1112
-									give_render_field( $field );
1112
+									give_render_field($field);
1113 1113
 
1114 1114
 								endforeach;
1115 1115
 								?>
@@ -1121,9 +1121,9 @@  discard block
 block discarded – undo
1121 1121
 			<tfoot>
1122 1122
 				<tr>
1123 1123
 					<?php
1124
-					$add_row_btn_title = isset( $fields['options']['add_button'] )
1124
+					$add_row_btn_title = isset($fields['options']['add_button'])
1125 1125
 						? $add_row_btn_title = $fields['options']['add_button']
1126
-						: esc_html__( 'Add Row', 'give' );
1126
+						: esc_html__('Add Row', 'give');
1127 1127
 					?>
1128 1128
 					<td colspan="2" class="give-add-repeater-field-section-row-wrap">
1129 1129
 						<span class="button button-primary give-add-repeater-field-section-row"><?php echo $add_row_btn_title; ?></span>
@@ -1153,10 +1153,10 @@  discard block
 block discarded – undo
1153 1153
 	 *
1154 1154
 	 * @param string
1155 1155
 	 */
1156
-	$default_current_tab = apply_filters( "give_default_setting_tab_{$current_setting_page}", 'general' );
1156
+	$default_current_tab = apply_filters("give_default_setting_tab_{$current_setting_page}", 'general');
1157 1157
 
1158 1158
 	// Get current tab.
1159
-	$current_tab = empty( $_GET['tab'] ) ? $default_current_tab : urldecode( $_GET['tab'] );
1159
+	$current_tab = empty($_GET['tab']) ? $default_current_tab : urldecode($_GET['tab']);
1160 1160
 
1161 1161
 	// Output.
1162 1162
 	return $current_tab;
@@ -1180,10 +1180,10 @@  discard block
 block discarded – undo
1180 1180
 	 *
1181 1181
 	 * @param string
1182 1182
 	 */
1183
-	$default_current_section = apply_filters( "give_default_setting_tab_section_{$current_tab}", '' );
1183
+	$default_current_section = apply_filters("give_default_setting_tab_section_{$current_tab}", '');
1184 1184
 
1185 1185
 	// Get current section.
1186
-	$current_section = empty( $_REQUEST['section'] ) ? $default_current_section : urldecode( $_REQUEST['section'] );
1186
+	$current_section = empty($_REQUEST['section']) ? $default_current_section : urldecode($_REQUEST['section']);
1187 1187
 
1188 1188
 	// Output.
1189 1189
 	return $current_section;
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
  */
1198 1198
 function give_get_current_setting_page() {
1199 1199
 	// Get current page.
1200
-	$setting_page = ! empty( $_GET['page'] ) ? urldecode( $_GET['page'] ) : '';
1200
+	$setting_page = ! empty($_GET['page']) ? urldecode($_GET['page']) : '';
1201 1201
 
1202 1202
 	// Output.
1203 1203
 	return $setting_page;
@@ -1217,13 +1217,13 @@  discard block
 block discarded – undo
1217 1217
  *
1218 1218
  * @return string
1219 1219
  */
1220
-function _give_display_content_field_value( $field_value, $field, $postid ) {
1221
-	$show_content = give_get_meta( $postid, '_give_content_option', true );
1220
+function _give_display_content_field_value($field_value, $field, $postid) {
1221
+	$show_content = give_get_meta($postid, '_give_content_option', true);
1222 1222
 
1223 1223
 	if (
1224
-		! give_get_meta( $postid, '_give_display_content', true )
1224
+		! give_get_meta($postid, '_give_display_content', true)
1225 1225
 		&& $show_content
1226
-		&& ( 'none' !== $show_content )
1226
+		&& ('none' !== $show_content)
1227 1227
 	) {
1228 1228
 		$field_value = 'enabled';
1229 1229
 	}
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
 	return $field_value;
1232 1232
 }
1233 1233
 
1234
-add_filter( '_give_display_content_field_value', '_give_display_content_field_value', 10, 3 );
1234
+add_filter('_give_display_content_field_value', '_give_display_content_field_value', 10, 3);
1235 1235
 
1236 1236
 
1237 1237
 /**
@@ -1248,12 +1248,12 @@  discard block
 block discarded – undo
1248 1248
  *
1249 1249
  * @return string
1250 1250
  */
1251
-function _give_content_placement_field_value( $field_value, $field, $postid ) {
1252
-	$show_content = give_get_meta( $postid, '_give_content_option', true );
1251
+function _give_content_placement_field_value($field_value, $field, $postid) {
1252
+	$show_content = give_get_meta($postid, '_give_content_option', true);
1253 1253
 
1254 1254
 	if (
1255
-		! give_get_meta( $postid, '_give_content_placement', true )
1256
-		&& ( 'none' !== $show_content )
1255
+		! give_get_meta($postid, '_give_content_placement', true)
1256
+		&& ('none' !== $show_content)
1257 1257
 	) {
1258 1258
 		$field_value = $show_content;
1259 1259
 	}
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 	return $field_value;
1262 1262
 }
1263 1263
 
1264
-add_filter( '_give_content_placement_field_value', '_give_content_placement_field_value', 10, 3 );
1264
+add_filter('_give_content_placement_field_value', '_give_content_placement_field_value', 10, 3);
1265 1265
 
1266 1266
 
1267 1267
 /**
@@ -1277,17 +1277,17 @@  discard block
 block discarded – undo
1277 1277
  *
1278 1278
  * @return string
1279 1279
  */
1280
-function _give_terms_option_field_value( $field_value, $field, $postid ) {
1281
-	$term_option = give_get_meta( $postid, '_give_terms_option', true );
1280
+function _give_terms_option_field_value($field_value, $field, $postid) {
1281
+	$term_option = give_get_meta($postid, '_give_terms_option', true);
1282 1282
 
1283
-	if ( in_array( $term_option, array( 'none', 'yes' ) ) ) {
1284
-		$field_value = ( 'yes' === $term_option ? 'enabled' : 'disabled' );
1283
+	if (in_array($term_option, array('none', 'yes'))) {
1284
+		$field_value = ('yes' === $term_option ? 'enabled' : 'disabled');
1285 1285
 	}
1286 1286
 
1287 1287
 	return $field_value;
1288 1288
 }
1289 1289
 
1290
-add_filter( '_give_terms_option_field_value', '_give_terms_option_field_value', 10, 3 );
1290
+add_filter('_give_terms_option_field_value', '_give_terms_option_field_value', 10, 3);
1291 1291
 
1292 1292
 
1293 1293
 /**
@@ -1304,17 +1304,17 @@  discard block
 block discarded – undo
1304 1304
  *
1305 1305
  * @return string
1306 1306
  */
1307
-function _give_offline_donation_enable_billing_fields_single_field_value( $field_value, $field, $postid ) {
1308
-	$offline_donation = give_get_meta( $postid, '_give_offline_donation_enable_billing_fields_single', true );
1307
+function _give_offline_donation_enable_billing_fields_single_field_value($field_value, $field, $postid) {
1308
+	$offline_donation = give_get_meta($postid, '_give_offline_donation_enable_billing_fields_single', true);
1309 1309
 
1310
-	if ( 'on' === $offline_donation ) {
1310
+	if ('on' === $offline_donation) {
1311 1311
 		$field_value = 'enabled';
1312 1312
 	}
1313 1313
 
1314 1314
 	return $field_value;
1315 1315
 }
1316 1316
 
1317
-add_filter( '_give_offline_donation_enable_billing_fields_single_field_value', '_give_offline_donation_enable_billing_fields_single_field_value', 10, 3 );
1317
+add_filter('_give_offline_donation_enable_billing_fields_single_field_value', '_give_offline_donation_enable_billing_fields_single_field_value', 10, 3);
1318 1318
 
1319 1319
 
1320 1320
 /**
@@ -1330,17 +1330,17 @@  discard block
 block discarded – undo
1330 1330
  *
1331 1331
  * @return string
1332 1332
  */
1333
-function _give_custom_amount_field_value( $field_value, $field, $postid ) {
1334
-	$custom_amount = give_get_meta( $postid, '_give_custom_amount', true );
1333
+function _give_custom_amount_field_value($field_value, $field, $postid) {
1334
+	$custom_amount = give_get_meta($postid, '_give_custom_amount', true);
1335 1335
 
1336
-	if ( in_array( $custom_amount, array( 'yes', 'no' ) ) ) {
1337
-		$field_value = ( 'yes' === $custom_amount ? 'enabled' : 'disabled' );
1336
+	if (in_array($custom_amount, array('yes', 'no'))) {
1337
+		$field_value = ('yes' === $custom_amount ? 'enabled' : 'disabled');
1338 1338
 	}
1339 1339
 
1340 1340
 	return $field_value;
1341 1341
 }
1342 1342
 
1343
-add_filter( '_give_custom_amount_field_value', '_give_custom_amount_field_value', 10, 3 );
1343
+add_filter('_give_custom_amount_field_value', '_give_custom_amount_field_value', 10, 3);
1344 1344
 
1345 1345
 
1346 1346
 /**
@@ -1356,17 +1356,17 @@  discard block
 block discarded – undo
1356 1356
  *
1357 1357
  * @return string
1358 1358
  */
1359
-function _give_goal_option_field_value( $field_value, $field, $postid ) {
1360
-	$goal_option = give_get_meta( $postid, '_give_goal_option', true );
1359
+function _give_goal_option_field_value($field_value, $field, $postid) {
1360
+	$goal_option = give_get_meta($postid, '_give_goal_option', true);
1361 1361
 
1362
-	if ( in_array( $goal_option, array( 'yes', 'no' ) ) ) {
1363
-		$field_value = ( 'yes' === $goal_option ? 'enabled' : 'disabled' );
1362
+	if (in_array($goal_option, array('yes', 'no'))) {
1363
+		$field_value = ('yes' === $goal_option ? 'enabled' : 'disabled');
1364 1364
 	}
1365 1365
 
1366 1366
 	return $field_value;
1367 1367
 }
1368 1368
 
1369
-add_filter( '_give_goal_option_field_value', '_give_goal_option_field_value', 10, 3 );
1369
+add_filter('_give_goal_option_field_value', '_give_goal_option_field_value', 10, 3);
1370 1370
 
1371 1371
 /**
1372 1372
  * Set value for Donation Goal --> close Form.
@@ -1382,17 +1382,17 @@  discard block
 block discarded – undo
1382 1382
  *
1383 1383
  * @return string
1384 1384
  */
1385
-function _give_close_form_when_goal_achieved_value( $field_value, $field, $postid ) {
1386
-	$close_form = give_get_meta( $postid, '_give_close_form_when_goal_achieved', true );
1385
+function _give_close_form_when_goal_achieved_value($field_value, $field, $postid) {
1386
+	$close_form = give_get_meta($postid, '_give_close_form_when_goal_achieved', true);
1387 1387
 
1388
-	if ( in_array( $close_form, array( 'yes', 'no' ) ) ) {
1389
-		$field_value = ( 'yes' === $close_form ? 'enabled' : 'disabled' );
1388
+	if (in_array($close_form, array('yes', 'no'))) {
1389
+		$field_value = ('yes' === $close_form ? 'enabled' : 'disabled');
1390 1390
 	}
1391 1391
 
1392 1392
 	return $field_value;
1393 1393
 }
1394 1394
 
1395
-add_filter( '_give_close_form_when_goal_achieved_field_value', '_give_close_form_when_goal_achieved_value', 10, 3 );
1395
+add_filter('_give_close_form_when_goal_achieved_field_value', '_give_close_form_when_goal_achieved_value', 10, 3);
1396 1396
 
1397 1397
 
1398 1398
 /**
@@ -1408,17 +1408,17 @@  discard block
 block discarded – undo
1408 1408
  *
1409 1409
  * @return string
1410 1410
  */
1411
-function _give_logged_in_only_value( $field_value, $field, $postid ) {
1412
-	$guest_donation = give_get_meta( $postid, '_give_logged_in_only', true );
1411
+function _give_logged_in_only_value($field_value, $field, $postid) {
1412
+	$guest_donation = give_get_meta($postid, '_give_logged_in_only', true);
1413 1413
 
1414
-	if ( in_array( $guest_donation, array( 'yes', 'no' ) ) ) {
1415
-		$field_value = ( 'yes' === $guest_donation ? 'enabled' : 'disabled' );
1414
+	if (in_array($guest_donation, array('yes', 'no'))) {
1415
+		$field_value = ('yes' === $guest_donation ? 'enabled' : 'disabled');
1416 1416
 	}
1417 1417
 
1418 1418
 	return $field_value;
1419 1419
 }
1420 1420
 
1421
-add_filter( '_give_logged_in_only_field_value', '_give_logged_in_only_value', 10, 3 );
1421
+add_filter('_give_logged_in_only_field_value', '_give_logged_in_only_value', 10, 3);
1422 1422
 
1423 1423
 /**
1424 1424
  * Set value for Offline Donations --> Offline Donations.
@@ -1434,17 +1434,17 @@  discard block
 block discarded – undo
1434 1434
  *
1435 1435
  * @return string
1436 1436
  */
1437
-function _give_customize_offline_donations_value( $field_value, $field, $postid ) {
1438
-	$customize_offline_text = give_get_meta( $postid, '_give_customize_offline_donations', true );
1437
+function _give_customize_offline_donations_value($field_value, $field, $postid) {
1438
+	$customize_offline_text = give_get_meta($postid, '_give_customize_offline_donations', true);
1439 1439
 
1440
-	if ( in_array( $customize_offline_text, array( 'yes', 'no' ) ) ) {
1441
-		$field_value = ( 'yes' === $customize_offline_text ? 'enabled' : 'disabled' );
1440
+	if (in_array($customize_offline_text, array('yes', 'no'))) {
1441
+		$field_value = ('yes' === $customize_offline_text ? 'enabled' : 'disabled');
1442 1442
 	}
1443 1443
 
1444 1444
 	return $field_value;
1445 1445
 }
1446 1446
 
1447
-add_filter( '_give_customize_offline_donations_field_value', '_give_customize_offline_donations_value', 10, 3 );
1447
+add_filter('_give_customize_offline_donations_field_value', '_give_customize_offline_donations_value', 10, 3);
1448 1448
 
1449 1449
 
1450 1450
 /**
@@ -1459,14 +1459,14 @@  discard block
 block discarded – undo
1459 1459
  *
1460 1460
  * @return mixed
1461 1461
  */
1462
-function _give_set_multi_level_repeater_field_id( $field_id, $field, $fields, $default ) {
1462
+function _give_set_multi_level_repeater_field_id($field_id, $field, $fields, $default) {
1463 1463
 	$row_placeholder = false !== $default ? $default : '{{row-count-placeholder}}';
1464 1464
 	$field_id        = "{$fields['id']}[{$row_placeholder}][{$field['id']}][level_id]";
1465 1465
 
1466 1466
 	return $field_id;
1467 1467
 }
1468 1468
 
1469
-add_filter( 'give_get_repeater_field__give_id_id', '_give_set_multi_level_repeater_field_id', 10, 4 );
1469
+add_filter('give_get_repeater_field__give_id_id', '_give_set_multi_level_repeater_field_id', 10, 4);
1470 1470
 
1471 1471
 /**
1472 1472
  * Set repeater field value for multi donation form.
@@ -1480,13 +1480,13 @@  discard block
 block discarded – undo
1480 1480
  *
1481 1481
  * @return mixed
1482 1482
  */
1483
-function _give_set_multi_level_repeater_field_value( $field_value, $field, $field_group, $fields ) {
1484
-	$field_value = $field_group[ $field['id'] ]['level_id'];
1483
+function _give_set_multi_level_repeater_field_value($field_value, $field, $field_group, $fields) {
1484
+	$field_value = $field_group[$field['id']]['level_id'];
1485 1485
 
1486 1486
 	return $field_value;
1487 1487
 }
1488 1488
 
1489
-add_filter( 'give_get_repeater_field__give_id_value', '_give_set_multi_level_repeater_field_value', 10, 4 );
1489
+add_filter('give_get_repeater_field__give_id_value', '_give_set_multi_level_repeater_field_value', 10, 4);
1490 1490
 
1491 1491
 /**
1492 1492
  * Set default value for _give_id field.
@@ -1497,11 +1497,11 @@  discard block
 block discarded – undo
1497 1497
  *
1498 1498
  * @return string
1499 1499
  */
1500
-function _give_set_field_give_id_default_value( $field ) {
1500
+function _give_set_field_give_id_default_value($field) {
1501 1501
 	return 0;
1502 1502
 }
1503 1503
 
1504
-add_filter( 'give_default_field_group_field__give_id_value', '_give_set_field_give_id_default_value' );
1504
+add_filter('give_default_field_group_field__give_id_value', '_give_set_field_give_id_default_value');
1505 1505
 
1506 1506
 /**
1507 1507
  * Set default value for _give_default field.
@@ -1512,11 +1512,11 @@  discard block
 block discarded – undo
1512 1512
  *
1513 1513
  * @return string
1514 1514
  */
1515
-function _give_set_field_give_default_default_value( $field ) {
1515
+function _give_set_field_give_default_default_value($field) {
1516 1516
 	return 'default';
1517 1517
 }
1518 1518
 
1519
-add_filter( 'give_default_field_group_field__give_default_value', '_give_set_field_give_default_default_value' );
1519
+add_filter('give_default_field_group_field__give_default_value', '_give_set_field_give_default_default_value');
1520 1520
 
1521 1521
 /**
1522 1522
  * Set repeater field editor id for field type wysiwyg.
@@ -1528,12 +1528,12 @@  discard block
 block discarded – undo
1528 1528
  *
1529 1529
  * @return string
1530 1530
  */
1531
-function give_repeater_field_set_editor_id( $field_name, $field ) {
1532
-	if ( isset( $field['repeatable_field_id'] ) && 'wysiwyg' == $field['type'] ) {
1533
-		$field_name = '_give_repeater_' . uniqid() . '_wysiwyg';
1531
+function give_repeater_field_set_editor_id($field_name, $field) {
1532
+	if (isset($field['repeatable_field_id']) && 'wysiwyg' == $field['type']) {
1533
+		$field_name = '_give_repeater_'.uniqid().'_wysiwyg';
1534 1534
 	}
1535 1535
 
1536 1536
 	return $field_name;
1537 1537
 }
1538 1538
 
1539
-add_filter( 'give_get_field_name', 'give_repeater_field_set_editor_id', 10, 2 );
1539
+add_filter('give_get_field_name', 'give_repeater_field_set_editor_id', 10, 2);
Please login to merge, or discard this patch.
includes/admin/shortcodes/class-shortcode-button.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
 	/**
114 114
 	 * Adds the "Donation Form" button above the TinyMCE Editor on add/edit screens.
115 115
 	 *
116
-	 * @return string|bool
116
+	 * @return false|null
117 117
 	 *
118 118
 	 * @since 1.0
119 119
 	 */
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -138,8 +138,8 @@
 block discarded – undo
138 138
 
139 139
 		// Only run in admin post/page creation and edit screens
140 140
 		if ( in_array( $screen->parent_file, $shortcode_button_pages )
141
-		     && apply_filters( 'give_shortcode_button_condition', true )
142
-		     && ! empty( self::$shortcodes )
141
+			 && apply_filters( 'give_shortcode_button_condition', true )
142
+			 && ! empty( self::$shortcodes )
143 143
 		) {
144 144
 
145 145
 			$shortcodes = array();
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
 	 */
34 34
 	public function __construct() {
35 35
 
36
-		if ( is_admin() ) {
37
-			add_filter( 'mce_external_plugins', array( $this, 'mce_external_plugins' ), 15 );
36
+		if (is_admin()) {
37
+			add_filter('mce_external_plugins', array($this, 'mce_external_plugins'), 15);
38 38
 
39
-			add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ) );
40
-			add_action( 'admin_enqueue_scripts', array( $this, 'admin_localize_scripts' ), 13 );
41
-			add_action( 'media_buttons', array( $this, 'shortcode_button' ) );
39
+			add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_assets'));
40
+			add_action('admin_enqueue_scripts', array($this, 'admin_localize_scripts'), 13);
41
+			add_action('media_buttons', array($this, 'shortcode_button'));
42 42
 		}
43 43
 
44
-		add_action( "wp_ajax_give_shortcode", array( $this, 'shortcode_ajax' ) );
45
-		add_action( "wp_ajax_nopriv_give_shortcode", array( $this, 'shortcode_ajax' ) );
44
+		add_action("wp_ajax_give_shortcode", array($this, 'shortcode_ajax'));
45
+		add_action("wp_ajax_nopriv_give_shortcode", array($this, 'shortcode_ajax'));
46 46
 	}
47 47
 
48 48
 	/**
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
 	 *
55 55
 	 * @since 1.0
56 56
 	 */
57
-	public function mce_external_plugins( $plugin_array ) {
57
+	public function mce_external_plugins($plugin_array) {
58 58
 
59
-		if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {
59
+		if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages')) {
60 60
 			return false;
61 61
 		}
62 62
 
63
-		$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
63
+		$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
64 64
 
65
-		$plugin_array['give_shortcode'] = GIVE_PLUGIN_URL . 'assets/js/admin/tinymce/mce-plugin' . $suffix . '.js';
65
+		$plugin_array['give_shortcode'] = GIVE_PLUGIN_URL.'assets/js/admin/tinymce/mce-plugin'.$suffix.'.js';
66 66
 
67 67
 		return $plugin_array;
68 68
 	}
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	public function admin_enqueue_assets() {
78 78
 
79
-		$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
79
+		$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
80 80
 
81 81
 		wp_enqueue_script(
82 82
 			'give_shortcode',
83
-			GIVE_PLUGIN_URL . 'assets/js/admin/admin-shortcodes' . $suffix . '.js',
84
-			array( 'jquery' ),
83
+			GIVE_PLUGIN_URL.'assets/js/admin/admin-shortcodes'.$suffix.'.js',
84
+			array('jquery'),
85 85
 			GIVE_VERSION,
86 86
 			true
87 87
 		);
@@ -96,17 +96,17 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function admin_localize_scripts() {
98 98
 
99
-		if ( ! empty( self::$shortcodes ) ) {
99
+		if ( ! empty(self::$shortcodes)) {
100 100
 
101 101
 			$variables = array();
102 102
 
103
-			foreach ( self::$shortcodes as $shortcode => $values ) {
104
-				if ( ! empty( $values['required'] ) ) {
105
-					$variables[ $shortcode ] = $values['required'];
103
+			foreach (self::$shortcodes as $shortcode => $values) {
104
+				if ( ! empty($values['required'])) {
105
+					$variables[$shortcode] = $values['required'];
106 106
 				}
107 107
 			}
108 108
 
109
-			wp_localize_script( 'give_shortcode', 'scShortcodes', $variables );
109
+			wp_localize_script('give_shortcode', 'scShortcodes', $variables);
110 110
 		}
111 111
 	}
112 112
 
@@ -123,37 +123,37 @@  discard block
 block discarded – undo
123 123
 
124 124
 		// If we load wp editor by ajax then $screen will be empty which generate notice if we treat $screen as WP_Screen object.
125 125
 		// For example we are loading wp editor by ajax in repeater field.
126
-		if ( ! ( $screen instanceof WP_Screen ) ) {
126
+		if ( ! ($screen instanceof WP_Screen)) {
127 127
 			return false;
128 128
 		}
129 129
 
130
-		$shortcode_button_pages = apply_filters( 'give_shortcode_button_pages', array(
130
+		$shortcode_button_pages = apply_filters('give_shortcode_button_pages', array(
131 131
 			'post.php',
132 132
 			'page.php',
133 133
 			'post-new.php',
134 134
 			'post-edit.php',
135 135
 			'edit.php',
136 136
 			'edit.php?post_type=page',
137
-		) );
137
+		));
138 138
 
139 139
 		// Only run in admin post/page creation and edit screens
140
-		if ( in_array( $screen->parent_file, $shortcode_button_pages )
141
-		     && apply_filters( 'give_shortcode_button_condition', true )
142
-		     && ! empty( self::$shortcodes )
140
+		if (in_array($screen->parent_file, $shortcode_button_pages)
141
+		     && apply_filters('give_shortcode_button_condition', true)
142
+		     && ! empty(self::$shortcodes)
143 143
 		) {
144 144
 
145 145
 			$shortcodes = array();
146 146
 
147
-			foreach ( self::$shortcodes as $shortcode => $values ) {
147
+			foreach (self::$shortcodes as $shortcode => $values) {
148 148
 
149 149
 				/**
150 150
 				 * Filters the condition for including the current shortcode
151 151
 				 *
152 152
 				 * @since 1.0
153 153
 				 */
154
-				if ( apply_filters( sanitize_title( $shortcode ) . '_condition', true ) ) {
154
+				if (apply_filters(sanitize_title($shortcode).'_condition', true)) {
155 155
 
156
-					$shortcodes[ $shortcode ] = sprintf(
156
+					$shortcodes[$shortcode] = sprintf(
157 157
 						'<div class="sc-shortcode mce-menu-item give-shortcode-item-%1$s" data-shortcode="%2$s">%3$s</div>',
158 158
 						$shortcode,
159 159
 						$shortcode,
@@ -162,37 +162,37 @@  discard block
 block discarded – undo
162 162
 				}
163 163
 			}
164 164
 
165
-			if ( ! empty( $shortcodes ) ) {
165
+			if ( ! empty($shortcodes)) {
166 166
 
167 167
 				// check current WP version
168
-				$img = ( version_compare( get_bloginfo( 'version' ), '3.5', '<' ) )
169
-					? '<img src="' . GIVE_PLUGIN_URL . 'assets/images/give-media.png" />'
170
-					: '<span class="wp-media-buttons-icon" id="give-media-button" style="background-image: url(' . give_svg_icons( 'give_grey' ) . ');"></span>';
168
+				$img = (version_compare(get_bloginfo('version'), '3.5', '<'))
169
+					? '<img src="'.GIVE_PLUGIN_URL.'assets/images/give-media.png" />'
170
+					: '<span class="wp-media-buttons-icon" id="give-media-button" style="background-image: url('.give_svg_icons('give_grey').');"></span>';
171 171
 
172
-				reset( $shortcodes );
172
+				reset($shortcodes);
173 173
 
174
-				if ( 1 === count( $shortcodes ) ) {
174
+				if (1 === count($shortcodes)) {
175 175
 
176
-					$shortcode = key( $shortcodes );
176
+					$shortcode = key($shortcodes);
177 177
 
178 178
 					printf(
179 179
 						'<button type="button" class="button sc-shortcode" data-shortcode="%s">%s</button>',
180 180
 						$shortcode,
181
-						sprintf( '%s %s %s',
181
+						sprintf('%s %s %s',
182 182
 							$img,
183
-							__( 'Insert', 'give' ),
184
-							self::$shortcodes[ $shortcode ]['label']
183
+							__('Insert', 'give'),
184
+							self::$shortcodes[$shortcode]['label']
185 185
 						)
186 186
 					);
187 187
 				} else {
188 188
 					printf(
189
-						'<div class="sc-wrap">' .
190
-						'<button class="button sc-button" type="button">%s %s</button>' .
191
-						'<div class="sc-menu mce-menu">%s</div>' .
189
+						'<div class="sc-wrap">'.
190
+						'<button class="button sc-button" type="button">%s %s</button>'.
191
+						'<div class="sc-menu mce-menu">%s</div>'.
192 192
 						'</div>',
193 193
 						$img,
194
-						__( 'Give Shortcodes', 'give' ),
195
-						implode( '', array_values( $shortcodes ) )
194
+						__('Give Shortcodes', 'give'),
195
+						implode('', array_values($shortcodes))
196 196
 					);
197 197
 				}
198 198
 			}
@@ -208,15 +208,15 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public function shortcode_ajax() {
210 210
 
211
-		$shortcode = isset( $_POST['shortcode'] ) ? $_POST['shortcode'] : false;
211
+		$shortcode = isset($_POST['shortcode']) ? $_POST['shortcode'] : false;
212 212
 		$response  = false;
213 213
 
214
-		if ( $shortcode && array_key_exists( $shortcode, self::$shortcodes ) ) {
214
+		if ($shortcode && array_key_exists($shortcode, self::$shortcodes)) {
215 215
 
216
-			$data = self::$shortcodes[ $shortcode ];
216
+			$data = self::$shortcodes[$shortcode];
217 217
 
218
-			if ( ! empty( $data['errors'] ) ) {
219
-				$data['btn_okay'] = array( esc_html__( 'Okay', 'give' ) );
218
+			if ( ! empty($data['errors'])) {
219
+				$data['btn_okay'] = array(esc_html__('Okay', 'give'));
220 220
 			}
221 221
 
222 222
 			$response = array(
@@ -228,10 +228,10 @@  discard block
 block discarded – undo
228 228
 			);
229 229
 		} else {
230 230
 			// todo: handle error
231
-			error_log( print_r( 'AJAX error!', 1 ) );
231
+			error_log(print_r('AJAX error!', 1));
232 232
 		}
233 233
 
234
-		wp_send_json( $response );
234
+		wp_send_json($response);
235 235
 	}
236 236
 }
237 237
 
Please login to merge, or discard this patch.
includes/admin/tools/views/html-admin-page-system-info.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -586,9 +586,9 @@
 block discarded – undo
586 586
 					}
587 587
 
588 588
 					echo ' &ndash; '
589
-					     . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) )
590
-					     . ' &ndash; '
591
-					     . esc_html( $plugin_data['Version'] );
589
+						 . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) )
590
+						 . ' &ndash; '
591
+						 . esc_html( $plugin_data['Version'] );
592 592
 					?>
593 593
 				</td>
594 594
 			</tr>
Please login to merge, or discard this patch.
Braces   +16 added lines, -5 removed lines patch added patch discarded remove patch
@@ -60,7 +60,12 @@  discard block
 block discarded – undo
60 60
 		<tr>
61 61
 			<td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'give' ); ?>:</td>
62 62
 			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether or not you have WordPress Multisite enabled.', 'give' ) ); ?></td>
63
-			<td><?php if ( is_multisite() ) echo '<span class="dashicons dashicons-yes"></span>'; else echo '&ndash;'; ?></td>
63
+			<td><?php if ( is_multisite() ) {
64
+	echo '<span class="dashicons dashicons-yes"></span>';
65
+} else {
66
+	echo '&ndash;';
67
+}
68
+?></td>
64 69
 
65 70
 		</tr>
66 71
 		<tr>
@@ -89,9 +94,12 @@  discard block
 block discarded – undo
89 94
 			<td>
90 95
 				<?php if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) : ?>
91 96
 					<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
92
-				<?php else : ?>
97
+				<?php else {
98
+	: ?>
93 99
 					<mark class="no">&ndash;</mark>
94
-				<?php endif; ?>
100
+				<?php endif;
101
+}
102
+?>
95 103
 			</td>
96 104
 		</tr>
97 105
 		<tr>
@@ -100,9 +108,12 @@  discard block
 block discarded – undo
100 108
 			<td>
101 109
 				<?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?>
102 110
 					<mark class="no">&ndash;</mark>
103
-				<?php else : ?>
111
+				<?php else {
112
+	: ?>
104 113
 					<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
105
-				<?php endif; ?>
114
+				<?php endif;
115
+}
116
+?>
106 117
 			</td>
107 118
 		</tr>
108 119
 		<tr>
Please login to merge, or discard this patch.
Spacing   +349 added lines, -350 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * Admin View: System Info
4 4
  */
5 5
 
6
-if ( ! defined( 'ABSPATH' ) ) {
6
+if ( ! defined('ABSPATH')) {
7 7
 	exit;
8 8
 }
9 9
 
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 ?>
26 26
 
27 27
 <div class="give-debug-report-wrapper">
28
-	<p class="give-debug-report-text"><?php echo sprintf(__( 'Please copy and paste this information in your ticket when contacting support:', 'give' )); ?> </p>
28
+	<p class="give-debug-report-text"><?php echo sprintf(__('Please copy and paste this information in your ticket when contacting support:', 'give')); ?> </p>
29 29
 	<div class="give-debug-report-actions">
30
-		<a class="button-primary js-give-debug-report-button" href="#"><?php _e( 'Get System Report', 'give' ); ?></a>
31
-		<a class="button-secondary docs" href="http://docs.givewp.com/settings-system-info" target="_blank"><?php _e( 'Understanding the System Report', 'give' ); ?> <span class="dashicons dashicons-external"></span></a>
30
+		<a class="button-primary js-give-debug-report-button" href="#"><?php _e('Get System Report', 'give'); ?></a>
31
+		<a class="button-secondary docs" href="http://docs.givewp.com/settings-system-info" target="_blank"><?php _e('Understanding the System Report', 'give'); ?> <span class="dashicons dashicons-external"></span></a>
32 32
 	</div>
33 33
 	<div class="give-debug-report js-give-debug-report">
34 34
 		<textarea readonly="readonly"></textarea>
@@ -38,56 +38,56 @@  discard block
 block discarded – undo
38 38
 <table class="give-status-table widefat" cellspacing="0" id="status">
39 39
 	<thead>
40 40
 		<tr>
41
-			<th colspan="3" data-export-label="WordPress Environment"><h2><?php _e( 'WordPress Environment', 'give' ); ?></h2></th>
41
+			<th colspan="3" data-export-label="WordPress Environment"><h2><?php _e('WordPress Environment', 'give'); ?></h2></th>
42 42
 		</tr>
43 43
 	</thead>
44 44
 	<tbody>
45 45
 		<tr>
46
-			<td data-export-label="Home URL"><?php _e( 'Home URL', 'give' ); ?>:</td>
47
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The URL of your site\'s homepage.', 'give' ) ); ?></td>
48
-			<td><?php form_option( 'home' ); ?></td>
46
+			<td data-export-label="Home URL"><?php _e('Home URL', 'give'); ?>:</td>
47
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The URL of your site\'s homepage.', 'give')); ?></td>
48
+			<td><?php form_option('home'); ?></td>
49 49
 		</tr>
50 50
 		<tr>
51
-			<td data-export-label="Site URL"><?php _e( 'Site URL', 'give' ); ?>:</td>
52
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The root URL of your site.', 'give' ) ); ?></td>
53
-			<td><?php form_option( 'siteurl' ); ?></td>
51
+			<td data-export-label="Site URL"><?php _e('Site URL', 'give'); ?>:</td>
52
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The root URL of your site.', 'give')); ?></td>
53
+			<td><?php form_option('siteurl'); ?></td>
54 54
 		</tr>
55 55
 		<tr>
56
-			<td data-export-label="WP Version"><?php _e( 'WP Version', 'give' ); ?>:</td>
57
-			<td class="help"><?php echo Give()->tooltips->render_help(  __( 'The version of WordPress installed on your site.', 'give' ) ); ?></td>
58
-			<td><?php bloginfo( 'version' ); ?></td>
56
+			<td data-export-label="WP Version"><?php _e('WP Version', 'give'); ?>:</td>
57
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The version of WordPress installed on your site.', 'give')); ?></td>
58
+			<td><?php bloginfo('version'); ?></td>
59 59
 		</tr>
60 60
 		<tr>
61
-			<td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'give' ); ?>:</td>
62
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether or not you have WordPress Multisite enabled.', 'give' ) ); ?></td>
63
-			<td><?php if ( is_multisite() ) echo '<span class="dashicons dashicons-yes"></span>'; else echo '&ndash;'; ?></td>
61
+			<td data-export-label="WP Multisite"><?php _e('WP Multisite', 'give'); ?>:</td>
62
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether or not you have WordPress Multisite enabled.', 'give')); ?></td>
63
+			<td><?php if (is_multisite()) echo '<span class="dashicons dashicons-yes"></span>'; else echo '&ndash;'; ?></td>
64 64
 
65 65
 		</tr>
66 66
 		<tr>
67
-			<td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit', 'give' ); ?>:</td>
68
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The maximum amount of memory (RAM) that your site can use at one time.', 'give' ) ); ?></td>
67
+			<td data-export-label="WP Memory Limit"><?php _e('WP Memory Limit', 'give'); ?>:</td>
68
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The maximum amount of memory (RAM) that your site can use at one time.', 'give')); ?></td>
69 69
 			<td>
70 70
 				<?php
71
-				$memory = give_let_to_num( WP_MEMORY_LIMIT );
71
+				$memory = give_let_to_num(WP_MEMORY_LIMIT);
72 72
 
73
-				if ( function_exists( 'memory_get_usage' ) ) {
74
-					$system_memory = give_let_to_num( @ini_get( 'memory_limit' ) );
75
-					$memory        = max( $memory, $system_memory );
73
+				if (function_exists('memory_get_usage')) {
74
+					$system_memory = give_let_to_num(@ini_get('memory_limit'));
75
+					$memory        = max($memory, $system_memory);
76 76
 				}
77 77
 
78
-				if ( $memory < 67108864 ) {
79
-					echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend setting memory to at least 64 MB. See: %s', 'give' ), size_format( $memory ), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">' . __( 'Increasing memory allocated to PHP', 'give' ) . '</a>' ) . '</mark>';
78
+				if ($memory < 67108864) {
79
+					echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend setting memory to at least 64 MB. See: %s', 'give'), size_format($memory), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">'.__('Increasing memory allocated to PHP', 'give').'</a>').'</mark>';
80 80
 				} else {
81
-					echo '<mark class="yes">' . size_format( $memory ) . '</mark>';
81
+					echo '<mark class="yes">'.size_format($memory).'</mark>';
82 82
 				}
83 83
 				?>
84 84
 			</td>
85 85
 		</tr>
86 86
 		<tr>
87
-			<td data-export-label="WP Debug Mode"><?php _e( 'WP Debug Mode', 'give' ); ?>:</td>
88
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Displays whether or not WordPress is in Debug Mode.', 'give' ) ); ?></td>
87
+			<td data-export-label="WP Debug Mode"><?php _e('WP Debug Mode', 'give'); ?>:</td>
88
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Displays whether or not WordPress is in Debug Mode.', 'give')); ?></td>
89 89
 			<td>
90
-				<?php if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) : ?>
90
+				<?php if (defined('WP_DEBUG') && WP_DEBUG) : ?>
91 91
 					<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
92 92
 				<?php else : ?>
93 93
 					<mark class="no">&ndash;</mark>
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
 			</td>
96 96
 		</tr>
97 97
 		<tr>
98
-			<td data-export-label="WP Cron"><?php _e( 'WP Cron', 'give' ); ?>:</td>
99
-			<td class="help"><?php echo Give()->tooltips->render( __( 'Displays whether or not WP Cron Jobs are enabled.', 'give' ) ); ?></td>
98
+			<td data-export-label="WP Cron"><?php _e('WP Cron', 'give'); ?>:</td>
99
+			<td class="help"><?php echo Give()->tooltips->render(__('Displays whether or not WP Cron Jobs are enabled.', 'give')); ?></td>
100 100
 			<td>
101
-				<?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?>
101
+				<?php if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) : ?>
102 102
 					<mark class="no">&ndash;</mark>
103 103
 				<?php else : ?>
104 104
 					<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
@@ -106,60 +106,60 @@  discard block
 block discarded – undo
106 106
 			</td>
107 107
 		</tr>
108 108
 		<tr>
109
-			<td data-export-label="Language"><?php _e( 'Language', 'give' ); ?>:</td>
110
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The current language used by WordPress. Default = English', 'give' ) ); ?></td>
109
+			<td data-export-label="Language"><?php _e('Language', 'give'); ?>:</td>
110
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The current language used by WordPress. Default = English', 'give')); ?></td>
111 111
 			<td><?php echo get_locale(); ?></td>
112 112
 		</tr>
113 113
 		<tr>
114
-			<td data-export-label="Permalink Structure"><?php _e( 'Permalink Structure', 'give' ); ?>:</td>
115
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The permalink structure as defined in Settings.', 'give' ) ); ?></td>
116
-			<td><?php echo esc_html( get_option( 'permalink_structure', __( 'Default', 'give' ) ) ); ?></td>
114
+			<td data-export-label="Permalink Structure"><?php _e('Permalink Structure', 'give'); ?>:</td>
115
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The permalink structure as defined in Settings.', 'give')); ?></td>
116
+			<td><?php echo esc_html(get_option('permalink_structure', __('Default', 'give'))); ?></td>
117 117
 		</tr>
118 118
 		<tr>
119
-			<td data-export-label="Show on Front"><?php _e( 'Show on Front', 'give' ); ?>:</td>
120
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether your front page is set to show posts or a static page.', 'give' ) ); ?></td>
121
-			<td><?php echo esc_html( get_option( 'show_on_front', '&ndash;' ) ); ?></td>
119
+			<td data-export-label="Show on Front"><?php _e('Show on Front', 'give'); ?>:</td>
120
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether your front page is set to show posts or a static page.', 'give')); ?></td>
121
+			<td><?php echo esc_html(get_option('show_on_front', '&ndash;')); ?></td>
122 122
 		</tr>
123
-		<?php if ( 'page' === get_option( 'show_on_front' ) ) : ?>
123
+		<?php if ('page' === get_option('show_on_front')) : ?>
124 124
 			<?php
125
-			$front_page_id = absint( get_option( 'page_on_front' ) );
126
-			$blog_page_id  = absint( get_option( 'page_for_posts' ) );
125
+			$front_page_id = absint(get_option('page_on_front'));
126
+			$blog_page_id  = absint(get_option('page_for_posts'));
127 127
 			?>
128 128
 			<tr>
129
-				<td data-export-label="Page on Front"><?php _e( 'Page on Front', 'give' ); ?>:</td>
130
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The page set to display as your front page.', 'give' ) ); ?></td>
131
-				<td><?php echo 0 !== $front_page_id ? esc_html( get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' ) : __( 'Unset', 'give' ); ?></td>
129
+				<td data-export-label="Page on Front"><?php _e('Page on Front', 'give'); ?>:</td>
130
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The page set to display as your front page.', 'give')); ?></td>
131
+				<td><?php echo 0 !== $front_page_id ? esc_html(get_the_title($front_page_id).' (#'.$front_page_id.')') : __('Unset', 'give'); ?></td>
132 132
 			</tr>
133 133
 			<tr>
134
-				<td data-export-label="Page for Posts"><?php _e( 'Page for Posts', 'give' ); ?>:</td>
135
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The page set to display your posts.', 'give' ) ); ?></td>
136
-				<td><?php echo 0 !== $blog_page_id ? esc_html( get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' ) : __( 'Unset', 'give' ); ?></td>
134
+				<td data-export-label="Page for Posts"><?php _e('Page for Posts', 'give'); ?>:</td>
135
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The page set to display your posts.', 'give')); ?></td>
136
+				<td><?php echo 0 !== $blog_page_id ? esc_html(get_the_title($blog_page_id).' (#'.$blog_page_id.')') : __('Unset', 'give'); ?></td>
137 137
 			</tr>
138
-		<?php endif;?>
138
+		<?php endif; ?>
139 139
 		<tr>
140
-			<td data-export-label="Table Prefix Length"><?php _e( 'Table Prefix', 'give' ); ?>:</td>
141
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The table prefix used in your WordPress database.', 'give' ) ); ?></td>
142
-			<td><?php echo esc_html( $wpdb->prefix ); ?></td>
140
+			<td data-export-label="Table Prefix Length"><?php _e('Table Prefix', 'give'); ?>:</td>
141
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The table prefix used in your WordPress database.', 'give')); ?></td>
142
+			<td><?php echo esc_html($wpdb->prefix); ?></td>
143 143
 		</tr>
144 144
 		<tr>
145
-			<td data-export-label="Table Prefix Length"><?php _e( 'Table Prefix Length', 'give' ); ?>:</td>
146
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The length of the table prefix used in your WordPress database.', 'give' ) ); ?></td>
147
-			<td><?php echo esc_html( strlen( $wpdb->prefix ) ); ?></td>
145
+			<td data-export-label="Table Prefix Length"><?php _e('Table Prefix Length', 'give'); ?>:</td>
146
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The length of the table prefix used in your WordPress database.', 'give')); ?></td>
147
+			<td><?php echo esc_html(strlen($wpdb->prefix)); ?></td>
148 148
 		</tr>
149 149
 		<tr>
150
-			<td data-export-label="Table Prefix Status"><?php _e( 'Table Prefix Status', 'give' ); ?>:</td>
151
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The status of the table prefix used in your WordPress database.', 'give' ) ); ?></td>
152
-			<td><?php echo strlen( $wpdb->prefix ) > 16 ? esc_html( 'Error: Too long', 'give' ) : esc_html( 'Acceptable', 'give' ); ?></td>
150
+			<td data-export-label="Table Prefix Status"><?php _e('Table Prefix Status', 'give'); ?>:</td>
151
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The status of the table prefix used in your WordPress database.', 'give')); ?></td>
152
+			<td><?php echo strlen($wpdb->prefix) > 16 ? esc_html('Error: Too long', 'give') : esc_html('Acceptable', 'give'); ?></td>
153 153
 		</tr>
154 154
 		<tr>
155
-			<td data-export-label="Admin AJAX"><?php _e( 'Admin AJAX', 'give' ); ?>:</td>
156
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether Admin AJAX is accessible.', 'give' ) ); ?></td>
157
-			<td><?php echo give_test_ajax_works() ? __( 'Accessible', 'give' ) : __( 'Inaccessible', 'give' ); ?></td>
155
+			<td data-export-label="Admin AJAX"><?php _e('Admin AJAX', 'give'); ?>:</td>
156
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether Admin AJAX is accessible.', 'give')); ?></td>
157
+			<td><?php echo give_test_ajax_works() ? __('Accessible', 'give') : __('Inaccessible', 'give'); ?></td>
158 158
 		</tr>
159 159
 		<tr>
160
-			<td data-export-label="Registered Post Statuses"><?php _e( 'Registered Post Statuses', 'give' ); ?>:</td>
161
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'A list of all registered post statuses.', 'give' ) ); ?></td>
162
-			<td><?php echo esc_html( implode( ', ', get_post_stati() ) ); ?></td>
160
+			<td data-export-label="Registered Post Statuses"><?php _e('Registered Post Statuses', 'give'); ?>:</td>
161
+			<td class="help"><?php echo Give()->tooltips->render_help(__('A list of all registered post statuses.', 'give')); ?></td>
162
+			<td><?php echo esc_html(implode(', ', get_post_stati())); ?></td>
163 163
 		</tr>
164 164
 	</tbody>
165 165
 </table>
@@ -167,97 +167,97 @@  discard block
 block discarded – undo
167 167
 <table class="give-status-table widefat" cellspacing="0">
168 168
 	<thead>
169 169
 		<tr>
170
-			<th colspan="3" data-export-label="Server Environment"><h2><?php _e( 'Server Environment', 'give' ); ?></h2></th>
170
+			<th colspan="3" data-export-label="Server Environment"><h2><?php _e('Server Environment', 'give'); ?></h2></th>
171 171
 		</tr>
172 172
 	</thead>
173 173
 	<tbody>
174 174
 		<tr>
175
-			<td data-export-label="Hosting Provider"><?php _e( 'Hosting Provider', 'give' ); ?>:</td>
176
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The hosting provider for this WordPress installation.', 'give' ) ); ?></td>
177
-			<td><?php echo give_get_host() ? esc_html( give_get_host() ) : __( 'Unknown', 'give' ); ?></td>
175
+			<td data-export-label="Hosting Provider"><?php _e('Hosting Provider', 'give'); ?>:</td>
176
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The hosting provider for this WordPress installation.', 'give')); ?></td>
177
+			<td><?php echo give_get_host() ? esc_html(give_get_host()) : __('Unknown', 'give'); ?></td>
178 178
 		</tr>
179 179
 		<tr>
180
-			<td data-export-label="TLS Connection"><?php _e( 'TLS Connection', 'give' ); ?>:</td>
181
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Most payment gateway APIs only support connections using the TLS 1.2 security protocol.', 'give' ) ); ?></td>
180
+			<td data-export-label="TLS Connection"><?php _e('TLS Connection', 'give'); ?>:</td>
181
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Most payment gateway APIs only support connections using the TLS 1.2 security protocol.', 'give')); ?></td>
182 182
 			<td>
183 183
 				<?php
184
-				$tls_check = wp_remote_post( 'https://www.howsmyssl.com/a/check' );
185
-				if ( ! is_wp_error( $tls_check ) ) {
186
-					$tls_check = json_decode( wp_remote_retrieve_body( $tls_check ) );
184
+				$tls_check = wp_remote_post('https://www.howsmyssl.com/a/check');
185
+				if ( ! is_wp_error($tls_check)) {
186
+					$tls_check = json_decode(wp_remote_retrieve_body($tls_check));
187 187
 					/* translators: %s: SSL connection response */
188
-					printf( __('Connection uses %s', 'give'), esc_html( $tls_check->tls_version )) ;
188
+					printf(__('Connection uses %s', 'give'), esc_html($tls_check->tls_version));
189 189
 				}
190 190
 				?>
191 191
 			</td>
192 192
 		</tr>
193 193
 		<tr>
194
-			<td data-export-label="TLS Connection"><?php _e( 'TLS Rating', 'give' ); ?>:</td>
195
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The server\'s connection as rated by https://www.howsmyssl.com/', 'give' ) ); ?></td>
194
+			<td data-export-label="TLS Connection"><?php _e('TLS Rating', 'give'); ?>:</td>
195
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The server\'s connection as rated by https://www.howsmyssl.com/', 'give')); ?></td>
196 196
 			<td>
197 197
 				<?php
198
-				if ( ! is_wp_error( $tls_check ) ) {
199
-					esc_html_e( $tls_check->rating);
198
+				if ( ! is_wp_error($tls_check)) {
199
+					esc_html_e($tls_check->rating);
200 200
 				}
201 201
 				?>
202 202
 			</td>
203 203
 		</tr>
204 204
 		<tr>
205
-			<td data-export-label="Server Info"><?php _e( 'Server Info', 'give' ); ?>:</td>
206
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Information about the web server that is currently hosting your site.', 'give' ) ); ?></td>
207
-			<td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td>
205
+			<td data-export-label="Server Info"><?php _e('Server Info', 'give'); ?>:</td>
206
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Information about the web server that is currently hosting your site.', 'give')); ?></td>
207
+			<td><?php echo esc_html($_SERVER['SERVER_SOFTWARE']); ?></td>
208 208
 		</tr>
209 209
 		<tr>
210
-			<td data-export-label="PHP Version"><?php _e( 'PHP Version', 'give' ); ?>:</td>
211
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of PHP installed on your hosting server.', 'give' ) ); ?></td>
210
+			<td data-export-label="PHP Version"><?php _e('PHP Version', 'give'); ?>:</td>
211
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The version of PHP installed on your hosting server.', 'give')); ?></td>
212 212
 			<td>
213 213
 				<?php
214 214
 				// Check if phpversion function exists.
215
-				if ( function_exists( 'phpversion' ) ) {
215
+				if (function_exists('phpversion')) {
216 216
 					$php_version = phpversion();
217 217
 
218
-					if ( version_compare( $php_version, '5.6', '<' ) ) {
219
-						echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum PHP version of 5.6. See: %s', 'give' ), esc_html( $php_version ), '<a href="http://docs.givewp.com/settings-system-info" target="_blank">' . __( 'PHP Requirements in Give', 'give' ) . '</a>' ) . '</mark>';
218
+					if (version_compare($php_version, '5.6', '<')) {
219
+						echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum PHP version of 5.6. See: %s', 'give'), esc_html($php_version), '<a href="http://docs.givewp.com/settings-system-info" target="_blank">'.__('PHP Requirements in Give', 'give').'</a>').'</mark>';
220 220
 					} else {
221
-						echo '<mark class="yes">' . esc_html( $php_version ) . '</mark>';
221
+						echo '<mark class="yes">'.esc_html($php_version).'</mark>';
222 222
 					}
223 223
 				} else {
224
-					_e( "Couldn't determine PHP version because phpversion() doesn't exist.", 'give' );
224
+					_e("Couldn't determine PHP version because phpversion() doesn't exist.", 'give');
225 225
 				}
226 226
 				?></td>
227 227
 		</tr>
228
-		<?php if ( function_exists( 'ini_get' ) ) : ?>
228
+		<?php if (function_exists('ini_get')) : ?>
229 229
 			<tr>
230
-				<td data-export-label="PHP Post Max Size"><?php _e( 'PHP Post Max Size', 'give' ); ?>:</td>
231
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The largest filesize that can be contained in one post.', 'give' ) ); ?></td>
232
-				<td><?php echo size_format( give_let_to_num( ini_get( 'post_max_size' ) ) ); ?></td>
230
+				<td data-export-label="PHP Post Max Size"><?php _e('PHP Post Max Size', 'give'); ?>:</td>
231
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The largest filesize that can be contained in one post.', 'give')); ?></td>
232
+				<td><?php echo size_format(give_let_to_num(ini_get('post_max_size'))); ?></td>
233 233
 			</tr>
234 234
 			<tr>
235
-				<td data-export-label="PHP Time Limit"><?php _e( 'PHP Time Limit', 'give' ); ?>:</td>
236
-				<td class="help"><?php echo Give() ->tooltips->render_help( __( 'The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups).', 'give' ) ); ?></td>
237
-				<td><?php echo ini_get( 'max_execution_time' ); ?></td>
235
+				<td data-export-label="PHP Time Limit"><?php _e('PHP Time Limit', 'give'); ?>:</td>
236
+				<td class="help"><?php echo Give() ->tooltips->render_help(__('The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups).', 'give')); ?></td>
237
+				<td><?php echo ini_get('max_execution_time'); ?></td>
238 238
 			</tr>
239 239
 			<tr>
240
-				<td data-export-label="PHP Max Input Vars"><?php _e( 'PHP Max Input Vars', 'give' ); ?>:</td>
241
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The maximum number of variables your server can use for a single function to avoid overloads.', 'give' ) ); ?></td>
242
-				<td><?php echo ini_get( 'max_input_vars' ); ?></td>
240
+				<td data-export-label="PHP Max Input Vars"><?php _e('PHP Max Input Vars', 'give'); ?>:</td>
241
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The maximum number of variables your server can use for a single function to avoid overloads.', 'give')); ?></td>
242
+				<td><?php echo ini_get('max_input_vars'); ?></td>
243 243
 			</tr>
244 244
 			<tr>
245
-				<td data-export-label="PHP Max Upload Size"><?php _e( 'PHP Max Upload Size', 'give' ); ?>:</td>
246
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The largest filesize that can be uploaded to your WordPress installation.', 'give' ) ); ?></td>
247
-				<td><?php echo size_format( wp_max_upload_size() ); ?></td>
245
+				<td data-export-label="PHP Max Upload Size"><?php _e('PHP Max Upload Size', 'give'); ?>:</td>
246
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The largest filesize that can be uploaded to your WordPress installation.', 'give')); ?></td>
247
+				<td><?php echo size_format(wp_max_upload_size()); ?></td>
248 248
 			</tr>
249 249
 			<tr>
250
-				<td data-export-label="cURL Version"><?php _e( 'cURL Version', 'give' ); ?>:</td>
251
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of cURL installed on your server.', 'give' ) ); ?></td>
250
+				<td data-export-label="cURL Version"><?php _e('cURL Version', 'give'); ?>:</td>
251
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The version of cURL installed on your server.', 'give')); ?></td>
252 252
 				<td>
253 253
 					<?php
254
-					if ( function_exists( 'curl_version' ) ) {
254
+					if (function_exists('curl_version')) {
255 255
 						$curl_version = curl_version();
256 256
 
257
-						if ( version_compare( $curl_version['version'], '7.40', '<' ) ) {
258
-							echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum cURL version of 7.40.', 'give' ), esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) ) . '</mark>';
257
+						if (version_compare($curl_version['version'], '7.40', '<')) {
258
+							echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum cURL version of 7.40.', 'give'), esc_html($curl_version['version'].', '.$curl_version['ssl_version'])).'</mark>';
259 259
 						} else {
260
-							echo '<mark class="yes">' . esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) . '</mark>';
260
+							echo '<mark class="yes">'.esc_html($curl_version['version'].', '.$curl_version['ssl_version']).'</mark>';
261 261
 						}
262 262
 					} else {
263 263
 						echo '&ndash';
@@ -266,42 +266,42 @@  discard block
 block discarded – undo
266 266
 				</td>
267 267
 			</tr>
268 268
 			<tr>
269
-				<td data-export-label="SUHOSIN Installed"><?php _e( 'SUHOSIN Installed', 'give' ); ?>:</td>
270
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'give' ) ); ?></td>
271
-				<td><?php echo extension_loaded( 'suhosin' ) ? '<span class="dashicons dashicons-yes"></span>' : '&ndash;'; ?></td>
269
+				<td data-export-label="SUHOSIN Installed"><?php _e('SUHOSIN Installed', 'give'); ?>:</td>
270
+				<td class="help"><?php echo Give()->tooltips->render_help(__('Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'give')); ?></td>
271
+				<td><?php echo extension_loaded('suhosin') ? '<span class="dashicons dashicons-yes"></span>' : '&ndash;'; ?></td>
272 272
 			</tr>
273 273
 		<?php endif;
274 274
 
275
-		if ( $wpdb->use_mysqli ) {
276
-			$ver = mysqli_get_server_info( $wpdb->dbh );
275
+		if ($wpdb->use_mysqli) {
276
+			$ver = mysqli_get_server_info($wpdb->dbh);
277 277
 		} else {
278 278
 			$ver = mysql_get_server_info();
279 279
 		}
280 280
 
281
-		if ( ! empty( $wpdb->is_mysql ) && ! stristr( $ver, 'MariaDB' ) ) : ?>
281
+		if ( ! empty($wpdb->is_mysql) && ! stristr($ver, 'MariaDB')) : ?>
282 282
 			<tr>
283
-				<td data-export-label="MySQL Version"><?php _e( 'MySQL Version', 'give' ); ?>:</td>
284
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of MySQL installed on your hosting server.', 'give' ) ); ?></td>
283
+				<td data-export-label="MySQL Version"><?php _e('MySQL Version', 'give'); ?>:</td>
284
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The version of MySQL installed on your hosting server.', 'give')); ?></td>
285 285
 				<td>
286 286
 					<?php
287 287
 					$mysql_version = $wpdb->db_version();
288 288
 
289
-					if ( version_compare( $mysql_version, '5.6', '<' ) ) {
290
-						echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum MySQL version of 5.6. See: %s', 'give' ), esc_html( $mysql_version ), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . __( 'WordPress Requirements', 'give' ) . '</a>' ) . '</mark>';
289
+					if (version_compare($mysql_version, '5.6', '<')) {
290
+						echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum MySQL version of 5.6. See: %s', 'give'), esc_html($mysql_version), '<a href="https://wordpress.org/about/requirements/" target="_blank">'.__('WordPress Requirements', 'give').'</a>').'</mark>';
291 291
 					} else {
292
-						echo '<mark class="yes">' . esc_html( $mysql_version ) . '</mark>';
292
+						echo '<mark class="yes">'.esc_html($mysql_version).'</mark>';
293 293
 					}
294 294
 					?>
295 295
 				</td>
296 296
 			</tr>
297 297
 		<?php endif; ?>
298 298
 		<tr>
299
-			<td data-export-label="Default Timezone is UTC"><?php _e( 'Default Timezone is UTC', 'give' ); ?>:</td>
300
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The default timezone for your server.', 'give' ) ); ?></td>
299
+			<td data-export-label="Default Timezone is UTC"><?php _e('Default Timezone is UTC', 'give'); ?>:</td>
300
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The default timezone for your server.', 'give')); ?></td>
301 301
 			<td><?php
302 302
 				$default_timezone = date_default_timezone_get();
303
-				if ( 'UTC' !== $default_timezone ) {
304
-					echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( 'Default timezone is %s - it should be UTC', 'give' ), $default_timezone ) . '</mark>';
303
+				if ('UTC' !== $default_timezone) {
304
+					echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('Default timezone is %s - it should be UTC', 'give'), $default_timezone).'</mark>';
305 305
 				} else {
306 306
 					echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
307 307
 				} ?>
@@ -312,119 +312,119 @@  discard block
 block discarded – undo
312 312
 
313 313
 		// fsockopen/cURL.
314 314
 		$posting['fsockopen_curl']['name'] = 'fsockopen/cURL';
315
-		$posting['fsockopen_curl']['help'] = __( 'Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'give' );
315
+		$posting['fsockopen_curl']['help'] = __('Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'give');
316 316
 
317
-		if ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) {
317
+		if (function_exists('fsockopen') || function_exists('curl_init')) {
318 318
 			$posting['fsockopen_curl']['success'] = true;
319 319
 		} else {
320 320
 			$posting['fsockopen_curl']['success'] = false;
321
-			$posting['fsockopen_curl']['note']    = __( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'give' );
321
+			$posting['fsockopen_curl']['note']    = __('Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'give');
322 322
 		}
323 323
 
324 324
 		// SOAP.
325 325
 		$posting['soap_client']['name'] = 'SoapClient';
326
-		$posting['soap_client']['help'] = __( 'Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'give' );
326
+		$posting['soap_client']['help'] = __('Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'give');
327 327
 
328
-		if ( class_exists( 'SoapClient' ) ) {
328
+		if (class_exists('SoapClient')) {
329 329
 			$posting['soap_client']['success'] = true;
330 330
 		} else {
331 331
 			$posting['soap_client']['success'] = false;
332
-			$posting['soap_client']['note']    = sprintf( __( 'Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'give' ), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>' );
332
+			$posting['soap_client']['note']    = sprintf(__('Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'give'), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>');
333 333
 		}
334 334
 
335 335
 		// DOMDocument.
336 336
 		$posting['dom_document']['name'] = 'DOMDocument';
337
-		$posting['dom_document']['help'] = __( 'HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'give' );
337
+		$posting['dom_document']['help'] = __('HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'give');
338 338
 
339
-		if ( class_exists( 'DOMDocument' ) ) {
339
+		if (class_exists('DOMDocument')) {
340 340
 			$posting['dom_document']['success'] = true;
341 341
 		} else {
342 342
 			$posting['dom_document']['success'] = false;
343
-			$posting['dom_document']['note']    = sprintf( __( 'Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'give' ), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>' );
343
+			$posting['dom_document']['note']    = sprintf(__('Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'give'), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>');
344 344
 		}
345 345
 
346 346
 		// gzip.
347 347
 		$posting['gzip']['name'] = 'gzip';
348
-		$posting['gzip']['help'] = __( 'gzip is used for file compression and decompression.', 'give' );
348
+		$posting['gzip']['help'] = __('gzip is used for file compression and decompression.', 'give');
349 349
 
350
-		if ( is_callable( 'gzopen' ) ) {
350
+		if (is_callable('gzopen')) {
351 351
 			$posting['gzip']['success'] = true;
352 352
 		} else {
353 353
 			$posting['gzip']['success'] = false;
354
-			$posting['gzip']['note']    = sprintf( __( 'Your server does not support the %s function - this is used for file compression and decompression.', 'give' ), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>' );
354
+			$posting['gzip']['note']    = sprintf(__('Your server does not support the %s function - this is used for file compression and decompression.', 'give'), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>');
355 355
 		}
356 356
 
357 357
 
358 358
 		// GD Graphics Library.
359 359
 		$posting['gd']['name']    = 'GD Graphics Library';
360
-		$posting['gd']['help']    = __( 'GD Graphics Library is used for dynamically manipulating images.', 'give' );
361
-		$posting['gd']['success'] = extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ? true : false;
360
+		$posting['gd']['help']    = __('GD Graphics Library is used for dynamically manipulating images.', 'give');
361
+		$posting['gd']['success'] = extension_loaded('gd') && function_exists('gd_info') ? true : false;
362 362
 
363 363
 		// Multibyte String.
364 364
 		$posting['mbstring']['name'] = 'Multibyte String';
365
-		$posting['mbstring']['help'] = __( 'Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'give' );
365
+		$posting['mbstring']['help'] = __('Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'give');
366 366
 
367
-		if ( extension_loaded( 'mbstring' ) ) {
367
+		if (extension_loaded('mbstring')) {
368 368
 			$posting['mbstring']['success'] = true;
369 369
 		} else {
370 370
 			$posting['mbstring']['success'] = false;
371
-			$posting['mbstring']['note']    = sprintf( __( 'Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'give' ), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>' );
371
+			$posting['mbstring']['note']    = sprintf(__('Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'give'), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>');
372 372
 		}
373 373
 
374 374
 		// WP Remote Post Check.
375
-		$posting['wp_remote_post']['name'] = __( 'Remote Post', 'give' );
376
-		$posting['wp_remote_post']['help'] = __( 'PayPal uses this method of communicating when sending back transaction information.', 'give' );
375
+		$posting['wp_remote_post']['name'] = __('Remote Post', 'give');
376
+		$posting['wp_remote_post']['help'] = __('PayPal uses this method of communicating when sending back transaction information.', 'give');
377 377
 
378
-		$response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array(
378
+		$response = wp_safe_remote_post('https://www.paypal.com/cgi-bin/webscr', array(
379 379
 			'timeout'     => 60,
380
-			'user-agent'  => 'Give/' . GIVE_VERSION,
380
+			'user-agent'  => 'Give/'.GIVE_VERSION,
381 381
 			'httpversion' => '1.1',
382 382
 			'body'        => array(
383 383
 				'cmd' => '_notify-validate',
384 384
 			),
385
-		) );
385
+		));
386 386
 
387
-		if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
387
+		if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
388 388
 			$posting['wp_remote_post']['success'] = true;
389 389
 		} else {
390
-			$posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'give' );
391
-			if ( is_wp_error( $response ) ) {
392
-				$posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), sanitize_text_field( $response->get_error_message() ) );
390
+			$posting['wp_remote_post']['note'] = __('wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'give');
391
+			if (is_wp_error($response)) {
392
+				$posting['wp_remote_post']['note'] .= ' '.sprintf(__('Error: %s', 'give'), sanitize_text_field($response->get_error_message()));
393 393
 			} else {
394
-				$posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), sanitize_text_field( $response['response']['code'] ) );
394
+				$posting['wp_remote_post']['note'] .= ' '.sprintf(__('Status code: %s', 'give'), sanitize_text_field($response['response']['code']));
395 395
 			}
396 396
 			$posting['wp_remote_post']['success'] = false;
397 397
 		}
398 398
 
399 399
 		// WP Remote Get Check.
400
-		$posting['wp_remote_get']['name'] = __( 'Remote Get', 'give' );
401
-		$posting['wp_remote_get']['help'] = __( 'Give plugins may use this method of communication when checking for plugin updates.', 'give' );
400
+		$posting['wp_remote_get']['name'] = __('Remote Get', 'give');
401
+		$posting['wp_remote_get']['help'] = __('Give plugins may use this method of communication when checking for plugin updates.', 'give');
402 402
 
403
-		$response = wp_safe_remote_get( 'https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . ( is_multisite() ? '1' : '0' ) );
403
+		$response = wp_safe_remote_get('https://woocommerce.com/wc-api/product-key-api?request=ping&network='.(is_multisite() ? '1' : '0'));
404 404
 
405
-		if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
405
+		if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
406 406
 			$posting['wp_remote_get']['success'] = true;
407 407
 		} else {
408
-			$posting['wp_remote_get']['note'] = __( 'wp_remote_get() failed. The Give plugin updater won\'t work with your server. Contact your hosting provider.', 'give' );
409
-			if ( is_wp_error( $response ) ) {
410
-				$posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), give_clean( $response->get_error_message() ) );
408
+			$posting['wp_remote_get']['note'] = __('wp_remote_get() failed. The Give plugin updater won\'t work with your server. Contact your hosting provider.', 'give');
409
+			if (is_wp_error($response)) {
410
+				$posting['wp_remote_get']['note'] .= ' '.sprintf(__('Error: %s', 'give'), give_clean($response->get_error_message()));
411 411
 			} else {
412
-				$posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), give_clean( $response['response']['code'] ) );
412
+				$posting['wp_remote_get']['note'] .= ' '.sprintf(__('Status code: %s', 'give'), give_clean($response['response']['code']));
413 413
 			}
414 414
 			$posting['wp_remote_get']['success'] = false;
415 415
 		}
416 416
 
417
-		$posting = apply_filters( 'give_debug_posting', $posting );
417
+		$posting = apply_filters('give_debug_posting', $posting);
418 418
 
419
-		foreach ( $posting as $post ) {
420
-			$mark = ! empty( $post['success'] ) ? 'yes' : 'error';
419
+		foreach ($posting as $post) {
420
+			$mark = ! empty($post['success']) ? 'yes' : 'error';
421 421
 			?>
422 422
 			<tr>
423
-				<td data-export-label="<?php echo esc_html( $post['name'] ); ?>"><?php echo esc_html( $post['name'] ); ?>:</td>
424
-				<td class="help"><?php echo Give()->tooltips->render_help( esc_attr( isset( $post['help'] ) ? $post['help'] : '' ) ); ?></td>
423
+				<td data-export-label="<?php echo esc_html($post['name']); ?>"><?php echo esc_html($post['name']); ?>:</td>
424
+				<td class="help"><?php echo Give()->tooltips->render_help(esc_attr(isset($post['help']) ? $post['help'] : '')); ?></td>
425 425
 				<td>
426 426
 					<mark class="<?php echo $mark; ?>">
427
-						<?php echo ! empty( $post['success'] ) ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no-alt"></span>'; ?> <?php echo ! empty( $post['note'] ) ? wp_kses_data( $post['note'] ) : ''; ?>
427
+						<?php echo ! empty($post['success']) ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no-alt"></span>'; ?> <?php echo ! empty($post['note']) ? wp_kses_data($post['note']) : ''; ?>
428 428
 					</mark>
429 429
 				</td>
430 430
 			</tr>
@@ -437,47 +437,47 @@  discard block
 block discarded – undo
437 437
 <table class="give-status-table widefat" cellspacing="0">
438 438
 	<thead>
439 439
 		<tr>
440
-			<th colspan="3" data-export-label="Give Configuration"><h2><?php _e( 'Give Configuration', 'give' ); ?></h2></th>
440
+			<th colspan="3" data-export-label="Give Configuration"><h2><?php _e('Give Configuration', 'give'); ?></h2></th>
441 441
 		</tr>
442 442
 	</thead>
443 443
 	<tbody>
444 444
 		<tr>
445
-			<td data-export-label="Give Version"><?php _e( 'Give Version', 'give' ); ?>:</td>
446
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of Give installed on your site.', 'give' ) ); ?></td>
447
-			<td><?php echo esc_html( GIVE_VERSION ); ?></td>
445
+			<td data-export-label="Give Version"><?php _e('Give Version', 'give'); ?>:</td>
446
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The version of Give installed on your site.', 'give')); ?></td>
447
+			<td><?php echo esc_html(GIVE_VERSION); ?></td>
448 448
 		</tr>
449 449
 		<tr>
450
-			<td data-export-label="Give Cache"><?php _e( 'Give Cache', 'give' ); ?>:</td>
451
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether cache is enabled in Give settings.', 'give' ) ); ?></td>
452
-			<td><?php echo give_is_setting_enabled( give_get_option('cache', 'enabled' ) ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
450
+			<td data-export-label="Give Cache"><?php _e('Give Cache', 'give'); ?>:</td>
451
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether cache is enabled in Give settings.', 'give')); ?></td>
452
+			<td><?php echo give_is_setting_enabled(give_get_option('cache', 'enabled')) ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td>
453 453
 		</tr>
454 454
 		<tr>
455
-			<td data-export-label="Database Updates"><?php _e( 'Database Updates', 'give' ); ?>:</td>
456
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'This will show the number of pending database updates.', 'give' ) ); ?></td>
455
+			<td data-export-label="Database Updates"><?php _e('Database Updates', 'give'); ?>:</td>
456
+			<td class="help"><?php echo Give()->tooltips->render_help(__('This will show the number of pending database updates.', 'give')); ?></td>
457 457
 			<td>
458 458
 				<?php
459
-				$updates_text    = __( 'All DB Updates Completed.', 'give' );
459
+				$updates_text    = __('All DB Updates Completed.', 'give');
460 460
 				$pending_updates = $give_updates->get_total_new_db_update_count();
461 461
 				$total_updates   = $give_updates->get_total_db_update_count();
462 462
 
463
-				if( Give_Updates::$background_updater->is_paused_process() ) {
463
+				if (Give_Updates::$background_updater->is_paused_process()) {
464 464
 					// When all the db updates are pending.
465 465
 					$updates_text = sprintf(
466
-						__( '%1$s updates still need to run. (Paused) ', 'give' ),
467
-						count( $give_updates->get_updates('database', 'new' ) )
466
+						__('%1$s updates still need to run. (Paused) ', 'give'),
467
+						count($give_updates->get_updates('database', 'new'))
468 468
 					);
469
-				} elseif( $pending_updates === $total_updates ) {
469
+				} elseif ($pending_updates === $total_updates) {
470 470
 
471 471
 					// When all the db updates are pending.
472 472
 					$updates_text = sprintf(
473
-						__( '%1$s updates still need to run.', 'give' ),
473
+						__('%1$s updates still need to run.', 'give'),
474 474
 						$total_updates
475 475
 					);
476
-				} elseif( $pending_updates > 0 ) {
476
+				} elseif ($pending_updates > 0) {
477 477
 
478 478
 					// When some of the db updates are completed and some are pending.
479 479
 					$updates_text = sprintf(
480
-						__( '%1$s of %2$s updates still need to run.', 'give' ),
480
+						__('%1$s of %2$s updates still need to run.', 'give'),
481 481
 						$pending_updates,
482 482
 						$total_updates
483 483
 					);
@@ -488,144 +488,143 @@  discard block
 block discarded – undo
488 488
 			</td>
489 489
 		</tr>
490 490
 		<tr>
491
-			<td data-export-label="Give Cache"><?php _e( 'Give Cache', 'give' ); ?>:</td>
492
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether cache is enabled in Give settings.', 'give' ) ); ?></td>
493
-			<td><?php echo give_is_setting_enabled( give_get_option('cache', 'enabled' ) ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
491
+			<td data-export-label="Give Cache"><?php _e('Give Cache', 'give'); ?>:</td>
492
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether cache is enabled in Give settings.', 'give')); ?></td>
493
+			<td><?php echo give_is_setting_enabled(give_get_option('cache', 'enabled')) ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td>
494 494
 		</tr>
495 495
 		<tr>
496
-			<td data-export-label="Give Cache"><?php _e( 'Give Emails', 'give' ); ?>:</td>
497
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether emails is enabled in Give settings.', 'give' ) ); ?></td>
496
+			<td data-export-label="Give Cache"><?php _e('Give Emails', 'give'); ?>:</td>
497
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether emails is enabled in Give settings.', 'give')); ?></td>
498 498
 			<td>
499 499
 				<?php
500 500
 				/* @var Give_Email_Notification $email_notification */
501
-				if( $email_notifications = Give_Email_Notifications::get_instance()->get_email_notifications() ) {
501
+				if ($email_notifications = Give_Email_Notifications::get_instance()->get_email_notifications()) {
502 502
 					ob_start();
503 503
 
504
-					foreach ( Give_Email_Notifications::get_instance()->get_email_notifications() as $email_notification ) {
505
-						$status = Give_Email_Notification_Util::is_email_notification_active( $email_notification ) ?
506
-							'yes' :
507
-							'error';
504
+					foreach (Give_Email_Notifications::get_instance()->get_email_notifications() as $email_notification) {
505
+						$status = Give_Email_Notification_Util::is_email_notification_active($email_notification) ?
506
+							'yes' : 'error';
508 507
 
509 508
 						echo sprintf(
510 509
 							'<li><mark class="%1$s"><span class="dashicons dashicons-%2$s"></mark></span>%3$s</li>',
511
-							Give_Email_Notification_Util::is_email_notification_active( $email_notification ) ? 'yes' : 'error',
512
-							Give_Email_Notification_Util::is_email_notification_active( $email_notification ) ? 'yes' : 'no-alt',
510
+							Give_Email_Notification_Util::is_email_notification_active($email_notification) ? 'yes' : 'error',
511
+							Give_Email_Notification_Util::is_email_notification_active($email_notification) ? 'yes' : 'no-alt',
513 512
 							$email_notification->config['label']
514 513
 						);
515 514
 					}
516 515
 
517
-					echo sprintf( '<ul>%s</ul>', ob_get_clean() );
516
+					echo sprintf('<ul>%s</ul>', ob_get_clean());
518 517
 				}
519 518
 				?>
520 519
 			</td>
521 520
 		</tr>
522 521
 		<tr>
523
-			<td data-export-label="Upgraded From"><?php _e( 'Upgraded From', 'give' ); ?>:</td>
524
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of Give installed prior to the last update.', 'give' ) ); ?></td>
525
-			<td><?php echo esc_html( get_option( 'give_version_upgraded_from', '&ndash;' ) ); ?></td>
522
+			<td data-export-label="Upgraded From"><?php _e('Upgraded From', 'give'); ?>:</td>
523
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The version of Give installed prior to the last update.', 'give')); ?></td>
524
+			<td><?php echo esc_html(get_option('give_version_upgraded_from', '&ndash;')); ?></td>
526 525
 		</tr>
527 526
 		<tr>
528
-			<td data-export-label="Test Mode"><?php _e( 'Test Mode', 'give' ); ?>:</td>
529
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether Test Mode is enabled in Give settings.', 'give' ) ); ?></td>
530
-			<td><?php echo give_is_test_mode() ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
527
+			<td data-export-label="Test Mode"><?php _e('Test Mode', 'give'); ?>:</td>
528
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether Test Mode is enabled in Give settings.', 'give')); ?></td>
529
+			<td><?php echo give_is_test_mode() ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td>
531 530
 		</tr>
532 531
 		<tr>
533
-			<td data-export-label="Currency Code"><?php _e( 'Currency Code', 'give' ); ?>:</td>
534
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The currency code selected in Give settings.', 'give' ) ); ?></td>
535
-			<td><?php echo esc_html( give_get_currency() ); ?></td>
532
+			<td data-export-label="Currency Code"><?php _e('Currency Code', 'give'); ?>:</td>
533
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The currency code selected in Give settings.', 'give')); ?></td>
534
+			<td><?php echo esc_html(give_get_currency()); ?></td>
536 535
 		</tr>
537 536
 		<tr>
538
-			<td data-export-label="Currency Position"><?php _e( 'Currency Position', 'give' ); ?>:</td>
539
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The currency position selected in Give settings.', 'give' ) ); ?></td>
540
-			<td><?php echo 'before' === give_get_option( 'currency_position' ) ? __( 'Before', 'give' ) : __( 'After', 'give' ); ?></td>
537
+			<td data-export-label="Currency Position"><?php _e('Currency Position', 'give'); ?>:</td>
538
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The currency position selected in Give settings.', 'give')); ?></td>
539
+			<td><?php echo 'before' === give_get_option('currency_position') ? __('Before', 'give') : __('After', 'give'); ?></td>
541 540
 		</tr>
542 541
 		<tr>
543
-			<td data-export-label="Decimal Separator"><?php _e( 'Decimal Separator', 'give' ); ?>:</td>
544
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The decimal separator defined in Give settings.', 'give' ) ); ?></td>
545
-			<td><?php echo esc_html( give_get_price_decimal_separator() ); ?></td>
542
+			<td data-export-label="Decimal Separator"><?php _e('Decimal Separator', 'give'); ?>:</td>
543
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The decimal separator defined in Give settings.', 'give')); ?></td>
544
+			<td><?php echo esc_html(give_get_price_decimal_separator()); ?></td>
546 545
 		</tr>
547 546
 		<tr>
548
-			<td data-export-label="Thousands Separator"><?php _e( 'Thousands Separator', 'give' ); ?>:</td>
549
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The thousands separator defined in Give settings.', 'give' ) ); ?></td>
550
-			<td><?php echo esc_html( give_get_price_thousand_separator() ); ?></td>
547
+			<td data-export-label="Thousands Separator"><?php _e('Thousands Separator', 'give'); ?>:</td>
548
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The thousands separator defined in Give settings.', 'give')); ?></td>
549
+			<td><?php echo esc_html(give_get_price_thousand_separator()); ?></td>
551 550
 		</tr>
552 551
 		<tr>
553
-			<td data-export-label="Success Page"><?php _e( 'Success Page', 'give' ); ?>:</td>
554
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The page where donors land following a successful transaction.', 'give' ) ); ?></td>
555
-			<td><?php echo ! empty( $give_options['success_page'] ) ? esc_url( get_permalink( $give_options['success_page'] ) ) : '&ndash;'; ?></td>
552
+			<td data-export-label="Success Page"><?php _e('Success Page', 'give'); ?>:</td>
553
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The page where donors land following a successful transaction.', 'give')); ?></td>
554
+			<td><?php echo ! empty($give_options['success_page']) ? esc_url(get_permalink($give_options['success_page'])) : '&ndash;'; ?></td>
556 555
 		</tr>
557 556
 		<tr>
558
-			<td data-export-label="Failure Page"><?php _e( 'Failure Page', 'give' ); ?>:</td>
559
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The page where donors land following a failed transaction.', 'give' ) ); ?></td>
560
-			<td><?php echo ! empty( $give_options['failure_page'] ) ? esc_url( get_permalink( $give_options['failure_page'] ) ) : '&ndash;'; ?></td>
557
+			<td data-export-label="Failure Page"><?php _e('Failure Page', 'give'); ?>:</td>
558
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The page where donors land following a failed transaction.', 'give')); ?></td>
559
+			<td><?php echo ! empty($give_options['failure_page']) ? esc_url(get_permalink($give_options['failure_page'])) : '&ndash;'; ?></td>
561 560
 		</tr>
562 561
 		<tr>
563
-			<td data-export-label="Donation History Page"><?php _e( 'Donation History Page', 'give' ); ?>:</td>
564
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The page where past donations are listed.', 'give' ) ); ?></td>
565
-			<td><?php echo ! empty( $give_options['history_page'] ) ? esc_url( get_permalink( $give_options['history_page'] ) ) : '&ndash;'; ?></td>
562
+			<td data-export-label="Donation History Page"><?php _e('Donation History Page', 'give'); ?>:</td>
563
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The page where past donations are listed.', 'give')); ?></td>
564
+			<td><?php echo ! empty($give_options['history_page']) ? esc_url(get_permalink($give_options['history_page'])) : '&ndash;'; ?></td>
566 565
 		</tr>
567 566
 		<tr>
568
-			<td data-export-label="Give Forms Slug"><?php _e( 'Give Forms Slug', 'give' ); ?>:</td>
569
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The slug used for Give donation forms.', 'give' ) ); ?></td>
570
-			<td><?php echo esc_html( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . '/' : '/donations/' ); ?></td>
567
+			<td data-export-label="Give Forms Slug"><?php _e('Give Forms Slug', 'give'); ?>:</td>
568
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The slug used for Give donation forms.', 'give')); ?></td>
569
+			<td><?php echo esc_html(defined('GIVE_SLUG') ? '/'.GIVE_SLUG.'/' : '/donations/'); ?></td>
571 570
 		</tr>
572 571
 		<?php
573 572
 		$active_gateways  = give_get_enabled_payment_gateways();
574 573
 		$enabled_gateways = $default_gateway = '';
575 574
 
576
-		if ( $active_gateways ) {
577
-			$default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) );
575
+		if ($active_gateways) {
576
+			$default_gateway_is_active = give_is_gateway_active(give_get_default_gateway(null));
578 577
 
579
-			if ( $default_gateway_is_active ) {
580
-				$default_gateway = give_get_default_gateway( null );
581
-				$default_gateway = $active_gateways[ $default_gateway ]['admin_label'];
578
+			if ($default_gateway_is_active) {
579
+				$default_gateway = give_get_default_gateway(null);
580
+				$default_gateway = $active_gateways[$default_gateway]['admin_label'];
582 581
 			} else {
583
-				$default_gateway = __( 'Test Donation', 'give' );
582
+				$default_gateway = __('Test Donation', 'give');
584 583
 			}
585 584
 
586 585
 			$gateways = array();
587 586
 
588
-			foreach ( $active_gateways as $gateway ) {
587
+			foreach ($active_gateways as $gateway) {
589 588
 				$gateways[] = $gateway['admin_label'];
590 589
 			}
591 590
 
592
-			$enabled_gateways = implode( ', ', $gateways );
591
+			$enabled_gateways = implode(', ', $gateways);
593 592
 		}
594 593
 		?>
595 594
 		<tr>
596
-			<td data-export-label="Enabled Payment Gateways"><?php _e( 'Enabled Payment Gateways', 'give' ); ?>:</td>
597
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'All payment gateways enabled in Give settings.', 'give' ) ); ?></td>
598
-			<td><?php echo esc_html( ! empty( $enabled_gateways ) ? $enabled_gateways : '&ndash;' ); ?></td>
595
+			<td data-export-label="Enabled Payment Gateways"><?php _e('Enabled Payment Gateways', 'give'); ?>:</td>
596
+			<td class="help"><?php echo Give()->tooltips->render_help(__('All payment gateways enabled in Give settings.', 'give')); ?></td>
597
+			<td><?php echo esc_html( ! empty($enabled_gateways) ? $enabled_gateways : '&ndash;'); ?></td>
599 598
 		</tr>
600 599
 		<tr>
601
-			<td data-export-label="Default Payment Gateway"><?php _e( 'Default Payment Gateway', 'give' ); ?>:</td>
602
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The default payment gateway selected in Give settings.', 'give' ) ); ?></td>
603
-			<td><?php echo esc_html( ! empty( $default_gateway ) ? $default_gateway : '&ndash;' ); ?></td>
600
+			<td data-export-label="Default Payment Gateway"><?php _e('Default Payment Gateway', 'give'); ?>:</td>
601
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The default payment gateway selected in Give settings.', 'give')); ?></td>
602
+			<td><?php echo esc_html( ! empty($default_gateway) ? $default_gateway : '&ndash;'); ?></td>
604 603
 		</tr>
605 604
 		<tr>
606
-			<td data-export-label="PayPal IPN Verification"><?php _e( 'PayPal IPN Verification', 'give' ); ?>:</td>
607
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether admins requires verification of IPN notifications with PayPal.', 'give' ) ); ?></td>
608
-			<td><?php echo 'enabled' === give_get_option( 'paypal_verification' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
605
+			<td data-export-label="PayPal IPN Verification"><?php _e('PayPal IPN Verification', 'give'); ?>:</td>
606
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether admins requires verification of IPN notifications with PayPal.', 'give')); ?></td>
607
+			<td><?php echo 'enabled' === give_get_option('paypal_verification') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td>
609 608
 		</tr>
610 609
 		<tr>
611
-			<td data-export-label="PayPal IPN Notifications"><?php _e( 'PayPal IPN Notifications', 'give' ); ?>:</td>
612
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Displays whether when last PayPal IPN is received with which donation or transaction.', 'give' ) ); ?></td>
610
+			<td data-export-label="PayPal IPN Notifications"><?php _e('PayPal IPN Notifications', 'give'); ?>:</td>
611
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Displays whether when last PayPal IPN is received with which donation or transaction.', 'give')); ?></td>
613 612
 			<td>
614 613
 				<?php
615
-				$last_paypal_ipn_received = get_option( 'give_last_paypal_ipn_received' );
616
-				if ( is_array( $last_paypal_ipn_received ) && count( $last_paypal_ipn_received ) > 0 ) {
614
+				$last_paypal_ipn_received = get_option('give_last_paypal_ipn_received');
615
+				if (is_array($last_paypal_ipn_received) && count($last_paypal_ipn_received) > 0) {
617 616
 					$donation_id     = $last_paypal_ipn_received['payment_id'];
618
-					$ipn_timestamp   = give_get_meta( $donation_id, 'give_last_paypal_ipn_received', true );
619
-					$transaction_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=' . $last_paypal_ipn_received['transaction_id'];
620
-					$donation_url    = site_url() . '/wp-admin/edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $donation_id;
617
+					$ipn_timestamp   = give_get_meta($donation_id, 'give_last_paypal_ipn_received', true);
618
+					$transaction_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id='.$last_paypal_ipn_received['transaction_id'];
619
+					$donation_url    = site_url().'/wp-admin/edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$donation_id;
621 620
 					echo sprintf(
622
-						__( 'IPN received for <a href="%s">#%s</a> ( <a href="%s" target="_blank">%s</a> ) on %s at %s. Status %s', 'give' ),
621
+						__('IPN received for <a href="%s">#%s</a> ( <a href="%s" target="_blank">%s</a> ) on %s at %s. Status %s', 'give'),
623 622
 						$donation_url,
624 623
 						$donation_id,
625 624
 						$transaction_url,
626 625
 						$last_paypal_ipn_received['transaction_id'],
627
-						date_i18n( 'm/d/Y', $ipn_timestamp ),
628
-						date_i18n( 'H:i', $ipn_timestamp ),
626
+						date_i18n('m/d/Y', $ipn_timestamp),
627
+						date_i18n('H:i', $ipn_timestamp),
629 628
 						$last_paypal_ipn_received['auth_status']
630 629
 					);
631 630
 				} else {
@@ -635,9 +634,9 @@  discard block
 block discarded – undo
635 634
 			</td>
636 635
 		</tr>
637 636
 		<tr>
638
-			<td data-export-label="Donor Email Access"><?php _e( 'Donor Email Access', 'give' ); ?>:</td>
639
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether donors can access their donation history using only email.', 'give' ) ); ?></td>
640
-			<td><?php echo 'enabled' === give_get_option( 'email_access' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
637
+			<td data-export-label="Donor Email Access"><?php _e('Donor Email Access', 'give'); ?>:</td>
638
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether donors can access their donation history using only email.', 'give')); ?></td>
639
+			<td><?php echo 'enabled' === give_get_option('email_access') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td>
641 640
 		</tr>
642 641
 	</tbody>
643 642
 </table>
@@ -645,45 +644,45 @@  discard block
 block discarded – undo
645 644
 <table class="give-status-table widefat" cellspacing="0">
646 645
 	<thead>
647 646
 		<tr>
648
-			<th colspan="3" data-export-label="Session Configuration"><h2><?php _e( 'Session Configuration', 'give' ); ?></h2></th>
647
+			<th colspan="3" data-export-label="Session Configuration"><h2><?php _e('Session Configuration', 'give'); ?></h2></th>
649 648
 		</tr>
650 649
 	</thead>
651 650
 	<tbody>
652 651
 		<tr>
653
-			<td data-export-label="Give Use Sessions"><?php _e( 'Give Use Sessions', 'give' ); ?>:</td>
654
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether PHP sessions are enforced, enabled, or disabled.', 'give' ) ); ?></td>
655
-			<td><?php echo defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? __( 'Enforced', 'give' ) : ( Give()->session->use_php_sessions() ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ) ); ?></td>
652
+			<td data-export-label="Give Use Sessions"><?php _e('Give Use Sessions', 'give'); ?>:</td>
653
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether PHP sessions are enforced, enabled, or disabled.', 'give')); ?></td>
654
+			<td><?php echo defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? __('Enforced', 'give') : (Give()->session->use_php_sessions() ? __('Enabled', 'give') : __('Disabled', 'give')); ?></td>
656 655
 		</tr>
657 656
 		<tr>
658
-			<td data-export-label="Session"><?php _e( 'Session', 'give' ); ?>:</td>
659
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether a PHP session is currently set.', 'give' ) ); ?></td>
660
-			<td><?php echo isset( $_SESSION ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
657
+			<td data-export-label="Session"><?php _e('Session', 'give'); ?>:</td>
658
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether a PHP session is currently set.', 'give')); ?></td>
659
+			<td><?php echo isset($_SESSION) ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td>
661 660
 		</tr>
662
-		<?php if ( isset( $_SESSION ) ) { ?>
661
+		<?php if (isset($_SESSION)) { ?>
663 662
 			<tr>
664
-				<td data-export-label="Session Name"><?php _e( 'Session Name', 'give' ); ?>:</td>
665
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The name of the current PHP session.', 'give' ) ); ?></td>
666
-				<td><?php echo esc_html( ini_get( 'session.name' ) ); ?></td>
663
+				<td data-export-label="Session Name"><?php _e('Session Name', 'give'); ?>:</td>
664
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The name of the current PHP session.', 'give')); ?></td>
665
+				<td><?php echo esc_html(ini_get('session.name')); ?></td>
667 666
 			</tr>
668 667
 			<tr>
669
-				<td data-export-label="Cookie Path"><?php _e( 'Cookie Path', 'give' ); ?>:</td>
670
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The cookie path of the current PHP session.', 'give' ) ); ?></td>
671
-				<td><?php echo esc_html( ini_get( 'session.cookie_path' ) ); ?></td>
668
+				<td data-export-label="Cookie Path"><?php _e('Cookie Path', 'give'); ?>:</td>
669
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The cookie path of the current PHP session.', 'give')); ?></td>
670
+				<td><?php echo esc_html(ini_get('session.cookie_path')); ?></td>
672 671
 			</tr>
673 672
 			<tr>
674
-				<td data-export-label="Save Path"><?php _e( 'Save Path', 'give' ); ?>:</td>
675
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The save path of the current PHP session.', 'give' ) ); ?></td>
676
-				<td><?php echo esc_html( ini_get( 'session.save_path' ) ); ?></td>
673
+				<td data-export-label="Save Path"><?php _e('Save Path', 'give'); ?>:</td>
674
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The save path of the current PHP session.', 'give')); ?></td>
675
+				<td><?php echo esc_html(ini_get('session.save_path')); ?></td>
677 676
 			</tr>
678 677
 			<tr>
679
-				<td data-export-label="Use Cookies"><?php _e( 'Use Cookies', 'give' ); ?>:</td>
680
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether the current PHP session is set to use cookies.', 'give' ) ); ?></td>
681
-				<td><?php echo ini_get( 'session.use_cookies' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
678
+				<td data-export-label="Use Cookies"><?php _e('Use Cookies', 'give'); ?>:</td>
679
+				<td class="help"><?php echo Give()->tooltips->render_help(__('Whether the current PHP session is set to use cookies.', 'give')); ?></td>
680
+				<td><?php echo ini_get('session.use_cookies') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td>
682 681
 			</tr>
683 682
 			<tr>
684
-				<td data-export-label="Use Only Cookies"><?php _e( 'Use Only Cookies', 'give' ); ?>:</td>
685
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether the current PHP session is set to use only cookies.', 'give' ) ); ?></td>
686
-				<td><?php echo ini_get( 'session.use_only_cookies' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
683
+				<td data-export-label="Use Only Cookies"><?php _e('Use Only Cookies', 'give'); ?>:</td>
684
+				<td class="help"><?php echo Give()->tooltips->render_help(__('Whether the current PHP session is set to use only cookies.', 'give')); ?></td>
685
+				<td><?php echo ini_get('session.use_only_cookies') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td>
687 686
 			</tr>
688 687
 		<?php } ?>
689 688
 	</tbody>
@@ -692,13 +691,13 @@  discard block
 block discarded – undo
692 691
 <table class="give-status-table widefat" cellspacing="0">
693 692
 	<thead>
694 693
 	<tr>
695
-		<th colspan="3" data-export-label="Active Give Add-ons"><h2><?php _e( 'Active Give Add-ons', 'give' ); ?></h2></th>
694
+		<th colspan="3" data-export-label="Active Give Add-ons"><h2><?php _e('Active Give Add-ons', 'give'); ?></h2></th>
696 695
 	</tr>
697 696
 	</thead>
698 697
 	<tbody>
699 698
 		<?php
700
-		foreach ( $plugins as $plugin_data ) {
701
-			if ( 'active' != $plugin_data['Status'] ||  'add-on' != $plugin_data['Type'] ) {
699
+		foreach ($plugins as $plugin_data) {
700
+			if ('active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type']) {
702 701
 				continue;
703 702
 			}
704 703
 
@@ -706,40 +705,40 @@  discard block
 block discarded – undo
706 705
 			$author_name = $plugin_data['Author'];
707 706
 
708 707
 			// Link the plugin name to the plugin URL if available.
709
-			if ( ! empty( $plugin_data['PluginURI'] ) ) {
708
+			if ( ! empty($plugin_data['PluginURI'])) {
710 709
 				$plugin_name = sprintf(
711 710
 					'<a href="%s" title="%s">%s</a>',
712
-					esc_url( $plugin_data['PluginURI'] ),
713
-					esc_attr__( 'Visit plugin homepage', 'give' ),
711
+					esc_url($plugin_data['PluginURI']),
712
+					esc_attr__('Visit plugin homepage', 'give'),
714 713
 					$plugin_name
715 714
 				);
716 715
 			}
717 716
 
718 717
 			// Link the author name to the author URL if available.
719
-			if ( ! empty( $plugin_data['AuthorURI'] ) ) {
718
+			if ( ! empty($plugin_data['AuthorURI'])) {
720 719
 				$author_name = sprintf(
721 720
 					'<a href="%s" title="%s">%s</a>',
722
-					esc_url( $plugin_data['AuthorURI'] ),
723
-					esc_attr__( 'Visit author homepage', 'give' ),
721
+					esc_url($plugin_data['AuthorURI']),
722
+					esc_attr__('Visit author homepage', 'give'),
724 723
 					$author_name
725 724
 				);
726 725
 			}
727 726
 			?>
728 727
 			<tr>
729
-				<td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td>
728
+				<td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td>
730 729
 				<td class="help">&nbsp;</td>
731 730
 				<td>
732 731
 					<?php
733
-					if ( true === $plugin_data['License'] ) {
734
-						echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> ' . __( 'Licensed', 'give' );
732
+					if (true === $plugin_data['License']) {
733
+						echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> '.__('Licensed', 'give');
735 734
 					} else {
736
-						echo '<mark class="error"><span class="dashicons dashicons-no-alt"></span></mark> ' . __( 'Unlicensed', 'give' );
735
+						echo '<mark class="error"><span class="dashicons dashicons-no-alt"></span></mark> '.__('Unlicensed', 'give');
737 736
 					}
738 737
 
739 738
 					echo ' &ndash; '
740
-					     . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) )
739
+					     . sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post')))
741 740
 					     . ' &ndash; '
742
-					     . esc_html( $plugin_data['Version'] );
741
+					     . esc_html($plugin_data['Version']);
743 742
 					?>
744 743
 				</td>
745 744
 			</tr>
@@ -752,18 +751,18 @@  discard block
 block discarded – undo
752 751
 <table class="give-status-table widefat" cellspacing="0">
753 752
 	<thead>
754 753
 		<tr>
755
-			<th colspan="3" data-export-label="Other Active Plugins"><h2><?php _e( 'Other Active Plugins', 'give' ); ?></h2></th>
754
+			<th colspan="3" data-export-label="Other Active Plugins"><h2><?php _e('Other Active Plugins', 'give'); ?></h2></th>
756 755
 		</tr>
757 756
 	</thead>
758 757
 	<tbody>
759 758
 		<?php
760
-		foreach ( $plugins as $plugin_data ) {
761
-			if ( 'active' != $plugin_data['Status'] ||  'other' != $plugin_data['Type'] ) {
759
+		foreach ($plugins as $plugin_data) {
760
+			if ('active' != $plugin_data['Status'] || 'other' != $plugin_data['Type']) {
762 761
 				continue;
763 762
 			}
764 763
 
765 764
 			// Do not show Give core plugin.
766
-			if ( 'Give - Donation Plugin' === $plugin_data['Name'] ) {
765
+			if ('Give - Donation Plugin' === $plugin_data['Name']) {
767 766
 				continue;
768 767
 			}
769 768
 
@@ -771,29 +770,29 @@  discard block
 block discarded – undo
771 770
 			$author_name = $plugin_data['Author'];
772 771
 
773 772
 			// Link the plugin name to the plugin URL if available.
774
-			if ( ! empty( $plugin_data['PluginURI'] ) ) {
773
+			if ( ! empty($plugin_data['PluginURI'])) {
775 774
 				$plugin_name = sprintf(
776 775
 					'<a href="%s" title="%s">%s</a>',
777
-					esc_url( $plugin_data['PluginURI'] ),
778
-					esc_attr__( 'Visit plugin homepage', 'give' ),
776
+					esc_url($plugin_data['PluginURI']),
777
+					esc_attr__('Visit plugin homepage', 'give'),
779 778
 					$plugin_name
780 779
 				);
781 780
 			}
782 781
 
783 782
 			// Link the author name to the author URL if available.
784
-			if ( ! empty( $plugin_data['AuthorURI'] ) ) {
783
+			if ( ! empty($plugin_data['AuthorURI'])) {
785 784
 				$author_name = sprintf(
786 785
 					'<a href="%s" title="%s">%s</a>',
787
-					esc_url( $plugin_data['AuthorURI'] ),
788
-					esc_attr__( 'Visit author homepage', 'give' ),
786
+					esc_url($plugin_data['AuthorURI']),
787
+					esc_attr__('Visit author homepage', 'give'),
789 788
 					$author_name
790 789
 				);
791 790
 			}
792 791
 			?>
793 792
 			<tr>
794
-				<td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td>
793
+				<td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td>
795 794
 				<td class="help">&nbsp;</td>
796
-				<td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) . ' &ndash; ' . esc_html( $plugin_data['Version'] ); ?></td>
795
+				<td><?php echo sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))).' &ndash; '.esc_html($plugin_data['Version']); ?></td>
797 796
 			</tr>
798 797
 			<?php
799 798
 		}
@@ -804,13 +803,13 @@  discard block
 block discarded – undo
804 803
 <table class="give-status-table widefat" cellspacing="0">
805 804
 	<thead>
806 805
 		<tr>
807
-			<th colspan="3" data-export-label="Inactive Plugins"><h2><?php _e( 'Inactive Plugins', 'give' ); ?></h2></th>
806
+			<th colspan="3" data-export-label="Inactive Plugins"><h2><?php _e('Inactive Plugins', 'give'); ?></h2></th>
808 807
 		</tr>
809 808
 	</thead>
810 809
 	<tbody>
811 810
 		<?php
812
-		foreach ( $plugins as $plugin_data ) {
813
-			if ( 'inactive' != $plugin_data['Status'] ) {
811
+		foreach ($plugins as $plugin_data) {
812
+			if ('inactive' != $plugin_data['Status']) {
814 813
 				continue;
815 814
 			}
816 815
 
@@ -818,29 +817,29 @@  discard block
 block discarded – undo
818 817
 			$author_name = $plugin_data['Author'];
819 818
 
820 819
 			// Link the plugin name to the plugin URL if available.
821
-			if ( ! empty( $plugin_data['PluginURI'] ) ) {
820
+			if ( ! empty($plugin_data['PluginURI'])) {
822 821
 				$plugin_name = sprintf(
823 822
 					'<a href="%s" title="%s">%s</a>',
824
-					esc_url( $plugin_data['PluginURI'] ),
825
-					esc_attr__( 'Visit plugin homepage', 'give' ),
823
+					esc_url($plugin_data['PluginURI']),
824
+					esc_attr__('Visit plugin homepage', 'give'),
826 825
 					$plugin_name
827 826
 				);
828 827
 			}
829 828
 
830 829
 			// Link the author name to the author URL if available.
831
-			if ( ! empty( $plugin_data['AuthorURI'] ) ) {
830
+			if ( ! empty($plugin_data['AuthorURI'])) {
832 831
 				$author_name = sprintf(
833 832
 					'<a href="%s" title="%s">%s</a>',
834
-					esc_url( $plugin_data['AuthorURI'] ),
835
-					esc_attr__( 'Visit author homepage', 'give' ),
833
+					esc_url($plugin_data['AuthorURI']),
834
+					esc_attr__('Visit author homepage', 'give'),
836 835
 					$author_name
837 836
 				);
838 837
 			}
839 838
 			?>
840 839
 			<tr>
841
-				<td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td>
840
+				<td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td>
842 841
 				<td class="help">&nbsp;</td>
843
-				<td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) . ' &ndash; ' . esc_html( $plugin_data['Version'] ); ?></td>
842
+				<td><?php echo sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))).' &ndash; '.esc_html($plugin_data['Version']); ?></td>
844 843
 			</tr>
845 844
 			<?php
846 845
 		}
@@ -850,38 +849,38 @@  discard block
 block discarded – undo
850 849
 
851 850
 <?php
852 851
 $active_mu_plugins = (array) get_mu_plugins();
853
-if ( ! empty( $active_mu_plugins ) ) {
852
+if ( ! empty($active_mu_plugins)) {
854 853
 ?>
855 854
 	<table class="give-status-table widefat" cellspacing="0">
856 855
 		<thead>
857 856
 			<tr>
858
-				<th colspan="3" data-export-label="Active MU Plugins"><h2><?php _e( 'Active MU Plugins', 'give' ); ?></h2></th>
857
+				<th colspan="3" data-export-label="Active MU Plugins"><h2><?php _e('Active MU Plugins', 'give'); ?></h2></th>
859 858
 			</tr>
860 859
 		</thead>
861 860
 		<tbody>
862 861
 			<?php
863 862
 
864
-			foreach ( $active_mu_plugins as $mu_plugin_data ) {
865
-				if ( ! empty( $mu_plugin_data['Name'] ) ) {
863
+			foreach ($active_mu_plugins as $mu_plugin_data) {
864
+				if ( ! empty($mu_plugin_data['Name'])) {
866 865
 					// Link the plugin name to the plugin URL if available.
867
-					$plugin_name = esc_html( $mu_plugin_data['Name'] );
866
+					$plugin_name = esc_html($mu_plugin_data['Name']);
868 867
 
869
-					if ( ! empty( $mu_plugin_data['PluginURI'] ) ) {
868
+					if ( ! empty($mu_plugin_data['PluginURI'])) {
870 869
 						$plugin_name = sprintf(
871 870
 							'<a href="%s" title="%s">%s</a>',
872
-							esc_url( $mu_plugin_data['PluginURI'] ),
873
-							esc_attr__( 'Visit plugin homepage', 'give' ),
871
+							esc_url($mu_plugin_data['PluginURI']),
872
+							esc_attr__('Visit plugin homepage', 'give'),
874 873
 							$plugin_name
875 874
 						);
876 875
 					}
877 876
 
878 877
 					// Link the author name to the author URL if available.
879
-					$author_name = esc_html( $mu_plugin_data['Author'] );
878
+					$author_name = esc_html($mu_plugin_data['Author']);
880 879
 
881
-					if ( ! empty( $mu_plugin_data['AuthorURI'] ) ) {
880
+					if ( ! empty($mu_plugin_data['AuthorURI'])) {
882 881
 						$author_name = sprintf(
883 882
 							'<a href="%s">%s</a>',
884
-							esc_url( $mu_plugin_data['AuthorURI'] ),
883
+							esc_url($mu_plugin_data['AuthorURI']),
885 884
 							$author_name
886 885
 						);
887 886
 					}
@@ -889,7 +888,7 @@  discard block
 block discarded – undo
889 888
 					<tr>
890 889
 						<td><?php echo $plugin_name; ?></td>
891 890
 						<td class="help">&nbsp;</td>
892
-						<td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), $author_name ) . ' &ndash; ' . esc_html( $mu_plugin_data['Version'] ); ?></td>
891
+						<td><?php echo sprintf(_x('by %s', 'by author', 'give'), $author_name).' &ndash; '.esc_html($mu_plugin_data['Version']); ?></td>
893 892
 					</tr>
894 893
 					<?php
895 894
 				}
@@ -902,53 +901,53 @@  discard block
 block discarded – undo
902 901
 <table class="give-status-table widefat" cellspacing="0">
903 902
 	<thead>
904 903
 		<tr>
905
-			<th colspan="3" data-export-label="Theme"><h2><?php _e( 'Theme', 'give' ); ?></h2></th>
904
+			<th colspan="3" data-export-label="Theme"><h2><?php _e('Theme', 'give'); ?></h2></th>
906 905
 		</tr>
907 906
 	</thead>
908 907
 	<?php
909
-	include_once( ABSPATH . 'wp-admin/includes/theme-install.php' );
908
+	include_once(ABSPATH.'wp-admin/includes/theme-install.php');
910 909
 	$active_theme = wp_get_theme();
911 910
 	?>
912 911
 	<tbody>
913 912
 		<tr>
914
-			<td data-export-label="Name"><?php _e( 'Name', 'give' ); ?>:</td>
915
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The name of the current active theme.', 'give' )  ); ?></td>
916
-			<td><?php echo esc_html( $active_theme->Name ); ?></td>
913
+			<td data-export-label="Name"><?php _e('Name', 'give'); ?>:</td>
914
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The name of the current active theme.', 'give')); ?></td>
915
+			<td><?php echo esc_html($active_theme->Name); ?></td>
917 916
 		</tr>
918 917
 		<tr>
919
-			<td data-export-label="Version"><?php _e( 'Version', 'give' ); ?>:</td>
920
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The installed version of the current active theme.', 'give' ) ); ?></td>
921
-			<td><?php echo esc_html( $active_theme->Version ); ?></td>
918
+			<td data-export-label="Version"><?php _e('Version', 'give'); ?>:</td>
919
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The installed version of the current active theme.', 'give')); ?></td>
920
+			<td><?php echo esc_html($active_theme->Version); ?></td>
922 921
 		</tr>
923 922
 		<tr>
924
-			<td data-export-label="Author URL"><?php _e( 'Author URL', 'give' ); ?>:</td>
925
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'The theme developer\'s URL.', 'give' ) ); ?></td>
923
+			<td data-export-label="Author URL"><?php _e('Author URL', 'give'); ?>:</td>
924
+			<td class="help"><?php echo Give()->tooltips->render_help(__('The theme developer\'s URL.', 'give')); ?></td>
926 925
 			<td><?php echo $active_theme->{'Author URI'}; ?></td>
927 926
 		</tr>
928 927
 		<tr>
929
-			<td data-export-label="Child Theme"><?php _e( 'Child Theme', 'give' ); ?>:</td>
930
-			<td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether the current theme is a child theme.', 'give' ) ); ?></td>
928
+			<td data-export-label="Child Theme"><?php _e('Child Theme', 'give'); ?>:</td>
929
+			<td class="help"><?php echo Give()->tooltips->render_help(__('Whether the current theme is a child theme.', 'give')); ?></td>
931 930
 			<td><?php
932
-				echo is_child_theme() ? __( 'Yes', 'give' ) : __( 'No', 'give' ) . ' &ndash; ' . sprintf( __( 'If you\'re modifying Give on a parent theme you didn\'t build personally, then we recommend using a child theme. See: <a href="%s" target="_blank">How to Create a Child Theme</a>', 'give' ), 'https://codex.wordpress.org/Child_Themes' );
931
+				echo is_child_theme() ? __('Yes', 'give') : __('No', 'give').' &ndash; '.sprintf(__('If you\'re modifying Give on a parent theme you didn\'t build personally, then we recommend using a child theme. See: <a href="%s" target="_blank">How to Create a Child Theme</a>', 'give'), 'https://codex.wordpress.org/Child_Themes');
933 932
 				?></td>
934 933
 		</tr>
935 934
 		<?php
936
-		if( is_child_theme() ) {
937
-			$parent_theme = wp_get_theme( $active_theme->Template );
935
+		if (is_child_theme()) {
936
+			$parent_theme = wp_get_theme($active_theme->Template);
938 937
 		?>
939 938
 			<tr>
940
-				<td data-export-label="Parent Theme Name"><?php _e( 'Parent Theme Name', 'give' ); ?>:</td>
941
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The name of the parent theme.', 'give' ) ); ?></td>
942
-				<td><?php echo esc_html( $parent_theme->Name ); ?></td>
939
+				<td data-export-label="Parent Theme Name"><?php _e('Parent Theme Name', 'give'); ?>:</td>
940
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The name of the parent theme.', 'give')); ?></td>
941
+				<td><?php echo esc_html($parent_theme->Name); ?></td>
943 942
 			</tr>
944 943
 			<tr>
945
-				<td data-export-label="Parent Theme Version"><?php _e( 'Parent Theme Version', 'give' ); ?>:</td>
946
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The installed version of the parent theme.', 'give' ) ); ?></td>
947
-				<td><?php echo esc_html( $parent_theme->Version ); ?></td>
944
+				<td data-export-label="Parent Theme Version"><?php _e('Parent Theme Version', 'give'); ?>:</td>
945
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The installed version of the parent theme.', 'give')); ?></td>
946
+				<td><?php echo esc_html($parent_theme->Version); ?></td>
948 947
 			</tr>
949 948
 			<tr>
950
-				<td data-export-label="Parent Theme Author URL"><?php _e( 'Parent Theme Author URL', 'give' ); ?>:</td>
951
-				<td class="help"><?php echo Give()->tooltips->render_help( __( 'The parent theme developers URL.', 'give' ) ); ?></td>
949
+				<td data-export-label="Parent Theme Author URL"><?php _e('Parent Theme Author URL', 'give'); ?>:</td>
950
+				<td class="help"><?php echo Give()->tooltips->render_help(__('The parent theme developers URL.', 'give')); ?></td>
952 951
 				<td><?php echo $parent_theme->{'Author URI'}; ?></td>
953 952
 			</tr>
954 953
 		<?php } ?>
Please login to merge, or discard this patch.
includes/gateways/paypal-standard.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
  *
566 566
  * @since 1.6.3
567 567
  *
568
- * @param $pending_reason
568
+ * @param string $pending_reason
569 569
  *
570 570
  * @return string
571 571
  */
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
  * @param int   $payment_id   Payment ID
643 643
  * @param array $payment_data Array of payment data.
644 644
  *
645
- * @return mixed|string
645
+ * @return string
646 646
  */
647 647
 function give_build_paypal_url( $payment_id, $payment_data ) {
648 648
 	// Only send to PayPal if the pending payment is created successfully.
Please login to merge, or discard this patch.
Spacing   +156 added lines, -156 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.0
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
  *
23 23
  * @return bool
24 24
  */
25
-function give_paypal_standard_billing_fields( $form_id ) {
25
+function give_paypal_standard_billing_fields($form_id) {
26 26
 
27
-	if ( give_is_setting_enabled( give_get_option( 'paypal_standard_billing_details' ) ) ) {
28
-		give_default_cc_address_fields( $form_id );
27
+	if (give_is_setting_enabled(give_get_option('paypal_standard_billing_details'))) {
28
+		give_default_cc_address_fields($form_id);
29 29
 
30 30
 		return true;
31 31
 	}
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 }
36 36
 
37
-add_action( 'give_paypal_cc_form', 'give_paypal_standard_billing_fields' );
37
+add_action('give_paypal_cc_form', 'give_paypal_standard_billing_fields');
38 38
 
39 39
 /**
40 40
  * Process PayPal Payment.
@@ -45,28 +45,28 @@  discard block
 block discarded – undo
45 45
  *
46 46
  * @return void
47 47
  */
48
-function give_process_paypal_payment( $payment_data ) {
48
+function give_process_paypal_payment($payment_data) {
49 49
 
50 50
 	// Validate nonce.
51
-	give_validate_nonce( $payment_data['gateway_nonce'], 'give-gateway' );
51
+	give_validate_nonce($payment_data['gateway_nonce'], 'give-gateway');
52 52
 
53
-	$payment_id = give_create_payment( $payment_data );
53
+	$payment_id = give_create_payment($payment_data);
54 54
 
55 55
 	// Check payment.
56
-	if ( empty( $payment_id ) ) {
56
+	if (empty($payment_id)) {
57 57
 		// Record the error.
58
-		give_record_gateway_error( __( 'Payment Error', 'give' ), sprintf( /* translators: %s: payment data */
59
-			__( 'Payment creation failed before sending donor to PayPal. Payment data: %s', 'give' ), json_encode( $payment_data ) ), $payment_id );
58
+		give_record_gateway_error(__('Payment Error', 'give'), sprintf( /* translators: %s: payment data */
59
+			__('Payment creation failed before sending donor to PayPal. Payment data: %s', 'give'), json_encode($payment_data) ), $payment_id);
60 60
 		// Problems? Send back.
61
-		give_send_back_to_checkout( '?payment-mode=' . $payment_data['post_data']['give-gateway'] );
61
+		give_send_back_to_checkout('?payment-mode='.$payment_data['post_data']['give-gateway']);
62 62
 	}
63 63
 
64 64
 	// Redirect to PayPal.
65
-	wp_redirect( give_build_paypal_url( $payment_id, $payment_data ) );
65
+	wp_redirect(give_build_paypal_url($payment_id, $payment_data));
66 66
 	exit;
67 67
 }
68 68
 
69
-add_action( 'give_gateway_paypal', 'give_process_paypal_payment' );
69
+add_action('give_gateway_paypal', 'give_process_paypal_payment');
70 70
 
71 71
 /**
72 72
  * Listens for a PayPal IPN requests and then sends to the processing function.
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
 function give_listen_for_paypal_ipn() {
78 78
 
79 79
 	// Regular PayPal IPN.
80
-	if ( isset( $_GET['give-listener'] ) && 'IPN' === $_GET['give-listener'] ) {
80
+	if (isset($_GET['give-listener']) && 'IPN' === $_GET['give-listener']) {
81 81
 		/**
82 82
 		 * Fires while verifying PayPal IPN
83 83
 		 *
84 84
 		 * @since 1.0
85 85
 		 */
86
-		do_action( 'give_verify_paypal_ipn' );
86
+		do_action('give_verify_paypal_ipn');
87 87
 	}
88 88
 }
89 89
 
90
-add_action( 'init', 'give_listen_for_paypal_ipn' );
90
+add_action('init', 'give_listen_for_paypal_ipn');
91 91
 
92 92
 /**
93 93
  * Process PayPal IPN
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 function give_process_paypal_ipn() {
99 99
 
100 100
 	// Check the request method is POST.
101
-	if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
101
+	if (isset($_SERVER['REQUEST_METHOD']) && 'POST' !== $_SERVER['REQUEST_METHOD']) {
102 102
 		return;
103 103
 	}
104 104
 
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 	$post_data = '';
107 107
 
108 108
 	// Fallback just in case post_max_size is lower than needed.
109
-	if ( ini_get( 'allow_url_fopen' ) ) {
110
-		$post_data = file_get_contents( 'php://input' );
109
+	if (ini_get('allow_url_fopen')) {
110
+		$post_data = file_get_contents('php://input');
111 111
 	} else {
112 112
 		// If allow_url_fopen is not enabled, then make sure that post_max_size is large enough.
113
-		ini_set( 'post_max_size', '12M' );
113
+		ini_set('post_max_size', '12M');
114 114
 	}
115 115
 	// Start the encoded data collection with notification command.
116 116
 	$encoded_data = 'cmd=_notify-validate';
@@ -119,41 +119,41 @@  discard block
 block discarded – undo
119 119
 	$arg_separator = give_get_php_arg_separator_output();
120 120
 
121 121
 	// Verify there is a post_data.
122
-	if ( $post_data || strlen( $post_data ) > 0 ) {
122
+	if ($post_data || strlen($post_data) > 0) {
123 123
 		// Append the data.
124
-		$encoded_data .= $arg_separator . $post_data;
124
+		$encoded_data .= $arg_separator.$post_data;
125 125
 	} else {
126 126
 		// Check if POST is empty.
127
-		if ( empty( $_POST ) ) {
127
+		if (empty($_POST)) {
128 128
 			// Nothing to do.
129 129
 			return;
130 130
 		} else {
131 131
 			// Loop through each POST.
132
-			foreach ( $_POST as $key => $value ) {
132
+			foreach ($_POST as $key => $value) {
133 133
 				// Encode the value and append the data.
134
-				$encoded_data .= $arg_separator . "$key=" . urlencode( $value );
134
+				$encoded_data .= $arg_separator."$key=".urlencode($value);
135 135
 			}
136 136
 		}
137 137
 	}
138 138
 
139 139
 	// Convert collected post data to an array.
140
-	parse_str( $encoded_data, $encoded_data_array );
140
+	parse_str($encoded_data, $encoded_data_array);
141 141
 
142
-	foreach ( $encoded_data_array as $key => $value ) {
142
+	foreach ($encoded_data_array as $key => $value) {
143 143
 
144
-		if ( false !== strpos( $key, 'amp;' ) ) {
145
-			$new_key = str_replace( '&amp;', '&', $key );
146
-			$new_key = str_replace( 'amp;', '&', $new_key );
144
+		if (false !== strpos($key, 'amp;')) {
145
+			$new_key = str_replace('&amp;', '&', $key);
146
+			$new_key = str_replace('amp;', '&', $new_key);
147 147
 
148
-			unset( $encoded_data_array[ $key ] );
149
-			$encoded_data_array[ $new_key ] = $value;
148
+			unset($encoded_data_array[$key]);
149
+			$encoded_data_array[$new_key] = $value;
150 150
 		}
151 151
 	}
152 152
 
153 153
 	$api_response = false;
154 154
 
155 155
 	// Validate IPN request w/ PayPal if user hasn't disabled this security measure.
156
-	if ( give_is_setting_enabled( give_get_option( 'paypal_verification' ) ) ) {
156
+	if (give_is_setting_enabled(give_get_option('paypal_verification'))) {
157 157
 
158 158
 		$remote_post_vars = array(
159 159
 			'method'      => 'POST',
@@ -173,25 +173,25 @@  discard block
 block discarded – undo
173 173
 		);
174 174
 
175 175
 		// Validate the IPN.
176
-		$api_response = wp_remote_post( give_get_paypal_redirect(), $remote_post_vars );
176
+		$api_response = wp_remote_post(give_get_paypal_redirect(), $remote_post_vars);
177 177
 
178
-		if ( is_wp_error( $api_response ) ) {
179
-			give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */
180
-				__( 'Invalid IPN verification response. IPN data: %s', 'give' ), json_encode( $api_response ) ) );
178
+		if (is_wp_error($api_response)) {
179
+			give_record_gateway_error(__('IPN Error', 'give'), sprintf( /* translators: %s: Paypal IPN response */
180
+				__('Invalid IPN verification response. IPN data: %s', 'give'), json_encode($api_response) ));
181 181
 
182 182
 			return; // Something went wrong.
183 183
 		}
184 184
 
185
-		if ( 'VERIFIED' !== $api_response['body'] ) {
186
-			give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */
187
-				__( 'Invalid IPN verification response. IPN data: %s', 'give' ), json_encode( $api_response ) ) );
185
+		if ('VERIFIED' !== $api_response['body']) {
186
+			give_record_gateway_error(__('IPN Error', 'give'), sprintf( /* translators: %s: Paypal IPN response */
187
+				__('Invalid IPN verification response. IPN data: %s', 'give'), json_encode($api_response) ));
188 188
 
189 189
 			return; // Response not okay.
190 190
 		}
191 191
 	}// End if().
192 192
 
193 193
 	// Check if $post_data_array has been populated.
194
-	if ( ! is_array( $encoded_data_array ) && ! empty( $encoded_data_array ) ) {
194
+	if ( ! is_array($encoded_data_array) && ! empty($encoded_data_array)) {
195 195
 		return;
196 196
 	}
197 197
 
@@ -200,28 +200,28 @@  discard block
 block discarded – undo
200 200
 		'payment_status' => '',
201 201
 	);
202 202
 
203
-	$encoded_data_array = wp_parse_args( $encoded_data_array, $defaults );
203
+	$encoded_data_array = wp_parse_args($encoded_data_array, $defaults);
204 204
 
205
-	$payment_id = isset( $encoded_data_array['custom'] ) ? absint( $encoded_data_array['custom'] ) : 0;
205
+	$payment_id = isset($encoded_data_array['custom']) ? absint($encoded_data_array['custom']) : 0;
206 206
 	$txn_type   = $encoded_data_array['txn_type'];
207 207
 
208 208
 	// Check for PayPal IPN Notifications and update data based on it.
209
-	$current_timestamp = current_time( 'timestamp' );
209
+	$current_timestamp = current_time('timestamp');
210 210
 	$paypal_ipn_vars   = array(
211
-		'auth_status'    => isset( $api_response['body'] ) ? $api_response['body'] : 'N/A',
212
-		'transaction_id' => isset( $encoded_data_array['txn_id'] ) ? $encoded_data_array['txn_id'] : 'N/A',
211
+		'auth_status'    => isset($api_response['body']) ? $api_response['body'] : 'N/A',
212
+		'transaction_id' => isset($encoded_data_array['txn_id']) ? $encoded_data_array['txn_id'] : 'N/A',
213 213
 		'payment_id'     => $payment_id,
214 214
 	);
215
-	update_option( 'give_last_paypal_ipn_received', $paypal_ipn_vars );
216
-	give_insert_payment_note( $payment_id, sprintf(
217
-			__( 'IPN received on %s at %s', 'give' ),
218
-			date_i18n( 'm/d/Y', $current_timestamp ),
219
-			date_i18n( 'H:i', $current_timestamp )
215
+	update_option('give_last_paypal_ipn_received', $paypal_ipn_vars);
216
+	give_insert_payment_note($payment_id, sprintf(
217
+			__('IPN received on %s at %s', 'give'),
218
+			date_i18n('m/d/Y', $current_timestamp),
219
+			date_i18n('H:i', $current_timestamp)
220 220
 		)
221 221
 	);
222
-	give_update_meta( $payment_id, 'give_last_paypal_ipn_received', $current_timestamp );
222
+	give_update_meta($payment_id, 'give_last_paypal_ipn_received', $current_timestamp);
223 223
 
224
-	if ( has_action( 'give_paypal_' . $txn_type ) ) {
224
+	if (has_action('give_paypal_'.$txn_type)) {
225 225
 		/**
226 226
 		 * Fires while processing PayPal IPN $txn_type.
227 227
 		 *
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 * @param array $encoded_data_array Encoded data.
233 233
 		 * @param int   $payment_id         Payment id.
234 234
 		 */
235
-		do_action( "give_paypal_{$txn_type}", $encoded_data_array, $payment_id );
235
+		do_action("give_paypal_{$txn_type}", $encoded_data_array, $payment_id);
236 236
 	} else {
237 237
 		/**
238 238
 		 * Fires while process PayPal IPN.
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
 		 * @param array $encoded_data_array Encoded data.
245 245
 		 * @param int   $payment_id         Payment id.
246 246
 		 */
247
-		do_action( 'give_paypal_web_accept', $encoded_data_array, $payment_id );
247
+		do_action('give_paypal_web_accept', $encoded_data_array, $payment_id);
248 248
 	}
249 249
 	exit;
250 250
 }
251 251
 
252
-add_action( 'give_verify_paypal_ipn', 'give_process_paypal_ipn' );
252
+add_action('give_verify_paypal_ipn', 'give_process_paypal_ipn');
253 253
 
254 254
 /**
255 255
  * Process web accept (one time) payment IPNs.
@@ -261,99 +261,99 @@  discard block
 block discarded – undo
261 261
  *
262 262
  * @return void
263 263
  */
264
-function give_process_paypal_web_accept( $data, $payment_id ) {
264
+function give_process_paypal_web_accept($data, $payment_id) {
265 265
 
266 266
 	// Only allow through these transaction types.
267
-	if ( 'web_accept' !== $data['txn_type'] && 'cart' !== $data['txn_type'] && 'refunded' !== strtolower( $data['payment_status'] ) ) {
267
+	if ('web_accept' !== $data['txn_type'] && 'cart' !== $data['txn_type'] && 'refunded' !== strtolower($data['payment_status'])) {
268 268
 		return;
269 269
 	}
270 270
 
271 271
 	// Need $payment_id to continue.
272
-	if ( empty( $payment_id ) ) {
272
+	if (empty($payment_id)) {
273 273
 		return;
274 274
 	}
275 275
 
276 276
 	// Collect donation payment details.
277 277
 	$paypal_amount  = $data['mc_gross'];
278
-	$payment_status = strtolower( $data['payment_status'] );
279
-	$currency_code  = strtolower( $data['mc_currency'] );
280
-	$business_email = isset( $data['business'] ) && is_email( $data['business'] ) ? trim( $data['business'] ) : trim( $data['receiver_email'] );
281
-	$payment_meta   = give_get_payment_meta( $payment_id );
278
+	$payment_status = strtolower($data['payment_status']);
279
+	$currency_code  = strtolower($data['mc_currency']);
280
+	$business_email = isset($data['business']) && is_email($data['business']) ? trim($data['business']) : trim($data['receiver_email']);
281
+	$payment_meta   = give_get_payment_meta($payment_id);
282 282
 
283 283
 	// Must be a PayPal standard IPN.
284
-	if ( 'paypal' !== give_get_payment_gateway( $payment_id ) ) {
284
+	if ('paypal' !== give_get_payment_gateway($payment_id)) {
285 285
 		return;
286 286
 	}
287 287
 
288 288
 	// Verify payment recipient.
289
-	if ( strcasecmp( $business_email, trim( give_get_option( 'paypal_email' ) ) ) !== 0 ) {
289
+	if (strcasecmp($business_email, trim(give_get_option('paypal_email'))) !== 0) {
290 290
 
291
-		give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */
292
-			__( 'Invalid business email in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id );
293
-		give_update_payment_status( $payment_id, 'failed' );
294
-		give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid PayPal business email.', 'give' ) );
291
+		give_record_gateway_error(__('IPN Error', 'give'), sprintf( /* translators: %s: Paypal IPN response */
292
+			__('Invalid business email in IPN response. IPN data: %s', 'give'), json_encode($data) ), $payment_id);
293
+		give_update_payment_status($payment_id, 'failed');
294
+		give_insert_payment_note($payment_id, __('Payment failed due to invalid PayPal business email.', 'give'));
295 295
 
296 296
 		return;
297 297
 	}
298 298
 
299 299
 	// Verify payment currency.
300
-	if ( $currency_code !== strtolower( $payment_meta['currency'] ) ) {
300
+	if ($currency_code !== strtolower($payment_meta['currency'])) {
301 301
 
302
-		give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */
303
-			__( 'Invalid currency in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id );
304
-		give_update_payment_status( $payment_id, 'failed' );
305
-		give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid currency in PayPal IPN.', 'give' ) );
302
+		give_record_gateway_error(__('IPN Error', 'give'), sprintf( /* translators: %s: Paypal IPN response */
303
+			__('Invalid currency in IPN response. IPN data: %s', 'give'), json_encode($data) ), $payment_id);
304
+		give_update_payment_status($payment_id, 'failed');
305
+		give_insert_payment_note($payment_id, __('Payment failed due to invalid currency in PayPal IPN.', 'give'));
306 306
 
307 307
 		return;
308 308
 	}
309 309
 
310 310
 	// Process refunds & reversed.
311
-	if ( 'refunded' === $payment_status || 'reversed' === $payment_status ) {
312
-		give_process_paypal_refund( $data, $payment_id );
311
+	if ('refunded' === $payment_status || 'reversed' === $payment_status) {
312
+		give_process_paypal_refund($data, $payment_id);
313 313
 
314 314
 		return;
315 315
 	}
316 316
 
317 317
 	// Only complete payments once.
318
-	if ( 'publish' === get_post_status( $payment_id ) ) {
318
+	if ('publish' === get_post_status($payment_id)) {
319 319
 		return;
320 320
 	}
321 321
 
322 322
 	// Retrieve the total donation amount (before PayPal).
323
-	$payment_amount = give_donation_amount( $payment_id );
323
+	$payment_amount = give_donation_amount($payment_id);
324 324
 
325 325
 	// Check that the donation PP and local db amounts match.
326
-	if ( number_format( (float) $paypal_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) {
326
+	if (number_format((float) $paypal_amount, 2) < number_format((float) $payment_amount, 2)) {
327 327
 		// The prices don't match
328
-		give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */
329
-			__( 'Invalid payment amount in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id );
330
-		give_update_payment_status( $payment_id, 'failed' );
331
-		give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid amount in PayPal IPN.', 'give' ) );
328
+		give_record_gateway_error(__('IPN Error', 'give'), sprintf( /* translators: %s: Paypal IPN response */
329
+			__('Invalid payment amount in IPN response. IPN data: %s', 'give'), json_encode($data) ), $payment_id);
330
+		give_update_payment_status($payment_id, 'failed');
331
+		give_insert_payment_note($payment_id, __('Payment failed due to invalid amount in PayPal IPN.', 'give'));
332 332
 
333 333
 		return;
334 334
 	}
335 335
 
336 336
 	// Process completed donations.
337
-	if ( 'completed' === $payment_status || give_is_test_mode() ) {
337
+	if ('completed' === $payment_status || give_is_test_mode()) {
338 338
 
339
-		give_insert_payment_note( $payment_id, sprintf( /* translators: %s: Paypal transaction ID */
340
-			__( 'PayPal Transaction ID: %s', 'give' ), $data['txn_id'] ) );
341
-		give_set_payment_transaction_id( $payment_id, $data['txn_id'] );
342
-		give_update_payment_status( $payment_id, 'publish' );
339
+		give_insert_payment_note($payment_id, sprintf( /* translators: %s: Paypal transaction ID */
340
+			__('PayPal Transaction ID: %s', 'give'), $data['txn_id'] ));
341
+		give_set_payment_transaction_id($payment_id, $data['txn_id']);
342
+		give_update_payment_status($payment_id, 'publish');
343 343
 
344
-	} elseif ( 'pending' === $payment_status && isset( $data['pending_reason'] ) ) {
344
+	} elseif ('pending' === $payment_status && isset($data['pending_reason'])) {
345 345
 
346 346
 		// Look for possible pending reasons, such as an echeck.
347
-		$note = give_paypal_get_pending_donation_note( strtolower( $data['pending_reason'] ) );
347
+		$note = give_paypal_get_pending_donation_note(strtolower($data['pending_reason']));
348 348
 
349
-		if ( ! empty( $note ) ) {
350
-			give_insert_payment_note( $payment_id, $note );
349
+		if ( ! empty($note)) {
350
+			give_insert_payment_note($payment_id, $note);
351 351
 		}
352 352
 	}
353 353
 
354 354
 }
355 355
 
356
-add_action( 'give_paypal_web_accept', 'give_process_paypal_web_accept', 10, 2 );
356
+add_action('give_paypal_web_accept', 'give_process_paypal_web_accept', 10, 2);
357 357
 
358 358
 /**
359 359
  * Process PayPal IPN Refunds
@@ -365,35 +365,35 @@  discard block
 block discarded – undo
365 365
  *
366 366
  * @return void
367 367
  */
368
-function give_process_paypal_refund( $data, $payment_id = 0 ) {
368
+function give_process_paypal_refund($data, $payment_id = 0) {
369 369
 
370 370
 	// Collect payment details.
371
-	if ( empty( $payment_id ) ) {
371
+	if (empty($payment_id)) {
372 372
 		return;
373 373
 	}
374 374
 
375 375
 	// Only refund payments once.
376
-	if ( 'refunded' === get_post_status( $payment_id ) ) {
376
+	if ('refunded' === get_post_status($payment_id)) {
377 377
 		return;
378 378
 	}
379 379
 
380
-	$payment_amount = give_donation_amount( $payment_id );
380
+	$payment_amount = give_donation_amount($payment_id);
381 381
 	$refund_amount  = $data['payment_gross'] * - 1;
382 382
 
383
-	if ( number_format( (float) $refund_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) {
383
+	if (number_format((float) $refund_amount, 2) < number_format((float) $payment_amount, 2)) {
384 384
 
385
-		give_insert_payment_note( $payment_id, sprintf( /* translators: %s: Paypal parent transaction ID */
386
-			__( 'Partial PayPal refund processed: %s', 'give' ), $data['parent_txn_id'] ) );
385
+		give_insert_payment_note($payment_id, sprintf( /* translators: %s: Paypal parent transaction ID */
386
+			__('Partial PayPal refund processed: %s', 'give'), $data['parent_txn_id'] ));
387 387
 
388 388
 		return; // This is a partial refund
389 389
 
390 390
 	}
391 391
 
392
-	give_insert_payment_note( $payment_id, sprintf( /* translators: 1: Paypal parent transaction ID 2. Paypal reason code */
393
-		__( 'PayPal Payment #%1$s Refunded for reason: %2$s', 'give' ), $data['parent_txn_id'], $data['reason_code'] ) );
394
-	give_insert_payment_note( $payment_id, sprintf( /* translators: %s: Paypal transaction ID */
395
-		__( 'PayPal Refund Transaction ID: %s', 'give' ), $data['txn_id'] ) );
396
-	give_update_payment_status( $payment_id, 'refunded' );
392
+	give_insert_payment_note($payment_id, sprintf( /* translators: 1: Paypal parent transaction ID 2. Paypal reason code */
393
+		__('PayPal Payment #%1$s Refunded for reason: %2$s', 'give'), $data['parent_txn_id'], $data['reason_code'] ));
394
+	give_insert_payment_note($payment_id, sprintf( /* translators: %s: Paypal transaction ID */
395
+		__('PayPal Refund Transaction ID: %s', 'give'), $data['txn_id'] ));
396
+	give_update_payment_status($payment_id, 'refunded');
397 397
 }
398 398
 
399 399
 /**
@@ -405,24 +405,24 @@  discard block
 block discarded – undo
405 405
  *
406 406
  * @return string
407 407
  */
408
-function give_get_paypal_redirect( $ssl_check = false ) {
408
+function give_get_paypal_redirect($ssl_check = false) {
409 409
 
410
-	if ( is_ssl() || ! $ssl_check ) {
410
+	if (is_ssl() || ! $ssl_check) {
411 411
 		$protocol = 'https://';
412 412
 	} else {
413 413
 		$protocol = 'http://';
414 414
 	}
415 415
 
416 416
 	// Check the current payment mode
417
-	if ( give_is_test_mode() ) {
417
+	if (give_is_test_mode()) {
418 418
 		// Test mode
419
-		$paypal_uri = $protocol . 'www.sandbox.paypal.com/cgi-bin/webscr';
419
+		$paypal_uri = $protocol.'www.sandbox.paypal.com/cgi-bin/webscr';
420 420
 	} else {
421 421
 		// Live mode
422
-		$paypal_uri = $protocol . 'www.paypal.com/cgi-bin/webscr';
422
+		$paypal_uri = $protocol.'www.paypal.com/cgi-bin/webscr';
423 423
 	}
424 424
 
425
-	return apply_filters( 'give_paypal_uri', $paypal_uri );
425
+	return apply_filters('give_paypal_uri', $paypal_uri);
426 426
 }
427 427
 
428 428
 /**
@@ -432,9 +432,9 @@  discard block
 block discarded – undo
432 432
  * @return string
433 433
  */
434 434
 function give_get_paypal_page_style() {
435
-	$page_style = trim( give_get_option( 'paypal_page_style', 'PayPal' ) );
435
+	$page_style = trim(give_get_option('paypal_page_style', 'PayPal'));
436 436
 
437
-	return apply_filters( 'give_paypal_page_style', $page_style );
437
+	return apply_filters('give_paypal_page_style', $page_style);
438 438
 }
439 439
 
440 440
 /**
@@ -448,26 +448,26 @@  discard block
 block discarded – undo
448 448
  *
449 449
  * @return string
450 450
  */
451
-function give_paypal_success_page_content( $content ) {
451
+function give_paypal_success_page_content($content) {
452 452
 
453
-	if ( ! isset( $_GET['payment-id'] ) && ! give_get_purchase_session() ) {
453
+	if ( ! isset($_GET['payment-id']) && ! give_get_purchase_session()) {
454 454
 		return $content;
455 455
 	}
456 456
 
457
-	$payment_id = isset( $_GET['payment-id'] ) ? absint( $_GET['payment-id'] ) : false;
457
+	$payment_id = isset($_GET['payment-id']) ? absint($_GET['payment-id']) : false;
458 458
 
459
-	if ( ! $payment_id ) {
459
+	if ( ! $payment_id) {
460 460
 		$session    = give_get_purchase_session();
461
-		$payment_id = give_get_donation_id_by_key( $session['purchase_key'] );
461
+		$payment_id = give_get_donation_id_by_key($session['purchase_key']);
462 462
 	}
463 463
 
464
-	$payment = get_post( $payment_id );
465
-	if ( $payment && 'pending' === $payment->post_status ) {
464
+	$payment = get_post($payment_id);
465
+	if ($payment && 'pending' === $payment->post_status) {
466 466
 
467 467
 		// Payment is still pending so show processing indicator to fix the race condition.
468 468
 		ob_start();
469 469
 
470
-		give_get_template_part( 'payment', 'processing' );
470
+		give_get_template_part('payment', 'processing');
471 471
 
472 472
 		$content = ob_get_clean();
473 473
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 
478 478
 }
479 479
 
480
-add_filter( 'give_payment_confirm_paypal', 'give_paypal_success_page_content' );
480
+add_filter('give_payment_confirm_paypal', 'give_paypal_success_page_content');
481 481
 
482 482
 /**
483 483
  * Given a transaction ID, generate a link to the PayPal transaction ID details
@@ -489,16 +489,16 @@  discard block
 block discarded – undo
489 489
  *
490 490
  * @return string                 A link to the PayPal transaction details
491 491
  */
492
-function give_paypal_link_transaction_id( $transaction_id, $payment_id ) {
492
+function give_paypal_link_transaction_id($transaction_id, $payment_id) {
493 493
 
494 494
 	$paypal_base_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=';
495
-	$transaction_url = '<a href="' . esc_url( $paypal_base_url . $transaction_id ) . '" target="_blank">' . $transaction_id . '</a>';
495
+	$transaction_url = '<a href="'.esc_url($paypal_base_url.$transaction_id).'" target="_blank">'.$transaction_id.'</a>';
496 496
 
497
-	return apply_filters( 'give_paypal_link_payment_details_transaction_id', $transaction_url );
497
+	return apply_filters('give_paypal_link_payment_details_transaction_id', $transaction_url);
498 498
 
499 499
 }
500 500
 
501
-add_filter( 'give_payment_details_transaction_id-paypal', 'give_paypal_link_transaction_id', 10, 2 );
501
+add_filter('give_payment_details_transaction_id-paypal', 'give_paypal_link_transaction_id', 10, 2);
502 502
 
503 503
 
504 504
 /**
@@ -510,64 +510,64 @@  discard block
 block discarded – undo
510 510
  *
511 511
  * @return string
512 512
  */
513
-function give_paypal_get_pending_donation_note( $pending_reason ) {
513
+function give_paypal_get_pending_donation_note($pending_reason) {
514 514
 
515 515
 	$note = '';
516 516
 
517
-	switch ( $pending_reason ) {
517
+	switch ($pending_reason) {
518 518
 
519 519
 		case 'echeck' :
520 520
 
521
-			$note = __( 'Payment made via eCheck and will clear automatically in 5-8 days.', 'give' );
521
+			$note = __('Payment made via eCheck and will clear automatically in 5-8 days.', 'give');
522 522
 
523 523
 			break;
524 524
 
525 525
 		case 'address' :
526 526
 
527
-			$note = __( 'Payment requires a confirmed donor address and must be accepted manually through PayPal.', 'give' );
527
+			$note = __('Payment requires a confirmed donor address and must be accepted manually through PayPal.', 'give');
528 528
 
529 529
 			break;
530 530
 
531 531
 		case 'intl' :
532 532
 
533
-			$note = __( 'Payment must be accepted manually through PayPal due to international account regulations.', 'give' );
533
+			$note = __('Payment must be accepted manually through PayPal due to international account regulations.', 'give');
534 534
 
535 535
 			break;
536 536
 
537 537
 		case 'multi-currency' :
538 538
 
539
-			$note = __( 'Payment received in non-shop currency and must be accepted manually through PayPal.', 'give' );
539
+			$note = __('Payment received in non-shop currency and must be accepted manually through PayPal.', 'give');
540 540
 
541 541
 			break;
542 542
 
543 543
 		case 'paymentreview' :
544 544
 		case 'regulatory_review' :
545 545
 
546
-			$note = __( 'Payment is being reviewed by PayPal staff as high-risk or in possible violation of government regulations.', 'give' );
546
+			$note = __('Payment is being reviewed by PayPal staff as high-risk or in possible violation of government regulations.', 'give');
547 547
 
548 548
 			break;
549 549
 
550 550
 		case 'unilateral' :
551 551
 
552
-			$note = __( 'Payment was sent to non-confirmed or non-registered email address.', 'give' );
552
+			$note = __('Payment was sent to non-confirmed or non-registered email address.', 'give');
553 553
 
554 554
 			break;
555 555
 
556 556
 		case 'upgrade' :
557 557
 
558
-			$note = __( 'PayPal account must be upgraded before this payment can be accepted.', 'give' );
558
+			$note = __('PayPal account must be upgraded before this payment can be accepted.', 'give');
559 559
 
560 560
 			break;
561 561
 
562 562
 		case 'verify' :
563 563
 
564
-			$note = __( 'PayPal account is not verified. Verify account in order to accept this donation.', 'give' );
564
+			$note = __('PayPal account is not verified. Verify account in order to accept this donation.', 'give');
565 565
 
566 566
 			break;
567 567
 
568 568
 		case 'other' :
569 569
 
570
-			$note = __( 'Payment is pending for unknown reasons. Contact PayPal support for assistance.', 'give' );
570
+			$note = __('Payment is pending for unknown reasons. Contact PayPal support for assistance.', 'give');
571 571
 
572 572
 			break;
573 573
 
@@ -585,49 +585,49 @@  discard block
 block discarded – undo
585 585
  *
586 586
  * @return mixed|string
587 587
  */
588
-function give_build_paypal_url( $payment_id, $payment_data ) {
588
+function give_build_paypal_url($payment_id, $payment_data) {
589 589
 	// Only send to PayPal if the pending payment is created successfully.
590
-	$listener_url = add_query_arg( 'give-listener', 'IPN', home_url( 'index.php' ) );
590
+	$listener_url = add_query_arg('give-listener', 'IPN', home_url('index.php'));
591 591
 
592 592
 	// Get the success url.
593
-	$return_url = add_query_arg( array(
593
+	$return_url = add_query_arg(array(
594 594
 		'payment-confirmation' => 'paypal',
595 595
 		'payment-id'           => $payment_id,
596 596
 
597
-	), get_permalink( give_get_option( 'success_page' ) ) );
597
+	), get_permalink(give_get_option('success_page')));
598 598
 
599 599
 	// Get the PayPal redirect uri.
600
-	$paypal_redirect = trailingslashit( give_get_paypal_redirect() ) . '?';
600
+	$paypal_redirect = trailingslashit(give_get_paypal_redirect()).'?';
601 601
 
602 602
 	// Item name.
603
-	$item_name = give_payment_gateway_item_title( $payment_data );
603
+	$item_name = give_payment_gateway_item_title($payment_data);
604 604
 
605 605
 	// Setup PayPal API params.
606 606
 	$paypal_args = array(
607
-		'business'      => give_get_option( 'paypal_email', false ),
607
+		'business'      => give_get_option('paypal_email', false),
608 608
 		'first_name'    => $payment_data['user_info']['first_name'],
609 609
 		'last_name'     => $payment_data['user_info']['last_name'],
610 610
 		'email'         => $payment_data['user_email'],
611 611
 		'invoice'       => $payment_data['purchase_key'],
612 612
 		'amount'        => $payment_data['price'],
613
-		'item_name'     => stripslashes( $item_name ),
613
+		'item_name'     => stripslashes($item_name),
614 614
 		'no_shipping'   => '1',
615 615
 		'shipping'      => '0',
616 616
 		'no_note'       => '1',
617
-		'currency_code' => give_get_currency( $payment_id, $payment_data ),
618
-		'charset'       => get_bloginfo( 'charset' ),
617
+		'currency_code' => give_get_currency($payment_id, $payment_data),
618
+		'charset'       => get_bloginfo('charset'),
619 619
 		'custom'        => $payment_id,
620 620
 		'rm'            => '2',
621 621
 		'return'        => $return_url,
622
-		'cancel_return' => give_get_failed_transaction_uri( '?payment-id=' . $payment_id ),
622
+		'cancel_return' => give_get_failed_transaction_uri('?payment-id='.$payment_id),
623 623
 		'notify_url'    => $listener_url,
624 624
 		'page_style'    => give_get_paypal_page_style(),
625
-		'cbt'           => get_bloginfo( 'name' ),
625
+		'cbt'           => get_bloginfo('name'),
626 626
 		'bn'            => 'givewp_SP',
627 627
 	);
628 628
 
629 629
 	// Add user address if present.
630
-	if ( ! empty( $payment_data['user_info']['address'] ) ) {
630
+	if ( ! empty($payment_data['user_info']['address'])) {
631 631
 		$default_address = array(
632 632
 			'line1'   => '',
633 633
 			'line2'   => '',
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 			'country' => '',
638 638
 		);
639 639
 
640
-		$address = wp_parse_args( $payment_data['user_info']['address'], $default_address );
640
+		$address = wp_parse_args($payment_data['user_info']['address'], $default_address);
641 641
 
642 642
 		$paypal_args['address1'] = $address['line1'];
643 643
 		$paypal_args['address2'] = $address['line2'];
@@ -658,13 +658,13 @@  discard block
 block discarded – undo
658 658
 	 *
659 659
 	 * @since 1.8
660 660
 	 */
661
-	$paypal_args = apply_filters( 'give_paypal_redirect_args', $paypal_args, $payment_data );
661
+	$paypal_args = apply_filters('give_paypal_redirect_args', $paypal_args, $payment_data);
662 662
 
663 663
 	// Build query.
664
-	$paypal_redirect .= http_build_query( $paypal_args );
664
+	$paypal_redirect .= http_build_query($paypal_args);
665 665
 
666 666
 	// Fix for some sites that encode the entities.
667
-	$paypal_redirect = str_replace( '&amp;', '&', $paypal_redirect );
667
+	$paypal_redirect = str_replace('&amp;', '&', $paypal_redirect);
668 668
 
669 669
 	return $paypal_redirect;
670 670
 }
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 function give_get_paypal_button_type() {
680 680
 	// paypal_button_type can be donation or standard.
681 681
 	$paypal_button_type = '_donations';
682
-	if ( 'standard' === give_get_option( 'paypal_button_type' ) ) {
682
+	if ('standard' === give_get_option('paypal_button_type')) {
683 683
 		$paypal_button_type = '_xclick';
684 684
 	}
685 685
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-addon.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Addon' ) ) :
16
+if ( ! class_exists('Give_Settings_Addon')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Addon.
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		 */
27 27
 		public function __construct() {
28 28
 			$this->id    = 'addons';
29
-			$this->label = esc_html__( 'Add-ons', 'give' );
29
+			$this->label = esc_html__('Add-ons', 'give');
30 30
 
31 31
 			parent::__construct();
32 32
 		}
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 		 * @param  $setting_tab
39 39
 		 * @return string
40 40
 		 */
41
-		function set_default_setting_tab( $setting_tab ) {
41
+		function set_default_setting_tab($setting_tab) {
42 42
 			$default_tab = '';
43 43
 
44 44
 			// Set default tab to first setting tab.
45
-			if( $sections = array_keys( $this->get_sections() ) ) {
46
-				$default_tab = current( $sections );
45
+			if ($sections = array_keys($this->get_sections())) {
46
+				$default_tab = current($sections);
47 47
 			}
48 48
 			return $default_tab;
49 49
 		}
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 		 * @param  array $pages Lst of pages.
56 56
 		 * @return array
57 57
 		 */
58
-		public function add_settings_page( $pages ) {
58
+		public function add_settings_page($pages) {
59 59
 			$setting = $this->get_settings();
60 60
 			// Bailout: Do not add addons setting tab if it does not contain any setting fields.
61
-			if( ! empty( $setting ) ) {
62
-				$pages[ $this->id ] = $this->label;
61
+			if ( ! empty($setting)) {
62
+				$pages[$this->id] = $this->label;
63 63
 			}
64 64
 
65 65
 			return $pages;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			 * Filter the addons settings.
79 79
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
80 80
 			 */
81
-			$settings = apply_filters( 'give_settings_addons', $settings );
81
+			$settings = apply_filters('give_settings_addons', $settings);
82 82
 
83 83
 			/**
84 84
 			 * Filter the settings.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			 * @since  1.8
87 87
 			 * @param  array $settings
88 88
 			 */
89
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
89
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
90 90
 
91 91
 			// Output.
92 92
 			return $settings;
Please login to merge, or discard this patch.