Completed
Pull Request — master (#745)
by
unknown
36:07 queued 32:32
created
includes/admin/system-info.php 1 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" title="<?php echo esc_attr( '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" title="<?php echo esc_attr('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( __( 'Download System Info File', 'give' ), 'secondary', 'give-download-sysinfo', false ); ?>
34
+		<?php submit_button(__('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
 /**
@@ -67,63 +67,63 @@  discard block
 block discarded – undo
67 67
 function give_tools_sysinfo_get() {
68 68
 	global $wpdb, $give_options;
69 69
 
70
-	if ( ! class_exists( 'Browser' ) ) {
71
-		require_once GIVE_PLUGIN_DIR . 'includes/libraries/browser.php';
70
+	if ( ! class_exists('Browser')) {
71
+		require_once GIVE_PLUGIN_DIR.'includes/libraries/browser.php';
72 72
 	}
73 73
 
74 74
 	$browser = new Browser();
75 75
 
76 76
 	// Get theme info
77
-	if ( get_bloginfo( 'version' ) < '3.4' ) {
78
-		$theme_data = wp_get_theme( get_stylesheet_directory() . '/style.css' );
79
-		$theme      = $theme_data['Name'] . ' ' . $theme_data['Version'];
77
+	if (get_bloginfo('version') < '3.4') {
78
+		$theme_data = wp_get_theme(get_stylesheet_directory().'/style.css');
79
+		$theme      = $theme_data['Name'].' '.$theme_data['Version'];
80 80
 	} else {
81 81
 		$theme_data = wp_get_theme();
82
-		$theme      = $theme_data->Name . ' ' . $theme_data->Version;
82
+		$theme      = $theme_data->Name.' '.$theme_data->Version;
83 83
 	}
84 84
 
85 85
 	// Try to identify the hosting provider
86 86
 	$host = give_get_host();
87 87
 
88
-	$return = '### Begin System Info ###' . "\n\n";
88
+	$return = '### Begin System Info ###'."\n\n";
89 89
 
90 90
 	// Start with the basics...
91
-	$return .= '-- Site Info' . "\n\n";
92
-	$return .= 'Site URL:                 ' . site_url() . "\n";
93
-	$return .= 'Home URL:                 ' . home_url() . "\n";
94
-	$return .= 'Multisite:                ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n";
91
+	$return .= '-- Site Info'."\n\n";
92
+	$return .= 'Site URL:                 '.site_url()."\n";
93
+	$return .= 'Home URL:                 '.home_url()."\n";
94
+	$return .= 'Multisite:                '.(is_multisite() ? 'Yes' : 'No')."\n";
95 95
 
96
-	$return = apply_filters( 'give_sysinfo_after_site_info', $return );
96
+	$return = apply_filters('give_sysinfo_after_site_info', $return);
97 97
 
98 98
 	// Can we determine the site's host?
99
-	if ( $host ) {
100
-		$return .= "\n" . '-- Hosting Provider' . "\n\n";
101
-		$return .= 'Host:                     ' . $host . "\n";
99
+	if ($host) {
100
+		$return .= "\n".'-- Hosting Provider'."\n\n";
101
+		$return .= 'Host:                     '.$host."\n";
102 102
 
103
-		$return = apply_filters( 'give_sysinfo_after_host_info', $return );
103
+		$return = apply_filters('give_sysinfo_after_host_info', $return);
104 104
 	}
105 105
 
106 106
 	// The local users' browser information, handled by the Browser class
107
-	$return .= "\n" . '-- User Browser' . "\n\n";
107
+	$return .= "\n".'-- User Browser'."\n\n";
108 108
 	$return .= $browser;
109 109
 
110
-	$return = apply_filters( 'give_sysinfo_after_user_browser', $return );
110
+	$return = apply_filters('give_sysinfo_after_user_browser', $return);
111 111
 
112 112
 	// WordPress configuration
113
-	$return .= "\n" . '-- WordPress Configuration' . "\n\n";
114
-	$return .= 'Version:                  ' . get_bloginfo( 'version' ) . "\n";
115
-	$return .= 'Language:                 ' . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . "\n";
116
-	$return .= 'Permalink Structure:      ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . "\n";
117
-	$return .= 'Active Theme:             ' . $theme . "\n";
118
-	$return .= 'Show On Front:            ' . get_option( 'show_on_front' ) . "\n";
113
+	$return .= "\n".'-- WordPress Configuration'."\n\n";
114
+	$return .= 'Version:                  '.get_bloginfo('version')."\n";
115
+	$return .= 'Language:                 '.(defined('WPLANG') && WPLANG ? WPLANG : 'en_US')."\n";
116
+	$return .= 'Permalink Structure:      '.(get_option('permalink_structure') ? get_option('permalink_structure') : 'Default')."\n";
117
+	$return .= 'Active Theme:             '.$theme."\n";
118
+	$return .= 'Show On Front:            '.get_option('show_on_front')."\n";
119 119
 
120 120
 	// Only show page specs if frontpage is set to 'page'
121
-	if ( get_option( 'show_on_front' ) == 'page' ) {
122
-		$front_page_id = get_option( 'page_on_front' );
123
-		$blog_page_id  = get_option( 'page_for_posts' );
121
+	if (get_option('show_on_front') == 'page') {
122
+		$front_page_id = get_option('page_on_front');
123
+		$blog_page_id  = get_option('page_for_posts');
124 124
 
125
-		$return .= 'Page On Front:            ' . ( $front_page_id != 0 ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n";
126
-		$return .= 'Page For Posts:           ' . ( $blog_page_id != 0 ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n";
125
+		$return .= 'Page On Front:            '.($front_page_id != 0 ? get_the_title($front_page_id).' (#'.$front_page_id.')' : 'Unset')."\n";
126
+		$return .= 'Page For Posts:           '.($blog_page_id != 0 ? get_the_title($blog_page_id).' (#'.$blog_page_id.')' : 'Unset')."\n";
127 127
 	}
128 128
 
129 129
 	// Make sure wp_remote_post() is working
@@ -132,205 +132,205 @@  discard block
 block discarded – undo
132 132
 	$params = array(
133 133
 		'sslverify'  => false,
134 134
 		'timeout'    => 60,
135
-		'user-agent' => 'Give/' . GIVE_VERSION,
135
+		'user-agent' => 'Give/'.GIVE_VERSION,
136 136
 		'body'       => $request
137 137
 	);
138 138
 
139
-	$response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params );
139
+	$response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', $params);
140 140
 
141
-	if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
141
+	if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
142 142
 		$WP_REMOTE_POST = 'wp_remote_post() works';
143 143
 	} else {
144 144
 		$WP_REMOTE_POST = 'wp_remote_post() does not work';
145 145
 	}
146 146
 
147
-	$return .= 'Remote Post:              ' . $WP_REMOTE_POST . "\n";
148
-	$return .= 'Table Prefix:             ' . 'Length: ' . strlen( $wpdb->prefix ) . '   Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ) . "\n";
149
-	$return .= 'Admin AJAX:               ' . ( give_test_ajax_works() ? 'Accessible' : 'Inaccessible' ) . "\n";
150
-	$return .= 'WP_DEBUG:                 ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
151
-	$return .= 'Memory Limit:             ' . WP_MEMORY_LIMIT . "\n";
152
-	$return .= 'Registered Post Stati:    ' . implode( ', ', get_post_stati() ) . "\n";
147
+	$return .= 'Remote Post:              '.$WP_REMOTE_POST."\n";
148
+	$return .= 'Table Prefix:             '.'Length: '.strlen($wpdb->prefix).'   Status: '.(strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable')."\n";
149
+	$return .= 'Admin AJAX:               '.(give_test_ajax_works() ? 'Accessible' : 'Inaccessible')."\n";
150
+	$return .= 'WP_DEBUG:                 '.(defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set')."\n";
151
+	$return .= 'Memory Limit:             '.WP_MEMORY_LIMIT."\n";
152
+	$return .= 'Registered Post Stati:    '.implode(', ', get_post_stati())."\n";
153 153
 
154
-	$return = apply_filters( 'give_sysinfo_after_wordpress_config', $return );
154
+	$return = apply_filters('give_sysinfo_after_wordpress_config', $return);
155 155
 
156 156
 	// GIVE configuration
157
-	$return .= "\n" . '-- Give Configuration' . "\n\n";
158
-	$return .= 'Version:                  ' . GIVE_VERSION . "\n";
159
-	$return .= 'Upgraded From:            ' . get_option( 'give_version_upgraded_from', 'None' ) . "\n";
160
-	$return .= 'Test Mode:                ' . ( give_is_test_mode() ? "Enabled\n" : "Disabled\n" );
161
-	$return .= 'Currency Code:            ' . give_get_currency() . "\n";
162
-	$return .= 'Currency Position:        ' . give_get_option( 'currency_position', 'before' ) . "\n";
163
-	$return .= 'Decimal Separator:        ' . give_get_option( 'decimal_separator', '.' ) . "\n";
164
-	$return .= 'Thousands Separator:      ' . give_get_option( 'thousands_separator', ',' ) . "\n";
157
+	$return .= "\n".'-- Give Configuration'."\n\n";
158
+	$return .= 'Version:                  '.GIVE_VERSION."\n";
159
+	$return .= 'Upgraded From:            '.get_option('give_version_upgraded_from', 'None')."\n";
160
+	$return .= 'Test Mode:                '.(give_is_test_mode() ? "Enabled\n" : "Disabled\n");
161
+	$return .= 'Currency Code:            '.give_get_currency()."\n";
162
+	$return .= 'Currency Position:        '.give_get_option('currency_position', 'before')."\n";
163
+	$return .= 'Decimal Separator:        '.give_get_option('decimal_separator', '.')."\n";
164
+	$return .= 'Thousands Separator:      '.give_get_option('thousands_separator', ',')."\n";
165 165
 
166
-	$return = apply_filters( 'give_sysinfo_after_give_config', $return );
166
+	$return = apply_filters('give_sysinfo_after_give_config', $return);
167 167
 
168 168
 	// GIVE pages
169
-	$return .= "\n" . '-- Give Page Configuration' . "\n\n";
170
-	$return .= 'Success Page:             ' . ( ! empty( $give_options['success_page'] ) ? get_permalink( $give_options['success_page'] ) . "\n" : "Unset\n" );
171
-	$return .= 'Failure Page:             ' . ( ! empty( $give_options['failure_page'] ) ? get_permalink( $give_options['failure_page'] ) . "\n" : "Unset\n" );
172
-	$return .= 'Give Forms Slug:           ' . ( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . "\n" : "/donations\n" );
169
+	$return .= "\n".'-- Give Page Configuration'."\n\n";
170
+	$return .= 'Success Page:             '.( ! empty($give_options['success_page']) ? get_permalink($give_options['success_page'])."\n" : "Unset\n");
171
+	$return .= 'Failure Page:             '.( ! empty($give_options['failure_page']) ? get_permalink($give_options['failure_page'])."\n" : "Unset\n");
172
+	$return .= 'Give Forms Slug:           '.(defined('GIVE_SLUG') ? '/'.GIVE_SLUG."\n" : "/donations\n");
173 173
 
174
-	$return = apply_filters( 'give_sysinfo_after_give_pages', $return );
174
+	$return = apply_filters('give_sysinfo_after_give_pages', $return);
175 175
 
176 176
 	// GIVE gateways
177
-	$return .= "\n" . '-- Give Gateway Configuration' . "\n\n";
177
+	$return .= "\n".'-- Give Gateway Configuration'."\n\n";
178 178
 
179 179
 	$active_gateways = give_get_enabled_payment_gateways();
180
-	if ( $active_gateways ) {
181
-		$default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) );
182
-		if ( $default_gateway_is_active ) {
183
-			$default_gateway = give_get_default_gateway( null );
184
-			$default_gateway = $active_gateways[ $default_gateway ]['admin_label'];
180
+	if ($active_gateways) {
181
+		$default_gateway_is_active = give_is_gateway_active(give_get_default_gateway(null));
182
+		if ($default_gateway_is_active) {
183
+			$default_gateway = give_get_default_gateway(null);
184
+			$default_gateway = $active_gateways[$default_gateway]['admin_label'];
185 185
 		} else {
186 186
 			$default_gateway = 'Test Payment';
187 187
 		}
188 188
 
189 189
 		$gateways = array();
190
-		foreach ( $active_gateways as $gateway ) {
190
+		foreach ($active_gateways as $gateway) {
191 191
 			$gateways[] = $gateway['admin_label'];
192 192
 		}
193 193
 
194
-		$return .= 'Enabled Gateways:         ' . implode( ', ', $gateways ) . "\n";
195
-		$return .= 'Default Gateway:          ' . $default_gateway . "\n";
194
+		$return .= 'Enabled Gateways:         '.implode(', ', $gateways)."\n";
195
+		$return .= 'Default Gateway:          '.$default_gateway."\n";
196 196
 	} else {
197
-		$return .= 'Enabled Gateways:         None' . "\n";
197
+		$return .= 'Enabled Gateways:         None'."\n";
198 198
 	}
199 199
 
200
-	$return = apply_filters( 'give_sysinfo_after_give_gateways', $return );
200
+	$return = apply_filters('give_sysinfo_after_give_gateways', $return);
201 201
 
202 202
 	// GIVE Templates
203
-	$dir = get_stylesheet_directory() . '/give_templates/*';
204
-	if ( is_dir( $dir ) && ( count( glob( "$dir/*" ) ) !== 0 ) ) {
205
-		$return .= "\n" . '-- Give Template Overrides' . "\n\n";
203
+	$dir = get_stylesheet_directory().'/give_templates/*';
204
+	if (is_dir($dir) && (count(glob("$dir/*")) !== 0)) {
205
+		$return .= "\n".'-- Give Template Overrides'."\n\n";
206 206
 
207
-		foreach ( glob( $dir ) as $file ) {
208
-			$return .= 'Filename:                 ' . basename( $file ) . "\n";
207
+		foreach (glob($dir) as $file) {
208
+			$return .= 'Filename:                 '.basename($file)."\n";
209 209
 		}
210 210
 
211
-		$return = apply_filters( 'give_sysinfo_after_give_templates', $return );
211
+		$return = apply_filters('give_sysinfo_after_give_templates', $return);
212 212
 	}
213 213
 
214 214
 	// Must-use plugins
215 215
 	$muplugins = get_mu_plugins();
216
-	if ( count( $muplugins > 0 ) ) {
217
-		$return .= "\n" . '-- Must-Use Plugins' . "\n\n";
216
+	if (count($muplugins > 0)) {
217
+		$return .= "\n".'-- Must-Use Plugins'."\n\n";
218 218
 
219
-		foreach ( $muplugins as $plugin => $plugin_data ) {
220
-			$return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n";
219
+		foreach ($muplugins as $plugin => $plugin_data) {
220
+			$return .= $plugin_data['Name'].': '.$plugin_data['Version']."\n";
221 221
 		}
222 222
 
223
-		$return = apply_filters( 'give_sysinfo_after_wordpress_mu_plugins', $return );
223
+		$return = apply_filters('give_sysinfo_after_wordpress_mu_plugins', $return);
224 224
 	}
225 225
 
226 226
 	// WordPress active plugins
227
-	$return .= "\n" . '-- WordPress Active Plugins' . "\n\n";
227
+	$return .= "\n".'-- WordPress Active Plugins'."\n\n";
228 228
 
229 229
 	$plugins        = get_plugins();
230
-	$active_plugins = get_option( 'active_plugins', array() );
230
+	$active_plugins = get_option('active_plugins', array());
231 231
 
232
-	foreach ( $plugins as $plugin_path => $plugin ) {
233
-		if ( ! in_array( $plugin_path, $active_plugins ) ) {
232
+	foreach ($plugins as $plugin_path => $plugin) {
233
+		if ( ! in_array($plugin_path, $active_plugins)) {
234 234
 			continue;
235 235
 		}
236 236
 
237
-		$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
237
+		$return .= $plugin['Name'].': '.$plugin['Version']."\n";
238 238
 	}
239 239
 
240
-	$return = apply_filters( 'give_sysinfo_after_wordpress_plugins', $return );
240
+	$return = apply_filters('give_sysinfo_after_wordpress_plugins', $return);
241 241
 
242 242
 	// WordPress inactive plugins
243
-	$return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n";
243
+	$return .= "\n".'-- WordPress Inactive Plugins'."\n\n";
244 244
 
245
-	foreach ( $plugins as $plugin_path => $plugin ) {
246
-		if ( in_array( $plugin_path, $active_plugins ) ) {
245
+	foreach ($plugins as $plugin_path => $plugin) {
246
+		if (in_array($plugin_path, $active_plugins)) {
247 247
 			continue;
248 248
 		}
249 249
 
250
-		$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
250
+		$return .= $plugin['Name'].': '.$plugin['Version']."\n";
251 251
 	}
252 252
 
253
-	$return = apply_filters( 'give_sysinfo_after_wordpress_plugins_inactive', $return );
253
+	$return = apply_filters('give_sysinfo_after_wordpress_plugins_inactive', $return);
254 254
 
255
-	if ( is_multisite() ) {
255
+	if (is_multisite()) {
256 256
 		// WordPress Multisite active plugins
257
-		$return .= "\n" . '-- Network Active Plugins' . "\n\n";
257
+		$return .= "\n".'-- Network Active Plugins'."\n\n";
258 258
 
259 259
 		$plugins        = wp_get_active_network_plugins();
260
-		$active_plugins = get_site_option( 'active_sitewide_plugins', array() );
260
+		$active_plugins = get_site_option('active_sitewide_plugins', array());
261 261
 
262
-		foreach ( $plugins as $plugin_path ) {
263
-			$plugin_base = plugin_basename( $plugin_path );
262
+		foreach ($plugins as $plugin_path) {
263
+			$plugin_base = plugin_basename($plugin_path);
264 264
 
265
-			if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
265
+			if ( ! array_key_exists($plugin_base, $active_plugins)) {
266 266
 				continue;
267 267
 			}
268 268
 
269
-			$plugin = get_plugin_data( $plugin_path );
270
-			$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
269
+			$plugin = get_plugin_data($plugin_path);
270
+			$return .= $plugin['Name'].': '.$plugin['Version']."\n";
271 271
 		}
272 272
 
273
-		$return = apply_filters( 'give_sysinfo_after_wordpress_ms_plugins', $return );
273
+		$return = apply_filters('give_sysinfo_after_wordpress_ms_plugins', $return);
274 274
 	}
275 275
 
276 276
 	// Server configuration (really just versioning)
277
-	$return .= "\n" . '-- Webserver Configuration' . "\n\n";
278
-	$return .= 'PHP Version:              ' . PHP_VERSION . "\n";
279
-	$return .= 'MySQL Version:            ' . $wpdb->db_version() . "\n";
280
-	$return .= 'Webserver Info:           ' . $_SERVER['SERVER_SOFTWARE'] . "\n";
277
+	$return .= "\n".'-- Webserver Configuration'."\n\n";
278
+	$return .= 'PHP Version:              '.PHP_VERSION."\n";
279
+	$return .= 'MySQL Version:            '.$wpdb->db_version()."\n";
280
+	$return .= 'Webserver Info:           '.$_SERVER['SERVER_SOFTWARE']."\n";
281 281
 
282
-	$return = apply_filters( 'give_sysinfo_after_webserver_config', $return );
282
+	$return = apply_filters('give_sysinfo_after_webserver_config', $return);
283 283
 
284 284
 	// PHP configs... now we're getting to the important stuff
285
-	$return .= "\n" . '-- PHP Configuration' . "\n\n";
286
-	$return .= 'Safe Mode:                ' . ( ini_get( 'safe_mode' ) ? 'Enabled' : 'Disabled' . "\n" );
287
-	$return .= 'Memory Limit:             ' . ini_get( 'memory_limit' ) . "\n";
288
-	$return .= 'Upload Max Size:          ' . ini_get( 'upload_max_filesize' ) . "\n";
289
-	$return .= 'Post Max Size:            ' . ini_get( 'post_max_size' ) . "\n";
290
-	$return .= 'Upload Max Filesize:      ' . ini_get( 'upload_max_filesize' ) . "\n";
291
-	$return .= 'Time Limit:               ' . ini_get( 'max_execution_time' ) . "\n";
292
-	$return .= 'Max Input Vars:           ' . ini_get( 'max_input_vars' ) . "\n";
293
-	$return .= 'URL-aware fopen:          ' . ( ini_get( 'allow_url_fopen' ) ? 'On (' . ini_get( 'allow_url_fopen' ) . ')' : 'N/A' ) . "\n";
294
-	$return .= 'Display Errors:           ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
295
-
296
-	$return = apply_filters( 'give_sysinfo_after_php_config', $return );
285
+	$return .= "\n".'-- PHP Configuration'."\n\n";
286
+	$return .= 'Safe Mode:                '.(ini_get('safe_mode') ? 'Enabled' : 'Disabled'."\n");
287
+	$return .= 'Memory Limit:             '.ini_get('memory_limit')."\n";
288
+	$return .= 'Upload Max Size:          '.ini_get('upload_max_filesize')."\n";
289
+	$return .= 'Post Max Size:            '.ini_get('post_max_size')."\n";
290
+	$return .= 'Upload Max Filesize:      '.ini_get('upload_max_filesize')."\n";
291
+	$return .= 'Time Limit:               '.ini_get('max_execution_time')."\n";
292
+	$return .= 'Max Input Vars:           '.ini_get('max_input_vars')."\n";
293
+	$return .= 'URL-aware fopen:          '.(ini_get('allow_url_fopen') ? 'On ('.ini_get('allow_url_fopen').')' : 'N/A')."\n";
294
+	$return .= 'Display Errors:           '.(ini_get('display_errors') ? 'On ('.ini_get('display_errors').')' : 'N/A')."\n";
295
+
296
+	$return = apply_filters('give_sysinfo_after_php_config', $return);
297 297
 
298 298
 	// PHP extensions and such
299
-	$return .= "\n" . '-- PHP Extensions' . "\n\n";
300
-	$return .= 'cURL:                     ' . ( function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported' ) . "\n";
299
+	$return .= "\n".'-- PHP Extensions'."\n\n";
300
+	$return .= 'cURL:                     '.(function_exists('curl_init') ? 'Supported' : 'Not Supported')."\n";
301 301
 
302 302
 	//cURL version
303
-	if ( function_exists( 'curl_init' ) && function_exists( 'curl_version' ) ) {
303
+	if (function_exists('curl_init') && function_exists('curl_version')) {
304 304
 		$curl_values = curl_version();
305
-		$return .= 'cURL Version:             ' . $curl_values["version"] . "\n";
305
+		$return .= 'cURL Version:             '.$curl_values["version"]."\n";
306 306
 	}
307
-	$return .= 'zlib:                     ' . ( function_exists( 'gzcompress' ) ? 'Supported' : 'Not Supported' ) . "\n";
308
-	$return .= 'GD:                       ' . ( ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ) ? 'Supported' : 'Not Supported' ) . "\n";
309
-	$return .= 'fsockopen:                ' . ( function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported' ) . "\n";
310
-	$return .= 'SOAP Client:              ' . ( class_exists( 'SoapClient' ) ? 'Installed' : 'Not Installed' ) . "\n";
311
-	$return .= 'Suhosin:                  ' . ( extension_loaded( 'suhosin' ) ? 'Installed' : 'Not Installed' ) . "\n";
312
-	$return .= 'DOM:                      ' . ( extension_loaded( 'dom' ) ? 'Installed' : 'Not Installed' ) . "\n";
313
-	$return .= 'MBString:                 ' . ( extension_loaded( 'mbstring' ) ? 'Installed' : 'Not Installed' ) . "\n";
307
+	$return .= 'zlib:                     '.(function_exists('gzcompress') ? 'Supported' : 'Not Supported')."\n";
308
+	$return .= 'GD:                       '.((extension_loaded('gd') && function_exists('gd_info')) ? 'Supported' : 'Not Supported')."\n";
309
+	$return .= 'fsockopen:                '.(function_exists('fsockopen') ? 'Supported' : 'Not Supported')."\n";
310
+	$return .= 'SOAP Client:              '.(class_exists('SoapClient') ? 'Installed' : 'Not Installed')."\n";
311
+	$return .= 'Suhosin:                  '.(extension_loaded('suhosin') ? 'Installed' : 'Not Installed')."\n";
312
+	$return .= 'DOM:                      '.(extension_loaded('dom') ? 'Installed' : 'Not Installed')."\n";
313
+	$return .= 'MBString:                 '.(extension_loaded('mbstring') ? 'Installed' : 'Not Installed')."\n";
314 314
 
315
-	$return = apply_filters( 'give_sysinfo_after_php_ext', $return );
315
+	$return = apply_filters('give_sysinfo_after_php_ext', $return);
316 316
 
317 317
 	// Session stuff
318
-	$return .= "\n" . '-- Session Configuration' . "\n\n";
319
-	$return .= 'Give Use Sessions:        ' . ( defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? 'Enforced' : ( Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled' ) ) . "\n";
320
-	$return .= 'Session:                  ' . ( isset( $_SESSION ) ? 'Enabled' : 'Disabled' ) . "\n";
318
+	$return .= "\n".'-- Session Configuration'."\n\n";
319
+	$return .= 'Give Use Sessions:        '.(defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? 'Enforced' : (Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled'))."\n";
320
+	$return .= 'Session:                  '.(isset($_SESSION) ? 'Enabled' : 'Disabled')."\n";
321 321
 
322 322
 	// The rest of this is only relevant is session is enabled
323
-	if ( isset( $_SESSION ) ) {
324
-		$return .= 'Session Name:             ' . esc_html( ini_get( 'session.name' ) ) . "\n";
325
-		$return .= 'Cookie Path:              ' . esc_html( ini_get( 'session.cookie_path' ) ) . "\n";
326
-		$return .= 'Save Path:                ' . esc_html( ini_get( 'session.save_path' ) ) . "\n";
327
-		$return .= 'Use Cookies:              ' . ( ini_get( 'session.use_cookies' ) ? 'On' : 'Off' ) . "\n";
328
-		$return .= 'Use Only Cookies:         ' . ( ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off' ) . "\n";
323
+	if (isset($_SESSION)) {
324
+		$return .= 'Session Name:             '.esc_html(ini_get('session.name'))."\n";
325
+		$return .= 'Cookie Path:              '.esc_html(ini_get('session.cookie_path'))."\n";
326
+		$return .= 'Save Path:                '.esc_html(ini_get('session.save_path'))."\n";
327
+		$return .= 'Use Cookies:              '.(ini_get('session.use_cookies') ? 'On' : 'Off')."\n";
328
+		$return .= 'Use Only Cookies:         '.(ini_get('session.use_only_cookies') ? 'On' : 'Off')."\n";
329 329
 	}
330 330
 
331
-	$return = apply_filters( 'give_sysinfo_after_session_config', $return );
331
+	$return = apply_filters('give_sysinfo_after_session_config', $return);
332 332
 
333
-	$return .= "\n" . '### End System Info ###';
333
+	$return .= "\n".'### End System Info ###';
334 334
 
335 335
 	return $return;
336 336
 }
@@ -344,17 +344,17 @@  discard block
 block discarded – undo
344 344
  */
345 345
 function give_tools_sysinfo_download() {
346 346
 
347
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
347
+	if ( ! current_user_can('manage_give_settings')) {
348 348
 		return;
349 349
 	}
350 350
 
351 351
 	nocache_headers();
352 352
 
353
-	header( 'Content-Type: text/plain' );
354
-	header( 'Content-Disposition: attachment; filename="give-system-info.txt"' );
353
+	header('Content-Type: text/plain');
354
+	header('Content-Disposition: attachment; filename="give-system-info.txt"');
355 355
 
356
-	echo wp_strip_all_tags( $_POST['give-sysinfo'] );
356
+	echo wp_strip_all_tags($_POST['give-sysinfo']);
357 357
 	give_die();
358 358
 }
359 359
 
360
-add_action( 'give_download_sysinfo', 'give_tools_sysinfo_download' );
361 360
\ No newline at end of file
361
+add_action('give_download_sysinfo', 'give_tools_sysinfo_download');
362 362
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/class-give-settings.php 1 patch
Spacing   +311 added lines, -311 removed lines patch added patch discarded remove patch
@@ -49,26 +49,26 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function __construct() {
51 51
 
52
-		add_action( 'admin_init', array( $this, 'init' ) );
52
+		add_action('admin_init', array($this, 'init'));
53 53
 
54 54
 		//Customize CMB2 URL
55
-		add_filter( 'cmb2_meta_box_url', array( $this, 'give_update_cmb_meta_box_url' ) );
55
+		add_filter('cmb2_meta_box_url', array($this, 'give_update_cmb_meta_box_url'));
56 56
 
57 57
 		//Custom CMB2 Settings Fields
58
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
59
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
60
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
61
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
62
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
63
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
64
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
65
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
66
-		add_action( 'admin_notices', array( $this, 'settings_notices' ) );
58
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
59
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
60
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
61
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
62
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
63
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
64
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
65
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
66
+		add_action('admin_notices', array($this, 'settings_notices'));
67 67
 
68 68
 		// Include CMB CSS in the head to avoid FOUC
69
-		add_action( 'admin_print_styles-give_forms_page_give-settings', array( 'CMB2_hookup', 'enqueue_cmb_css' ) );
69
+		add_action('admin_print_styles-give_forms_page_give-settings', array('CMB2_hookup', 'enqueue_cmb_css'));
70 70
 
71
-		add_filter( 'cmb2_get_metabox_form_format', array( $this, 'give_modify_cmb2_form_output' ), 10, 3 );
71
+		add_filter('cmb2_get_metabox_form_format', array($this, 'give_modify_cmb2_form_output'), 10, 3);
72 72
 
73 73
 	}
74 74
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * @since  1.0
79 79
 	 */
80 80
 	public function init() {
81
-		register_setting( $this->key, $this->key );
81
+		register_setting($this->key, $this->key);
82 82
 
83 83
 	}
84 84
 
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 	 *
93 93
 	 * @return mixed
94 94
 	 */
95
-	public function give_update_cmb_meta_box_url( $url ) {
95
+	public function give_update_cmb_meta_box_url($url) {
96 96
 		//Path to Give's CMB
97
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
97
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
98 98
 	}
99 99
 
100 100
 
@@ -106,27 +106,27 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function give_get_settings_tabs() {
108 108
 
109
-		$settings = $this->give_settings( null );
109
+		$settings = $this->give_settings(null);
110 110
 
111 111
 		$tabs             = array();
112
-		$tabs['general']  = __( 'General', 'give' );
113
-		$tabs['gateways'] = __( 'Payment Gateways', 'give' );
114
-		$tabs['display']  = __( 'Display Options', 'give' );
115
-		$tabs['emails']   = __( 'Emails', 'give' );
112
+		$tabs['general']  = __('General', 'give');
113
+		$tabs['gateways'] = __('Payment Gateways', 'give');
114
+		$tabs['display']  = __('Display Options', 'give');
115
+		$tabs['emails']   = __('Emails', 'give');
116 116
 
117
-		if ( ! empty( $settings['addons']['fields'] ) ) {
118
-			$tabs['addons'] = __( 'Add-ons', 'give' );
117
+		if ( ! empty($settings['addons']['fields'])) {
118
+			$tabs['addons'] = __('Add-ons', 'give');
119 119
 		}
120 120
 
121
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
122
-			$tabs['licenses'] = __( 'Licenses', 'give' );
121
+		if ( ! empty($settings['licenses']['fields'])) {
122
+			$tabs['licenses'] = __('Licenses', 'give');
123 123
 		}
124 124
 
125
-		$tabs['advanced']    = __( 'Advanced', 'give' );
126
-		$tabs['api']         = __( 'API', 'give' );
127
-		$tabs['system_info'] = __( 'System Info', 'give' );
125
+		$tabs['advanced']    = __('Advanced', 'give');
126
+		$tabs['api']         = __('API', 'give');
127
+		$tabs['system_info'] = __('System Info', 'give');
128 128
 
129
-		return apply_filters( 'give_settings_tabs', $tabs );
129
+		return apply_filters('give_settings_tabs', $tabs);
130 130
 	}
131 131
 
132 132
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 */
137 137
 	public function admin_page_display() {
138 138
 
139
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
139
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
140 140
 
141 141
 		?>
142 142
 
@@ -144,20 +144,20 @@  discard block
 block discarded – undo
144 144
 
145 145
 			<h1 class="nav-tab-wrapper">
146 146
 				<?php
147
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
147
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
148 148
 
149 149
 					//Support legacy tab creation conditions based off $_GET parameter
150 150
 					//We pass the $_GET['tab'] to conditions executed later
151 151
 					$_GET['tab'] = $tab_id;
152 152
 
153
-					$tab_url = esc_url( add_query_arg( array(
153
+					$tab_url = esc_url(add_query_arg(array(
154 154
 						'settings-updated' => false,
155 155
 						'tab'              => $tab_id
156
-					) ) );
156
+					)));
157 157
 
158
-					$active       = $active_tab == $tab_id ? ' nav-tab-active' : '';
158
+					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
159 159
 
160
-					echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $tab_name ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>';
160
+					echo '<a href="'.esc_url($tab_url).'" title="'.esc_attr($tab_name).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>';
161 161
 
162 162
 				}
163 163
 				?>
@@ -165,20 +165,20 @@  discard block
 block discarded – undo
165 165
 
166 166
 			<?php
167 167
 			//Loop through and output settings
168
-			foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
168
+			foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
169 169
 
170 170
 				//Support legacy tab creation conditions based off $_GET parameter
171 171
 				//We 'trick' the conditions into thinking this is the tab
172 172
 				$_GET['tab'] = $tab_id;
173 173
 
174
-				$tab_settings = $this->give_settings( $tab_id );
174
+				$tab_settings = $this->give_settings($tab_id);
175 175
 
176 176
 				//Pass active tab within $tab_settings so we can hide with CSS via PHP
177
-				if ( $active_tab == $tab_id ) {
177
+				if ($active_tab == $tab_id) {
178 178
 					$tab_settings['active_tab'] = true;
179 179
 				}
180 180
 
181
-				cmb2_metabox_form( $tab_settings, $this->key );
181
+				cmb2_metabox_form($tab_settings, $this->key);
182 182
 
183 183
 			} ?>
184 184
 
@@ -196,34 +196,34 @@  discard block
 block discarded – undo
196 196
 	 * @since 1.5 Modified to CSS hide non-active tabs
197 197
 	 * @since 1.0
198 198
 	 */
199
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
199
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
200 200
 
201 201
 
202
-		$pagenow = isset( $_GET['page'] ) ? $_GET['page'] : '';
202
+		$pagenow = isset($_GET['page']) ? $_GET['page'] : '';
203 203
 
204 204
 		//only modify the give settings form
205
-		if ( 'give_settings' == $object_id && $pagenow == 'give-settings' ) {
205
+		if ('give_settings' == $object_id && $pagenow == 'give-settings') {
206 206
 
207 207
 			$style = '';
208
-			if ( ! isset( $cmb->meta_box['active_tab'] ) ) {
208
+			if ( ! isset($cmb->meta_box['active_tab'])) {
209 209
 				$style = 'style="display:none;"';
210 210
 			}
211 211
 
212 212
 			//Set ID based off tab name - protects backwards compatibility
213
-			$tab_id = isset( $_GET['tab'] ) ? $_GET['tab'] : $cmb->meta_box['id'];
213
+			$tab_id = isset($_GET['tab']) ? $_GET['tab'] : $cmb->meta_box['id'];
214 214
 
215
-			$save_button = apply_filters( 'give_save_button_markup', '<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . __( 'Save Settings', 'give' ) . '" class="button-primary"></div>' );
215
+			$save_button = apply_filters('give_save_button_markup', '<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.__('Save Settings', 'give').'" class="button-primary"></div>');
216 216
 
217 217
 			//Filter so some tabs won't have save settings
218
-			$no_save_button = apply_filters( 'give_settings_no_save_output', array(
218
+			$no_save_button = apply_filters('give_settings_no_save_output', array(
219 219
 				'system_info'
220
-			) );
220
+			));
221 221
 
222
-			if ( in_array( $tab_id, $no_save_button ) ) {
222
+			if (in_array($tab_id, $no_save_button)) {
223 223
 				$save_button = '';
224 224
 			}
225 225
 
226
-			$form_format = '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data" ' . $style . ' data-tab="' . $tab_id . '"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s' . $save_button . '</form>';
226
+			$form_format = '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data" '.$style.' data-tab="'.$tab_id.'"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s'.$save_button.'</form>';
227 227
 
228 228
 		}
229 229
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	 *
241 241
 	 * @return array
242 242
 	 */
243
-	public function give_settings( $active_tab ) {
243
+	public function give_settings($active_tab) {
244 244
 
245 245
 		$give_settings = array(
246 246
 			/**
@@ -248,60 +248,60 @@  discard block
 block discarded – undo
248 248
 			 */
249 249
 			'general'     => array(
250 250
 				'id'         => 'general_settings',
251
-				'give_title' => __( 'General Settings', 'give' ),
252
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
253
-				'fields'     => apply_filters( 'give_settings_general', array(
251
+				'give_title' => __('General Settings', 'give'),
252
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
253
+				'fields'     => apply_filters('give_settings_general', array(
254 254
 						array(
255
-							'name' => __( 'General Settings', 'give' ),
255
+							'name' => __('General Settings', 'give'),
256 256
 							'desc' => '',
257 257
 							'type' => 'give_title',
258 258
 							'id'   => 'give_title_general_settings_1'
259 259
 						),
260 260
 						array(
261
-							'name'    => __( 'Success Page', 'give' ),
262
-							'desc'    => sprintf( __( 'This is the page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
261
+							'name'    => __('Success Page', 'give'),
262
+							'desc'    => sprintf(__('This is the page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
263 263
 							'id'      => 'success_page',
264 264
 							'type'    => 'select',
265
-							'options' => give_cmb2_get_post_options( array(
265
+							'options' => give_cmb2_get_post_options(array(
266 266
 								'post_type'   => 'page',
267
-								'numberposts' => - 1
268
-							) ),
267
+								'numberposts' => -1
268
+							)),
269 269
 						),
270 270
 						array(
271
-							'name'    => __( 'Failed Transaction Page', 'give' ),
272
-							'desc'    => __( 'This is the page donors are sent to if their transaction is cancelled or fails.', 'give' ),
271
+							'name'    => __('Failed Transaction Page', 'give'),
272
+							'desc'    => __('This is the page donors are sent to if their transaction is cancelled or fails.', 'give'),
273 273
 							'id'      => 'failure_page',
274 274
 							'type'    => 'select',
275
-							'options' => give_cmb2_get_post_options( array(
275
+							'options' => give_cmb2_get_post_options(array(
276 276
 								'post_type'   => 'page',
277
-								'numberposts' => - 1
278
-							) ),
277
+								'numberposts' => -1
278
+							)),
279 279
 						),
280 280
 						array(
281
-							'name'    => __( 'Donation History Page', 'give' ),
282
-							'desc'    => sprintf( __( 'This page shows a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
281
+							'name'    => __('Donation History Page', 'give'),
282
+							'desc'    => sprintf(__('This page shows a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
283 283
 							'id'      => 'history_page',
284 284
 							'type'    => 'select',
285
-							'options' => give_cmb2_get_post_options( array(
285
+							'options' => give_cmb2_get_post_options(array(
286 286
 								'post_type'   => 'page',
287
-								'numberposts' => - 1
288
-							) ),
287
+								'numberposts' => -1
288
+							)),
289 289
 						),
290 290
 						array(
291
-							'name'    => __( 'Base Country', 'give' ),
292
-							'desc'    => __( 'Where does your site operate from?', 'give' ),
291
+							'name'    => __('Base Country', 'give'),
292
+							'desc'    => __('Where does your site operate from?', 'give'),
293 293
 							'id'      => 'base_country',
294 294
 							'type'    => 'select',
295 295
 							'options' => give_get_country_list(),
296 296
 						),
297 297
 						array(
298
-							'name' => __( 'Currency Settings', 'give' ),
298
+							'name' => __('Currency Settings', 'give'),
299 299
 							'desc' => '',
300 300
 							'type' => 'give_title',
301 301
 							'id'   => 'give_title_general_settings_2'
302 302
 						),
303 303
 						array(
304
-							'name'    => __( 'Currency', 'give' ),
304
+							'name'    => __('Currency', 'give'),
305 305
 							'desc'    => 'Choose your currency. Note that some payment gateways have currency restrictions.',
306 306
 							'id'      => 'currency',
307 307
 							'type'    => 'select',
@@ -309,26 +309,26 @@  discard block
 block discarded – undo
309 309
 							'default' => 'USD',
310 310
 						),
311 311
 						array(
312
-							'name'    => __( 'Currency Position', 'give' ),
312
+							'name'    => __('Currency Position', 'give'),
313 313
 							'desc'    => 'Choose the position of the currency sign.',
314 314
 							'id'      => 'currency_position',
315 315
 							'type'    => 'select',
316 316
 							'options' => array(
317
-								'before' => sprintf( __( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
318
-								'after'  => sprintf( __( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) )
317
+								'before' => sprintf(__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
318
+								'after'  => sprintf(__('After - 10%s', 'give'), give_currency_symbol(give_get_currency()))
319 319
 							),
320 320
 							'default' => 'before',
321 321
 						),
322 322
 						array(
323
-							'name'    => __( 'Thousands Separator', 'give' ),
324
-							'desc'    => __( 'The symbol (typically , or .) to separate thousands.', 'give' ),
323
+							'name'    => __('Thousands Separator', 'give'),
324
+							'desc'    => __('The symbol (typically , or .) to separate thousands.', 'give'),
325 325
 							'id'      => 'thousands_separator',
326 326
 							'type'    => 'text_small',
327 327
 							'default' => ',',
328 328
 						),
329 329
 						array(
330
-							'name'    => __( 'Decimal Separator', 'give' ),
331
-							'desc'    => __( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
330
+							'name'    => __('Decimal Separator', 'give'),
331
+							'desc'    => __('The symbol (usually , or .) to separate decimal points.', 'give'),
332 332
 							'id'      => 'decimal_separator',
333 333
 							'type'    => 'text_small',
334 334
 							'default' => '.',
@@ -341,83 +341,83 @@  discard block
 block discarded – undo
341 341
 			 */
342 342
 			'gateways'    => array(
343 343
 				'id'         => 'payment_gateways',
344
-				'give_title' => __( 'Payment Gateways', 'give' ),
345
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
346
-				'fields'     => apply_filters( 'give_settings_gateways', array(
344
+				'give_title' => __('Payment Gateways', 'give'),
345
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
346
+				'fields'     => apply_filters('give_settings_gateways', array(
347 347
 						array(
348
-							'name' => __( 'Gateways Settings', 'give' ),
348
+							'name' => __('Gateways Settings', 'give'),
349 349
 							'desc' => '',
350 350
 							'id'   => 'give_title_gateway_settings_1',
351 351
 							'type' => 'give_title'
352 352
 						),
353 353
 						array(
354
-							'name' => __( 'Test Mode', 'give' ),
355
-							'desc' => __( 'While in test mode no live transactions are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
354
+							'name' => __('Test Mode', 'give'),
355
+							'desc' => __('While in test mode no live transactions are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
356 356
 							'id'   => 'test_mode',
357 357
 							'type' => 'checkbox'
358 358
 						),
359 359
 						array(
360
-							'name' => __( 'Enabled Gateways', 'give' ),
361
-							'desc' => __( 'Choose the payment gateways you would like enabled. You can drag-and-drop payment gateways to reorder them.', 'give' ),
360
+							'name' => __('Enabled Gateways', 'give'),
361
+							'desc' => __('Choose the payment gateways you would like enabled. You can drag-and-drop payment gateways to reorder them.', 'give'),
362 362
 							'id'   => 'gateways',
363 363
 							'type' => 'enabled_gateways'
364 364
 						),
365 365
 						array(
366
-							'name' => __( 'Default Gateway', 'give' ),
367
-							'desc' => __( 'This is the gateway that will be selected by default.', 'give' ),
366
+							'name' => __('Default Gateway', 'give'),
367
+							'desc' => __('This is the gateway that will be selected by default.', 'give'),
368 368
 							'id'   => 'default_gateway',
369 369
 							'type' => 'default_gateway'
370 370
 						),
371 371
 						array(
372
-							'name' => __( 'PayPal Standard', 'give' ),
372
+							'name' => __('PayPal Standard', 'give'),
373 373
 							'desc' => '',
374 374
 							'type' => 'give_title',
375 375
 							'id'   => 'give_title_gateway_settings_2',
376 376
 						),
377 377
 						array(
378
-							'name' => __( 'PayPal Email', 'give' ),
379
-							'desc' => __( 'Enter your PayPal account\'s email.', 'give' ),
378
+							'name' => __('PayPal Email', 'give'),
379
+							'desc' => __('Enter your PayPal account\'s email.', 'give'),
380 380
 							'id'   => 'paypal_email',
381 381
 							'type' => 'text_email',
382 382
 						),
383 383
 						array(
384
-							'name' => __( 'PayPal Page Style', 'give' ),
385
-							'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
384
+							'name' => __('PayPal Page Style', 'give'),
385
+							'desc' => __('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
386 386
 							'id'   => 'paypal_page_style',
387 387
 							'type' => 'text',
388 388
 						),
389 389
 						array(
390
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
391
-							'desc'    => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
390
+							'name'    => __('PayPal Transaction Type', 'give'),
391
+							'desc'    => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
392 392
 							'id'      => 'paypal_button_type',
393 393
 							'type'    => 'radio_inline',
394 394
 							'options' => array(
395
-								'donation' => __( 'Donation', 'give' ),
396
-								'standard' => __( 'Standard Transaction', 'give' )
395
+								'donation' => __('Donation', 'give'),
396
+								'standard' => __('Standard Transaction', 'give')
397 397
 							),
398 398
 							'default' => 'donation',
399 399
 						),
400 400
 						array(
401
-							'name' => __( 'Disable PayPal IPN Verification', 'give' ),
402
-							'desc' => __( 'If donations are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying donations.', 'give' ),
401
+							'name' => __('Disable PayPal IPN Verification', 'give'),
402
+							'desc' => __('If donations are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying donations.', 'give'),
403 403
 							'id'   => 'disable_paypal_verification',
404 404
 							'type' => 'checkbox'
405 405
 						),
406 406
 						array(
407
-							'name' => __( 'Offline Donations', 'give' ),
407
+							'name' => __('Offline Donations', 'give'),
408 408
 							'desc' => '',
409 409
 							'type' => 'give_title',
410 410
 							'id'   => 'give_title_gateway_settings_3',
411 411
 						),
412 412
 						array(
413
-							'name' => __( 'Collect Billing Details', 'give' ),
414
-							'desc' => __( 'This option will enable the billing details section for offline donations. The fieldset will appear above the offline donation instructions. Note: You may customize this option per form as needed.', 'give' ),
413
+							'name' => __('Collect Billing Details', 'give'),
414
+							'desc' => __('This option will enable the billing details section for offline donations. The fieldset will appear above the offline donation instructions. Note: You may customize this option per form as needed.', 'give'),
415 415
 							'id'   => 'give_offline_donation_enable_billing_fields',
416 416
 							'type' => 'checkbox'
417 417
 						),
418 418
 						array(
419
-							'name'    => __( 'Offline Donation Instructions', 'give' ),
420
-							'desc'    => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
419
+							'name'    => __('Offline Donation Instructions', 'give'),
420
+							'desc'    => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
421 421
 							'id'      => 'global_offline_donation_content',
422 422
 							'default' => give_get_default_offline_donation_content(),
423 423
 							'type'    => 'wysiwyg',
@@ -426,15 +426,15 @@  discard block
 block discarded – undo
426 426
 							)
427 427
 						),
428 428
 						array(
429
-							'name'    => __( 'Offline Donation Email Instructions Subject', 'give' ),
430
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
429
+							'name'    => __('Offline Donation Email Instructions Subject', 'give'),
430
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
431 431
 							'id'      => 'offline_donation_subject',
432
-							'default' => __( '{donation} - Offline Donation Instructions', 'give' ),
432
+							'default' => __('{donation} - Offline Donation Instructions', 'give'),
433 433
 							'type'    => 'text'
434 434
 						),
435 435
 						array(
436
-							'name'    => __( 'Offline Donation Email Instructions', 'give' ),
437
-							'desc'    => __( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
436
+							'name'    => __('Offline Donation Email Instructions', 'give'),
437
+							'desc'    => __('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
438 438
 							'id'      => 'global_offline_donation_email',
439 439
 							'default' => give_get_default_offline_donation_email_content(),
440 440
 							'type'    => 'wysiwyg',
@@ -448,93 +448,93 @@  discard block
 block discarded – undo
448 448
 			/** Display Settings */
449 449
 			'display'     => array(
450 450
 				'id'         => 'display_settings',
451
-				'give_title' => __( 'Display Settings', 'give' ),
452
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
453
-				'fields'     => apply_filters( 'give_settings_display', array(
451
+				'give_title' => __('Display Settings', 'give'),
452
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
453
+				'fields'     => apply_filters('give_settings_display', array(
454 454
 						array(
455
-							'name' => __( 'Display Settings', 'give' ),
455
+							'name' => __('Display Settings', 'give'),
456 456
 							'desc' => '',
457 457
 							'id'   => 'give_title_display_settings_1',
458 458
 							'type' => 'give_title'
459 459
 						),
460 460
 						array(
461
-							'name' => __( 'Disable CSS', 'give' ),
462
-							'desc' => __( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
461
+							'name' => __('Disable CSS', 'give'),
462
+							'desc' => __('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
463 463
 							'id'   => 'disable_css',
464 464
 							'type' => 'checkbox'
465 465
 						),
466 466
 						array(
467
-							'name' => __( 'Enable Floating Labels', 'give' ),
468
-							'desc' => sprintf( esc_html__( 'Enable this option if you would like to enable %1$sfloating labels%2$s in Give\'s donation forms. %3$sBe aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), '<a href="' . esc_url( "http://bradfrost.com/blog/post/float-label-pattern/" ) . '" target="_blank">', '</a>', '<br />' ),
467
+							'name' => __('Enable Floating Labels', 'give'),
468
+							'desc' => sprintf(esc_html__('Enable this option if you would like to enable %1$sfloating labels%2$s in Give\'s donation forms. %3$sBe aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), '<a href="'.esc_url("http://bradfrost.com/blog/post/float-label-pattern/").'" target="_blank">', '</a>', '<br />'),
469 469
 							'id'   => 'enable_floatlabels',
470 470
 							'type' => 'checkbox'
471 471
 						),
472 472
 						array(
473
-							'name' => __( 'Disable Welcome Screen', 'give' ),
474
-							'desc' => sprintf( esc_html__( 'Enable this option if you would like to disable the Give Welcome screen every time Give is activated and/or updated. You can always access the <a href="%s">Welcome Screen</a> if you want in the future.', 'give' ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
473
+							'name' => __('Disable Welcome Screen', 'give'),
474
+							'desc' => sprintf(esc_html__('Enable this option if you would like to disable the Give Welcome screen every time Give is activated and/or updated. You can always access the <a href="%s">Welcome Screen</a> if you want in the future.', 'give'), esc_url(admin_url('index.php?page=give-about'))),
475 475
 							'id'   => 'disable_welcome',
476 476
 							'type' => 'checkbox'
477 477
 						),
478 478
 						array(
479
-							'name' => __( 'Post Types', 'give' ),
479
+							'name' => __('Post Types', 'give'),
480 480
 							'desc' => '',
481 481
 							'id'   => 'give_title_display_settings_2',
482 482
 							'type' => 'give_title'
483 483
 						),
484 484
 						array(
485
-							'name' => __( 'Disable Form Single Views', 'give' ),
486
-							'desc' => __( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
485
+							'name' => __('Disable Form Single Views', 'give'),
486
+							'desc' => __('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
487 487
 							'id'   => 'disable_forms_singular',
488 488
 							'type' => 'checkbox'
489 489
 						),
490 490
 						array(
491
-							'name' => __( 'Disable Form Archives', 'give' ),
492
-							'desc' => __( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
491
+							'name' => __('Disable Form Archives', 'give'),
492
+							'desc' => __('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
493 493
 							'id'   => 'disable_forms_archives',
494 494
 							'type' => 'checkbox'
495 495
 						),
496 496
 						array(
497
-							'name' => __( 'Disable Form Excerpts', 'give' ),
498
-							'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
497
+							'name' => __('Disable Form Excerpts', 'give'),
498
+							'desc' => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
499 499
 							'id'   => 'disable_forms_excerpt',
500 500
 							'type' => 'checkbox'
501 501
 						),
502 502
 
503 503
 						array(
504
-							'name'    => __( 'Featured Image Size', 'give' ),
505
-							'desc'    => __( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation forms\' featured image.', 'give' ),
504
+							'name'    => __('Featured Image Size', 'give'),
505
+							'desc'    => __('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation forms\' featured image.', 'give'),
506 506
 							'id'      => 'featured_image_size',
507 507
 							'type'    => 'select',
508 508
 							'default' => 'large',
509 509
 							'options' => give_get_featured_image_sizes()
510 510
 						),
511 511
 						array(
512
-							'name' => __( 'Disable Form Featured Image', 'give' ),
513
-							'desc' => __( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
512
+							'name' => __('Disable Form Featured Image', 'give'),
513
+							'desc' => __('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
514 514
 							'id'   => 'disable_form_featured_img',
515 515
 							'type' => 'checkbox'
516 516
 						),
517 517
 						array(
518
-							'name' => __( 'Disable Single Form Sidebar', 'give' ),
519
-							'desc' => __( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
518
+							'name' => __('Disable Single Form Sidebar', 'give'),
519
+							'desc' => __('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
520 520
 							'id'   => 'disable_form_sidebar',
521 521
 							'type' => 'checkbox'
522 522
 						),
523 523
 						array(
524
-							'name' => __( 'Taxonomies', 'give' ),
524
+							'name' => __('Taxonomies', 'give'),
525 525
 							'desc' => '',
526 526
 							'id'   => 'give_title_display_settings_3',
527 527
 							'type' => 'give_title'
528 528
 						),
529 529
 						array(
530
-							'name' => __( 'Enable Form Categories', 'give' ),
531
-							'desc' => __( 'Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give' ),
530
+							'name' => __('Enable Form Categories', 'give'),
531
+							'desc' => __('Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give'),
532 532
 							'id'   => 'enable_categories',
533 533
 							'type' => 'checkbox'
534 534
 						),
535 535
 						array(
536
-							'name' => __( 'Enable Form Tags', 'give' ),
537
-							'desc' => __( 'Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give' ),
536
+							'name' => __('Enable Form Tags', 'give'),
537
+							'desc' => __('Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give'),
538 538
 							'id'   => 'enable_tags',
539 539
 							'type' => 'checkbox'
540 540
 						),
@@ -547,93 +547,93 @@  discard block
 block discarded – undo
547 547
 			 */
548 548
 			'emails'      => array(
549 549
 				'id'         => 'email_settings',
550
-				'give_title' => __( 'Email Settings', 'give' ),
551
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
552
-				'fields'     => apply_filters( 'give_settings_emails', array(
550
+				'give_title' => __('Email Settings', 'give'),
551
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
552
+				'fields'     => apply_filters('give_settings_emails', array(
553 553
 						array(
554
-							'name' => __( 'Email Settings', 'give' ),
554
+							'name' => __('Email Settings', 'give'),
555 555
 							'desc' => '',
556 556
 							'id'   => 'give_title_email_settings_1',
557 557
 							'type' => 'give_title'
558 558
 						),
559 559
 						array(
560 560
 							'id'      => 'email_template',
561
-							'name'    => __( 'Email Template', 'give' ),
562
-							'desc'    => __( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
561
+							'name'    => __('Email Template', 'give'),
562
+							'desc'    => __('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
563 563
 							'type'    => 'select',
564 564
 							'options' => give_get_email_templates()
565 565
 						),
566 566
 						array(
567 567
 							'id'   => 'email_logo',
568
-							'name' => __( 'Logo', 'give' ),
569
-							'desc' => __( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
568
+							'name' => __('Logo', 'give'),
569
+							'desc' => __('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
570 570
 							'type' => 'file'
571 571
 						),
572 572
 						array(
573 573
 							'id'      => 'from_name',
574
-							'name'    => __( 'From Name', 'give' ),
575
-							'desc'    => __( 'The name donation receipts are said to come from. This should probably be your site or shop name.', 'give' ),
576
-							'default' => get_bloginfo( 'name' ),
574
+							'name'    => __('From Name', 'give'),
575
+							'desc'    => __('The name donation receipts are said to come from. This should probably be your site or shop name.', 'give'),
576
+							'default' => get_bloginfo('name'),
577 577
 							'type'    => 'text'
578 578
 						),
579 579
 						array(
580 580
 							'id'      => 'from_email',
581
-							'name'    => __( 'From Email', 'give' ),
582
-							'desc'    => __( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
583
-							'default' => get_bloginfo( 'admin_email' ),
581
+							'name'    => __('From Email', 'give'),
582
+							'desc'    => __('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
583
+							'default' => get_bloginfo('admin_email'),
584 584
 							'type'    => 'text'
585 585
 						),
586 586
 						array(
587
-							'name' => __( 'Donation Receipt', 'give' ),
587
+							'name' => __('Donation Receipt', 'give'),
588 588
 							'desc' => '',
589 589
 							'id'   => 'give_title_email_settings_2',
590 590
 							'type' => 'give_title'
591 591
 						),
592 592
 						array(
593 593
 							'id'      => 'donation_subject',
594
-							'name'    => __( 'Donation Email Subject', 'give' ),
595
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
596
-							'default' => __( 'Donation Receipt', 'give' ),
594
+							'name'    => __('Donation Email Subject', 'give'),
595
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
596
+							'default' => __('Donation Receipt', 'give'),
597 597
 							'type'    => 'text'
598 598
 						),
599 599
 						array(
600 600
 							'id'      => 'donation_receipt',
601
-							'name'    => __( 'Donation Receipt', 'give' ),
602
-							'desc'    => sprintf( __( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ), give_get_emails_tags_list() ) . '<br/>',
601
+							'name'    => __('Donation Receipt', 'give'),
602
+							'desc'    => sprintf(__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'), give_get_emails_tags_list()).'<br/>',
603 603
 							'type'    => 'wysiwyg',
604 604
 							'default' => give_get_default_donation_receipt_email()
605 605
 						),
606 606
 						array(
607
-							'name' => __( 'New Donation Notification', 'give' ),
607
+							'name' => __('New Donation Notification', 'give'),
608 608
 							'desc' => '',
609 609
 							'id'   => 'give_title_email_settings_3',
610 610
 							'type' => 'give_title'
611 611
 						),
612 612
 						array(
613 613
 							'id'      => 'donation_notification_subject',
614
-							'name'    => __( 'Donation Notification Subject', 'give' ),
615
-							'desc'    => __( 'Enter the subject line for the donation notification email.', 'give' ),
614
+							'name'    => __('Donation Notification Subject', 'give'),
615
+							'desc'    => __('Enter the subject line for the donation notification email.', 'give'),
616 616
 							'type'    => 'text',
617
-							'default' => __( 'New Donation - #{payment_id}', 'give' )
617
+							'default' => __('New Donation - #{payment_id}', 'give')
618 618
 						),
619 619
 						array(
620 620
 							'id'      => 'donation_notification',
621
-							'name'    => __( 'Donation Notification', 'give' ),
622
-							'desc'    => sprintf( __( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ), give_get_emails_tags_list() ) . '<br/>',
621
+							'name'    => __('Donation Notification', 'give'),
622
+							'desc'    => sprintf(__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'), give_get_emails_tags_list()).'<br/>',
623 623
 							'type'    => 'wysiwyg',
624 624
 							'default' => give_get_default_donation_notification_email()
625 625
 						),
626 626
 						array(
627 627
 							'id'      => 'admin_notice_emails',
628
-							'name'    => __( 'Donation Notification Emails', 'give' ),
629
-							'desc'    => sprintf( __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter %1$sone email address per line%2$s and not separated by commas.', 'give' ), '<span class="give-underline">', '</span>' ),
628
+							'name'    => __('Donation Notification Emails', 'give'),
629
+							'desc'    => sprintf(__('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter %1$sone email address per line%2$s and not separated by commas.', 'give'), '<span class="give-underline">', '</span>'),
630 630
 							'type'    => 'textarea',
631
-							'default' => get_bloginfo( 'admin_email' )
631
+							'default' => get_bloginfo('admin_email')
632 632
 						),
633 633
 						array(
634 634
 							'id'   => 'disable_admin_notices',
635
-							'name' => __( 'Disable Admin Notifications', 'give' ),
636
-							'desc' => __( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
635
+							'name' => __('Disable Admin Notifications', 'give'),
636
+							'desc' => __('Check this box if you do not want to receive emails when new donations are made.', 'give'),
637 637
 							'type' => 'checkbox'
638 638
 						)
639 639
 					)
@@ -642,96 +642,96 @@  discard block
 block discarded – undo
642 642
 			/** Extension Settings */
643 643
 			'addons'      => array(
644 644
 				'id'         => 'addons',
645
-				'give_title' => __( 'Give Add-ons Settings', 'give' ),
646
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
647
-				'fields'     => apply_filters( 'give_settings_addons', array()
645
+				'give_title' => __('Give Add-ons Settings', 'give'),
646
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
647
+				'fields'     => apply_filters('give_settings_addons', array()
648 648
 				)
649 649
 			),
650 650
 			/** Licenses Settings */
651 651
 			'licenses'    => array(
652 652
 				'id'         => 'licenses',
653
-				'give_title' => __( 'Give Licenses', 'give' ),
654
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
655
-				'fields'     => apply_filters( 'give_settings_licenses', array()
653
+				'give_title' => __('Give Licenses', 'give'),
654
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
655
+				'fields'     => apply_filters('give_settings_licenses', array()
656 656
 				)
657 657
 			),
658 658
 			/** Advanced Options */
659 659
 			'advanced'    => array(
660 660
 				'id'         => 'advanced_options',
661
-				'give_title' => __( 'Advanced Options', 'give' ),
662
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
663
-				'fields'     => apply_filters( 'give_settings_advanced', array(
661
+				'give_title' => __('Advanced Options', 'give'),
662
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
663
+				'fields'     => apply_filters('give_settings_advanced', array(
664 664
 						array(
665
-							'name' => __( 'Access Control', 'give' ),
665
+							'name' => __('Access Control', 'give'),
666 666
 							'desc' => '',
667 667
 							'id'   => 'give_title_session_control_1',
668 668
 							'type' => 'give_title'
669 669
 						),
670 670
 						array(
671 671
 							'id'      => 'session_lifetime',
672
-							'name'    => __( 'Session Lifetime', 'give' ),
673
-							'desc'    => __( 'Give will start a new session per user once they have donated. This option controls the lifetime a user\'s session is kept alive. An active session allows users to view donation receipts on your site without having to be logged in as long as they are using the same browser they used when donating.', 'give' ),
672
+							'name'    => __('Session Lifetime', 'give'),
673
+							'desc'    => __('Give will start a new session per user once they have donated. This option controls the lifetime a user\'s session is kept alive. An active session allows users to view donation receipts on your site without having to be logged in as long as they are using the same browser they used when donating.', 'give'),
674 674
 							'type'    => 'select',
675 675
 							'options' => array(
676
-								'86400'  => __( '24 Hours', 'give' ),
677
-								'172800' => __( '48 Hours', 'give' ),
678
-								'259200' => __( '72 Hours', 'give' ),
679
-								'604800' => __( '1 Week', 'give' ),
676
+								'86400'  => __('24 Hours', 'give'),
677
+								'172800' => __('48 Hours', 'give'),
678
+								'259200' => __('72 Hours', 'give'),
679
+								'604800' => __('1 Week', 'give'),
680 680
 							)
681 681
 						),
682 682
 						array(
683
-							'name' => __( 'Email Access', 'give' ),
684
-							'desc' => __( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
683
+							'name' => __('Email Access', 'give'),
684
+							'desc' => __('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
685 685
 							'id'   => 'email_access',
686 686
 							'type' => 'checkbox',
687 687
 						),
688 688
 						array(
689 689
 							'id'      => 'recaptcha_key',
690
-							'name'    => __( 'reCAPTCHA Site Key', 'give' ),
691
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to %1$sthe reCAPTCHA website%2$s and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), '<a href="https://www.google.com/recaptcha/" target="_blank">', '</a>' ),
690
+							'name'    => __('reCAPTCHA Site Key', 'give'),
691
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to %1$sthe reCAPTCHA website%2$s and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), '<a href="https://www.google.com/recaptcha/" target="_blank">', '</a>'),
692 692
 							'default' => '',
693 693
 							'type'    => 'text'
694 694
 						),
695 695
 						array(
696 696
 							'id'      => 'recaptcha_secret',
697
-							'name'    => __( 'reCAPTCHA Secret Key', 'give' ),
698
-							'desc'    => __( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
697
+							'name'    => __('reCAPTCHA Secret Key', 'give'),
698
+							'desc'    => __('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
699 699
 							'default' => '',
700 700
 							'type'    => 'text'
701 701
 						),
702 702
 						array(
703
-							'name' => __( 'Data Control', 'give' ),
703
+							'name' => __('Data Control', 'give'),
704 704
 							'desc' => '',
705 705
 							'id'   => 'give_title_data_control_2',
706 706
 							'type' => 'give_title'
707 707
 						),
708 708
 						array(
709
-							'name' => __( 'Remove All Data on Uninstall?', 'give' ),
710
-							'desc' => __( 'Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give' ),
709
+							'name' => __('Remove All Data on Uninstall?', 'give'),
710
+							'desc' => __('Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give'),
711 711
 							'id'   => 'uninstall_on_delete',
712 712
 							'type' => 'checkbox'
713 713
 						),
714 714
 						array(
715
-							'name' => __( 'Filter Control', 'give' ),
715
+							'name' => __('Filter Control', 'give'),
716 716
 							'desc' => '',
717 717
 							'id'   => 'give_title_filter_control',
718 718
 							'type' => 'give_title'
719 719
 						),
720 720
 						array(
721
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
722
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
721
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
722
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
723 723
 							'id'   => 'disable_the_content_filter',
724 724
 							'type' => 'checkbox'
725 725
 						),
726 726
 						array(
727
-							'name' => __( 'Script Loading', 'give' ),
727
+							'name' => __('Script Loading', 'give'),
728 728
 							'desc' => '',
729 729
 							'id'   => 'give_title_script_control',
730 730
 							'type' => 'give_title'
731 731
 						),
732 732
 						array(
733
-							'name' => __( 'Load Scripts in Footer?', 'give' ),
734
-							'desc' => __( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
733
+							'name' => __('Load Scripts in Footer?', 'give'),
734
+							'desc' => __('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
735 735
 							'id'   => 'scripts_footer',
736 736
 							'type' => 'checkbox'
737 737
 						)
@@ -741,13 +741,13 @@  discard block
 block discarded – undo
741 741
 			/** API Settings */
742 742
 			'api'         => array(
743 743
 				'id'         => 'api',
744
-				'give_title' => __( 'API', 'give' ),
745
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
744
+				'give_title' => __('API', 'give'),
745
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
746 746
 				'show_names' => false, // Hide field names on the left
747
-				'fields'     => apply_filters( 'give_settings_system', array(
747
+				'fields'     => apply_filters('give_settings_system', array(
748 748
 						array(
749 749
 							'id'   => 'api',
750
-							'name' => __( 'API', 'give' ),
750
+							'name' => __('API', 'give'),
751 751
 							'type' => 'api'
752 752
 						)
753 753
 					)
@@ -756,13 +756,13 @@  discard block
 block discarded – undo
756 756
 			/** Licenses Settings */
757 757
 			'system_info' => array(
758 758
 				'id'         => 'system_info',
759
-				'give_title' => __( 'System Info', 'give' ),
760
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
761
-				'fields'     => apply_filters( 'give_settings_system', array(
759
+				'give_title' => __('System Info', 'give'),
760
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
761
+				'fields'     => apply_filters('give_settings_system', array(
762 762
 						array(
763 763
 							'id'   => 'system_info',
764
-							'name' => __( 'System Info', 'give' ),
765
-							'desc' => __( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
764
+							'name' => __('System Info', 'give'),
765
+							'desc' => __('Please copy and paste this information in your ticket when contacting support.', 'give'),
766 766
 							'type' => 'system_info'
767 767
 						)
768 768
 					)
@@ -771,15 +771,15 @@  discard block
 block discarded – undo
771 771
 		);
772 772
 
773 773
 		//Return all settings array if no active tab
774
-		if ( $active_tab === null || ! isset( $give_settings[ $active_tab ] ) ) {
774
+		if ($active_tab === null || ! isset($give_settings[$active_tab])) {
775 775
 
776
-			return apply_filters( 'give_registered_settings', $give_settings );
776
+			return apply_filters('give_registered_settings', $give_settings);
777 777
 			
778 778
 		}
779 779
 
780 780
 
781 781
 		// Add other tabs and settings fields as needed
782
-		return apply_filters( 'give_registered_settings', $give_settings[ $active_tab ] );
782
+		return apply_filters('give_registered_settings', $give_settings[$active_tab]);
783 783
 
784 784
 	}
785 785
 
@@ -788,11 +788,11 @@  discard block
 block discarded – undo
788 788
 	 */
789 789
 	public function settings_notices() {
790 790
 
791
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
791
+		if ( ! isset($_POST['give_settings_saved'])) {
792 792
 			return;
793 793
 		}
794 794
 
795
-		add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' );
795
+		add_settings_error('give-notices', 'global-settings-updated', __('Settings updated.', 'give'), 'updated');
796 796
 
797 797
 	}
798 798
 
@@ -806,17 +806,17 @@  discard block
 block discarded – undo
806 806
 	 *
807 807
 	 * @return mixed          Field value or exception is thrown
808 808
 	 */
809
-	public function __get( $field ) {
809
+	public function __get($field) {
810 810
 
811 811
 		// Allowed fields to retrieve
812
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
812
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
813 813
 			return $this->{$field};
814 814
 		}
815
-		if ( 'option_metabox' === $field ) {
815
+		if ('option_metabox' === $field) {
816 816
 			return $this->option_metabox();
817 817
 		}
818 818
 
819
-		throw new Exception( 'Invalid property: ' . $field );
819
+		throw new Exception('Invalid property: '.$field);
820 820
 	}
821 821
 
822 822
 
@@ -833,12 +833,12 @@  discard block
 block discarded – undo
833 833
  *
834 834
  * @return mixed        Option value
835 835
  */
836
-function give_get_option( $key = '', $default = false ) {
836
+function give_get_option($key = '', $default = false) {
837 837
 	global $give_options;
838
-	$value = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
839
-	$value = apply_filters( 'give_get_option', $value, $key, $default );
838
+	$value = ! empty($give_options[$key]) ? $give_options[$key] : $default;
839
+	$value = apply_filters('give_get_option', $value, $key, $default);
840 840
 
841
-	return apply_filters( 'give_get_option_' . $key, $value, $key, $default );
841
+	return apply_filters('give_get_option_'.$key, $value, $key, $default);
842 842
 }
843 843
 
844 844
 
@@ -856,33 +856,33 @@  discard block
 block discarded – undo
856 856
  *
857 857
  * @return boolean True if updated, false if not.
858 858
  */
859
-function give_update_option( $key = '', $value = false ) {
859
+function give_update_option($key = '', $value = false) {
860 860
 
861 861
 	// If no key, exit
862
-	if ( empty( $key ) ) {
862
+	if (empty($key)) {
863 863
 		return false;
864 864
 	}
865 865
 
866
-	if ( empty( $value ) ) {
867
-		$remove_option = give_delete_option( $key );
866
+	if (empty($value)) {
867
+		$remove_option = give_delete_option($key);
868 868
 
869 869
 		return $remove_option;
870 870
 	}
871 871
 
872 872
 	// First let's grab the current settings
873
-	$options = get_option( 'give_settings' );
873
+	$options = get_option('give_settings');
874 874
 
875 875
 	// Let's let devs alter that value coming in
876
-	$value = apply_filters( 'give_update_option', $value, $key );
876
+	$value = apply_filters('give_update_option', $value, $key);
877 877
 
878 878
 	// Next let's try to update the value
879
-	$options[ $key ] = $value;
880
-	$did_update      = update_option( 'give_settings', $options );
879
+	$options[$key] = $value;
880
+	$did_update      = update_option('give_settings', $options);
881 881
 
882 882
 	// If it updated, let's update the global variable
883
-	if ( $did_update ) {
883
+	if ($did_update) {
884 884
 		global $give_options;
885
-		$give_options[ $key ] = $value;
885
+		$give_options[$key] = $value;
886 886
 	}
887 887
 
888 888
 	return $did_update;
@@ -899,27 +899,27 @@  discard block
 block discarded – undo
899 899
  *
900 900
  * @return boolean True if updated, false if not.
901 901
  */
902
-function give_delete_option( $key = '' ) {
902
+function give_delete_option($key = '') {
903 903
 
904 904
 	// If no key, exit
905
-	if ( empty( $key ) ) {
905
+	if (empty($key)) {
906 906
 		return false;
907 907
 	}
908 908
 
909 909
 	// First let's grab the current settings
910
-	$options = get_option( 'give_settings' );
910
+	$options = get_option('give_settings');
911 911
 
912 912
 	// Next let's try to update the value
913
-	if ( isset( $options[ $key ] ) ) {
913
+	if (isset($options[$key])) {
914 914
 
915
-		unset( $options[ $key ] );
915
+		unset($options[$key]);
916 916
 
917 917
 	}
918 918
 
919
-	$did_update = update_option( 'give_settings', $options );
919
+	$did_update = update_option('give_settings', $options);
920 920
 
921 921
 	// If it updated, let's update the global variable
922
-	if ( $did_update ) {
922
+	if ($did_update) {
923 923
 		global $give_options;
924 924
 		$give_options = $options;
925 925
 	}
@@ -938,9 +938,9 @@  discard block
 block discarded – undo
938 938
  */
939 939
 function give_get_settings() {
940 940
 
941
-	$settings = get_option( 'give_settings' );
941
+	$settings = get_option('give_settings');
942 942
 
943
-	return (array) apply_filters( 'give_get_settings', $settings );
943
+	return (array) apply_filters('give_get_settings', $settings);
944 944
 
945 945
 }
946 946
 
@@ -958,25 +958,25 @@  discard block
 block discarded – undo
958 958
  *
959 959
  * @return array
960 960
  */
961
-function give_settings_array_insert( $array, $position, $insert ) {
962
-	if ( is_int( $position ) ) {
963
-		array_splice( $array, $position, 0, $insert );
961
+function give_settings_array_insert($array, $position, $insert) {
962
+	if (is_int($position)) {
963
+		array_splice($array, $position, 0, $insert);
964 964
 	} else {
965 965
 
966
-		foreach ( $array as $index => $subarray ) {
967
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
966
+		foreach ($array as $index => $subarray) {
967
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
968 968
 				$pos = $index;
969 969
 			}
970 970
 		}
971 971
 
972
-		if ( ! isset( $pos ) ) {
972
+		if ( ! isset($pos)) {
973 973
 			return $array;
974 974
 		}
975 975
 
976 976
 		$array = array_merge(
977
-			array_slice( $array, 0, $pos ),
977
+			array_slice($array, 0, $pos),
978 978
 			$insert,
979
-			array_slice( $array, $pos )
979
+			array_slice($array, $pos)
980 980
 		);
981 981
 	}
982 982
 
@@ -999,31 +999,31 @@  discard block
 block discarded – undo
999 999
  *
1000 1000
  * @return void
1001 1001
  */
1002
-function give_enabled_gateways_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1002
+function give_enabled_gateways_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1003 1003
 
1004 1004
 	$id                = $field_type_object->field->args['id'];
1005 1005
 	$field_description = $field_type_object->field->args['desc'];
1006
-	$gateways          = give_get_ordered_payment_gateways( give_get_payment_gateways() );
1006
+	$gateways          = give_get_ordered_payment_gateways(give_get_payment_gateways());
1007 1007
 
1008 1008
 	echo '<ul class="cmb2-checkbox-list cmb2-list">';
1009 1009
 
1010
-	foreach ( $gateways as $key => $option ) :
1010
+	foreach ($gateways as $key => $option) :
1011 1011
 
1012
-		if ( is_array( $escaped_value ) && array_key_exists( $key, $escaped_value ) ) {
1012
+		if (is_array($escaped_value) && array_key_exists($key, $escaped_value)) {
1013 1013
 			$enabled = '1';
1014 1014
 		} else {
1015 1015
 			$enabled = null;
1016 1016
 		}
1017 1017
 
1018
-		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
1019
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
1018
+		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
1019
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
1020 1020
 
1021 1021
 	endforeach;
1022 1022
 
1023 1023
 	echo '</ul>';
1024 1024
 
1025
-	if ( $field_description ) {
1026
-		echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
1025
+	if ($field_description) {
1026
+		echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
1027 1027
 	}
1028 1028
 
1029 1029
 }
@@ -1039,31 +1039,31 @@  discard block
 block discarded – undo
1039 1039
  *
1040 1040
  * @return void
1041 1041
  */
1042
-function give_default_gateway_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1042
+function give_default_gateway_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1043 1043
 
1044 1044
 	$id                = $field_type_object->field->args['id'];
1045 1045
 	$field_description = $field_type_object->field->args['desc'];
1046 1046
 	$gateways          = give_get_enabled_payment_gateways();
1047 1047
 
1048
-	echo '<select class="cmb2_select" name="' . $id . '" id="' . $id . '">';
1048
+	echo '<select class="cmb2_select" name="'.$id.'" id="'.$id.'">';
1049 1049
 
1050 1050
 	//Add a field to the Give Form admin single post view of this field
1051
-	if ( $field_type_object->field->object_type === 'post' ) {
1052
-		echo '<option value="global">' . __( 'Global Default', 'give' ) . '</option>';
1051
+	if ($field_type_object->field->object_type === 'post') {
1052
+		echo '<option value="global">'.__('Global Default', 'give').'</option>';
1053 1053
 	}
1054 1054
 
1055
-	foreach ( $gateways as $key => $option ) :
1055
+	foreach ($gateways as $key => $option) :
1056 1056
 
1057
-		$selected = isset( $escaped_value ) ? selected( $key, $escaped_value, false ) : '';
1057
+		$selected = isset($escaped_value) ? selected($key, $escaped_value, false) : '';
1058 1058
 
1059 1059
 
1060
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1060
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1061 1061
 
1062 1062
 	endforeach;
1063 1063
 
1064 1064
 	echo '</select>';
1065 1065
 
1066
-	echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
1066
+	echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
1067 1067
 
1068 1068
 }
1069 1069
 
@@ -1078,13 +1078,13 @@  discard block
 block discarded – undo
1078 1078
  *
1079 1079
  * @return void
1080 1080
  */
1081
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1081
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1082 1082
 
1083 1083
 	$id                = $field_type_object->field->args['id'];
1084 1084
 	$title             = $field_type_object->field->args['name'];
1085 1085
 	$field_description = $field_type_object->field->args['desc'];
1086 1086
 
1087
-	echo '<hr>' . $field_description;
1087
+	echo '<hr>'.$field_description;
1088 1088
 
1089 1089
 }
1090 1090
 
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
  *
1100 1100
  * @return void
1101 1101
  */
1102
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1102
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1103 1103
 
1104 1104
 	$id                = $field_type_object->field->args['id'];
1105 1105
 	$title             = $field_type_object->field->args['name'];
@@ -1119,25 +1119,25 @@  discard block
 block discarded – undo
1119 1119
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1120 1120
  * @return array An array of options that matches the CMB2 options array
1121 1121
  */
1122
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1122
+function give_cmb2_get_post_options($query_args, $force = false) {
1123 1123
 
1124
-	$post_options = array( '' => '' ); // Blank option
1124
+	$post_options = array('' => ''); // Blank option
1125 1125
 
1126
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1126
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1127 1127
 		return $post_options;
1128 1128
 	}
1129 1129
 
1130
-	$args = wp_parse_args( $query_args, array(
1130
+	$args = wp_parse_args($query_args, array(
1131 1131
 		'post_type'   => 'page',
1132 1132
 		'numberposts' => 10,
1133
-	) );
1133
+	));
1134 1134
 
1135
-	$posts = get_posts( $args );
1135
+	$posts = get_posts($args);
1136 1136
 
1137
-	if ( $posts ) {
1138
-		foreach ( $posts as $post ) {
1137
+	if ($posts) {
1138
+		foreach ($posts as $post) {
1139 1139
 
1140
-			$post_options[ $post->ID ] = $post->post_title;
1140
+			$post_options[$post->ID] = $post->post_title;
1141 1141
 
1142 1142
 		}
1143 1143
 	}
@@ -1157,17 +1157,17 @@  discard block
 block discarded – undo
1157 1157
 	global $_wp_additional_image_sizes;
1158 1158
 	$sizes = array();
1159 1159
 
1160
-	foreach ( get_intermediate_image_sizes() as $_size ) {
1160
+	foreach (get_intermediate_image_sizes() as $_size) {
1161 1161
 
1162
-		if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
1163
-			$sizes[ $_size ] = $_size . ' - ' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1164
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1165
-			$sizes[ $_size ] = $_size . ' - ' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height'];
1162
+		if (in_array($_size, array('thumbnail', 'medium', 'medium_large', 'large'))) {
1163
+			$sizes[$_size] = $_size.' - '.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1164
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1165
+			$sizes[$_size] = $_size.' - '.$_wp_additional_image_sizes[$_size]['width'].'x'.$_wp_additional_image_sizes[$_size]['height'];
1166 1166
 		}
1167 1167
 
1168 1168
 	}
1169 1169
 
1170
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1170
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1171 1171
 }
1172 1172
 
1173 1173
 
@@ -1181,34 +1181,34 @@  discard block
 block discarded – undo
1181 1181
  *
1182 1182
  * @return void
1183 1183
  */
1184
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1184
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1185 1185
 
1186 1186
 	$id                = $field_type_object->field->args['id'];
1187 1187
 	$field_description = $field_type_object->field->args['desc'];
1188
-	$license_status    = get_option( $field_type_object->field->args['options']['is_valid_license_option'] );
1188
+	$license_status    = get_option($field_type_object->field->args['options']['is_valid_license_option']);
1189 1189
 	$field_classes     = 'regular-text give-license-field';
1190
-	$type              = empty( $escaped_value ) ? 'text' : 'password';
1190
+	$type              = empty($escaped_value) ? 'text' : 'password';
1191 1191
 
1192
-	if ( $license_status === 'valid' ) {
1192
+	if ($license_status === 'valid') {
1193 1193
 		$field_classes .= ' give-license-active';
1194 1194
 	}
1195 1195
 
1196
-	$html = $field_type_object->input( array(
1196
+	$html = $field_type_object->input(array(
1197 1197
 		'class' => $field_classes,
1198 1198
 		'type'  => $type
1199
-	) );
1199
+	));
1200 1200
 
1201 1201
 	//License is active so show deactivate button
1202
-	if ( $license_status === 'valid' ) {
1203
-		$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="' . $id . '_deactivate" value="' . __( 'Deactivate License', 'give' ) . '"/>';
1202
+	if ($license_status === 'valid') {
1203
+		$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="'.$id.'_deactivate" value="'.__('Deactivate License', 'give').'"/>';
1204 1204
 	} else {
1205 1205
 		//This license is not valid so delete it
1206
-		give_delete_option( $id );
1206
+		give_delete_option($id);
1207 1207
 	}
1208 1208
 
1209
-	$html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1209
+	$html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1210 1210
 
1211
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1211
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1212 1212
 
1213 1213
 	echo $html;
1214 1214
 }
@@ -1222,13 +1222,13 @@  discard block
 block discarded – undo
1222 1222
  */
1223 1223
 function give_api_callback() {
1224 1224
 
1225
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1225
+	if ( ! current_user_can('manage_give_settings')) {
1226 1226
 		return;
1227 1227
 	}
1228 1228
 
1229
-	do_action( 'give_tools_api_keys_before' );
1229
+	do_action('give_tools_api_keys_before');
1230 1230
 
1231
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1231
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1232 1232
 
1233 1233
 	$api_keys_table = new Give_API_Keys_Table();
1234 1234
 	$api_keys_table->prepare_items();
@@ -1236,17 +1236,17 @@  discard block
 block discarded – undo
1236 1236
 	?>
1237 1237
 	<span class="cmb2-metabox-description api-description">
1238 1238
 		<?php echo sprintf(
1239
-			__( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ),
1240
-			esc_url( 'https://givewp.com/documentation/give-api-reference/' ),
1241
-			esc_url( 'https://givewp.com/addons/zapier/' )
1239
+			__('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'),
1240
+			esc_url('https://givewp.com/documentation/give-api-reference/'),
1241
+			esc_url('https://givewp.com/addons/zapier/')
1242 1242
 		); ?>
1243 1243
 	</span>
1244 1244
 	<?php
1245 1245
 
1246
-	do_action( 'give_tools_api_keys_after' );
1246
+	do_action('give_tools_api_keys_after');
1247 1247
 }
1248 1248
 
1249
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1249
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1250 1250
 
1251 1251
 /**
1252 1252
  * Hook Callback
@@ -1259,8 +1259,8 @@  discard block
 block discarded – undo
1259 1259
  *
1260 1260
  * @return void
1261 1261
  */
1262
-function give_hook_callback( $args ) {
1263
-	do_action( 'give_' . $args['id'] );
1262
+function give_hook_callback($args) {
1263
+	do_action('give_'.$args['id']);
1264 1264
 }
1265 1265
 
1266 1266
 /**
@@ -1270,10 +1270,10 @@  discard block
 block discarded – undo
1270 1270
  *
1271 1271
  */
1272 1272
 
1273
-if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1274
-	require_once WP_PLUGIN_DIR . '/cmb2/init.php';
1275
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1276
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php';
1277
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1278
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php';
1273
+if (file_exists(WP_PLUGIN_DIR.'/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1274
+	require_once WP_PLUGIN_DIR.'/cmb2/init.php';
1275
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1276
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php';
1277
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php') && ! defined('CMB2_LOADED')) {
1278
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php';
1279 1279
 }
1280 1280
\ No newline at end of file
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'] : __( '- Select -', 'give' ) ),
252
-			                    ) + $field['options'];
251
+									'' => ( $field['placeholder'] ? $field['placeholder'] : __( '- 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
  * @since       1.3.0
12 12
  */
13 13
 
14
-defined( 'ABSPATH' ) or exit;
14
+defined('ABSPATH') or exit;
15 15
 
16 16
 abstract class Give_Shortcode_Generator {
17 17
 
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
 	 *
58 58
 	 * @since 1.0
59 59
 	 */
60
-	public function __construct( $shortcode ) {
60
+	public function __construct($shortcode) {
61 61
 
62 62
 
63 63
 		$this->shortcode_tag = $shortcode;
64 64
 
65
-		add_action( 'admin_init', array( $this, 'init' ) );
65
+		add_action('admin_init', array($this, 'init'));
66 66
 
67 67
 	}
68 68
 
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function init() {
75 75
 
76
-		if ( $this->shortcode_tag ) {
76
+		if ($this->shortcode_tag) {
77 77
 
78
-			$this->self = get_class( $this );
78
+			$this->self = get_class($this);
79 79
 
80 80
 			$this->errors   = array();
81 81
 			$this->required = array();
@@ -84,18 +84,18 @@  discard block
 block discarded – undo
84 84
 			$fields = $this->get_fields();
85 85
 
86 86
 			$defaults = array(
87
-				'btn_close' => __( 'Close', 'give' ),
88
-				'btn_okay'  => __( 'Insert Shortcode', 'give' ),
87
+				'btn_close' => __('Close', 'give'),
88
+				'btn_okay'  => __('Insert Shortcode', 'give'),
89 89
 				'errors'    => $this->errors,
90 90
 				'fields'    => $fields,
91
-				'label'     => '[' . $this->shortcode_tag . ']',
91
+				'label'     => '['.$this->shortcode_tag.']',
92 92
 				'required'  => $this->required,
93
-				'title'     => __( 'Insert Shortcode', 'give' ),
93
+				'title'     => __('Insert Shortcode', 'give'),
94 94
 			);
95 95
 
96
-			if ( user_can_richedit() ) {
96
+			if (user_can_richedit()) {
97 97
 
98
-				Give_Shortcode_Button::$shortcodes[ $this->shortcode_tag ] = wp_parse_args( $this->shortcode, $defaults );
98
+				Give_Shortcode_Button::$shortcodes[$this->shortcode_tag] = wp_parse_args($this->shortcode, $defaults);
99 99
 
100 100
 			}
101 101
 		}
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
124 124
 	 *
125 125
 	 * @since 1.0
126 126
 	 */
127
-	protected function generate_fields( $defined_fields ) {
127
+	protected function generate_fields($defined_fields) {
128 128
 
129 129
 		$fields = array();
130 130
 
131
-		if ( is_array( $defined_fields ) ) {
131
+		if (is_array($defined_fields)) {
132 132
 
133
-			foreach ( $defined_fields as $field ) {
133
+			foreach ($defined_fields as $field) {
134 134
 
135 135
 				$defaults = array(
136 136
 					'label'       => false,
@@ -141,14 +141,14 @@  discard block
 block discarded – undo
141 141
 					'type'        => '',
142 142
 				);
143 143
 
144
-				$field  = wp_parse_args( (array) $field, $defaults );
145
-				$method = 'generate_' . strtolower( $field['type'] );
144
+				$field  = wp_parse_args((array) $field, $defaults);
145
+				$method = 'generate_'.strtolower($field['type']);
146 146
 
147
-				if ( method_exists( $this, $method ) ) {
147
+				if (method_exists($this, $method)) {
148 148
 
149
-					$field = call_user_func( array( $this, $method ), $field );
149
+					$field = call_user_func(array($this, $method), $field);
150 150
 
151
-					if ( $field ) {
151
+					if ($field) {
152 152
 						$fields[] = $field;
153 153
 					}
154 154
 				}
@@ -168,22 +168,22 @@  discard block
 block discarded – undo
168 168
 	protected function get_fields() {
169 169
 
170 170
 		$defined_fields   = $this->define_fields();
171
-		$generated_fields = $this->generate_fields( $defined_fields );
171
+		$generated_fields = $this->generate_fields($defined_fields);
172 172
 
173 173
 		$errors = array();
174 174
 
175
-		if ( ! empty( $this->errors ) ) {
176
-			foreach ( $this->required as $name => $alert ) {
177
-				if ( false === array_search( $name, array_column( $generated_fields, 'name' ) ) ) {
175
+		if ( ! empty($this->errors)) {
176
+			foreach ($this->required as $name => $alert) {
177
+				if (false === array_search($name, array_column($generated_fields, 'name'))) {
178 178
 
179
-					$errors[] = $this->errors[ $name ];
179
+					$errors[] = $this->errors[$name];
180 180
 				}
181 181
 			}
182 182
 
183 183
 			$this->errors = $errors;
184 184
 		}
185 185
 
186
-		if ( ! empty( $errors ) ) {
186
+		if ( ! empty($errors)) {
187 187
 
188 188
 			return $errors;
189 189
 		}
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
 	 *
201 201
 	 * @since 1.0
202 202
 	 */
203
-	protected function generate_container( $field ) {
203
+	protected function generate_container($field) {
204 204
 
205
-		if ( array_key_exists( 'html', $field ) ) {
205
+		if (array_key_exists('html', $field)) {
206 206
 
207 207
 			return array(
208 208
 				'type' => $field['type'],
@@ -222,36 +222,36 @@  discard block
 block discarded – undo
222 222
 	 *
223 223
 	 * @since 1.0
224 224
 	 */
225
-	protected function generate_listbox( $field ) {
225
+	protected function generate_listbox($field) {
226 226
 
227
-		$listbox = shortcode_atts( array(
227
+		$listbox = shortcode_atts(array(
228 228
 			'label'    => '',
229 229
 			'minWidth' => '',
230 230
 			'name'     => false,
231 231
 			'tooltip'  => '',
232 232
 			'type'     => '',
233 233
 			'value'    => '',
234
-		), $field );
234
+		), $field);
235 235
 
236
-		if ( $this->validate( $field ) ) {
236
+		if ($this->validate($field)) {
237 237
 
238 238
 			$new_listbox = array();
239 239
 
240
-			foreach ( $listbox as $key => $value ) {
240
+			foreach ($listbox as $key => $value) {
241 241
 
242
-				if ( $key == 'value' && empty( $value ) ) {
243
-					$new_listbox[ $key ] = $listbox['name'];
244
-				} else if ( $value ) {
245
-					$new_listbox[ $key ] = $value;
242
+				if ($key == 'value' && empty($value)) {
243
+					$new_listbox[$key] = $listbox['name'];
244
+				} else if ($value) {
245
+					$new_listbox[$key] = $value;
246 246
 				}
247 247
 			}
248 248
 
249 249
 			// do not reindex array!
250 250
 			$field['options'] = array(
251
-				                    '' => ( $field['placeholder'] ? $field['placeholder'] : __( '- Select -', 'give' ) ),
251
+				                    '' => ($field['placeholder'] ? $field['placeholder'] : __('- Select -', 'give')),
252 252
 			                    ) + $field['options'];
253 253
 
254
-			foreach ( $field['options'] as $value => $text ) {
254
+			foreach ($field['options'] as $value => $text) {
255 255
 				$new_listbox['values'][] = array(
256 256
 					'text'  => $text,
257 257
 					'value' => $value,
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 	 *
274 274
 	 * @since 1.0
275 275
 	 */
276
-	protected function generate_post( $field ) {
276
+	protected function generate_post($field) {
277 277
 
278 278
 		$args = array(
279 279
 			'post_type'      => 'post',
@@ -282,23 +282,23 @@  discard block
 block discarded – undo
282 282
 			'posts_per_page' => 30,
283 283
 		);
284 284
 
285
-		$args    = wp_parse_args( (array) $field['query_args'], $args );
286
-		$posts   = get_posts( $args );
285
+		$args    = wp_parse_args((array) $field['query_args'], $args);
286
+		$posts   = get_posts($args);
287 287
 		$options = array();
288 288
 
289
-		if ( $posts ) {
290
-			foreach ( $posts as $post ) {
291
-				$options[ absint( $post->ID ) ] = esc_html( $post->post_title );
289
+		if ($posts) {
290
+			foreach ($posts as $post) {
291
+				$options[absint($post->ID)] = esc_html($post->post_title);
292 292
 			}
293 293
 
294 294
 			$field['type']    = 'listbox';
295 295
 			$field['options'] = $options;
296 296
 
297
-			return $this->generate_listbox( $field );
297
+			return $this->generate_listbox($field);
298 298
 		}
299 299
 
300 300
 		// perform validation here before returning false
301
-		$this->validate( $field );
301
+		$this->validate($field);
302 302
 
303 303
 		return false;
304 304
 	}
@@ -312,9 +312,9 @@  discard block
 block discarded – undo
312 312
 	 *
313 313
 	 * @since 1.0
314 314
 	 */
315
-	protected function generate_textbox( $field ) {
315
+	protected function generate_textbox($field) {
316 316
 
317
-		$textbox = shortcode_atts( array(
317
+		$textbox = shortcode_atts(array(
318 318
 			'label'     => '',
319 319
 			'maxLength' => '',
320 320
 			'minHeight' => '',
@@ -324,10 +324,10 @@  discard block
 block discarded – undo
324 324
 			'tooltip'   => '',
325 325
 			'type'      => '',
326 326
 			'value'     => '',
327
-		), $field );
327
+		), $field);
328 328
 
329
-		if ( $this->validate( $field ) ) {
330
-			return array_filter( $textbox, array( $this, 'return_textbox_value' ) );
329
+		if ($this->validate($field)) {
330
+			return array_filter($textbox, array($this, 'return_textbox_value'));
331 331
 		}
332 332
 
333 333
 		return false;
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 	 *
341 341
 	 * @return bool
342 342
 	 */
343
-	function return_textbox_value( $value ) {
343
+	function return_textbox_value($value) {
344 344
 		return $value !== '';
345 345
 	}
346 346
 
@@ -356,9 +356,9 @@  discard block
 block discarded – undo
356 356
 	 *
357 357
 	 * @since 1.0
358 358
 	 */
359
-	protected function validate( $field ) {
359
+	protected function validate($field) {
360 360
 
361
-		extract( shortcode_atts(
361
+		extract(shortcode_atts(
362 362
 				array(
363 363
 					'name'     => false,
364 364
 					'required' => false,
@@ -366,34 +366,34 @@  discard block
 block discarded – undo
366 366
 				), $field )
367 367
 		);
368 368
 
369
-		if ( $name ) {
369
+		if ($name) {
370 370
 
371
-			if ( isset( $required['error'] ) ) {
371
+			if (isset($required['error'])) {
372 372
 
373 373
 				$error = array(
374 374
 					'type' => 'container',
375 375
 					'html' => $required['error'],
376 376
 				);
377 377
 
378
-				$this->errors[ $name ] = $this->generate_container( $error );
378
+				$this->errors[$name] = $this->generate_container($error);
379 379
 			}
380 380
 
381
-			if ( ! ! $required || is_array( $required ) ) {
381
+			if ( ! ! $required || is_array($required)) {
382 382
 
383
-				$alert = __( 'Some of the Shortcode options are required.', 'give' );
383
+				$alert = __('Some of the Shortcode options are required.', 'give');
384 384
 
385
-				if ( isset( $required['alert'] ) ) {
385
+				if (isset($required['alert'])) {
386 386
 
387 387
 					$alert = $required['alert'];
388 388
 
389
-				} else if ( ! empty( $label ) ) {
389
+				} else if ( ! empty($label)) {
390 390
 
391
-					$alert = sprintf( __( 'The "%s" option is required.', 'give' ),
392
-						str_replace( ':', '', $label )
391
+					$alert = sprintf(__('The "%s" option is required.', 'give'),
392
+						str_replace(':', '', $label)
393 393
 					);
394 394
 				}
395 395
 
396
-				$this->required[ $name ] = $alert;
396
+				$this->required[$name] = $alert;
397 397
 			}
398 398
 
399 399
 			return true;
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-form.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 /**
15 15
  * Class Give_Shortcode_Donation_Form
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['title']   = __( 'Donation Form', 'give' );
25
-		$this->shortcode['label']   = __( 'Donation Form', 'give' );
24
+		$this->shortcode['title']   = __('Donation Form', 'give');
25
+		$this->shortcode['label']   = __('Donation Form', 'give');
26 26
 
27
-		parent::__construct( 'give_form' );
27
+		parent::__construct('give_form');
28 28
 	}
29 29
 
30 30
 	/**
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 	public function define_fields() {
36 36
 
37 37
 		$create_form_link = sprintf(
38
-			__( '<a href="%s">Create</a> a new Donation Form.', 'give' ),
39
-			admin_url( 'post-new.php?post_type=give_forms' )
38
+			__('<a href="%s">Create</a> a new Donation Form.', 'give'),
39
+			admin_url('post-new.php?post_type=give_forms')
40 40
 		);
41 41
 
42 42
 		return array(
@@ -46,68 +46,68 @@  discard block
 block discarded – undo
46 46
 					'post_type' => 'give_forms',
47 47
 				),
48 48
 				'name'        => 'id',
49
-				'tooltip'     => __( 'Select a Donation Form', 'give' ),
50
-				'placeholder' => __( '- Select a Form -', 'give' ),
49
+				'tooltip'     => __('Select a Donation Form', 'give'),
50
+				'placeholder' => __('- Select a Form -', 'give'),
51 51
 				'required'    => array(
52
-					'alert' => __( 'You must first select a Form!', 'give' ),
53
-					'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', __( 'No donation forms were found!', 'give' ), $create_form_link ),
52
+					'alert' => __('You must first select a Form!', 'give'),
53
+					'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', __('No donation forms were found!', 'give'), $create_form_link),
54 54
 				),
55 55
 			),
56 56
 			array(
57 57
 				'type' => 'container',
58
-				'html' => sprintf( '<p class="strong margin-top">%s</p>', __( 'Optional form settings', 'give' ) ),
58
+				'html' => sprintf('<p class="strong margin-top">%s</p>', __('Optional form settings', 'give')),
59 59
 			),
60 60
 			array(
61 61
 				'type'    => 'listbox',
62 62
 				'name'    => 'show_title',
63
-				'label'   => __( 'Show Title:', 'give' ),
64
-				'tooltip' => __( 'Do you want to display the form title?', 'give' ),
63
+				'label'   => __('Show Title:', 'give'),
64
+				'tooltip' => __('Do you want to display the form title?', 'give'),
65 65
 				'options' => array(
66
-					'true'  => __( 'Show', 'give' ),
67
-					'false' => __( 'Hide', 'give' ),
66
+					'true'  => __('Show', 'give'),
67
+					'false' => __('Hide', 'give'),
68 68
 				),
69 69
 			),
70 70
 			array(
71 71
 				'type'    => 'listbox',
72 72
 				'name'    => 'show_goal',
73
-				'label'   => __( 'Show Goal:', 'give' ),
74
-				'tooltip' => __( 'Do you want to display the donation goal?', 'give' ),
73
+				'label'   => __('Show Goal:', 'give'),
74
+				'tooltip' => __('Do you want to display the donation goal?', 'give'),
75 75
 				'options' => array(
76
-					'true'  => __( 'Show', 'give' ),
77
-					'false' => __( 'Hide', 'give' ),
76
+					'true'  => __('Show', 'give'),
77
+					'false' => __('Hide', 'give'),
78 78
 				),
79 79
 			),
80 80
 			array(
81 81
 				'type'    => 'listbox',
82 82
 				'name'    => 'show_content',
83 83
 				'minWidth' => 240,
84
-				'label'   => __( 'Display Content:', 'give' ),
85
-				'tooltip' => __( 'Do you want to display the form content?', 'give' ),
84
+				'label'   => __('Display Content:', 'give'),
85
+				'tooltip' => __('Do you want to display the form content?', 'give'),
86 86
 				'options' => array(
87
-					'none'  => __( 'No Content', 'give' ),
88
-					'above' => __( 'Display above the form fields', 'give' ),
89
-					'below' => __( 'Display below the form fields', 'give' ),
87
+					'none'  => __('No Content', 'give'),
88
+					'above' => __('Display above the form fields', 'give'),
89
+					'below' => __('Display below the form fields', 'give'),
90 90
 				),
91 91
 			),
92 92
 			array(
93 93
 				'type'    => 'listbox',
94 94
 				'name'    => 'display_style',
95
-				'label'   => __( 'Payment Fields:', 'give' ),
96
-				'tooltip' => __( 'How would you like to display payment information?', 'give' ),
95
+				'label'   => __('Payment Fields:', 'give'),
96
+				'tooltip' => __('How would you like to display payment information?', 'give'),
97 97
 				'options' => array(
98
-					'onpage' => __( 'Show on Page', 'give' ),
99
-					'reveal' => __( 'Reveal Upon Click', 'give' ),
100
-					'modal'  => __( 'Modal Window Upon Click', 'give' ),
98
+					'onpage' => __('Show on Page', 'give'),
99
+					'reveal' => __('Reveal Upon Click', 'give'),
100
+					'modal'  => __('Modal Window Upon Click', 'give'),
101 101
 				),
102 102
 			),
103 103
 			array(
104 104
 				'type'    => 'listbox',
105 105
 				'name'    => 'float_labels',
106
-				'label'   => __( 'Floating Labels:', 'give' ),
107
-				'tooltip' => __( 'Override the default floating labels setting for this form?', 'give' ),
106
+				'label'   => __('Floating Labels:', 'give'),
107
+				'tooltip' => __('Override the default floating labels setting for this form?', 'give'),
108 108
 				'options' => array(
109
-					'enabled'  => __( 'Enabled', 'give' ),
110
-					'disabled' => __( 'Disabled', 'give' ),
109
+					'enabled'  => __('Enabled', 'give'),
110
+					'disabled' => __('Disabled', 'give'),
111 111
 				),
112 112
 			),
113 113
 		);
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-goal.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Donation_Form_Goal extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = __( 'Donation Form Goal', 'give' );
22
-		$this->shortcode['label'] = __( 'Donation Form Goal', 'give' );
21
+		$this->shortcode['title'] = __('Donation Form Goal', 'give');
22
+		$this->shortcode['label'] = __('Donation Form Goal', 'give');
23 23
 
24
-		parent::__construct( 'give_goal' );
24
+		parent::__construct('give_goal');
25 25
 	}
26 26
 
27 27
 	/**
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 	public function define_fields() {
33 33
 
34 34
 		$create_form_link = sprintf(
35
-			__( '<a href="%s">Create</a> a new Donation Form.', 'give' ),
36
-			admin_url( 'post-new.php?post_type=give_forms' )
35
+			__('<a href="%s">Create</a> a new Donation Form.', 'give'),
36
+			admin_url('post-new.php?post_type=give_forms')
37 37
 		);
38 38
 
39 39
 		return array(
@@ -43,35 +43,35 @@  discard block
 block discarded – undo
43 43
 					'post_type' => 'give_forms',
44 44
 				),
45 45
 				'name'        => 'id',
46
-				'tooltip'     => __( 'Select a Donation Form', 'give' ),
47
-				'placeholder' => __( '- Select a Form -', 'give' ),
46
+				'tooltip'     => __('Select a Donation Form', 'give'),
47
+				'placeholder' => __('- Select a Form -', 'give'),
48 48
 				'required'    => array(
49
-					'alert' => __( 'You must first select a Form!', 'give' ),
50
-					'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', __( 'No donation forms were found!', 'give' ), $create_form_link ),
49
+					'alert' => __('You must first select a Form!', 'give'),
50
+					'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', __('No donation forms were found!', 'give'), $create_form_link),
51 51
 				),
52 52
 			),
53 53
 			array(
54 54
 				'type' => 'container',
55
-				'html' => sprintf( '<p class="strong margin-top">%s</p>', __( 'Optional settings', 'give' ) ),
55
+				'html' => sprintf('<p class="strong margin-top">%s</p>', __('Optional settings', 'give')),
56 56
 			),
57 57
 			array(
58 58
 				'type'    => 'listbox',
59 59
 				'name'    => 'show_text',
60
-				'label'   => __( 'Show Text:', 'give' ),
61
-				'tooltip' => __( 'This text displays the amount of income raised compared to the goal.', 'give' ),
60
+				'label'   => __('Show Text:', 'give'),
61
+				'tooltip' => __('This text displays the amount of income raised compared to the goal.', 'give'),
62 62
 				'options' => array(
63
-					'true'  => __( 'Show', 'give' ),
64
-					'false' => __( 'Hide', 'give' ),
63
+					'true'  => __('Show', 'give'),
64
+					'false' => __('Hide', 'give'),
65 65
 				),
66 66
 			),
67 67
 			array(
68 68
 				'type'    => 'listbox',
69 69
 				'name'    => 'show_bar',
70
-				'label'   => __( 'Show Progress Bar:', 'give' ),
71
-				'tooltip' => __( 'Do you want to display the goal\'s progress bar?', 'give' ),
70
+				'label'   => __('Show Progress Bar:', 'give'),
71
+				'tooltip' => __('Do you want to display the goal\'s progress bar?', 'give'),
72 72
 				'options' => array(
73
-					'true'  => __( 'Show', 'give' ),
74
-					'false' => __( 'Hide', 'give' ),
73
+					'true'  => __('Show', 'give'),
74
+					'false' => __('Hide', 'give'),
75 75
 				),
76 76
 			),
77 77
 		);
Please login to merge, or discard this patch.