Completed
Pull Request — master (#1857)
by Mehul
18:30
created
includes/admin/system-info.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
  *
50 50
  * @since: 1.4
51 51
  *
52
- * @return bool
52
+ * @return boolean|null
53 53
  */
54 54
 function give_allow_sessions_for_sysinfo() {
55 55
 	if ( is_admin() && ( isset( $_GET['page'] ) && isset( $_GET['tab'] ) ) && ( $_GET['tab'] == 'system_info' && $_GET['page'] == 'give-settings' ) ) {
Please login to merge, or discard this patch.
Spacing   +146 added lines, -146 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
  */
25 25
 function give_system_info_callback() {
26 26
 
27
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
27
+	if ( ! current_user_can('manage_give_settings')) {
28 28
 		return;
29 29
 	}
30 30
 	?>
31
-	<textarea readonly="readonly" onclick="this.focus(); this.select()" id="system-info-textarea" name="give-sysinfo" aria-label="<?php esc_attr_e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'give' ); ?>"><?php echo give_tools_sysinfo_get(); ?></textarea>
31
+	<textarea readonly="readonly" onclick="this.focus(); this.select()" id="system-info-textarea" name="give-sysinfo" aria-label="<?php esc_attr_e('To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'give'); ?>"><?php echo give_tools_sysinfo_get(); ?></textarea>
32 32
 	<p class="submit">
33 33
 		<input type="hidden" name="give-action" value="download_sysinfo"/>
34
-		<?php submit_button( esc_html__( 'Download System Info File', 'give' ), 'secondary', 'give-download-sysinfo', false ); ?>
34
+		<?php submit_button(esc_html__('Download System Info File', 'give'), 'secondary', 'give-download-sysinfo', false); ?>
35 35
 	</p>
36 36
 	<?php
37 37
 }
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
  * @return bool
48 48
  */
49 49
 function give_allow_sessions_for_sysinfo() {
50
-	if ( is_admin() && ( isset( $_GET['page'] ) && isset( $_GET['tab'] ) ) && ( $_GET['tab'] == 'system_info' && $_GET['page'] == 'give-settings' ) ) {
50
+	if (is_admin() && (isset($_GET['page']) && isset($_GET['tab'])) && ($_GET['tab'] == 'system_info' && $_GET['page'] == 'give-settings')) {
51 51
 		return true;
52 52
 	}
53 53
 }
54 54
 
55
-add_filter( 'give_start_session', 'give_allow_sessions_for_sysinfo' );
55
+add_filter('give_start_session', 'give_allow_sessions_for_sysinfo');
56 56
 
57 57
 
58 58
 /**
@@ -70,63 +70,63 @@  discard block
 block discarded – undo
70 70
 
71 71
 	$give_options = give_get_settings();
72 72
 
73
-	if ( ! class_exists( 'Browser' ) ) {
74
-		require_once GIVE_PLUGIN_DIR . 'includes/libraries/browser.php';
73
+	if ( ! class_exists('Browser')) {
74
+		require_once GIVE_PLUGIN_DIR.'includes/libraries/browser.php';
75 75
 	}
76 76
 
77 77
 	$browser = new Browser();
78 78
 
79 79
 	// Get theme info
80
-	if ( get_bloginfo( 'version' ) < '3.4' ) {
81
-		$theme_data = wp_get_theme( get_stylesheet_directory() . '/style.css' );
82
-		$theme      = $theme_data['Name'] . ' ' . $theme_data['Version'];
80
+	if (get_bloginfo('version') < '3.4') {
81
+		$theme_data = wp_get_theme(get_stylesheet_directory().'/style.css');
82
+		$theme      = $theme_data['Name'].' '.$theme_data['Version'];
83 83
 	} else {
84 84
 		$theme_data = wp_get_theme();
85
-		$theme      = $theme_data->Name . ' ' . $theme_data->Version;
85
+		$theme      = $theme_data->Name.' '.$theme_data->Version;
86 86
 	}
87 87
 
88 88
 	// Try to identify the hosting provider
89 89
 	$host = give_get_host();
90 90
 
91
-	$return = '### Begin System Info ###' . "\n\n";
91
+	$return = '### Begin System Info ###'."\n\n";
92 92
 
93 93
 	// Start with the basics...
94
-	$return .= '-- Site Info' . "\n\n";
95
-	$return .= 'Site URL:                 ' . site_url() . "\n";
96
-	$return .= 'Home URL:                 ' . home_url() . "\n";
97
-	$return .= 'Multisite:                ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n";
94
+	$return .= '-- Site Info'."\n\n";
95
+	$return .= 'Site URL:                 '.site_url()."\n";
96
+	$return .= 'Home URL:                 '.home_url()."\n";
97
+	$return .= 'Multisite:                '.(is_multisite() ? 'Yes' : 'No')."\n";
98 98
 
99
-	$return = apply_filters( 'give_sysinfo_after_site_info', $return );
99
+	$return = apply_filters('give_sysinfo_after_site_info', $return);
100 100
 
101 101
 	// Can we determine the site's host?
102
-	if ( $host ) {
103
-		$return .= "\n" . '-- Hosting Provider' . "\n\n";
104
-		$return .= 'Host:                     ' . $host . "\n";
102
+	if ($host) {
103
+		$return .= "\n".'-- Hosting Provider'."\n\n";
104
+		$return .= 'Host:                     '.$host."\n";
105 105
 
106
-		$return = apply_filters( 'give_sysinfo_after_host_info', $return );
106
+		$return = apply_filters('give_sysinfo_after_host_info', $return);
107 107
 	}
108 108
 
109 109
 	// The local users' browser information, handled by the Browser class
110
-	$return .= "\n" . '-- User Browser' . "\n\n";
110
+	$return .= "\n".'-- User Browser'."\n\n";
111 111
 	$return .= $browser;
112 112
 
113
-	$return = apply_filters( 'give_sysinfo_after_user_browser', $return );
113
+	$return = apply_filters('give_sysinfo_after_user_browser', $return);
114 114
 
115 115
 	// WordPress configuration
116
-	$return .= "\n" . '-- WordPress Configuration' . "\n\n";
117
-	$return .= 'Version:                  ' . get_bloginfo( 'version' ) . "\n";
118
-	$return .= 'Language:                 ' . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . "\n";
119
-	$return .= 'Permalink Structure:      ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . "\n";
120
-	$return .= 'Active Theme:             ' . $theme . "\n";
121
-	$return .= 'Show On Front:            ' . get_option( 'show_on_front' ) . "\n";
116
+	$return .= "\n".'-- WordPress Configuration'."\n\n";
117
+	$return .= 'Version:                  '.get_bloginfo('version')."\n";
118
+	$return .= 'Language:                 '.(defined('WPLANG') && WPLANG ? WPLANG : 'en_US')."\n";
119
+	$return .= 'Permalink Structure:      '.(get_option('permalink_structure') ? get_option('permalink_structure') : 'Default')."\n";
120
+	$return .= 'Active Theme:             '.$theme."\n";
121
+	$return .= 'Show On Front:            '.get_option('show_on_front')."\n";
122 122
 
123 123
 	// Only show page specs if frontpage is set to 'page'
124
-	if ( get_option( 'show_on_front' ) == 'page' ) {
125
-		$front_page_id = get_option( 'page_on_front' );
126
-		$blog_page_id  = get_option( 'page_for_posts' );
124
+	if (get_option('show_on_front') == 'page') {
125
+		$front_page_id = get_option('page_on_front');
126
+		$blog_page_id  = get_option('page_for_posts');
127 127
 
128
-		$return .= 'Page On Front:            ' . ( $front_page_id != 0 ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n";
129
-		$return .= 'Page For Posts:           ' . ( $blog_page_id != 0 ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n";
128
+		$return .= 'Page On Front:            '.($front_page_id != 0 ? get_the_title($front_page_id).' (#'.$front_page_id.')' : 'Unset')."\n";
129
+		$return .= 'Page For Posts:           '.($blog_page_id != 0 ? get_the_title($blog_page_id).' (#'.$blog_page_id.')' : 'Unset')."\n";
130 130
 	}
131 131
 
132 132
 	// Make sure wp_remote_post() is working
@@ -136,205 +136,205 @@  discard block
 block discarded – undo
136 136
 	$params = array(
137 137
 		'sslverify'  => false,
138 138
 		'timeout'    => 60,
139
-		'user-agent' => 'Give/' . GIVE_VERSION,
139
+		'user-agent' => 'Give/'.GIVE_VERSION,
140 140
 		'body'       => $request
141 141
 	);
142 142
 
143
-	$response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params );
143
+	$response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', $params);
144 144
 
145
-	if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
145
+	if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
146 146
 		$WP_REMOTE_POST = 'wp_remote_post() works';
147 147
 	} else {
148 148
 		$WP_REMOTE_POST = 'wp_remote_post() does not work';
149 149
 	}
150 150
 
151
-	$return .= 'Remote Post:              ' . $WP_REMOTE_POST . "\n";
152
-	$return .= 'Table Prefix:             ' . 'Length: ' . strlen( $wpdb->prefix ) . '   Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ) . "\n";
153
-	$return .= 'Admin AJAX:               ' . ( give_test_ajax_works() ? 'Accessible' : 'Inaccessible' ) . "\n";
154
-	$return .= 'WP_DEBUG:                 ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
155
-	$return .= 'Memory Limit:             ' . WP_MEMORY_LIMIT . "\n";
156
-	$return .= 'Registered Post Stati:    ' . implode( ', ', get_post_stati() ) . "\n";
151
+	$return .= 'Remote Post:              '.$WP_REMOTE_POST."\n";
152
+	$return .= 'Table Prefix:             '.'Length: '.strlen($wpdb->prefix).'   Status: '.(strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable')."\n";
153
+	$return .= 'Admin AJAX:               '.(give_test_ajax_works() ? 'Accessible' : 'Inaccessible')."\n";
154
+	$return .= 'WP_DEBUG:                 '.(defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set')."\n";
155
+	$return .= 'Memory Limit:             '.WP_MEMORY_LIMIT."\n";
156
+	$return .= 'Registered Post Stati:    '.implode(', ', get_post_stati())."\n";
157 157
 
158
-	$return = apply_filters( 'give_sysinfo_after_wordpress_config', $return );
158
+	$return = apply_filters('give_sysinfo_after_wordpress_config', $return);
159 159
 
160 160
 	// GIVE configuration
161
-	$return .= "\n" . '-- Give Configuration' . "\n\n";
162
-	$return .= 'Version:                  ' . GIVE_VERSION . "\n";
163
-	$return .= 'Upgraded From:            ' . get_option( 'give_version_upgraded_from', 'None' ) . "\n";
164
-	$return .= 'Test Mode:                ' . ( give_is_test_mode() ? "Enabled\n" : "Disabled\n" );
165
-	$return .= 'Currency Code:            ' . give_get_currency() . "\n";
166
-	$return .= 'Currency Position:        ' . give_get_option( 'currency_position', 'before' ) . "\n";
167
-	$return .= 'Decimal Separator:        ' . give_get_option( 'decimal_separator', '.' ) . "\n";
168
-	$return .= 'Thousands Separator:      ' . give_get_option( 'thousands_separator', ',' ) . "\n";
161
+	$return .= "\n".'-- Give Configuration'."\n\n";
162
+	$return .= 'Version:                  '.GIVE_VERSION."\n";
163
+	$return .= 'Upgraded From:            '.get_option('give_version_upgraded_from', 'None')."\n";
164
+	$return .= 'Test Mode:                '.(give_is_test_mode() ? "Enabled\n" : "Disabled\n");
165
+	$return .= 'Currency Code:            '.give_get_currency()."\n";
166
+	$return .= 'Currency Position:        '.give_get_option('currency_position', 'before')."\n";
167
+	$return .= 'Decimal Separator:        '.give_get_option('decimal_separator', '.')."\n";
168
+	$return .= 'Thousands Separator:      '.give_get_option('thousands_separator', ',')."\n";
169 169
 
170
-	$return = apply_filters( 'give_sysinfo_after_give_config', $return );
170
+	$return = apply_filters('give_sysinfo_after_give_config', $return);
171 171
 
172 172
 	// GIVE pages
173
-	$return .= "\n" . '-- Give Page Configuration' . "\n\n";
174
-	$return .= 'Success Page:             ' . ( ! empty( $give_options['success_page'] ) ? get_permalink( $give_options['success_page'] ) . "\n" : "Unset\n" );
175
-	$return .= 'Failure Page:             ' . ( ! empty( $give_options['failure_page'] ) ? get_permalink( $give_options['failure_page'] ) . "\n" : "Unset\n" );
176
-	$return .= 'Give Forms Slug:           ' . ( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . "\n" : "/donations\n" );
173
+	$return .= "\n".'-- Give Page Configuration'."\n\n";
174
+	$return .= 'Success Page:             '.( ! empty($give_options['success_page']) ? get_permalink($give_options['success_page'])."\n" : "Unset\n");
175
+	$return .= 'Failure Page:             '.( ! empty($give_options['failure_page']) ? get_permalink($give_options['failure_page'])."\n" : "Unset\n");
176
+	$return .= 'Give Forms Slug:           '.(defined('GIVE_SLUG') ? '/'.GIVE_SLUG."\n" : "/donations\n");
177 177
 
178
-	$return = apply_filters( 'give_sysinfo_after_give_pages', $return );
178
+	$return = apply_filters('give_sysinfo_after_give_pages', $return);
179 179
 
180 180
 	// GIVE gateways
181
-	$return .= "\n" . '-- Give Gateway Configuration' . "\n\n";
181
+	$return .= "\n".'-- Give Gateway Configuration'."\n\n";
182 182
 
183 183
 	$active_gateways = give_get_enabled_payment_gateways();
184
-	if ( $active_gateways ) {
185
-		$default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) );
186
-		if ( $default_gateway_is_active ) {
187
-			$default_gateway = give_get_default_gateway( null );
188
-			$default_gateway = $active_gateways[ $default_gateway ]['admin_label'];
184
+	if ($active_gateways) {
185
+		$default_gateway_is_active = give_is_gateway_active(give_get_default_gateway(null));
186
+		if ($default_gateway_is_active) {
187
+			$default_gateway = give_get_default_gateway(null);
188
+			$default_gateway = $active_gateways[$default_gateway]['admin_label'];
189 189
 		} else {
190 190
 			$default_gateway = 'Test Donation';
191 191
 		}
192 192
 
193 193
 		$gateways = array();
194
-		foreach ( $active_gateways as $gateway ) {
194
+		foreach ($active_gateways as $gateway) {
195 195
 			$gateways[] = $gateway['admin_label'];
196 196
 		}
197 197
 
198
-		$return .= 'Enabled Gateways:         ' . implode( ', ', $gateways ) . "\n";
199
-		$return .= 'Default Gateway:          ' . $default_gateway . "\n";
198
+		$return .= 'Enabled Gateways:         '.implode(', ', $gateways)."\n";
199
+		$return .= 'Default Gateway:          '.$default_gateway."\n";
200 200
 	} else {
201
-		$return .= 'Enabled Gateways:         None' . "\n";
201
+		$return .= 'Enabled Gateways:         None'."\n";
202 202
 	}
203 203
 
204
-	$return = apply_filters( 'give_sysinfo_after_give_gateways', $return );
204
+	$return = apply_filters('give_sysinfo_after_give_gateways', $return);
205 205
 
206 206
 	// GIVE Templates
207
-	$dir = get_stylesheet_directory() . '/give_templates/*';
208
-	if ( is_dir( $dir ) && ( count( glob( "$dir/*" ) ) !== 0 ) ) {
209
-		$return .= "\n" . '-- Give Template Overrides' . "\n\n";
207
+	$dir = get_stylesheet_directory().'/give_templates/*';
208
+	if (is_dir($dir) && (count(glob("$dir/*")) !== 0)) {
209
+		$return .= "\n".'-- Give Template Overrides'."\n\n";
210 210
 
211
-		foreach ( glob( $dir ) as $file ) {
212
-			$return .= 'Filename:                 ' . basename( $file ) . "\n";
211
+		foreach (glob($dir) as $file) {
212
+			$return .= 'Filename:                 '.basename($file)."\n";
213 213
 		}
214 214
 
215
-		$return = apply_filters( 'give_sysinfo_after_give_templates', $return );
215
+		$return = apply_filters('give_sysinfo_after_give_templates', $return);
216 216
 	}
217 217
 
218 218
 	// Must-use plugins
219 219
 	$muplugins = get_mu_plugins();
220
-	if ( count( $muplugins > 0 ) ) {
221
-		$return .= "\n" . '-- Must-Use Plugins' . "\n\n";
220
+	if (count($muplugins > 0)) {
221
+		$return .= "\n".'-- Must-Use Plugins'."\n\n";
222 222
 
223
-		foreach ( $muplugins as $plugin => $plugin_data ) {
224
-			$return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n";
223
+		foreach ($muplugins as $plugin => $plugin_data) {
224
+			$return .= $plugin_data['Name'].': '.$plugin_data['Version']."\n";
225 225
 		}
226 226
 
227
-		$return = apply_filters( 'give_sysinfo_after_wordpress_mu_plugins', $return );
227
+		$return = apply_filters('give_sysinfo_after_wordpress_mu_plugins', $return);
228 228
 	}
229 229
 
230 230
 	// WordPress active plugins
231
-	$return .= "\n" . '-- WordPress Active Plugins' . "\n\n";
231
+	$return .= "\n".'-- WordPress Active Plugins'."\n\n";
232 232
 
233 233
 	$plugins        = get_plugins();
234
-	$active_plugins = get_option( 'active_plugins', array() );
234
+	$active_plugins = get_option('active_plugins', array());
235 235
 
236
-	foreach ( $plugins as $plugin_path => $plugin ) {
237
-		if ( ! in_array( $plugin_path, $active_plugins ) ) {
236
+	foreach ($plugins as $plugin_path => $plugin) {
237
+		if ( ! in_array($plugin_path, $active_plugins)) {
238 238
 			continue;
239 239
 		}
240 240
 
241
-		$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
241
+		$return .= $plugin['Name'].': '.$plugin['Version']."\n";
242 242
 	}
243 243
 
244
-	$return = apply_filters( 'give_sysinfo_after_wordpress_plugins', $return );
244
+	$return = apply_filters('give_sysinfo_after_wordpress_plugins', $return);
245 245
 
246 246
 	// WordPress inactive plugins
247
-	$return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n";
247
+	$return .= "\n".'-- WordPress Inactive Plugins'."\n\n";
248 248
 
249
-	foreach ( $plugins as $plugin_path => $plugin ) {
250
-		if ( in_array( $plugin_path, $active_plugins ) ) {
249
+	foreach ($plugins as $plugin_path => $plugin) {
250
+		if (in_array($plugin_path, $active_plugins)) {
251 251
 			continue;
252 252
 		}
253 253
 
254
-		$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
254
+		$return .= $plugin['Name'].': '.$plugin['Version']."\n";
255 255
 	}
256 256
 
257
-	$return = apply_filters( 'give_sysinfo_after_wordpress_plugins_inactive', $return );
257
+	$return = apply_filters('give_sysinfo_after_wordpress_plugins_inactive', $return);
258 258
 
259
-	if ( is_multisite() ) {
259
+	if (is_multisite()) {
260 260
 		// WordPress Multisite active plugins
261
-		$return .= "\n" . '-- Network Active Plugins' . "\n\n";
261
+		$return .= "\n".'-- Network Active Plugins'."\n\n";
262 262
 
263 263
 		$plugins        = wp_get_active_network_plugins();
264
-		$active_plugins = get_site_option( 'active_sitewide_plugins', array() );
264
+		$active_plugins = get_site_option('active_sitewide_plugins', array());
265 265
 
266
-		foreach ( $plugins as $plugin_path ) {
267
-			$plugin_base = plugin_basename( $plugin_path );
266
+		foreach ($plugins as $plugin_path) {
267
+			$plugin_base = plugin_basename($plugin_path);
268 268
 
269
-			if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
269
+			if ( ! array_key_exists($plugin_base, $active_plugins)) {
270 270
 				continue;
271 271
 			}
272 272
 
273
-			$plugin = get_plugin_data( $plugin_path );
274
-			$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
273
+			$plugin = get_plugin_data($plugin_path);
274
+			$return .= $plugin['Name'].': '.$plugin['Version']."\n";
275 275
 		}
276 276
 
277
-		$return = apply_filters( 'give_sysinfo_after_wordpress_ms_plugins', $return );
277
+		$return = apply_filters('give_sysinfo_after_wordpress_ms_plugins', $return);
278 278
 	}
279 279
 
280 280
 	// Server configuration (really just versioning)
281
-	$return .= "\n" . '-- Webserver Configuration' . "\n\n";
282
-	$return .= 'PHP Version:              ' . PHP_VERSION . "\n";
283
-	$return .= 'MySQL Version:            ' . $wpdb->db_version() . "\n";
284
-	$return .= 'Webserver Info:           ' . $_SERVER['SERVER_SOFTWARE'] . "\n";
281
+	$return .= "\n".'-- Webserver Configuration'."\n\n";
282
+	$return .= 'PHP Version:              '.PHP_VERSION."\n";
283
+	$return .= 'MySQL Version:            '.$wpdb->db_version()."\n";
284
+	$return .= 'Webserver Info:           '.$_SERVER['SERVER_SOFTWARE']."\n";
285 285
 
286
-	$return = apply_filters( 'give_sysinfo_after_webserver_config', $return );
286
+	$return = apply_filters('give_sysinfo_after_webserver_config', $return);
287 287
 
288 288
 	// PHP configs... now we're getting to the important stuff
289
-	$return .= "\n" . '-- PHP Configuration' . "\n\n";
290
-	$return .= 'Safe Mode:                ' . ( ini_get( 'safe_mode' ) ? 'Enabled' : 'Disabled' . "\n" );
291
-	$return .= 'Memory Limit:             ' . ini_get( 'memory_limit' ) . "\n";
292
-	$return .= 'Upload Max Size:          ' . ini_get( 'upload_max_filesize' ) . "\n";
293
-	$return .= 'Post Max Size:            ' . ini_get( 'post_max_size' ) . "\n";
294
-	$return .= 'Upload Max Filesize:      ' . ini_get( 'upload_max_filesize' ) . "\n";
295
-	$return .= 'Time Limit:               ' . ini_get( 'max_execution_time' ) . "\n";
296
-	$return .= 'Max Input Vars:           ' . ini_get( 'max_input_vars' ) . "\n";
297
-	$return .= 'URL-aware fopen:          ' . ( ini_get( 'allow_url_fopen' ) ? 'On (' . ini_get( 'allow_url_fopen' ) . ')' : 'N/A' ) . "\n";
298
-	$return .= 'Display Errors:           ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
299
-
300
-	$return = apply_filters( 'give_sysinfo_after_php_config', $return );
289
+	$return .= "\n".'-- PHP Configuration'."\n\n";
290
+	$return .= 'Safe Mode:                '.(ini_get('safe_mode') ? 'Enabled' : 'Disabled'."\n");
291
+	$return .= 'Memory Limit:             '.ini_get('memory_limit')."\n";
292
+	$return .= 'Upload Max Size:          '.ini_get('upload_max_filesize')."\n";
293
+	$return .= 'Post Max Size:            '.ini_get('post_max_size')."\n";
294
+	$return .= 'Upload Max Filesize:      '.ini_get('upload_max_filesize')."\n";
295
+	$return .= 'Time Limit:               '.ini_get('max_execution_time')."\n";
296
+	$return .= 'Max Input Vars:           '.ini_get('max_input_vars')."\n";
297
+	$return .= 'URL-aware fopen:          '.(ini_get('allow_url_fopen') ? 'On ('.ini_get('allow_url_fopen').')' : 'N/A')."\n";
298
+	$return .= 'Display Errors:           '.(ini_get('display_errors') ? 'On ('.ini_get('display_errors').')' : 'N/A')."\n";
299
+
300
+	$return = apply_filters('give_sysinfo_after_php_config', $return);
301 301
 
302 302
 	// PHP extensions and such
303
-	$return .= "\n" . '-- PHP Extensions' . "\n\n";
304
-	$return .= 'cURL:                     ' . ( function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported' ) . "\n";
303
+	$return .= "\n".'-- PHP Extensions'."\n\n";
304
+	$return .= 'cURL:                     '.(function_exists('curl_init') ? 'Supported' : 'Not Supported')."\n";
305 305
 
306 306
 	//cURL version
307
-	if ( function_exists( 'curl_init' ) && function_exists( 'curl_version' ) ) {
307
+	if (function_exists('curl_init') && function_exists('curl_version')) {
308 308
 		$curl_values = curl_version();
309
-		$return .= 'cURL Version:             ' . $curl_values["version"] . "\n";
309
+		$return .= 'cURL Version:             '.$curl_values["version"]."\n";
310 310
 	}
311
-	$return .= 'zlib:                     ' . ( function_exists( 'gzcompress' ) ? 'Supported' : 'Not Supported' ) . "\n";
312
-	$return .= 'GD:                       ' . ( ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ) ? 'Supported' : 'Not Supported' ) . "\n";
313
-	$return .= 'fsockopen:                ' . ( function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported' ) . "\n";
314
-	$return .= 'SOAP Client:              ' . ( class_exists( 'SoapClient' ) ? 'Installed' : 'Not Installed' ) . "\n";
315
-	$return .= 'Suhosin:                  ' . ( extension_loaded( 'suhosin' ) ? 'Installed' : 'Not Installed' ) . "\n";
316
-	$return .= 'DOM:                      ' . ( extension_loaded( 'dom' ) ? 'Installed' : 'Not Installed' ) . "\n";
317
-	$return .= 'MBString:                 ' . ( extension_loaded( 'mbstring' ) ? 'Installed' : 'Not Installed' ) . "\n";
311
+	$return .= 'zlib:                     '.(function_exists('gzcompress') ? 'Supported' : 'Not Supported')."\n";
312
+	$return .= 'GD:                       '.((extension_loaded('gd') && function_exists('gd_info')) ? 'Supported' : 'Not Supported')."\n";
313
+	$return .= 'fsockopen:                '.(function_exists('fsockopen') ? 'Supported' : 'Not Supported')."\n";
314
+	$return .= 'SOAP Client:              '.(class_exists('SoapClient') ? 'Installed' : 'Not Installed')."\n";
315
+	$return .= 'Suhosin:                  '.(extension_loaded('suhosin') ? 'Installed' : 'Not Installed')."\n";
316
+	$return .= 'DOM:                      '.(extension_loaded('dom') ? 'Installed' : 'Not Installed')."\n";
317
+	$return .= 'MBString:                 '.(extension_loaded('mbstring') ? 'Installed' : 'Not Installed')."\n";
318 318
 
319
-	$return = apply_filters( 'give_sysinfo_after_php_ext', $return );
319
+	$return = apply_filters('give_sysinfo_after_php_ext', $return);
320 320
 
321 321
 	// Session stuff
322
-	$return .= "\n" . '-- Session Configuration' . "\n\n";
323
-	$return .= 'Give Use Sessions:        ' . ( defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? 'Enforced' : ( Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled' ) ) . "\n";
324
-	$return .= 'Session:                  ' . ( isset( $_SESSION ) ? 'Enabled' : 'Disabled' ) . "\n";
322
+	$return .= "\n".'-- Session Configuration'."\n\n";
323
+	$return .= 'Give Use Sessions:        '.(defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? 'Enforced' : (Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled'))."\n";
324
+	$return .= 'Session:                  '.(isset($_SESSION) ? 'Enabled' : 'Disabled')."\n";
325 325
 
326 326
 	// The rest of this is only relevant is session is enabled
327
-	if ( isset( $_SESSION ) ) {
328
-		$return .= 'Session Name:             ' . esc_html( ini_get( 'session.name' ) ) . "\n";
329
-		$return .= 'Cookie Path:              ' . esc_html( ini_get( 'session.cookie_path' ) ) . "\n";
330
-		$return .= 'Save Path:                ' . esc_html( ini_get( 'session.save_path' ) ) . "\n";
331
-		$return .= 'Use Cookies:              ' . ( ini_get( 'session.use_cookies' ) ? 'On' : 'Off' ) . "\n";
332
-		$return .= 'Use Only Cookies:         ' . ( ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off' ) . "\n";
327
+	if (isset($_SESSION)) {
328
+		$return .= 'Session Name:             '.esc_html(ini_get('session.name'))."\n";
329
+		$return .= 'Cookie Path:              '.esc_html(ini_get('session.cookie_path'))."\n";
330
+		$return .= 'Save Path:                '.esc_html(ini_get('session.save_path'))."\n";
331
+		$return .= 'Use Cookies:              '.(ini_get('session.use_cookies') ? 'On' : 'Off')."\n";
332
+		$return .= 'Use Only Cookies:         '.(ini_get('session.use_only_cookies') ? 'On' : 'Off')."\n";
333 333
 	}
334 334
 
335
-	$return = apply_filters( 'give_sysinfo_after_session_config', $return );
335
+	$return = apply_filters('give_sysinfo_after_session_config', $return);
336 336
 
337
-	$return .= "\n" . '### End System Info ###';
337
+	$return .= "\n".'### End System Info ###';
338 338
 
339 339
 	return $return;
340 340
 }
@@ -348,17 +348,17 @@  discard block
 block discarded – undo
348 348
  */
349 349
 function give_tools_sysinfo_download() {
350 350
 
351
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
351
+	if ( ! current_user_can('manage_give_settings')) {
352 352
 		return;
353 353
 	}
354 354
 
355 355
 	nocache_headers();
356 356
 
357
-	header( 'Content-Type: text/plain' );
358
-	header( 'Content-Disposition: attachment; filename="give-system-info.txt"' );
357
+	header('Content-Type: text/plain');
358
+	header('Content-Disposition: attachment; filename="give-system-info.txt"');
359 359
 
360
-	echo wp_strip_all_tags( $_POST['give-sysinfo'] );
360
+	echo wp_strip_all_tags($_POST['give-sysinfo']);
361 361
 	give_die();
362 362
 }
363 363
 
364
-add_action( 'give_download_sysinfo', 'give_tools_sysinfo_download' );
365 364
\ No newline at end of file
365
+add_action('give_download_sysinfo', 'give_tools_sysinfo_download');
366 366
\ No newline at end of file
Please login to merge, or discard this patch.
includes/error-tracking.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
  *
66 66
  * @since 1.0
67 67
  * @uses  Give_Session::get()
68
- * @return mixed array if errors are present, false if none found
68
+ * @return string array if errors are present, false if none found
69 69
  */
70 70
 function give_get_errors() {
71 71
 	return Give()->session->get( 'give_errors' );
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * @return mixed array if errors are present, false if none found
26 26
  */
27 27
 function give_get_errors() {
28
-	return Give()->session->get( 'give_errors' );
28
+	return Give()->session->get('give_errors');
29 29
 }
30 30
 
31 31
 /**
@@ -42,23 +42,23 @@  discard block
 block discarded – undo
42 42
  *
43 43
  * @return void
44 44
  */
45
-function give_set_error( $error_id, $error_message, $notice_args = array() ) {
45
+function give_set_error($error_id, $error_message, $notice_args = array()) {
46 46
 	$errors = give_get_errors();
47
-	if ( ! $errors ) {
47
+	if ( ! $errors) {
48 48
 		$errors = array();
49 49
 	}
50 50
 
51
-	if( is_array( $notice_args ) && ! empty( $notice_args ) ) {
52
-		$errors[ $error_id ] = array(
51
+	if (is_array($notice_args) && ! empty($notice_args)) {
52
+		$errors[$error_id] = array(
53 53
 			'message'     => $error_message,
54 54
 			'notice_args' => $notice_args,
55 55
 		);
56 56
 	} else {
57 57
 		// Backward compatibility v<1.8.11.
58
-		$errors[ $error_id ] = $error_message;
58
+		$errors[$error_id] = $error_message;
59 59
 	}
60 60
 
61
-	Give()->session->set( 'give_errors', $errors );
61
+	Give()->session->set('give_errors', $errors);
62 62
 }
63 63
 
64 64
 /**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
  * @return void
70 70
  */
71 71
 function give_clear_errors() {
72
-	Give()->session->set( 'give_errors', null );
72
+	Give()->session->set('give_errors', null);
73 73
 }
74 74
 
75 75
 /**
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
  *
83 83
  * @return void
84 84
  */
85
-function give_unset_error( $error_id ) {
85
+function give_unset_error($error_id) {
86 86
 	$errors = give_get_errors();
87
-	if ( $errors ) {
88
-		unset( $errors[ $error_id ] );
89
-		Give()->session->set( 'give_errors', $errors );
87
+	if ($errors) {
88
+		unset($errors[$error_id]);
89
+		Give()->session->set('give_errors', $errors);
90 90
 	}
91 91
 }
92 92
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  * @return string
98 98
  */
99 99
 function _give_die_handler() {
100
-	if ( defined( 'GIVE_UNIT_TESTS' ) ) {
100
+	if (defined('GIVE_UNIT_TESTS')) {
101 101
 		return '_give_die_handler';
102 102
 	} else {
103 103
 		die();
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  *
118 118
  * @return void
119 119
  */
120
-function give_die( $message = '', $title = '', $status = 400 ) {
121
-	add_filter( 'wp_die_ajax_handler', '_give_die_handler', 10, 3 );
122
-	add_filter( 'wp_die_handler', '_give_die_handler', 10, 3 );
123
-	wp_die( $message, $title, array( 'response' => $status ) );
120
+function give_die($message = '', $title = '', $status = 400) {
121
+	add_filter('wp_die_ajax_handler', '_give_die_handler', 10, 3);
122
+	add_filter('wp_die_handler', '_give_die_handler', 10, 3);
123
+	wp_die($message, $title, array('response' => $status));
124 124
 }
Please login to merge, or discard this patch.
includes/admin/upgrades/upgrades.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,11 +64,14 @@
 block discarded – undo
64 64
 				}, 250 );
65 65
 			</script>
66 66
 
67
-		<?php else : ?>
67
+		<?php else {
68
+	: ?>
68 69
 
69 70
 			<div id="give-upgrade-status">
70 71
 				<p style="font-size: 20px;max-width: 900px;">
71
-					<?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?>
72
+					<?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' );
73
+}
74
+?>
72 75
 					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
73 76
 				</p>
74 77
 			</div>
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 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_upgrades_screen() {
24
-	$action = isset( $_GET['give-upgrade'] ) ? sanitize_text_field( $_GET['give-upgrade'] ) : '';
25
-	$step   = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1;
26
-	$total  = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false;
27
-	$custom = isset( $_GET['custom'] ) ? absint( $_GET['custom'] ) : 0;
28
-	$number = isset( $_GET['number'] ) ? absint( $_GET['number'] ) : 100;
29
-	$steps  = round( ( $total / $number ), 0 );
24
+	$action = isset($_GET['give-upgrade']) ? sanitize_text_field($_GET['give-upgrade']) : '';
25
+	$step   = isset($_GET['step']) ? absint($_GET['step']) : 1;
26
+	$total  = isset($_GET['total']) ? absint($_GET['total']) : false;
27
+	$custom = isset($_GET['custom']) ? absint($_GET['custom']) : 0;
28
+	$number = isset($_GET['number']) ? absint($_GET['number']) : 100;
29
+	$steps  = round(($total / $number), 0);
30 30
 
31 31
 	$doing_upgrade_args = array(
32 32
 		'page'         => 'give-upgrades',
@@ -36,25 +36,25 @@  discard block
 block discarded – undo
36 36
 		'custom'       => $custom,
37 37
 		'steps'        => $steps
38 38
 	);
39
-	update_option( 'give_doing_upgrade', $doing_upgrade_args );
40
-	if ( $step > $steps ) {
39
+	update_option('give_doing_upgrade', $doing_upgrade_args);
40
+	if ($step > $steps) {
41 41
 		// Prevent a weird case where the estimate was off. Usually only a couple.
42 42
 		$steps = $step;
43 43
 	}
44 44
 	?>
45 45
 	<div class="wrap">
46
-		<h1><?php esc_html_e( 'Give - Upgrades', 'give' ); ?></h1>
46
+		<h1><?php esc_html_e('Give - Upgrades', 'give'); ?></h1>
47 47
 
48
-		<?php if ( ! empty( $action ) ) : ?>
48
+		<?php if ( ! empty($action)) : ?>
49 49
 
50 50
 			<div id="give-upgrade-status">
51
-				<p style="font-size: 20px;max-width: 900px;"><?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?>
52
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
51
+				<p style="font-size: 20px;max-width: 900px;"><?php esc_html_e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?>
52
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
53 53
 				</p>
54 54
 
55
-				<?php if ( ! empty( $total ) ) : ?>
55
+				<?php if ( ! empty($total)) : ?>
56 56
 					<p>
57
-						<strong><?php printf( esc_html__( 'Step %d of approximately %d running', 'give' ), $step, $steps ); ?></strong>
57
+						<strong><?php printf(esc_html__('Step %d of approximately %d running', 'give'), $step, $steps); ?></strong>
58 58
 					</p>
59 59
 				<?php endif; ?>
60 60
 			</div>
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 
69 69
 			<div id="give-upgrade-status">
70 70
 				<p style="font-size: 20px;max-width: 900px;">
71
-					<?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?>
72
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
71
+					<?php esc_html_e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?>
72
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
73 73
 				</p>
74 74
 			</div>
75 75
 			<script type="text/javascript">
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-login.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,16 +42,16 @@
 block discarded – undo
42 42
 				'minWidth' => 320,
43 43
 				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ),
44 44
 			),
45
-            array(
46
-                'type' => 'container',
47
-                'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
48
-            ),
49
-            array(
50
-                'type'     => 'textbox',
51
-                'name'     => 'logout-redirect',
52
-                'minWidth' => 320,
53
-                'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
54
-            ),
45
+			array(
46
+				'type' => 'container',
47
+				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
48
+			),
49
+			array(
50
+				'type'     => 'textbox',
51
+				'name'     => 'logout-redirect',
52
+				'minWidth' => 320,
53
+				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
54
+			),
55 55
 		);
56 56
 	}
57 57
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['title'] = esc_html__( 'Login', 'give' );
25
-		$this->shortcode['label'] = esc_html__( 'Login', 'give' );
24
+		$this->shortcode['title'] = esc_html__('Login', 'give');
25
+		$this->shortcode['label'] = esc_html__('Login', 'give');
26 26
 
27
-		parent::__construct( 'give_login' );
27
+		parent::__construct('give_login');
28 28
 	}
29 29
 
30 30
 	/**
@@ -37,23 +37,23 @@  discard block
 block discarded – undo
37 37
 		return array(
38 38
 			array(
39 39
 				'type' => 'container',
40
-				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Login Redirect URL (optional):', 'give' ) ),
40
+				'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Login Redirect URL (optional):', 'give')),
41 41
 			),
42 42
 			array(
43 43
 				'type'     => 'textbox',
44 44
 				'name'     => 'login-redirect',
45 45
 				'minWidth' => 320,
46
-				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ),
46
+				'tooltip'  => esc_attr__('Enter an URL here to redirect to after login.', 'give'),
47 47
 			),
48 48
             array(
49 49
                 'type' => 'container',
50
-                'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
50
+                'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Logout Redirect URL (optional):', 'give')),
51 51
             ),
52 52
             array(
53 53
                 'type'     => 'textbox',
54 54
                 'name'     => 'logout-redirect',
55 55
                 'minWidth' => 320,
56
-                'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
56
+                'tooltip'  => esc_attr__('Enter an URL here to redirect to after logout.', 'give'),
57 57
             ),
58 58
 		);
59 59
 	}
Please login to merge, or discard this patch.
includes/admin/shortcodes/abstract-shortcode-generator.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -248,8 +248,8 @@
 block discarded – undo
248 248
 
249 249
 			// do not reindex array!
250 250
 			$field['options'] = array(
251
-				                    '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
252
-			                    ) + $field['options'];
251
+									'' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
252
+								) + $field['options'];
253 253
 
254 254
 			foreach ( $field['options'] as $value => $text ) {
255 255
 				$new_listbox['values'][] = array(
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @since 1.0
64 64
 	 */
65
-	public function __construct( $shortcode ) {
65
+	public function __construct($shortcode) {
66 66
 
67 67
 		$this->shortcode_tag = $shortcode;
68 68
 
69
-		add_action( 'admin_init', array( $this, 'init' ) );
69
+		add_action('admin_init', array($this, 'init'));
70 70
 
71 71
 	}
72 72
 
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	public function init() {
79 79
 
80
-		if ( $this->shortcode_tag ) {
80
+		if ($this->shortcode_tag) {
81 81
 
82
-			$this->self = get_class( $this );
82
+			$this->self = get_class($this);
83 83
 
84 84
 			$this->errors   = array();
85 85
 			$this->required = array();
@@ -88,18 +88,18 @@  discard block
 block discarded – undo
88 88
 			$fields = $this->get_fields();
89 89
 
90 90
 			$defaults = array(
91
-				'btn_close' => esc_html__( 'Close', 'give' ),
92
-				'btn_okay'  => esc_html__( 'Insert Shortcode', 'give' ),
91
+				'btn_close' => esc_html__('Close', 'give'),
92
+				'btn_okay'  => esc_html__('Insert Shortcode', 'give'),
93 93
 				'errors'    => $this->errors,
94 94
 				'fields'    => $fields,
95
-				'label'     => '[' . $this->shortcode_tag . ']',
95
+				'label'     => '['.$this->shortcode_tag.']',
96 96
 				'required'  => $this->required,
97
-				'title'     => esc_html__( 'Insert Shortcode', 'give' ),
97
+				'title'     => esc_html__('Insert Shortcode', 'give'),
98 98
 			);
99 99
 
100
-			if ( user_can_richedit() ) {
100
+			if (user_can_richedit()) {
101 101
 
102
-				Give_Shortcode_Button::$shortcodes[ $this->shortcode_tag ] = wp_parse_args( $this->shortcode, $defaults );
102
+				Give_Shortcode_Button::$shortcodes[$this->shortcode_tag] = wp_parse_args($this->shortcode, $defaults);
103 103
 
104 104
 			}
105 105
 		}
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 	 *
129 129
 	 * @since 1.0
130 130
 	 */
131
-	protected function generate_fields( $defined_fields ) {
131
+	protected function generate_fields($defined_fields) {
132 132
 
133 133
 		$fields = array();
134 134
 
135
-		if ( is_array( $defined_fields ) ) {
135
+		if (is_array($defined_fields)) {
136 136
 
137
-			foreach ( $defined_fields as $field ) {
137
+			foreach ($defined_fields as $field) {
138 138
 
139 139
 				$defaults = array(
140 140
 					'label'       => false,
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
 					'type'        => '',
146 146
 				);
147 147
 
148
-				$field  = wp_parse_args( (array) $field, $defaults );
149
-				$method = 'generate_' . strtolower( $field['type'] );
148
+				$field  = wp_parse_args((array) $field, $defaults);
149
+				$method = 'generate_'.strtolower($field['type']);
150 150
 
151
-				if ( method_exists( $this, $method ) ) {
151
+				if (method_exists($this, $method)) {
152 152
 
153
-					$field = call_user_func( array( $this, $method ), $field );
153
+					$field = call_user_func(array($this, $method), $field);
154 154
 
155
-					if ( $field ) {
155
+					if ($field) {
156 156
 						$fields[] = $field;
157 157
 					}
158 158
 				}
@@ -172,22 +172,22 @@  discard block
 block discarded – undo
172 172
 	protected function get_fields() {
173 173
 
174 174
 		$defined_fields   = $this->define_fields();
175
-		$generated_fields = $this->generate_fields( $defined_fields );
175
+		$generated_fields = $this->generate_fields($defined_fields);
176 176
 
177 177
 		$errors = array();
178 178
 
179
-		if ( ! empty( $this->errors ) ) {
180
-			foreach ( $this->required as $name => $alert ) {
181
-				if ( false === array_search( $name, array_column( $generated_fields, 'name' ) ) ) {
179
+		if ( ! empty($this->errors)) {
180
+			foreach ($this->required as $name => $alert) {
181
+				if (false === array_search($name, array_column($generated_fields, 'name'))) {
182 182
 
183
-					$errors[] = $this->errors[ $name ];
183
+					$errors[] = $this->errors[$name];
184 184
 				}
185 185
 			}
186 186
 
187 187
 			$this->errors = $errors;
188 188
 		}
189 189
 
190
-		if ( ! empty( $errors ) ) {
190
+		if ( ! empty($errors)) {
191 191
 
192 192
 			return $errors;
193 193
 		}
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
 	 *
205 205
 	 * @since 1.0
206 206
 	 */
207
-	protected function generate_container( $field ) {
207
+	protected function generate_container($field) {
208 208
 
209
-		if ( array_key_exists( 'html', $field ) ) {
209
+		if (array_key_exists('html', $field)) {
210 210
 
211 211
 			return array(
212 212
 				'type' => $field['type'],
@@ -226,9 +226,9 @@  discard block
 block discarded – undo
226 226
 	 *
227 227
 	 * @since 1.0
228 228
 	 */
229
-	protected function generate_listbox( $field ) {
229
+	protected function generate_listbox($field) {
230 230
 
231
-		$listbox = shortcode_atts( array(
231
+		$listbox = shortcode_atts(array(
232 232
 			'label'    => '',
233 233
 			'minWidth' => '',
234 234
 			'name'     => false,
@@ -236,27 +236,27 @@  discard block
 block discarded – undo
236 236
 			'type'     => '',
237 237
 			'value'    => '',
238 238
 			'classes'  => ''
239
-		), $field );
239
+		), $field);
240 240
 
241
-		if ( $this->validate( $field ) ) {
241
+		if ($this->validate($field)) {
242 242
 
243 243
 			$new_listbox = array();
244 244
 
245
-			foreach ( $listbox as $key => $value ) {
245
+			foreach ($listbox as $key => $value) {
246 246
 
247
-				if ( $key == 'value' && empty( $value ) ) {
248
-					$new_listbox[ $key ] = $listbox['name'];
249
-				} else if ( $value ) {
250
-					$new_listbox[ $key ] = $value;
247
+				if ($key == 'value' && empty($value)) {
248
+					$new_listbox[$key] = $listbox['name'];
249
+				} else if ($value) {
250
+					$new_listbox[$key] = $value;
251 251
 				}
252 252
 			}
253 253
 
254 254
 			// do not reindex array!
255 255
 			$field['options'] = array(
256
-				                    '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
256
+				                    '' => ($field['placeholder'] ? $field['placeholder'] : esc_attr__('- Select -', 'give')),
257 257
 			                    ) + $field['options'];
258 258
 
259
-			foreach ( $field['options'] as $value => $text ) {
259
+			foreach ($field['options'] as $value => $text) {
260 260
 				$new_listbox['values'][] = array(
261 261
 					'text'  => $text,
262 262
 					'value' => $value,
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 *
279 279
 	 * @since 1.0
280 280
 	 */
281
-	protected function generate_post( $field ) {
281
+	protected function generate_post($field) {
282 282
 
283 283
 		$args = array(
284 284
 			'post_type'      => 'post',
@@ -287,23 +287,23 @@  discard block
 block discarded – undo
287 287
 			'posts_per_page' => 30,
288 288
 		);
289 289
 
290
-		$args    = wp_parse_args( (array) $field['query_args'], $args );
291
-		$posts   = get_posts( $args );
290
+		$args    = wp_parse_args((array) $field['query_args'], $args);
291
+		$posts   = get_posts($args);
292 292
 		$options = array();
293 293
 
294
-		if ( $posts ) {
295
-			foreach ( $posts as $post ) {
296
-				$options[ absint( $post->ID ) ] = ( empty( $post->post_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $post->ID ) : $post->post_title );
294
+		if ($posts) {
295
+			foreach ($posts as $post) {
296
+				$options[absint($post->ID)] = (empty($post->post_title) ? sprintf(__('Untitled (#%s)', 'give'), $post->ID) : $post->post_title);
297 297
 			}
298 298
 
299 299
 			$field['type']    = 'listbox';
300 300
 			$field['options'] = $options;
301 301
 
302
-			return $this->generate_listbox( $field );
302
+			return $this->generate_listbox($field);
303 303
 		}
304 304
 
305 305
 		// perform validation here before returning false
306
-		$this->validate( $field );
306
+		$this->validate($field);
307 307
 
308 308
 		return false;
309 309
 	}
@@ -317,9 +317,9 @@  discard block
 block discarded – undo
317 317
 	 *
318 318
 	 * @since 1.0
319 319
 	 */
320
-	protected function generate_textbox( $field ) {
320
+	protected function generate_textbox($field) {
321 321
 
322
-		$textbox = shortcode_atts( array(
322
+		$textbox = shortcode_atts(array(
323 323
 			'label'     => '',
324 324
 			'maxLength' => '',
325 325
 			'minHeight' => '',
@@ -330,10 +330,10 @@  discard block
 block discarded – undo
330 330
 			'type'      => '',
331 331
 			'value'     => '',
332 332
 			'classes'   => ''
333
-		), $field );
333
+		), $field);
334 334
 
335
-		if ( $this->validate( $field ) ) {
336
-			return array_filter( $textbox, array( $this, 'return_textbox_value' ) );
335
+		if ($this->validate($field)) {
336
+			return array_filter($textbox, array($this, 'return_textbox_value'));
337 337
 		}
338 338
 
339 339
 		return false;
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 	 *
347 347
 	 * @return bool
348 348
 	 */
349
-	function return_textbox_value( $value ) {
349
+	function return_textbox_value($value) {
350 350
 		return $value !== '';
351 351
 	}
352 352
 
@@ -362,9 +362,9 @@  discard block
 block discarded – undo
362 362
 	 *
363 363
 	 * @since 1.0
364 364
 	 */
365
-	protected function validate( $field ) {
365
+	protected function validate($field) {
366 366
 
367
-		extract( shortcode_atts(
367
+		extract(shortcode_atts(
368 368
 				array(
369 369
 					'name'     => false,
370 370
 					'required' => false,
@@ -372,36 +372,36 @@  discard block
 block discarded – undo
372 372
 				), $field )
373 373
 		);
374 374
 
375
-		if ( $name ) {
375
+		if ($name) {
376 376
 
377
-			if ( isset( $required['error'] ) ) {
377
+			if (isset($required['error'])) {
378 378
 
379 379
 				$error = array(
380 380
 					'type' => 'container',
381 381
 					'html' => $required['error'],
382 382
 				);
383 383
 
384
-				$this->errors[ $name ] = $this->generate_container( $error );
384
+				$this->errors[$name] = $this->generate_container($error);
385 385
 			}
386 386
 
387
-			if ( ! ! $required || is_array( $required ) ) {
387
+			if ( ! ! $required || is_array($required)) {
388 388
 
389
-				$alert = esc_html__( 'Some of the shortcode options are required.', 'give' );
389
+				$alert = esc_html__('Some of the shortcode options are required.', 'give');
390 390
 
391
-				if ( isset( $required['alert'] ) ) {
391
+				if (isset($required['alert'])) {
392 392
 
393 393
 					$alert = $required['alert'];
394 394
 
395
-				} else if ( ! empty( $label ) ) {
395
+				} else if ( ! empty($label)) {
396 396
 
397 397
 					$alert = sprintf(
398 398
 					/* translators: %s: option label */
399
-						esc_html__( 'The "%s" option is required.', 'give' ),
400
-						str_replace( ':', '', $label )
399
+						esc_html__('The "%s" option is required.', 'give'),
400
+						str_replace(':', '', $label)
401 401
 					);
402 402
 				}
403 403
 
404
-				$this->required[ $name ] = $alert;
404
+				$this->required[$name] = $alert;
405 405
 			}
406 406
 
407 407
 			return true;
Please login to merge, or discard this patch.
includes/misc-functions.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -337,7 +337,7 @@
 block discarded – undo
337 337
  *
338 338
  * @since 1.0
339 339
  * @uses  Give()->session->get()
340
- * @return mixed array | false
340
+ * @return string array | false
341 341
  */
342 342
 function give_get_purchase_session() {
343 343
 	return Give()->session->get( 'give_purchase' );
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -812,10 +812,10 @@  discard block
 block discarded – undo
812 812
 		}
813 813
 
814 814
 		if ( ! is_int( $params[1] )
815
-		     && ! is_float( $params[1] )
816
-		     && ! is_string( $params[1] )
817
-		     && $params[1] !== null
818
-		     && ! ( is_object( $params[1] ) && method_exists( $params[1], '__toString' ) )
815
+			 && ! is_float( $params[1] )
816
+			 && ! is_string( $params[1] )
817
+			 && $params[1] !== null
818
+			 && ! ( is_object( $params[1] ) && method_exists( $params[1], '__toString' ) )
819 819
 		) {
820 820
 			trigger_error( esc_html__( 'array_column(): The column key should be either a string or an integer.', 'give' ), E_USER_WARNING );
821 821
 
@@ -823,10 +823,10 @@  discard block
 block discarded – undo
823 823
 		}
824 824
 
825 825
 		if ( isset( $params[2] )
826
-		     && ! is_int( $params[2] )
827
-		     && ! is_float( $params[2] )
828
-		     && ! is_string( $params[2] )
829
-		     && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) )
826
+			 && ! is_int( $params[2] )
827
+			 && ! is_float( $params[2] )
828
+			 && ! is_string( $params[2] )
829
+			 && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) )
830 830
 		) {
831 831
 			trigger_error( esc_html__( 'array_column(): The index key should be either a string or an integer.', 'give' ), E_USER_WARNING );
832 832
 
Please login to merge, or discard this patch.
Spacing   +223 added lines, -223 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
  */
24 24
 function give_is_test_mode() {
25 25
 
26
-	$ret = give_is_setting_enabled( give_get_option( 'test_mode' ) );
26
+	$ret = give_is_setting_enabled(give_get_option('test_mode'));
27 27
 
28
-	return (bool) apply_filters( 'give_is_test_mode', $ret );
28
+	return (bool) apply_filters('give_is_test_mode', $ret);
29 29
 
30 30
 }
31 31
 
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
  */
38 38
 function give_get_currency() {
39 39
 
40
-	$currency = give_get_option( 'currency', 'USD' );
40
+	$currency = give_get_option('currency', 'USD');
41 41
 
42
-	return apply_filters( 'give_currency', $currency );
42
+	return apply_filters('give_currency', $currency);
43 43
 }
44 44
 
45 45
 /**
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
  */
52 52
 function give_get_currency_position() {
53 53
 
54
-	$currency_pos = give_get_option( 'currency_position', 'before' );
54
+	$currency_pos = give_get_option('currency_position', 'before');
55 55
 
56
-	return apply_filters( 'give_currency_position', $currency_pos );
56
+	return apply_filters('give_currency_position', $currency_pos);
57 57
 }
58 58
 
59 59
 
@@ -66,39 +66,39 @@  discard block
 block discarded – undo
66 66
 
67 67
 function give_get_currencies() {
68 68
 	$currencies = array(
69
-		'USD'  => __( 'US Dollars ($)', 'give' ),
70
-		'EUR'  => __( 'Euros (€)', 'give' ),
71
-		'GBP'  => __( 'Pounds Sterling (£)', 'give' ),
72
-		'AUD'  => __( 'Australian Dollars ($)', 'give' ),
73
-		'BRL'  => __( 'Brazilian Real (R$)', 'give' ),
74
-		'CAD'  => __( 'Canadian Dollars ($)', 'give' ),
75
-		'CZK'  => __( 'Czech Koruna (Kč)', 'give' ),
76
-		'DKK'  => __( 'Danish Krone (kr.)', 'give' ),
77
-		'HKD'  => __( 'Hong Kong Dollar ($)', 'give' ),
78
-		'HUF'  => __( 'Hungarian Forint (Ft)', 'give' ),
79
-		'ILS'  => __( 'Israeli Shekel (₪)', 'give' ),
80
-		'JPY'  => __( 'Japanese Yen (¥)', 'give' ),
81
-		'MYR'  => __( 'Malaysian Ringgits (RM)', 'give' ),
82
-		'MXN'  => __( 'Mexican Peso ($)', 'give' ),
83
-		'MAD'  => __( 'Moroccan Dirham (&#x2e;&#x62f;&#x2e;&#x645;)', 'give' ),
84
-		'NZD'  => __( 'New Zealand Dollar ($)', 'give' ),
85
-		'NOK'  => __( 'Norwegian Krone (Kr.)', 'give' ),
86
-		'PHP'  => __( 'Philippine Pesos (₱)', 'give' ),
87
-		'PLN'  => __( 'Polish Zloty (zł)', 'give' ),
88
-		'SGD'  => __( 'Singapore Dollar ($)', 'give' ),
89
-		'KRW'  => __( 'South Korean Won (₩)', 'give' ),
90
-		'ZAR'  => __( 'South African Rand (R)', 'give' ),
91
-		'SEK'  => __( 'Swedish Krona (kr)', 'give' ),
92
-		'CHF'  => __( 'Swiss Franc (CHF)', 'give' ),
93
-		'TWD'  => __( 'Taiwan New Dollars (NT$)', 'give' ),
94
-		'THB'  => __( 'Thai Baht (฿)', 'give' ),
95
-		'INR'  => __( 'Indian Rupee (₹)', 'give' ),
96
-		'TRY'  => __( 'Turkish Lira (₺)', 'give' ),
97
-		'RIAL' => __( 'Iranian Rial (﷼)', 'give' ),
98
-		'RUB'  => __( 'Russian Rubles (руб)', 'give' ),
69
+		'USD'  => __('US Dollars ($)', 'give'),
70
+		'EUR'  => __('Euros (€)', 'give'),
71
+		'GBP'  => __('Pounds Sterling (£)', 'give'),
72
+		'AUD'  => __('Australian Dollars ($)', 'give'),
73
+		'BRL'  => __('Brazilian Real (R$)', 'give'),
74
+		'CAD'  => __('Canadian Dollars ($)', 'give'),
75
+		'CZK'  => __('Czech Koruna (Kč)', 'give'),
76
+		'DKK'  => __('Danish Krone (kr.)', 'give'),
77
+		'HKD'  => __('Hong Kong Dollar ($)', 'give'),
78
+		'HUF'  => __('Hungarian Forint (Ft)', 'give'),
79
+		'ILS'  => __('Israeli Shekel (₪)', 'give'),
80
+		'JPY'  => __('Japanese Yen (¥)', 'give'),
81
+		'MYR'  => __('Malaysian Ringgits (RM)', 'give'),
82
+		'MXN'  => __('Mexican Peso ($)', 'give'),
83
+		'MAD'  => __('Moroccan Dirham (&#x2e;&#x62f;&#x2e;&#x645;)', 'give'),
84
+		'NZD'  => __('New Zealand Dollar ($)', 'give'),
85
+		'NOK'  => __('Norwegian Krone (Kr.)', 'give'),
86
+		'PHP'  => __('Philippine Pesos (₱)', 'give'),
87
+		'PLN'  => __('Polish Zloty (zł)', 'give'),
88
+		'SGD'  => __('Singapore Dollar ($)', 'give'),
89
+		'KRW'  => __('South Korean Won (₩)', 'give'),
90
+		'ZAR'  => __('South African Rand (R)', 'give'),
91
+		'SEK'  => __('Swedish Krona (kr)', 'give'),
92
+		'CHF'  => __('Swiss Franc (CHF)', 'give'),
93
+		'TWD'  => __('Taiwan New Dollars (NT$)', 'give'),
94
+		'THB'  => __('Thai Baht (฿)', 'give'),
95
+		'INR'  => __('Indian Rupee (₹)', 'give'),
96
+		'TRY'  => __('Turkish Lira (₺)', 'give'),
97
+		'RIAL' => __('Iranian Rial (﷼)', 'give'),
98
+		'RUB'  => __('Russian Rubles (руб)', 'give'),
99 99
 	);
100 100
 
101
-	return apply_filters( 'give_currencies', $currencies );
101
+	return apply_filters('give_currencies', $currencies);
102 102
 }
103 103
 
104 104
 
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
  *
116 116
  * @return string           The symbol to use for the currency
117 117
  */
118
-function give_currency_symbol( $currency = '', $decode_currency = false ) {
118
+function give_currency_symbol($currency = '', $decode_currency = false) {
119 119
 
120
-	if ( empty( $currency ) ) {
120
+	if (empty($currency)) {
121 121
 		$currency = give_get_currency();
122 122
 	}
123
-	switch ( $currency ) :
123
+	switch ($currency) :
124 124
 		case 'GBP' :
125 125
 			$symbol = '&pound;';
126 126
 			break;
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
 			break;
199 199
 	endswitch;
200 200
 
201
-	$symbol = ( ! $decode_currency ? $symbol : html_entity_decode( $symbol ) );
201
+	$symbol = ( ! $decode_currency ? $symbol : html_entity_decode($symbol));
202 202
 
203
-	return apply_filters( 'give_currency_symbol', $symbol, $currency );
203
+	return apply_filters('give_currency_symbol', $symbol, $currency);
204 204
 }
205 205
 
206 206
 
@@ -213,16 +213,16 @@  discard block
 block discarded – undo
213 213
  *
214 214
  * @return string
215 215
  */
216
-function give_get_currency_name( $currency_code ) {
216
+function give_get_currency_name($currency_code) {
217 217
 	$currency_name = '';
218 218
 	$currency_names = give_get_currencies();
219 219
 
220
-	if ( $currency_code && array_key_exists( $currency_code, $currency_names ) ) {
221
-		$currency_name = explode( '(',  $currency_names[ $currency_code ] );
222
-		$currency_name = trim( current( $currency_name ) );
220
+	if ($currency_code && array_key_exists($currency_code, $currency_names)) {
221
+		$currency_name = explode('(', $currency_names[$currency_code]);
222
+		$currency_name = trim(current($currency_name));
223 223
 	}
224 224
 
225
-	return apply_filters( 'give_currency_name', $currency_name, $currency_code );
225
+	return apply_filters('give_currency_name', $currency_name, $currency_code);
226 226
 }
227 227
 
228 228
 
@@ -236,21 +236,21 @@  discard block
 block discarded – undo
236 236
 
237 237
 	global $wp;
238 238
 
239
-	if ( get_option( 'permalink_structure' ) ) {
240
-		$base = trailingslashit( home_url( $wp->request ) );
239
+	if (get_option('permalink_structure')) {
240
+		$base = trailingslashit(home_url($wp->request));
241 241
 	} else {
242
-		$base = add_query_arg( $wp->query_string, '', trailingslashit( home_url( $wp->request ) ) );
243
-		$base = remove_query_arg( array( 'post_type', 'name' ), $base );
242
+		$base = add_query_arg($wp->query_string, '', trailingslashit(home_url($wp->request)));
243
+		$base = remove_query_arg(array('post_type', 'name'), $base);
244 244
 	}
245 245
 
246 246
 	$scheme      = is_ssl() ? 'https' : 'http';
247
-	$current_uri = set_url_scheme( $base, $scheme );
247
+	$current_uri = set_url_scheme($base, $scheme);
248 248
 
249
-	if ( is_front_page() ) {
250
-		$current_uri = home_url( '/' );
249
+	if (is_front_page()) {
250
+		$current_uri = home_url('/');
251 251
 	}
252 252
 
253
-	return apply_filters( 'give_get_current_page_url', $current_uri );
253
+	return apply_filters('give_get_current_page_url', $current_uri);
254 254
 
255 255
 }
256 256
 
@@ -272,15 +272,15 @@  discard block
 block discarded – undo
272 272
 	 */
273 273
 	$gateways = give_get_enabled_payment_gateways();
274 274
 
275
-	if ( count( $gateways ) == 1 && ! isset( $gateways['paypal'] ) && ! isset( $gateways['manual'] ) ) {
275
+	if (count($gateways) == 1 && ! isset($gateways['paypal']) && ! isset($gateways['manual'])) {
276 276
 		$ret = true;
277
-	} elseif ( count( $gateways ) == 1 ) {
277
+	} elseif (count($gateways) == 1) {
278 278
 		$ret = false;
279
-	} elseif ( count( $gateways ) == 2 && isset( $gateways['paypal'] ) && isset( $gateways['manual'] ) ) {
279
+	} elseif (count($gateways) == 2 && isset($gateways['paypal']) && isset($gateways['manual'])) {
280 280
 		$ret = false;
281 281
 	}
282 282
 
283
-	return (bool) apply_filters( 'give_verify_credit_cards', $ret );
283
+	return (bool) apply_filters('give_verify_credit_cards', $ret);
284 284
 }
285 285
 
286 286
 /**
@@ -292,26 +292,26 @@  discard block
 block discarded – undo
292 292
 function give_get_timezone_id() {
293 293
 
294 294
 	// if site timezone string exists, return it.
295
-	if ( $timezone = get_option( 'timezone_string' ) ) {
295
+	if ($timezone = get_option('timezone_string')) {
296 296
 		return $timezone;
297 297
 	}
298 298
 
299 299
 	// get UTC offset, if it isn't set return UTC.
300
-	if ( ! ( $utc_offset = 3600 * get_option( 'gmt_offset', 0 ) ) ) {
300
+	if ( ! ($utc_offset = 3600 * get_option('gmt_offset', 0))) {
301 301
 		return 'UTC';
302 302
 	}
303 303
 
304 304
 	// attempt to guess the timezone string from the UTC offset.
305
-	$timezone = timezone_name_from_abbr( '', $utc_offset );
305
+	$timezone = timezone_name_from_abbr('', $utc_offset);
306 306
 
307 307
 	// last try, guess timezone string manually.
308
-	if ( $timezone === false ) {
308
+	if ($timezone === false) {
309 309
 
310
-		$is_dst = date( 'I' );
310
+		$is_dst = date('I');
311 311
 
312
-		foreach ( timezone_abbreviations_list() as $abbr ) {
313
-			foreach ( $abbr as $city ) {
314
-				if ( $city['dst'] == $is_dst && $city['offset'] == $utc_offset ) {
312
+		foreach (timezone_abbreviations_list() as $abbr) {
313
+			foreach ($abbr as $city) {
314
+				if ($city['dst'] == $is_dst && $city['offset'] == $utc_offset) {
315 315
 					return $city['timezone_id'];
316 316
 				}
317 317
 			}
@@ -335,17 +335,17 @@  discard block
 block discarded – undo
335 335
 
336 336
 	$ip = '127.0.0.1';
337 337
 
338
-	if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
338
+	if ( ! empty($_SERVER['HTTP_CLIENT_IP'])) {
339 339
 		// check ip from share internet
340 340
 		$ip = $_SERVER['HTTP_CLIENT_IP'];
341
-	} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
341
+	} elseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
342 342
 		// to check ip is pass from proxy
343 343
 		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
344
-	} elseif ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) {
344
+	} elseif ( ! empty($_SERVER['REMOTE_ADDR'])) {
345 345
 		$ip = $_SERVER['REMOTE_ADDR'];
346 346
 	}
347 347
 
348
-	return apply_filters( 'give_get_ip', $ip );
348
+	return apply_filters('give_get_ip', $ip);
349 349
 }
350 350
 
351 351
 
@@ -360,9 +360,9 @@  discard block
 block discarded – undo
360 360
  *
361 361
  * @uses  Give()->session->set()
362 362
  */
363
-function give_set_purchase_session( $purchase_data = array() ) {
364
-	Give()->session->set( 'give_purchase', $purchase_data );
365
-	Give()->session->set( 'give_email', $purchase_data['user_email'] );
363
+function give_set_purchase_session($purchase_data = array()) {
364
+	Give()->session->set('give_purchase', $purchase_data);
365
+	Give()->session->set('give_email', $purchase_data['user_email']);
366 366
 }
367 367
 
368 368
 /**
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
  * @return mixed array | false
377 377
  */
378 378
 function give_get_purchase_session() {
379
-	return Give()->session->get( 'give_purchase' );
379
+	return Give()->session->get('give_purchase');
380 380
 }
381 381
 
382 382
 /**
@@ -391,14 +391,14 @@  discard block
 block discarded – undo
391 391
  *
392 392
  * @return string
393 393
  */
394
-function give_get_purchase_summary( $purchase_data, $email = true ) {
394
+function give_get_purchase_summary($purchase_data, $email = true) {
395 395
 	$summary = '';
396 396
 
397
-	if ( $email ) {
398
-		$summary .= $purchase_data['user_email'] . ' - ';
397
+	if ($email) {
398
+		$summary .= $purchase_data['user_email'].' - ';
399 399
 	}
400 400
 
401
-	$summary .= get_the_title( $purchase_data['post_data']['give-form-id'] );
401
+	$summary .= get_the_title($purchase_data['post_data']['give-form-id']);
402 402
 
403 403
 	return $summary;
404 404
 }
@@ -415,31 +415,31 @@  discard block
 block discarded – undo
415 415
 function give_get_host() {
416 416
 	$host = false;
417 417
 
418
-	if ( defined( 'WPE_APIKEY' ) ) {
418
+	if (defined('WPE_APIKEY')) {
419 419
 		$host = 'WP Engine';
420
-	} elseif ( defined( 'PAGELYBIN' ) ) {
420
+	} elseif (defined('PAGELYBIN')) {
421 421
 		$host = 'Pagely';
422
-	} elseif ( DB_HOST == 'localhost:/tmp/mysql5.sock' ) {
422
+	} elseif (DB_HOST == 'localhost:/tmp/mysql5.sock') {
423 423
 		$host = 'ICDSoft';
424
-	} elseif ( DB_HOST == 'mysqlv5' ) {
424
+	} elseif (DB_HOST == 'mysqlv5') {
425 425
 		$host = 'NetworkSolutions';
426
-	} elseif ( strpos( DB_HOST, 'ipagemysql.com' ) !== false ) {
426
+	} elseif (strpos(DB_HOST, 'ipagemysql.com') !== false) {
427 427
 		$host = 'iPage';
428
-	} elseif ( strpos( DB_HOST, 'ipowermysql.com' ) !== false ) {
428
+	} elseif (strpos(DB_HOST, 'ipowermysql.com') !== false) {
429 429
 		$host = 'IPower';
430
-	} elseif ( strpos( DB_HOST, '.gridserver.com' ) !== false ) {
430
+	} elseif (strpos(DB_HOST, '.gridserver.com') !== false) {
431 431
 		$host = 'MediaTemple Grid';
432
-	} elseif ( strpos( DB_HOST, '.pair.com' ) !== false ) {
432
+	} elseif (strpos(DB_HOST, '.pair.com') !== false) {
433 433
 		$host = 'pair Networks';
434
-	} elseif ( strpos( DB_HOST, '.stabletransit.com' ) !== false ) {
434
+	} elseif (strpos(DB_HOST, '.stabletransit.com') !== false) {
435 435
 		$host = 'Rackspace Cloud';
436
-	} elseif ( strpos( DB_HOST, '.sysfix.eu' ) !== false ) {
436
+	} elseif (strpos(DB_HOST, '.sysfix.eu') !== false) {
437 437
 		$host = 'SysFix.eu Power Hosting';
438
-	} elseif ( strpos( $_SERVER['SERVER_NAME'], 'Flywheel' ) !== false ) {
438
+	} elseif (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) {
439 439
 		$host = 'Flywheel';
440 440
 	} else {
441 441
 		// Adding a general fallback for data gathering
442
-		$host = 'DBH: ' . DB_HOST . ', SRV: ' . $_SERVER['SERVER_NAME'];
442
+		$host = 'DBH: '.DB_HOST.', SRV: '.$_SERVER['SERVER_NAME'];
443 443
 	}
444 444
 
445 445
 	return $host;
@@ -455,67 +455,67 @@  discard block
 block discarded – undo
455 455
  *
456 456
  * @return bool true if host matches, false if not
457 457
  */
458
-function give_is_host( $host = false ) {
458
+function give_is_host($host = false) {
459 459
 
460 460
 	$return = false;
461 461
 
462
-	if ( $host ) {
463
-		$host = str_replace( ' ', '', strtolower( $host ) );
462
+	if ($host) {
463
+		$host = str_replace(' ', '', strtolower($host));
464 464
 
465
-		switch ( $host ) {
465
+		switch ($host) {
466 466
 			case 'wpengine':
467
-				if ( defined( 'WPE_APIKEY' ) ) {
467
+				if (defined('WPE_APIKEY')) {
468 468
 					$return = true;
469 469
 				}
470 470
 				break;
471 471
 			case 'pagely':
472
-				if ( defined( 'PAGELYBIN' ) ) {
472
+				if (defined('PAGELYBIN')) {
473 473
 					$return = true;
474 474
 				}
475 475
 				break;
476 476
 			case 'icdsoft':
477
-				if ( DB_HOST == 'localhost:/tmp/mysql5.sock' ) {
477
+				if (DB_HOST == 'localhost:/tmp/mysql5.sock') {
478 478
 					$return = true;
479 479
 				}
480 480
 				break;
481 481
 			case 'networksolutions':
482
-				if ( DB_HOST == 'mysqlv5' ) {
482
+				if (DB_HOST == 'mysqlv5') {
483 483
 					$return = true;
484 484
 				}
485 485
 				break;
486 486
 			case 'ipage':
487
-				if ( strpos( DB_HOST, 'ipagemysql.com' ) !== false ) {
487
+				if (strpos(DB_HOST, 'ipagemysql.com') !== false) {
488 488
 					$return = true;
489 489
 				}
490 490
 				break;
491 491
 			case 'ipower':
492
-				if ( strpos( DB_HOST, 'ipowermysql.com' ) !== false ) {
492
+				if (strpos(DB_HOST, 'ipowermysql.com') !== false) {
493 493
 					$return = true;
494 494
 				}
495 495
 				break;
496 496
 			case 'mediatemplegrid':
497
-				if ( strpos( DB_HOST, '.gridserver.com' ) !== false ) {
497
+				if (strpos(DB_HOST, '.gridserver.com') !== false) {
498 498
 					$return = true;
499 499
 				}
500 500
 				break;
501 501
 			case 'pairnetworks':
502
-				if ( strpos( DB_HOST, '.pair.com' ) !== false ) {
502
+				if (strpos(DB_HOST, '.pair.com') !== false) {
503 503
 					$return = true;
504 504
 				}
505 505
 				break;
506 506
 			case 'rackspacecloud':
507
-				if ( strpos( DB_HOST, '.stabletransit.com' ) !== false ) {
507
+				if (strpos(DB_HOST, '.stabletransit.com') !== false) {
508 508
 					$return = true;
509 509
 				}
510 510
 				break;
511 511
 			case 'sysfix.eu':
512 512
 			case 'sysfix.eupowerhosting':
513
-				if ( strpos( DB_HOST, '.sysfix.eu' ) !== false ) {
513
+				if (strpos(DB_HOST, '.sysfix.eu') !== false) {
514 514
 					$return = true;
515 515
 				}
516 516
 				break;
517 517
 			case 'flywheel':
518
-				if ( strpos( $_SERVER['SERVER_NAME'], 'Flywheel' ) !== false ) {
518
+				if (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) {
519 519
 					$return = true;
520 520
 				}
521 521
 				break;
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
  * @param string $replacement Optional. The function that should have been called.
549 549
  * @param array  $backtrace   Optional. Contains stack backtrace of deprecated function.
550 550
  */
551
-function _give_deprecated_function( $function, $version, $replacement = null, $backtrace = null ) {
551
+function _give_deprecated_function($function, $version, $replacement = null, $backtrace = null) {
552 552
 
553 553
 	/**
554 554
 	 * Fires while give deprecated function call occurs.
@@ -561,19 +561,19 @@  discard block
 block discarded – undo
561 561
 	 * @param string $replacement Optional. The function that should have been called.
562 562
 	 * @param string $version     The plugin version that deprecated the function.
563 563
 	 */
564
-	do_action( 'give_deprecated_function_run', $function, $replacement, $version );
564
+	do_action('give_deprecated_function_run', $function, $replacement, $version);
565 565
 
566
-	$show_errors = current_user_can( 'manage_options' );
566
+	$show_errors = current_user_can('manage_options');
567 567
 
568 568
 	// Allow plugin to filter the output error trigger.
569
-	if ( WP_DEBUG && apply_filters( 'give_deprecated_function_trigger_error', $show_errors ) ) {
570
-		if ( ! is_null( $replacement ) ) {
571
-			trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Give version %2$s! Use %3$s instead.', 'give' ), $function, $version, $replacement ) );
572
-			trigger_error( print_r( $backtrace, 1 ) ); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
569
+	if (WP_DEBUG && apply_filters('give_deprecated_function_trigger_error', $show_errors)) {
570
+		if ( ! is_null($replacement)) {
571
+			trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since Give version %2$s! Use %3$s instead.', 'give'), $function, $version, $replacement));
572
+			trigger_error(print_r($backtrace, 1)); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
573 573
 			// Alternatively we could dump this to a file.
574 574
 		} else {
575
-			trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Give version %2$s with no alternative available.', 'give' ), $function, $version ) );
576
-			trigger_error( print_r( $backtrace, 1 ) );// Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
575
+			trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since Give version %2$s with no alternative available.', 'give'), $function, $version));
576
+			trigger_error(print_r($backtrace, 1)); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
577 577
 			// Alternatively we could dump this to a file.
578 578
 		}
579 579
 	}
@@ -587,8 +587,8 @@  discard block
 block discarded – undo
587 587
  * @return string $post_id
588 588
  */
589 589
 function give_get_admin_post_id() {
590
-	$post_id = isset( $_GET['post'] ) ? $_GET['post'] : null;
591
-	if ( ! $post_id && isset( $_POST['post_id'] ) ) {
590
+	$post_id = isset($_GET['post']) ? $_GET['post'] : null;
591
+	if ( ! $post_id && isset($_POST['post_id'])) {
592 592
 		$post_id = $_POST['post_id'];
593 593
 	}
594 594
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
  * @return string Arg separator output
603 603
  */
604 604
 function give_get_php_arg_separator_output() {
605
-	return ini_get( 'arg_separator.output' );
605
+	return ini_get('arg_separator.output');
606 606
 }
607 607
 
608 608
 
@@ -617,10 +617,10 @@  discard block
 block discarded – undo
617 617
  *
618 618
  * @return string Short month name
619 619
  */
620
-function give_month_num_to_name( $n ) {
621
-	$timestamp = mktime( 0, 0, 0, $n, 1, 2005 );
620
+function give_month_num_to_name($n) {
621
+	$timestamp = mktime(0, 0, 0, $n, 1, 2005);
622 622
 
623
-	return date_i18n( 'M', $timestamp );
623
+	return date_i18n('M', $timestamp);
624 624
 }
625 625
 
626 626
 
@@ -633,10 +633,10 @@  discard block
 block discarded – undo
633 633
  *
634 634
  * @return bool Whether or not function is disabled.
635 635
  */
636
-function give_is_func_disabled( $function ) {
637
-	$disabled = explode( ',', ini_get( 'disable_functions' ) );
636
+function give_is_func_disabled($function) {
637
+	$disabled = explode(',', ini_get('disable_functions'));
638 638
 
639
-	return in_array( $function, $disabled );
639
+	return in_array($function, $disabled);
640 640
 }
641 641
 
642 642
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 function give_get_newsletter() {
649 649
 	?>
650 650
 
651
-	<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
651
+	<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
652 652
 
653 653
 	<div class="give-newsletter-form-wrap">
654 654
 
@@ -656,33 +656,33 @@  discard block
 block discarded – undo
656 656
 			  method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
657 657
 			  target="_blank" novalidate>
658 658
 			<div class="give-newsletter-confirmation">
659
-				<p><?php esc_html_e( 'Thanks for Subscribing!', 'give' ); ?> :)</p>
659
+				<p><?php esc_html_e('Thanks for Subscribing!', 'give'); ?> :)</p>
660 660
 			</div>
661 661
 
662 662
 			<table class="form-table give-newsletter-form">
663 663
 				<tr valign="middle">
664 664
 					<td>
665 665
 						<label for="mce-EMAIL"
666
-							   class="screen-reader-text"><?php esc_html_e( 'Email Address (required)', 'give' ); ?></label>
666
+							   class="screen-reader-text"><?php esc_html_e('Email Address (required)', 'give'); ?></label>
667 667
 						<input type="email" name="EMAIL" id="mce-EMAIL"
668
-							   placeholder="<?php esc_attr_e( 'Email Address (required)', 'give' ); ?>"
668
+							   placeholder="<?php esc_attr_e('Email Address (required)', 'give'); ?>"
669 669
 							   class="required email" value="">
670 670
 					</td>
671 671
 					<td>
672 672
 						<label for="mce-FNAME"
673
-							   class="screen-reader-text"><?php esc_html_e( 'First Name', 'give' ); ?></label>
673
+							   class="screen-reader-text"><?php esc_html_e('First Name', 'give'); ?></label>
674 674
 						<input type="text" name="FNAME" id="mce-FNAME"
675
-							   placeholder="<?php esc_attr_e( 'First Name', 'give' ); ?>" class="" value="">
675
+							   placeholder="<?php esc_attr_e('First Name', 'give'); ?>" class="" value="">
676 676
 					</td>
677 677
 					<td>
678 678
 						<label for="mce-LNAME"
679
-							   class="screen-reader-text"><?php esc_html_e( 'Last Name', 'give' ); ?></label>
679
+							   class="screen-reader-text"><?php esc_html_e('Last Name', 'give'); ?></label>
680 680
 						<input type="text" name="LNAME" id="mce-LNAME"
681
-							   placeholder="<?php esc_attr_e( 'Last Name', 'give' ); ?>" class="" value="">
681
+							   placeholder="<?php esc_attr_e('Last Name', 'give'); ?>" class="" value="">
682 682
 					</td>
683 683
 					<td>
684 684
 						<input type="submit" name="subscribe" id="mc-embedded-subscribe" class="button"
685
-							   value="<?php esc_attr_e( 'Subscribe', 'give' ); ?>">
685
+							   value="<?php esc_attr_e('Subscribe', 'give'); ?>">
686 686
 					</td>
687 687
 				</tr>
688 688
 			</table>
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
  *
736 736
  * @return string
737 737
  */
738
-function give_svg_icons( $icon ) {
738
+function give_svg_icons($icon) {
739 739
 
740 740
 	// Store your SVGs in an associative array
741 741
 	$svgs = array(
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 	);
748 748
 
749 749
 	// Return the chosen icon's SVG string
750
-	return $svgs[ $icon ];
750
+	return $svgs[$icon];
751 751
 }
752 752
 
753 753
 /**
@@ -759,15 +759,15 @@  discard block
 block discarded – undo
759 759
  *
760 760
  * @return mixed
761 761
  */
762
-function modify_nav_menu_meta_box_object( $post_type ) {
763
-	if ( isset( $post_type->name ) && $post_type->name == 'give_forms' ) {
764
-		$post_type->labels->name = esc_html__( 'Donation Forms', 'give' );
762
+function modify_nav_menu_meta_box_object($post_type) {
763
+	if (isset($post_type->name) && $post_type->name == 'give_forms') {
764
+		$post_type->labels->name = esc_html__('Donation Forms', 'give');
765 765
 	}
766 766
 
767 767
 	return $post_type;
768 768
 }
769 769
 
770
-add_filter( 'nav_menu_meta_box_object', 'modify_nav_menu_meta_box_object' );
770
+add_filter('nav_menu_meta_box_object', 'modify_nav_menu_meta_box_object');
771 771
 
772 772
 /**
773 773
  * Enable 'Donation Form' meta enabled by default on Menu page.
@@ -777,22 +777,22 @@  discard block
 block discarded – undo
777 777
 function give_nav_donation_metabox_enabled() {
778 778
 
779 779
 	// Return false, if it fails to retrieve hidden meta box list and is not admin.
780
-	if ( ( ! $hidden_meta_boxes = get_user_option( 'metaboxhidden_nav-menus' ) ) || ! is_admin() ) {
780
+	if (( ! $hidden_meta_boxes = get_user_option('metaboxhidden_nav-menus')) || ! is_admin()) {
781 781
 		return false;
782 782
 	}
783 783
 
784 784
 	// Return false, In case, we don't find 'Donation Form' in hidden meta box list.
785
-	if ( ! in_array( 'add-post-type-give_forms', $hidden_meta_boxes, true ) ) {
785
+	if ( ! in_array('add-post-type-give_forms', $hidden_meta_boxes, true)) {
786 786
 		return false;
787 787
 	}
788 788
 
789 789
 	// Exclude 'Donation Form' value from hidden meta box's list.
790
-	$hidden_meta_boxes = array_diff( $hidden_meta_boxes, array( 'add-post-type-give_forms' ) );
790
+	$hidden_meta_boxes = array_diff($hidden_meta_boxes, array('add-post-type-give_forms'));
791 791
 
792 792
 	// Get current user ID.
793 793
 	$user = wp_get_current_user();
794 794
 
795
-	update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true );
795
+	update_user_option($user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true);
796 796
 }
797 797
 
798 798
 /**
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
  * @license    https://opensource.org/licenses/MIT MIT
807 807
  */
808 808
 
809
-if ( ! function_exists( 'array_column' ) ) {
809
+if ( ! function_exists('array_column')) {
810 810
 	/**
811 811
 	 * Returns the values from a single column of the input array, identified by
812 812
 	 * the $columnKey.
@@ -825,53 +825,53 @@  discard block
 block discarded – undo
825 825
 	 *
826 826
 	 * @return array
827 827
 	 */
828
-	function array_column( $input = null, $columnKey = null, $indexKey = null ) {
828
+	function array_column($input = null, $columnKey = null, $indexKey = null) {
829 829
 		// Using func_get_args() in order to check for proper number of
830 830
 		// parameters and trigger errors exactly as the built-in array_column()
831 831
 		// does in PHP 5.5.
832 832
 		$argc   = func_num_args();
833 833
 		$params = func_get_args();
834 834
 
835
-		if ( $argc < 2 ) {
836
-			trigger_error( sprintf( esc_html__( 'array_column() expects at least 2 parameters, %s given.', 'give' ), $argc ), E_USER_WARNING );
835
+		if ($argc < 2) {
836
+			trigger_error(sprintf(esc_html__('array_column() expects at least 2 parameters, %s given.', 'give'), $argc), E_USER_WARNING);
837 837
 
838 838
 			return null;
839 839
 		}
840 840
 
841
-		if ( ! is_array( $params[0] ) ) {
842
-			trigger_error( sprintf( esc_html__( 'array_column() expects parameter 1 to be array, %s given.', 'give' ), gettype( $params[0] ) ), E_USER_WARNING );
841
+		if ( ! is_array($params[0])) {
842
+			trigger_error(sprintf(esc_html__('array_column() expects parameter 1 to be array, %s given.', 'give'), gettype($params[0])), E_USER_WARNING);
843 843
 
844 844
 			return null;
845 845
 		}
846 846
 
847
-		if ( ! is_int( $params[1] )
848
-		     && ! is_float( $params[1] )
849
-		     && ! is_string( $params[1] )
847
+		if ( ! is_int($params[1])
848
+		     && ! is_float($params[1])
849
+		     && ! is_string($params[1])
850 850
 		     && $params[1] !== null
851
-		     && ! ( is_object( $params[1] ) && method_exists( $params[1], '__toString' ) )
851
+		     && ! (is_object($params[1]) && method_exists($params[1], '__toString'))
852 852
 		) {
853
-			trigger_error( esc_html__( 'array_column(): The column key should be either a string or an integer.', 'give' ), E_USER_WARNING );
853
+			trigger_error(esc_html__('array_column(): The column key should be either a string or an integer.', 'give'), E_USER_WARNING);
854 854
 
855 855
 			return false;
856 856
 		}
857 857
 
858
-		if ( isset( $params[2] )
859
-		     && ! is_int( $params[2] )
860
-		     && ! is_float( $params[2] )
861
-		     && ! is_string( $params[2] )
862
-		     && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) )
858
+		if (isset($params[2])
859
+		     && ! is_int($params[2])
860
+		     && ! is_float($params[2])
861
+		     && ! is_string($params[2])
862
+		     && ! (is_object($params[2]) && method_exists($params[2], '__toString'))
863 863
 		) {
864
-			trigger_error( esc_html__( 'array_column(): The index key should be either a string or an integer.', 'give' ), E_USER_WARNING );
864
+			trigger_error(esc_html__('array_column(): The index key should be either a string or an integer.', 'give'), E_USER_WARNING);
865 865
 
866 866
 			return false;
867 867
 		}
868 868
 
869 869
 		$paramsInput     = $params[0];
870
-		$paramsColumnKey = ( $params[1] !== null ) ? (string) $params[1] : null;
870
+		$paramsColumnKey = ($params[1] !== null) ? (string) $params[1] : null;
871 871
 
872 872
 		$paramsIndexKey = null;
873
-		if ( isset( $params[2] ) ) {
874
-			if ( is_float( $params[2] ) || is_int( $params[2] ) ) {
873
+		if (isset($params[2])) {
874
+			if (is_float($params[2]) || is_int($params[2])) {
875 875
 				$paramsIndexKey = (int) $params[2];
876 876
 			} else {
877 877
 				$paramsIndexKey = (string) $params[2];
@@ -880,26 +880,26 @@  discard block
 block discarded – undo
880 880
 
881 881
 		$resultArray = array();
882 882
 
883
-		foreach ( $paramsInput as $row ) {
883
+		foreach ($paramsInput as $row) {
884 884
 			$key    = $value = null;
885 885
 			$keySet = $valueSet = false;
886 886
 
887
-			if ( $paramsIndexKey !== null && array_key_exists( $paramsIndexKey, $row ) ) {
887
+			if ($paramsIndexKey !== null && array_key_exists($paramsIndexKey, $row)) {
888 888
 				$keySet = true;
889
-				$key    = (string) $row[ $paramsIndexKey ];
889
+				$key    = (string) $row[$paramsIndexKey];
890 890
 			}
891 891
 
892
-			if ( $paramsColumnKey === null ) {
892
+			if ($paramsColumnKey === null) {
893 893
 				$valueSet = true;
894 894
 				$value    = $row;
895
-			} elseif ( is_array( $row ) && array_key_exists( $paramsColumnKey, $row ) ) {
895
+			} elseif (is_array($row) && array_key_exists($paramsColumnKey, $row)) {
896 896
 				$valueSet = true;
897
-				$value    = $row[ $paramsColumnKey ];
897
+				$value    = $row[$paramsColumnKey];
898 898
 			}
899 899
 
900
-			if ( $valueSet ) {
901
-				if ( $keySet ) {
902
-					$resultArray[ $key ] = $value;
900
+			if ($valueSet) {
901
+				if ($keySet) {
902
+					$resultArray[$key] = $value;
903 903
 				} else {
904 904
 					$resultArray[] = $value;
905 905
 				}
@@ -919,40 +919,40 @@  discard block
 block discarded – undo
919 919
  *
920 920
  * @return bool Whether the receipt is visible or not.
921 921
  */
922
-function give_can_view_receipt( $payment_key = '' ) {
922
+function give_can_view_receipt($payment_key = '') {
923 923
 
924 924
 	$return = false;
925 925
 
926
-	if ( empty( $payment_key ) ) {
926
+	if (empty($payment_key)) {
927 927
 		return $return;
928 928
 	}
929 929
 
930 930
 	global $give_receipt_args;
931 931
 
932
-	$give_receipt_args['id'] = give_get_purchase_id_by_key( $payment_key );
932
+	$give_receipt_args['id'] = give_get_purchase_id_by_key($payment_key);
933 933
 
934
-	$user_id = (int) give_get_payment_user_id( $give_receipt_args['id'] );
934
+	$user_id = (int) give_get_payment_user_id($give_receipt_args['id']);
935 935
 
936
-	$payment_meta = give_get_payment_meta( $give_receipt_args['id'] );
936
+	$payment_meta = give_get_payment_meta($give_receipt_args['id']);
937 937
 
938
-	if ( is_user_logged_in() ) {
939
-		if ( $user_id === (int) get_current_user_id() ) {
938
+	if (is_user_logged_in()) {
939
+		if ($user_id === (int) get_current_user_id()) {
940 940
 			$return = true;
941
-		} elseif ( wp_get_current_user()->user_email === give_get_payment_user_email( $give_receipt_args['id'] ) ) {
941
+		} elseif (wp_get_current_user()->user_email === give_get_payment_user_email($give_receipt_args['id'])) {
942 942
 			$return = true;
943
-		} elseif ( current_user_can( 'view_give_sensitive_data' ) ) {
943
+		} elseif (current_user_can('view_give_sensitive_data')) {
944 944
 			$return = true;
945 945
 		}
946 946
 	}
947 947
 
948 948
 	$session = give_get_purchase_session();
949
-	if ( ! empty( $session ) && ! is_user_logged_in() ) {
950
-		if ( $session['purchase_key'] === $payment_meta['key'] ) {
949
+	if ( ! empty($session) && ! is_user_logged_in()) {
950
+		if ($session['purchase_key'] === $payment_meta['key']) {
951 951
 			$return = true;
952 952
 		}
953 953
 	}
954 954
 
955
-	return (bool) apply_filters( 'give_can_view_receipt', $return, $payment_key );
955
+	return (bool) apply_filters('give_can_view_receipt', $return, $payment_key);
956 956
 
957 957
 }
958 958
 
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
  *
962 962
  * Fallback in case the calendar extension is not loaded in PHP; Only supports Gregorian calendar
963 963
  */
964
-if ( ! function_exists( 'cal_days_in_month' ) ) {
964
+if ( ! function_exists('cal_days_in_month')) {
965 965
 	/**
966 966
 	 * cal_days_in_month
967 967
 	 *
@@ -971,8 +971,8 @@  discard block
 block discarded – undo
971 971
 	 *
972 972
 	 * @return bool|string
973 973
 	 */
974
-	function cal_days_in_month( $calendar, $month, $year ) {
975
-		return date( 't', mktime( 0, 0, 0, $month, 1, $year ) );
974
+	function cal_days_in_month($calendar, $month, $year) {
975
+		return date('t', mktime(0, 0, 0, $month, 1, $year));
976 976
 	}
977 977
 }
978 978
 
@@ -991,42 +991,42 @@  discard block
 block discarded – undo
991 991
  */
992 992
 function give_get_plugins() {
993 993
 	$plugins             = get_plugins();
994
-	$active_plugin_paths = (array) get_option( 'active_plugins', array() );
994
+	$active_plugin_paths = (array) get_option('active_plugins', array());
995 995
 
996
-	if ( is_multisite() ) {
997
-		$network_activated_plugin_paths = array_keys( get_site_option( 'active_sitewide_plugins', array() ) );
998
-		$active_plugin_paths            = array_merge( $active_plugin_paths, $network_activated_plugin_paths );
996
+	if (is_multisite()) {
997
+		$network_activated_plugin_paths = array_keys(get_site_option('active_sitewide_plugins', array()));
998
+		$active_plugin_paths            = array_merge($active_plugin_paths, $network_activated_plugin_paths);
999 999
 	}
1000 1000
 
1001
-	foreach ( $plugins as $plugin_path => $plugin_data ) {
1001
+	foreach ($plugins as $plugin_path => $plugin_data) {
1002 1002
 		// Is plugin active?
1003
-		if ( in_array( $plugin_path, $active_plugin_paths ) ) {
1004
-			$plugins[ $plugin_path ]['Status'] = 'active';
1003
+		if (in_array($plugin_path, $active_plugin_paths)) {
1004
+			$plugins[$plugin_path]['Status'] = 'active';
1005 1005
 		} else {
1006
-			$plugins[ $plugin_path ]['Status'] = 'inactive';
1006
+			$plugins[$plugin_path]['Status'] = 'inactive';
1007 1007
 		}
1008 1008
 
1009
-		$dirname = strtolower( dirname( $plugin_path ) );
1009
+		$dirname = strtolower(dirname($plugin_path));
1010 1010
 
1011 1011
 		// Is plugin a Give add-on by WordImpress?
1012
-		if ( strstr( $dirname, 'give-' ) && strstr( $plugin_data['AuthorURI'], 'wordimpress.com' ) ) {
1012
+		if (strstr($dirname, 'give-') && strstr($plugin_data['AuthorURI'], 'wordimpress.com')) {
1013 1013
 			// Plugin is a Give-addon.
1014
-			$plugins[ $plugin_path ]['Type'] = 'add-on';
1014
+			$plugins[$plugin_path]['Type'] = 'add-on';
1015 1015
 
1016 1016
 			// Get license info from database.
1017
-			$plugin_name    = str_replace( 'Give - ', '', $plugin_data['Name'] );
1018
-			$db_option      = 'give_' . preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $plugin_name ) ) ) . '_license_active';
1019
-			$license_active = get_option( $db_option );
1017
+			$plugin_name    = str_replace('Give - ', '', $plugin_data['Name']);
1018
+			$db_option      = 'give_'.preg_replace('/[^a-zA-Z0-9_\s]/', '', str_replace(' ', '_', strtolower($plugin_name))).'_license_active';
1019
+			$license_active = get_option($db_option);
1020 1020
 
1021 1021
 			// Does a valid license exist?
1022
-			if ( ! empty( $license_active ) && 'valid' === $license_active->license ) {
1023
-				$plugins[ $plugin_path ]['License'] = true;
1022
+			if ( ! empty($license_active) && 'valid' === $license_active->license) {
1023
+				$plugins[$plugin_path]['License'] = true;
1024 1024
 			} else {
1025
-				$plugins[ $plugin_path ]['License'] = false;
1025
+				$plugins[$plugin_path]['License'] = false;
1026 1026
 			}
1027 1027
 		} else {
1028 1028
 			// Plugin is not a Give add-on.
1029
-			$plugins[ $plugin_path ]['Type'] = 'other';
1029
+			$plugins[$plugin_path]['Type'] = 'other';
1030 1030
 		}
1031 1031
 	}
1032 1032
 
@@ -1043,16 +1043,16 @@  discard block
 block discarded – undo
1043 1043
  *
1044 1044
  * @return bool
1045 1045
  */
1046
-function give_is_terms_enabled( $form_id ) {
1047
-	$form_option = give_get_meta( $form_id, '_give_terms_option', true );
1046
+function give_is_terms_enabled($form_id) {
1047
+	$form_option = give_get_meta($form_id, '_give_terms_option', true);
1048 1048
 
1049 1049
 	if (
1050
-		give_is_setting_enabled( $form_option, 'global' )
1051
-		&& give_is_setting_enabled( give_get_option( 'terms' ) )
1050
+		give_is_setting_enabled($form_option, 'global')
1051
+		&& give_is_setting_enabled(give_get_option('terms'))
1052 1052
 	) {
1053 1053
 		return true;
1054 1054
 
1055
-	} elseif ( give_is_setting_enabled( $form_option ) ) {
1055
+	} elseif (give_is_setting_enabled($form_option)) {
1056 1056
 		return true;
1057 1057
 
1058 1058
 	} else {
@@ -1076,9 +1076,9 @@  discard block
 block discarded – undo
1076 1076
  *
1077 1077
  * @return WP_Error|bool
1078 1078
  */
1079
-function give_delete_donation_stats( $date_range = '', $args = array() ) {
1079
+function give_delete_donation_stats($date_range = '', $args = array()) {
1080 1080
 	// Delete all cache.
1081
-	$status = Give_Cache::delete( Give_Cache::get_options_like( 'give_stats' ) );
1081
+	$status = Give_Cache::delete(Give_Cache::get_options_like('give_stats'));
1082 1082
 
1083 1083
 	/**
1084 1084
 	 * Fire the action when donation stats delete.
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
 	 * @param string|array $date_range
1089 1089
 	 * @param array  $args
1090 1090
 	 */
1091
-	do_action( 'give_delete_donation_stats', $status, $date_range, $args );
1091
+	do_action('give_delete_donation_stats', $status, $date_range, $args);
1092 1092
 
1093 1093
 	return $status;
1094 1094
 }
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
  *
1107 1107
  * @return mixed
1108 1108
  */
1109
-function give_get_meta( $id, $meta_key, $single = false, $default = false ) {
1109
+function give_get_meta($id, $meta_key, $single = false, $default = false) {
1110 1110
 	/**
1111 1111
 	 * Filter the meta value
1112 1112
 	 *
@@ -1114,14 +1114,14 @@  discard block
 block discarded – undo
1114 1114
 	 */
1115 1115
 	$meta_value = apply_filters(
1116 1116
 			'give_get_meta',
1117
-			get_post_meta( $id, $meta_key, $single ),
1117
+			get_post_meta($id, $meta_key, $single),
1118 1118
 			$id,
1119 1119
 			$meta_key,
1120 1120
 			$default
1121 1121
 	);
1122 1122
 
1123 1123
 	if (
1124
-		( empty( $meta_key ) || empty( $meta_value ) )
1124
+		(empty($meta_key) || empty($meta_value))
1125 1125
 		&& $default
1126 1126
 	) {
1127 1127
 		$meta_value = $default;
@@ -1142,15 +1142,15 @@  discard block
 block discarded – undo
1142 1142
  *
1143 1143
  * @return mixed
1144 1144
  */
1145
-function give_update_meta( $id, $meta_key, $meta_value, $prev_value = '' ) {
1146
-	$status = update_post_meta( $id, $meta_key, $meta_value, $prev_value );
1145
+function give_update_meta($id, $meta_key, $meta_value, $prev_value = '') {
1146
+	$status = update_post_meta($id, $meta_key, $meta_value, $prev_value);
1147 1147
 
1148 1148
 	/**
1149 1149
 	 * Filter the meta value update status
1150 1150
 	 *
1151 1151
 	 * @since 1.8.8
1152 1152
 	 */
1153
-	return apply_filters( 'give_update_meta', $status, $id, $meta_key, $meta_value );
1153
+	return apply_filters('give_update_meta', $status, $id, $meta_key, $meta_value);
1154 1154
 }
1155 1155
 
1156 1156
 /**
@@ -1164,13 +1164,13 @@  discard block
 block discarded – undo
1164 1164
  *
1165 1165
  * @return mixed
1166 1166
  */
1167
-function give_delete_meta( $id, $meta_key, $meta_value = '' ) {
1168
-	$status = delete_post_meta( $id, $meta_key, $meta_value );
1167
+function give_delete_meta($id, $meta_key, $meta_value = '') {
1168
+	$status = delete_post_meta($id, $meta_key, $meta_value);
1169 1169
 
1170 1170
 	/**
1171 1171
 	 * Filter the meta value delete status
1172 1172
 	 *
1173 1173
 	 * @since 1.8.8
1174 1174
 	 */
1175
-	return apply_filters( 'give_delete_meta', $status, $id, $meta_key, $meta_value );
1175
+	return apply_filters('give_delete_meta', $status, $id, $meta_key, $meta_value);
1176 1176
 }
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', esc_html__( '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', esc_html__('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( _x( 'F j, Y', 'dashboard widget', 'give' ) ); ?></h3>
49
+			<h3 class="give-dashboard-date-today"><?php echo date(_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
-					esc_html__( 'Happy %s!', 'give' ),
55
-					date( 'l', current_time( 'timestamp' ) )
54
+					esc_html__('Happy %s!', 'give'),
55
+					date('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 ) );
60
+				$earnings_today = $stats->get_earnings(0, 'today', false);
61
+				echo give_currency_filter(give_format_amount($earnings_today));
62 62
 			?></p>
63 63
 
64 64
 			<p class="give-orders-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
-					esc_html__( '%s donations today', 'give' ),
69
-					give_format_amount( $donations_today, false )
68
+					esc_html__('%s donations today', 'give'),
69
+					give_format_amount($donations_today, 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 esc_html_e( 'This Week', 'give' ); ?></th>
80
-				<th><?php esc_html_e( 'This Month', 'give' ); ?></th>
81
-				<th><?php esc_html_e( 'Past 30 Days', 'give' ); ?></th>
79
+				<th><?php esc_html_e('This Week', 'give'); ?></th>
80
+				<th><?php esc_html_e('This Month', 'give'); ?></th>
81
+				<th><?php esc_html_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' ) ) ); ?></p>
87
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_week'))); ?></p>
88 88
 
89
-					<p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Week', 'give' ); ?></p>
89
+					<p class="give-dashboard-stat-total-label"><?php esc_html_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' ) ) ); ?></p>
92
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_month'))); ?></p>
93 93
 
94
-					<p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Month', 'give' ); ?></p>
94
+					<p class="give-dashboard-stat-total-label"><?php esc_html_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' ) ) ) ?></p>
99
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'last_month'))) ?></p>
100 100
 
101
-					<p class="give-dashboard-stat-total-label"><?php esc_html_e( 'Last Month', 'give' ); ?></p>
101
+					<p class="give-dashboard-stat-total-label"><?php esc_html_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( $stats->get_earnings( 0, 'this_year', false ) ) ) ?></p>
104
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_year', false))) ?></p>
105 105
 
106
-					<p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Year', 'give' ); ?></p>
106
+					<p class="give-dashboard-stat-total-label"><?php esc_html_e('This Year', 'give'); ?></p>
107 107
 				</td>
108 108
 			</tr>
109 109
 			</tbody>
@@ -123,23 +123,23 @@  discard block
 block discarded – undo
123 123
  *
124 124
  * @return array
125 125
  */
126
-function give_dashboard_at_a_glance_widget( $items ) {
127
-	$num_posts = wp_count_posts( 'give_forms' );
126
+function give_dashboard_at_a_glance_widget($items) {
127
+	$num_posts = wp_count_posts('give_forms');
128 128
 
129
-	if ( $num_posts && $num_posts->publish ) {
129
+	if ($num_posts && $num_posts->publish) {
130 130
 
131 131
 		$text = sprintf(
132 132
 			/* translators: %s: number of posts published */
133
-			_n( '%s Give Form', '%s Give Forms', $num_posts->publish, 'give' ),
133
+			_n('%s Give Form', '%s Give Forms', $num_posts->publish, 'give'),
134 134
 			$num_posts->publish
135 135
 		);
136 136
 
137
-		$text = sprintf( $text, number_format_i18n( $num_posts->publish ) );
137
+		$text = sprintf($text, number_format_i18n($num_posts->publish));
138 138
 
139
-		if ( current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
139
+		if (current_user_can('edit_give_forms', get_current_user_id())) {
140 140
 			$text = sprintf(
141 141
 				'<a class="give-forms-count" href="%1$s">%2$s</a>',
142
-				admin_url( 'edit.php?post_type=give_forms' ),
142
+				admin_url('edit.php?post_type=give_forms'),
143 143
 				$text
144 144
 			);
145 145
 		} else {
@@ -155,4 +155,4 @@  discard block
 block discarded – undo
155 155
 	return $items;
156 156
 }
157 157
 
158
-add_filter( 'dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1 );
158
+add_filter('dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1);
Please login to merge, or discard this patch.
includes/country-functions.php 1 patch
Spacing   +333 added lines, -333 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
  */
24 24
 function give_get_country() {
25 25
 	$give_options = give_get_settings();
26
-	$country = isset( $give_options['base_country'] ) ? $give_options['base_country'] : 'US';
26
+	$country = isset($give_options['base_country']) ? $give_options['base_country'] : 'US';
27 27
 
28
-	return apply_filters( 'give_give_country', $country );
28
+	return apply_filters('give_give_country', $country);
29 29
 }
30 30
 
31 31
 /**
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function give_get_state() {
38 38
 	$give_options = give_get_settings();
39
-	$state = isset( $give_options['base_state'] ) ? $give_options['base_state'] : false;
39
+	$state = isset($give_options['base_state']) ? $give_options['base_state'] : false;
40 40
 
41
-	return apply_filters( 'give_give_state', $state );
41
+	return apply_filters('give_give_state', $state);
42 42
 }
43 43
 
44 44
 /**
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
  *
51 51
  * @return mixed|void  A list of states for the shop's base country
52 52
  */
53
-function give_get_states( $country = null ) {
53
+function give_get_states($country = null) {
54 54
 
55
-	if ( empty( $country ) ) {
55
+	if (empty($country)) {
56 56
 		$country = give_get_country();
57 57
 	}
58 58
 
59
-	switch ( $country ) :
59
+	switch ($country) :
60 60
 
61 61
 		case 'US' :
62 62
 			$states = give_get_states_list();
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
 	endswitch;
108 108
 
109
-	return apply_filters( 'give_give_states', $states );
109
+	return apply_filters('give_give_states', $states);
110 110
 }
111 111
 
112 112
 
@@ -119,253 +119,253 @@  discard block
 block discarded – undo
119 119
 function give_get_country_list() {
120 120
 	$countries = array(
121 121
 		''   => '',
122
-		'US' => esc_html__( 'United States', 'give' ),
123
-		'CA' => esc_html__( 'Canada', 'give' ),
124
-		'GB' => esc_html__( 'United Kingdom', 'give' ),
125
-		'AF' => esc_html__( 'Afghanistan', 'give' ),
126
-		'AL' => esc_html__( 'Albania', 'give' ),
127
-		'DZ' => esc_html__( 'Algeria', 'give' ),
128
-		'AS' => esc_html__( 'American Samoa', 'give' ),
129
-		'AD' => esc_html__( 'Andorra', 'give' ),
130
-		'AO' => esc_html__( 'Angola', 'give' ),
131
-		'AI' => esc_html__( 'Anguilla', 'give' ),
132
-		'AQ' => esc_html__( 'Antarctica', 'give' ),
133
-		'AG' => esc_html__( 'Antigua and Barbuda', 'give' ),
134
-		'AR' => esc_html__( 'Argentina', 'give' ),
135
-		'AM' => esc_html__( 'Armenia', 'give' ),
136
-		'AW' => esc_html__( 'Aruba', 'give' ),
137
-		'AU' => esc_html__( 'Australia', 'give' ),
138
-		'AT' => esc_html__( 'Austria', 'give' ),
139
-		'AZ' => esc_html__( 'Azerbaijan', 'give' ),
140
-		'BS' => esc_html__( 'Bahamas', 'give'),
141
-		'BH' => esc_html__( 'Bahrain', 'give' ),
142
-		'BD' => esc_html__( 'Bangladesh', 'give' ),
143
-		'BB' => esc_html__( 'Barbados', 'give' ),
144
-		'BY' => esc_html__( 'Belarus', 'give' ),
145
-		'BE' => esc_html__( 'Belgium', 'give' ),
146
-		'BZ' => esc_html__( 'Belize', 'give' ),
147
-		'BJ' => esc_html__( 'Benin', 'give' ),
148
-		'BM' => esc_html__( 'Bermuda', 'give' ),
149
-		'BT' => esc_html__( 'Bhutan', 'give' ),
150
-		'BO' => esc_html__( 'Bolivia', 'give' ),
151
-		'BA' => esc_html__( 'Bosnia and Herzegovina', 'give' ),
152
-		'BW' => esc_html__( 'Botswana', 'give' ),
153
-		'BV' => esc_html__( 'Bouvet Island', 'give' ),
154
-		'BR' => esc_html__( 'Brazil', 'give' ),
155
-		'IO' => esc_html__( 'British Indian Ocean Territory', 'give' ),
156
-		'BN' => esc_html__( 'Brunei Darrussalam', 'give' ),
157
-		'BG' => esc_html__( 'Bulgaria', 'give' ),
158
-		'BF' => esc_html__( 'Burkina Faso', 'give' ),
159
-		'BI' => esc_html__( 'Burundi', 'give' ),
160
-		'KH' => esc_html__( 'Cambodia', 'give' ),
161
-		'CM' => esc_html__( 'Cameroon', 'give' ),
162
-		'CV' => esc_html__( 'Cape Verde', 'give' ),
163
-		'KY' => esc_html__( 'Cayman Islands', 'give' ),
164
-		'CF' => esc_html__( 'Central African Republic', 'give' ),
165
-		'TD' => esc_html__( 'Chad', 'give' ),
166
-		'CL' => esc_html__( 'Chile', 'give' ),
167
-		'CN' => esc_html__( 'China', 'give' ),
168
-		'CX' => esc_html__( 'Christmas Island', 'give' ),
169
-		'CC' => esc_html__( 'Cocos Islands', 'give' ),
170
-		'CO' => esc_html__( 'Colombia', 'give' ),
171
-		'KM' => esc_html__( 'Comoros', 'give' ),
172
-		'CD' => esc_html__( 'Congo, Democratic People\'s Republic', 'give' ),
173
-		'CG' => esc_html__( 'Congo, Republic of', 'give' ),
174
-		'CK' => esc_html__( 'Cook Islands', 'give' ),
175
-		'CR' => esc_html__( 'Costa Rica', 'give' ),
176
-		'CI' => esc_html__( 'Cote d\'Ivoire', 'give' ),
177
-		'HR' => esc_html__( 'Croatia/Hrvatska', 'give' ),
178
-		'CU' => esc_html__( 'Cuba', 'give' ),
179
-		'CY' => esc_html__( 'Cyprus Island', 'give' ),
180
-		'CZ' => esc_html__( 'Czech Republic', 'give' ),
181
-		'DK' => esc_html__( 'Denmark', 'give' ),
182
-		'DJ' => esc_html__( 'Djibouti', 'give' ),
183
-		'DM' => esc_html__( 'Dominica', 'give' ),
184
-		'DO' => esc_html__( 'Dominican Republic', 'give' ),
185
-		'TP' => esc_html__( 'East Timor', 'give' ),
186
-		'EC' => esc_html__( 'Ecuador', 'give' ),
187
-		'EG' => esc_html__( 'Egypt', 'give' ),
188
-		'GQ' => esc_html__( 'Equatorial Guinea', 'give' ),
189
-		'SV' => esc_html__( 'El Salvador', 'give' ),
190
-		'ER' => esc_html__( 'Eritrea', 'give' ),
191
-		'EE' => esc_html__( 'Estonia', 'give' ),
192
-		'ET' => esc_html__( 'Ethiopia', 'give' ),
193
-		'FK' => esc_html__( 'Falkland Islands', 'give' ),
194
-		'FO' => esc_html__( 'Faroe Islands', 'give' ),
195
-		'FJ' => esc_html__( 'Fiji', 'give' ),
196
-		'FI' => esc_html__( 'Finland', 'give' ),
197
-		'FR' => esc_html__( 'France', 'give' ),
198
-		'GF' => esc_html__( 'French Guiana', 'give' ),
199
-		'PF' => esc_html__( 'French Polynesia', 'give' ),
200
-		'TF' => esc_html__( 'French Southern Territories', 'give' ),
201
-		'GA' => esc_html__( 'Gabon', 'give' ),
202
-		'GM' => esc_html__( 'Gambia', 'give' ),
203
-		'GE' => esc_html__( 'Georgia', 'give' ),
204
-		'DE' => esc_html__( 'Germany', 'give' ),
205
-		'GR' => esc_html__( 'Greece', 'give' ),
206
-		'GH' => esc_html__( 'Ghana', 'give' ),
207
-		'GI' => esc_html__( 'Gibraltar', 'give' ),
208
-		'GL' => esc_html__( 'Greenland', 'give' ),
209
-		'GD' => esc_html__( 'Grenada', 'give' ),
210
-		'GP' => esc_html__( 'Guadeloupe', 'give' ),
211
-		'GU' => esc_html__( 'Guam', 'give' ),
212
-		'GT' => esc_html__( 'Guatemala', 'give' ),
213
-		'GG' => esc_html__( 'Guernsey', 'give' ),
214
-		'GN' => esc_html__( 'Guinea', 'give' ),
215
-		'GW' => esc_html__( 'Guinea-Bissau', 'give' ),
216
-		'GY' => esc_html__( 'Guyana', 'give' ),
217
-		'HT' => esc_html__( 'Haiti', 'give' ),
218
-		'HM' => esc_html__( 'Heard and McDonald Islands', 'give' ),
219
-		'VA' => esc_html__( 'Holy See (City Vatican State)', 'give' ),
220
-		'HN' => esc_html__( 'Honduras', 'give' ),
221
-		'HK' => esc_html__( 'Hong Kong', 'give' ),
222
-		'HU' => esc_html__( 'Hungary', 'give' ),
223
-		'IS' => esc_html__( 'Iceland', 'give' ),
224
-		'IN' => esc_html__( 'India', 'give' ),
225
-		'ID' => esc_html__( 'Indonesia', 'give' ),
226
-		'IR' => esc_html__( 'Iran', 'give' ),
227
-		'IQ' => esc_html__( 'Iraq', 'give' ),
228
-		'IE' => esc_html__( 'Ireland', 'give' ),
229
-		'IM' => esc_html__( 'Isle of Man', 'give' ),
230
-		'IL' => esc_html__( 'Israel', 'give' ),
231
-		'IT' => esc_html__( 'Italy', 'give' ),
232
-		'JM' => esc_html__( 'Jamaica', 'give' ),
233
-		'JP' => esc_html__( 'Japan', 'give' ),
234
-		'JE' => esc_html__( 'Jersey', 'give' ),
235
-		'JO' => esc_html__( 'Jordan', 'give' ),
236
-		'KZ' => esc_html__( 'Kazakhstan', 'give' ),
237
-		'KE' => esc_html__( 'Kenya', 'give' ),
238
-		'KI' => esc_html__( 'Kiribati', 'give' ),
239
-		'KW' => esc_html__( 'Kuwait', 'give' ),
240
-		'KG' => esc_html__( 'Kyrgyzstan', 'give' ),
241
-		'LA' => esc_html__( 'Lao People\'s Democratic Republic', 'give' ),
242
-		'LV' => esc_html__( 'Latvia', 'give' ),
243
-		'LB' => esc_html__( 'Lebanon', 'give' ),
244
-		'LS' => esc_html__( 'Lesotho', 'give' ),
245
-		'LR' => esc_html__( 'Liberia', 'give' ),
246
-		'LY' => esc_html__( 'Libyan Arab Jamahiriya', 'give' ),
247
-		'LI' => esc_html__( 'Liechtenstein', 'give' ),
248
-		'LT' => esc_html__( 'Lithuania', 'give' ),
249
-		'LU' => esc_html__( 'Luxembourg', 'give' ),
250
-		'MO' => esc_html__( 'Macau', 'give' ),
251
-		'MK' => esc_html__( 'Macedonia', 'give' ),
252
-		'MG' => esc_html__( 'Madagascar', 'give' ),
253
-		'MW' => esc_html__( 'Malawi', 'give' ),
254
-		'MY' => esc_html__( 'Malaysia', 'give' ),
255
-		'MV' => esc_html__( 'Maldives', 'give' ),
256
-		'ML' => esc_html__( 'Mali', 'give' ),
257
-		'MT' => esc_html__( 'Malta', 'give' ),
258
-		'MH' => esc_html__( 'Marshall Islands', 'give' ),
259
-		'MQ' => esc_html__( 'Martinique', 'give' ),
260
-		'MR' => esc_html__( 'Mauritania', 'give' ),
261
-		'MU' => esc_html__( 'Mauritius', 'give' ),
262
-		'YT' => esc_html__( 'Mayotte', 'give' ),
263
-		'MX' => esc_html__( 'Mexico', 'give' ),
264
-		'FM' => esc_html__( 'Micronesia', 'give' ),
265
-		'MD' => esc_html__( 'Moldova, Republic of', 'give' ),
266
-		'MC' => esc_html__( 'Monaco', 'give' ),
267
-		'MN' => esc_html__( 'Mongolia', 'give' ),
268
-		'ME' => esc_html__( 'Montenegro', 'give' ),
269
-		'MS' => esc_html__( 'Montserrat', 'give' ),
270
-		'MA' => esc_html__( 'Morocco', 'give' ),
271
-		'MZ' => esc_html__( 'Mozambique', 'give' ),
272
-		'MM' => esc_html__( 'Myanmar', 'give' ),
273
-		'NA' => esc_html__( 'Namibia', 'give' ),
274
-		'NR' => esc_html__( 'Nauru', 'give' ),
275
-		'NP' => esc_html__( 'Nepal', 'give' ),
276
-		'NL' => esc_html__( 'Netherlands', 'give' ),
277
-		'AN' => esc_html__( 'Netherlands Antilles', 'give' ),
278
-		'NC' => esc_html__( 'New Caledonia', 'give' ),
279
-		'NZ' => esc_html__( 'New Zealand', 'give' ),
280
-		'NI' => esc_html__( 'Nicaragua', 'give' ),
281
-		'NE' => esc_html__( 'Niger', 'give' ),
282
-		'NG' => esc_html__( 'Nigeria', 'give' ),
283
-		'NU' => esc_html__( 'Niue', 'give' ),
284
-		'NF' => esc_html__( 'Norfolk Island', 'give' ),
285
-		'KP' => esc_html__( 'North Korea', 'give' ),
286
-		'MP' => esc_html__( 'Northern Mariana Islands', 'give' ),
287
-		'NO' => esc_html__( 'Norway', 'give' ),
288
-		'OM' => esc_html__( 'Oman', 'give' ),
289
-		'PK' => esc_html__( 'Pakistan', 'give' ),
290
-		'PW' => esc_html__( 'Palau', 'give' ),
291
-		'PS' => esc_html__( 'Palestinian Territories', 'give' ),
292
-		'PA' => esc_html__( 'Panama', 'give' ),
293
-		'PG' => esc_html__( 'Papua New Guinea', 'give' ),
294
-		'PY' => esc_html__( 'Paraguay', 'give' ),
295
-		'PE' => esc_html__( 'Peru', 'give' ),
296
-		'PH' => esc_html__( 'Phillipines', 'give' ),
297
-		'PN' => esc_html__( 'Pitcairn Island', 'give' ),
298
-		'PL' => esc_html__( 'Poland', 'give' ),
299
-		'PT' => esc_html__( 'Portugal', 'give' ),
300
-		'PR' => esc_html__( 'Puerto Rico', 'give' ),
301
-		'QA' => esc_html__( 'Qatar', 'give' ),
302
-		'RE' => esc_html__( 'Reunion Island', 'give' ),
303
-		'RO' => esc_html__( 'Romania', 'give' ),
304
-		'RU' => esc_html__( 'Russian Federation', 'give' ),
305
-		'RW' => esc_html__( 'Rwanda', 'give' ),
306
-		'SH' => esc_html__( 'Saint Helena', 'give' ),
307
-		'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ),
308
-		'LC' => esc_html__( 'Saint Lucia', 'give' ),
309
-		'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ),
310
-		'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ),
311
-		'SM' => esc_html__( 'San Marino', 'give' ),
312
-		'ST' => esc_html__( 'Sao Tome and Principe', 'give' ),
313
-		'SA' => esc_html__( 'Saudi Arabia', 'give' ),
314
-		'SN' => esc_html__( 'Senegal', 'give' ),
315
-		'RS' => esc_html__( 'Serbia', 'give' ),
316
-		'SC' => esc_html__( 'Seychelles', 'give' ),
317
-		'SL' => esc_html__( 'Sierra Leone', 'give' ),
318
-		'SG' => esc_html__( 'Singapore', 'give' ),
319
-		'SK' => esc_html__( 'Slovak Republic', 'give' ),
320
-		'SI' => esc_html__( 'Slovenia', 'give' ),
321
-		'SB' => esc_html__( 'Solomon Islands', 'give' ),
322
-		'SO' => esc_html__( 'Somalia', 'give' ),
323
-		'ZA' => esc_html__( 'South Africa', 'give' ),
324
-		'GS' => esc_html__( 'South Georgia', 'give' ),
325
-		'KR' => esc_html__( 'South Korea', 'give' ),
326
-		'ES' => esc_html__( 'Spain', 'give' ),
327
-		'LK' => esc_html__( 'Sri Lanka', 'give' ),
328
-		'SD' => esc_html__( 'Sudan', 'give' ),
329
-		'SR' => esc_html__( 'Suriname', 'give' ),
330
-		'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ),
331
-		'SZ' => esc_html__( 'Swaziland', 'give' ),
332
-		'SE' => esc_html__( 'Sweden', 'give' ),
333
-		'CH' => esc_html__( 'Switzerland', 'give' ),
334
-		'SY' => esc_html__( 'Syrian Arab Republic', 'give' ),
335
-		'TW' => esc_html__( 'Taiwan', 'give' ),
336
-		'TJ' => esc_html__( 'Tajikistan', 'give' ),
337
-		'TZ' => esc_html__( 'Tanzania', 'give' ),
338
-		'TG' => esc_html__( 'Togo', 'give' ),
339
-		'TK' => esc_html__( 'Tokelau', 'give' ),
340
-		'TO' => esc_html__( 'Tonga', 'give' ),
341
-		'TH' => esc_html__( 'Thailand', 'give' ),
342
-		'TT' => esc_html__( 'Trinidad and Tobago', 'give' ),
343
-		'TN' => esc_html__( 'Tunisia', 'give' ),
344
-		'TR' => esc_html__( 'Turkey', 'give' ),
345
-		'TM' => esc_html__( 'Turkmenistan', 'give' ),
346
-		'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ),
347
-		'TV' => esc_html__( 'Tuvalu', 'give' ),
348
-		'UG' => esc_html__( 'Uganda', 'give' ),
349
-		'UA' => esc_html__( 'Ukraine', 'give' ),
350
-		'AE' => esc_html__( 'United Arab Emirates', 'give' ),
351
-		'UY' => esc_html__( 'Uruguay', 'give' ),
352
-		'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ),
353
-		'UZ' => esc_html__( 'Uzbekistan', 'give' ),
354
-		'VU' => esc_html__( 'Vanuatu', 'give' ),
355
-		'VE' => esc_html__( 'Venezuela', 'give' ),
356
-		'VN' => esc_html__( 'Vietnam', 'give' ),
357
-		'VG' => esc_html__( 'Virgin Islands (British)', 'give' ),
358
-		'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ),
359
-		'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ),
360
-		'EH' => esc_html__( 'Western Sahara', 'give' ),
361
-		'WS' => esc_html__( 'Western Samoa', 'give' ),
362
-		'YE' => esc_html__( 'Yemen', 'give' ),
363
-		'YU' => esc_html__( 'Yugoslavia', 'give' ),
364
-		'ZM' => esc_html__( 'Zambia', 'give' ),
365
-		'ZW' => esc_html__( 'Zimbabwe', 'give' )
122
+		'US' => esc_html__('United States', 'give'),
123
+		'CA' => esc_html__('Canada', 'give'),
124
+		'GB' => esc_html__('United Kingdom', 'give'),
125
+		'AF' => esc_html__('Afghanistan', 'give'),
126
+		'AL' => esc_html__('Albania', 'give'),
127
+		'DZ' => esc_html__('Algeria', 'give'),
128
+		'AS' => esc_html__('American Samoa', 'give'),
129
+		'AD' => esc_html__('Andorra', 'give'),
130
+		'AO' => esc_html__('Angola', 'give'),
131
+		'AI' => esc_html__('Anguilla', 'give'),
132
+		'AQ' => esc_html__('Antarctica', 'give'),
133
+		'AG' => esc_html__('Antigua and Barbuda', 'give'),
134
+		'AR' => esc_html__('Argentina', 'give'),
135
+		'AM' => esc_html__('Armenia', 'give'),
136
+		'AW' => esc_html__('Aruba', 'give'),
137
+		'AU' => esc_html__('Australia', 'give'),
138
+		'AT' => esc_html__('Austria', 'give'),
139
+		'AZ' => esc_html__('Azerbaijan', 'give'),
140
+		'BS' => esc_html__('Bahamas', 'give'),
141
+		'BH' => esc_html__('Bahrain', 'give'),
142
+		'BD' => esc_html__('Bangladesh', 'give'),
143
+		'BB' => esc_html__('Barbados', 'give'),
144
+		'BY' => esc_html__('Belarus', 'give'),
145
+		'BE' => esc_html__('Belgium', 'give'),
146
+		'BZ' => esc_html__('Belize', 'give'),
147
+		'BJ' => esc_html__('Benin', 'give'),
148
+		'BM' => esc_html__('Bermuda', 'give'),
149
+		'BT' => esc_html__('Bhutan', 'give'),
150
+		'BO' => esc_html__('Bolivia', 'give'),
151
+		'BA' => esc_html__('Bosnia and Herzegovina', 'give'),
152
+		'BW' => esc_html__('Botswana', 'give'),
153
+		'BV' => esc_html__('Bouvet Island', 'give'),
154
+		'BR' => esc_html__('Brazil', 'give'),
155
+		'IO' => esc_html__('British Indian Ocean Territory', 'give'),
156
+		'BN' => esc_html__('Brunei Darrussalam', 'give'),
157
+		'BG' => esc_html__('Bulgaria', 'give'),
158
+		'BF' => esc_html__('Burkina Faso', 'give'),
159
+		'BI' => esc_html__('Burundi', 'give'),
160
+		'KH' => esc_html__('Cambodia', 'give'),
161
+		'CM' => esc_html__('Cameroon', 'give'),
162
+		'CV' => esc_html__('Cape Verde', 'give'),
163
+		'KY' => esc_html__('Cayman Islands', 'give'),
164
+		'CF' => esc_html__('Central African Republic', 'give'),
165
+		'TD' => esc_html__('Chad', 'give'),
166
+		'CL' => esc_html__('Chile', 'give'),
167
+		'CN' => esc_html__('China', 'give'),
168
+		'CX' => esc_html__('Christmas Island', 'give'),
169
+		'CC' => esc_html__('Cocos Islands', 'give'),
170
+		'CO' => esc_html__('Colombia', 'give'),
171
+		'KM' => esc_html__('Comoros', 'give'),
172
+		'CD' => esc_html__('Congo, Democratic People\'s Republic', 'give'),
173
+		'CG' => esc_html__('Congo, Republic of', 'give'),
174
+		'CK' => esc_html__('Cook Islands', 'give'),
175
+		'CR' => esc_html__('Costa Rica', 'give'),
176
+		'CI' => esc_html__('Cote d\'Ivoire', 'give'),
177
+		'HR' => esc_html__('Croatia/Hrvatska', 'give'),
178
+		'CU' => esc_html__('Cuba', 'give'),
179
+		'CY' => esc_html__('Cyprus Island', 'give'),
180
+		'CZ' => esc_html__('Czech Republic', 'give'),
181
+		'DK' => esc_html__('Denmark', 'give'),
182
+		'DJ' => esc_html__('Djibouti', 'give'),
183
+		'DM' => esc_html__('Dominica', 'give'),
184
+		'DO' => esc_html__('Dominican Republic', 'give'),
185
+		'TP' => esc_html__('East Timor', 'give'),
186
+		'EC' => esc_html__('Ecuador', 'give'),
187
+		'EG' => esc_html__('Egypt', 'give'),
188
+		'GQ' => esc_html__('Equatorial Guinea', 'give'),
189
+		'SV' => esc_html__('El Salvador', 'give'),
190
+		'ER' => esc_html__('Eritrea', 'give'),
191
+		'EE' => esc_html__('Estonia', 'give'),
192
+		'ET' => esc_html__('Ethiopia', 'give'),
193
+		'FK' => esc_html__('Falkland Islands', 'give'),
194
+		'FO' => esc_html__('Faroe Islands', 'give'),
195
+		'FJ' => esc_html__('Fiji', 'give'),
196
+		'FI' => esc_html__('Finland', 'give'),
197
+		'FR' => esc_html__('France', 'give'),
198
+		'GF' => esc_html__('French Guiana', 'give'),
199
+		'PF' => esc_html__('French Polynesia', 'give'),
200
+		'TF' => esc_html__('French Southern Territories', 'give'),
201
+		'GA' => esc_html__('Gabon', 'give'),
202
+		'GM' => esc_html__('Gambia', 'give'),
203
+		'GE' => esc_html__('Georgia', 'give'),
204
+		'DE' => esc_html__('Germany', 'give'),
205
+		'GR' => esc_html__('Greece', 'give'),
206
+		'GH' => esc_html__('Ghana', 'give'),
207
+		'GI' => esc_html__('Gibraltar', 'give'),
208
+		'GL' => esc_html__('Greenland', 'give'),
209
+		'GD' => esc_html__('Grenada', 'give'),
210
+		'GP' => esc_html__('Guadeloupe', 'give'),
211
+		'GU' => esc_html__('Guam', 'give'),
212
+		'GT' => esc_html__('Guatemala', 'give'),
213
+		'GG' => esc_html__('Guernsey', 'give'),
214
+		'GN' => esc_html__('Guinea', 'give'),
215
+		'GW' => esc_html__('Guinea-Bissau', 'give'),
216
+		'GY' => esc_html__('Guyana', 'give'),
217
+		'HT' => esc_html__('Haiti', 'give'),
218
+		'HM' => esc_html__('Heard and McDonald Islands', 'give'),
219
+		'VA' => esc_html__('Holy See (City Vatican State)', 'give'),
220
+		'HN' => esc_html__('Honduras', 'give'),
221
+		'HK' => esc_html__('Hong Kong', 'give'),
222
+		'HU' => esc_html__('Hungary', 'give'),
223
+		'IS' => esc_html__('Iceland', 'give'),
224
+		'IN' => esc_html__('India', 'give'),
225
+		'ID' => esc_html__('Indonesia', 'give'),
226
+		'IR' => esc_html__('Iran', 'give'),
227
+		'IQ' => esc_html__('Iraq', 'give'),
228
+		'IE' => esc_html__('Ireland', 'give'),
229
+		'IM' => esc_html__('Isle of Man', 'give'),
230
+		'IL' => esc_html__('Israel', 'give'),
231
+		'IT' => esc_html__('Italy', 'give'),
232
+		'JM' => esc_html__('Jamaica', 'give'),
233
+		'JP' => esc_html__('Japan', 'give'),
234
+		'JE' => esc_html__('Jersey', 'give'),
235
+		'JO' => esc_html__('Jordan', 'give'),
236
+		'KZ' => esc_html__('Kazakhstan', 'give'),
237
+		'KE' => esc_html__('Kenya', 'give'),
238
+		'KI' => esc_html__('Kiribati', 'give'),
239
+		'KW' => esc_html__('Kuwait', 'give'),
240
+		'KG' => esc_html__('Kyrgyzstan', 'give'),
241
+		'LA' => esc_html__('Lao People\'s Democratic Republic', 'give'),
242
+		'LV' => esc_html__('Latvia', 'give'),
243
+		'LB' => esc_html__('Lebanon', 'give'),
244
+		'LS' => esc_html__('Lesotho', 'give'),
245
+		'LR' => esc_html__('Liberia', 'give'),
246
+		'LY' => esc_html__('Libyan Arab Jamahiriya', 'give'),
247
+		'LI' => esc_html__('Liechtenstein', 'give'),
248
+		'LT' => esc_html__('Lithuania', 'give'),
249
+		'LU' => esc_html__('Luxembourg', 'give'),
250
+		'MO' => esc_html__('Macau', 'give'),
251
+		'MK' => esc_html__('Macedonia', 'give'),
252
+		'MG' => esc_html__('Madagascar', 'give'),
253
+		'MW' => esc_html__('Malawi', 'give'),
254
+		'MY' => esc_html__('Malaysia', 'give'),
255
+		'MV' => esc_html__('Maldives', 'give'),
256
+		'ML' => esc_html__('Mali', 'give'),
257
+		'MT' => esc_html__('Malta', 'give'),
258
+		'MH' => esc_html__('Marshall Islands', 'give'),
259
+		'MQ' => esc_html__('Martinique', 'give'),
260
+		'MR' => esc_html__('Mauritania', 'give'),
261
+		'MU' => esc_html__('Mauritius', 'give'),
262
+		'YT' => esc_html__('Mayotte', 'give'),
263
+		'MX' => esc_html__('Mexico', 'give'),
264
+		'FM' => esc_html__('Micronesia', 'give'),
265
+		'MD' => esc_html__('Moldova, Republic of', 'give'),
266
+		'MC' => esc_html__('Monaco', 'give'),
267
+		'MN' => esc_html__('Mongolia', 'give'),
268
+		'ME' => esc_html__('Montenegro', 'give'),
269
+		'MS' => esc_html__('Montserrat', 'give'),
270
+		'MA' => esc_html__('Morocco', 'give'),
271
+		'MZ' => esc_html__('Mozambique', 'give'),
272
+		'MM' => esc_html__('Myanmar', 'give'),
273
+		'NA' => esc_html__('Namibia', 'give'),
274
+		'NR' => esc_html__('Nauru', 'give'),
275
+		'NP' => esc_html__('Nepal', 'give'),
276
+		'NL' => esc_html__('Netherlands', 'give'),
277
+		'AN' => esc_html__('Netherlands Antilles', 'give'),
278
+		'NC' => esc_html__('New Caledonia', 'give'),
279
+		'NZ' => esc_html__('New Zealand', 'give'),
280
+		'NI' => esc_html__('Nicaragua', 'give'),
281
+		'NE' => esc_html__('Niger', 'give'),
282
+		'NG' => esc_html__('Nigeria', 'give'),
283
+		'NU' => esc_html__('Niue', 'give'),
284
+		'NF' => esc_html__('Norfolk Island', 'give'),
285
+		'KP' => esc_html__('North Korea', 'give'),
286
+		'MP' => esc_html__('Northern Mariana Islands', 'give'),
287
+		'NO' => esc_html__('Norway', 'give'),
288
+		'OM' => esc_html__('Oman', 'give'),
289
+		'PK' => esc_html__('Pakistan', 'give'),
290
+		'PW' => esc_html__('Palau', 'give'),
291
+		'PS' => esc_html__('Palestinian Territories', 'give'),
292
+		'PA' => esc_html__('Panama', 'give'),
293
+		'PG' => esc_html__('Papua New Guinea', 'give'),
294
+		'PY' => esc_html__('Paraguay', 'give'),
295
+		'PE' => esc_html__('Peru', 'give'),
296
+		'PH' => esc_html__('Phillipines', 'give'),
297
+		'PN' => esc_html__('Pitcairn Island', 'give'),
298
+		'PL' => esc_html__('Poland', 'give'),
299
+		'PT' => esc_html__('Portugal', 'give'),
300
+		'PR' => esc_html__('Puerto Rico', 'give'),
301
+		'QA' => esc_html__('Qatar', 'give'),
302
+		'RE' => esc_html__('Reunion Island', 'give'),
303
+		'RO' => esc_html__('Romania', 'give'),
304
+		'RU' => esc_html__('Russian Federation', 'give'),
305
+		'RW' => esc_html__('Rwanda', 'give'),
306
+		'SH' => esc_html__('Saint Helena', 'give'),
307
+		'KN' => esc_html__('Saint Kitts and Nevis', 'give'),
308
+		'LC' => esc_html__('Saint Lucia', 'give'),
309
+		'PM' => esc_html__('Saint Pierre and Miquelon', 'give'),
310
+		'VC' => esc_html__('Saint Vincent and the Grenadines', 'give'),
311
+		'SM' => esc_html__('San Marino', 'give'),
312
+		'ST' => esc_html__('Sao Tome and Principe', 'give'),
313
+		'SA' => esc_html__('Saudi Arabia', 'give'),
314
+		'SN' => esc_html__('Senegal', 'give'),
315
+		'RS' => esc_html__('Serbia', 'give'),
316
+		'SC' => esc_html__('Seychelles', 'give'),
317
+		'SL' => esc_html__('Sierra Leone', 'give'),
318
+		'SG' => esc_html__('Singapore', 'give'),
319
+		'SK' => esc_html__('Slovak Republic', 'give'),
320
+		'SI' => esc_html__('Slovenia', 'give'),
321
+		'SB' => esc_html__('Solomon Islands', 'give'),
322
+		'SO' => esc_html__('Somalia', 'give'),
323
+		'ZA' => esc_html__('South Africa', 'give'),
324
+		'GS' => esc_html__('South Georgia', 'give'),
325
+		'KR' => esc_html__('South Korea', 'give'),
326
+		'ES' => esc_html__('Spain', 'give'),
327
+		'LK' => esc_html__('Sri Lanka', 'give'),
328
+		'SD' => esc_html__('Sudan', 'give'),
329
+		'SR' => esc_html__('Suriname', 'give'),
330
+		'SJ' => esc_html__('Svalbard and Jan Mayen Islands', 'give'),
331
+		'SZ' => esc_html__('Swaziland', 'give'),
332
+		'SE' => esc_html__('Sweden', 'give'),
333
+		'CH' => esc_html__('Switzerland', 'give'),
334
+		'SY' => esc_html__('Syrian Arab Republic', 'give'),
335
+		'TW' => esc_html__('Taiwan', 'give'),
336
+		'TJ' => esc_html__('Tajikistan', 'give'),
337
+		'TZ' => esc_html__('Tanzania', 'give'),
338
+		'TG' => esc_html__('Togo', 'give'),
339
+		'TK' => esc_html__('Tokelau', 'give'),
340
+		'TO' => esc_html__('Tonga', 'give'),
341
+		'TH' => esc_html__('Thailand', 'give'),
342
+		'TT' => esc_html__('Trinidad and Tobago', 'give'),
343
+		'TN' => esc_html__('Tunisia', 'give'),
344
+		'TR' => esc_html__('Turkey', 'give'),
345
+		'TM' => esc_html__('Turkmenistan', 'give'),
346
+		'TC' => esc_html__('Turks and Caicos Islands', 'give'),
347
+		'TV' => esc_html__('Tuvalu', 'give'),
348
+		'UG' => esc_html__('Uganda', 'give'),
349
+		'UA' => esc_html__('Ukraine', 'give'),
350
+		'AE' => esc_html__('United Arab Emirates', 'give'),
351
+		'UY' => esc_html__('Uruguay', 'give'),
352
+		'UM' => esc_html__('US Minor Outlying Islands', 'give'),
353
+		'UZ' => esc_html__('Uzbekistan', 'give'),
354
+		'VU' => esc_html__('Vanuatu', 'give'),
355
+		'VE' => esc_html__('Venezuela', 'give'),
356
+		'VN' => esc_html__('Vietnam', 'give'),
357
+		'VG' => esc_html__('Virgin Islands (British)', 'give'),
358
+		'VI' => esc_html__('Virgin Islands (USA)', 'give'),
359
+		'WF' => esc_html__('Wallis and Futuna Islands', 'give'),
360
+		'EH' => esc_html__('Western Sahara', 'give'),
361
+		'WS' => esc_html__('Western Samoa', 'give'),
362
+		'YE' => esc_html__('Yemen', 'give'),
363
+		'YU' => esc_html__('Yugoslavia', 'give'),
364
+		'ZM' => esc_html__('Zambia', 'give'),
365
+		'ZW' => esc_html__('Zimbabwe', 'give')
366 366
 	);
367 367
 
368
-	return apply_filters( 'give_countries', $countries );
368
+	return apply_filters('give_countries', $countries);
369 369
 }
370 370
 
371 371
 /**
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 		'AP' => 'Armed Forces - Pacific'
447 447
 	);
448 448
 
449
-	return apply_filters( 'give_us_states', $states );
449
+	return apply_filters('give_us_states', $states);
450 450
 }
451 451
 
452 452
 /**
@@ -459,22 +459,22 @@  discard block
 block discarded – undo
459 459
 function give_get_provinces_list() {
460 460
 	$provinces = array(
461 461
 		''   => '',
462
-		'AB' => esc_html__('Alberta', 'give' ),
463
-		'BC' => esc_html__('British Columbia', 'give' ),
464
-		'MB' => esc_html__('Manitoba', 'give' ),
465
-		'NB' => esc_html__('New Brunswick', 'give' ),
466
-		'NL' => esc_html__('Newfoundland and Labrador', 'give' ),
467
-		'NS' => esc_html__('Nova Scotia', 'give' ),
468
-		'NT' => esc_html__('Northwest Territories', 'give' ),
469
-		'NU' => esc_html__('Nunavut', 'give' ),
470
-		'ON' => esc_html__('Ontario', 'give' ),
471
-		'PE' => esc_html__('Prince Edward Island', 'give' ),
472
-		'QC' => esc_html__('Quebec', 'give' ),
473
-		'SK' => esc_html__('Saskatchewan', 'give' ),
474
-		'YT' => esc_html__('Yukon', 'give' )
462
+		'AB' => esc_html__('Alberta', 'give'),
463
+		'BC' => esc_html__('British Columbia', 'give'),
464
+		'MB' => esc_html__('Manitoba', 'give'),
465
+		'NB' => esc_html__('New Brunswick', 'give'),
466
+		'NL' => esc_html__('Newfoundland and Labrador', 'give'),
467
+		'NS' => esc_html__('Nova Scotia', 'give'),
468
+		'NT' => esc_html__('Northwest Territories', 'give'),
469
+		'NU' => esc_html__('Nunavut', 'give'),
470
+		'ON' => esc_html__('Ontario', 'give'),
471
+		'PE' => esc_html__('Prince Edward Island', 'give'),
472
+		'QC' => esc_html__('Quebec', 'give'),
473
+		'SK' => esc_html__('Saskatchewan', 'give'),
474
+		'YT' => esc_html__('Yukon', 'give')
475 475
 	);
476 476
 
477
-	return apply_filters( 'give_canada_provinces', $provinces );
477
+	return apply_filters('give_canada_provinces', $provinces);
478 478
 }
479 479
 
480 480
 /**
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 		'WA'  => 'Western Australia'
497 497
 	);
498 498
 
499
-	return apply_filters( 'give_australian_states', $states );
499
+	return apply_filters('give_australian_states', $states);
500 500
 }
501 501
 
502 502
 /**
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 		'TO' => 'Tocantins'
538 538
 	);
539 539
 
540
-	return apply_filters( 'give_brazil_states', $states );
540
+	return apply_filters('give_brazil_states', $states);
541 541
 }
542 542
 
543 543
 /**
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 		'NEW TERRITORIES' => 'New Territories'
555 555
 	);
556 556
 
557
-	return apply_filters( 'give_hong_kong_states', $states );
557
+	return apply_filters('give_hong_kong_states', $states);
558 558
 }
559 559
 
560 560
 /**
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 		'ZA' => 'Zala'
589 589
 	);
590 590
 
591
-	return apply_filters( 'give_hungary_states', $states );
591
+	return apply_filters('give_hungary_states', $states);
592 592
 }
593 593
 
594 594
 /**
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 		'CN32' => 'Xinjiang / &#26032;&#30086;'
635 635
 	);
636 636
 
637
-	return apply_filters( 'give_chinese_states', $states );
637
+	return apply_filters('give_chinese_states', $states);
638 638
 }
639 639
 
640 640
 /**
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 		'WC' => 'West Coast'
664 664
 	);
665 665
 
666
-	return apply_filters( 'give_new_zealand_states', $states );
666
+	return apply_filters('give_new_zealand_states', $states);
667 667
 }
668 668
 
669 669
 /**
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 		'PB' => 'Papua Barat'
712 712
 	);
713 713
 
714
-	return apply_filters( 'give_indonesia_states', $states );
714
+	return apply_filters('give_indonesia_states', $states);
715 715
 }
716 716
 
717 717
 /**
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 		'PY' => 'Pondicherry (Puducherry)'
762 762
 	);
763 763
 
764
-	return apply_filters( 'give_indian_states', $states );
764
+	return apply_filters('give_indian_states', $states);
765 765
 }
766 766
 
767 767
 /**
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 		'PJY' => 'W.P. Putrajaya'
792 792
 	);
793 793
 
794
-	return apply_filters( 'give_malaysian_states', $states );
794
+	return apply_filters('give_malaysian_states', $states);
795 795
 }
796 796
 
797 797
 /**
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 		'WC'  => 'Western Cape'
815 815
 	);
816 816
 
817
-	return apply_filters( 'give_south_african_states', $states );
817
+	return apply_filters('give_south_african_states', $states);
818 818
 }
819 819
 
820 820
 /**
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
 		'TH-35' => 'Yasothon (&#3618;&#3650;&#3626;&#3608;&#3619;)'
906 906
 	);
907 907
 
908
-	return apply_filters( 'give_thailand_states', $states );
908
+	return apply_filters('give_thailand_states', $states);
909 909
 }
910 910
 
911 911
 /**
@@ -917,59 +917,59 @@  discard block
 block discarded – undo
917 917
 function give_get_spain_states_list() {
918 918
 	$states = array(
919 919
 		''   => '',
920
-		'C'  => esc_html__( 'A Coru&ntilde;a', 'give' ),
921
-		'VI' => esc_html__( 'Álava', 'give' ),
922
-		'AB' => esc_html__( 'Albacete', 'give' ),
923
-		'A'  => esc_html__( 'Alicante', 'give' ),
924
-		'AL' => esc_html__( 'Almer&iacute;a', 'give' ),
925
-		'O'  => esc_html__( 'Asturias', 'give' ),
926
-		'AV' => esc_html__( '&Aacute;vila', 'give' ),
927
-		'BA' => esc_html__( 'Badajoz', 'give' ),
928
-		'PM' => esc_html__( 'Baleares', 'give' ),
929
-		'B'  => esc_html__( 'Barcelona', 'give' ),
930
-		'BU' => esc_html__( 'Burgos', 'give' ),
931
-		'CC' => esc_html__( 'C&aacute;ceres', 'give' ),
932
-		'CA' => esc_html__( 'C&aacute;diz', 'give' ),
933
-		'S'  => esc_html__( 'Cantabria', 'give' ),
934
-		'CS' => esc_html__( 'Castell&oacute;n', 'give' ),
935
-		'CE' => esc_html__( 'Ceuta', 'give' ),
936
-		'CR' => esc_html__( 'Ciudad Real', 'give' ),
937
-		'CO' => esc_html__( 'C&oacute;rdoba', 'give' ),
938
-		'CU' => esc_html__( 'Cuenca', 'give' ),
939
-		'GI' => esc_html__( 'Girona', 'give' ),
940
-		'GR' => esc_html__( 'Granada', 'give' ),
941
-		'GU' => esc_html__( 'Guadalajara', 'give' ),
942
-		'SS' => esc_html__( 'Gipuzkoa', 'give' ),
943
-		'H'  => esc_html__( 'Huelva', 'give' ),
944
-		'HU' => esc_html__( 'Huesca', 'give' ),
945
-		'J'  => esc_html__( 'Ja&eacute;n', 'give' ),
946
-		'LO' => esc_html__( 'La Rioja', 'give' ),
947
-		'GC' => esc_html__( 'Las Palmas', 'give' ),
948
-		'LE' => esc_html__( 'Le&oacute;n', 'give' ),
949
-		'L'  => esc_html__( 'Lleida', 'give' ),
950
-		'LU' => esc_html__( 'Lugo', 'give' ),
951
-		'M'  => esc_html__( 'Madrid', 'give' ),
952
-		'MA' => esc_html__( 'M&aacute;laga', 'give' ),
953
-		'ML' => esc_html__( 'Melilla', 'give' ),
954
-		'MU' => esc_html__( 'Murcia', 'give' ),
955
-		'NA' => esc_html__( 'Navarra', 'give' ),
956
-		'OR' => esc_html__( 'Ourense', 'give' ),
957
-		'P'  => esc_html__( 'Palencia', 'give' ),
958
-		'PO' => esc_html__( 'Pontevedra', 'give' ),
959
-		'SA' => esc_html__( 'Salamanca', 'give' ),
960
-		'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ),
961
-		'SG' => esc_html__( 'Segovia', 'give' ),
962
-		'SE' => esc_html__( 'Sevilla', 'give' ),
963
-		'SO' => esc_html__( 'Soria', 'give' ),
964
-		'T'  => esc_html__( 'Tarragona', 'give' ),
965
-		'TE' => esc_html__( 'Teruel', 'give' ),
966
-		'TO' => esc_html__( 'Toledo', 'give' ),
967
-		'V'  => esc_html__( 'Valencia', 'give' ),
968
-		'VA' => esc_html__( 'Valladolid', 'give' ),
969
-		'BI' => esc_html__( 'Bizkaia', 'give' ),
970
-		'ZA' => esc_html__( 'Zamora', 'give' ),
971
-		'Z'  => esc_html__( 'Zaragoza', 'give' )
920
+		'C'  => esc_html__('A Coru&ntilde;a', 'give'),
921
+		'VI' => esc_html__('Álava', 'give'),
922
+		'AB' => esc_html__('Albacete', 'give'),
923
+		'A'  => esc_html__('Alicante', 'give'),
924
+		'AL' => esc_html__('Almer&iacute;a', 'give'),
925
+		'O'  => esc_html__('Asturias', 'give'),
926
+		'AV' => esc_html__('&Aacute;vila', 'give'),
927
+		'BA' => esc_html__('Badajoz', 'give'),
928
+		'PM' => esc_html__('Baleares', 'give'),
929
+		'B'  => esc_html__('Barcelona', 'give'),
930
+		'BU' => esc_html__('Burgos', 'give'),
931
+		'CC' => esc_html__('C&aacute;ceres', 'give'),
932
+		'CA' => esc_html__('C&aacute;diz', 'give'),
933
+		'S'  => esc_html__('Cantabria', 'give'),
934
+		'CS' => esc_html__('Castell&oacute;n', 'give'),
935
+		'CE' => esc_html__('Ceuta', 'give'),
936
+		'CR' => esc_html__('Ciudad Real', 'give'),
937
+		'CO' => esc_html__('C&oacute;rdoba', 'give'),
938
+		'CU' => esc_html__('Cuenca', 'give'),
939
+		'GI' => esc_html__('Girona', 'give'),
940
+		'GR' => esc_html__('Granada', 'give'),
941
+		'GU' => esc_html__('Guadalajara', 'give'),
942
+		'SS' => esc_html__('Gipuzkoa', 'give'),
943
+		'H'  => esc_html__('Huelva', 'give'),
944
+		'HU' => esc_html__('Huesca', 'give'),
945
+		'J'  => esc_html__('Ja&eacute;n', 'give'),
946
+		'LO' => esc_html__('La Rioja', 'give'),
947
+		'GC' => esc_html__('Las Palmas', 'give'),
948
+		'LE' => esc_html__('Le&oacute;n', 'give'),
949
+		'L'  => esc_html__('Lleida', 'give'),
950
+		'LU' => esc_html__('Lugo', 'give'),
951
+		'M'  => esc_html__('Madrid', 'give'),
952
+		'MA' => esc_html__('M&aacute;laga', 'give'),
953
+		'ML' => esc_html__('Melilla', 'give'),
954
+		'MU' => esc_html__('Murcia', 'give'),
955
+		'NA' => esc_html__('Navarra', 'give'),
956
+		'OR' => esc_html__('Ourense', 'give'),
957
+		'P'  => esc_html__('Palencia', 'give'),
958
+		'PO' => esc_html__('Pontevedra', 'give'),
959
+		'SA' => esc_html__('Salamanca', 'give'),
960
+		'TF' => esc_html__('Santa Cruz de Tenerife', 'give'),
961
+		'SG' => esc_html__('Segovia', 'give'),
962
+		'SE' => esc_html__('Sevilla', 'give'),
963
+		'SO' => esc_html__('Soria', 'give'),
964
+		'T'  => esc_html__('Tarragona', 'give'),
965
+		'TE' => esc_html__('Teruel', 'give'),
966
+		'TO' => esc_html__('Toledo', 'give'),
967
+		'V'  => esc_html__('Valencia', 'give'),
968
+		'VA' => esc_html__('Valladolid', 'give'),
969
+		'BI' => esc_html__('Bizkaia', 'give'),
970
+		'ZA' => esc_html__('Zamora', 'give'),
971
+		'Z'  => esc_html__('Zaragoza', 'give')
972 972
 	);
973 973
 
974
-	return apply_filters( 'give_spain_states', $states );
974
+	return apply_filters('give_spain_states', $states);
975 975
 }
Please login to merge, or discard this patch.
includes/emails/actions.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return void
25 25
  */
26
-function give_trigger_donation_receipt( $payment_id ) {
26
+function give_trigger_donation_receipt($payment_id) {
27 27
 	// Make sure we don't send a receipt while editing a donation.
28
-	if ( isset( $_POST['give-action'] ) && 'edit_payment' == $_POST['give-action'] ) {
28
+	if (isset($_POST['give-action']) && 'edit_payment' == $_POST['give-action']) {
29 29
 		return;
30 30
 	}
31 31
 
32 32
 	// Send email.
33
-	give_email_donation_receipt( $payment_id );
33
+	give_email_donation_receipt($payment_id);
34 34
 }
35 35
 
36
-add_action( 'give_complete_donation', 'give_trigger_donation_receipt', 999, 1 );
36
+add_action('give_complete_donation', 'give_trigger_donation_receipt', 999, 1);
37 37
 
38 38
 /**
39 39
  * Resend the Email Donation Receipt. (This can be done from the Donation History Page)
@@ -44,29 +44,29 @@  discard block
 block discarded – undo
44 44
  *
45 45
  * @return void
46 46
  */
47
-function give_resend_donation_receipt( $data ) {
47
+function give_resend_donation_receipt($data) {
48 48
 
49
-	$purchase_id = absint( $data['purchase_id'] );
49
+	$purchase_id = absint($data['purchase_id']);
50 50
 
51
-	if ( empty( $purchase_id ) ) {
51
+	if (empty($purchase_id)) {
52 52
 		return;
53 53
 	}
54 54
 
55
-	if ( ! current_user_can( 'edit_give_payments', $purchase_id ) ) {
56
-		wp_die( esc_html__( 'You do not have permission to edit payments.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
55
+	if ( ! current_user_can('edit_give_payments', $purchase_id)) {
56
+		wp_die(esc_html__('You do not have permission to edit payments.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
57 57
 	}
58 58
 
59
-	give_email_donation_receipt( $purchase_id, false );
59
+	give_email_donation_receipt($purchase_id, false);
60 60
 
61
-	wp_redirect( add_query_arg( array(
61
+	wp_redirect(add_query_arg(array(
62 62
 		'give-message' => 'email_sent',
63 63
 		'give-action'  => false,
64 64
 		'purchase_id'  => false
65
-	) ) );
65
+	)));
66 66
 	exit;
67 67
 }
68 68
 
69
-add_action( 'give_email_links', 'give_resend_donation_receipt' );
69
+add_action('give_email_links', 'give_resend_donation_receipt');
70 70
 
71 71
 /**
72 72
  * Trigger the sending of a Test Email
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
  *
78 78
  * @return void
79 79
  */
80
-function give_send_test_email( $data ) {
81
-	if ( ! wp_verify_nonce( $data['_wpnonce'], 'give-test-email' ) ) {
80
+function give_send_test_email($data) {
81
+	if ( ! wp_verify_nonce($data['_wpnonce'], 'give-test-email')) {
82 82
 		return;
83 83
 	}
84 84
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	give_email_test_donation_receipt();
87 87
 
88 88
 	// Remove the test email query arg.
89
-	wp_redirect( remove_query_arg( 'give_action' ) );
89
+	wp_redirect(remove_query_arg('give_action'));
90 90
 	exit;
91 91
 }
92 92
 
93
-add_action( 'give_send_test_email', 'give_send_test_email' );
93
+add_action('give_send_test_email', 'give_send_test_email');
Please login to merge, or discard this patch.