Test Failed
Push — master ( 3f7048...88589f )
by Ravinder
04:53
created
includes/admin/settings/class-settings-display.php 1 patch
Spacing   +77 added lines, -77 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_Display' ) ) :
16
+if ( ! class_exists('Give_Settings_Display')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Display.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'display';
30
-			$this->label = __( 'Display Options', 'give' );
30
+			$this->label = __('Display Options', 'give');
31 31
 
32 32
 			$this->default_tab = 'display-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings        = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'display-settings' :
49 49
 					$settings = array(
50 50
 						// Section 1: Display
@@ -53,55 +53,55 @@  discard block
 block discarded – undo
53 53
 							'type' => 'title',
54 54
 						),
55 55
 						array(
56
-							'name'    => __( 'Default Give Styles', 'give' ),
57
-							'desc'    => __( 'You can disable Give\'s default styles for donation forms and other frontend elements.', 'give' ),
56
+							'name'    => __('Default Give Styles', 'give'),
57
+							'desc'    => __('You can disable Give\'s default styles for donation forms and other frontend elements.', 'give'),
58 58
 							'id'      => 'css',
59 59
 							'type'    => 'radio_inline',
60 60
 							'default' => 'enabled',
61 61
 							'options' => array(
62
-								'enabled'  => __( 'Enabled', 'give' ),
63
-								'disabled' => __( 'Disabled', 'give' ),
62
+								'enabled'  => __('Enabled', 'give'),
63
+								'disabled' => __('Disabled', 'give'),
64 64
 							),
65 65
 						),
66 66
 						array(
67
-							'name'    => __( 'Floating Labels', 'give' ),
67
+							'name'    => __('Floating Labels', 'give'),
68 68
 							/* translators: %s: http://docs.givewp.com/form-floating-labels */
69
-							'desc'    => sprintf( wp_kses( __( '<a href="%s" target="_blank">Floating labels</a> allows your labels to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array(
69
+							'desc'    => sprintf(wp_kses(__('<a href="%s" target="_blank">Floating labels</a> allows your labels to be inset within the form fields to provide a cleaner form appearance. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array(
70 70
 								'a' => array(
71 71
 									'href'   => array(),
72 72
 									'target' => array(),
73 73
 								),
74
-							) ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
74
+							)), esc_url('http://docs.givewp.com/form-floating-labels')),
75 75
 							'id'      => 'floatlabels',
76 76
 							'type'    => 'radio_inline',
77 77
 							'default' => 'disabled',
78 78
 							'options' => array(
79
-								'enabled'  => __( 'Enabled', 'give' ),
80
-								'disabled' => __( 'Disabled', 'give' ),
79
+								'enabled'  => __('Enabled', 'give'),
80
+								'disabled' => __('Disabled', 'give'),
81 81
 							),
82 82
 						),
83 83
 						array(
84
-							'name'    => __( 'Welcome Screen', 'give' ),
84
+							'name'    => __('Welcome Screen', 'give'),
85 85
 							/* translators: %s: about page URL */
86
-							'desc'    => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give' ), array(
86
+							'desc'    => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that displays each time Give is activated or updated.', 'give'), array(
87 87
 								'a' => array(
88 88
 									'href'   => array(),
89 89
 									'target' => array(),
90 90
 								),
91
-							) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
91
+							)), esc_url(admin_url('index.php?page=give-about'))),
92 92
 							'id'      => 'welcome',
93 93
 							'type'    => 'radio_inline',
94 94
 							'default' => 'enabled',
95 95
 							'options' => array(
96
-								'enabled'  => __( 'Enabled', 'give' ),
97
-								'disabled' => __( 'Disabled', 'give' ),
96
+								'enabled'  => __('Enabled', 'give'),
97
+								'disabled' => __('Disabled', 'give'),
98 98
 							),
99 99
 						),
100 100
 						array(
101
-							'name'  => __( 'Display Settings Docs Link', 'give' ),
101
+							'name'  => __('Display Settings Docs Link', 'give'),
102 102
 							'id'    => 'display_settings_docs_link',
103
-							'url'   => esc_url( 'http://docs.givewp.com/form-display-options' ),
104
-							'title' => __( 'Display Options Settings', 'give' ),
103
+							'url'   => esc_url('http://docs.givewp.com/form-display-options'),
104
+							'title' => __('Display Options Settings', 'give'),
105 105
 							'type'  => 'give_docs_link',
106 106
 						),
107 107
 						array(
@@ -118,78 +118,78 @@  discard block
 block discarded – undo
118 118
 							'type' => 'title',
119 119
 						),
120 120
 						array(
121
-							'name'    => __( 'Form Single Views', 'give' ),
122
-							'desc'    => __( 'By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
121
+							'name'    => __('Form Single Views', 'give'),
122
+							'desc'    => __('By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
123 123
 							'id'      => 'forms_singular',
124 124
 							'type'    => 'radio_inline',
125 125
 							'default' => 'enabled',
126 126
 							'options' => array(
127
-								'enabled'  => __( 'Enabled', 'give' ),
128
-								'disabled' => __( 'Disabled', 'give' ),
127
+								'enabled'  => __('Enabled', 'give'),
128
+								'disabled' => __('Disabled', 'give'),
129 129
 							),
130 130
 						),
131 131
 						array(
132
-							'name'    => __( 'Form Archives', 'give' ),
133
-							'desc'    => sprintf( wp_kses( __( 'Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give' ), array(
132
+							'name'    => __('Form Archives', 'give'),
133
+							'desc'    => sprintf(wp_kses(__('Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to <a href="%s">refresh your permalinks</a> after this option has been enabled.', 'give'), array(
134 134
 								'a' => array(
135 135
 									'href'   => array(),
136 136
 									'target' => array(),
137 137
 								),
138
-							) ), esc_url( admin_url( 'options-permalink.php' ) ) ),
138
+							)), esc_url(admin_url('options-permalink.php'))),
139 139
 							'id'      => 'forms_archives',
140 140
 							'type'    => 'radio_inline',
141 141
 							'default' => 'enabled',
142 142
 							'options' => array(
143
-								'enabled'  => __( 'Enabled', 'give' ),
144
-								'disabled' => __( 'Disabled', 'give' ),
143
+								'enabled'  => __('Enabled', 'give'),
144
+								'disabled' => __('Disabled', 'give'),
145 145
 							),
146 146
 						),
147 147
 						array(
148
-							'name'    => __( 'Form Excerpts', 'give' ),
149
-							'desc'    => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
148
+							'name'    => __('Form Excerpts', 'give'),
149
+							'desc'    => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
150 150
 							'id'      => 'forms_excerpt',
151 151
 							'type'    => 'radio_inline',
152 152
 							'default' => 'enabled',
153 153
 							'options' => array(
154
-								'enabled'  => __( 'Enabled', 'give' ),
155
-								'disabled' => __( 'Disabled', 'give' ),
154
+								'enabled'  => __('Enabled', 'give'),
155
+								'disabled' => __('Disabled', 'give'),
156 156
 							),
157 157
 						),
158 158
 						array(
159
-							'name'    => __( 'Form Featured Image', 'give' ),
160
-							'desc'    => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
159
+							'name'    => __('Form Featured Image', 'give'),
160
+							'desc'    => __('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
161 161
 							'id'      => 'form_featured_img',
162 162
 							'type'    => 'radio_inline',
163 163
 							'default' => 'enabled',
164 164
 							'options' => array(
165
-								'enabled'  => __( 'Enabled', 'give' ),
166
-								'disabled' => __( 'Disabled', 'give' ),
165
+								'enabled'  => __('Enabled', 'give'),
166
+								'disabled' => __('Disabled', 'give'),
167 167
 							),
168 168
 						),
169 169
 						array(
170
-							'name'    => __( 'Featured Image Size', 'give' ),
171
-							'desc'    => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
170
+							'name'    => __('Featured Image Size', 'give'),
171
+							'desc'    => __('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'),
172 172
 							'id'      => 'featured_image_size',
173 173
 							'type'    => 'select',
174 174
 							'default' => 'large',
175 175
 							'options' => give_get_featured_image_sizes(),
176 176
 						),
177 177
 						array(
178
-							'name'    => __( 'Single Form Sidebar', 'give' ),
179
-							'desc'    => __( 'The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
178
+							'name'    => __('Single Form Sidebar', 'give'),
179
+							'desc'    => __('The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
180 180
 							'id'      => 'form_sidebar',
181 181
 							'type'    => 'radio_inline',
182 182
 							'default' => 'enabled',
183 183
 							'options' => array(
184
-								'enabled'  => __( 'Enabled', 'give' ),
185
-								'disabled' => __( 'Disabled', 'give' ),
184
+								'enabled'  => __('Enabled', 'give'),
185
+								'disabled' => __('Disabled', 'give'),
186 186
 							),
187 187
 						),
188 188
 						array(
189
-							'name'  => __( 'Post Types Docs Link', 'give' ),
189
+							'name'  => __('Post Types Docs Link', 'give'),
190 190
 							'id'    => 'post_types_settings_docs_link',
191
-							'url'   => esc_url( 'http://docs.givewp.com/settings-post-types' ),
192
-							'title' => __( 'Post Types Settings', 'give' ),
191
+							'url'   => esc_url('http://docs.givewp.com/settings-post-types'),
192
+							'title' => __('Post Types Settings', 'give'),
193 193
 							'type'  => 'give_docs_link',
194 194
 						),
195 195
 						array(
@@ -206,32 +206,32 @@  discard block
 block discarded – undo
206 206
 							'type' => 'title',
207 207
 						),
208 208
 						array(
209
-							'name'    => __( 'Form Categories', 'give' ),
210
-							'desc'    => __( 'Enable Categories for all Give forms.', 'give' ),
209
+							'name'    => __('Form Categories', 'give'),
210
+							'desc'    => __('Enable Categories for all Give forms.', 'give'),
211 211
 							'id'      => 'categories',
212 212
 							'type'    => 'radio_inline',
213 213
 							'default' => 'disabled',
214 214
 							'options' => array(
215
-								'enabled'  => __( 'Enabled', 'give' ),
216
-								'disabled' => __( 'Disabled', 'give' ),
215
+								'enabled'  => __('Enabled', 'give'),
216
+								'disabled' => __('Disabled', 'give'),
217 217
 							),
218 218
 						),
219 219
 						array(
220
-							'name'    => __( 'Form Tags', 'give' ),
221
-							'desc'    => __( 'Enable Tags for all Give forms.', 'give' ),
220
+							'name'    => __('Form Tags', 'give'),
221
+							'desc'    => __('Enable Tags for all Give forms.', 'give'),
222 222
 							'id'      => 'tags',
223 223
 							'type'    => 'radio_inline',
224 224
 							'default' => 'disabled',
225 225
 							'options' => array(
226
-								'enabled'  => __( 'Enabled', 'give' ),
227
-								'disabled' => __( 'Disabled', 'give' ),
226
+								'enabled'  => __('Enabled', 'give'),
227
+								'disabled' => __('Disabled', 'give'),
228 228
 							),
229 229
 						),
230 230
 						array(
231
-							'name'  => __( 'Taxonomies Docs Link', 'give' ),
231
+							'name'  => __('Taxonomies Docs Link', 'give'),
232 232
 							'id'    => 'taxonomies_settings_docs_link',
233
-							'url'   => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
234
-							'title' => __( 'Taxonomies Settings', 'give' ),
233
+							'url'   => esc_url('http://docs.givewp.com/settings-taxonomies'),
234
+							'title' => __('Taxonomies Settings', 'give'),
235 235
 							'type'  => 'give_docs_link',
236 236
 						),
237 237
 						array(
@@ -248,36 +248,36 @@  discard block
 block discarded – undo
248 248
 							'type' => 'title',
249 249
 						),
250 250
 						array(
251
-							'name'    => __( 'Terms and Conditions', 'give' ),
252
-							'desc'    => __( 'Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give' ),
251
+							'name'    => __('Terms and Conditions', 'give'),
252
+							'desc'    => __('Would you like donors to require that donors agree to your terms when donating? Note: You can enable/disable this option and customize the terms per form as well.', 'give'),
253 253
 							'id'      => 'terms',
254 254
 							'type'    => 'radio_inline',
255 255
 							'default' => 'disabled',
256 256
 							'options' => array(
257
-								'enabled'  => __( 'Enabled', 'give' ),
258
-								'disabled' => __( 'Disabled', 'give' ),
257
+								'enabled'  => __('Enabled', 'give'),
258
+								'disabled' => __('Disabled', 'give'),
259 259
 							),
260 260
 						),
261 261
 						array(
262
-							'name'       => __( 'Agree to Terms Label', 'give' ),
263
-							'desc'       => __( 'The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give' ),
262
+							'name'       => __('Agree to Terms Label', 'give'),
263
+							'desc'       => __('The label shown next to the agree to terms check box. Customize it here or leave blank to use the default placeholder text. Note: You can customize the label per form.', 'give'),
264 264
 							'id'         => 'agree_to_terms_label',
265 265
 							'attributes' => array(
266
-								'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ),
266
+								'placeholder' => esc_attr__('Agree to Terms?', 'give'),
267 267
 							),
268 268
 							'type'       => 'text',
269 269
 						),
270 270
 						array(
271
-							'name' => __( 'Agreement Text', 'give' ),
272
-							'desc' => __( 'This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give' ),
271
+							'name' => __('Agreement Text', 'give'),
272
+							'desc' => __('This is the actual text which the user will be asked to agree to in order to donate. Note: You can customize the content per form as needed.', 'give'),
273 273
 							'id'   => 'agreement_text',
274 274
 							'type' => 'wysiwyg',
275 275
 						),
276 276
 						array(
277
-							'name'  => __( 'Terms and Conditions Docs Link', 'give' ),
277
+							'name'  => __('Terms and Conditions Docs Link', 'give'),
278 278
 							'id'    => 'terms_settings_docs_link',
279
-							'url'   => esc_url( 'http://docs.givewp.com/settings-terms' ),
280
-							'title' => __( 'Terms and Conditions Settings', 'give' ),
279
+							'url'   => esc_url('http://docs.givewp.com/settings-terms'),
280
+							'title' => __('Terms and Conditions Settings', 'give'),
281 281
 							'type'  => 'give_docs_link',
282 282
 						),
283 283
 						array(
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 			 * Filter the display options settings.
293 293
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
294 294
 			 */
295
-			$settings = apply_filters( 'give_settings_display', $settings );
295
+			$settings = apply_filters('give_settings_display', $settings);
296 296
 
297 297
 			/**
298 298
 			 * Filter the settings.
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 			 *
302 302
 			 * @param  array $settings
303 303
 			 */
304
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
304
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
305 305
 
306 306
 			// Output.
307 307
 			return $settings;
@@ -315,13 +315,13 @@  discard block
 block discarded – undo
315 315
 		 */
316 316
 		public function get_sections() {
317 317
 			$sections = array(
318
-				'display-settings'    => __( 'Display', 'give' ),
319
-				'post-types'          => __( 'Post Types', 'give' ),
320
-				'taxonomies'          => __( 'Taxonomies', 'give' ),
321
-				'term-and-conditions' => __( 'Terms and Conditions', 'give' ),
318
+				'display-settings'    => __('Display', 'give'),
319
+				'post-types'          => __('Post Types', 'give'),
320
+				'taxonomies'          => __('Taxonomies', 'give'),
321
+				'term-and-conditions' => __('Terms and Conditions', 'give'),
322 322
 			);
323 323
 
324
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
324
+			return apply_filters('give_get_sections_'.$this->id, $sections);
325 325
 		}
326 326
 	}
327 327
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-general.php 1 patch
Spacing   +68 added lines, -68 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_General' ) ) :
16
+if ( ! class_exists('Give_Settings_General')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_General.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'general';
30
-			$this->label = __( 'General', 'give' );
30
+			$this->label = __('General', 'give');
31 31
 
32 32
 			$this->default_tab = 'general-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings        = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'access-control':
49 49
 					$settings = array(
50 50
 						// Section 3: Access control.
@@ -54,20 +54,20 @@  discard block
 block discarded – undo
54 54
 						),
55 55
 						array(
56 56
 							'id'      => 'session_lifetime',
57
-							'name'    => __( 'Session Lifetime', 'give' ),
58
-							'desc'    => __( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ),
57
+							'name'    => __('Session Lifetime', 'give'),
58
+							'desc'    => __('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'),
59 59
 							'type'    => 'select',
60 60
 							'options' => array(
61
-								'86400'  => __( '24 Hours', 'give' ),
62
-								'172800' => __( '48 Hours', 'give' ),
63
-								'259200' => __( '72 Hours', 'give' ),
64
-								'604800' => __( '1 Week', 'give' ),
61
+								'86400'  => __('24 Hours', 'give'),
62
+								'172800' => __('48 Hours', 'give'),
63
+								'259200' => __('72 Hours', 'give'),
64
+								'604800' => __('1 Week', 'give'),
65 65
 							),
66 66
 						),
67 67
 						array(
68 68
 							'id'         => 'limit_display_donations',
69
-							'name'       => __( 'Limit Donations Displayed', 'give' ),
70
-							'desc'       => __( 'Adjusts the number of donations displayed to a non logged-in user when they attempt to access the Donation History page without an active session. For security reasons, it\'s best to leave this at 1-3 donations.', 'give' ),
69
+							'name'       => __('Limit Donations Displayed', 'give'),
70
+							'desc'       => __('Adjusts the number of donations displayed to a non logged-in user when they attempt to access the Donation History page without an active session. For security reasons, it\'s best to leave this at 1-3 donations.', 'give'),
71 71
 							'default'    => '1',
72 72
 							'type'       => 'number',
73 73
 							'css'        => 'width:50px;',
@@ -77,36 +77,36 @@  discard block
 block discarded – undo
77 77
 							),
78 78
 						),
79 79
 						array(
80
-							'name'    => __( 'Email Access', 'give' ),
81
-							'desc'    => __( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
80
+							'name'    => __('Email Access', 'give'),
81
+							'desc'    => __('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
82 82
 							'id'      => 'email_access',
83 83
 							'type'    => 'radio_inline',
84 84
 							'default' => 'disabled',
85 85
 							'options' => array(
86
-								'enabled'  => __( 'Enabled', 'give' ),
87
-								'disabled' => __( 'Disabled', 'give' ),
86
+								'enabled'  => __('Enabled', 'give'),
87
+								'disabled' => __('Disabled', 'give'),
88 88
 							),
89 89
 						),
90 90
 						array(
91 91
 							'id'      => 'recaptcha_key',
92
-							'name'    => __( 'reCAPTCHA Site Key', 'give' ),
92
+							'name'    => __('reCAPTCHA Site Key', 'give'),
93 93
 							/* translators: %s: https://www.google.com/recaptcha/ */
94
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key and paste your reCAPTCHA site key here. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'http://docs.givewp.com/recaptcha' ) ),
94
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key and paste your reCAPTCHA site key here. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('http://docs.givewp.com/recaptcha')),
95 95
 							'default' => '',
96 96
 							'type'    => 'text',
97 97
 						),
98 98
 						array(
99 99
 							'id'      => 'recaptcha_secret',
100
-							'name'    => __( 'reCAPTCHA Secret Key', 'give' ),
101
-							'desc'    => __( 'Please paste the reCAPTCHA secret key here from your  reCAPTCHA API Keys panel.', 'give' ),
100
+							'name'    => __('reCAPTCHA Secret Key', 'give'),
101
+							'desc'    => __('Please paste the reCAPTCHA secret key here from your  reCAPTCHA API Keys panel.', 'give'),
102 102
 							'default' => '',
103 103
 							'type'    => 'text',
104 104
 						),
105 105
 						array(
106
-							'name'  => __( 'Access Control Docs Link', 'give' ),
106
+							'name'  => __('Access Control Docs Link', 'give'),
107 107
 							'id'    => 'access_control_docs_link',
108
-							'url'   => esc_url( 'http://docs.givewp.com/settings-access-control' ),
109
-							'title' => __( 'Access Control', 'give' ),
108
+							'url'   => esc_url('http://docs.givewp.com/settings-access-control'),
109
+							'title' => __('Access Control', 'give'),
110 110
 							'type'  => 'give_docs_link',
111 111
 						),
112 112
 						array(
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
 							'id'   => 'give_title_general_settings_2',
125 125
 						),
126 126
 						array(
127
-							'name' => __( 'Currency Settings', 'give' ),
127
+							'name' => __('Currency Settings', 'give'),
128 128
 							'desc' => '',
129 129
 							'type' => 'give_title',
130 130
 							'id'   => 'give_title_general_settings_2',
131 131
 						),
132 132
 						array(
133
-							'name'    => __( 'Currency', 'give' ),
134
-							'desc'    => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
133
+							'name'    => __('Currency', 'give'),
134
+							'desc'    => __('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
135 135
 							'id'      => 'currency',
136 136
 							'class'   => 'give-select-chosen',
137 137
 							'type'    => 'select',
@@ -139,47 +139,47 @@  discard block
 block discarded – undo
139 139
 							'default' => 'USD',
140 140
 						),
141 141
 						array(
142
-							'name'    => __( 'Currency Position', 'give' ),
143
-							'desc'    => __( 'The position of the currency symbol.', 'give' ),
142
+							'name'    => __('Currency Position', 'give'),
143
+							'desc'    => __('The position of the currency symbol.', 'give'),
144 144
 							'id'      => 'currency_position',
145 145
 							'type'    => 'select',
146 146
 							'options' => array(
147 147
 								/* translators: %s: currency symbol */
148
-								'before' => sprintf( __( 'Before - %s&#x200e;10', 'give' ), give_currency_symbol( give_get_currency() ) ),
148
+								'before' => sprintf(__('Before - %s&#x200e;10', 'give'), give_currency_symbol(give_get_currency())),
149 149
 								/* translators: %s: currency symbol */
150
-								'after'  => sprintf( __( 'After - 10%s&#x200f;', 'give' ), give_currency_symbol( give_get_currency() ) ),
150
+								'after'  => sprintf(__('After - 10%s&#x200f;', 'give'), give_currency_symbol(give_get_currency())),
151 151
 							),
152 152
 							'default' => 'before',
153 153
 						),
154 154
 						array(
155
-							'name'    => __( 'Thousands Separator', 'give' ),
156
-							'desc'    => __( 'The symbol (typically , or .) to separate thousands.', 'give' ),
155
+							'name'    => __('Thousands Separator', 'give'),
156
+							'desc'    => __('The symbol (typically , or .) to separate thousands.', 'give'),
157 157
 							'id'      => 'thousands_separator',
158 158
 							'type'    => 'text',
159 159
 							'default' => ',',
160 160
 							'css'     => 'width:12em;',
161 161
 						),
162 162
 						array(
163
-							'name'    => __( 'Decimal Separator', 'give' ),
164
-							'desc'    => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
163
+							'name'    => __('Decimal Separator', 'give'),
164
+							'desc'    => __('The symbol (usually , or .) to separate decimal points.', 'give'),
165 165
 							'id'      => 'decimal_separator',
166 166
 							'type'    => 'text',
167 167
 							'default' => '.',
168 168
 							'css'     => 'width:12em;',
169 169
 						),
170 170
 						array(
171
-							'name'    => __( 'Number of Decimals', 'give' ),
172
-							'desc'    => __( 'The number of decimal points displayed in amounts.', 'give' ),
171
+							'name'    => __('Number of Decimals', 'give'),
172
+							'desc'    => __('The number of decimal points displayed in amounts.', 'give'),
173 173
 							'id'      => 'number_decimals',
174 174
 							'type'    => 'text',
175 175
 							'default' => 2,
176 176
 							'css'     => 'width:12em;',
177 177
 						),
178 178
 						array(
179
-							'name'  => __( 'Currency Options Docs Link', 'give' ),
179
+							'name'  => __('Currency Options Docs Link', 'give'),
180 180
 							'id'    => 'currency_settings_docs_link',
181
-							'url'   => esc_url( 'http://docs.givewp.com/settings-currency' ),
182
-							'title' => __( 'Currency Settings', 'give' ),
181
+							'url'   => esc_url('http://docs.givewp.com/settings-currency'),
182
+							'title' => __('Currency Settings', 'give'),
183 183
 							'type'  => 'give_docs_link',
184 184
 						),
185 185
 						array(
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 					$country = give_get_country();
195 195
 
196 196
 					// get the list of the states of which default country is selected.
197
-					$states = give_get_states( $country );
197
+					$states = give_get_states($country);
198 198
 
199 199
 					// Get the country list that does not have any states init.
200 200
 					$no_states_country = give_no_states_country_list();
@@ -206,46 +206,46 @@  discard block
 block discarded – undo
206 206
 							'id'   => 'give_title_general_settings_1',
207 207
 						),
208 208
 						array(
209
-							'name' => __( 'General Settings', 'give' ),
209
+							'name' => __('General Settings', 'give'),
210 210
 							'desc' => '',
211 211
 							'type' => 'give_title',
212 212
 							'id'   => 'give_title_general_settings_1',
213 213
 						),
214 214
 						array(
215
-							'name'    => __( 'Success Page', 'give' ),
215
+							'name'    => __('Success Page', 'give'),
216 216
 							/* translators: %s: [give_receipt] */
217
-							'desc'    => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
217
+							'desc'    => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
218 218
 							'id'      => 'success_page',
219 219
 							'type'    => 'select',
220
-							'options' => give_cmb2_get_post_options( array(
220
+							'options' => give_cmb2_get_post_options(array(
221 221
 								'post_type'   => 'page',
222 222
 								'numberposts' => 999,
223
-							) ),
223
+							)),
224 224
 						),
225 225
 						array(
226
-							'name'    => __( 'Failed Donation Page', 'give' ),
227
-							'desc'    => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
226
+							'name'    => __('Failed Donation Page', 'give'),
227
+							'desc'    => __('The page donors are sent to if their donation is cancelled or fails.', 'give'),
228 228
 							'id'      => 'failure_page',
229 229
 							'type'    => 'select',
230
-							'options' => give_cmb2_get_post_options( array(
230
+							'options' => give_cmb2_get_post_options(array(
231 231
 								'post_type'   => 'page',
232 232
 								'numberposts' => 999,
233
-							) ),
233
+							)),
234 234
 						),
235 235
 						array(
236
-							'name'    => __( 'Donation History Page', 'give' ),
236
+							'name'    => __('Donation History Page', 'give'),
237 237
 							/* translators: %s: [donation_history] */
238
-							'desc'    => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
238
+							'desc'    => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
239 239
 							'id'      => 'history_page',
240 240
 							'type'    => 'select',
241
-							'options' => give_cmb2_get_post_options( array(
241
+							'options' => give_cmb2_get_post_options(array(
242 242
 								'post_type'   => 'page',
243 243
 								'numberposts' => 999,
244
-							) ),
244
+							)),
245 245
 						),
246 246
 						array(
247
-							'name'    => __( 'Base Country', 'give' ),
248
-							'desc'    => __( 'The country your site operates from.', 'give' ),
247
+							'name'    => __('Base Country', 'give'),
248
+							'desc'    => __('The country your site operates from.', 'give'),
249 249
 							'id'      => 'base_country',
250 250
 							'type'    => 'select',
251 251
 							'options' => give_get_country_list(),
@@ -256,18 +256,18 @@  discard block
 block discarded – undo
256 256
 						 * @since 1.8.14
257 257
 						 */
258 258
 						array(
259
-							'wrapper_class' => ( array_key_exists( $country, $no_states_country ) ? 'give-hidden' : '' ),
260
-							'name'          => __( 'Base State/Province', 'give' ),
261
-							'desc'          => __( 'The state/province your site operates from.', 'give' ),
259
+							'wrapper_class' => (array_key_exists($country, $no_states_country) ? 'give-hidden' : ''),
260
+							'name'          => __('Base State/Province', 'give'),
261
+							'desc'          => __('The state/province your site operates from.', 'give'),
262 262
 							'id'            => 'base_state',
263
-							'type'          => ( empty( $states ) ? 'text' : 'select' ),
263
+							'type'          => (empty($states) ? 'text' : 'select'),
264 264
 							'options'       => $states,
265 265
 						),
266 266
 						array(
267
-							'name'  => __( 'General Options Docs Link', 'give' ),
267
+							'name'  => __('General Options Docs Link', 'give'),
268 268
 							'id'    => 'general_options_docs_link',
269
-							'url'   => esc_url( 'http://docs.givewp.com/settings-general' ),
270
-							'title' => __( 'General Options', 'give' ),
269
+							'url'   => esc_url('http://docs.givewp.com/settings-general'),
270
+							'title' => __('General Options', 'give'),
271 271
 							'type'  => 'give_docs_link',
272 272
 						),
273 273
 						array(
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 			 * Filter the general settings.
283 283
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
284 284
 			 */
285
-			$settings = apply_filters( 'give_settings_general', $settings );
285
+			$settings = apply_filters('give_settings_general', $settings);
286 286
 
287 287
 			/**
288 288
 			 * Filter the settings.
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 			 *
292 292
 			 * @param  array $settings
293 293
 			 */
294
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
294
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
295 295
 
296 296
 			// Output.
297 297
 			return $settings;
@@ -305,12 +305,12 @@  discard block
 block discarded – undo
305 305
 		 */
306 306
 		public function get_sections() {
307 307
 			$sections = array(
308
-				'general-settings'  => __( 'General', 'give' ),
309
-				'currency-settings' => __( 'Currency', 'give' ),
310
-				'access-control'    => __( 'Access Control', 'give' ),
308
+				'general-settings'  => __('General', 'give'),
309
+				'currency-settings' => __('Currency', 'give'),
310
+				'access-control'    => __('Access Control', 'give'),
311 311
 			);
312 312
 
313
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
313
+			return apply_filters('give_get_sections_'.$this->id, $sections);
314 314
 		}
315 315
 	}
316 316
 
Please login to merge, or discard this patch.
includes/filters.php 1 patch
Spacing   +43 added lines, -45 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
 
@@ -26,34 +26,34 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * @return void
28 28
  */
29
-function give_set_settings_with_disable_prefix( $old_settings, $settings ) {
29
+function give_set_settings_with_disable_prefix($old_settings, $settings) {
30 30
 	// Bailout.
31
-	if ( ! function_exists( 'give_v18_renamed_core_settings' ) ) {
31
+	if ( ! function_exists('give_v18_renamed_core_settings')) {
32 32
 		return;
33 33
 	}
34 34
 
35 35
 	// Get old setting names.
36
-	$old_settings   = array_flip( give_v18_renamed_core_settings() );
36
+	$old_settings   = array_flip(give_v18_renamed_core_settings());
37 37
 	$update_setting = false;
38 38
 
39
-	foreach ( $settings as $key => $value ) {
39
+	foreach ($settings as $key => $value) {
40 40
 
41 41
 		// Check 1. Check if new option is really updated or not.
42 42
 		// Check 2. Continue if key is not renamed.
43
-		if ( ! isset( $old_settings[ $key ] ) ) {
43
+		if ( ! isset($old_settings[$key])) {
44 44
 			continue;
45 45
 		}
46 46
 
47 47
 		// Set old setting.
48
-		$settings[ $old_settings[ $key ] ] = 'on';
48
+		$settings[$old_settings[$key]] = 'on';
49 49
 
50 50
 		// Do not need to set old setting if new setting is not set.
51 51
 		if (
52
-			( give_is_setting_enabled( $value ) && ( false !== strpos( $old_settings[ $key ], 'disable_' ) ) )
53
-			|| ( ! give_is_setting_enabled( $value ) && ( false !== strpos( $old_settings[ $key ], 'enable_' ) ) )
52
+			(give_is_setting_enabled($value) && (false !== strpos($old_settings[$key], 'disable_')))
53
+			|| ( ! give_is_setting_enabled($value) && (false !== strpos($old_settings[$key], 'enable_')))
54 54
 
55 55
 		) {
56
-			unset( $settings[ $old_settings[ $key ] ] );
56
+			unset($settings[$old_settings[$key]]);
57 57
 		}
58 58
 
59 59
 		// Tell bot to update setting.
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	// Update setting if any old setting set.
64
-	if ( $update_setting ) {
65
-		update_option( 'give_settings', $settings );
64
+	if ($update_setting) {
65
+		update_option('give_settings', $settings);
66 66
 	}
67 67
 }
68 68
 
69
-add_action( 'update_option_give_settings', 'give_set_settings_with_disable_prefix', 10, 2 );
69
+add_action('update_option_give_settings', 'give_set_settings_with_disable_prefix', 10, 2);
70 70
 
71 71
 /**
72 72
  * Check spam through Akismet.
@@ -80,45 +80,45 @@  discard block
 block discarded – undo
80 80
  *
81 81
  * @return bool|mixed
82 82
  */
83
-function give_akismet( $spam ) {
83
+function give_akismet($spam) {
84 84
 
85 85
 	// Bail out, If spam.
86
-	if ( $spam ) {
86
+	if ($spam) {
87 87
 		return $spam;
88 88
 	}
89 89
 
90 90
 	// Bail out, if Akismet key not exist.
91
-	if ( ! give_check_akismet_key() ) {
91
+	if ( ! give_check_akismet_key()) {
92 92
 		return false;
93 93
 	}
94 94
 
95 95
 	// Build args array.
96 96
 	$args = array();
97 97
 
98
-	$args['comment_author']       = isset( $_POST['give_first'] ) ? strip_tags( trim( $_POST['give_first'] ) ) : '';
99
-	$args['comment_author_email'] = isset( $_POST['give_email'] ) ? $_POST['give_email'] : false;
100
-	$args['blog']                 = get_option( 'home' );
98
+	$args['comment_author']       = isset($_POST['give_first']) ? strip_tags(trim($_POST['give_first'])) : '';
99
+	$args['comment_author_email'] = isset($_POST['give_email']) ? $_POST['give_email'] : false;
100
+	$args['blog']                 = get_option('home');
101 101
 	$args['blog_lang']            = get_locale();
102
-	$args['blog_charset']         = get_option( 'blog_charset' );
102
+	$args['blog_charset']         = get_option('blog_charset');
103 103
 	$args['user_ip']              = $_SERVER['REMOTE_ADDR'];
104 104
 	$args['user_agent']           = $_SERVER['HTTP_USER_AGENT'];
105 105
 	$args['referrer']             = $_SERVER['HTTP_REFERER'];
106 106
 	$args['comment_type']         = 'contact-form';
107 107
 
108
-	$ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' );
108
+	$ignore = array('HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW');
109 109
 
110
-	foreach ( $_SERVER as $key => $value ) {
111
-		if ( ! in_array( $key, (array) $ignore ) ) {
110
+	foreach ($_SERVER as $key => $value) {
111
+		if ( ! in_array($key, (array) $ignore)) {
112 112
 			$args["$key"] = $value;
113 113
 		}
114 114
 	}
115 115
 
116 116
 	// It will return Akismet spam detect API response.
117
-	return give_akismet_spam_check( $args );
117
+	return give_akismet_spam_check($args);
118 118
 
119 119
 }
120 120
 
121
-add_filter( 'give_spam', 'give_akismet' );
121
+add_filter('give_spam', 'give_akismet');
122 122
 
123 123
 /**
124 124
  * Check Akismet API Key.
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
  * @return bool
129 129
  */
130 130
 function give_check_akismet_key() {
131
-	if ( is_callable( array( 'Akismet', 'get_api_key' ) ) ) { // Akismet v3.0+
131
+	if (is_callable(array('Akismet', 'get_api_key'))) { // Akismet v3.0+
132 132
 		return (bool) Akismet::get_api_key();
133 133
 	}
134 134
 
135
-	if ( function_exists( 'akismet_get_key' ) ) {
135
+	if (function_exists('akismet_get_key')) {
136 136
 		return (bool) akismet_get_key();
137 137
 	}
138 138
 
@@ -148,26 +148,26 @@  discard block
 block discarded – undo
148 148
  *
149 149
  * @return bool|mixed
150 150
  */
151
-function give_akismet_spam_check( $args ) {
151
+function give_akismet_spam_check($args) {
152 152
 	global $akismet_api_host, $akismet_api_port;
153 153
 
154 154
 	$spam         = false;
155
-	$query_string = http_build_query( $args );
155
+	$query_string = http_build_query($args);
156 156
 
157
-	if ( is_callable( array( 'Akismet', 'http_post' ) ) ) { // Akismet v3.0+
158
-		$response = Akismet::http_post( $query_string, 'comment-check' );
157
+	if (is_callable(array('Akismet', 'http_post'))) { // Akismet v3.0+
158
+		$response = Akismet::http_post($query_string, 'comment-check');
159 159
 	} else {
160
-		$response = akismet_http_post( $query_string, $akismet_api_host,
161
-			'/1.1/comment-check', $akismet_api_port );
160
+		$response = akismet_http_post($query_string, $akismet_api_host,
161
+			'/1.1/comment-check', $akismet_api_port);
162 162
 	}
163 163
 
164 164
 	// It's spam if response status is true.
165
-	if ( 'true' === $response[1] ) {
165
+	if ('true' === $response[1]) {
166 166
 		$spam = true;
167 167
 	}
168 168
 
169 169
 	// Allow developer to modified Akismet spam detection response.
170
-	return apply_filters( 'give_akismet_spam_check', $spam, $args );
170
+	return apply_filters('give_akismet_spam_check', $spam, $args);
171 171
 }
172 172
 
173 173
 /**
@@ -180,15 +180,15 @@  discard block
 block discarded – undo
180 180
  *
181 181
  * @return array
182 182
  */
183
-function give_bc_v1817_iranian_currency_code( $currencies ) {
184
-	if ( ! give_has_upgrade_completed( 'v1817_update_donation_iranian_currency_code' ) ) {
183
+function give_bc_v1817_iranian_currency_code($currencies) {
184
+	if ( ! give_has_upgrade_completed('v1817_update_donation_iranian_currency_code')) {
185 185
 		$currencies['RIAL'] = $currencies['IRR'];
186 186
 	}
187 187
 
188 188
 	return $currencies;
189 189
 }
190 190
 
191
-add_filter( 'give_currencies', 'give_bc_v1817_iranian_currency_code', 0 );
191
+add_filter('give_currencies', 'give_bc_v1817_iranian_currency_code', 0);
192 192
 
193 193
 
194 194
 /**
@@ -202,22 +202,20 @@  discard block
 block discarded – undo
202 202
  *
203 203
  * @return string
204 204
  */
205
-function give_format_price_for_right_to_left_supported_currency( $formatted_amount, $currency_args, $price ) {
206
-	if ( ! give_is_right_to_left_supported_currency( $currency_args['currency_code'] ) ) {
205
+function give_format_price_for_right_to_left_supported_currency($formatted_amount, $currency_args, $price) {
206
+	if ( ! give_is_right_to_left_supported_currency($currency_args['currency_code'])) {
207 207
 		return $formatted_amount;
208 208
 	}
209 209
 
210 210
 	$formatted_amount = (
211 211
 	'before' === (string) $currency_args['position'] ?
212
-		'&#x202B;' . $price . $currency_args['symbol'] . '&#x202C;' :
213
-		'&#x202A;' . $price . $currency_args['symbol'] . '&#x202C;'
212
+		'&#x202B;'.$price.$currency_args['symbol'].'&#x202C;' : '&#x202A;'.$price.$currency_args['symbol'].'&#x202C;'
214 213
 	);
215 214
 
216 215
 	$formatted_amount = $currency_args['decode_currency'] ?
217
-		html_entity_decode( $formatted_amount, ENT_COMPAT, 'UTF-8' ) :
218
-		$formatted_amount;
216
+		html_entity_decode($formatted_amount, ENT_COMPAT, 'UTF-8') : $formatted_amount;
219 217
 
220 218
 	return $formatted_amount;
221 219
 }
222 220
 
223
-add_filter( 'give_currency_filter', 'give_format_price_for_right_to_left_supported_currency', 10, 3 );
224 221
\ No newline at end of file
222
+add_filter('give_currency_filter', 'give_format_price_for_right_to_left_supported_currency', 10, 3);
225 223
\ No newline at end of file
Please login to merge, or discard this patch.
includes/donors/class-give-donors-query.php 1 patch
Spacing   +49 added lines, -50 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
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @param  $args array The array of arguments that can be passed in and used for setting up this payment query.
87 87
 	 */
88
-	public function __construct( $args = array() ) {
88
+	public function __construct($args = array()) {
89 89
 		$defaults = array(
90 90
 			'number'     => 20,
91 91
 			'offset'     => 0,
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			// 'form'       => array(),
104 104
 		);
105 105
 
106
-		$this->args = wp_parse_args( $args, $defaults );
106
+		$this->args = wp_parse_args($args, $defaults);
107 107
 
108 108
 		$this->table_name      = Give()->donors->table_name;
109 109
 		$this->meta_table_name = Give()->donor_meta->table_name;
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
 		 *
147 147
 		 * @param Give_Donors_Query $this Donors query object.
148 148
 		 */
149
-		do_action( 'give_pre_get_donors', $this );
149
+		do_action('give_pre_get_donors', $this);
150 150
 
151
-		if ( empty( $this->args['count'] ) ) {
152
-			$this->donors = $wpdb->get_results( $this->get_sql() );
151
+		if (empty($this->args['count'])) {
152
+			$this->donors = $wpdb->get_results($this->get_sql());
153 153
 		} else {
154
-			$this->donors = $wpdb->get_var( $this->get_sql() );
154
+			$this->donors = $wpdb->get_var($this->get_sql());
155 155
 		}
156 156
 
157 157
 		/**
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 		 *
162 162
 		 * @param Give_Donors_Query $this Donors query object.
163 163
 		 */
164
-		do_action( 'give_post_get_donors', $this );
164
+		do_action('give_post_get_donors', $this);
165 165
 
166 166
 		return $this->donors;
167 167
 	}
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	public function get_sql() {
179 179
 		global $wpdb;
180 180
 
181
-		if ( $this->args['number'] < 1 ) {
181
+		if ($this->args['number'] < 1) {
182 182
 			$this->args['number'] = 999999999999;
183 183
 		}
184 184
 
@@ -186,22 +186,22 @@  discard block
 block discarded – undo
186 186
 
187 187
 
188 188
 		// Set offset.
189
-		if ( empty( $this->args['offset'] ) && ( 0 < $this->args['paged'] ) ) {
190
-			$this->args['offset'] = $this->args['number'] * ( $this->args['paged'] - 1 );
189
+		if (empty($this->args['offset']) && (0 < $this->args['paged'])) {
190
+			$this->args['offset'] = $this->args['number'] * ($this->args['paged'] - 1);
191 191
 		}
192 192
 
193 193
 		// Set fields.
194 194
 		$fields = "{$this->table_name}.*";
195
-		if ( ! empty( $this->args['fields'] ) && 'all' !== $this->args['fields'] ) {
196
-			if ( is_string( $this->args['fields'] ) ) {
195
+		if ( ! empty($this->args['fields']) && 'all' !== $this->args['fields']) {
196
+			if (is_string($this->args['fields'])) {
197 197
 				$fields = "{$this->table_name}.{$this->args['fields']}";
198
-			} else if ( is_array( $this->args['fields'] ) ) {
199
-				$fields = "{$this->table_name}." . implode( " , {$this->table_name}.", $this->args['fields'] );
198
+			} else if (is_array($this->args['fields'])) {
199
+				$fields = "{$this->table_name}.".implode(" , {$this->table_name}.", $this->args['fields']);
200 200
 			}
201 201
 		}
202 202
 
203 203
 		// Set count.
204
-		if ( ! empty( $this->args['count'] ) ) {
204
+		if ( ! empty($this->args['count'])) {
205 205
 			$fields = "COUNT({$this->table_name}.id)";
206 206
 		}
207 207
 
@@ -209,13 +209,13 @@  discard block
 block discarded – undo
209 209
 
210 210
 		$sql = $wpdb->prepare(
211 211
 			"SELECT {$fields} FROM {$this->table_name} LIMIT %d,%d;",
212
-			absint( $this->args['offset'] ),
213
-			absint( $this->args['number'] )
212
+			absint($this->args['offset']),
213
+			absint($this->args['number'])
214 214
 		);
215 215
 
216 216
 		// $where, $orderby and order already prepared query they can generate notice if you re prepare them in above.
217 217
 		// WordPress consider LIKE condition as placeholder if start with s,f, or d.
218
-		$sql = str_replace( 'LIMIT', "{$where} {$orderby} {$this->args['order']} LIMIT", $sql );
218
+		$sql = str_replace('LIMIT', "{$where} {$orderby} {$this->args['order']} LIMIT", $sql);
219 219
 
220 220
 		return $sql;
221 221
 	}
@@ -233,15 +233,15 @@  discard block
 block discarded – undo
233 233
 		$where = '';
234 234
 
235 235
 		// Get sql query for meta.
236
-		if ( ! empty( $this->args['meta_query'] ) ) {
237
-			$meta_query_object = new WP_Meta_Query( $this->args['meta_query'] );
236
+		if ( ! empty($this->args['meta_query'])) {
237
+			$meta_query_object = new WP_Meta_Query($this->args['meta_query']);
238 238
 			$meta_query        = $meta_query_object->get_sql(
239 239
 				$this->meta_type,
240 240
 				$this->table_name,
241 241
 				'id'
242 242
 			);
243 243
 
244
-			$where = implode( '', $meta_query );
244
+			$where = implode('', $meta_query);
245 245
 		}
246 246
 
247 247
 		$where .= 'WHERE 1=1 ';
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 		$where .= $this->get_where_user();
252 252
 		$where .= $this->get_where_date();
253 253
 
254
-		return trim( $where );
254
+		return trim($where);
255 255
 	}
256 256
 
257 257
 	/**
@@ -268,17 +268,17 @@  discard block
 block discarded – undo
268 268
 
269 269
 		$where = '';
270 270
 
271
-		if ( ! empty( $this->args['email'] ) ) {
271
+		if ( ! empty($this->args['email'])) {
272 272
 
273
-			if ( is_array( $this->args['email'] ) ) {
273
+			if (is_array($this->args['email'])) {
274 274
 
275
-				$emails_count       = count( $this->args['email'] );
276
-				$emails_placeholder = array_fill( 0, $emails_count, '%s' );
277
-				$emails             = implode( ', ', $emails_placeholder );
275
+				$emails_count       = count($this->args['email']);
276
+				$emails_placeholder = array_fill(0, $emails_count, '%s');
277
+				$emails             = implode(', ', $emails_placeholder);
278 278
 
279
-				$where .= $wpdb->prepare( "AND {$this->table_name}.email IN( $emails )", $this->args['email'] );
279
+				$where .= $wpdb->prepare("AND {$this->table_name}.email IN( $emails )", $this->args['email']);
280 280
 			} else {
281
-				$where .= $wpdb->prepare( "AND {$this->table_name}.email = %s", $this->args['email'] );
281
+				$where .= $wpdb->prepare("AND {$this->table_name}.email = %s", $this->args['email']);
282 282
 			}
283 283
 		}
284 284
 
@@ -298,11 +298,11 @@  discard block
 block discarded – undo
298 298
 		$where = '';
299 299
 
300 300
 		// Specific donors.
301
-		if ( ! empty( $this->args['donor'] ) ) {
302
-			if ( ! is_array( $this->args['donor'] ) ) {
303
-				$this->args['donor'] = explode( ',', $this->args['donor'] );
301
+		if ( ! empty($this->args['donor'])) {
302
+			if ( ! is_array($this->args['donor'])) {
303
+				$this->args['donor'] = explode(',', $this->args['donor']);
304 304
 			}
305
-			$donor_ids = implode( ',', array_map( 'intval', $this->args['donor'] ) );
305
+			$donor_ids = implode(',', array_map('intval', $this->args['donor']));
306 306
 
307 307
 			$where .= "AND {$this->table_name}.id IN( {$donor_ids} )";
308 308
 		}
@@ -323,9 +323,9 @@  discard block
 block discarded – undo
323 323
 		$where = '';
324 324
 
325 325
 		// Donors created for a specific date or in a date range
326
-		if ( ! empty( $this->args['date_query'] ) ) {
326
+		if ( ! empty($this->args['date_query'])) {
327 327
 			$date_query_object = new WP_Date_Query(
328
-				is_array( $this->args['date_query'] ) ? $this->args['date_query'] : wp_parse_args( $this->args['date_query'] ),
328
+				is_array($this->args['date_query']) ? $this->args['date_query'] : wp_parse_args($this->args['date_query']),
329 329
 				"{$this->table_name}.date_created"
330 330
 			);
331 331
 
@@ -360,11 +360,11 @@  discard block
 block discarded – undo
360 360
 		$where = '';
361 361
 
362 362
 		// Donors created for a specific date or in a date range
363
-		if ( ! empty( $this->args['s'] ) && false !== strpos( $this->args['s'], ':' ) ) {
364
-			$search_parts = explode( ':', $this->args['s'] );
363
+		if ( ! empty($this->args['s']) && false !== strpos($this->args['s'], ':')) {
364
+			$search_parts = explode(':', $this->args['s']);
365 365
 
366
-			if ( ! empty( $search_parts[0] ) ) {
367
-				switch ( $search_parts[0] ) {
366
+			if ( ! empty($search_parts[0])) {
367
+				switch ($search_parts[0]) {
368 368
 					case 'name':
369 369
 						$where = "AND {$this->table_name}.name LIKE '%{$search_parts[1]}%'";
370 370
 						break;
@@ -392,11 +392,11 @@  discard block
 block discarded – undo
392 392
 		$where = '';
393 393
 
394 394
 		// Donors create for specific wp user.
395
-		if ( ! empty( $this->args['user'] ) ) {
396
-			if ( ! is_array( $this->args['user'] ) ) {
397
-				$this->args['user'] = explode( ',', $this->args['user'] );
395
+		if ( ! empty($this->args['user'])) {
396
+			if ( ! is_array($this->args['user'])) {
397
+				$this->args['user'] = explode(',', $this->args['user']);
398 398
 			}
399
-			$user_ids = implode( ',', array_map( 'intval', $this->args['user'] ) );
399
+			$user_ids = implode(',', array_map('intval', $this->args['user']));
400 400
 
401 401
 			$where .= "AND {$this->table_name}.user_id IN( {$user_ids} )";
402 402
 		}
@@ -415,14 +415,13 @@  discard block
 block discarded – undo
415 415
 	private function get_order_query() {
416 416
 		$table_columns = Give()->donors->get_columns();
417 417
 
418
-		$this->args['orderby'] = ! array_key_exists( $this->args['orderby'], $table_columns ) ?
419
-			'id' :
420
-			$this->args['orderby'];
418
+		$this->args['orderby'] = ! array_key_exists($this->args['orderby'], $table_columns) ?
419
+			'id' : $this->args['orderby'];
421 420
 
422
-		$this->args['orderby'] = esc_sql( $this->args['orderby'] );
423
-		$this->args['order']   = esc_sql( $this->args['order'] );
421
+		$this->args['orderby'] = esc_sql($this->args['orderby']);
422
+		$this->args['order']   = esc_sql($this->args['order']);
424 423
 
425
-		switch ( $table_columns[ $this->args['orderby'] ] ) {
424
+		switch ($table_columns[$this->args['orderby']]) {
426 425
 			case '%d':
427 426
 			case '%f':
428 427
 				$query = "ORDER BY {$this->table_name}.{$this->args['orderby']}+0";
Please login to merge, or discard this patch.
templates/shortcode-login.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,18 +5,18 @@  discard block
 block discarded – undo
5 5
 
6 6
 global $give_logout_redirect;
7 7
 
8
-if ( ! is_user_logged_in() ) {
8
+if ( ! is_user_logged_in()) {
9 9
 
10 10
 	$give_login_redirect = give_get_history_page_uri();
11
-	if ( ! empty( $_GET['payment_key'] ) ) {
12
-		$give_login_redirect = add_query_arg( 'payment_key', give_clean( $_GET['payment_key'] ) , give_get_history_page_uri() );
11
+	if ( ! empty($_GET['payment_key'])) {
12
+		$give_login_redirect = add_query_arg('payment_key', give_clean($_GET['payment_key']), give_get_history_page_uri());
13 13
 	}
14 14
 
15 15
 	// Show any error messages after form submission
16
-	Give()->notices->render_frontend_notices( 0 ); ?>
16
+	Give()->notices->render_frontend_notices(0); ?>
17 17
 	<form id="give-login-form" class="give-form" action="" method="post">
18 18
 		<fieldset>
19
-			<legend><?php _e( 'Log into Your Account', 'give' ); ?></legend>
19
+			<legend><?php _e('Log into Your Account', 'give'); ?></legend>
20 20
 			<?php
21 21
 			/**
22 22
 			 * Fires in the login shortcode, before the login fields.
@@ -25,27 +25,27 @@  discard block
 block discarded – undo
25 25
 			 *
26 26
 			 * @since 1.0
27 27
 			 */
28
-			do_action( 'give_login_fields_before' );
28
+			do_action('give_login_fields_before');
29 29
 			?>
30 30
 			<div class="give-login-username give-login">
31
-				<label for="give_user_login"><?php _e( 'Username', 'give' ); ?></label>
31
+				<label for="give_user_login"><?php _e('Username', 'give'); ?></label>
32 32
 				<input name="give_user_login" id="give_user_login" class="give-required give-input" type="text" required aria-required="true" />
33 33
 			</div>
34 34
 
35 35
 			<div class="give-login-password give-login">
36
-				<label for="give_user_pass"><?php _e( 'Password', 'give' ); ?></label>
36
+				<label for="give_user_pass"><?php _e('Password', 'give'); ?></label>
37 37
 				<input name="give_user_pass" id="give_user_pass" class="give-password give-required give-input" type="password" required aria-required="true" />
38 38
 			</div>
39 39
 
40 40
 			<div class="give-login-submit give-login">
41
-				<input type="hidden" name="give_login_redirect" value="<?php echo esc_url( $give_login_redirect ); ?>" />
42
-				<input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce( 'give-login-nonce' ); ?>" />
41
+				<input type="hidden" name="give_login_redirect" value="<?php echo esc_url($give_login_redirect); ?>" />
42
+				<input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce('give-login-nonce'); ?>" />
43 43
 				<input type="hidden" name="give_action" value="user_login" />
44
-				<input id="give_login_submit" type="submit" class="give_submit" value="<?php _e( 'Log In', 'give' ); ?>" />
44
+				<input id="give_login_submit" type="submit" class="give_submit" value="<?php _e('Log In', 'give'); ?>" />
45 45
 			</div>
46 46
 
47 47
 			<div class="give-lost-password give-login">
48
-				<a href="<?php echo wp_lostpassword_url(); ?>"><?php _e( 'Reset Password', 'give' ); ?></a>
48
+				<a href="<?php echo wp_lostpassword_url(); ?>"><?php _e('Reset Password', 'give'); ?></a>
49 49
 			</div>
50 50
 			<?php
51 51
 			/**
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
 			 *
56 56
 			 * @since 1.0
57 57
 			 */
58
-			do_action( 'give_login_fields_after' );
58
+			do_action('give_login_fields_after');
59 59
 			?>
60 60
 		</fieldset>
61 61
 	</form>
62
-<?php } elseif( isset( $_GET['give-login-success'] ) && true === (bool) $_GET['give-login-success'] ) { ?>
63
-	<?php Give()->notices->print_frontend_notice( apply_filters('give_successful_login_message', __( 'Login successful. Welcome!', 'give' )), true, 'success' ); ?>
62
+<?php } elseif (isset($_GET['give-login-success']) && true === (bool) $_GET['give-login-success']) { ?>
63
+	<?php Give()->notices->print_frontend_notice(apply_filters('give_successful_login_message', __('Login successful. Welcome!', 'give')), true, 'success'); ?>
64 64
 <?php } else { ?>
65
-	<?php Give()->notices->print_frontend_notice( apply_filters('give_already_logged_in_message', sprintf( __( 'You are already logged in to the site. <a href="%s">Click here</a> to logout.', 'give' ), esc_url( $give_logout_redirect ) ) ), true, 'warning' ); ?>
65
+	<?php Give()->notices->print_frontend_notice(apply_filters('give_already_logged_in_message', sprintf(__('You are already logged in to the site. <a href="%s">Click here</a> to logout.', 'give'), esc_url($give_logout_redirect))), true, 'warning'); ?>
66 66
 <?php } ?>
67 67
\ No newline at end of file
Please login to merge, or discard this patch.
templates/shortcode-goal.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -3,24 +3,24 @@  discard block
 block discarded – undo
3 3
  * This template is used to display the goal with [give_goal]
4 4
  */
5 5
 
6
-$form        = new Give_Donate_Form( $form_id );
7
-$goal_option = give_get_meta( $form->ID, '_give_goal_option', true );
6
+$form        = new Give_Donate_Form($form_id);
7
+$goal_option = give_get_meta($form->ID, '_give_goal_option', true);
8 8
 
9 9
 //Sanity check - ensure form has pass all condition to show goal.
10 10
 if (
11
-	( isset( $args['show_goal'] ) && ! filter_var( $args['show_goal'], FILTER_VALIDATE_BOOLEAN ) )
12
-	|| empty( $form->ID )
13
-	|| ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) )
14
-	|| ! give_is_setting_enabled( $goal_option )
11
+	(isset($args['show_goal']) && ! filter_var($args['show_goal'], FILTER_VALIDATE_BOOLEAN))
12
+	|| empty($form->ID)
13
+	|| (is_singular('give_forms') && ! give_is_setting_enabled($goal_option))
14
+	|| ! give_is_setting_enabled($goal_option)
15 15
 	|| 0 === $form->goal
16 16
 ) {
17 17
 	return false;
18 18
 }
19 19
 
20
-$goal_format = give_get_meta( $form_id, '_give_goal_format', true );
21
-$color       = give_get_meta( $form_id, '_give_goal_color', true );
22
-$show_text   = isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true;
23
-$show_bar    = isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true;
20
+$goal_format = give_get_meta($form_id, '_give_goal_format', true);
21
+$color       = give_get_meta($form_id, '_give_goal_color', true);
22
+$show_text   = isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true;
23
+$show_bar    = isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true;
24 24
 
25 25
 
26 26
 /**
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
  *
29 29
  * @since 1.8.8
30 30
  */
31
-$income = apply_filters( 'give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form );
31
+$income = apply_filters('give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form);
32 32
 
33 33
 /**
34 34
  * Filter the form
35 35
  *
36 36
  * @since 1.8.8
37 37
  */
38
-$goal = apply_filters( 'give_goal_amount_target_output', $form->goal, $form_id, $form );
38
+$goal = apply_filters('give_goal_amount_target_output', $form->goal, $form_id, $form);
39 39
 
40 40
 
41 41
 /**
@@ -43,59 +43,59 @@  discard block
 block discarded – undo
43 43
  *
44 44
  * @since 1.8.8
45 45
  */
46
-$progress = apply_filters( 'give_goal_amount_funded_percentage_output', round( ( $income / $goal ) * 100, 2 ), $form_id, $form );
46
+$progress = apply_filters('give_goal_amount_funded_percentage_output', round(($income / $goal) * 100, 2), $form_id, $form);
47 47
 
48 48
 /**
49 49
  * Filter the give currency.
50 50
  *
51 51
  * @since 1.8.17
52 52
  */
53
-$form_currency = apply_filters( 'give_goal_form_currency', give_get_currency( $form_id ), $form_id );
53
+$form_currency = apply_filters('give_goal_form_currency', give_get_currency($form_id), $form_id);
54 54
 
55 55
 // Set progress to 100 percentage if income > goal.
56
-if ( $income >= $goal ) {
56
+if ($income >= $goal) {
57 57
 	$progress = 100;
58 58
 }
59 59
 
60 60
 ?>
61 61
 <div class="give-goal-progress">
62
-	<?php if ( ! empty( $show_text ) ) : ?>
62
+	<?php if ( ! empty($show_text)) : ?>
63 63
 		<div class="raised">
64 64
 			<?php
65
-			if ( $goal_format !== 'percentage' ) :
65
+			if ($goal_format !== 'percentage') :
66 66
 
67 67
 				/**
68 68
 				 * Filter the income formatting arguments.
69 69
 				 *
70 70
 				 * @since 1.8.17
71 71
 				 */
72
-				$income_format_args = apply_filters( 'give_goal_income_format_args', array( 'sanitize' => false, 'currency' => $form_currency, 'decimal' => false ), $form_id );
72
+				$income_format_args = apply_filters('give_goal_income_format_args', array('sanitize' => false, 'currency' => $form_currency, 'decimal' => false), $form_id);
73 73
 
74 74
 				/**
75 75
 				 * Filter the goal formatting arguments.
76 76
 				 *
77 77
 				 * @since 1.8.17
78 78
 				 */
79
-				$goal_format_args   = apply_filters( 'give_goal_amount_format_args', array( 'sanitize' => false, 'currency' => $form_currency, 'decimal' => false ), $form_id );
79
+				$goal_format_args = apply_filters('give_goal_amount_format_args', array('sanitize' => false, 'currency' => $form_currency, 'decimal' => false), $form_id);
80 80
 
81 81
 				// Get formatted amount.
82
-				$income = give_human_format_large_amount( give_format_amount( $income, $income_format_args ), array( 'currency' => $form_currency ) );
83
-				$goal   = give_human_format_large_amount( give_format_amount( $goal, $goal_format_args ), array( 'currency' => $form_currency ) );
82
+				$income = give_human_format_large_amount(give_format_amount($income, $income_format_args), array('currency' => $form_currency));
83
+				$goal   = give_human_format_large_amount(give_format_amount($goal, $goal_format_args), array('currency' => $form_currency));
84 84
 
85 85
 				echo sprintf(
86 86
 				/* translators: 1: amount of income raised 2: goal target amount. */
87
-					__( '%1$s of %2$s raised', 'give' ),
88
-					'<span class="income">' . give_currency_filter( $income, array( 'form_id' => $form_id ) ) . '</span>',
89
-					'<span class="goal-text">' . give_currency_filter( $goal, array( 'form_id' => $form_id ) ) . '</span>'
87
+					__('%1$s of %2$s raised', 'give'),
88
+					'<span class="income">'.give_currency_filter($income, array('form_id' => $form_id)).'</span>',
89
+					'<span class="goal-text">'.give_currency_filter($goal, array('form_id' => $form_id)).'</span>'
90 90
 				);
91 91
 
92 92
 
93
-			elseif ( $goal_format == 'percentage' ) :
93
+			elseif ($goal_format == 'percentage') :
94 94
 
95 95
 				echo sprintf(
96 96
 				/* translators: %s: percentage of the amount raised compared to the goal target */
97
-					__( '%s%% funded', 'give' ),
98
-					'<span class="give-percentage">' . round( $progress ) . '</span>'
97
+					__('%s%% funded', 'give'),
98
+					'<span class="give-percentage">'.round($progress).'</span>'
99 99
 				);
100 100
 
101 101
 			endif;
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
 	<?php endif; ?>
105 105
 
106 106
 
107
-	<?php if ( ! empty( $show_bar ) ) : ?>
108
-		<div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="<?php echo esc_attr( $progress ); ?>">
109
-			<span style="width: <?php echo esc_attr( $progress ); ?>%;<?php if ( ! empty( $color ) ) {
110
-				echo 'background-color:' . $color;
107
+	<?php if ( ! empty($show_bar)) : ?>
108
+		<div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="<?php echo esc_attr($progress); ?>">
109
+			<span style="width: <?php echo esc_attr($progress); ?>%;<?php if ( ! empty($color)) {
110
+				echo 'background-color:'.$color;
111 111
 			} ?>"></span>
112 112
 		</div><!-- /.give-progress-bar -->
113 113
 	<?php endif; ?>
Please login to merge, or discard this patch.
templates/history-donations.php 2 patches
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -4,56 +4,56 @@  discard block
 block discarded – undo
4 4
  */
5 5
 
6 6
 $donations             = array();
7
-$donation_history_args = Give()->session->get( 'give_donation_history_args' );
7
+$donation_history_args = Give()->session->get('give_donation_history_args');
8 8
 
9 9
 // User's Donations.
10
-if ( is_user_logged_in() ) {
11
-	$donations = give_get_users_donations( get_current_user_id(), 20, true, 'any' );
12
-} elseif ( Give()->email_access->token_exists ) {
10
+if (is_user_logged_in()) {
11
+	$donations = give_get_users_donations(get_current_user_id(), 20, true, 'any');
12
+} elseif (Give()->email_access->token_exists) {
13 13
 	// Email Access Token?
14
-	$donations = give_get_users_donations( 0, 20, true, 'any' );
14
+	$donations = give_get_users_donations(0, 20, true, 'any');
15 15
 } elseif (
16 16
 	false !== Give()->session->get_session_expiration() ||
17 17
 	true === give_get_history_session()
18 18
 ) {
19 19
 	// Session active?
20
-	$email           = Give()->session->get( 'give_email' );
21
-	$donor           = Give()->donors->get_donor_by( 'email', $email );
22
-	$donations_count = count( explode( ',', $donor->payment_ids ) );
20
+	$email           = Give()->session->get('give_email');
21
+	$donor           = Give()->donors->get_donor_by('email', $email);
22
+	$donations_count = count(explode(',', $donor->payment_ids));
23 23
 
24
-	if( $donations_count > give_get_limit_display_donations() ) {
24
+	if ($donations_count > give_get_limit_display_donations()) {
25 25
 
26 26
 		// Restrict Security Email Access option, if donation count of a donor is less than or equal to limit.
27
-		if( true !== Give_Cache::get( "give_cache_email_throttle_limit_exhausted_{$donor->id}" ) ) {
28
-			add_action( 'give_donation_history_table_end', 'give_donation_history_table_end' );
27
+		if (true !== Give_Cache::get("give_cache_email_throttle_limit_exhausted_{$donor->id}")) {
28
+			add_action('give_donation_history_table_end', 'give_donation_history_table_end');
29 29
 		} else {
30 30
 			$value = Give()->email_access->verify_throttle / 60;
31 31
 
32
-			give_set_error( 'give-limited-throttle', sprintf(
33
-				__( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ),
34
-				sprintf( _n( '%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give' ), Give()->email_access->verify_throttle / 60 )
35
-			) );
32
+			give_set_error('give-limited-throttle', sprintf(
33
+				__('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'),
34
+				sprintf(_n('%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give'), Give()->email_access->verify_throttle / 60)
35
+			));
36 36
 
37 37
 		}
38 38
 
39
-		$donations = give_get_users_donations( $email, give_get_limit_display_donations(), true, 'any' );
39
+		$donations = give_get_users_donations($email, give_get_limit_display_donations(), true, 'any');
40 40
 	} else {
41
-		$donations = give_get_users_donations( $email, 20, true, 'any' );
41
+		$donations = give_get_users_donations($email, 20, true, 'any');
42 42
 	}
43 43
 }
44 44
 
45
-Give()->notices->render_frontend_notices( 0 );
45
+Give()->notices->render_frontend_notices(0);
46 46
 
47
-if ( $donations ) : ?>
47
+if ($donations) : ?>
48 48
 	<?php
49 49
 	$table_headings = array(
50
-		'id'             => __( 'ID', 'give' ),
51
-		'date'           => __( 'Date', 'give' ),
52
-		'donor'          => __( 'Donor', 'give' ),
53
-		'amount'         => __( 'Amount', 'give' ),
54
-		'status'         => __( 'Status', 'give' ),
55
-		'payment_method' => __( 'Payment Method', 'give' ),
56
-		'details'        => __( 'Details', 'give' ),
50
+		'id'             => __('ID', 'give'),
51
+		'date'           => __('Date', 'give'),
52
+		'donor'          => __('Donor', 'give'),
53
+		'amount'         => __('Amount', 'give'),
54
+		'status'         => __('Status', 'give'),
55
+		'payment_method' => __('Payment Method', 'give'),
56
+		'details'        => __('Details', 'give'),
57 57
 	);
58 58
 	?>
59 59
 	<div class="give_user_history_main" >
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
 				 *
70 70
 				 * @since 1.7
71 71
 				 */
72
-				do_action( 'give_donation_history_header_before' );
72
+				do_action('give_donation_history_header_before');
73 73
 
74
-				foreach ( $donation_history_args as $index => $value ) {
75
-					if ( filter_var( $donation_history_args[ $index ], FILTER_VALIDATE_BOOLEAN ) ) :
74
+				foreach ($donation_history_args as $index => $value) {
75
+					if (filter_var($donation_history_args[$index], FILTER_VALIDATE_BOOLEAN)) :
76 76
 						echo sprintf(
77 77
 							'<th scope="col" class="give-donation-%1$s>">%2$s</th>',
78 78
 							$index,
79
-							$table_headings[ $index ]
79
+							$table_headings[$index]
80 80
 						);
81 81
 					endif;
82 82
 				}
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 				 *
89 89
 				 * @since 1.7
90 90
 				 */
91
-				do_action( 'give_donation_history_header_after' );
91
+				do_action('give_donation_history_header_after');
92 92
 				?>
93 93
 			</tr>
94 94
 			</thead>
95
-			<?php foreach ( $donations as $post ) :
96
-				setup_postdata( $post );
97
-				$donation_data = give_get_payment_meta( $post->ID ); ?>
95
+			<?php foreach ($donations as $post) :
96
+				setup_postdata($post);
97
+				$donation_data = give_get_payment_meta($post->ID); ?>
98 98
 				<tr class="give-donation-row">
99 99
 					<?php
100 100
 					/**
@@ -107,36 +107,36 @@  discard block
 block discarded – undo
107 107
 					 * @param int   $post_id       The ID of the post.
108 108
 					 * @param mixed $donation_data Payment meta data.
109 109
 					 */
110
-					do_action( 'give_donation_history_row_start', $post->ID, $donation_data );
110
+					do_action('give_donation_history_row_start', $post->ID, $donation_data);
111 111
 
112
-					if ( filter_var( $donation_history_args['id'], FILTER_VALIDATE_BOOLEAN ) ) :
112
+					if (filter_var($donation_history_args['id'], FILTER_VALIDATE_BOOLEAN)) :
113 113
 						echo sprintf(
114 114
 							'<td class="give-donation-id">#%1$s</td>',
115
-							give_get_payment_number( $post->ID )
115
+							give_get_payment_number($post->ID)
116 116
 						);
117 117
 					endif;
118 118
 
119
-					if ( filter_var( $donation_history_args['date'], FILTER_VALIDATE_BOOLEAN ) ) :
119
+					if (filter_var($donation_history_args['date'], FILTER_VALIDATE_BOOLEAN)) :
120 120
 						echo sprintf(
121 121
 							'<td class="give-donation-date">%1$s</td>',
122
-							date_i18n( give_date_format(), strtotime( get_post_field( 'post_date', $post->ID ) ) )
122
+							date_i18n(give_date_format(), strtotime(get_post_field('post_date', $post->ID)))
123 123
 						);
124 124
 					endif;
125 125
 
126
-					if ( filter_var( $donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN ) ) :
126
+					if (filter_var($donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN)) :
127 127
 						echo sprintf(
128 128
 							'<td class="give-donation-donor">%1$s</td>',
129
-							give_get_donor_name_by( $post->ID )
129
+							give_get_donor_name_by($post->ID)
130 130
 						);
131 131
 					endif;
132 132
 					?>
133 133
 
134
-					<?php if ( filter_var( $donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
134
+					<?php if (filter_var($donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN)) : ?>
135 135
 						<td class="give-donation-amount">
136 136
 						<span class="give-donation-amount">
137 137
 							<?php
138
-							$currency_code   = give_get_payment_currency_code( $post->ID );
139
-							$donation_amount = give_donation_amount( $post->ID, true );
138
+							$currency_code   = give_get_payment_currency_code($post->ID);
139
+							$donation_amount = give_donation_amount($post->ID, true);
140 140
 
141 141
 							/**
142 142
 							 * Filters the donation amount on Donation History Page.
@@ -148,42 +148,42 @@  discard block
 block discarded – undo
148 148
 							 *
149 149
 							 * @return int
150 150
 							 */
151
-							echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID );
151
+							echo apply_filters('give_donation_history_row_amount', $donation_amount, $post->ID);
152 152
 							?>
153 153
 						</span>
154 154
 						</td>
155 155
 					<?php endif; ?>
156 156
 
157 157
 					<?php
158
-					if ( filter_var( $donation_history_args['status'], FILTER_VALIDATE_BOOLEAN ) ) :
158
+					if (filter_var($donation_history_args['status'], FILTER_VALIDATE_BOOLEAN)) :
159 159
 						echo sprintf(
160 160
 							'<td class="give-donation-status">%1$s</td>',
161
-							give_get_payment_status( $post, true )
161
+							give_get_payment_status($post, true)
162 162
 						);
163 163
 					endif;
164 164
 
165
-					if ( filter_var( $donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN ) ) :
165
+					if (filter_var($donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN)) :
166 166
 						echo sprintf(
167 167
 							'<td class="give-donation-payment-method">%1$s</td>',
168
-							give_get_gateway_checkout_label( give_get_payment_gateway( $post->ID ) )
168
+							give_get_gateway_checkout_label(give_get_payment_gateway($post->ID))
169 169
 						);
170 170
 					endif;
171 171
 					?>
172 172
 					<td class="give-donation-details">
173 173
 						<?php
174 174
 						// Display View Receipt or.
175
-						if ( 'publish' !== $post->post_status && 'subscription' !== $post->post_status ) :
175
+						if ('publish' !== $post->post_status && 'subscription' !== $post->post_status) :
176 176
 							echo sprintf(
177 177
 								'<a href="%1$s"><span class="give-donation-status %2$s">%3$s</span></a>',
178 178
 								esc_url(
179 179
 									add_query_arg(
180 180
 										'payment_key',
181
-										give_get_payment_key( $post->ID ),
181
+										give_get_payment_key($post->ID),
182 182
 										give_get_history_page_uri()
183 183
 									)
184 184
 								),
185 185
 								$post->post_status,
186
-								__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' &raquo;'
186
+								__('View', 'give').' '.give_get_payment_status($post, true).' &raquo;'
187 187
 							);
188 188
 
189 189
 						else :
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
 								esc_url(
193 193
 									add_query_arg(
194 194
 										'payment_key',
195
-										give_get_payment_key( $post->ID ),
195
+										give_get_payment_key($post->ID),
196 196
 										give_get_history_page_uri()
197 197
 									)
198 198
 								),
199
-								__( 'View Receipt &raquo;', 'give' )
199
+								__('View Receipt &raquo;', 'give')
200 200
 							);
201 201
 
202 202
 						endif;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 					 * @param int   $post_id       The ID of the post.
214 214
 					 * @param mixed $donation_data Payment meta data.
215 215
 					 */
216
-					do_action( 'give_donation_history_row_end', $post->ID, $donation_data );
216
+					do_action('give_donation_history_row_end', $post->ID, $donation_data);
217 217
 					?>
218 218
 				</tr>
219 219
 			<?php endforeach; ?>
@@ -226,22 +226,22 @@  discard block
 block discarded – undo
226 226
 			 *
227 227
 			 * @since 1.8.17
228 228
 			 */
229
-			do_action( 'give_donation_history_table_end' );
229
+			do_action('give_donation_history_table_end');
230 230
 			?>
231 231
 		</table>
232 232
 		<div id="give-donation-history-pagination" class="give_pagination navigation">
233 233
 			<?php
234 234
 			$big = 999999;
235
-			echo paginate_links( array(
236
-				'base'    => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
235
+			echo paginate_links(array(
236
+				'base'    => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
237 237
 				'format'  => '?paged=%#%',
238
-				'current' => max( 1, get_query_var( 'paged' ) ),
239
-				'total'   => ceil( give_count_donations_of_donor() / 20 ) // 20 items per page
240
-			) );
238
+				'current' => max(1, get_query_var('paged')),
239
+				'total'   => ceil(give_count_donations_of_donor() / 20) // 20 items per page
240
+			));
241 241
 			?>
242 242
 		</div>
243 243
 	</div>
244 244
 	<?php wp_reset_postdata(); ?>
245 245
 <?php else : ?>
246
-	<?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?>
246
+	<?php Give()->notices->print_frontend_notice(__('It looks like you haven\'t made any donations.', 'give'), true, 'success'); ?>
247 247
 <?php endif;
248 248
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -186,7 +186,8 @@  discard block
 block discarded – undo
186 186
 								__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' &raquo;'
187 187
 							);
188 188
 
189
-						else :
189
+						else {
190
+							:
190 191
 							echo sprintf(
191 192
 								'<a href="%1$s">%2$s</a>',
192 193
 								esc_url(
@@ -198,6 +199,7 @@  discard block
 block discarded – undo
198 199
 								),
199 200
 								__( 'View Receipt &raquo;', 'give' )
200 201
 							);
202
+						}
201 203
 
202 204
 						endif;
203 205
 						?>
@@ -242,6 +244,9 @@  discard block
 block discarded – undo
242 244
 		</div>
243 245
 	</div>
244 246
 	<?php wp_reset_postdata(); ?>
245
-<?php else : ?>
246
-	<?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?>
247
+<?php else {
248
+	: ?>
249
+	<?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' );
250
+}
251
+?>
247 252
 <?php endif;
248 253
\ No newline at end of file
Please login to merge, or discard this patch.
templates/email-login-form.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,26 +8,26 @@  discard block
 block discarded – undo
8 8
 global $give_access_form_outputted;
9 9
 
10 10
 // Only output the form once.
11
-if ( $give_access_form_outputted ) {
11
+if ($give_access_form_outputted) {
12 12
 	return;
13 13
 }
14 14
 
15
-$recaptcha_key    = give_get_option( 'recaptcha_key' );
16
-$recaptcha_secret = give_get_option( 'recaptcha_secret' );
17
-$enable_recaptcha = ! empty( $recaptcha_key ) && ! empty( $recaptcha_secret ) ? true : false;
15
+$recaptcha_key    = give_get_option('recaptcha_key');
16
+$recaptcha_secret = give_get_option('recaptcha_secret');
17
+$enable_recaptcha = ! empty($recaptcha_key) && ! empty($recaptcha_secret) ? true : false;
18 18
 
19 19
 // Email already sent?
20
-if ( isset( $_POST['email-access-sent'] ) ) {
21
-	Give()->notices->print_frontend_notice( __( 'Please check your email and click on the link to access your complete donation history.', 'give' ), true, 'success' );
20
+if (isset($_POST['email-access-sent'])) {
21
+	Give()->notices->print_frontend_notice(__('Please check your email and click on the link to access your complete donation history.', 'give'), true, 'success');
22 22
 
23 23
 	return;
24
-} elseif ( isset( $_POST['email-access-exhausted'] ) ) {
24
+} elseif (isset($_POST['email-access-exhausted'])) {
25 25
 
26 26
 	// Too many emails sent?
27 27
 	Give()->notices->print_frontend_notice(
28 28
 		sprintf(
29
-			__( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ),
30
-			sprintf( _n( '%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give' ), Give()->email_access->verify_throttle / 60 )
29
+			__('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'),
30
+			sprintf(_n('%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give'), Give()->email_access->verify_throttle / 60)
31 31
 		),
32 32
 		true,
33 33
 		'error'
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
  *
43 43
  * @since 1.8.17
44 44
  */
45
-do_action( 'give_email_access_form_login' );
45
+do_action('give_email_access_form_login');
46 46
 
47 47
 // Print any other messages & errors.
48 48
 Give()->notices->render_frontend_notices();
@@ -51,17 +51,17 @@  discard block
 block discarded – undo
51 51
 	<div class="give-form">
52 52
 		<form method="post" id="give-email-access-form">
53 53
 
54
-			<p><?php echo apply_filters( 'give_email_access_welcome_message', __( 'Please verify your email to access your donation history.', 'give' ) ); ?></p>
54
+			<p><?php echo apply_filters('give_email_access_welcome_message', __('Please verify your email to access your donation history.', 'give')); ?></p>
55 55
 
56
-			<label for="give-email"><?php _e( 'Donation Email:', 'give' ); ?></label>
56
+			<label for="give-email"><?php _e('Donation Email:', 'give'); ?></label>
57 57
 			<input id="give-email" type="email" name="give_email" value=""
58
-			       placeholder="<?php _e( 'Email Address', 'give' ); ?>" />
59
-			<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'give' ); ?>" />
58
+			       placeholder="<?php _e('Email Address', 'give'); ?>" />
59
+			<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('give'); ?>" />
60 60
 			<input type="hidden" name="give_action" value="email_access_form_login" />
61 61
 
62 62
 			<?php
63 63
 			// Enable reCAPTCHA?
64
-			if ( $enable_recaptcha ) :
64
+			if ($enable_recaptcha) :
65 65
 				?>
66 66
 				<script>
67 67
 									// IP verify for reCAPTCHA.
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 				<input type="hidden" name="give_ip" class="give_ip" value="" />
80 80
 			<?php endif; ?>
81 81
 
82
-			<input type="submit" class="give-submit" value="<?php _e( 'Verify Email', 'give' ); ?>" />
82
+			<input type="submit" class="give-submit" value="<?php _e('Verify Email', 'give'); ?>" />
83 83
 		</form>
84 84
 	</div>
85 85
 <?php
Please login to merge, or discard this patch.
includes/admin/donors/donors.php 1 patch
Spacing   +170 added lines, -170 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
 
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
  */
25 25
 function give_donors_page() {
26 26
 	$default_views  = give_donor_views();
27
-	$requested_view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : 'donors';
28
-	if ( array_key_exists( $requested_view, $default_views ) && function_exists( $default_views[ $requested_view ] ) ) {
29
-		give_render_donor_view( $requested_view, $default_views );
27
+	$requested_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : 'donors';
28
+	if (array_key_exists($requested_view, $default_views) && function_exists($default_views[$requested_view])) {
29
+		give_render_donor_view($requested_view, $default_views);
30 30
 	} else {
31 31
 		give_donors_list();
32 32
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 	$views = array();
44 44
 
45
-	return apply_filters( 'give_donor_views', $views );
45
+	return apply_filters('give_donor_views', $views);
46 46
 
47 47
 }
48 48
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 	$tabs = array();
58 58
 
59
-	return apply_filters( 'give_donor_tabs', $tabs );
59
+	return apply_filters('give_donor_tabs', $tabs);
60 60
 
61 61
 }
62 62
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
  * @return void
68 68
  */
69 69
 function give_donors_list() {
70
-	include dirname( __FILE__ ) . '/class-donor-table.php';
70
+	include dirname(__FILE__).'/class-donor-table.php';
71 71
 
72 72
 	$donors_table = new Give_Donor_List_Table();
73 73
 	$donors_table->prepare_items();
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
 		 *
81 81
 		 * @since 1.0
82 82
 		 */
83
-		do_action( 'give_donors_table_top' );
83
+		do_action('give_donors_table_top');
84 84
 		?>
85 85
 
86 86
 		<hr class="wp-header-end">
87
-		<form id="give-donors-search-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>">
88
-			<?php $donors_table->search_box( __( 'Search Donors', 'give' ), 'give-donors' ); ?>
87
+		<form id="give-donors-search-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>">
88
+			<?php $donors_table->search_box(__('Search Donors', 'give'), 'give-donors'); ?>
89 89
 			<input type="hidden" name="post_type" value="give_forms" />
90 90
 			<input type="hidden" name="page" value="give-donors" />
91 91
 			<input type="hidden" name="view" value="donors" />
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		 *
103 103
 		 * @since 1.0
104 104
 		 */
105
-		do_action( 'give_donors_table_bottom' );
105
+		do_action('give_donors_table_bottom');
106 106
 		?>
107 107
 	</div>
108 108
 	<?php
@@ -118,33 +118,33 @@  discard block
 block discarded – undo
118 118
  *
119 119
  * @return void
120 120
  */
121
-function give_render_donor_view( $view, $callbacks ) {
121
+function give_render_donor_view($view, $callbacks) {
122 122
 
123 123
 	$render = true;
124 124
 
125
-	$donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' );
125
+	$donor_view_role = apply_filters('give_view_donors_role', 'view_give_reports');
126 126
 
127
-	if ( ! current_user_can( $donor_view_role ) ) {
128
-		give_set_error( 'give-no-access', __( 'You are not permitted to view this data.', 'give' ) );
127
+	if ( ! current_user_can($donor_view_role)) {
128
+		give_set_error('give-no-access', __('You are not permitted to view this data.', 'give'));
129 129
 		$render = false;
130 130
 	}
131 131
 
132
-	if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
133
-		give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) );
132
+	if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
133
+		give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give'));
134 134
 		$render = false;
135 135
 	}
136 136
 
137 137
 	$donor_id          = (int) $_GET['id'];
138
-	$reconnect_user_id = ! empty( $_GET['user_id'] ) ? (int) $_GET['user_id'] : '';
139
-	$donor             = new Give_Donor( $donor_id );
138
+	$reconnect_user_id = ! empty($_GET['user_id']) ? (int) $_GET['user_id'] : '';
139
+	$donor             = new Give_Donor($donor_id);
140 140
 
141 141
 	// Reconnect User with Donor profile.
142
-	if( $reconnect_user_id ) {
143
-		give_connect_user_donor_profile( $donor, array( 'user_id' => $reconnect_user_id ), array() );
142
+	if ($reconnect_user_id) {
143
+		give_connect_user_donor_profile($donor, array('user_id' => $reconnect_user_id), array());
144 144
 	}
145 145
 
146
-	if ( empty( $donor->id ) ) {
147
-		give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) );
146
+	if (empty($donor->id)) {
147
+		give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give'));
148 148
 		$render = false;
149 149
 	}
150 150
 
@@ -153,9 +153,9 @@  discard block
 block discarded – undo
153 153
 
154 154
 	<div class='wrap'>
155 155
 
156
-		<?php if ( give_get_errors() ) : ?>
156
+		<?php if (give_get_errors()) : ?>
157 157
 			<div class="error settings-error">
158
-				<?php Give()->notices->render_frontend_notices( 0 ); ?>
158
+				<?php Give()->notices->render_frontend_notices(0); ?>
159 159
 			</div>
160 160
 		<?php endif; ?>
161 161
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 			<?php
164 164
 			printf(
165 165
 			/* translators: %s: donor number */
166
-				esc_html__( 'Donor %s', 'give' ),
166
+				esc_html__('Donor %s', 'give'),
167 167
 				$donor_id
168 168
 			);
169 169
 			?>
@@ -171,26 +171,26 @@  discard block
 block discarded – undo
171 171
 
172 172
 		<hr class="wp-header-end">
173 173
 		
174
-		<?php if ( $donor && $render ) : ?>
174
+		<?php if ($donor && $render) : ?>
175 175
 
176 176
 			<h2 class="nav-tab-wrapper">
177 177
 				<?php
178
-				foreach ( $donor_tabs as $key => $tab ) :
178
+				foreach ($donor_tabs as $key => $tab) :
179 179
 					$active = $key === $view ? true : false;
180 180
 					$class = $active ? 'nav-tab nav-tab-active' : 'nav-tab';
181 181
 					printf(
182
-						'<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>' . "\n",
183
-						esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $donor->id ) ),
184
-						esc_attr( $class ),
185
-						sanitize_html_class( $tab['dashicon'] ),
186
-						esc_html( $tab['title'] )
182
+						'<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>'."\n",
183
+						esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$donor->id)),
184
+						esc_attr($class),
185
+						sanitize_html_class($tab['dashicon']),
186
+						esc_html($tab['title'])
187 187
 					);
188 188
 				endforeach;
189 189
 				?>
190 190
 			</h2>
191 191
 
192 192
 			<div id="give-donor-card-wrapper">
193
-				<?php $callbacks[ $view ]( $donor ) ?>
193
+				<?php $callbacks[$view]($donor) ?>
194 194
 			</div>
195 195
 
196 196
 		<?php endif; ?>
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
  *
211 211
  * @return void
212 212
  */
213
-function give_donor_view( $donor ) {
213
+function give_donor_view($donor) {
214 214
 
215
-	$donor_edit_role   = apply_filters( 'give_edit_donors_role', 'edit_give_payments' );
215
+	$donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments');
216 216
 
217 217
 	/**
218 218
 	 * Fires in donor profile screen, above the donor card.
@@ -221,32 +221,32 @@  discard block
 block discarded – undo
221 221
 	 *
222 222
 	 * @param object $donor The donor object being displayed.
223 223
 	 */
224
-	do_action( 'give_donor_card_top', $donor );
224
+	do_action('give_donor_card_top', $donor);
225 225
 	?>
226 226
 
227 227
 	<div id="donor-summary" class="info-wrapper donor-section postbox">
228 228
 
229
-		<form id="edit-donor-info" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>">
229
+		<form id="edit-donor-info" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>">
230 230
 
231 231
 			<div class="donor-info">
232 232
 
233 233
 				<div class="donor-bio-header clearfix">
234 234
 
235 235
 					<div class="avatar-wrap left" id="donor-avatar">
236
-						<?php echo get_avatar( $donor->email ); ?>
236
+						<?php echo get_avatar($donor->email); ?>
237 237
 					</div>
238 238
 
239 239
 					<div id="donor-name-wrap" class="left">
240 240
 						<span class="donor-id">#<?php echo $donor->id; ?></span>
241
-						<span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr( $donor->name ); ?>" placeholder="<?php _e( 'Donor Name', 'give' ); ?>" /></span>
241
+						<span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr($donor->name); ?>" placeholder="<?php _e('Donor Name', 'give'); ?>" /></span>
242 242
 						<span class="donor-name info-item editable"><span data-key="name"><?php echo $donor->name; ?></span></span>
243 243
 					</div>
244 244
 					<p class="donor-since info-item">
245
-						<?php _e( 'Donor since', 'give' ); ?>
246
-						<?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?>
245
+						<?php _e('Donor since', 'give'); ?>
246
+						<?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?>
247 247
 					</p>
248
-					<?php if ( current_user_can( $donor_edit_role ) ) : ?>
249
-						<a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php _e( 'Edit Donor', 'give' ); ?></a>
248
+					<?php if (current_user_can($donor_edit_role)) : ?>
249
+						<a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php _e('Edit Donor', 'give'); ?></a>
250 250
 					<?php endif; ?>
251 251
 				</div>
252 252
 				<!-- /donor-bio-header -->
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 					<table class="widefat">
257 257
 						<tbody>
258 258
 						<tr class="alternate">
259
-							<th scope="col"><label for="tablecell"><?php _e( 'User:', 'give' ); ?></label></th>
259
+							<th scope="col"><label for="tablecell"><?php _e('User:', 'give'); ?></label></th>
260 260
 							<td>
261 261
 								<span class="donor-user-id info-item edit-item">
262 262
 									<?php
@@ -273,48 +273,48 @@  discard block
 block discarded – undo
273 273
 										'data'  => $data_atts,
274 274
 									);
275 275
 
276
-									if ( ! empty( $user_id ) ) {
277
-										$userdata           = get_userdata( $user_id );
276
+									if ( ! empty($user_id)) {
277
+										$userdata = get_userdata($user_id);
278 278
 										$user_args['selected'] = $user_id;
279 279
 									}
280 280
 
281
-									echo Give()->html->ajax_user_search( $user_args );
281
+									echo Give()->html->ajax_user_search($user_args);
282 282
 									?>
283 283
 								</span>
284 284
 
285 285
 								<span class="donor-user-id info-item editable">
286
-									<?php if ( ! empty( $userdata ) ) { ?>
287
-										<span data-key="user_id">#<?php echo $donor->user_id . ' - ' . $userdata->display_name; ?></span>
286
+									<?php if ( ! empty($userdata)) { ?>
287
+										<span data-key="user_id">#<?php echo $donor->user_id.' - '.$userdata->display_name; ?></span>
288 288
 									<?php } else { ?>
289
-										<span data-key="user_id"><?php _e( 'None', 'give' ); ?></span>
289
+										<span data-key="user_id"><?php _e('None', 'give'); ?></span>
290 290
 									<?php } ?>
291
-									<?php if ( current_user_can( $donor_edit_role ) && intval( $donor->user_id ) > 0 ) { ?>
291
+									<?php if (current_user_can($donor_edit_role) && intval($donor->user_id) > 0) { ?>
292 292
 										<span class="disconnect-user">
293 293
  											-
294
- 											<a id="disconnect-donor" href="#disconnect" aria-label="<?php _e( 'Disconnects the current user ID from this donor record.', 'give' ); ?>">
295
- 												<?php _e( 'Disconnect User', 'give' ); ?>
294
+ 											<a id="disconnect-donor" href="#disconnect" aria-label="<?php _e('Disconnects the current user ID from this donor record.', 'give'); ?>">
295
+ 												<?php _e('Disconnect User', 'give'); ?>
296 296
 											</a>
297 297
  										</span>
298 298
 										<span class="view-user-profile">
299 299
  											|
300
- 											<a id="view-user-profile" href="<?php echo 'user-edit.php?user_id=' . $donor->user_id; ?>" aria-label="<?php _e( 'View User Profile of current user ID.', 'give' ); ?>">
301
- 												<?php _e( 'View User Profile', 'give' ); ?>
300
+ 											<a id="view-user-profile" href="<?php echo 'user-edit.php?user_id='.$donor->user_id; ?>" aria-label="<?php _e('View User Profile of current user ID.', 'give'); ?>">
301
+ 												<?php _e('View User Profile', 'give'); ?>
302 302
 											</a>
303 303
  										</span>
304 304
 									<?php } ?>
305 305
 								</span>
306 306
 							</td>
307 307
 						</tr>
308
-						<?php if ( isset( $donor->user_id ) && $donor->user_id > 0 ) : ?>
308
+						<?php if (isset($donor->user_id) && $donor->user_id > 0) : ?>
309 309
 
310 310
 							<tr>
311
-								<th scope="col"><?php _e( 'Address:', 'give' ); ?></th>
311
+								<th scope="col"><?php _e('Address:', 'give'); ?></th>
312 312
 								<td class="row-title">
313 313
 
314 314
 									<div class="donor-address-wrapper">
315 315
 
316 316
 										<?php
317
-										$address  = get_user_meta( $donor->user_id, '_give_user_address', true );
317
+										$address  = get_user_meta($donor->user_id, '_give_user_address', true);
318 318
 										$defaults = array(
319 319
 											'line1'   => '',
320 320
 											'line2'   => '',
@@ -324,10 +324,10 @@  discard block
 block discarded – undo
324 324
 											'zip'     => '',
325 325
 										);
326 326
 
327
-										$address = wp_parse_args( $address, $defaults );
327
+										$address = wp_parse_args($address, $defaults);
328 328
 										?>
329 329
 
330
-										<?php if ( ! empty( $address ) ) { ?>
330
+										<?php if ( ! empty($address)) { ?>
331 331
 											<span class="donor-address info-item editable">
332 332
 												<span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span>
333 333
 												<span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span>
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
 
345 345
 										// For State.
346 346
 										$selected_state = give_get_state();
347
-										$states         = give_get_states( $selected_country );
348
-										$selected_state = ( isset( $address['state'] ) ? $address['state'] : $selected_state );
347
+										$states         = give_get_states($selected_country);
348
+										$selected_state = (isset($address['state']) ? $address['state'] : $selected_state);
349 349
 
350 350
 										// Get the country list that does not have any states init.
351 351
 										$no_states_country = give_no_states_country_list();
@@ -353,32 +353,32 @@  discard block
 block discarded – undo
353 353
 										<span class="donor-address info-item edit-item">
354 354
 											<select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item">
355 355
 												<?php
356
-												foreach ( $countries as $country_code => $country ) {
357
-													echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
356
+												foreach ($countries as $country_code => $country) {
357
+													echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>';
358 358
 												}
359 359
 												?>
360 360
 											</select>
361
-											<input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php _e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" />
362
-											<input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php _e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" />
363
-											<input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php _e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" />
361
+											<input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php _e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" />
362
+											<input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php _e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" />
363
+											<input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php _e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" />
364 364
 											<?php
365
-											if ( ! empty( $states ) ) {
365
+											if ( ! empty($states)) {
366 366
 												?>
367 367
 												<select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item">
368 368
 													<?php
369
-													foreach ( $states as $state_code => $state ) {
370
-														echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
369
+													foreach ($states as $state_code => $state) {
370
+														echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
371 371
 													}
372 372
 													?>
373 373
 												</select>
374 374
 												<?php
375 375
 											} else {
376 376
 												?>
377
-												<input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item <?php echo ( ! empty( $selected_country ) && array_key_exists( $selected_country, $no_states_country ) ? 'give-hidden' : '' ); ?>" placeholder="<?php _e( 'State / Province / County', 'give' ); ?>" />
377
+												<input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item <?php echo ( ! empty($selected_country) && array_key_exists($selected_country, $no_states_country) ? 'give-hidden' : ''); ?>" placeholder="<?php _e('State / Province / County', 'give'); ?>" />
378 378
 												<?php
379 379
 											}
380 380
 											?>
381
-											<input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php _e( 'Zip / Postal Code', 'give' ); ?>" value="<?php echo $address['zip']; ?>" />
381
+											<input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php _e('Zip / Postal Code', 'give'); ?>" value="<?php echo $address['zip']; ?>" />
382 382
 										</span>
383 383
 
384 384
 									</div>
@@ -394,10 +394,10 @@  discard block
 block discarded – undo
394 394
 
395 395
 			<span id="donor-edit-actions" class="edit-item">
396 396
 				<input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $donor->id; ?>" />
397
-				<?php wp_nonce_field( 'edit-donor', '_wpnonce', false, true ); ?>
397
+				<?php wp_nonce_field('edit-donor', '_wpnonce', false, true); ?>
398 398
 				<input type="hidden" name="give_action" value="edit-donor" />
399
-				<input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php _e( 'Update Donor', 'give' ); ?>" />
400
-				<a id="give-edit-donor-cancel" href="" class="delete"><?php _e( 'Cancel', 'give' ); ?></a>
399
+				<input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php _e('Update Donor', 'give'); ?>" />
400
+				<a id="give-edit-donor-cancel" href="" class="delete"><?php _e('Cancel', 'give'); ?></a>
401 401
 			</span>
402 402
 
403 403
 		</form>
@@ -412,24 +412,24 @@  discard block
 block discarded – undo
412 412
 	 *
413 413
 	 * @param object $donor The donor object being displayed.
414 414
 	 */
415
-	do_action( 'give_donor_before_stats', $donor );
415
+	do_action('give_donor_before_stats', $donor);
416 416
 	?>
417 417
 
418 418
 	<div id="donor-stats-wrapper" class="donor-section postbox clear">
419 419
 		<ul>
420 420
 			<li>
421
-				<a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $donor->id ) ); ?>">
421
+				<a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&donor='.absint($donor->id)); ?>">
422 422
 					<span class="dashicons dashicons-heart"></span>
423 423
 					<?php
424 424
 					// Completed Donations.
425
-					$completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give' ), $donor->purchase_count );
426
-					echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $donor );
425
+					$completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give'), $donor->purchase_count);
426
+					echo apply_filters('give_donor_completed_donations', $completed_donations_text, $donor);
427 427
 					?>
428 428
 				</a>
429 429
 			</li>
430 430
 			<li>
431 431
 				<span class="dashicons dashicons-chart-area"></span>
432
-				<?php echo give_currency_filter( give_format_amount( $donor->get_total_donation_amount(), array( 'sanitize' => false ) ) ); ?> <?php _e( 'Lifetime Donations', 'give' ); ?>
432
+				<?php echo give_currency_filter(give_format_amount($donor->get_total_donation_amount(), array('sanitize' => false))); ?> <?php _e('Lifetime Donations', 'give'); ?>
433 433
 			</li>
434 434
 			<?php
435 435
 			/**
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 			 *
442 442
 			 * @param object $donor The donor object being displayed.
443 443
 			 */
444
-			do_action( 'give_donor_stats_list', $donor );
444
+			do_action('give_donor_stats_list', $donor);
445 445
 			?>
446 446
 		</ul>
447 447
 	</div>
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 	 *
455 455
 	 * @param object $donor The donor object being displayed.
456 456
 	 */
457
-	do_action( 'give_donor_before_tables_wrapper', $donor );
457
+	do_action('give_donor_before_tables_wrapper', $donor);
458 458
 	?>
459 459
 
460 460
 	<div id="donor-tables-wrapper" class="donor-section">
@@ -467,46 +467,46 @@  discard block
 block discarded – undo
467 467
 		 *
468 468
 		 * @param object $donor The donor object being displayed.
469 469
 		 */
470
-		do_action( 'give_donor_before_tables', $donor );
470
+		do_action('give_donor_before_tables', $donor);
471 471
 		?>
472 472
 
473
-		<h3><?php _e( 'Donor Emails', 'give' ); ?></h3>
473
+		<h3><?php _e('Donor Emails', 'give'); ?></h3>
474 474
 
475 475
 		<table class="wp-list-table widefat striped emails">
476 476
 			<thead>
477 477
 			<tr>
478
-				<th><?php _e( 'Email', 'give' ); ?></th>
479
-				<th><?php _e( 'Actions', 'give' ); ?></th>
478
+				<th><?php _e('Email', 'give'); ?></th>
479
+				<th><?php _e('Actions', 'give'); ?></th>
480 480
 			</tr>
481 481
 			</thead>
482 482
 
483 483
 			<tbody>
484
-			<?php if ( ! empty( $donor->emails ) ) { ?>
484
+			<?php if ( ! empty($donor->emails)) { ?>
485 485
 
486
-				<?php foreach ( $donor->emails as $key => $email ) : ?>
486
+				<?php foreach ($donor->emails as $key => $email) : ?>
487 487
 					<tr data-key="<?php echo $key; ?>">
488 488
 						<td>
489 489
 							<?php echo $email; ?>
490
-							<?php if ( 'primary' === $key ) : ?>
490
+							<?php if ('primary' === $key) : ?>
491 491
 								<span class="dashicons dashicons-star-filled primary-email-icon"></span>
492 492
 							<?php endif; ?>
493 493
 						</td>
494 494
 						<td>
495
-							<?php if ( 'primary' !== $key ) : ?>
495
+							<?php if ('primary' !== $key) : ?>
496 496
 								<?php
497
-								$base_url    = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id );
498
-								$promote_url = wp_nonce_url( add_query_arg( array(
499
-									'email' => rawurlencode( $email ),
497
+								$base_url    = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id);
498
+								$promote_url = wp_nonce_url(add_query_arg(array(
499
+									'email' => rawurlencode($email),
500 500
 									'give_action' => 'set_donor_primary_email',
501
-								), $base_url ), 'give-set-donor-primary-email' );
502
-								$remove_url  = wp_nonce_url( add_query_arg( array(
503
-									'email' => rawurlencode( $email ),
501
+								), $base_url), 'give-set-donor-primary-email');
502
+								$remove_url = wp_nonce_url(add_query_arg(array(
503
+									'email' => rawurlencode($email),
504 504
 									'give_action' => 'remove_donor_email',
505
-								), $base_url ), 'give-remove-donor-email' );
505
+								), $base_url), 'give-remove-donor-email');
506 506
 								?>
507
-								<a href="<?php echo $promote_url; ?>"><?php _e( 'Make Primary', 'give' ); ?></a>
507
+								<a href="<?php echo $promote_url; ?>"><?php _e('Make Primary', 'give'); ?></a>
508 508
 								&nbsp;|&nbsp;
509
-								<a href="<?php echo $remove_url; ?>" class="delete"><?php _e( 'Remove', 'give' ); ?></a>
509
+								<a href="<?php echo $remove_url; ?>" class="delete"><?php _e('Remove', 'give'); ?></a>
510 510
 							<?php endif; ?>
511 511
 						</td>
512 512
 					</tr>
@@ -516,59 +516,59 @@  discard block
 block discarded – undo
516 516
 					<td colspan="2" class="add-donor-email-td">
517 517
 						<div class="add-donor-email-wrapper">
518 518
 							<input type="hidden" name="donor-id" value="<?php echo $donor->id; ?>" />
519
-							<?php wp_nonce_field( 'give_add_donor_email', 'add_email_nonce', false, true ); ?>
520
-							<input type="email" name="additional-email" value="" placeholder="<?php _e( 'Email Address', 'give' ); ?>" />&nbsp;
521
-							<input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" />&nbsp;<label for="make-additional-primary"><?php _e( 'Make Primary', 'give' ); ?></label>
522
-							<button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e( 'Add Email', 'give' ); ?></button>
519
+							<?php wp_nonce_field('give_add_donor_email', 'add_email_nonce', false, true); ?>
520
+							<input type="email" name="additional-email" value="" placeholder="<?php _e('Email Address', 'give'); ?>" />&nbsp;
521
+							<input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" />&nbsp;<label for="make-additional-primary"><?php _e('Make Primary', 'give'); ?></label>
522
+							<button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e('Add Email', 'give'); ?></button>
523 523
 							<span class="spinner"></span>
524 524
 						</div>
525 525
 						<div class="notice-wrap"></div>
526 526
 					</td>
527 527
 				</tr>
528 528
 			<?php } else { ?>
529
-				<tr><td colspan="2"><?php _e( 'No Emails Found', 'give' ); ?></td></tr>
529
+				<tr><td colspan="2"><?php _e('No Emails Found', 'give'); ?></td></tr>
530 530
 			<?php }// End if().
531 531
 			?>
532 532
 			</tbody>
533 533
 		</table>
534 534
 
535
-		<h3><?php _e( 'Recent Donations', 'give' ); ?></h3>
535
+		<h3><?php _e('Recent Donations', 'give'); ?></h3>
536 536
 		<?php
537
-		$payment_ids = explode( ',', $donor->payment_ids );
538
-		$payments    = give_get_payments( array(
537
+		$payment_ids = explode(',', $donor->payment_ids);
538
+		$payments    = give_get_payments(array(
539 539
 			'post__in' => $payment_ids,
540
-		) );
541
-		$payments    = array_slice( $payments, 0, 10 );
540
+		));
541
+		$payments    = array_slice($payments, 0, 10);
542 542
 		?>
543 543
 		<table class="wp-list-table widefat striped payments">
544 544
 			<thead>
545 545
 			<tr>
546
-				<th scope="col"><?php _e( 'ID', 'give' ); ?></th>
547
-				<th scope="col"><?php _e( 'Amount', 'give' ); ?></th>
548
-				<th scope="col"><?php _e( 'Date', 'give' ); ?></th>
549
-				<th scope="col"><?php _e( 'Status', 'give' ); ?></th>
550
-				<th scope="col"><?php _e( 'Actions', 'give' ); ?></th>
546
+				<th scope="col"><?php _e('ID', 'give'); ?></th>
547
+				<th scope="col"><?php _e('Amount', 'give'); ?></th>
548
+				<th scope="col"><?php _e('Date', 'give'); ?></th>
549
+				<th scope="col"><?php _e('Status', 'give'); ?></th>
550
+				<th scope="col"><?php _e('Actions', 'give'); ?></th>
551 551
 			</tr>
552 552
 			</thead>
553 553
 			<tbody>
554
-			<?php if ( ! empty( $payments ) ) { ?>
555
-				<?php foreach ( $payments as $payment ) : ?>
554
+			<?php if ( ! empty($payments)) { ?>
555
+				<?php foreach ($payments as $payment) : ?>
556 556
 					<tr>
557 557
 						<td><?php echo $payment->ID; ?></td>
558
-						<td><?php echo give_donation_amount( $payment->ID ); ?></td>
559
-						<td><?php echo date_i18n( give_date_format(), strtotime( $payment->post_date ) ); ?></td>
560
-						<td><?php echo give_get_payment_status( $payment, true ); ?></td>
558
+						<td><?php echo give_donation_amount($payment->ID); ?></td>
559
+						<td><?php echo date_i18n(give_date_format(), strtotime($payment->post_date)); ?></td>
560
+						<td><?php echo give_get_payment_status($payment, true); ?></td>
561 561
 						<td>
562 562
 							<?php
563 563
 							printf(
564 564
 								'<a href="%1$s" aria-label="%2$s">%3$s</a>',
565
-								admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment->ID ),
565
+								admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$payment->ID),
566 566
 								sprintf(
567 567
 								/* translators: %s: Donation ID */
568
-									esc_attr__( 'View Donation %s.', 'give' ),
568
+									esc_attr__('View Donation %s.', 'give'),
569 569
 									$payment->ID
570 570
 								),
571
-								__( 'View Donation', 'give' )
571
+								__('View Donation', 'give')
572 572
 							);
573 573
 							?>
574 574
 
@@ -583,47 +583,47 @@  discard block
 block discarded – undo
583 583
 							 * @param object $donor The donor object being displayed.
584 584
 							 * @param object $payment  The payment object being displayed.
585 585
 							 */
586
-							do_action( 'give_donor_recent_purchases_actions', $donor, $payment );
586
+							do_action('give_donor_recent_purchases_actions', $donor, $payment);
587 587
 							?>
588 588
 						</td>
589 589
 					</tr>
590 590
 				<?php endforeach; ?>
591 591
 			<?php } else { ?>
592 592
 				<tr>
593
-					<td colspan="5"><?php _e( 'No donations found.', 'give' ); ?></td>
593
+					<td colspan="5"><?php _e('No donations found.', 'give'); ?></td>
594 594
 				</tr>
595 595
 			<?php }// End if().
596 596
 			?>
597 597
 			</tbody>
598 598
 		</table>
599 599
 
600
-		<h3><?php _e( 'Completed Forms', 'give' ); ?></h3>
600
+		<h3><?php _e('Completed Forms', 'give'); ?></h3>
601 601
 		<?php
602
-		$donations = give_get_users_completed_donations( $donor->email );
602
+		$donations = give_get_users_completed_donations($donor->email);
603 603
 		?>
604 604
 		<table class="wp-list-table widefat striped donations">
605 605
 			<thead>
606 606
 			<tr>
607
-				<th scope="col"><?php _e( 'Form', 'give' ); ?></th>
608
-				<th scope="col" width="120px"><?php _e( 'Actions', 'give' ); ?></th>
607
+				<th scope="col"><?php _e('Form', 'give'); ?></th>
608
+				<th scope="col" width="120px"><?php _e('Actions', 'give'); ?></th>
609 609
 			</tr>
610 610
 			</thead>
611 611
 			<tbody>
612
-			<?php if ( ! empty( $donations ) ) { ?>
613
-				<?php foreach ( $donations as $donation ) : ?>
612
+			<?php if ( ! empty($donations)) { ?>
613
+				<?php foreach ($donations as $donation) : ?>
614 614
 					<tr>
615 615
 						<td><?php echo $donation->post_title; ?></td>
616 616
 						<td>
617 617
 							<?php
618 618
 							printf(
619 619
 								'<a href="%1$s" aria-label="%2$s">%3$s</a>',
620
-								esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) ),
620
+								esc_url(admin_url('post.php?action=edit&post='.$donation->ID)),
621 621
 								sprintf(
622 622
 								/* translators: %s: form name */
623
-									esc_attr__( 'View Form %s.', 'give' ),
623
+									esc_attr__('View Form %s.', 'give'),
624 624
 									$donation->post_title
625 625
 								),
626
-								__( 'View Form', 'give' )
626
+								__('View Form', 'give')
627 627
 							);
628 628
 							?>
629 629
 						</td>
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 				<?php endforeach; ?>
632 632
 			<?php } else { ?>
633 633
 				<tr>
634
-					<td colspan="2"><?php _e( 'No completed donations found.', 'give' ); ?></td>
634
+					<td colspan="2"><?php _e('No completed donations found.', 'give'); ?></td>
635 635
 				</tr>
636 636
 			<?php } ?>
637 637
 			</tbody>
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 		 *
646 646
 		 * @param object $donor The donor object being displayed.
647 647
 		 */
648
-		do_action( 'give_donor_after_tables', $donor );
648
+		do_action('give_donor_after_tables', $donor);
649 649
 		?>
650 650
 
651 651
 	</div>
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 	 *
659 659
 	 * @param object $donor The donor object being displayed.
660 660
 	 */
661
-	do_action( 'give_donor_card_bottom', $donor );
661
+	do_action('give_donor_card_bottom', $donor);
662 662
 
663 663
 }
664 664
 
@@ -671,30 +671,30 @@  discard block
 block discarded – undo
671 671
  *
672 672
  * @return void
673 673
  */
674
-function give_donor_notes_view( $donor ) {
674
+function give_donor_notes_view($donor) {
675 675
 
676
-	$paged          = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1;
677
-	$paged          = absint( $paged );
676
+	$paged          = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1;
677
+	$paged          = absint($paged);
678 678
 	$note_count     = $donor->get_notes_count();
679
-	$per_page       = apply_filters( 'give_donor_notes_per_page', 20 );
680
-	$total_pages    = ceil( $note_count / $per_page );
681
-	$donor_notes = $donor->get_notes( $per_page, $paged );
679
+	$per_page       = apply_filters('give_donor_notes_per_page', 20);
680
+	$total_pages    = ceil($note_count / $per_page);
681
+	$donor_notes = $donor->get_notes($per_page, $paged);
682 682
 	?>
683 683
 
684 684
 	<div id="donor-notes-wrapper">
685 685
 		<div class="donor-notes-header">
686
-			<?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span>
686
+			<?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span>
687 687
 		</div>
688
-		<h3><?php _e( 'Notes', 'give' ); ?></h3>
688
+		<h3><?php _e('Notes', 'give'); ?></h3>
689 689
 
690
-		<?php if ( 1 == $paged ) : ?>
690
+		<?php if (1 == $paged) : ?>
691 691
 			<div style="display: block; margin-bottom: 55px;">
692
-				<form id="give-add-donor-note" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor->id ); ?>">
692
+				<form id="give-add-donor-note" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$donor->id); ?>">
693 693
 					<textarea id="donor-note" name="donor_note" class="donor-note-input" rows="10"></textarea>
694 694
 					<br />
695 695
 					<input type="hidden" id="donor-id" name="customer_id" value="<?php echo $donor->id; ?>" />
696 696
 					<input type="hidden" name="give_action" value="add-donor-note" />
697
-					<?php wp_nonce_field( 'add-donor-note', 'add_donor_note_nonce', true, true ); ?>
697
+					<?php wp_nonce_field('add-donor-note', 'add_donor_note_nonce', true, true); ?>
698 698
 					<input id="add-donor-note" class="right button-primary" type="submit" value="Add Note" />
699 699
 				</form>
700 700
 			</div>
@@ -709,26 +709,26 @@  discard block
 block discarded – undo
709 709
 			'show_all' => true,
710 710
 		);
711 711
 
712
-		echo paginate_links( $pagination_args );
712
+		echo paginate_links($pagination_args);
713 713
 		?>
714 714
 
715 715
 		<div id="give-donor-notes" class="postbox">
716
-			<?php if ( count( $donor_notes ) > 0 ) { ?>
717
-				<?php foreach ( $donor_notes as $key => $note ) : ?>
716
+			<?php if (count($donor_notes) > 0) { ?>
717
+				<?php foreach ($donor_notes as $key => $note) : ?>
718 718
 					<div class="donor-note-wrapper dashboard-comment-wrap comment-item">
719 719
 					<span class="note-content-wrap">
720
-						<?php echo stripslashes( $note ); ?>
720
+						<?php echo stripslashes($note); ?>
721 721
 					</span>
722 722
 					</div>
723 723
 				<?php endforeach; ?>
724 724
 			<?php } else { ?>
725 725
 				<div class="give-no-donor-notes">
726
-					<?php _e( 'No donor notes found.', 'give' ); ?>
726
+					<?php _e('No donor notes found.', 'give'); ?>
727 727
 				</div>
728 728
 			<?php } ?>
729 729
 		</div>
730 730
 
731
-		<?php echo paginate_links( $pagination_args ); ?>
731
+		<?php echo paginate_links($pagination_args); ?>
732 732
 
733 733
 	</div>
734 734
 
@@ -744,9 +744,9 @@  discard block
 block discarded – undo
744 744
  *
745 745
  * @return void
746 746
  */
747
-function give_donor_delete_view( $donor ) {
747
+function give_donor_delete_view($donor) {
748 748
 
749
-	$donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' );
749
+	$donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments');
750 750
 
751 751
 	/**
752 752
 	 * Fires in donor delete screen, above the content.
@@ -755,15 +755,15 @@  discard block
 block discarded – undo
755 755
 	 *
756 756
 	 * @param object $donor The donor object being displayed.
757 757
 	 */
758
-	do_action( 'give_donor_delete_top', $donor );
758
+	do_action('give_donor_delete_top', $donor);
759 759
 	?>
760 760
 
761 761
 	<div class="info-wrapper donor-section">
762 762
 
763
-		<form id="delete-donor" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $donor->id ); ?>">
763
+		<form id="delete-donor" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$donor->id); ?>">
764 764
 
765 765
 			<div class="donor-notes-header">
766
-				<?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span>
766
+				<?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span>
767 767
 			</div>
768 768
 
769 769
 
@@ -771,20 +771,20 @@  discard block
 block discarded – undo
771 771
 
772 772
 				<span class="delete-donor-options">
773 773
 					<p>
774
-						<?php echo Give()->html->checkbox( array(
774
+						<?php echo Give()->html->checkbox(array(
775 775
 							'name' => 'give-donor-delete-confirm',
776
-						) ); ?>
777
-						<label for="give-donor-delete-confirm"><?php _e( 'Are you sure you want to delete this donor?', 'give' ); ?></label>
776
+						)); ?>
777
+						<label for="give-donor-delete-confirm"><?php _e('Are you sure you want to delete this donor?', 'give'); ?></label>
778 778
 					</p>
779 779
 
780 780
 					<p>
781
-						<?php echo Give()->html->checkbox( array(
781
+						<?php echo Give()->html->checkbox(array(
782 782
 							'name'    => 'give-donor-delete-records',
783 783
 							'options' => array(
784 784
 								'disabled' => true,
785 785
 							),
786
-						) ); ?>
787
-						<label for="give-donor-delete-records"><?php _e( 'Delete all associated donations and records?', 'give' ); ?></label>
786
+						)); ?>
787
+						<label for="give-donor-delete-records"><?php _e('Delete all associated donations and records?', 'give'); ?></label>
788 788
 					</p>
789 789
 
790 790
 					<?php
@@ -797,16 +797,16 @@  discard block
 block discarded – undo
797 797
 					 *
798 798
 					 * @param object $donor The donor object being displayed.
799 799
 					 */
800
-					do_action( 'give_donor_delete_inputs', $donor );
800
+					do_action('give_donor_delete_inputs', $donor);
801 801
 					?>
802 802
 				</span>
803 803
 
804 804
 				<span id="donor-edit-actions">
805 805
 					<input type="hidden" name="customer_id" value="<?php echo $donor->id; ?>" />
806
-					<?php wp_nonce_field( 'delete-donor', '_wpnonce', false, true ); ?>
806
+					<?php wp_nonce_field('delete-donor', '_wpnonce', false, true); ?>
807 807
 					<input type="hidden" name="give_action" value="delete-donor" />
808
-					<input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php _e( 'Delete Donor', 'give' ); ?>" />
809
-					<a id="give-delete-donor-cancel" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>" class="delete"><?php _e( 'Cancel', 'give' ); ?></a>
808
+					<input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php _e('Delete Donor', 'give'); ?>" />
809
+					<a id="give-delete-donor-cancel" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>" class="delete"><?php _e('Cancel', 'give'); ?></a>
810 810
 				</span>
811 811
 
812 812
 			</div>
@@ -822,5 +822,5 @@  discard block
 block discarded – undo
822 822
 	 *
823 823
 	 * @param object $donor The donor object being displayed.
824 824
 	 */
825
-	do_action( 'give_donor_delete_bottom', $donor );
825
+	do_action('give_donor_delete_bottom', $donor);
826 826
 }
Please login to merge, or discard this patch.