Test Failed
Pull Request — master (#2814)
by Devin
05:29
created
includes/admin/settings/class-settings-general.php 1 patch
Spacing   +76 added lines, -76 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,47 +77,47 @@  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
-							'name'    => __( 'Enable reCAPTCHA', 'give' ),
92
-							'desc'    => __( 'Would you like to enable the reCAPTCHA feature?', 'give' ),
91
+							'name'    => __('Enable reCAPTCHA', 'give'),
92
+							'desc'    => __('Would you like to enable the reCAPTCHA feature?', 'give'),
93 93
 							'id'      => 'enable_recaptcha',
94 94
 							'type'    => 'radio_inline',
95 95
 							'default' => 'disabled',
96 96
 							'options' => array(
97
-								'enabled'  => __( 'Enabled', 'give' ),
98
-								'disabled' => __( 'Disabled', 'give' ),
97
+								'enabled'  => __('Enabled', 'give'),
98
+								'disabled' => __('Disabled', 'give'),
99 99
 							),
100 100
 						),
101 101
 						array(
102 102
 							'id'      => 'recaptcha_key',
103
-							'name'    => __( 'reCAPTCHA Site Key', 'give' ),
103
+							'name'    => __('reCAPTCHA Site Key', 'give'),
104 104
 							/* translators: %s: https://www.google.com/recaptcha/ */
105
-							'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' ) ),
105
+							'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')),
106 106
 							'default' => '',
107 107
 							'type'    => 'text',
108 108
 						),
109 109
 						array(
110 110
 							'id'      => 'recaptcha_secret',
111
-							'name'    => __( 'reCAPTCHA Secret Key', 'give' ),
112
-							'desc'    => __( 'Please paste the reCAPTCHA secret key here from your  reCAPTCHA API Keys panel.', 'give' ),
111
+							'name'    => __('reCAPTCHA Secret Key', 'give'),
112
+							'desc'    => __('Please paste the reCAPTCHA secret key here from your  reCAPTCHA API Keys panel.', 'give'),
113 113
 							'default' => '',
114 114
 							'type'    => 'text',
115 115
 						),
116 116
 						array(
117
-							'name'  => __( 'Access Control Docs Link', 'give' ),
117
+							'name'  => __('Access Control Docs Link', 'give'),
118 118
 							'id'    => 'access_control_docs_link',
119
-							'url'   => esc_url( 'http://docs.givewp.com/settings-access-control' ),
120
-							'title' => __( 'Access Control', 'give' ),
119
+							'url'   => esc_url('http://docs.givewp.com/settings-access-control'),
120
+							'title' => __('Access Control', 'give'),
121 121
 							'type'  => 'give_docs_link',
122 122
 						),
123 123
 						array(
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
 					break;
129 129
 
130 130
 				case 'currency-settings' :
131
-					$currency_position_before = __( 'Before - %s&#x200e;10', 'give' );
132
-					$currency_position_after  = __( 'After - 10%s&#x200f;', 'give' );
131
+					$currency_position_before = __('Before - %s&#x200e;10', 'give');
132
+					$currency_position_after  = __('After - 10%s&#x200f;', 'give');
133 133
 
134 134
 					$settings = array(
135 135
 						// Section 2: Currency
@@ -138,14 +138,14 @@  discard block
 block discarded – undo
138 138
 							'id'   => 'give_title_general_settings_2',
139 139
 						),
140 140
 						array(
141
-							'name' => __( 'Currency Settings', 'give' ),
141
+							'name' => __('Currency Settings', 'give'),
142 142
 							'desc' => '',
143 143
 							'type' => 'give_title',
144 144
 							'id'   => 'give_title_general_settings_2',
145 145
 						),
146 146
 						array(
147
-							'name'    => __( 'Currency', 'give' ),
148
-							'desc'    => __( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
147
+							'name'    => __('Currency', 'give'),
148
+							'desc'    => __('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
149 149
 							'id'      => 'currency',
150 150
 							'class'   => 'give-select-chosen',
151 151
 							'type'    => 'select',
@@ -153,51 +153,51 @@  discard block
 block discarded – undo
153 153
 							'default' => 'USD',
154 154
 						),
155 155
 						array(
156
-							'name'       => __( 'Currency Position', 'give' ),
157
-							'desc'       => __( 'The position of the currency symbol.', 'give' ),
156
+							'name'       => __('Currency Position', 'give'),
157
+							'desc'       => __('The position of the currency symbol.', 'give'),
158 158
 							'id'         => 'currency_position',
159 159
 							'type'       => 'select',
160 160
 							'options'    => array(
161 161
 								/* translators: %s: currency symbol */
162
-								'before' => sprintf( $currency_position_before, give_currency_symbol( give_get_currency() ) ),
162
+								'before' => sprintf($currency_position_before, give_currency_symbol(give_get_currency())),
163 163
 								/* translators: %s: currency symbol */
164
-								'after'  => sprintf( $currency_position_after, give_currency_symbol( give_get_currency() ) ),
164
+								'after'  => sprintf($currency_position_after, give_currency_symbol(give_get_currency())),
165 165
 							),
166 166
 							'default'    => 'before',
167 167
 							'attributes' => array(
168
-								'data-before-template' => sprintf( $currency_position_before, '{currency_pos}' ),
169
-								'data-after-template' => sprintf( $currency_position_after, '{currency_pos}' ),
168
+								'data-before-template' => sprintf($currency_position_before, '{currency_pos}'),
169
+								'data-after-template' => sprintf($currency_position_after, '{currency_pos}'),
170 170
 							),
171 171
 						),
172 172
 						array(
173
-							'name'    => __( 'Thousands Separator', 'give' ),
174
-							'desc'    => __( 'The symbol (typically , or .) to separate thousands.', 'give' ),
173
+							'name'    => __('Thousands Separator', 'give'),
174
+							'desc'    => __('The symbol (typically , or .) to separate thousands.', 'give'),
175 175
 							'id'      => 'thousands_separator',
176 176
 							'type'    => 'text',
177 177
 							'default' => ',',
178 178
 							'css'     => 'width:12em;',
179 179
 						),
180 180
 						array(
181
-							'name'    => __( 'Decimal Separator', 'give' ),
182
-							'desc'    => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
181
+							'name'    => __('Decimal Separator', 'give'),
182
+							'desc'    => __('The symbol (usually , or .) to separate decimal points.', 'give'),
183 183
 							'id'      => 'decimal_separator',
184 184
 							'type'    => 'text',
185 185
 							'default' => '.',
186 186
 							'css'     => 'width:12em;',
187 187
 						),
188 188
 						array(
189
-							'name'    => __( 'Number of Decimals', 'give' ),
190
-							'desc'    => __( 'The number of decimal points displayed in amounts.', 'give' ),
189
+							'name'    => __('Number of Decimals', 'give'),
190
+							'desc'    => __('The number of decimal points displayed in amounts.', 'give'),
191 191
 							'id'      => 'number_decimals',
192 192
 							'type'    => 'text',
193 193
 							'default' => 2,
194 194
 							'css'     => 'width:12em;',
195 195
 						),
196 196
 						array(
197
-							'name'  => __( 'Currency Options Docs Link', 'give' ),
197
+							'name'  => __('Currency Options Docs Link', 'give'),
198 198
 							'id'    => 'currency_settings_docs_link',
199
-							'url'   => esc_url( 'http://docs.givewp.com/settings-currency' ),
200
-							'title' => __( 'Currency Settings', 'give' ),
199
+							'url'   => esc_url('http://docs.givewp.com/settings-currency'),
200
+							'title' => __('Currency Settings', 'give'),
201 201
 							'type'  => 'give_docs_link',
202 202
 						),
203 203
 						array(
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 					$country = give_get_country();
214 214
 
215 215
 					// get the list of the states of which default country is selected.
216
-					$states = give_get_states( $country );
216
+					$states = give_get_states($country);
217 217
 
218 218
 					// Get the country list that does not have any states init.
219 219
 					$no_states_country = give_no_states_country_list();
@@ -225,46 +225,46 @@  discard block
 block discarded – undo
225 225
 							'id'   => 'give_title_general_settings_1',
226 226
 						),
227 227
 						array(
228
-							'name' => __( 'General Settings', 'give' ),
228
+							'name' => __('General Settings', 'give'),
229 229
 							'desc' => '',
230 230
 							'type' => 'give_title',
231 231
 							'id'   => 'give_title_general_settings_1',
232 232
 						),
233 233
 						array(
234
-							'name'    => __( 'Success Page', 'give' ),
234
+							'name'    => __('Success Page', 'give'),
235 235
 							/* translators: %s: [give_receipt] */
236
-							'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>' ),
236
+							'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>'),
237 237
 							'id'      => 'success_page',
238 238
 							'type'    => 'select',
239
-							'options' => give_cmb2_get_post_options( array(
239
+							'options' => give_cmb2_get_post_options(array(
240 240
 								'post_type'   => 'page',
241 241
 								'numberposts' => 999,
242
-							) ),
242
+							)),
243 243
 						),
244 244
 						array(
245
-							'name'    => __( 'Failed Donation Page', 'give' ),
246
-							'desc'    => __( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
245
+							'name'    => __('Failed Donation Page', 'give'),
246
+							'desc'    => __('The page donors are sent to if their donation is cancelled or fails.', 'give'),
247 247
 							'id'      => 'failure_page',
248 248
 							'type'    => 'select',
249
-							'options' => give_cmb2_get_post_options( array(
249
+							'options' => give_cmb2_get_post_options(array(
250 250
 								'post_type'   => 'page',
251 251
 								'numberposts' => 999,
252
-							) ),
252
+							)),
253 253
 						),
254 254
 						array(
255
-							'name'    => __( 'Donation History Page', 'give' ),
255
+							'name'    => __('Donation History Page', 'give'),
256 256
 							/* translators: %s: [donation_history] */
257
-							'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>' ),
257
+							'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>'),
258 258
 							'id'      => 'history_page',
259 259
 							'type'    => 'select',
260
-							'options' => give_cmb2_get_post_options( array(
260
+							'options' => give_cmb2_get_post_options(array(
261 261
 								'post_type'   => 'page',
262 262
 								'numberposts' => 999,
263
-							) ),
263
+							)),
264 264
 						),
265 265
 						array(
266
-							'name'    => __( 'Base Country', 'give' ),
267
-							'desc'    => __( 'The country your site operates from.', 'give' ),
266
+							'name'    => __('Base Country', 'give'),
267
+							'desc'    => __('The country your site operates from.', 'give'),
268 268
 							'id'      => 'base_country',
269 269
 							'type'    => 'select',
270 270
 							'options' => give_get_country_list(),
@@ -275,18 +275,18 @@  discard block
 block discarded – undo
275 275
 						 * @since 1.8.14
276 276
 						 */
277 277
 						array(
278
-							'wrapper_class' => ( array_key_exists( $country, $no_states_country ) ? 'give-hidden' : '' ),
279
-							'name'          => __( 'Base State/Province', 'give' ),
280
-							'desc'          => __( 'The state/province your site operates from.', 'give' ),
278
+							'wrapper_class' => (array_key_exists($country, $no_states_country) ? 'give-hidden' : ''),
279
+							'name'          => __('Base State/Province', 'give'),
280
+							'desc'          => __('The state/province your site operates from.', 'give'),
281 281
 							'id'            => 'base_state',
282
-							'type'          => ( empty( $states ) ? 'text' : 'select' ),
282
+							'type'          => (empty($states) ? 'text' : 'select'),
283 283
 							'options'       => $states,
284 284
 						),
285 285
 						array(
286
-							'name'  => __( 'General Options Docs Link', 'give' ),
286
+							'name'  => __('General Options Docs Link', 'give'),
287 287
 							'id'    => 'general_options_docs_link',
288
-							'url'   => esc_url( 'http://docs.givewp.com/settings-general' ),
289
-							'title' => __( 'General Options', 'give' ),
288
+							'url'   => esc_url('http://docs.givewp.com/settings-general'),
289
+							'title' => __('General Options', 'give'),
290 290
 							'type'  => 'give_docs_link',
291 291
 						),
292 292
 						array(
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 			 * Filter the general settings.
302 302
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
303 303
 			 */
304
-			$settings = apply_filters( 'give_settings_general', $settings );
304
+			$settings = apply_filters('give_settings_general', $settings);
305 305
 
306 306
 			/**
307 307
 			 * Filter the settings.
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 			 *
311 311
 			 * @param  array $settings
312 312
 			 */
313
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
313
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
314 314
 
315 315
 			// Output.
316 316
 			return $settings;
@@ -324,12 +324,12 @@  discard block
 block discarded – undo
324 324
 		 */
325 325
 		public function get_sections() {
326 326
 			$sections = array(
327
-				'general-settings'  => __( 'General', 'give' ),
328
-				'currency-settings' => __( 'Currency', 'give' ),
329
-				'access-control'    => __( 'Access Control', 'give' ),
327
+				'general-settings'  => __('General', 'give'),
328
+				'currency-settings' => __('Currency', 'give'),
329
+				'access-control'    => __('Access Control', 'give'),
330 330
 			);
331 331
 
332
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
332
+			return apply_filters('give_get_sections_'.$this->id, $sections);
333 333
 		}
334 334
 	}
335 335
 
Please login to merge, or discard this patch.
includes/admin/emails/class-email-setting-field.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -21,33 +21,33 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @return array
23 23
 	 */
24
-	public static function get_setting_fields( Give_Email_Notification $email, $form_id = null ) {
25
-		$setting_fields = self::get_default_setting_fields( $email, $form_id );
24
+	public static function get_setting_fields(Give_Email_Notification $email, $form_id = null) {
25
+		$setting_fields = self::get_default_setting_fields($email, $form_id);
26 26
 
27 27
 		// Recipient field.
28
-		if ( Give_Email_Notification_Util::has_recipient_field( $email ) ) {
29
-			$setting_fields[] = self::get_recipient_setting_field( $email, $form_id );
28
+		if (Give_Email_Notification_Util::has_recipient_field($email)) {
29
+			$setting_fields[] = self::get_recipient_setting_field($email, $form_id);
30 30
 		}
31 31
 
32 32
 
33 33
 		// Add extra setting field.
34
-		if ( $extra_setting_field = $email->get_extra_setting_fields( $form_id ) ) {
35
-			$setting_fields = array_merge( $setting_fields, $extra_setting_field );
34
+		if ($extra_setting_field = $email->get_extra_setting_fields($form_id)) {
35
+			$setting_fields = array_merge($setting_fields, $extra_setting_field);
36 36
 		}
37 37
 
38 38
 		// Preview field.
39
-		if ( Give_Email_Notification_Util::has_preview( $email ) ) {
40
-			$setting_fields[] = self::get_preview_setting_field( $email, $form_id );
39
+		if (Give_Email_Notification_Util::has_preview($email)) {
40
+			$setting_fields[] = self::get_preview_setting_field($email, $form_id);
41 41
 		}
42 42
 
43
-		$setting_fields = self::add_section_end( $email, $setting_fields );
43
+		$setting_fields = self::add_section_end($email, $setting_fields);
44 44
 
45 45
 		/**
46 46
 		 * Filter the email notification settings.
47 47
 		 *
48 48
 		 * @since 2.0
49 49
 		 */
50
-		return apply_filters( 'give_email_notification_setting_fields', $setting_fields, $email, $form_id );
50
+		return apply_filters('give_email_notification_setting_fields', $setting_fields, $email, $form_id);
51 51
 	}
52 52
 
53 53
 
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 	 *
62 62
 	 * @return bool
63 63
 	 */
64
-	public static function has_section_end( $setting ) {
65
-		$last_field      = end( $setting );
64
+	public static function has_section_end($setting) {
65
+		$last_field      = end($setting);
66 66
 		$has_section_end = false;
67 67
 
68
-		if ( 'sectionend' === $last_field['type'] ) {
68
+		if ('sectionend' === $last_field['type']) {
69 69
 			$has_section_end = true;
70 70
 		}
71 71
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 *
84 84
 	 * @return array
85 85
 	 */
86
-	public static function get_section_start( Give_Email_Notification $email, $form_id = null ) {
86
+	public static function get_section_start(Give_Email_Notification $email, $form_id = null) {
87 87
 		// Add section end field.
88 88
 		$setting = array(
89 89
 			'id'    => "give_title_email_settings_{$email->config['id']}",
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	 *
106 106
 	 * @return array
107 107
 	 */
108
-	public static function add_section_end( Give_Email_Notification $email, $setting ) {
109
-		if ( ! self::has_section_end( $setting ) ) {
108
+	public static function add_section_end(Give_Email_Notification $email, $setting) {
109
+		if ( ! self::has_section_end($setting)) {
110 110
 			// Add section end field.
111 111
 			$setting[] = array(
112 112
 				'id'   => "give_title_email_settings_{$email->config['id']}",
@@ -128,25 +128,25 @@  discard block
 block discarded – undo
128 128
 	 *
129 129
 	 * @return array
130 130
 	 */
131
-	public static function get_default_setting_fields( Give_Email_Notification $email, $form_id = null ) {
132
-		$settings[] = self::get_section_start( $email, $form_id );
133
-		$settings[] = self::get_notification_status_field( $email, $form_id );
131
+	public static function get_default_setting_fields(Give_Email_Notification $email, $form_id = null) {
132
+		$settings[] = self::get_section_start($email, $form_id);
133
+		$settings[] = self::get_notification_status_field($email, $form_id);
134 134
 
135
-		if ( ! Give_Email_Notification_Util::is_notification_status_editable( $email ) ) {
136
-			if( $form_id || give_is_add_new_form_page() ){
135
+		if ( ! Give_Email_Notification_Util::is_notification_status_editable($email)) {
136
+			if ($form_id || give_is_add_new_form_page()) {
137 137
 				// Do not allow admin to disable notification on perform basis.
138
-				unset( $settings[1]['options']['disabled'] );
139
-			} else{
138
+				unset($settings[1]['options']['disabled']);
139
+			} else {
140 140
 				// Do not allow admin to edit notification status globally.
141
-				unset( $settings[1] );
141
+				unset($settings[1]);
142 142
 			}
143 143
 		}
144 144
 
145
-		$settings[] = self::get_email_subject_field( $email, $form_id );
146
-		$settings[] = self::get_email_message_field( $email, $form_id );
145
+		$settings[] = self::get_email_subject_field($email, $form_id);
146
+		$settings[] = self::get_email_message_field($email, $form_id);
147 147
 
148
-		if( Give_Email_Notification_Util::is_content_type_editable( $email ) ) {
149
-			$settings[] = self::get_email_content_type_field( $email, $form_id );
148
+		if (Give_Email_Notification_Util::is_content_type_editable($email)) {
149
+			$settings[] = self::get_email_content_type_field($email, $form_id);
150 150
 		}
151 151
 
152 152
 		return $settings;
@@ -163,31 +163,31 @@  discard block
 block discarded – undo
163 163
 	 *
164 164
 	 * @return array
165 165
 	 */
166
-	public static function get_notification_status_field( Give_Email_Notification $email, $form_id = null ) {
166
+	public static function get_notification_status_field(Give_Email_Notification $email, $form_id = null) {
167 167
 		$option = array(
168
-			'enabled'  => __( 'Enabled', 'give' ),
169
-			'disabled' => __( 'Disabled', 'give' ),
168
+			'enabled'  => __('Enabled', 'give'),
169
+			'disabled' => __('Disabled', 'give'),
170 170
 		);
171 171
 
172 172
 		$default_value = $email->get_notification_status();
173 173
 
174 174
 		// Add global options.
175
-		if ( $form_id || give_is_add_new_form_page() ) {
175
+		if ($form_id || give_is_add_new_form_page()) {
176 176
 			$option = array(
177
-				'global'   => __( 'Global Options' ),
178
-				'enabled'  => __( 'Customize', 'give' ),
179
-				'disabled' => __( 'Disabled', 'give' ),
177
+				'global'   => __('Global Options'),
178
+				'enabled'  => __('Customize', 'give'),
179
+				'disabled' => __('Disabled', 'give'),
180 180
 			);
181 181
 
182 182
 			$default_value = 'global';
183 183
 		}
184 184
 
185
-		$description = isset($_GET['page']) && 'give-settings' === $_GET['page'] ? __('Choose whether you want this email enabled or not.', 'give') : sprintf( __( 'Global Options are set <a href="%s">in Give settings</a>. You may override them for this form here.', 'give' ), admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails' ) );
185
+		$description = isset($_GET['page']) && 'give-settings' === $_GET['page'] ? __('Choose whether you want this email enabled or not.', 'give') : sprintf(__('Global Options are set <a href="%s">in Give settings</a>. You may override them for this form here.', 'give'), admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails'));
186 186
 
187 187
 		return array(
188
-			'name'          => esc_html__( 'Notification', 'give' ),
188
+			'name'          => esc_html__('Notification', 'give'),
189 189
 			'desc'          => $description,
190
-			'id'            => self::get_prefix( $email, $form_id ) . 'notification',
190
+			'id'            => self::get_prefix($email, $form_id).'notification',
191 191
 			'type'          => 'radio_inline',
192 192
 			'default'       => $default_value,
193 193
 			'options'       => $option,
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
 	 *
207 207
 	 * @return array
208 208
 	 */
209
-	public static function get_email_subject_field( Give_Email_Notification $email, $form_id = null ) {
209
+	public static function get_email_subject_field(Give_Email_Notification $email, $form_id = null) {
210 210
 		return array(
211
-			'id'      => self::get_prefix( $email, $form_id ) . 'email_subject',
212
-			'name'    => esc_html__( 'Email Subject', 'give' ),
213
-			'desc'    => esc_html__( 'Enter the email subject line.', 'give' ),
211
+			'id'      => self::get_prefix($email, $form_id).'email_subject',
212
+			'name'    => esc_html__('Email Subject', 'give'),
213
+			'desc'    => esc_html__('Enter the email subject line.', 'give'),
214 214
 			'default' => $email->config['default_email_subject'],
215 215
 			'type'    => 'text',
216 216
 		);
@@ -227,28 +227,28 @@  discard block
 block discarded – undo
227 227
 	 *
228 228
 	 * @return array
229 229
 	 */
230
-	public static function get_email_message_field( Give_Email_Notification $email, $form_id = null ) {
231
-		$desc = esc_html__( 'Enter the email message.', 'give' );
230
+	public static function get_email_message_field(Give_Email_Notification $email, $form_id = null) {
231
+		$desc = esc_html__('Enter the email message.', 'give');
232 232
 
233
-		if ( $email_tag_list = $email->get_allowed_email_tags( true ) ) {
233
+		if ($email_tag_list = $email->get_allowed_email_tags(true)) {
234 234
 			$desc = sprintf(
235 235
 				'%1$s <br> %2$s: %3$s %4$s',
236
-				__( 'The email that is sent to users after completing a successful donation. HTML is accepted.', 'give' ),
237
-				__( 'Available template tags', 'give' ),
236
+				__('The email that is sent to users after completing a successful donation. HTML is accepted.', 'give'),
237
+				__('Available template tags', 'give'),
238 238
 				$email_tag_list,
239 239
 				sprintf(
240 240
 					'<br><a href="%1$s" target="_blank">%2$s</a> %3$s',
241 241
 					esc_url('http://docs.givewp.com/meta-email-tags'),
242
-					__( 'See our documentation', 'give' ),
243
-					__( 'for examples of how to use custom meta email tags to output additional donor or donation information in your Give emails.', 'give' )
242
+					__('See our documentation', 'give'),
243
+					__('for examples of how to use custom meta email tags to output additional donor or donation information in your Give emails.', 'give')
244 244
 				)
245 245
 			);
246 246
 
247 247
 		}
248 248
 
249 249
 		return array(
250
-			'id'      => self::get_prefix( $email, $form_id ) . 'email_message',
251
-			'name'    => esc_html__( 'Email message', 'give' ),
250
+			'id'      => self::get_prefix($email, $form_id).'email_message',
251
+			'name'    => esc_html__('Email message', 'give'),
252 252
 			'desc'    => $desc,
253 253
 			'type'    => 'wysiwyg',
254 254
 			'default' => $email->config['default_email_message'],
@@ -266,15 +266,15 @@  discard block
 block discarded – undo
266 266
 	 *
267 267
 	 * @return array
268 268
 	 */
269
-	public static function get_email_content_type_field( Give_Email_Notification $email, $form_id = null ) {
269
+	public static function get_email_content_type_field(Give_Email_Notification $email, $form_id = null) {
270 270
 		return array(
271
-			'id'      => self::get_prefix( $email, $form_id ) . 'email_content_type',
272
-			'name'    => esc_html__( 'Email Content Type', 'give' ),
273
-			'desc'    => __( 'Choose email type.', 'give' ),
271
+			'id'      => self::get_prefix($email, $form_id).'email_content_type',
272
+			'name'    => esc_html__('Email Content Type', 'give'),
273
+			'desc'    => __('Choose email type.', 'give'),
274 274
 			'type'    => 'select',
275 275
 			'options' => array(
276
-				'text/html'  => Give_Email_Notification_Util::get_formatted_email_type( 'text/html' ),
277
-				'text/plain' => Give_Email_Notification_Util::get_formatted_email_type( 'text/plain' ),
276
+				'text/html'  => Give_Email_Notification_Util::get_formatted_email_type('text/html'),
277
+				'text/plain' => Give_Email_Notification_Util::get_formatted_email_type('text/plain'),
278 278
 			),
279 279
 			'default' => $email->config['content_type'],
280 280
 		);
@@ -293,29 +293,29 @@  discard block
 block discarded – undo
293 293
 	 *
294 294
 	 * @return array
295 295
 	 */
296
-	public static function get_recipient_setting_field( Give_Email_Notification $email, $form_id = null ) {
297
-		$recipient =  array(
298
-			'id'               => self::get_prefix( $email, $form_id ) . 'recipient',
299
-			'name'             => esc_html__( 'Email Recipients', 'give' ),
300
-			'desc'             => __( 'Enter the email address(es) that should receive a notification.', 'give' ),
296
+	public static function get_recipient_setting_field(Give_Email_Notification $email, $form_id = null) {
297
+		$recipient = array(
298
+			'id'               => self::get_prefix($email, $form_id).'recipient',
299
+			'name'             => esc_html__('Email Recipients', 'give'),
300
+			'desc'             => __('Enter the email address(es) that should receive a notification.', 'give'),
301 301
 			'type'             => 'email',
302
-			'default'          => get_bloginfo( 'admin_email' ),
302
+			'default'          => get_bloginfo('admin_email'),
303 303
 			'repeat'           => true,
304
-			'repeat_btn_title' => esc_html__( 'Add Recipient', 'give' ),
304
+			'repeat_btn_title' => esc_html__('Add Recipient', 'give'),
305 305
 		);
306 306
 
307
-		if ( $form_id || give_is_add_new_form_page() ) {
308
-			$recipient['name']    = __( 'Email', 'give' );
307
+		if ($form_id || give_is_add_new_form_page()) {
308
+			$recipient['name']    = __('Email', 'give');
309 309
 			$recipient['default'] = '';
310 310
 			$recipient['id']      = 'email';
311
-			$recipient['desc']    = __( 'Enter the email address that should receive a notification.', 'give' );
311
+			$recipient['desc']    = __('Enter the email address that should receive a notification.', 'give');
312 312
 
313 313
 			$recipient = array(
314
-				'id'      => self::get_prefix( $email, $form_id ) . 'recipient',
314
+				'id'      => self::get_prefix($email, $form_id).'recipient',
315 315
 				'type'    => 'group',
316 316
 				'options' => array(
317
-					'add_button'    => __( 'Add Email', 'give' ),
318
-					'header_title'  => __( 'Email Recipient', 'give' ),
317
+					'add_button'    => __('Add Email', 'give'),
318
+					'header_title'  => __('Email Recipient', 'give'),
319 319
 					'remove_button' => '<span class="dashicons dashicons-no"></span>',
320 320
 				),
321 321
 				'fields'  => array(
@@ -338,12 +338,12 @@  discard block
 block discarded – undo
338 338
 	 *
339 339
 	 * @return array
340 340
 	 */
341
-	public static function get_preview_setting_field( Give_Email_Notification $email, $form_id = null ) {
341
+	public static function get_preview_setting_field(Give_Email_Notification $email, $form_id = null) {
342 342
 		return array(
343
-			'name' => __( 'Preview Email', 'give' ),
344
-			'desc' => __( 'Click the "Preview Email" button to preview the email in your browser. Click the "Send Test Email" button to send a test email directly to your inbox.',
345
-				'give' ),
346
-			'id'   => self::get_prefix( $email, $form_id ) . 'preview_buttons',
343
+			'name' => __('Preview Email', 'give'),
344
+			'desc' => __('Click the "Preview Email" button to preview the email in your browser. Click the "Send Test Email" button to send a test email directly to your inbox.',
345
+				'give'),
346
+			'id'   => self::get_prefix($email, $form_id).'preview_buttons',
347 347
 			'type' => 'email_preview_buttons',
348 348
 		);
349 349
 	}
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
 	 *
361 361
 	 * @return string
362 362
 	 */
363
-	public static function get_prefix( Give_Email_Notification $email, $form_id = null  ) {
363
+	public static function get_prefix(Give_Email_Notification $email, $form_id = null) {
364 364
 		$meta_key = "{$email->config['id']}_";
365 365
 
366
-		if( $form_id || give_is_add_new_form_page() ) {
366
+		if ($form_id || give_is_add_new_form_page()) {
367 367
 			$meta_key = "_give_{$email->config['id']}_";
368 368
 		}
369 369
 
Please login to merge, or discard this patch.
includes/admin/dashboard-widgets.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
  * @return void
22 22
  */
23 23
 function give_register_dashboard_widgets() {
24
-	if ( current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) {
25
-		wp_add_dashboard_widget( 'give_dashboard_sales', __( 'Give: Donation Statistics', 'give' ), 'give_dashboard_sales_widget' );
24
+	if (current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) {
25
+		wp_add_dashboard_widget('give_dashboard_sales', __('Give: Donation Statistics', 'give'), 'give_dashboard_sales_widget');
26 26
 	}
27 27
 }
28 28
 
29
-add_action( 'wp_dashboard_setup', 'give_register_dashboard_widgets', 10 );
29
+add_action('wp_dashboard_setup', 'give_register_dashboard_widgets', 10);
30 30
 
31 31
 /**
32 32
  * Sales Summary Dashboard Widget
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
  */
39 39
 function give_dashboard_sales_widget() {
40 40
 
41
-	if ( ! current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) {
41
+	if ( ! current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) {
42 42
 		return;
43 43
 	}
44 44
 	$stats = new Give_Payment_Stats(); ?>
@@ -46,27 +46,27 @@  discard block
 block discarded – undo
46 46
 	<div class="give-dashboard-widget">
47 47
 
48 48
 		<div class="give-dashboard-today give-clearfix">
49
-			<h3 class="give-dashboard-date-today"><?php echo date_i18n( _x( 'F j, Y', 'dashboard widget', 'give' ) ); ?></h3>
49
+			<h3 class="give-dashboard-date-today"><?php echo date_i18n(_x('F j, Y', 'dashboard widget', 'give')); ?></h3>
50 50
 
51 51
 			<p class="give-dashboard-happy-day"><?php
52 52
 				printf(
53 53
 				/* translators: %s: day of the week */
54
-					__( 'Happy %s!', 'give' ),
55
-					date_i18n( 'l', current_time( 'timestamp' ) )
54
+					__('Happy %s!', 'give'),
55
+					date_i18n('l', current_time('timestamp'))
56 56
 				);
57 57
 			?></p>
58 58
 
59 59
 			<p class="give-dashboard-today-earnings"><?php
60
-				$earnings_today = $stats->get_earnings( 0, 'today', false );
61
-				echo give_currency_filter( give_format_amount( $earnings_today, array( 'sanitize' => false ) ) );
60
+				$earnings_today = $stats->get_earnings(0, 'today', false);
61
+				echo give_currency_filter(give_format_amount($earnings_today, array('sanitize' => false)));
62 62
 			?></p>
63 63
 
64 64
 			<p class="give-donations-today"><?php
65
-				$donations_today = $stats->get_sales( 0, 'today', false );
65
+				$donations_today = $stats->get_sales(0, 'today', false);
66 66
 				printf(
67 67
 					/* translators: %s: daily donation count */
68
-					__( '%s donations today', 'give' ),
69
-					give_format_amount( $donations_today, array( 'decimal' => false, 'sanitize' => false ) )
68
+					__('%s donations today', 'give'),
69
+					give_format_amount($donations_today, array('decimal' => false, 'sanitize' => false))
70 70
 				);
71 71
 			?></p>
72 72
 
@@ -76,34 +76,34 @@  discard block
 block discarded – undo
76 76
 		<table class="give-table-stats">
77 77
 			<thead style="display: none;">
78 78
 			<tr>
79
-				<th><?php _e( 'This Week', 'give' ); ?></th>
80
-				<th><?php _e( 'This Month', 'give' ); ?></th>
81
-				<th><?php _e( 'Past 30 Days', 'give' ); ?></th>
79
+				<th><?php _e('This Week', 'give'); ?></th>
80
+				<th><?php _e('This Month', 'give'); ?></th>
81
+				<th><?php _e('Past 30 Days', 'give'); ?></th>
82 82
 			</tr>
83 83
 			</thead>
84 84
 			<tbody>
85 85
 			<tr id="give-table-stats-tr-1">
86 86
 				<td>
87
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_week' ), array( 'sanitize' => false ) ) ); ?></p>
87
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_week'), array('sanitize' => false))); ?></p>
88 88
 
89
-					<p class="give-dashboard-stat-total-label"><?php _e( 'This Week', 'give' ); ?></p>
89
+					<p class="give-dashboard-stat-total-label"><?php _e('This Week', 'give'); ?></p>
90 90
 				</td>
91 91
 				<td>
92
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_month' ), array( 'sanitize' => false ) ) ); ?></p>
92
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_month'), array('sanitize' => false))); ?></p>
93 93
 
94
-					<p class="give-dashboard-stat-total-label"><?php _e( 'This Month', 'give' ); ?></p>
94
+					<p class="give-dashboard-stat-total-label"><?php _e('This Month', 'give'); ?></p>
95 95
 				</td>
96 96
 			</tr>
97 97
 			<tr id="give-table-stats-tr-2">
98 98
 				<td>
99
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'last_month' ), array( 'sanitize' => false ) ) ) ?></p>
99
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'last_month'), array('sanitize' => false))) ?></p>
100 100
 
101
-					<p class="give-dashboard-stat-total-label"><?php _e( 'Last Month', 'give' ); ?></p>
101
+					<p class="give-dashboard-stat-total-label"><?php _e('Last Month', 'give'); ?></p>
102 102
 				</td>
103 103
 				<td>
104
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( give_get_total_earnings(), array( 'sanitize' => false ) ) ) ?></p>
104
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount(give_get_total_earnings(), array('sanitize' => false))) ?></p>
105 105
 
106
-					<p class="give-dashboard-stat-total-label"><?php _e( 'This Year', 'give' ); ?></p>
106
+					<p class="give-dashboard-stat-total-label"><?php _e('This Year', 'give'); ?></p>
107 107
 				</td>
108 108
 			</tr>
109 109
 			</tbody>
@@ -123,24 +123,24 @@  discard block
 block discarded – undo
123 123
  *
124 124
  * @return array
125 125
  */
126
-function give_dashboard_at_a_glance_widget( $items ) {
126
+function give_dashboard_at_a_glance_widget($items) {
127 127
 
128
-	$num_posts = wp_count_posts( 'give_forms' );
128
+	$num_posts = wp_count_posts('give_forms');
129 129
 
130
-	if ( $num_posts && $num_posts->publish ) {
130
+	if ($num_posts && $num_posts->publish) {
131 131
 
132 132
 		$text = sprintf(
133 133
 			/* translators: %s: number of posts published */
134
-			_n( '%s Give Form', '%s Give Forms', $num_posts->publish, 'give' ),
134
+			_n('%s Give Form', '%s Give Forms', $num_posts->publish, 'give'),
135 135
 			$num_posts->publish
136 136
 		);
137 137
 
138
-		$text = sprintf( $text, number_format_i18n( $num_posts->publish ) );
138
+		$text = sprintf($text, number_format_i18n($num_posts->publish));
139 139
 
140
-		if ( current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
140
+		if (current_user_can('edit_give_forms', get_current_user_id())) {
141 141
 			$text = sprintf(
142 142
 				'<a class="give-forms-count" href="%1$s">%2$s</a>',
143
-				admin_url( 'edit.php?post_type=give_forms' ),
143
+				admin_url('edit.php?post_type=give_forms'),
144 144
 				$text
145 145
 			);
146 146
 		} else {
@@ -156,4 +156,4 @@  discard block
 block discarded – undo
156 156
 	return $items;
157 157
 }
158 158
 
159
-add_filter( 'dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1 );
159
+add_filter('dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1);
Please login to merge, or discard this patch.
includes/class-give-background-updater.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -202,8 +202,8 @@
 block discarded – undo
202 202
 		// 2. Processing percentage greater then 100%
203 203
 		if( (
204 204
 			101 < $resume_update['total_percentage'] ) ||
205
-		    ( $give_updates->get_total_db_update_count() < $resume_update['update'] ) ||
206
-		    ! in_array( $resume_update['update_info']['id'], $give_updates->get_update_ids() )
205
+			( $give_updates->get_total_db_update_count() < $resume_update['update'] ) ||
206
+			! in_array( $resume_update['update_info']['id'], $give_updates->get_update_ids() )
207 207
 		) {
208 208
 			if( ! $this->is_paused_process() ){
209 209
 				$give_updates->__pause_db_update(true);
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @category Class
12 12
  * @author   WordImpress
13 13
  */
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 * @return bool
56 56
 	 */
57 57
 	public function has_queue() {
58
-		return ( ! parent::is_queue_empty() );
58
+		return ( ! parent::is_queue_empty());
59 59
 	}
60 60
 
61 61
 
@@ -71,12 +71,12 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	protected function lock_process() {
73 73
 		// Check if admin want to pause upgrade.
74
-		if( get_option('give_pause_upgrade') ) {
74
+		if (get_option('give_pause_upgrade')) {
75 75
 			self::flush_cache();
76 76
 
77
-			delete_option( 'give_paused_batches' );
77
+			delete_option('give_paused_batches');
78 78
 
79
-			Give_Updates::get_instance()->__pause_db_update( true );
79
+			Give_Updates::get_instance()->__pause_db_update(true);
80 80
 
81 81
 			delete_option('give_pause_upgrade');
82 82
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			 *
86 86
 			 * @since 2.0.1
87 87
 			 */
88
-			do_action( 'give_pause_db_upgrade', Give_Updates::get_instance() );
88
+			do_action('give_pause_db_upgrade', Give_Updates::get_instance());
89 89
 
90 90
 			wp_die();
91 91
 		}
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
 
94 94
 		$this->start_time = time(); // Set start time of current process.
95 95
 
96
-		$lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : 60; // 1 minute
97
-		$lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration );
96
+		$lock_duration = (property_exists($this, 'queue_lock_time')) ? $this->queue_lock_time : 60; // 1 minute
97
+		$lock_duration = apply_filters($this->identifier.'_queue_lock_time', $lock_duration);
98 98
 
99
-		set_site_transient( $this->identifier . '_process_lock', microtime(), $lock_duration );
99
+		set_site_transient($this->identifier.'_process_lock', microtime(), $lock_duration);
100 100
 	}
101 101
 
102 102
 	/**
@@ -106,12 +106,12 @@  discard block
 block discarded – undo
106 106
 	 * and data exists in the queue.
107 107
 	 */
108 108
 	public function handle_cron_healthcheck() {
109
-		if ( $this->is_process_running() || $this->is_paused_process()  ) {
109
+		if ($this->is_process_running() || $this->is_paused_process()) {
110 110
 			// Background process already running.
111 111
 			return;
112 112
 		}
113 113
 
114
-		if ( $this->is_queue_empty() ) {
114
+		if ($this->is_queue_empty()) {
115 115
 			// No data to process.
116 116
 			$this->clear_scheduled_event();
117 117
 
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 	 * Schedule fallback event.
126 126
 	 */
127 127
 	protected function schedule_event() {
128
-		if ( ! wp_next_scheduled( $this->cron_hook_identifier ) && ! $this->is_paused_process() ) {
129
-			wp_schedule_event( time() + 10, $this->cron_interval_identifier, $this->cron_hook_identifier );
128
+		if ( ! wp_next_scheduled($this->cron_hook_identifier) && ! $this->is_paused_process()) {
129
+			wp_schedule_event(time() + 10, $this->cron_interval_identifier, $this->cron_hook_identifier);
130 130
 		}
131 131
 	}
132 132
 
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
 	 *
143 143
 	 * @return mixed
144 144
 	 */
145
-	protected function task( $update ) {
145
+	protected function task($update) {
146 146
 		// Pause upgrade immediately if admin pausing upgrades.
147
-		if( $this->is_paused_process() ) {
147
+		if ($this->is_paused_process()) {
148 148
 			wp_die();
149 149
 		}
150 150
 
151
-		if ( empty( $update ) ) {
151
+		if (empty($update)) {
152 152
 			return false;
153 153
 		}
154 154
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 				'update_info'      => $update,
166 166
 				'step'             => 1,
167 167
 				'update'           => 1,
168
-				'heading'          => sprintf( 'Update %s of {update_count}', 1 ),
168
+				'heading'          => sprintf('Update %s of {update_count}', 1),
169 169
 				'percentage'       => $give_updates->percentage,
170 170
 				'total_percentage' => 0,
171 171
 			)
@@ -174,22 +174,22 @@  discard block
 block discarded – undo
174 174
 		// Continuously skip update if previous update does not complete yet.
175 175
 		if (
176 176
 			$resume_update['update_info']['id'] !== $update['id'] &&
177
-			! give_has_upgrade_completed( $resume_update['update_info']['id'] )
177
+			! give_has_upgrade_completed($resume_update['update_info']['id'])
178 178
 		) {
179 179
 			return $update;
180 180
 		}
181 181
 
182 182
 		// Set params.
183 183
 		$resume_update['update_info'] = $update;
184
-		$give_updates->step           = absint( $resume_update['step'] );
185
-		$give_updates->update         = absint( $resume_update['update'] );
186
-		$is_parent_update_completed   = $give_updates->is_parent_updates_completed( $update );
184
+		$give_updates->step           = absint($resume_update['step']);
185
+		$give_updates->update         = absint($resume_update['update']);
186
+		$is_parent_update_completed   = $give_updates->is_parent_updates_completed($update);
187 187
 
188 188
 
189 189
 		// Skip update if dependency update does not complete yet.
190
-		if ( empty( $is_parent_update_completed ) ) {
190
+		if (empty($is_parent_update_completed)) {
191 191
 			// @todo: set error when you have only one update with invalid dependency
192
-			if ( ! is_null( $is_parent_update_completed ) ) {
192
+			if ( ! is_null($is_parent_update_completed)) {
193 193
 				return $update;
194 194
 			}
195 195
 
@@ -200,23 +200,23 @@  discard block
 block discarded – undo
200 200
 		// Pause upgrade immediately if found following:
201 201
 		// 1. Running update number greater then total update count
202 202
 		// 2. Processing percentage greater then 100%
203
-		if( (
203
+		if ((
204 204
 			101 < $resume_update['total_percentage'] ) ||
205
-		    ( $give_updates->get_total_db_update_count() < $resume_update['update'] ) ||
206
-		    ! in_array( $resume_update['update_info']['id'], $give_updates->get_update_ids() )
205
+		    ($give_updates->get_total_db_update_count() < $resume_update['update']) ||
206
+		    ! in_array($resume_update['update_info']['id'], $give_updates->get_update_ids())
207 207
 		) {
208
-			if( ! $this->is_paused_process() ){
208
+			if ( ! $this->is_paused_process()) {
209 209
 				$give_updates->__pause_db_update(true);
210 210
 			}
211 211
 
212
-			update_option( 'give_upgrade_error', 1 );
212
+			update_option('give_upgrade_error', 1);
213 213
 
214
-			$log_data = 'Update Task' . "\n";
214
+			$log_data = 'Update Task'."\n";
215 215
 			$log_data .= "Total update count: {$give_updates->get_total_db_update_count()}\n";
216
-			$log_data .= 'Update IDs: ' . print_r( $give_updates->get_update_ids() , true );
217
-			$log_data .= 'Update: ' . print_r( $resume_update , true );
216
+			$log_data .= 'Update IDs: '.print_r($give_updates->get_update_ids(), true);
217
+			$log_data .= 'Update: '.print_r($resume_update, true);
218 218
 
219
-			Give()->logs->add( 'Update Error', $log_data, 0, 'update' );
219
+			Give()->logs->add('Update Error', $log_data, 0, 'update');
220 220
 
221 221
 			wp_die();
222 222
 		}
@@ -224,25 +224,25 @@  discard block
 block discarded – undo
224 224
 		// Disable cache.
225 225
 		Give_Cache::disable();
226 226
 
227
-		try{
227
+		try {
228 228
 			// Run update.
229
-			if ( is_array( $update['callback'] ) ) {
229
+			if (is_array($update['callback'])) {
230 230
 				$update['callback'][0]->$update['callback'][1]();
231 231
 			} else {
232 232
 				$update['callback']();
233 233
 			}
234
-		} catch ( Exception $e ){
234
+		} catch (Exception $e) {
235 235
 
236
-			if( ! $this->is_paused_process() ){
236
+			if ( ! $this->is_paused_process()) {
237 237
 				$give_updates->__pause_db_update(true);
238 238
 			}
239 239
 
240
-			$log_data = 'Update Task' . "\n";
241
-			$log_data .= print_r( $resume_update, true ) . "\n\n";
240
+			$log_data = 'Update Task'."\n";
241
+			$log_data .= print_r($resume_update, true)."\n\n";
242 242
 			$log_data .= "Error\n {$e->getMessage()}";
243 243
 
244
-			Give()->logs->add( 'Update Error', $log_data, 0, 'update' );
245
-			update_option( 'give_upgrade_error', 1 );
244
+			Give()->logs->add('Update Error', $log_data, 0, 'update');
245
+			update_option('give_upgrade_error', 1);
246 246
 
247 247
 			wp_die();
248 248
 		}
@@ -250,21 +250,21 @@  discard block
 block discarded – undo
250 250
 		// Set update info.
251 251
 		$doing_upgrade_args = array(
252 252
 			'update_info'      => $update,
253
-			'step'             => ++ $give_updates->step,
253
+			'step'             => ++$give_updates->step,
254 254
 			'update'           => $give_updates->update,
255
-			'heading'          => sprintf( 'Update %s of %s', $give_updates->update, get_option( 'give_db_update_count' ) ),
255
+			'heading'          => sprintf('Update %s of %s', $give_updates->update, get_option('give_db_update_count')),
256 256
 			'percentage'       => $give_updates->percentage,
257 257
 			'total_percentage' => $give_updates->get_db_update_processing_percentage(),
258 258
 		);
259 259
 
260 260
 		// Cache upgrade.
261
-		update_option( 'give_doing_upgrade', $doing_upgrade_args );
261
+		update_option('give_doing_upgrade', $doing_upgrade_args);
262 262
 
263 263
 		// Enable cache.
264 264
 		Give_Cache::enable();
265 265
 
266 266
 		// Check if current update completed or not.
267
-		if ( give_has_upgrade_completed( $update['id'] ) ) {
267
+		if (give_has_upgrade_completed($update['id'])) {
268 268
 			return false;
269 269
 		}
270 270
 
@@ -278,23 +278,23 @@  discard block
 block discarded – undo
278 278
 	 * performed, or, call parent::complete().
279 279
 	 */
280 280
 	public function complete() {
281
-		if ( $this->is_paused_process() ) {
281
+		if ($this->is_paused_process()) {
282 282
 			return false;
283 283
 		}
284 284
 
285 285
 		parent::complete();
286 286
 
287
-		delete_option( 'give_pause_upgrade' );
288
-		delete_option( 'give_upgrade_error' );
289
-		delete_option( 'give_db_update_count' );
290
-		delete_option( 'give_doing_upgrade' );
291
-		add_option( 'give_show_db_upgrade_complete_notice', 1, '', 'no' );
287
+		delete_option('give_pause_upgrade');
288
+		delete_option('give_upgrade_error');
289
+		delete_option('give_db_update_count');
290
+		delete_option('give_doing_upgrade');
291
+		add_option('give_show_db_upgrade_complete_notice', 1, '', 'no');
292 292
 
293 293
 		// Flush cache.
294 294
 		Give_Cache::get_instance()->flush_cache();
295 295
 
296
-		if ( $cache_keys = Give_Cache::get_options_like( '' ) ) {
297
-			Give_Cache::delete( $cache_keys );
296
+		if ($cache_keys = Give_Cache::get_options_like('')) {
297
+			Give_Cache::delete($cache_keys);
298 298
 		}
299 299
 	}
300 300
 
@@ -304,19 +304,19 @@  discard block
 block discarded – undo
304 304
 	 * @return int
305 305
 	 */
306 306
 	protected function get_memory_limit() {
307
-		if ( function_exists( 'ini_get' ) ) {
308
-			$memory_limit = ini_get( 'memory_limit' );
307
+		if (function_exists('ini_get')) {
308
+			$memory_limit = ini_get('memory_limit');
309 309
 		} else {
310 310
 			// Sensible default.
311 311
 			$memory_limit = '128M';
312 312
 		}
313 313
 
314
-		if ( ! $memory_limit || '-1' === $memory_limit ) {
314
+		if ( ! $memory_limit || '-1' === $memory_limit) {
315 315
 			// Unlimited, set to 32GB.
316 316
 			$memory_limit = '32000M';
317 317
 		}
318 318
 
319
-		return intval( $memory_limit ) * 1024 * 1024;
319
+		return intval($memory_limit) * 1024 * 1024;
320 320
 	}
321 321
 
322 322
 	/**
@@ -329,17 +329,17 @@  discard block
 block discarded – undo
329 329
 		// Don't lock up other requests while processing
330 330
 		session_write_close();
331 331
 
332
-		if ( $this->is_process_running() || $this->is_paused_process() ) {
332
+		if ($this->is_process_running() || $this->is_paused_process()) {
333 333
 			// Background process already running.
334 334
 			wp_die();
335 335
 		}
336 336
 
337
-		if ( $this->is_queue_empty() ) {
337
+		if ($this->is_queue_empty()) {
338 338
 			// No data to process.
339 339
 			wp_die();
340 340
 		}
341 341
 
342
-		check_ajax_referer( $this->identifier, 'nonce' );
342
+		check_ajax_referer($this->identifier, 'nonce');
343 343
 
344 344
 		$this->handle();
345 345
 
@@ -354,13 +354,13 @@  discard block
 block discarded – undo
354 354
 	 * @access public
355 355
 	 * @return bool
356 356
 	 */
357
-	public function is_paused_process(){
357
+	public function is_paused_process() {
358 358
 		// Delete cache.
359
-		wp_cache_delete( 'give_paused_batches', 'options' );
359
+		wp_cache_delete('give_paused_batches', 'options');
360 360
 
361 361
 		$paused_batches = get_option('give_paused_batches');
362 362
 
363
-		return ! empty( $paused_batches );
363
+		return ! empty($paused_batches);
364 364
 	}
365 365
 
366 366
 
@@ -406,8 +406,8 @@  discard block
 block discarded – undo
406 406
 		);
407 407
 
408 408
 
409
-		foreach ( $options as $option ) {
410
-			wp_cache_delete( $option, 'options' );
409
+		foreach ($options as $option) {
410
+			wp_cache_delete($option, 'options');
411 411
 		}
412 412
 	}
413 413
 }
Please login to merge, or discard this patch.
templates/shortcode-profile-editor.php 2 patches
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@  discard block
 block discarded – undo
7 7
  * @copyright    Copyright (c) 2016, WordImpress
8 8
  * @license      https://opensource.org/licenses/gpl-license GNU Public License
9 9
  */
10
-$current_user     = wp_get_current_user();
10
+$current_user = wp_get_current_user();
11 11
 
12
-if ( is_user_logged_in() ) :
12
+if (is_user_logged_in()) :
13 13
 	$user_id      = get_current_user_id();
14
-	$first_name   = get_user_meta( $user_id, 'first_name', true );
15
-	$last_name    = get_user_meta( $user_id, 'last_name', true );
14
+	$first_name   = get_user_meta($user_id, 'first_name', true);
15
+	$last_name    = get_user_meta($user_id, 'last_name', true);
16 16
 	$display_name = $current_user->display_name;
17
-	$address      = give_get_donor_address( $user_id, array( 'address_type' => 'personal' ) );
17
+	$address      = give_get_donor_address($user_id, array('address_type' => 'personal'));
18 18
 
19
-	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) :
20
-		if ( isset( $_GET['update_code'] ) ) :?>
19
+	if (isset($_GET['updated']) && 'true' === $_GET['updated'] && ! give_get_errors()) :
20
+		if (isset($_GET['update_code'])) :?>
21 21
 				<?php
22
-				switch ( $_GET['update_code'] ) {
22
+				switch ($_GET['update_code']) {
23 23
 					case '1':
24
-						printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile has been updated.', 'give' ) );
24
+						printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your profile has been updated.', 'give'));
25 25
 						break;
26 26
 				}
27 27
 				?>
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		<?php endif; ?>
30 30
 	<?php endif; ?>
31 31
 
32
-	<?php Give()->notices->render_frontend_notices( 0 ); ?>
32
+	<?php Give()->notices->render_frontend_notices(0); ?>
33 33
 
34 34
 	<?php
35 35
 	/**
@@ -39,42 +39,42 @@  discard block
 block discarded – undo
39 39
 	 *
40 40
 	 * @since 1.0
41 41
 	 */
42
-	do_action( 'give_profile_editor_before' );
42
+	do_action('give_profile_editor_before');
43 43
 	?>
44 44
 
45 45
 	<form id="give_profile_editor_form" class="give-form" action="<?php echo give_get_current_page_url(); ?>" method="post">
46 46
 
47 47
 		<fieldset>
48
-			<legend id="give_profile_name_label"><?php _e( 'Profile', 'give' ); ?></legend>
48
+			<legend id="give_profile_name_label"><?php _e('Profile', 'give'); ?></legend>
49 49
 
50
-			<h3 id="give_personal_information_label" class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3>
50
+			<h3 id="give_personal_information_label" class="give-section-break"><?php _e('Change your Name', 'give'); ?></h3>
51 51
 
52 52
 			<p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive">
53 53
 				<label for="give_first_name">
54
-					<?php _e( 'First Name', 'give' ); ?>
54
+					<?php _e('First Name', 'give'); ?>
55 55
 					<span class="give-required-indicator  ">*</span>
56 56
 				</label>
57
-				<input name="give_first_name" id="give_first_name" class="text give-input" type="text" value="<?php echo esc_attr( $first_name ); ?>"/>
57
+				<input name="give_first_name" id="give_first_name" class="text give-input" type="text" value="<?php echo esc_attr($first_name); ?>"/>
58 58
 			</p>
59 59
 
60 60
 			<p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive">
61
-				<label for="give_last_name"><?php _e( 'Last Name', 'give' ); ?></label>
62
-				<input name="give_last_name" id="give_last_name" class="text give-input" type="text" value="<?php echo esc_attr( $last_name ); ?>"/>
61
+				<label for="give_last_name"><?php _e('Last Name', 'give'); ?></label>
62
+				<input name="give_last_name" id="give_last_name" class="text give-input" type="text" value="<?php echo esc_attr($last_name); ?>"/>
63 63
 			</p>
64 64
 
65 65
 			<p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive">
66
-				<label for="give_display_name"><?php _e( 'Display Name', 'give' ); ?></label>
66
+				<label for="give_display_name"><?php _e('Display Name', 'give'); ?></label>
67 67
 				<select name="give_display_name" id="give_display_name" class="select give-select">
68
-					<?php if ( ! empty( $current_user->first_name ) ): ?>
69
-						<option <?php selected( $display_name, $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option>
68
+					<?php if ( ! empty($current_user->first_name)): ?>
69
+						<option <?php selected($display_name, $current_user->first_name); ?> value="<?php echo esc_attr($current_user->first_name); ?>"><?php echo esc_html($current_user->first_name); ?></option>
70 70
 					<?php endif; ?>
71
-					<option <?php selected( $display_name, $current_user->user_nicename ); ?> value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option>
72
-					<?php if ( ! empty( $current_user->last_name ) ): ?>
73
-						<option <?php selected( $display_name, $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option>
71
+					<option <?php selected($display_name, $current_user->user_nicename); ?> value="<?php echo esc_attr($current_user->user_nicename); ?>"><?php echo esc_html($current_user->user_nicename); ?></option>
72
+					<?php if ( ! empty($current_user->last_name)): ?>
73
+						<option <?php selected($display_name, $current_user->last_name); ?> value="<?php echo esc_attr($current_user->last_name); ?>"><?php echo esc_html($current_user->last_name); ?></option>
74 74
 					<?php endif; ?>
75
-					<?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?>
76
-						<option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->first_name . ' ' . $current_user->last_name ); ?>"><?php echo esc_html( $current_user->first_name . ' ' . $current_user->last_name ); ?></option>
77
-						<option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->last_name . ' ' . $current_user->first_name ); ?>"><?php echo esc_html( $current_user->last_name . ' ' . $current_user->first_name ); ?></option>
75
+					<?php if ( ! empty($current_user->first_name) && ! empty($current_user->last_name)): ?>
76
+						<option <?php selected($display_name, $current_user->first_name.' '.$current_user->last_name); ?> value="<?php echo esc_attr($current_user->first_name.' '.$current_user->last_name); ?>"><?php echo esc_html($current_user->first_name.' '.$current_user->last_name); ?></option>
77
+						<option <?php selected($display_name, $current_user->last_name.' '.$current_user->first_name); ?> value="<?php echo esc_attr($current_user->last_name.' '.$current_user->first_name); ?>"><?php echo esc_html($current_user->last_name.' '.$current_user->first_name); ?></option>
78 78
 					<?php endif; ?>
79 79
 				</select>
80 80
 				<?php
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 				 *
86 86
 				 * @since 1.0
87 87
 				 */
88
-				do_action( 'give_profile_editor_name' );
88
+				do_action('give_profile_editor_name');
89 89
 				?>
90 90
 			</p>
91 91
 
@@ -97,15 +97,15 @@  discard block
 block discarded – undo
97 97
 			 *
98 98
 			 * @since 1.0
99 99
 			 */
100
-			do_action( 'give_profile_editor_after_name' );
100
+			do_action('give_profile_editor_after_name');
101 101
 			?>
102 102
 
103 103
 			<p class="form-row form-row-last form-row-responsive">
104 104
 				<label for="give_email">
105
-					<?php _e( 'Email Address', 'give' ); ?>
105
+					<?php _e('Email Address', 'give'); ?>
106 106
 					<span class="give-required-indicator  ">*</span>
107 107
 				</label>
108
-				<input name="give_email" id="give_email" class="text give-input required" type="email" value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/>
108
+				<input name="give_email" id="give_email" class="text give-input required" type="email" value="<?php echo esc_attr($current_user->user_email); ?>" required aria-required="true"/>
109 109
 				<?php
110 110
 				/**
111 111
 				 * Fires in the profile editor shortcode, to the email section.
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 				 *
115 115
 				 * @since 1.0
116 116
 				 */
117
-				do_action( 'give_profile_editor_email' );
117
+				do_action('give_profile_editor_email');
118 118
 				?>
119 119
 			</p>
120 120
 
@@ -126,19 +126,19 @@  discard block
 block discarded – undo
126 126
 			 *
127 127
 			 * @since 1.0
128 128
 			 */
129
-			do_action( 'give_profile_editor_after_email' );
129
+			do_action('give_profile_editor_after_email');
130 130
 			?>
131 131
 
132
-			<h3 id="give_profile_password_label" class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3>
132
+			<h3 id="give_profile_password_label" class="give-section-break"><?php _e('Change your Password', 'give'); ?></h3>
133 133
 
134 134
 			<div id="give_profile_password_wrap" class="give-clearfix">
135 135
 				<p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive">
136
-					<label for="give_new_user_pass1"><?php _e( 'New Password', 'give' ); ?></label>
136
+					<label for="give_new_user_pass1"><?php _e('New Password', 'give'); ?></label>
137 137
 					<input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input" type="password"/>
138 138
 				</p>
139 139
 
140 140
 				<p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive">
141
-					<label for="give_new_user_pass2"><?php _e( 'Re-enter Password', 'give' ); ?></label>
141
+					<label for="give_new_user_pass2"><?php _e('Re-enter Password', 'give'); ?></label>
142 142
 					<input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input" type="password"/>
143 143
 					<?php
144 144
 					/**
@@ -148,12 +148,12 @@  discard block
 block discarded – undo
148 148
 					 *
149 149
 					 * @since 1.0
150 150
 					 */
151
-					do_action( 'give_profile_editor_password' );
151
+					do_action('give_profile_editor_password');
152 152
 					?>
153 153
 				</p>
154 154
 			</div>
155 155
 
156
-			<p class="give_password_change_notice"><?php _e( 'Please note after changing your password, you must log back in.', 'give' ); ?></p>
156
+			<p class="give_password_change_notice"><?php _e('Please note after changing your password, you must log back in.', 'give'); ?></p>
157 157
 
158 158
 			<?php
159 159
 			/**
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 			 *
164 164
 			 * @since 1.0
165 165
 			 */
166
-			do_action( 'give_profile_editor_after_password' );
166
+			do_action('give_profile_editor_after_password');
167 167
 			?>
168 168
 
169 169
 			<p id="give_profile_submit_wrap">
170
-				<input type="hidden" name="give_profile_editor_nonce" value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/>
170
+				<input type="hidden" name="give_profile_editor_nonce" value="<?php echo wp_create_nonce('give-profile-editor-nonce'); ?>"/>
171 171
 				<input type="hidden" name="give_action" value="edit_user_profile"/>
172
-				<input type="hidden" name="give_redirect" value="<?php echo esc_url( give_get_current_page_url() ); ?>"/>
173
-				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/>
172
+				<input type="hidden" name="give_redirect" value="<?php echo esc_url(give_get_current_page_url()); ?>"/>
173
+				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php _e('Save Changes', 'give'); ?>"/>
174 174
 			</p>
175 175
 
176 176
 		</fieldset>
@@ -185,23 +185,23 @@  discard block
 block discarded – undo
185 185
 	 *
186 186
 	 * @since 1.0
187 187
 	 */
188
-	do_action( 'give_profile_editor_after' );
188
+	do_action('give_profile_editor_after');
189 189
 	?>
190 190
 
191 191
 	<?php
192 192
 else :
193
-	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) {
194
-		if ( isset( $_GET['update_code'] ) ) {
195
-			switch ( $_GET['update_code'] ) {
193
+	if (isset($_GET['updated']) && 'true' === $_GET['updated'] && ! give_get_errors()) {
194
+		if (isset($_GET['update_code'])) {
195
+			switch ($_GET['update_code']) {
196 196
 				case '2':
197
-					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile and password has been updated.', 'give' ) );
198
-					_e( 'Login with your new credentials.', 'give' );
197
+					printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your profile and password has been updated.', 'give'));
198
+					_e('Login with your new credentials.', 'give');
199 199
 					echo give_login_form();
200 200
 					break;
201 201
 
202 202
 				case '3':
203
-					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your password has been updated.', 'give' ) );
204
-					_e( 'Login with your new credentials.', 'give' );
203
+					printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your password has been updated.', 'give'));
204
+					_e('Login with your new credentials.', 'give');
205 205
 					echo give_login_form();
206 206
 					break;
207 207
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 			}
211 211
 		}
212 212
 	} else {
213
-		_e( 'You need to login to edit your profile.', 'give' );
213
+		_e('You need to login to edit your profile.', 'give');
214 214
 		echo give_login_form();
215 215
 	}
216 216
 endif;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,12 +189,14 @@
 block discarded – undo
189 189
 	?>
190 190
 
191 191
 	<?php
192
-else :
192
+else {
193
+	:
193 194
 	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) {
194 195
 		if ( isset( $_GET['update_code'] ) ) {
195 196
 			switch ( $_GET['update_code'] ) {
196 197
 				case '2':
197 198
 					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile and password has been updated.', 'give' ) );
199
+}
198 200
 					_e( 'Login with your new credentials.', 'give' );
199 201
 					echo give_login_form();
200 202
 					break;
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
@@ -9,27 +9,27 @@  discard block
 block discarded – undo
9 9
 global $give_access_form_outputted;
10 10
 
11 11
 // Only output the form once.
12
-if ( $give_access_form_outputted ) {
12
+if ($give_access_form_outputted) {
13 13
 	return;
14 14
 }
15 15
 
16
-$recaptcha_key    = give_get_option( 'recaptcha_key' );
17
-$recaptcha_secret = give_get_option( 'recaptcha_secret' );
16
+$recaptcha_key    = give_get_option('recaptcha_key');
17
+$recaptcha_secret = give_get_option('recaptcha_secret');
18 18
 
19
-$enable_recaptcha = ( give_is_setting_enabled( give_get_option( 'enable_recaptcha' ) ) ) && ! empty( $recaptcha_key ) && ! empty( $recaptcha_secret ) ? true : false;
19
+$enable_recaptcha = (give_is_setting_enabled(give_get_option('enable_recaptcha'))) && ! empty($recaptcha_key) && ! empty($recaptcha_secret) ? true : false;
20 20
 
21 21
 // Email already sent?
22
-if ( isset( $_POST['email-access-sent'] ) ) {
23
-	Give()->notices->print_frontend_notice( __( 'Please check your email and click on the link to access your complete donation history.', 'give' ), true, 'success' );
22
+if (isset($_POST['email-access-sent'])) {
23
+	Give()->notices->print_frontend_notice(__('Please check your email and click on the link to access your complete donation history.', 'give'), true, 'success');
24 24
 
25 25
 	return;
26
-} elseif ( isset( $_POST['email-access-exhausted'] ) ) {
26
+} elseif (isset($_POST['email-access-exhausted'])) {
27 27
 
28 28
 	// Too many emails sent?
29 29
 	Give()->notices->print_frontend_notice(
30 30
 		sprintf(
31
-			__( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ),
32
-			sprintf( _n( '%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give' ), Give()->email_access->verify_throttle / 60 )
31
+			__('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'),
32
+			sprintf(_n('%s minute', '%s minutes', Give()->email_access->verify_throttle / 60, 'give'), Give()->email_access->verify_throttle / 60)
33 33
 		),
34 34
 		true,
35 35
 		'error'
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
  *
45 45
  * @since 1.8.17
46 46
  */
47
-do_action( 'give_email_access_form_login' );
47
+do_action('give_email_access_form_login');
48 48
 
49 49
 // Print any other messages & errors.
50 50
 Give()->notices->render_frontend_notices();
@@ -52,17 +52,17 @@  discard block
 block discarded – undo
52 52
 ?>
53 53
 	<div class="give-form">
54 54
 		<form method="post" id="give-email-access-form">
55
-			<p><?php echo apply_filters( 'give_email_access_welcome_message', __( 'Please verify your email to access your donation history.', 'give' ) ); ?></p>
55
+			<p><?php echo apply_filters('give_email_access_welcome_message', __('Please verify your email to access your donation history.', 'give')); ?></p>
56 56
 
57
-			<label for="give-email"><?php _e( 'Donation Email:', 'give' ); ?></label>
57
+			<label for="give-email"><?php _e('Donation Email:', 'give'); ?></label>
58 58
 			<input id="give-email" type="email" name="give_email" value=""
59
-				   placeholder="<?php _e( 'Email Address', 'give' ); ?>"/>
60
-			<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'give' ); ?>"/>
59
+				   placeholder="<?php _e('Email Address', 'give'); ?>"/>
60
+			<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('give'); ?>"/>
61 61
 			<input type="hidden" name="give_action" value="email_access_form_login"/>
62 62
 
63 63
 			<?php
64 64
 			// Enable reCAPTCHA?
65
-			if ( $enable_recaptcha ) :
65
+			if ($enable_recaptcha) :
66 66
 				?>
67 67
 				<script>
68 68
 					// IP verify for reCAPTCHA.
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 				<input type="hidden" name="give_ip" class="give_ip" value=""/>
81 81
 			<?php endif; ?>
82 82
 
83
-			<input type="submit" class="give-submit" value="<?php _e( 'Verify Email', 'give' ); ?>"/>
83
+			<input type="submit" class="give-submit" value="<?php _e('Verify Email', 'give'); ?>"/>
84 84
 		</form>
85 85
 	</div>
86 86
 <?php
Please login to merge, or discard this patch.
give.php 1 patch
Spacing   +174 added lines, -174 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
  */
40 40
 
41 41
 // Exit if accessed directly.
42
-if ( ! defined( 'ABSPATH' ) ) {
42
+if ( ! defined('ABSPATH')) {
43 43
 	exit;
44 44
 }
45 45
 
46
-if ( ! class_exists( 'Give' ) ) :
46
+if ( ! class_exists('Give')) :
47 47
 
48 48
 	/**
49 49
 	 * Main Give Class
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 		 * @return    Give
238 238
 		 */
239 239
 		public static function instance() {
240
-			if ( is_null( self::$_instance ) ) {
240
+			if (is_null(self::$_instance)) {
241 241
 				self::$_instance = new self();
242 242
 			}
243 243
 
@@ -249,13 +249,13 @@  discard block
 block discarded – undo
249 249
 		 */
250 250
 		public function __construct() {
251 251
 			// PHP version
252
-			if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) {
253
-				define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' );
252
+			if ( ! defined('GIVE_REQUIRED_PHP_VERSION')) {
253
+				define('GIVE_REQUIRED_PHP_VERSION', '5.3');
254 254
 			}
255 255
 
256 256
 			// Bailout: Need minimum php version to load plugin.
257
-			if ( function_exists( 'phpversion' ) && version_compare( GIVE_REQUIRED_PHP_VERSION, phpversion(), '>' ) ) {
258
-				add_action( 'admin_notices', array( $this, 'minmum_phpversion_notice' ) );
257
+			if (function_exists('phpversion') && version_compare(GIVE_REQUIRED_PHP_VERSION, phpversion(), '>')) {
258
+				add_action('admin_notices', array($this, 'minmum_phpversion_notice'));
259 259
 
260 260
 				return;
261 261
 			}
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 			$this->includes();
266 266
 			$this->init_hooks();
267 267
 
268
-			do_action( 'give_loaded' );
268
+			do_action('give_loaded');
269 269
 		}
270 270
 
271 271
 		/**
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
 		 * @since  1.8.9
275 275
 		 */
276 276
 		private function init_hooks() {
277
-			register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' );
278
-			add_action( 'plugins_loaded', array( $this, 'init' ), 0 );
277
+			register_activation_hook(GIVE_PLUGIN_FILE, 'give_install');
278
+			add_action('plugins_loaded', array($this, 'init'), 0);
279 279
 		}
280 280
 
281 281
 		/**
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 			 *
291 291
 			 * @since 1.8.9
292 292
 			 */
293
-			do_action( 'before_give_init' );
293
+			do_action('before_give_init');
294 294
 
295 295
 			// Set up localization.
296 296
 			$this->load_textdomain();
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 			 *
321 321
 			 * @since 1.8.7
322 322
 			 */
323
-			do_action( 'give_init', $this );
323
+			do_action('give_init', $this);
324 324
 
325 325
 		}
326 326
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		 */
338 338
 		public function __clone() {
339 339
 			// Cloning instances of the class is forbidden.
340
-			give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
340
+			give_doing_it_wrong(__FUNCTION__, __('Cheatin&#8217; huh?', 'give'), '1.0');
341 341
 		}
342 342
 
343 343
 		/**
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 		 */
351 351
 		public function __wakeup() {
352 352
 			// Unserializing instances of the class is forbidden.
353
-			give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
353
+			give_doing_it_wrong(__FUNCTION__, __('Cheatin&#8217; huh?', 'give'), '1.0');
354 354
 		}
355 355
 
356 356
 		/**
@@ -364,33 +364,33 @@  discard block
 block discarded – undo
364 364
 		private function setup_constants() {
365 365
 
366 366
 			// Plugin version
367
-			if ( ! defined( 'GIVE_VERSION' ) ) {
368
-				define( 'GIVE_VERSION', '2.0.3' );
367
+			if ( ! defined('GIVE_VERSION')) {
368
+				define('GIVE_VERSION', '2.0.3');
369 369
 			}
370 370
 
371 371
 			// Plugin Root File
372
-			if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
373
-				define( 'GIVE_PLUGIN_FILE', __FILE__ );
372
+			if ( ! defined('GIVE_PLUGIN_FILE')) {
373
+				define('GIVE_PLUGIN_FILE', __FILE__);
374 374
 			}
375 375
 
376 376
 			// Plugin Folder Path
377
-			if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
378
-				define( 'GIVE_PLUGIN_DIR', plugin_dir_path( GIVE_PLUGIN_FILE ) );
377
+			if ( ! defined('GIVE_PLUGIN_DIR')) {
378
+				define('GIVE_PLUGIN_DIR', plugin_dir_path(GIVE_PLUGIN_FILE));
379 379
 			}
380 380
 
381 381
 			// Plugin Folder URL
382
-			if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
383
-				define( 'GIVE_PLUGIN_URL', plugin_dir_url( GIVE_PLUGIN_FILE ) );
382
+			if ( ! defined('GIVE_PLUGIN_URL')) {
383
+				define('GIVE_PLUGIN_URL', plugin_dir_url(GIVE_PLUGIN_FILE));
384 384
 			}
385 385
 
386 386
 			// Plugin Basename aka: "give/give.php"
387
-			if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
388
-				define( 'GIVE_PLUGIN_BASENAME', plugin_basename( GIVE_PLUGIN_FILE ) );
387
+			if ( ! defined('GIVE_PLUGIN_BASENAME')) {
388
+				define('GIVE_PLUGIN_BASENAME', plugin_basename(GIVE_PLUGIN_FILE));
389 389
 			}
390 390
 
391 391
 			// Make sure CAL_GREGORIAN is defined
392
-			if ( ! defined( 'CAL_GREGORIAN' ) ) {
393
-				define( 'CAL_GREGORIAN', 1 );
392
+			if ( ! defined('CAL_GREGORIAN')) {
393
+				define('CAL_GREGORIAN', 1);
394 394
 			}
395 395
 		}
396 396
 
@@ -408,152 +408,152 @@  discard block
 block discarded – undo
408 408
 			/**
409 409
 			 * Load libraries.
410 410
 			 */
411
-			if ( ! class_exists( 'WP_Async_Request' ) ) {
412
-				include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-async-request.php' );
411
+			if ( ! class_exists('WP_Async_Request')) {
412
+				include_once(GIVE_PLUGIN_DIR.'includes/libraries/wp-async-request.php');
413 413
 			}
414 414
 
415
-			if ( ! class_exists( 'WP_Background_Process' ) ) {
416
-				include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-background-process.php' );
415
+			if ( ! class_exists('WP_Background_Process')) {
416
+				include_once(GIVE_PLUGIN_DIR.'includes/libraries/wp-background-process.php');
417 417
 			}
418 418
 
419 419
 			/**
420 420
 			 * Load plugin files
421 421
 			 */
422
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
423
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php';
422
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-settings.php';
423
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-give-settings.php';
424 424
 			$give_options = give_get_settings();
425 425
 
426
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
427
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-async-process.php';
428
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
429
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
430
-			require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
431
-			require_once GIVE_PLUGIN_DIR . 'includes/scripts.php';
432
-			require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
433
-			require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
434
-			require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
435
-			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
436
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php';
437
-			require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
438
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-translation.php';
439
-
440
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
441
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php';
442
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
443
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
444
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-meta.php';
445
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php';
446
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php';
447
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php';
448
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
449
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
450
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php';
451
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
452
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
453
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php';
454
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-payment-meta.php';
455
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-form-meta.php';
456
-
457
-			require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
458
-			require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
459
-			require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
460
-			require_once GIVE_PLUGIN_DIR . 'includes/import-functions.php';
461
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
462
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
463
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
464
-			require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
465
-			require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
466
-			require_once GIVE_PLUGIN_DIR . 'includes/currency-functions.php';
467
-			require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
468
-			require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
469
-			require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
470
-			require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
471
-			require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
472
-			require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
473
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php';
474
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
475
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
476
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
477
-
478
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/backward-compatibility.php';
479
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
480
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
481
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
482
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
483
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
484
-
485
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
486
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
487
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
488
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
489
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
490
-
491
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
492
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
493
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notifications.php';
494
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
495
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
496
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
497
-
498
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donors-query.php';
499
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/backward-compatibility.php';
500
-
501
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/class-give-updates.php';
502
-
503
-			if ( defined( 'WP_CLI' ) && WP_CLI ) {
504
-				require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
426
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php';
427
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-async-process.php';
428
+			require_once GIVE_PLUGIN_DIR.'includes/admin/give-metabox-functions.php';
429
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cache.php';
430
+			require_once GIVE_PLUGIN_DIR.'includes/post-types.php';
431
+			require_once GIVE_PLUGIN_DIR.'includes/scripts.php';
432
+			require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php';
433
+			require_once GIVE_PLUGIN_DIR.'includes/actions.php';
434
+			require_once GIVE_PLUGIN_DIR.'includes/filters.php';
435
+			require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php';
436
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-tooltips.php';
437
+			require_once GIVE_PLUGIN_DIR.'includes/class-notices.php';
438
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-translation.php';
439
+
440
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php';
441
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php';
442
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php';
443
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php';
444
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-meta.php';
445
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donors.php';
446
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donor-meta.php';
447
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donor.php';
448
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php';
449
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php';
450
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php';
451
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php';
452
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php';
453
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-email-access.php';
454
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-payment-meta.php';
455
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-form-meta.php';
456
+
457
+			require_once GIVE_PLUGIN_DIR.'includes/country-functions.php';
458
+			require_once GIVE_PLUGIN_DIR.'includes/template-functions.php';
459
+			require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php';
460
+			require_once GIVE_PLUGIN_DIR.'includes/import-functions.php';
461
+			require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php';
462
+			require_once GIVE_PLUGIN_DIR.'includes/forms/template.php';
463
+			require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php';
464
+			require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php';
465
+			require_once GIVE_PLUGIN_DIR.'includes/formatting.php';
466
+			require_once GIVE_PLUGIN_DIR.'includes/currency-functions.php';
467
+			require_once GIVE_PLUGIN_DIR.'includes/price-functions.php';
468
+			require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php';
469
+			require_once GIVE_PLUGIN_DIR.'includes/process-donation.php';
470
+			require_once GIVE_PLUGIN_DIR.'includes/login-register.php';
471
+			require_once GIVE_PLUGIN_DIR.'includes/user-functions.php';
472
+			require_once GIVE_PLUGIN_DIR.'includes/plugin-compatibility.php';
473
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-classes.php';
474
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-functions.php';
475
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-actions.php';
476
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-filters.php';
477
+
478
+			require_once GIVE_PLUGIN_DIR.'includes/payments/backward-compatibility.php';
479
+			require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php';
480
+			require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php';
481
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php';
482
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php';
483
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-payment.php';
484
+
485
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php';
486
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php';
487
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php';
488
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php';
489
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php';
490
+
491
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php';
492
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php';
493
+			require_once GIVE_PLUGIN_DIR.'includes/admin/emails/class-email-notifications.php';
494
+			require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php';
495
+			require_once GIVE_PLUGIN_DIR.'includes/emails/template.php';
496
+			require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php';
497
+
498
+			require_once GIVE_PLUGIN_DIR.'includes/donors/class-give-donors-query.php';
499
+			require_once GIVE_PLUGIN_DIR.'includes/donors/backward-compatibility.php';
500
+
501
+			require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/class-give-updates.php';
502
+
503
+			if (defined('WP_CLI') && WP_CLI) {
504
+				require_once GIVE_PLUGIN_DIR.'includes/class-give-cli-commands.php';
505 505
 			}
506 506
 
507
-			if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
508
-
509
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
510
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php';
511
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
512
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
513
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
514
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
515
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
516
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php';
517
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
518
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
519
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-blank-slate.php';
520
-
521
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
522
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
523
-
524
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php';
525
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php';
526
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php';
527
-
528
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
529
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
530
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
531
-
532
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
533
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
534
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
535
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';
536
-
537
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/reports.php';
538
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/class-give-graph.php';
539
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/graphing.php';
540
-
541
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php';
542
-
543
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';
544
-
545
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
546
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
547
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
548
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
549
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
550
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
551
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
552
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
553
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
507
+			if (is_admin() || (defined('WP_CLI') && WP_CLI)) {
508
+
509
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php';
510
+				require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php';
511
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php';
512
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
513
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-i18n-module.php';
514
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php';
515
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-filters.php';
516
+				require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php';
517
+				require_once GIVE_PLUGIN_DIR.'includes/admin/plugins.php';
518
+				require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php';
519
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-blank-slate.php';
520
+
521
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php';
522
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php';
523
+
524
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donors.php';
525
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-functions.php';
526
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-actions.php';
527
+
528
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php';
529
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/class-metabox-form-data.php';
530
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php';
531
+
532
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-functions.php';
533
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/class-export.php';
534
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-actions.php';
535
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/pdf-reports.php';
536
+
537
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/reports.php';
538
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/class-give-graph.php';
539
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/graphing.php';
540
+
541
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/logs/logs.php';
542
+
543
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/data/tools-actions.php';
544
+
545
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php';
546
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php';
547
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php';
548
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php';
549
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php';
550
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php';
551
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php';
552
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php';
553
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php';
554 554
 			}// End if().
555 555
 
556
-			require_once GIVE_PLUGIN_DIR . 'includes/install.php';
556
+			require_once GIVE_PLUGIN_DIR.'includes/install.php';
557 557
 
558 558
 		}
559 559
 
@@ -568,16 +568,16 @@  discard block
 block discarded – undo
568 568
 		public function load_textdomain() {
569 569
 
570 570
 			// Set filter for Give's languages directory
571
-			$give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
572
-			$give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
571
+			$give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/';
572
+			$give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir);
573 573
 
574 574
 			// Traditional WordPress plugin locale filter.
575
-			$locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
576
-			$locale = apply_filters( 'plugin_locale', $locale, 'give' );
575
+			$locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale();
576
+			$locale = apply_filters('plugin_locale', $locale, 'give');
577 577
 
578
-			unload_textdomain( 'give' );
579
-			load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' );
580
-			load_plugin_textdomain( 'give', false, $give_lang_dir );
578
+			unload_textdomain('give');
579
+			load_textdomain('give', WP_LANG_DIR.'/give/give-'.$locale.'.mo');
580
+			load_plugin_textdomain('give', false, $give_lang_dir);
581 581
 
582 582
 		}
583 583
 
@@ -590,17 +590,17 @@  discard block
 block discarded – undo
590 590
 		 */
591 591
 		public function minmum_phpversion_notice() {
592 592
 			// Bailout.
593
-			if ( ! is_admin() ) {
593
+			if ( ! is_admin()) {
594 594
 				return;
595 595
 			}
596 596
 
597
-			$notice_desc = '<p><strong>' . __( 'Your site could be faster and more secure with a newer PHP version.', 'give' ) . '</strong></p>';
598
-			$notice_desc .= '<p>' . __( 'Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give' ) . '</p>';
599
-			$notice_desc .= '<p>' . __( 'Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give' ) . '</p>';
600
-			$notice_desc .= '<p><strong>' . __( 'To which version should I update?', 'give' ) . '</strong></p>';
601
-			$notice_desc .= '<p>' . __( 'You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give' ) . '</p>';
602
-			$notice_desc .= '<p><strong>' . __( 'Can\'t update? Ask your host!', 'give' ) . '</strong></p>';
603
-			$notice_desc .= '<p>' . sprintf( __( 'If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give' ), sprintf( '<a href="%1$s" target="_blank">', esc_url( 'https://wordpress.org/hosting/' ) ), '</a>' ) . '</p>';
597
+			$notice_desc = '<p><strong>'.__('Your site could be faster and more secure with a newer PHP version.', 'give').'</strong></p>';
598
+			$notice_desc .= '<p>'.__('Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give').'</p>';
599
+			$notice_desc .= '<p>'.__('Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give').'</p>';
600
+			$notice_desc .= '<p><strong>'.__('To which version should I update?', 'give').'</strong></p>';
601
+			$notice_desc .= '<p>'.__('You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give').'</p>';
602
+			$notice_desc .= '<p><strong>'.__('Can\'t update? Ask your host!', 'give').'</strong></p>';
603
+			$notice_desc .= '<p>'.sprintf(__('If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give'), sprintf('<a href="%1$s" target="_blank">', esc_url('https://wordpress.org/hosting/')), '</a>').'</p>';
604 604
 
605 605
 			echo sprintf(
606 606
 				'<div class="notice notice-error">%1$s</div>',
Please login to merge, or discard this patch.