Test Failed
Push — master ( 07651e...9726e4 )
by Ravinder
06:03
created
includes/class-give-scripts.php 1 patch
Spacing   +176 added lines, -176 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 	 * @since 2.1.0
38 38
 	 */
39 39
 	public function __construct() {
40
-		$this->direction      = ( is_rtl() || isset( $_GET['d'] ) && 'rtl' === $_GET['d'] ) ? '.rtl' : '';
41
-		$this->scripts_footer = give_is_setting_enabled( give_get_option( 'scripts_footer' ) ) ? true : false;
40
+		$this->direction      = (is_rtl() || isset($_GET['d']) && 'rtl' === $_GET['d']) ? '.rtl' : '';
41
+		$this->scripts_footer = give_is_setting_enabled(give_get_option('scripts_footer')) ? true : false;
42 42
 		$this->init();
43 43
 	}
44 44
 
@@ -49,20 +49,20 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function init() {
51 51
 
52
-		add_action( 'admin_enqueue_scripts', array( $this, 'register_styles' ) );
53
-		add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) );
54
-		add_action( 'wp_enqueue_scripts', array( $this, 'register_styles' ) );
55
-		add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
52
+		add_action('admin_enqueue_scripts', array($this, 'register_styles'));
53
+		add_action('admin_enqueue_scripts', array($this, 'register_scripts'));
54
+		add_action('wp_enqueue_scripts', array($this, 'register_styles'));
55
+		add_action('wp_enqueue_scripts', array($this, 'register_scripts'));
56 56
 
57
-		if ( is_admin() ) {
58
-			add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
59
-			add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_styles' ) );
60
-			add_action( 'enqueue_block_editor_assets', array( $this, 'gutenberg_admin_scripts' ) );
61
-			add_action( 'admin_head', array( $this, 'global_admin_head' ) );
57
+		if (is_admin()) {
58
+			add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
59
+			add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_styles'));
60
+			add_action('enqueue_block_editor_assets', array($this, 'gutenberg_admin_scripts'));
61
+			add_action('admin_head', array($this, 'global_admin_head'));
62 62
 
63 63
 		} else {
64
-			add_action( 'wp_enqueue_scripts', array( $this, 'public_enqueue_styles' ) );
65
-			add_action( 'wp_enqueue_scripts', array( $this, 'public_enqueue_scripts' ) );
64
+			add_action('wp_enqueue_scripts', array($this, 'public_enqueue_styles'));
65
+			add_action('wp_enqueue_scripts', array($this, 'public_enqueue_scripts'));
66 66
 		}
67 67
 	}
68 68
 
@@ -74,19 +74,19 @@  discard block
 block discarded – undo
74 74
 	public function register_styles() {
75 75
 
76 76
 		// WP-admin.
77
-		wp_register_style( 'give-admin-styles', GIVE_PLUGIN_URL . 'assets/dist/css/admin' . $this->direction . '.css', array(), GIVE_VERSION );
77
+		wp_register_style('give-admin-styles', GIVE_PLUGIN_URL.'assets/dist/css/admin'.$this->direction.'.css', array(), GIVE_VERSION);
78 78
 
79 79
 		// WP-admin: plugin page.
80 80
 		wp_register_style(
81 81
 			'plugin-deactivation-survey-css',
82
-			GIVE_PLUGIN_URL . 'assets/dist/css/plugin-deactivation-survey.css',
82
+			GIVE_PLUGIN_URL.'assets/dist/css/plugin-deactivation-survey.css',
83 83
 			array(),
84 84
 			GIVE_VERSION
85 85
 		);
86 86
 
87 87
 		// Frontend.
88
-		if ( give_is_setting_enabled( give_get_option( 'css' ) ) ) {
89
-			wp_register_style( 'give-styles', $this->get_frontend_stylesheet_uri(), array(), GIVE_VERSION, 'all' );
88
+		if (give_is_setting_enabled(give_get_option('css'))) {
89
+			wp_register_style('give-styles', $this->get_frontend_stylesheet_uri(), array(), GIVE_VERSION, 'all');
90 90
 		}
91 91
 	}
92 92
 
@@ -98,23 +98,23 @@  discard block
 block discarded – undo
98 98
 	public function register_scripts() {
99 99
 
100 100
 		// WP-Admin.
101
-		wp_register_script( 'give-admin-scripts', GIVE_PLUGIN_URL . 'assets/dist/js/admin.js', array(
101
+		wp_register_script('give-admin-scripts', GIVE_PLUGIN_URL.'assets/dist/js/admin.js', array(
102 102
 			'jquery',
103 103
 			'jquery-ui-datepicker',
104 104
 			'wp-color-picker',
105 105
 			'jquery-query',
106
-		), GIVE_VERSION );
106
+		), GIVE_VERSION);
107 107
 
108 108
 		// WP-admin: plugin page.
109
-		wp_register_script( 'plugin-deactivation-survey-js',
110
-			GIVE_PLUGIN_URL . 'assets/dist/js/plugin-deactivation-survey.js',
111
-			array( 'jquery' ),
109
+		wp_register_script('plugin-deactivation-survey-js',
110
+			GIVE_PLUGIN_URL.'assets/dist/js/plugin-deactivation-survey.js',
111
+			array('jquery'),
112 112
 			GIVE_VERSION,
113 113
 			true
114 114
 		);
115 115
 
116 116
 		// Frontend.
117
-		wp_register_script( 'give', GIVE_PLUGIN_URL . 'assets/dist/js/give.js', array( 'jquery' ), GIVE_VERSION, $this->scripts_footer );
117
+		wp_register_script('give', GIVE_PLUGIN_URL.'assets/dist/js/give.js', array('jquery'), GIVE_VERSION, $this->scripts_footer);
118 118
 	}
119 119
 
120 120
 	/**
@@ -124,19 +124,19 @@  discard block
 block discarded – undo
124 124
 	 *
125 125
 	 * @param string $hook Page hook.
126 126
 	 */
127
-	public function admin_enqueue_styles( $hook ) {
127
+	public function admin_enqueue_styles($hook) {
128 128
 		// Give Admin Only.
129
-		if ( ! apply_filters( 'give_load_admin_styles', give_is_admin_page(), $hook ) ) {
129
+		if ( ! apply_filters('give_load_admin_styles', give_is_admin_page(), $hook)) {
130 130
 			return;
131 131
 		}
132 132
 
133 133
 		// Give enqueues.
134
-		wp_enqueue_style( 'give-admin-styles' );
135
-		wp_enqueue_style( 'give-admin-bar-notification' );
134
+		wp_enqueue_style('give-admin-styles');
135
+		wp_enqueue_style('give-admin-bar-notification');
136 136
 
137 137
 		// WP Core enqueues.
138
-		wp_enqueue_style( 'wp-color-picker' );
139
-		wp_enqueue_style( 'thickbox' ); // @TODO remove once we have modal API.
138
+		wp_enqueue_style('wp-color-picker');
139
+		wp_enqueue_style('thickbox'); // @TODO remove once we have modal API.
140 140
 
141 141
 	}
142 142
 
@@ -147,27 +147,27 @@  discard block
 block discarded – undo
147 147
 	 *
148 148
 	 * @param string $hook Page hook.
149 149
 	 */
150
-	public function admin_enqueue_scripts( $hook ) {
150
+	public function admin_enqueue_scripts($hook) {
151 151
 		global $pagenow;
152 152
 
153 153
 		// Plugin page script
154
-		if ( 'plugins.php' === $pagenow ) {
154
+		if ('plugins.php' === $pagenow) {
155 155
 			$this->plugin_equeue_scripts();
156 156
 		}
157 157
 
158 158
 		// Give Admin Only.
159
-		if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) {
159
+		if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
160 160
 			return;
161 161
 		}
162 162
 
163 163
 		// WP Scripts.
164
-		wp_enqueue_script( 'wp-color-picker' );
165
-		wp_enqueue_script( 'jquery-ui-datepicker' );
166
-		wp_enqueue_script( 'thickbox' );
164
+		wp_enqueue_script('wp-color-picker');
165
+		wp_enqueue_script('jquery-ui-datepicker');
166
+		wp_enqueue_script('thickbox');
167 167
 		wp_enqueue_media();
168 168
 
169 169
 		// Give admin scripts.
170
-		wp_enqueue_script( 'give-admin-scripts' );
170
+		wp_enqueue_script('give-admin-scripts');
171 171
 
172 172
 		// Localize admin scripts
173 173
 		$this->admin_localize_scripts();
@@ -183,19 +183,19 @@  discard block
 block discarded – undo
183 183
 	 *
184 184
 	 */
185 185
 	private function plugin_equeue_scripts() {
186
-		wp_enqueue_style( 'plugin-deactivation-survey-css' );
187
-		wp_enqueue_script( 'plugin-deactivation-survey-js' );
186
+		wp_enqueue_style('plugin-deactivation-survey-css');
187
+		wp_enqueue_script('plugin-deactivation-survey-js');
188 188
 
189 189
 		$localized_data = array(
190
-			'nonce'                           => wp_create_nonce( 'deactivation_survey_nonce' ),
191
-			'cancel'                          => __( 'Cancel', 'give' ),
192
-			'deactivation_no_option_selected' => __( 'Error: Please select at least one option.', 'give' ),
193
-			'submit_and_deactivate'           => __( 'Submit and Deactivate', 'give' ),
194
-			'skip_and_deactivate'             => __( 'Skip & Deactivate', 'give' ),
195
-			'please_fill_field'               => __( 'Error: Please fill the field.', 'give' ),
190
+			'nonce'                           => wp_create_nonce('deactivation_survey_nonce'),
191
+			'cancel'                          => __('Cancel', 'give'),
192
+			'deactivation_no_option_selected' => __('Error: Please select at least one option.', 'give'),
193
+			'submit_and_deactivate'           => __('Submit and Deactivate', 'give'),
194
+			'skip_and_deactivate'             => __('Skip & Deactivate', 'give'),
195
+			'please_fill_field'               => __('Error: Please fill the field.', 'give'),
196 196
 
197 197
 		);
198
-		wp_localize_script( 'plugin-deactivation-survey-js', 'give_vars', $localized_data );
198
+		wp_localize_script('plugin-deactivation-survey-js', 'give_vars', $localized_data);
199 199
 	}
200 200
 
201 201
 	/**
@@ -212,119 +212,119 @@  discard block
 block discarded – undo
212 212
 
213 213
 		// Localize strings & variables for JS.
214 214
 		$localized_data = array(
215
-			'post_id'                           => isset( $post->ID ) ? $post->ID : null,
215
+			'post_id'                           => isset($post->ID) ? $post->ID : null,
216 216
 			'give_version'                      => GIVE_VERSION,
217 217
 			'thousands_separator'               => $thousand_separator,
218 218
 			'decimal_separator'                 => $decimal_separator,
219
-			'quick_edit_warning'                => __( 'Not available for variable priced forms.', 'give' ),
220
-			'delete_payment'                    => __( 'Are you sure you want to <strong>permanently</strong> delete this donation?', 'give' ),
221
-			'delete_payment_note'               => __( 'Are you sure you want to delete this note?', 'give' ),
222
-			'revoke_api_key'                    => __( 'Are you sure you want to revoke this API key?', 'give' ),
223
-			'regenerate_api_key'                => __( 'Are you sure you want to regenerate this API key?', 'give' ),
224
-			'resend_receipt'                    => __( 'Are you sure you want to resend the donation receipt?', 'give' ),
225
-			'disconnect_user'                   => __( 'Are you sure you want to disconnect the user from this donor?', 'give' ),
226
-			'one_option'                        => __( 'Choose a form', 'give' ),
227
-			'one_or_more_option'                => __( 'Choose one or more forms', 'give' ),
228
-			'currency_sign'                     => give_currency_filter( '' ),
229
-			'currency_pos'                      => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
219
+			'quick_edit_warning'                => __('Not available for variable priced forms.', 'give'),
220
+			'delete_payment'                    => __('Are you sure you want to <strong>permanently</strong> delete this donation?', 'give'),
221
+			'delete_payment_note'               => __('Are you sure you want to delete this note?', 'give'),
222
+			'revoke_api_key'                    => __('Are you sure you want to revoke this API key?', 'give'),
223
+			'regenerate_api_key'                => __('Are you sure you want to regenerate this API key?', 'give'),
224
+			'resend_receipt'                    => __('Are you sure you want to resend the donation receipt?', 'give'),
225
+			'disconnect_user'                   => __('Are you sure you want to disconnect the user from this donor?', 'give'),
226
+			'one_option'                        => __('Choose a form', 'give'),
227
+			'one_or_more_option'                => __('Choose one or more forms', 'give'),
228
+			'currency_sign'                     => give_currency_filter(''),
229
+			'currency_pos'                      => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
230 230
 			'currency_decimals'                 => give_get_price_decimals(),
231
-			'ok'                                => __( 'Ok', 'give' ),
232
-			'cancel'                            => __( 'Cancel', 'give' ),
233
-			'success'                           => __( 'Success', 'give' ),
234
-			'error'                             => __( 'Error', 'give' ),
235
-			'close'                             => __( 'Close', 'give' ),
236
-			'confirm'                           => __( 'Confirm', 'give' ),
237
-			'confirm_action'                    => __( 'Confirm Action', 'give' ),
238
-			'confirm_deletion'                  => __( 'Confirm Deletion', 'give' ),
239
-			'confirm_delete_donation'           => __( 'Confirm Delete Donation', 'give' ),
240
-			'confirm_resend'                    => __( 'Confirm re-send', 'give' ),
241
-			'confirm_bulk_action'               => __( 'Confirm bulk action', 'give' ),
242
-			'restart_upgrade'                   => __( 'Do you want to restart the update process?', 'give' ),
243
-			'restart_update'                    => __( 'It is recommended that you backup your database before proceeding. Do you want to run the update now?', 'give' ),
244
-			'stop_upgrade'                      => __( 'Do you want to stop the update process now?', 'give' ),
245
-			'import_failed'                     => __( 'Import failed', 'give' ),
246
-			'flush_success'                     => __( 'Flush success', 'give' ),
247
-			'flush_error'                       => __( 'Flush error', 'give' ),
248
-			'no_form_selected'                  => __( 'No form selected', 'give' ),
249
-			'batch_export_no_class'             => __( 'You must choose a method.', 'give' ),
250
-			'batch_export_no_reqs'              => __( 'Required fields not completed.', 'give' ),
251
-			'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' ),
252
-			'delete_test_donor'                 => __( 'Are you sure you want to delete all the test donors? This process will also delete test donations as well.', 'give' ),
253
-			'delete_import_donor'               => __( 'Are you sure you want to delete all the imported donors? This process will also delete imported donations as well.', 'give' ),
254
-			'price_format_guide'                => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ),
231
+			'ok'                                => __('Ok', 'give'),
232
+			'cancel'                            => __('Cancel', 'give'),
233
+			'success'                           => __('Success', 'give'),
234
+			'error'                             => __('Error', 'give'),
235
+			'close'                             => __('Close', 'give'),
236
+			'confirm'                           => __('Confirm', 'give'),
237
+			'confirm_action'                    => __('Confirm Action', 'give'),
238
+			'confirm_deletion'                  => __('Confirm Deletion', 'give'),
239
+			'confirm_delete_donation'           => __('Confirm Delete Donation', 'give'),
240
+			'confirm_resend'                    => __('Confirm re-send', 'give'),
241
+			'confirm_bulk_action'               => __('Confirm bulk action', 'give'),
242
+			'restart_upgrade'                   => __('Do you want to restart the update process?', 'give'),
243
+			'restart_update'                    => __('It is recommended that you backup your database before proceeding. Do you want to run the update now?', 'give'),
244
+			'stop_upgrade'                      => __('Do you want to stop the update process now?', 'give'),
245
+			'import_failed'                     => __('Import failed', 'give'),
246
+			'flush_success'                     => __('Flush success', 'give'),
247
+			'flush_error'                       => __('Flush error', 'give'),
248
+			'no_form_selected'                  => __('No form selected', 'give'),
249
+			'batch_export_no_class'             => __('You must choose a method.', 'give'),
250
+			'batch_export_no_reqs'              => __('Required fields not completed.', 'give'),
251
+			'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'),
252
+			'delete_test_donor'                 => __('Are you sure you want to delete all the test donors? This process will also delete test donations as well.', 'give'),
253
+			'delete_import_donor'               => __('Are you sure you want to delete all the imported donors? This process will also delete imported donations as well.', 'give'),
254
+			'price_format_guide'                => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator),
255 255
 			/* translators : %s: Donation form options metabox */
256
-			'confirm_before_remove_row_text'    => __( 'Do you want to delete this item?', 'give' ),
257
-			'matched_success_failure_page'      => __( 'You cannot set the success and failed pages to the same page', 'give' ),
258
-			'dismiss_notice_text'               => __( 'Dismiss this notice.', 'give' ),
259
-			'search_placeholder'                => __( 'Type to search all forms', 'give' ),
260
-			'search_placeholder_donor'          => __( 'Type to search all donors', 'give' ),
261
-			'search_placeholder_country'        => __( 'Type to search all countries', 'give' ),
262
-			'search_placeholder_state'          => __( 'Type to search all states/provinces', 'give' ),
263
-			'unlock_donor_fields_title'         => __( 'Action forbidden', 'give' ),
264
-			'unlock_donor_fields_message'       => __( 'To edit first name and last name, please go to user profile of the donor.', 'give' ),
265
-			'remove_from_bulk_delete'           => __( 'Remove from Bulk Delete', 'give' ),
256
+			'confirm_before_remove_row_text'    => __('Do you want to delete this item?', 'give'),
257
+			'matched_success_failure_page'      => __('You cannot set the success and failed pages to the same page', 'give'),
258
+			'dismiss_notice_text'               => __('Dismiss this notice.', 'give'),
259
+			'search_placeholder'                => __('Type to search all forms', 'give'),
260
+			'search_placeholder_donor'          => __('Type to search all donors', 'give'),
261
+			'search_placeholder_country'        => __('Type to search all countries', 'give'),
262
+			'search_placeholder_state'          => __('Type to search all states/provinces', 'give'),
263
+			'unlock_donor_fields_title'         => __('Action forbidden', 'give'),
264
+			'unlock_donor_fields_message'       => __('To edit first name and last name, please go to user profile of the donor.', 'give'),
265
+			'remove_from_bulk_delete'           => __('Remove from Bulk Delete', 'give'),
266 266
 			'donors_bulk_action'                => array(
267 267
 				'no_donor_selected'  => array(
268
-					'title' => __( 'No donors selected', 'give' ),
269
-					'desc'  => __( 'You must choose at least one or more donors to delete.', 'give' )
268
+					'title' => __('No donors selected', 'give'),
269
+					'desc'  => __('You must choose at least one or more donors to delete.', 'give')
270 270
 				),
271 271
 				'no_action_selected' => array(
272
-					'title' => __( 'No action selected', 'give' ),
273
-					'desc'  => __( 'You must select a bulk action to proceed.', 'give' ),
272
+					'title' => __('No action selected', 'give'),
273
+					'desc'  => __('You must select a bulk action to proceed.', 'give'),
274 274
 				),
275 275
 			),
276 276
 			'donations_bulk_action'             => array(
277 277
 				'titles'         => array(
278
-					'zero' => __( 'No payments selected', 'give' ),
278
+					'zero' => __('No payments selected', 'give'),
279 279
 				),
280 280
 				'delete'         => array(
281
-					'zero'     => __( 'You must choose at least one or more donations to delete.', 'give' ),
282
-					'single'   => __( 'Are you sure you want to permanently delete this donation?', 'give' ),
283
-					'multiple' => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ),
281
+					'zero'     => __('You must choose at least one or more donations to delete.', 'give'),
282
+					'single'   => __('Are you sure you want to permanently delete this donation?', 'give'),
283
+					'multiple' => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'),
284 284
 				),
285 285
 				'resend-receipt' => array(
286
-					'zero'     => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ),
287
-					'single'   => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ),
288
-					'multiple' => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ),
286
+					'zero'     => __('You must choose at least one or more recipients to resend the email receipt.', 'give'),
287
+					'single'   => __('Are you sure you want to resend the email receipt to this recipient?', 'give'),
288
+					'multiple' => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'),
289 289
 				),
290 290
 				'set-to-status'  => array(
291
-					'zero'     => __( 'You must choose at least one or more donations to set status to {status}.', 'give' ),
292
-					'single'   => __( 'Are you sure you want to set status of this donation to {status}?', 'give' ),
293
-					'multiple' => __( 'Are you sure you want to set status of {payment_count} donations to {status}?', 'give' ),
291
+					'zero'     => __('You must choose at least one or more donations to set status to {status}.', 'give'),
292
+					'single'   => __('Are you sure you want to set status of this donation to {status}?', 'give'),
293
+					'multiple' => __('Are you sure you want to set status of {payment_count} donations to {status}?', 'give'),
294 294
 				),
295 295
 			),
296 296
 			'updates'                           => array(
297
-				'ajax_error' => __( 'Please reload this page and try again', 'give' ),
297
+				'ajax_error' => __('Please reload this page and try again', 'give'),
298 298
 			),
299 299
 			'metabox_fields'                    => array(
300 300
 				'media' => array(
301
-					'button_title' => __( 'Choose Image', 'give' ),
301
+					'button_title' => __('Choose Image', 'give'),
302 302
 				),
303 303
 				'file'  => array(
304
-					'button_title' => __( 'Choose File', 'give' ),
304
+					'button_title' => __('Choose File', 'give'),
305 305
 				),
306 306
 			),
307 307
 			'chosen'                            => array(
308
-				'no_results_msg'  => __( 'No results match {search_term}', 'give' ),
309
-				'ajax_search_msg' => __( 'Searching results for match {search_term}', 'give' ),
308
+				'no_results_msg'  => __('No results match {search_term}', 'give'),
309
+				'ajax_search_msg' => __('Searching results for match {search_term}', 'give'),
310 310
 			),
311
-			'db_update_confirmation_msg_button' => __( 'Run Updates', 'give' ),
312
-			'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' ),
313
-			'error_message'                     => __( 'Something went wrong kindly try again!', 'give' ),
311
+			'db_update_confirmation_msg_button' => __('Run Updates', 'give'),
312
+			'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'),
313
+			'error_message'                     => __('Something went wrong kindly try again!', 'give'),
314 314
 			'give_donation_import'              => 'give_donation_import',
315 315
 			'core_settings_import'              => 'give_core_settings_import',
316
-			'setting_not_save_message'          => __( 'Changes you made may not be saved.', 'give' ),
316
+			'setting_not_save_message'          => __('Changes you made may not be saved.', 'give'),
317 317
 			'give_donation_amounts'             => array(
318
-				'minimum' => apply_filters( 'give_donation_minimum_limit', 1 ),
319
-				'maximum' => apply_filters( 'give_donation_maximum_limit', 999999.99 ),
318
+				'minimum' => apply_filters('give_donation_minimum_limit', 1),
319
+				'maximum' => apply_filters('give_donation_maximum_limit', 999999.99),
320 320
 			),
321
-			'chosen_add_title_prefix'           => __( 'No result found. Press enter to add', 'give' ),
322
-			'db_update_nonce'                   => wp_create_nonce( Give_Updates::$background_updater->get_identifier() ),
321
+			'chosen_add_title_prefix'           => __('No result found. Press enter to add', 'give'),
322
+			'db_update_nonce'                   => wp_create_nonce(Give_Updates::$background_updater->get_identifier()),
323 323
 			'ajax'                              => give_test_ajax_works(),
324 324
 			'date_format'                       => give_get_localized_date_format_to_js(),
325 325
 		);
326 326
 
327
-		wp_localize_script( 'give-admin-scripts', 'give_vars', $localized_data );
327
+		wp_localize_script('give-admin-scripts', 'give_vars', $localized_data);
328 328
 	}
329 329
 
330 330
 	/**
@@ -335,10 +335,10 @@  discard block
 block discarded – undo
335 335
 		<style type="text/css" media="screen">
336 336
 			@font-face {
337 337
 				font-family: 'give-icomoon';
338
-				src: url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.eot?ngjl88'; ?>');
339
-				src: url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
340
-				url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
341
-				url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
338
+				src: url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.eot?ngjl88'; ?>');
339
+				src: url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
340
+				url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
341
+				url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
342 342
 				font-weight: normal;
343 343
 				font-style: normal;
344 344
 			}
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	 * @since 2.1.0
362 362
 	 */
363 363
 	public function public_enqueue_styles() {
364
-		wp_enqueue_style( 'give-styles' );
364
+		wp_enqueue_style('give-styles');
365 365
 	}
366 366
 
367 367
 
@@ -373,17 +373,17 @@  discard block
 block discarded – undo
373 373
 	public function public_enqueue_scripts() {
374 374
 
375 375
 		// Call Babel Polyfill with common handle so that it is compatible with plugins and themes.
376
-		if ( ! wp_script_is( 'babel-polyfill', 'enqueued' ) ) {
376
+		if ( ! wp_script_is('babel-polyfill', 'enqueued')) {
377 377
 			wp_enqueue_script(
378 378
 				'babel-polyfill',
379
-				GIVE_PLUGIN_URL . 'assets/dist/js/babel-polyfill.js',
380
-				array( 'jquery' ),
379
+				GIVE_PLUGIN_URL.'assets/dist/js/babel-polyfill.js',
380
+				array('jquery'),
381 381
 				GIVE_VERSION,
382 382
 				false
383 383
 			);
384 384
 		}
385 385
 
386
-		wp_enqueue_script( 'give' );
386
+		wp_enqueue_script('give');
387 387
 
388 388
 		$this->public_localize_scripts();
389 389
 	}
@@ -402,22 +402,22 @@  discard block
 block discarded – undo
402 402
 		 *
403 403
 		 * @return  string $message Send notice message for email access.
404 404
 		 */
405
-		$message = (string) apply_filters( 'give_email_access_mail_send_notice', __( 'Please check your email and click on the link to access your complete donation history.', 'give' ) );
405
+		$message = (string) apply_filters('give_email_access_mail_send_notice', __('Please check your email and click on the link to access your complete donation history.', 'give'));
406 406
 
407
-		$localize_give_vars = apply_filters( 'give_global_script_vars', array(
407
+		$localize_give_vars = apply_filters('give_global_script_vars', array(
408 408
 			'ajaxurl'                     => give_get_ajax_url(),
409
-			'checkout_nonce'              => wp_create_nonce( 'give_checkout_nonce' ),
409
+			'checkout_nonce'              => wp_create_nonce('give_checkout_nonce'),
410 410
 			// Do not use this nonce. Its deprecated.
411 411
 			'currency'                    => give_get_currency(),
412
-			'currency_sign'               => give_currency_filter( '' ),
412
+			'currency_sign'               => give_currency_filter(''),
413 413
 			'currency_pos'                => give_get_currency_position(),
414 414
 			'thousands_separator'         => give_get_price_thousand_separator(),
415 415
 			'decimal_separator'           => give_get_price_decimal_separator(),
416
-			'no_gateway'                  => __( 'Please select a payment method.', 'give' ),
417
-			'bad_minimum'                 => __( 'The minimum custom donation amount for this form is', 'give' ),
418
-			'bad_maximum'                 => __( 'The maximum custom donation amount for this form is', 'give' ),
419
-			'general_loading'             => __( 'Loading...', 'give' ),
420
-			'purchase_loading'            => __( 'Please Wait...', 'give' ),
416
+			'no_gateway'                  => __('Please select a payment method.', 'give'),
417
+			'bad_minimum'                 => __('The minimum custom donation amount for this form is', 'give'),
418
+			'bad_maximum'                 => __('The maximum custom donation amount for this form is', 'give'),
419
+			'general_loading'             => __('Loading...', 'give'),
420
+			'purchase_loading'            => __('Please Wait...', 'give'),
421 421
 			'number_decimals'             => give_get_price_decimals(),
422 422
 			'give_version'                => GIVE_VERSION,
423 423
 			'magnific_options'            => apply_filters(
@@ -431,32 +431,32 @@  discard block
 block discarded – undo
431 431
 				'give_form_translation_js',
432 432
 				array(
433 433
 					// Field name               Validation message.
434
-					'payment-mode'           => __( 'Please select payment mode.', 'give' ),
435
-					'give_first'             => __( 'Please enter your first name.', 'give' ),
436
-					'give_email'             => __( 'Please enter a valid email address.', 'give' ),
437
-					'give_user_login'        => __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ),
438
-					'give_user_pass'         => __( 'Enter a password.', 'give' ),
439
-					'give_user_pass_confirm' => __( 'Enter the password confirmation.', 'give' ),
440
-					'give_agree_to_terms'    => __( 'You must agree to the terms and conditions.', 'give' ),
434
+					'payment-mode'           => __('Please select payment mode.', 'give'),
435
+					'give_first'             => __('Please enter your first name.', 'give'),
436
+					'give_email'             => __('Please enter a valid email address.', 'give'),
437
+					'give_user_login'        => __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'),
438
+					'give_user_pass'         => __('Enter a password.', 'give'),
439
+					'give_user_pass_confirm' => __('Enter the password confirmation.', 'give'),
440
+					'give_agree_to_terms'    => __('You must agree to the terms and conditions.', 'give'),
441 441
 				)
442 442
 			),
443 443
 			'confirm_email_sent_message'  => $message,
444
-			'ajax_vars'                   => apply_filters( 'give_global_ajax_vars', array(
444
+			'ajax_vars'                   => apply_filters('give_global_ajax_vars', array(
445 445
 				'ajaxurl'         => give_get_ajax_url(),
446
-				'ajaxNonce'       => wp_create_nonce( 'give_ajax_nonce' ),
447
-				'loading'         => __( 'Loading', 'give' ),
446
+				'ajaxNonce'       => wp_create_nonce('give_ajax_nonce'),
447
+				'loading'         => __('Loading', 'give'),
448 448
 				// General loading message.
449
-				'select_option'   => __( 'Please select an option', 'give' ),
449
+				'select_option'   => __('Please select an option', 'give'),
450 450
 				// Variable pricing error with multi-donation option enabled.
451
-				'default_gateway' => give_get_default_gateway( null ),
452
-				'permalinks'      => get_option( 'permalink_structure' ) ? '1' : '0',
451
+				'default_gateway' => give_get_default_gateway(null),
452
+				'permalinks'      => get_option('permalink_structure') ? '1' : '0',
453 453
 				'number_decimals' => give_get_price_decimals(),
454
-			) ),
454
+			)),
455 455
 			'cookie_hash'                 => COOKIEHASH,
456
-			'delete_session_nonce_cookie' => absint( Give()->session->is_delete_nonce_cookie() )
457
-		) );
456
+			'delete_session_nonce_cookie' => absint(Give()->session->is_delete_nonce_cookie())
457
+		));
458 458
 
459
-		wp_localize_script( 'give', 'give_global_vars', $localize_give_vars );
459
+		wp_localize_script('give', 'give_global_vars', $localize_give_vars);
460 460
 
461 461
 	}
462 462
 
@@ -470,15 +470,15 @@  discard block
 block discarded – undo
470 470
 	 */
471 471
 	public function get_frontend_stylesheet_uri() {
472 472
 
473
-		$file          = 'give' . $this->direction . '.css';
473
+		$file          = 'give'.$this->direction.'.css';
474 474
 		$templates_dir = give_get_theme_template_dir_name();
475 475
 
476 476
 		// Directory paths to CSS files to support checking via file_exists().
477
-		$child_theme_style_sheet    = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file;
478
-		$child_theme_style_sheet_2  = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give' . $this->direction . '.css';
479
-		$parent_theme_style_sheet   = trailingslashit( get_template_directory() ) . $templates_dir . $file;
480
-		$parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give' . $this->direction . '.css';
481
-		$give_plugin_style_sheet    = trailingslashit( GIVE_PLUGIN_DIR ) . 'assets/dist/css/' . $file;
477
+		$child_theme_style_sheet    = trailingslashit(get_stylesheet_directory()).$templates_dir.$file;
478
+		$child_theme_style_sheet_2  = trailingslashit(get_stylesheet_directory()).$templates_dir.'give'.$this->direction.'.css';
479
+		$parent_theme_style_sheet   = trailingslashit(get_template_directory()).$templates_dir.$file;
480
+		$parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give'.$this->direction.'.css';
481
+		$give_plugin_style_sheet    = trailingslashit(GIVE_PLUGIN_DIR).'assets/dist/css/'.$file;
482 482
 		$uri                        = false;
483 483
 
484 484
 		/**
@@ -489,23 +489,23 @@  discard block
 block discarded – undo
489 489
 		 * c. followed by non minified version, even if SCRIPT_DEBUG is not enabled. This allows users to copy just give.css to their theme.
490 490
 		 * d. Finally, fallback to the standard Give version. This is the default styles included within the plugin.
491 491
 		 */
492
-		if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) {
493
-			if ( ! empty( $nonmin ) ) {
494
-				$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give' . $this->direction . '.css';
492
+		if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) {
493
+			if ( ! empty($nonmin)) {
494
+				$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give'.$this->direction.'.css';
495 495
 			} else {
496
-				$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file;
496
+				$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file;
497 497
 			}
498
-		} elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) {
499
-			if ( ! empty( $nonmin ) ) {
500
-				$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give' . $this->direction . '.css';
498
+		} elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) {
499
+			if ( ! empty($nonmin)) {
500
+				$uri = trailingslashit(get_template_directory_uri()).$templates_dir.'give'.$this->direction.'.css';
501 501
 			} else {
502
-				$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file;
502
+				$uri = trailingslashit(get_template_directory_uri()).$templates_dir.$file;
503 503
 			}
504
-		} elseif ( file_exists( $give_plugin_style_sheet ) ) {
505
-			$uri = trailingslashit( GIVE_PLUGIN_URL ) . 'assets/dist/css/' . $file;
504
+		} elseif (file_exists($give_plugin_style_sheet)) {
505
+			$uri = trailingslashit(GIVE_PLUGIN_URL).'assets/dist/css/'.$file;
506 506
 		}
507 507
 
508
-		return apply_filters( 'give_get_stylesheet_uri', $uri );
508
+		return apply_filters('give_get_stylesheet_uri', $uri);
509 509
 
510 510
 	}
511 511
 
@@ -517,19 +517,19 @@  discard block
 block discarded – undo
517 517
 		// Enqueue the bundled block JS file
518 518
 		wp_enqueue_script(
519 519
 			'give-blocks-js',
520
-			GIVE_PLUGIN_URL . 'assets/dist/js/gutenberg.js',
521
-			array( 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api' ),
520
+			GIVE_PLUGIN_URL.'assets/dist/js/gutenberg.js',
521
+			array('wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api'),
522 522
 			GIVE_VERSION
523 523
 		);
524 524
 
525 525
 		// Enqueue public styles
526
-		wp_enqueue_style( 'give-styles' );
526
+		wp_enqueue_style('give-styles');
527 527
 
528 528
 		// Enqueue the bundled block css file
529 529
 		wp_enqueue_style(
530 530
 			'give-blocks-css',
531
-			GIVE_PLUGIN_URL . 'assets/dist/css/gutenberg.css',
532
-			array( 'wp-blocks' ),
531
+			GIVE_PLUGIN_URL.'assets/dist/css/gutenberg.css',
532
+			array('wp-blocks'),
533 533
 			GIVE_VERSION
534 534
 		);
535 535
 
Please login to merge, or discard this patch.