Test Failed
Push — master ( 26906f...b49498 )
by Devin
05:35
created
includes/scripts.php 1 patch
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -25,26 +25,26 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function give_load_scripts() {
27 27
 
28
-	$js_dir         = GIVE_PLUGIN_URL . 'assets/js/frontend/';
29
-	$js_plugins     = GIVE_PLUGIN_URL . 'assets/js/plugins/';
30
-	$scripts_footer = ( give_is_setting_enabled( give_get_option( 'scripts_footer' ) ) ) ? true : false;
28
+	$js_dir         = GIVE_PLUGIN_URL.'assets/js/frontend/';
29
+	$js_plugins     = GIVE_PLUGIN_URL.'assets/js/plugins/';
30
+	$scripts_footer = (give_is_setting_enabled(give_get_option('scripts_footer'))) ? true : false;
31 31
 
32 32
 	// Use minified libraries if SCRIPT_DEBUG is turned off.
33
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
33
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
34 34
 
35 35
 	// Localize / PHP to AJAX vars.
36
-	$localize_give_vars = apply_filters( 'give_global_script_vars', array(
36
+	$localize_give_vars = apply_filters('give_global_script_vars', array(
37 37
 		'ajaxurl'             => give_get_ajax_url(),
38
-		'checkout_nonce'      => wp_create_nonce( 'give_checkout_nonce' ), // Do not use this nonce. Its deprecated.
38
+		'checkout_nonce'      => wp_create_nonce('give_checkout_nonce'), // Do not use this nonce. Its deprecated.
39 39
 		'currency'            => give_get_currency(),
40
-		'currency_sign'       => give_currency_filter( '' ),
40
+		'currency_sign'       => give_currency_filter(''),
41 41
 		'currency_pos'        => give_get_currency_position(),
42 42
 		'thousands_separator' => give_get_price_thousand_separator(),
43 43
 		'decimal_separator'   => give_get_price_decimal_separator(),
44
-		'no_gateway'          => __( 'Please select a payment method.', 'give' ),
45
-		'bad_minimum'         => __( 'The minimum custom donation amount for this form is', 'give' ),
46
-		'general_loading'     => __( 'Loading...', 'give' ),
47
-		'purchase_loading'    => __( 'Please Wait...', 'give' ),
44
+		'no_gateway'          => __('Please select a payment method.', 'give'),
45
+		'bad_minimum'         => __('The minimum custom donation amount for this form is', 'give'),
46
+		'general_loading'     => __('Loading...', 'give'),
47
+		'purchase_loading'    => __('Please Wait...', 'give'),
48 48
 		'number_decimals'     => give_get_price_decimals(),
49 49
 		'give_version'        => GIVE_VERSION,
50 50
 		'magnific_options'    => apply_filters(
@@ -58,83 +58,83 @@  discard block
 block discarded – undo
58 58
 			'give_form_translation_js',
59 59
 			array(
60 60
 				// Field name               Validation message.
61
-				'payment-mode'           => __( 'Please select payment mode.', 'give' ),
62
-				'give_first'             => __( 'Please enter your first name.', 'give' ),
63
-				'give_email'             => __( 'Please enter a valid email address.', 'give' ),
64
-				'give_user_login'        => __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ),
65
-				'give_user_pass'         => __( 'Enter a password.', 'give' ),
66
-				'give_user_pass_confirm' => __( 'Enter the password confirmation.', 'give' ),
67
-				'give_agree_to_terms'    => __( 'You must agree to the terms and conditions.', 'give' ),
61
+				'payment-mode'           => __('Please select payment mode.', 'give'),
62
+				'give_first'             => __('Please enter your first name.', 'give'),
63
+				'give_email'             => __('Please enter a valid email address.', 'give'),
64
+				'give_user_login'        => __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'),
65
+				'give_user_pass'         => __('Enter a password.', 'give'),
66
+				'give_user_pass_confirm' => __('Enter the password confirmation.', 'give'),
67
+				'give_agree_to_terms'    => __('You must agree to the terms and conditions.', 'give'),
68 68
 			)
69 69
 		),
70
-		'confirm_email_sent_message'         => __( 'Please check your email and click on the link to access your complete donation history.', 'give' ),
71
-	) );
70
+		'confirm_email_sent_message'         => __('Please check your email and click on the link to access your complete donation history.', 'give'),
71
+	));
72 72
 
73
-	$localize_give_ajax = apply_filters( 'give_global_ajax_vars', array(
73
+	$localize_give_ajax = apply_filters('give_global_ajax_vars', array(
74 74
 		'ajaxurl'         => give_get_ajax_url(),
75
-		'ajaxNonce'       => wp_create_nonce( 'give_ajax_nonce' ),
76
-		'loading'         => __( 'Loading', 'give' ),
75
+		'ajaxNonce'       => wp_create_nonce('give_ajax_nonce'),
76
+		'loading'         => __('Loading', 'give'),
77 77
 		// General loading message.
78
-		'select_option'   => __( 'Please select an option', 'give' ),
78
+		'select_option'   => __('Please select an option', 'give'),
79 79
 		// Variable pricing error with multi-donation option enabled.
80
-		'default_gateway' => give_get_default_gateway( null ),
81
-		'permalinks'      => get_option( 'permalink_structure' ) ? '1' : '0',
80
+		'default_gateway' => give_get_default_gateway(null),
81
+		'permalinks'      => get_option('permalink_structure') ? '1' : '0',
82 82
 		'number_decimals' => give_get_price_decimals(),
83
-	) );
83
+	));
84 84
 
85 85
 	// DEBUG is On.
86
-	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
86
+	if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
87 87
 
88
-		if ( give_is_cc_verify_enabled() ) {
89
-			wp_register_script( 'give-cc-validator', $js_plugins . 'jquery.payment' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
90
-			wp_enqueue_script( 'give-cc-validator' );
88
+		if (give_is_cc_verify_enabled()) {
89
+			wp_register_script('give-cc-validator', $js_plugins.'jquery.payment'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
90
+			wp_enqueue_script('give-cc-validator');
91 91
 		}
92 92
 
93
-		wp_register_script( 'give-float-labels', $js_plugins . 'float-labels' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
94
-		wp_enqueue_script( 'give-float-labels' );
93
+		wp_register_script('give-float-labels', $js_plugins.'float-labels'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
94
+		wp_enqueue_script('give-float-labels');
95 95
 
96
-		wp_register_script( 'give-blockui', $js_plugins . 'jquery.blockUI' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
97
-		wp_enqueue_script( 'give-blockui' );
96
+		wp_register_script('give-blockui', $js_plugins.'jquery.blockUI'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
97
+		wp_enqueue_script('give-blockui');
98 98
 
99
-		wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
100
-		wp_enqueue_script( 'give-accounting' );
99
+		wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
100
+		wp_enqueue_script('give-accounting');
101 101
 
102
-		wp_register_script( 'give-magnific', $js_plugins . 'jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
103
-		wp_enqueue_script( 'give-magnific' );
102
+		wp_register_script('give-magnific', $js_plugins.'jquery.magnific-popup'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
103
+		wp_enqueue_script('give-magnific');
104 104
 
105
-		wp_register_script( 'give-checkout-global', $js_dir . 'give-donations' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
106
-		wp_enqueue_script( 'give-checkout-global' );
105
+		wp_register_script('give-checkout-global', $js_dir.'give-donations'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
106
+		wp_enqueue_script('give-checkout-global');
107 107
 
108
-		wp_register_script( 'give-hint.css', $js_plugins . 'give-hint.css' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
109
-		wp_enqueue_script( 'give-hint.css' );
108
+		wp_register_script('give-hint.css', $js_plugins.'give-hint.css'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
109
+		wp_enqueue_script('give-hint.css');
110 110
 
111 111
 		// General scripts.
112
-		wp_register_script( 'give-scripts', $js_dir . 'give' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
113
-		wp_enqueue_script( 'give-scripts' );
112
+		wp_register_script('give-scripts', $js_dir.'give'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
113
+		wp_enqueue_script('give-scripts');
114 114
 
115 115
 		// Load AJAX scripts, if enabled.
116
-		wp_register_script( 'give-ajax', $js_dir . 'give-ajax' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
117
-		wp_enqueue_script( 'give-ajax' );
116
+		wp_register_script('give-ajax', $js_dir.'give-ajax'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
117
+		wp_enqueue_script('give-ajax');
118 118
 
119 119
 		// Localize / Pass AJAX vars from PHP,
120
-		wp_localize_script( 'give-checkout-global', 'give_global_vars', $localize_give_vars );
121
-		wp_localize_script( 'give-ajax', 'give_scripts', $localize_give_ajax );
120
+		wp_localize_script('give-checkout-global', 'give_global_vars', $localize_give_vars);
121
+		wp_localize_script('give-ajax', 'give_scripts', $localize_give_ajax);
122 122
 
123 123
 	} else {
124 124
 
125 125
 		// DEBUG is OFF (one JS file to rule them all!).
126
-		wp_register_script( 'give', $js_dir . 'give.all.min.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
127
-		wp_enqueue_script( 'give' );
126
+		wp_register_script('give', $js_dir.'give.all.min.js', array('jquery'), GIVE_VERSION, $scripts_footer);
127
+		wp_enqueue_script('give');
128 128
 
129 129
 		// Localize / Pass AJAX vars from PHP.
130
-		wp_localize_script( 'give', 'give_global_vars', $localize_give_vars );
131
-		wp_localize_script( 'give', 'give_scripts', $localize_give_ajax );
130
+		wp_localize_script('give', 'give_global_vars', $localize_give_vars);
131
+		wp_localize_script('give', 'give_scripts', $localize_give_ajax);
132 132
 
133 133
 	}
134 134
 
135 135
 }
136 136
 
137
-add_action( 'wp_enqueue_scripts', 'give_load_scripts' );
137
+add_action('wp_enqueue_scripts', 'give_load_scripts');
138 138
 
139 139
 /**
140 140
  * Register styles.
@@ -147,16 +147,16 @@  discard block
 block discarded – undo
147 147
  */
148 148
 function give_register_styles() {
149 149
 
150
-	if ( ! give_is_setting_enabled( give_get_option( 'css' ) ) ) {
150
+	if ( ! give_is_setting_enabled(give_get_option('css'))) {
151 151
 		return;
152 152
 	}
153 153
 
154
-	wp_register_style( 'give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all' );
155
-	wp_enqueue_style( 'give-styles' );
154
+	wp_register_style('give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all');
155
+	wp_enqueue_style('give-styles');
156 156
 
157 157
 }
158 158
 
159
-add_action( 'wp_enqueue_scripts', 'give_register_styles' );
159
+add_action('wp_enqueue_scripts', 'give_register_styles');
160 160
 
161 161
 
162 162
 /**
@@ -169,19 +169,19 @@  discard block
 block discarded – undo
169 169
 function give_get_stylesheet_uri() {
170 170
 
171 171
 	// Use minified libraries if SCRIPT_DEBUG is turned off.
172
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
172
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
173 173
 
174 174
 	// LTR or RTL files.
175
-	$direction = ( is_rtl() ) ? '-rtl' : '';
175
+	$direction = (is_rtl()) ? '-rtl' : '';
176 176
 
177
-	$file          = 'give' . $direction . $suffix . '.css';
177
+	$file          = 'give'.$direction.$suffix.'.css';
178 178
 	$templates_dir = give_get_theme_template_dir_name();
179 179
 
180
-	$child_theme_style_sheet    = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file;
181
-	$child_theme_style_sheet_2  = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give' . $direction . '.css';
182
-	$parent_theme_style_sheet   = trailingslashit( get_template_directory() ) . $templates_dir . $file;
183
-	$parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give' . $direction . '.css';
184
-	$give_plugin_style_sheet    = trailingslashit( give_get_templates_dir() ) . $file;
180
+	$child_theme_style_sheet    = trailingslashit(get_stylesheet_directory()).$templates_dir.$file;
181
+	$child_theme_style_sheet_2  = trailingslashit(get_stylesheet_directory()).$templates_dir.'give'.$direction.'.css';
182
+	$parent_theme_style_sheet   = trailingslashit(get_template_directory()).$templates_dir.$file;
183
+	$parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give'.$direction.'.css';
184
+	$give_plugin_style_sheet    = trailingslashit(give_get_templates_dir()).$file;
185 185
 
186 186
 	$uri = false;
187 187
 
@@ -191,23 +191,23 @@  discard block
 block discarded – undo
191 191
 	 * followed by non minified version, even if SCRIPT_DEBUG is not enabled.
192 192
 	 * This allows users to copy just give.css to their theme.
193 193
 	 */
194
-	if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) {
195
-		if ( ! empty( $nonmin ) ) {
196
-			$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give' . $direction . '.css';
194
+	if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) {
195
+		if ( ! empty($nonmin)) {
196
+			$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give'.$direction.'.css';
197 197
 		} else {
198
-			$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file;
198
+			$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file;
199 199
 		}
200
-	} elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) {
201
-		if ( ! empty( $nonmin ) ) {
202
-			$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give' . $direction . '.css';
200
+	} elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) {
201
+		if ( ! empty($nonmin)) {
202
+			$uri = trailingslashit(get_template_directory_uri()).$templates_dir.'give'.$direction.'.css';
203 203
 		} else {
204
-			$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file;
204
+			$uri = trailingslashit(get_template_directory_uri()).$templates_dir.$file;
205 205
 		}
206
-	} elseif ( file_exists( $give_plugin_style_sheet ) || file_exists( $give_plugin_style_sheet ) ) {
207
-		$uri = trailingslashit( give_get_templates_url() ) . $file;
206
+	} elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) {
207
+		$uri = trailingslashit(give_get_templates_url()).$file;
208 208
 	}
209 209
 
210
-	return apply_filters( 'give_get_stylesheet_uri', $uri );
210
+	return apply_filters('give_get_stylesheet_uri', $uri);
211 211
 
212 212
 }
213 213
 
@@ -224,80 +224,80 @@  discard block
 block discarded – undo
224 224
  *
225 225
  * @return void
226 226
  */
227
-function give_load_admin_scripts( $hook ) {
227
+function give_load_admin_scripts($hook) {
228 228
 
229 229
 	global $post, $post_type;
230 230
 
231 231
 	$give_options = give_get_settings();
232 232
 
233 233
 	// Directories of assets.
234
-	$js_dir     = GIVE_PLUGIN_URL . 'assets/js/admin/';
235
-	$js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/';
236
-	$css_dir    = GIVE_PLUGIN_URL . 'assets/css/';
234
+	$js_dir     = GIVE_PLUGIN_URL.'assets/js/admin/';
235
+	$js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/';
236
+	$css_dir    = GIVE_PLUGIN_URL.'assets/css/';
237 237
 
238 238
 	// Use minified libraries if SCRIPT_DEBUG is turned off.
239
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
239
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
240 240
 
241 241
 	// LTR or RTL files.
242
-	$direction = ( is_rtl() ) ? '-rtl' : '';
242
+	$direction = (is_rtl()) ? '-rtl' : '';
243 243
 
244 244
 	// Global Admin.
245
-	wp_register_style( 'give-admin-bar-notification', $css_dir . 'adminbar-style.css' );
246
-	wp_enqueue_style( 'give-admin-bar-notification' );
245
+	wp_register_style('give-admin-bar-notification', $css_dir.'adminbar-style.css');
246
+	wp_enqueue_style('give-admin-bar-notification');
247 247
 
248 248
 	// Give Admin Only.
249
-	if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) {
249
+	if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
250 250
 		return;
251 251
 	}
252 252
 
253 253
 	// CSS.
254
-	wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css' );
255
-	wp_enqueue_style( 'jquery-ui-css' );
256
-	wp_register_style( 'give-admin', $css_dir . 'give-admin' . $direction . $suffix . '.css', array(), GIVE_VERSION );
257
-	wp_enqueue_style( 'give-admin' );
258
-	wp_enqueue_style( 'thickbox' );
259
-	wp_enqueue_style( 'wp-color-picker' );
254
+	wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css');
255
+	wp_enqueue_style('jquery-ui-css');
256
+	wp_register_style('give-admin', $css_dir.'give-admin'.$direction.$suffix.'.css', array(), GIVE_VERSION);
257
+	wp_enqueue_style('give-admin');
258
+	wp_enqueue_style('thickbox');
259
+	wp_enqueue_style('wp-color-picker');
260 260
 
261 261
 
262 262
 	// JS.
263
-	wp_register_script( 'give-selector-cache', $js_plugins . 'selector-cache' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
264
-	wp_enqueue_script( 'give-selector-cache' );
263
+	wp_register_script('give-selector-cache', $js_plugins.'selector-cache'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
264
+	wp_enqueue_script('give-selector-cache');
265 265
 
266
-	wp_register_script( 'give-ajaxify-fields', $js_plugins . 'give-ajaxify-fields' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
267
-	wp_enqueue_script( 'give-ajaxify-fields' );
266
+	wp_register_script('give-ajaxify-fields', $js_plugins.'give-ajaxify-fields'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
267
+	wp_enqueue_script('give-ajaxify-fields');
268 268
 
269
-	wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION );
270
-	wp_enqueue_script( 'jquery-chosen' );
269
+	wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION);
270
+	wp_enqueue_script('jquery-chosen');
271 271
 
272
-	wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
273
-	wp_enqueue_script( 'give-accounting' );
272
+	wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
273
+	wp_enqueue_script('give-accounting');
274 274
 
275
-	wp_enqueue_script( 'wp-color-picker' );
276
-	wp_enqueue_script( 'jquery-ui-datepicker' );
277
-	wp_enqueue_script( 'thickbox' );
275
+	wp_enqueue_script('wp-color-picker');
276
+	wp_enqueue_script('jquery-ui-datepicker');
277
+	wp_enqueue_script('thickbox');
278 278
 
279
-	wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'wp-color-picker', 'jquery-query' ), GIVE_VERSION, false );
280
-	wp_enqueue_script( 'give-admin-scripts' );
279
+	wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery', 'jquery-ui-datepicker', 'wp-color-picker', 'jquery-query'), GIVE_VERSION, false);
280
+	wp_enqueue_script('give-admin-scripts');
281 281
 
282
-	wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' );
283
-	wp_enqueue_script( 'jquery-flot' );
282
+	wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js');
283
+	wp_enqueue_script('jquery-flot');
284 284
 
285
-	wp_register_script( 'give-repeatable-fields', $js_plugins . 'repeatable-fields' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
286
-	wp_enqueue_script( 'give-repeatable-fields' );
285
+	wp_register_script('give-repeatable-fields', $js_plugins.'repeatable-fields'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
286
+	wp_enqueue_script('give-repeatable-fields');
287 287
 
288
-	wp_register_script( 'give-hint.css', $js_plugins . 'give-hint.css' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
289
-	wp_enqueue_script( 'give-hint.css' );
288
+	wp_register_script('give-hint.css', $js_plugins.'give-hint.css'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
289
+	wp_enqueue_script('give-hint.css');
290 290
 
291 291
 	// Forms CPT Script.
292
-	if ( $post_type === 'give_forms' ) {
293
-		wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
294
-		wp_enqueue_script( 'give-admin-forms-scripts' );
292
+	if ($post_type === 'give_forms') {
293
+		wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
294
+		wp_enqueue_script('give-admin-forms-scripts');
295 295
 	}
296 296
 
297 297
 	// Settings Scripts.
298
-	if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-settings' ) {
299
-		wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
300
-		wp_enqueue_script( 'give-admin-settings-scripts' );
298
+	if (isset($_GET['page']) && $_GET['page'] == 'give-settings') {
299
+		wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
300
+		wp_enqueue_script('give-admin-settings-scripts');
301 301
 	}
302 302
 
303 303
 	// Price Separators.
@@ -305,91 +305,91 @@  discard block
 block discarded – undo
305 305
 	$decimal_separator  = give_get_price_decimal_separator();
306 306
 
307 307
 	// Localize strings & variables for JS.
308
-	wp_localize_script( 'give-admin-scripts', 'give_vars', array(
309
-		'post_id'                           => isset( $post->ID ) ? $post->ID : null,
308
+	wp_localize_script('give-admin-scripts', 'give_vars', array(
309
+		'post_id'                           => isset($post->ID) ? $post->ID : null,
310 310
 		'give_version'                      => GIVE_VERSION,
311 311
 		'thousands_separator'               => $thousand_separator,
312 312
 		'decimal_separator'                 => $decimal_separator,
313
-		'quick_edit_warning'                => __( 'Not available for variable priced forms.', 'give' ),
314
-		'delete_payment'                    => __( 'Are you sure you want to delete this payment?', 'give' ),
315
-		'delete_payment_note'               => __( 'Are you sure you want to delete this note?', 'give' ),
316
-		'revoke_api_key'                    => __( 'Are you sure you want to revoke this API key?', 'give' ),
317
-		'regenerate_api_key'                => __( 'Are you sure you want to regenerate this API key?', 'give' ),
318
-		'resend_receipt'                    => __( 'Are you sure you want to resend the donation receipt?', 'give' ),
319
-		'disconnect_user'                   => __( 'Are you sure you want to disconnect the user from this donor?', 'give' ),
320
-		'one_option'                        => __( 'Choose a form', 'give' ),
321
-		'one_or_more_option'                => __( 'Choose one or more forms', 'give' ),
322
-		'currency_sign'                     => give_currency_filter( '' ),
323
-		'currency_pos'                      => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
313
+		'quick_edit_warning'                => __('Not available for variable priced forms.', 'give'),
314
+		'delete_payment'                    => __('Are you sure you want to delete this payment?', 'give'),
315
+		'delete_payment_note'               => __('Are you sure you want to delete this note?', 'give'),
316
+		'revoke_api_key'                    => __('Are you sure you want to revoke this API key?', 'give'),
317
+		'regenerate_api_key'                => __('Are you sure you want to regenerate this API key?', 'give'),
318
+		'resend_receipt'                    => __('Are you sure you want to resend the donation receipt?', 'give'),
319
+		'disconnect_user'                   => __('Are you sure you want to disconnect the user from this donor?', 'give'),
320
+		'one_option'                        => __('Choose a form', 'give'),
321
+		'one_or_more_option'                => __('Choose one or more forms', 'give'),
322
+		'currency_sign'                     => give_currency_filter(''),
323
+		'currency_pos'                      => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
324 324
 		'currency_decimals'                 => give_get_price_decimals(),
325
-		'batch_export_no_class'             => __( 'You must choose a method.', 'give' ),
326
-		'batch_export_no_reqs'              => __( 'Required fields not completed.', 'give' ),
327
-		'reset_stats_warn'                  => __( 'Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give' ),
328
-		'delete_test_donor'                 => __( 'Are you sure you want to delete all the test donors? This process will also delete test donations as well.', 'give' ),
329
-		'delete_import_donor'               => __( 'Are you sure you want to delete all the imported donors? This process will also delete imported donations as well.', 'give' ),
330
-		'price_format_guide'                => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ),
325
+		'batch_export_no_class'             => __('You must choose a method.', 'give'),
326
+		'batch_export_no_reqs'              => __('Required fields not completed.', 'give'),
327
+		'reset_stats_warn'                  => __('Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give'),
328
+		'delete_test_donor'                 => __('Are you sure you want to delete all the test donors? This process will also delete test donations as well.', 'give'),
329
+		'delete_import_donor'               => __('Are you sure you want to delete all the imported donors? This process will also delete imported donations as well.', 'give'),
330
+		'price_format_guide'                => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator),
331 331
 		/* translators : %s: Donation form options metabox */
332
-		'confirm_before_remove_row_text'    => __( 'Do you want to delete this item?', 'give' ),
333
-		'matched_success_failure_page'      => __( 'You cannot set the success and failed pages to the same page', 'give' ),
334
-		'dismiss_notice_text'               => __( 'Dismiss this notice.', 'give' ),
335
-		'search_placeholder'                => __( 'Type to search all forms', 'give' ),
336
-		'search_placeholder_donor'          => __( 'Type to search all donors', 'give' ),
337
-		'search_placeholder_country'        => __( 'Type to search all countries', 'give' ),
338
-		'search_placeholder_state'          => __( 'Type to search all states/provinces', 'give' ),
339
-		'unlock_donor_fields'            => __( 'To edit first name and last name, please go to user profile of the donor.', 'give' ),
340
-		'remove_from_bulk_delete'           => __( 'Remove from Bulk Delete', 'give' ),
332
+		'confirm_before_remove_row_text'    => __('Do you want to delete this item?', 'give'),
333
+		'matched_success_failure_page'      => __('You cannot set the success and failed pages to the same page', 'give'),
334
+		'dismiss_notice_text'               => __('Dismiss this notice.', 'give'),
335
+		'search_placeholder'                => __('Type to search all forms', 'give'),
336
+		'search_placeholder_donor'          => __('Type to search all donors', 'give'),
337
+		'search_placeholder_country'        => __('Type to search all countries', 'give'),
338
+		'search_placeholder_state'          => __('Type to search all states/provinces', 'give'),
339
+		'unlock_donor_fields'            => __('To edit first name and last name, please go to user profile of the donor.', 'give'),
340
+		'remove_from_bulk_delete'           => __('Remove from Bulk Delete', 'give'),
341 341
 		'donors_bulk_action'                => array(
342
-			'no_donor_selected'  => __( 'You must choose at least one or more donors to delete.', 'give' ),
343
-			'no_action_selected' => __( 'You must select a bulk action to proceed.', 'give' ),
342
+			'no_donor_selected'  => __('You must choose at least one or more donors to delete.', 'give'),
343
+			'no_action_selected' => __('You must select a bulk action to proceed.', 'give'),
344 344
 		),
345 345
 		'donations_bulk_action'             => array(
346 346
 			'delete'         => array(
347
-				'zero'     => __( 'You must choose at least one or more donations to delete.', 'give' ),
348
-				'single'   => __( 'Are you sure you want to permanently delete this donation?', 'give' ),
349
-				'multiple' => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ),
347
+				'zero'     => __('You must choose at least one or more donations to delete.', 'give'),
348
+				'single'   => __('Are you sure you want to permanently delete this donation?', 'give'),
349
+				'multiple' => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'),
350 350
 			),
351 351
 			'resend-receipt' => array(
352
-				'zero'     => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ),
353
-				'single'   => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ),
354
-				'multiple' => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ),
352
+				'zero'     => __('You must choose at least one or more recipients to resend the email receipt.', 'give'),
353
+				'single'   => __('Are you sure you want to resend the email receipt to this recipient?', 'give'),
354
+				'multiple' => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'),
355 355
 			),
356 356
 			'set-to-status'  => array(
357
-				'zero'     => __( 'You must choose at least one or more donations to set status to {status}.', 'give' ),
358
-				'single'   => __( 'Are you sure you want to set status of this donation to {status}?', 'give' ),
359
-				'multiple' => __( 'Are you sure you want to set status of {payment_count} donations to {status}?', 'give' ),
357
+				'zero'     => __('You must choose at least one or more donations to set status to {status}.', 'give'),
358
+				'single'   => __('Are you sure you want to set status of this donation to {status}?', 'give'),
359
+				'multiple' => __('Are you sure you want to set status of {payment_count} donations to {status}?', 'give'),
360 360
 			),
361 361
 		),
362 362
 		'updates' => array(
363
-			'ajax_error' => __( 'Please reload this page and try again', 'give' )
363
+			'ajax_error' => __('Please reload this page and try again', 'give')
364 364
 		),
365 365
 		'metabox_fields' => array(
366 366
 			'media' => array(
367
-				'button_title' => __( 'Choose Image', 'give' ),
367
+				'button_title' => __('Choose Image', 'give'),
368 368
 			),
369 369
 			'file'  => array(
370
-				'button_title' => __( 'Choose File', 'give' ),
370
+				'button_title' => __('Choose File', 'give'),
371 371
 			),
372 372
 		),
373 373
 		'chosen'                            => array(
374
-			'no_results_msg'  => __( 'No results match {search_term}', 'give' ),
375
-			'ajax_search_msg' => __( 'Searching results for match {search_term}', 'give' ),
374
+			'no_results_msg'  => __('No results match {search_term}', 'give'),
375
+			'ajax_search_msg' => __('Searching results for match {search_term}', 'give'),
376 376
 		),
377
-		'db_update_confirmation_msg_button' => __( 'Run Updates', 'give' ),
378
-		'db_update_confirmation_msg'        => __( 'The following process will make updates to your site\'s database. Please create a database backup before proceeding with updates.', 'give' ),
379
-		'error_message'                     => __( 'Something went wrong kindly try again!', 'give' ),
377
+		'db_update_confirmation_msg_button' => __('Run Updates', 'give'),
378
+		'db_update_confirmation_msg'        => __('The following process will make updates to your site\'s database. Please create a database backup before proceeding with updates.', 'give'),
379
+		'error_message'                     => __('Something went wrong kindly try again!', 'give'),
380 380
 		'give_donation_import'              => 'give_donation_import',
381 381
 		'core_settings_import'              => 'give_core_settings_import',
382
-		'setting_not_save_message'          => __( 'Changes you made may not be saved.', 'give' ),
383
-	) );
382
+		'setting_not_save_message'          => __('Changes you made may not be saved.', 'give'),
383
+	));
384 384
 
385
-	if ( function_exists( 'wp_enqueue_media' ) && version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) {
385
+	if (function_exists('wp_enqueue_media') && version_compare(get_bloginfo('version'), '3.5', '>=')) {
386 386
 		// call for new media manager.
387 387
 		wp_enqueue_media();
388 388
 	}
389 389
 
390 390
 }
391 391
 
392
-add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 );
392
+add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100);
393 393
 
394 394
 /**
395 395
  * Admin Give Icon
@@ -404,13 +404,13 @@  discard block
 block discarded – undo
404 404
 	?>
405 405
 	<style type="text/css" media="screen">
406 406
 
407
-		<?php if ( version_compare( get_bloginfo( 'version' ), '3.8-RC', '>=' ) || version_compare( get_bloginfo( 'version' ), '3.8', '>=' ) ) { ?>
407
+		<?php if (version_compare(get_bloginfo('version'), '3.8-RC', '>=') || version_compare(get_bloginfo('version'), '3.8', '>=')) { ?>
408 408
 		@font-face {
409 409
 			font-family: 'give-icomoon';
410
-			src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?ngjl88'; ?>');
411
-			src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
412
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
413
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
410
+			src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?ngjl88'; ?>');
411
+			src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
412
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
413
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
414 414
 			font-weight: normal;
415 415
 			font-style: normal;
416 416
 		}
@@ -429,4 +429,4 @@  discard block
 block discarded – undo
429 429
 	<?php
430 430
 }
431 431
 
432
-add_action( 'admin_head', 'give_admin_icon' );
432
+add_action('admin_head', 'give_admin_icon');
Please login to merge, or discard this patch.