Test Failed
Push — master ( 15dfc4...36ff7d )
by Devin
06:56
created
templates/history-donations.php 2 patches
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -4,56 +4,56 @@  discard block
 block discarded – undo
4 4
  */
5 5
 
6 6
 $donations             = array();
7
-$donation_history_args = Give()->session->get( 'give_donation_history_args' );
7
+$donation_history_args = Give()->session->get('give_donation_history_args');
8 8
 
9 9
 // User's Donations.
10
-if ( is_user_logged_in() ) {
11
-	$donations = give_get_users_donations( get_current_user_id(), 20, true, 'any' );
12
-} elseif ( Give()->email_access->token_exists ) {
10
+if (is_user_logged_in()) {
11
+	$donations = give_get_users_donations(get_current_user_id(), 20, true, 'any');
12
+} elseif (Give()->email_access->token_exists) {
13 13
 	// Email Access Token?
14
-	$donations = give_get_users_donations( 0, 20, true, 'any' );
14
+	$donations = give_get_users_donations(0, 20, true, 'any');
15 15
 } elseif (
16 16
 	false !== Give()->session->get_session_expiration() ||
17 17
 	true === give_get_history_session()
18 18
 ) {
19 19
 	// Session active?
20
-	$email           = Give()->session->get( 'give_email' );
21
-	$donor           = Give()->donors->get_donor_by( 'email', $email );
22
-	$donations_count = count( explode( ',', $donor->payment_ids ) );
20
+	$email           = Give()->session->get('give_email');
21
+	$donor           = Give()->donors->get_donor_by('email', $email);
22
+	$donations_count = count(explode(',', $donor->payment_ids));
23 23
 
24
-	if ( $donations_count > give_get_limit_display_donations() ) {
24
+	if ($donations_count > give_get_limit_display_donations()) {
25 25
 
26 26
 		// Restrict Security Email Access option, if donation count of a donor is less than or equal to limit.
27
-		if ( true !== Give_Cache::get( "give_cache_email_throttle_limit_exhausted_{$donor->id}" ) ) {
28
-			add_action( 'give_donation_history_table_end', 'give_donation_history_table_end' );
27
+		if (true !== Give_Cache::get("give_cache_email_throttle_limit_exhausted_{$donor->id}")) {
28
+			add_action('give_donation_history_table_end', 'give_donation_history_table_end');
29 29
 		} else {
30 30
 			$value = Give()->email_access->verify_throttle / 60;
31 31
 
32
-			give_set_error( 'give-limited-throttle', sprintf(
33
-				__( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ),
34
-				sprintf( _n( '%s minute', '%s minutes', $value, 'give' ), $value )
35
-			) );
32
+			give_set_error('give-limited-throttle', sprintf(
33
+				__('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'),
34
+				sprintf(_n('%s minute', '%s minutes', $value, 'give'), $value)
35
+			));
36 36
 
37 37
 		}
38 38
 
39
-		$donations = give_get_users_donations( $email, give_get_limit_display_donations(), true, 'any' );
39
+		$donations = give_get_users_donations($email, give_get_limit_display_donations(), true, 'any');
40 40
 	} else {
41
-		$donations = give_get_users_donations( $email, 20, true, 'any' );
41
+		$donations = give_get_users_donations($email, 20, true, 'any');
42 42
 	}
43 43
 }
44 44
 
45
-Give()->notices->render_frontend_notices( 0 );
45
+Give()->notices->render_frontend_notices(0);
46 46
 
47
-if ( $donations ) : ?>
47
+if ($donations) : ?>
48 48
 	<?php
49 49
 	$table_headings = array(
50
-		'id'             => __( 'ID', 'give' ),
51
-		'date'           => __( 'Date', 'give' ),
52
-		'donor'          => __( 'Donor', 'give' ),
53
-		'amount'         => __( 'Amount', 'give' ),
54
-		'status'         => __( 'Status', 'give' ),
55
-		'payment_method' => __( 'Payment Method', 'give' ),
56
-		'details'        => __( 'Details', 'give' ),
50
+		'id'             => __('ID', 'give'),
51
+		'date'           => __('Date', 'give'),
52
+		'donor'          => __('Donor', 'give'),
53
+		'amount'         => __('Amount', 'give'),
54
+		'status'         => __('Status', 'give'),
55
+		'payment_method' => __('Payment Method', 'give'),
56
+		'details'        => __('Details', 'give'),
57 57
 	);
58 58
 	?>
59 59
 	<div class="give_user_history_main" >
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
 				 *
70 70
 				 * @since 1.7
71 71
 				 */
72
-				do_action( 'give_donation_history_header_before' );
72
+				do_action('give_donation_history_header_before');
73 73
 
74
-				foreach ( $donation_history_args as $index => $value ) {
75
-					if ( filter_var( $donation_history_args[ $index ], FILTER_VALIDATE_BOOLEAN ) ) :
74
+				foreach ($donation_history_args as $index => $value) {
75
+					if (filter_var($donation_history_args[$index], FILTER_VALIDATE_BOOLEAN)) :
76 76
 						echo sprintf(
77 77
 							'<th scope="col" class="give-donation-%1$s>">%2$s</th>',
78 78
 							$index,
79
-							$table_headings[ $index ]
79
+							$table_headings[$index]
80 80
 						);
81 81
 					endif;
82 82
 				}
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 				 *
89 89
 				 * @since 1.7
90 90
 				 */
91
-				do_action( 'give_donation_history_header_after' );
91
+				do_action('give_donation_history_header_after');
92 92
 				?>
93 93
 			</tr>
94 94
 			</thead>
95
-			<?php foreach ( $donations as $post ) :
96
-				setup_postdata( $post );
97
-				$donation_data = give_get_payment_meta( $post->ID ); ?>
95
+			<?php foreach ($donations as $post) :
96
+				setup_postdata($post);
97
+				$donation_data = give_get_payment_meta($post->ID); ?>
98 98
 				<tr class="give-donation-row">
99 99
 					<?php
100 100
 					/**
@@ -107,37 +107,37 @@  discard block
 block discarded – undo
107 107
 					 * @param int   $post_id       The ID of the post.
108 108
 					 * @param mixed $donation_data Payment meta data.
109 109
 					 */
110
-					do_action( 'give_donation_history_row_start', $post->ID, $donation_data );
110
+					do_action('give_donation_history_row_start', $post->ID, $donation_data);
111 111
 
112
-					if ( filter_var( $donation_history_args['id'], FILTER_VALIDATE_BOOLEAN ) ) :
112
+					if (filter_var($donation_history_args['id'], FILTER_VALIDATE_BOOLEAN)) :
113 113
 						echo sprintf(
114 114
 							'<td class="give-donation-id"><span class="title-for-mobile">%2$s</span>%1$s</td>',
115
-							give_get_payment_number( $post->ID ), esc_html( $table_headings['id'] )
115
+							give_get_payment_number($post->ID), esc_html($table_headings['id'])
116 116
 						);
117 117
 					endif;
118 118
 
119
-					if ( filter_var( $donation_history_args['date'], FILTER_VALIDATE_BOOLEAN ) ) :
119
+					if (filter_var($donation_history_args['date'], FILTER_VALIDATE_BOOLEAN)) :
120 120
 						echo sprintf(
121 121
 							'<td class="give-donation-date"><span class="title-for-mobile">%2$s</span>%1$s</td>',
122
-							date_i18n( give_date_format(), strtotime( get_post_field( 'post_date', $post->ID ) ) ), esc_html( $table_headings['date'] )
122
+							date_i18n(give_date_format(), strtotime(get_post_field('post_date', $post->ID))), esc_html($table_headings['date'])
123 123
 						);
124 124
 					endif;
125 125
 
126
-					if ( filter_var( $donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN ) ) :
126
+					if (filter_var($donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN)) :
127 127
 						echo sprintf(
128 128
 							'<td class="give-donation-donor"><span class="title-for-mobile">%2$s</span>%1$s</td>',
129
-							give_get_donor_name_by( $post->ID ), $table_headings['donor']
129
+							give_get_donor_name_by($post->ID), $table_headings['donor']
130 130
 						);
131 131
 					endif;
132 132
 					?>
133 133
 
134
-					<?php if ( filter_var( $donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
134
+					<?php if (filter_var($donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN)) : ?>
135 135
 						<td class="give-donation-amount">
136
-						<?php printf( '<span class="title-for-mobile">%1$s</span>', esc_html( $table_headings['amount'] ) ); ?>
136
+						<?php printf('<span class="title-for-mobile">%1$s</span>', esc_html($table_headings['amount'])); ?>
137 137
 						<span class="give-donation-amount">
138 138
 							<?php
139
-							$currency_code   = give_get_payment_currency_code( $post->ID );
140
-							$donation_amount = give_donation_amount( $post->ID, true );
139
+							$currency_code   = give_get_payment_currency_code($post->ID);
140
+							$donation_amount = give_donation_amount($post->ID, true);
141 141
 
142 142
 							/**
143 143
 							 * Filters the donation amount on Donation History Page.
@@ -149,45 +149,45 @@  discard block
 block discarded – undo
149 149
 							 *
150 150
 							 * @return int
151 151
 							 */
152
-							echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID );
152
+							echo apply_filters('give_donation_history_row_amount', $donation_amount, $post->ID);
153 153
 							?>
154 154
 						</span>
155 155
 						</td>
156 156
 					<?php endif; ?>
157 157
 
158 158
 					<?php
159
-					if ( filter_var( $donation_history_args['status'], FILTER_VALIDATE_BOOLEAN ) ) :
159
+					if (filter_var($donation_history_args['status'], FILTER_VALIDATE_BOOLEAN)) :
160 160
 						echo sprintf(
161 161
 							'<td class="give-donation-status"><span class="title-for-mobile">%2$s</span>%1$s</td>',
162
-							give_get_payment_status( $post, true ),
163
-							esc_html( $table_headings['status'] )
162
+							give_get_payment_status($post, true),
163
+							esc_html($table_headings['status'])
164 164
 						);
165 165
 					endif;
166 166
 
167
-					if ( filter_var( $donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN ) ) :
167
+					if (filter_var($donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN)) :
168 168
 						echo sprintf(
169 169
 							'<td class="give-donation-payment-method"><span class="title-for-mobile">%2$s</span>%1$s</td>',
170
-							give_get_gateway_checkout_label( give_get_payment_gateway( $post->ID ) ),
171
-							esc_html( $table_headings['payment_method'] )
170
+							give_get_gateway_checkout_label(give_get_payment_gateway($post->ID)),
171
+							esc_html($table_headings['payment_method'])
172 172
 						);
173 173
 					endif;
174 174
 					?>
175 175
 					<td class="give-donation-details">
176 176
 						<?php
177 177
 						// Display View Receipt or.
178
-						if ( 'publish' !== $post->post_status && 'subscription' !== $post->post_status ) :
178
+						if ('publish' !== $post->post_status && 'subscription' !== $post->post_status) :
179 179
 							echo sprintf(
180 180
 								'<span class="title-for-mobile">%4$s</span><a href="%1$s"><span class="give-donation-status %2$s">%3$s</span></a>',
181 181
 								esc_url(
182 182
 									add_query_arg(
183 183
 										'payment_key',
184
-										give_get_payment_key( $post->ID ),
184
+										give_get_payment_key($post->ID),
185 185
 										give_get_history_page_uri()
186 186
 									)
187 187
 								),
188 188
 								$post->post_status,
189
-								__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' &raquo;',
190
-								esc_html( $table_headings['details'] )
189
+								__('View', 'give').' '.give_get_payment_status($post, true).' &raquo;',
190
+								esc_html($table_headings['details'])
191 191
 							);
192 192
 
193 193
 						else :
@@ -196,12 +196,12 @@  discard block
 block discarded – undo
196 196
 								esc_url(
197 197
 									add_query_arg(
198 198
 										'payment_key',
199
-										give_get_payment_key( $post->ID ),
199
+										give_get_payment_key($post->ID),
200 200
 										give_get_history_page_uri()
201 201
 									)
202 202
 								),
203
-								__( 'View Receipt &raquo;', 'give' ),
204
-								esc_html( $table_headings['details'] )
203
+								__('View Receipt &raquo;', 'give'),
204
+								esc_html($table_headings['details'])
205 205
 							);
206 206
 
207 207
 						endif;
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 					 * @param int   $post_id       The ID of the post.
219 219
 					 * @param mixed $donation_data Payment meta data.
220 220
 					 */
221
-					do_action( 'give_donation_history_row_end', $post->ID, $donation_data );
221
+					do_action('give_donation_history_row_end', $post->ID, $donation_data);
222 222
 					?>
223 223
 				</tr>
224 224
 			<?php endforeach; ?>
@@ -231,22 +231,22 @@  discard block
 block discarded – undo
231 231
 			 *
232 232
 			 * @since 1.8.17
233 233
 			 */
234
-			do_action( 'give_donation_history_table_end' );
234
+			do_action('give_donation_history_table_end');
235 235
 			?>
236 236
 		</table>
237 237
 		<div id="give-donation-history-pagination" class="give_pagination navigation">
238 238
 			<?php
239 239
 			$big = 999999;
240
-			echo paginate_links( array(
241
-				'base'    => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
240
+			echo paginate_links(array(
241
+				'base'    => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
242 242
 				'format'  => '?paged=%#%',
243
-				'current' => max( 1, get_query_var( 'paged' ) ),
244
-				'total'   => ceil( give_count_donations_of_donor() / 20 ), // 20 items per page
245
-			) );
243
+				'current' => max(1, get_query_var('paged')),
244
+				'total'   => ceil(give_count_donations_of_donor() / 20), // 20 items per page
245
+			));
246 246
 			?>
247 247
 		</div>
248 248
 	</div>
249 249
 	<?php wp_reset_postdata(); ?>
250 250
 <?php else : ?>
251
-	<?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?>
251
+	<?php Give()->notices->print_frontend_notice(__('It looks like you haven\'t made any donations.', 'give'), true, 'success'); ?>
252 252
 <?php endif;
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -190,7 +190,8 @@  discard block
 block discarded – undo
190 190
 								esc_html( $table_headings['details'] )
191 191
 							);
192 192
 
193
-						else :
193
+						else {
194
+							:
194 195
 							echo sprintf(
195 196
 								'<span class="title-for-mobile">%3$s</span><a href="%1$s">%2$s</a>',
196 197
 								esc_url(
@@ -203,6 +204,7 @@  discard block
 block discarded – undo
203 204
 								__( 'View Receipt &raquo;', 'give' ),
204 205
 								esc_html( $table_headings['details'] )
205 206
 							);
207
+						}
206 208
 
207 209
 						endif;
208 210
 						?>
@@ -247,6 +249,9 @@  discard block
 block discarded – undo
247 249
 		</div>
248 250
 	</div>
249 251
 	<?php wp_reset_postdata(); ?>
250
-<?php else : ?>
251
-	<?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?>
252
+<?php else {
253
+	: ?>
254
+	<?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' );
255
+}
256
+?>
252 257
 <?php endif;
Please login to merge, or discard this patch.
templates/shortcode-totals-progress.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -4,26 +4,26 @@  discard block
 block discarded – undo
4 4
  */
5 5
 
6 6
 // Bail out if total goal is empty.
7
-if ( empty( $total_goal ) ) {
7
+if (empty($total_goal)) {
8 8
 	return false;
9 9
 }
10 10
 
11 11
 // Set Give total progress bar color.
12
-$color = apply_filters( 'give_totals_progress_color', '#2bc253' );
12
+$color = apply_filters('give_totals_progress_color', '#2bc253');
13 13
 
14 14
 // Give total.
15
-$total = ! empty( $total ) ? $total : 0;
15
+$total = ! empty($total) ? $total : 0;
16 16
 
17 17
 /**
18 18
  * Filter the goal progress output
19 19
  *
20 20
  * @since 2.1
21 21
  */
22
-$progress = round( ( $total / $total_goal ) * 100, 2 );
22
+$progress = round(($total / $total_goal) * 100, 2);
23 23
 
24 24
 // Set progress to 100 percentage if total > total_goal
25 25
 $progress = $total >= $total_goal ? 100 : $progress;
26
-$progress = apply_filters( 'give_goal_totals_funded_percentage_output', $progress, $total, $total_goal );
26
+$progress = apply_filters('give_goal_totals_funded_percentage_output', $progress, $total, $total_goal);
27 27
 
28 28
 ?>
29 29
 <div class="give-goal-progress">
@@ -31,16 +31,16 @@  discard block
 block discarded – undo
31 31
 		<?php
32 32
 		echo sprintf(
33 33
 		/* translators: %s: percentage of the amount raised compared to the goal target */
34
-			__( '<span class="give-percentage">%s%%</span> funded', 'give' ),
35
-			round( $progress )
34
+			__('<span class="give-percentage">%s%%</span> funded', 'give'),
35
+			round($progress)
36 36
 		);
37 37
 		?>
38 38
 	</div>
39 39
 
40 40
 	<div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"
41
-	     aria-valuenow="<?php echo esc_attr( $progress ); ?>">
42
-			<span style="width: <?php echo esc_attr( $progress ); ?>%;<?php if ( ! empty( $color ) ) {
43
-				echo 'background-color:' . $color;
41
+	     aria-valuenow="<?php echo esc_attr($progress); ?>">
42
+			<span style="width: <?php echo esc_attr($progress); ?>%;<?php if ( ! empty($color)) {
43
+				echo 'background-color:'.$color;
44 44
 			} ?>"></span>
45 45
 	</div><!-- /.give-progress-bar -->
46 46
 
Please login to merge, or discard this patch.
templates/shortcode-profile-editor.php 2 patches
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -7,25 +7,25 @@  discard block
 block discarded – undo
7 7
  * @copyright    Copyright (c) 2016, WordImpress
8 8
  * @license      https://opensource.org/licenses/gpl-license GNU Public License
9 9
  */
10
-$current_user     = wp_get_current_user();
10
+$current_user = wp_get_current_user();
11 11
 
12
-if ( is_user_logged_in() ) :
12
+if (is_user_logged_in()) :
13 13
 	$user_id = get_current_user_id();
14
-	$first_name   = get_user_meta( $user_id, 'first_name', true );
15
-	$last_name    = get_user_meta( $user_id, 'last_name', true );
16
-	$last_name    = get_user_meta( $user_id, 'last_name', true );
14
+	$first_name   = get_user_meta($user_id, 'first_name', true);
15
+	$last_name    = get_user_meta($user_id, 'last_name', true);
16
+	$last_name    = get_user_meta($user_id, 'last_name', true);
17 17
 	$display_name = $current_user->display_name;
18
-	$address      = give_get_donor_address( $user_id, array( 'address_type' => 'personal' ) );
18
+	$address      = give_get_donor_address($user_id, array('address_type' => 'personal'));
19 19
 
20
-	$donor        = new Give_Donor( $user_id, true );
21
-	$company_name = $donor->get_meta( '_give_donor_company', true );
20
+	$donor        = new Give_Donor($user_id, true);
21
+	$company_name = $donor->get_meta('_give_donor_company', true);
22 22
 
23
-	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) :
24
-		if ( isset( $_GET['update_code'] ) ) :?>
23
+	if (isset($_GET['updated']) && 'true' === $_GET['updated'] && ! give_get_errors()) :
24
+		if (isset($_GET['update_code'])) :?>
25 25
 			<?php
26
-			switch ( $_GET['update_code'] ) {
26
+			switch ($_GET['update_code']) {
27 27
 				case '1':
28
-					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile has been updated.', 'give' ) );
28
+					printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your profile has been updated.', 'give'));
29 29
 					break;
30 30
 			}
31 31
 			?>
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 		<?php endif; ?>
34 34
 	<?php endif; ?>
35 35
 
36
-	<?php Give()->notices->render_frontend_notices( 0 ); ?>
36
+	<?php Give()->notices->render_frontend_notices(0); ?>
37 37
 
38 38
 	<?php
39 39
 	/**
@@ -43,59 +43,59 @@  discard block
 block discarded – undo
43 43
 	 *
44 44
 	 * @since 1.0
45 45
 	 */
46
-	do_action( 'give_profile_editor_before' );
46
+	do_action('give_profile_editor_before');
47 47
 	?>
48 48
 
49 49
 	<form id="give_profile_editor_form" class="give-form" action="<?php echo give_get_current_page_url(); ?>"
50 50
 	      method="post">
51 51
 
52 52
 		<fieldset>
53
-			<legend id="give_profile_name_label"><?php _e( 'Profile', 'give' ); ?></legend>
53
+			<legend id="give_profile_name_label"><?php _e('Profile', 'give'); ?></legend>
54 54
 
55 55
 			<h3 id="give_personal_information_label"
56
-			    class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3>
56
+			    class="give-section-break"><?php _e('Change your Name', 'give'); ?></h3>
57 57
 
58 58
 			<p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive">
59 59
 				<label for="give_first_name">
60
-					<?php _e( 'First Name', 'give' ); ?>
60
+					<?php _e('First Name', 'give'); ?>
61 61
 					<span class="give-required-indicator  ">*</span>
62 62
 				</label>
63 63
 				<input name="give_first_name" id="give_first_name" class="text give-input" type="text"
64
-				       value="<?php echo esc_attr( $first_name ); ?>"/>
64
+				       value="<?php echo esc_attr($first_name); ?>"/>
65 65
 			</p>
66 66
 
67 67
 			<p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive">
68
-				<label for="give_last_name"><?php _e( 'Last Name', 'give' ); ?></label>
68
+				<label for="give_last_name"><?php _e('Last Name', 'give'); ?></label>
69 69
 				<input name="give_last_name" id="give_last_name" class="text give-input" type="text"
70
-				       value="<?php echo esc_attr( $last_name ); ?>"/>
70
+				       value="<?php echo esc_attr($last_name); ?>"/>
71 71
 			</p>
72 72
 
73
-			<?php if ( ! empty( $company_name ) ) : ?>
73
+			<?php if ( ! empty($company_name)) : ?>
74 74
 				<p id="give_profile_company_name_wrap" class="form-row form-row-wide">
75
-					<label for="give_company_name"><?php _e( 'Company Name', 'give' ); ?></label>
75
+					<label for="give_company_name"><?php _e('Company Name', 'give'); ?></label>
76 76
 					<input name="give_company_name" id="give_company_name" class="text give-input" type="text"
77
-					       value="<?php echo esc_attr( $company_name ); ?>"/>
77
+					       value="<?php echo esc_attr($company_name); ?>"/>
78 78
 				</p>
79 79
 			<?php endif; ?>
80 80
 
81 81
 			<p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive">
82
-				<label for="give_display_name"><?php _e( 'Display Name', 'give' ); ?></label>
82
+				<label for="give_display_name"><?php _e('Display Name', 'give'); ?></label>
83 83
 				<select name="give_display_name" id="give_display_name" class="select give-select">
84
-					<?php if ( ! empty( $current_user->first_name ) ): ?>
85
-						<option <?php selected( $display_name, $current_user->first_name ); ?>
86
-							value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option>
84
+					<?php if ( ! empty($current_user->first_name)): ?>
85
+						<option <?php selected($display_name, $current_user->first_name); ?>
86
+							value="<?php echo esc_attr($current_user->first_name); ?>"><?php echo esc_html($current_user->first_name); ?></option>
87 87
 					<?php endif; ?>
88
-					<option <?php selected( $display_name, $current_user->user_nicename ); ?>
89
-						value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option>
90
-					<?php if ( ! empty( $current_user->last_name ) ): ?>
91
-						<option <?php selected( $display_name, $current_user->last_name ); ?>
92
-							value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option>
88
+					<option <?php selected($display_name, $current_user->user_nicename); ?>
89
+						value="<?php echo esc_attr($current_user->user_nicename); ?>"><?php echo esc_html($current_user->user_nicename); ?></option>
90
+					<?php if ( ! empty($current_user->last_name)): ?>
91
+						<option <?php selected($display_name, $current_user->last_name); ?>
92
+							value="<?php echo esc_attr($current_user->last_name); ?>"><?php echo esc_html($current_user->last_name); ?></option>
93 93
 					<?php endif; ?>
94
-					<?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?>
95
-						<option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?>
96
-							value="<?php echo esc_attr( $current_user->first_name . ' ' . $current_user->last_name ); ?>"><?php echo esc_html( $current_user->first_name . ' ' . $current_user->last_name ); ?></option>
97
-						<option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?>
98
-							value="<?php echo esc_attr( $current_user->last_name . ' ' . $current_user->first_name ); ?>"><?php echo esc_html( $current_user->last_name . ' ' . $current_user->first_name ); ?></option>
94
+					<?php if ( ! empty($current_user->first_name) && ! empty($current_user->last_name)): ?>
95
+						<option <?php selected($display_name, $current_user->first_name.' '.$current_user->last_name); ?>
96
+							value="<?php echo esc_attr($current_user->first_name.' '.$current_user->last_name); ?>"><?php echo esc_html($current_user->first_name.' '.$current_user->last_name); ?></option>
97
+						<option <?php selected($display_name, $current_user->last_name.' '.$current_user->first_name); ?>
98
+							value="<?php echo esc_attr($current_user->last_name.' '.$current_user->first_name); ?>"><?php echo esc_html($current_user->last_name.' '.$current_user->first_name); ?></option>
99 99
 					<?php endif; ?>
100 100
 				</select>
101 101
 				<?php
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 				 *
107 107
 				 * @since 1.0
108 108
 				 */
109
-				do_action( 'give_profile_editor_name' );
109
+				do_action('give_profile_editor_name');
110 110
 				?>
111 111
 			</p>
112 112
 
@@ -118,16 +118,16 @@  discard block
 block discarded – undo
118 118
 			 *
119 119
 			 * @since 1.0
120 120
 			 */
121
-			do_action( 'give_profile_editor_after_name' );
121
+			do_action('give_profile_editor_after_name');
122 122
 			?>
123 123
 
124 124
 			<p class="form-row form-row-last form-row-responsive">
125 125
 				<label for="give_email">
126
-					<?php _e( 'Email Address', 'give' ); ?>
126
+					<?php _e('Email Address', 'give'); ?>
127 127
 					<span class="give-required-indicator  ">*</span>
128 128
 				</label>
129 129
 				<input name="give_email" id="give_email" class="text give-input required" type="email"
130
-				       value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/>
130
+				       value="<?php echo esc_attr($current_user->user_email); ?>" required aria-required="true"/>
131 131
 				<?php
132 132
 				/**
133 133
 				 * Fires in the profile editor shortcode, to the email section.
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 				 *
137 137
 				 * @since 1.0
138 138
 				 */
139
-				do_action( 'give_profile_editor_email' );
139
+				do_action('give_profile_editor_email');
140 140
 				?>
141 141
 			</p>
142 142
 
@@ -148,21 +148,21 @@  discard block
 block discarded – undo
148 148
 			 *
149 149
 			 * @since 1.0
150 150
 			 */
151
-			do_action( 'give_profile_editor_after_email' );
151
+			do_action('give_profile_editor_after_email');
152 152
 			?>
153 153
 
154 154
 			<h3 id="give_profile_password_label"
155
-			    class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3>
155
+			    class="give-section-break"><?php _e('Change your Password', 'give'); ?></h3>
156 156
 
157 157
 			<div id="give_profile_password_wrap" class="give-clearfix">
158 158
 				<p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive">
159
-					<label for="give_new_user_pass1"><?php _e( 'New Password', 'give' ); ?></label>
159
+					<label for="give_new_user_pass1"><?php _e('New Password', 'give'); ?></label>
160 160
 					<input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input"
161 161
 					       type="password"/>
162 162
 				</p>
163 163
 
164 164
 				<p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive">
165
-					<label for="give_new_user_pass2"><?php _e( 'Re-enter Password', 'give' ); ?></label>
165
+					<label for="give_new_user_pass2"><?php _e('Re-enter Password', 'give'); ?></label>
166 166
 					<input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input"
167 167
 					       type="password"/>
168 168
 					<?php
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
 					 *
174 174
 					 * @since 1.0
175 175
 					 */
176
-					do_action( 'give_profile_editor_password' );
176
+					do_action('give_profile_editor_password');
177 177
 					?>
178 178
 				</p>
179 179
 			</div>
180 180
 
181
-			<p class="give_password_change_notice"><?php _e( 'Please note after changing your password, you must log back in.', 'give' ); ?></p>
181
+			<p class="give_password_change_notice"><?php _e('Please note after changing your password, you must log back in.', 'give'); ?></p>
182 182
 
183 183
 			<?php
184 184
 			/**
@@ -188,17 +188,17 @@  discard block
 block discarded – undo
188 188
 			 *
189 189
 			 * @since 1.0
190 190
 			 */
191
-			do_action( 'give_profile_editor_after_password' );
191
+			do_action('give_profile_editor_after_password');
192 192
 			?>
193 193
 
194 194
 			<p id="give_profile_submit_wrap">
195 195
 				<input type="hidden" name="give_profile_editor_nonce"
196
-				       value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/>
196
+				       value="<?php echo wp_create_nonce('give-profile-editor-nonce'); ?>"/>
197 197
 				<input type="hidden" name="give_action" value="edit_user_profile"/>
198 198
 				<input type="hidden" name="give_redirect"
199
-				       value="<?php echo esc_url( give_get_current_page_url() ); ?>"/>
199
+				       value="<?php echo esc_url(give_get_current_page_url()); ?>"/>
200 200
 				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit"
201
-				       class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/>
201
+				       class="give_submit" value="<?php _e('Save Changes', 'give'); ?>"/>
202 202
 			</p>
203 203
 
204 204
 		</fieldset>
@@ -213,23 +213,23 @@  discard block
 block discarded – undo
213 213
 	 *
214 214
 	 * @since 1.0
215 215
 	 */
216
-	do_action( 'give_profile_editor_after' );
216
+	do_action('give_profile_editor_after');
217 217
 	?>
218 218
 
219 219
 <?php
220 220
 else :
221
-	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) {
222
-		if ( isset( $_GET['update_code'] ) ) {
223
-			switch ( $_GET['update_code'] ) {
221
+	if (isset($_GET['updated']) && 'true' === $_GET['updated'] && ! give_get_errors()) {
222
+		if (isset($_GET['update_code'])) {
223
+			switch ($_GET['update_code']) {
224 224
 				case '2':
225
-					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile and password has been updated.', 'give' ) );
226
-					_e( 'Login with your new credentials.', 'give' );
225
+					printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your profile and password has been updated.', 'give'));
226
+					_e('Login with your new credentials.', 'give');
227 227
 					echo give_login_form();
228 228
 					break;
229 229
 
230 230
 				case '3':
231
-					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your password has been updated.', 'give' ) );
232
-					_e( 'Login with your new credentials.', 'give' );
231
+					printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your password has been updated.', 'give'));
232
+					_e('Login with your new credentials.', 'give');
233 233
 					echo give_login_form();
234 234
 					break;
235 235
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 			}
239 239
 		}
240 240
 	} else {
241
-		_e( 'You need to login to edit your profile.', 'give' );
241
+		_e('You need to login to edit your profile.', 'give');
242 242
 		echo give_login_form();
243 243
 	}
244 244
 endif;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -217,12 +217,14 @@
 block discarded – undo
217 217
 	?>
218 218
 
219 219
 <?php
220
-else :
220
+else {
221
+	:
221 222
 	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) {
222 223
 		if ( isset( $_GET['update_code'] ) ) {
223 224
 			switch ( $_GET['update_code'] ) {
224 225
 				case '2':
225 226
 					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile and password has been updated.', 'give' ) );
227
+}
226 228
 					_e( 'Login with your new credentials.', 'give' );
227 229
 					echo give_login_form();
228 230
 					break;
Please login to merge, or discard this patch.
templates/shortcode-receipt.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@  discard block
 block discarded – undo
6 6
 global $give_receipt_args, $payment;
7 7
 
8 8
 // Validation: Ensure $payment var is set.
9
-if ( empty( $payment ) ) {
10
-	$payment = ! empty( $give_receipt_args['id'] ) ? get_post( $give_receipt_args['id'] ) : 0;
9
+if (empty($payment)) {
10
+	$payment = ! empty($give_receipt_args['id']) ? get_post($give_receipt_args['id']) : 0;
11 11
 }
12 12
 
13 13
 // Double-Validation: Check for $payment global.
14
-if ( empty( $payment ) ) {
15
-	Give()->notices->print_frontend_notice( __( 'The specified receipt ID appears to be invalid.', 'give' ) );
14
+if (empty($payment)) {
15
+	Give()->notices->print_frontend_notice(__('The specified receipt ID appears to be invalid.', 'give'));
16 16
 
17 17
 	return;
18 18
 }
19 19
 
20 20
 $donation_id  = $payment->ID;
21
-$donation_number = Give()->seq_donation_number->get_serial_code( $payment->ID );
22
-$form_id      = give_get_payment_meta( $donation_id, '_give_payment_form_id', true );
23
-$donation     = give_get_donation_form_title( $donation_id );
24
-$user         = give_get_payment_meta_user_info( $donation_id );
25
-$email        = give_get_payment_user_email( $donation_id );
21
+$donation_number = Give()->seq_donation_number->get_serial_code($payment->ID);
22
+$form_id      = give_get_payment_meta($donation_id, '_give_payment_form_id', true);
23
+$donation     = give_get_donation_form_title($donation_id);
24
+$user         = give_get_payment_meta_user_info($donation_id);
25
+$email        = give_get_payment_user_email($donation_id);
26 26
 $status       = $payment->post_status;
27
-$status_label = give_get_payment_status( $payment, true );
28
-$company_name = give_get_payment_meta( $donation_id, '_give_donation_company', true );
27
+$status_label = give_get_payment_status($payment, true);
28
+$company_name = give_get_payment_meta($donation_id, '_give_donation_company', true);
29 29
 
30 30
 /**
31 31
  * Generate Donation Receipt Arguments.
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
  * @since 1.8.8
37 37
  */
38 38
 $give_receipt_args['donation_receipt']['donor'] = array(
39
-	'name'    => __( 'Donor', 'give' ),
40
-	'value'   => $user['first_name'] . ' ' . $user['last_name'],
39
+	'name'    => __('Donor', 'give'),
40
+	'value'   => $user['first_name'].' '.$user['last_name'],
41 41
 	'display' => $give_receipt_args['donor'],
42 42
 );
43 43
 
@@ -51,50 +51,50 @@  discard block
 block discarded – undo
51 51
  * @return bool show/hide company name in donation receipt page.
52 52
  */
53 53
 $give_receipt_args['donation_receipt']['company_name'] = array(
54
-	'name'    => __( 'Company Name', 'give' ),
55
-	'value'   => esc_attr( $company_name ),
54
+	'name'    => __('Company Name', 'give'),
55
+	'value'   => esc_attr($company_name),
56 56
 	'display' => $give_receipt_args['company_name'],
57 57
 );
58 58
 
59 59
 $give_receipt_args['donation_receipt']['date'] = array(
60
-	'name'    => __( 'Date', 'give' ),
61
-	'value'   => date_i18n( give_date_format(), strtotime( give_get_payment_completed_date( $donation_id ) ) ),
60
+	'name'    => __('Date', 'give'),
61
+	'value'   => date_i18n(give_date_format(), strtotime(give_get_payment_completed_date($donation_id))),
62 62
 	'display' => $give_receipt_args['date'],
63 63
 );
64 64
 
65 65
 $give_receipt_args['donation_receipt']['total_donation'] = array(
66
-	'name'    => __( 'Total Donation', 'give' ),
67
-	'value'   => give_donation_amount( $donation_id, array( 'currency' => true, 'amount' => true, 'type' => 'receipt' ) ),
66
+	'name'    => __('Total Donation', 'give'),
67
+	'value'   => give_donation_amount($donation_id, array('currency' => true, 'amount' => true, 'type' => 'receipt')),
68 68
 	'display' => $give_receipt_args['price'],
69 69
 );
70 70
 
71 71
 $give_receipt_args['donation_receipt']['donation'] = array(
72
-	'name'    => __( 'Donation', 'give' ),
72
+	'name'    => __('Donation', 'give'),
73 73
 	'value'   => $donation,
74 74
 	'display' => true,
75 75
 );
76 76
 
77 77
 $give_receipt_args['donation_receipt']['donation_status'] = array(
78
-	'name'    => __( 'Donation Status', 'give' ),
79
-	'value'   => esc_attr( $status_label ),
78
+	'name'    => __('Donation Status', 'give'),
79
+	'value'   => esc_attr($status_label),
80 80
 	'display' => $give_receipt_args['payment_status'],
81 81
 );
82 82
 
83 83
 $give_receipt_args['donation_receipt']['donation_id'] = array(
84
-	'name'    => __( 'Donation ID', 'give' ),
84
+	'name'    => __('Donation ID', 'give'),
85 85
 	'value'   => $donation_number,
86 86
 	'display' => $give_receipt_args['payment_id'],
87 87
 );
88 88
 
89 89
 $give_receipt_args['donation_receipt']['payment_key'] = array(
90
-	'name'    => __( 'Payment Key', 'give' ),
91
-	'value'   => get_post_meta( $donation_id, '_give_payment_purchase_key', true ),
90
+	'name'    => __('Payment Key', 'give'),
91
+	'value'   => get_post_meta($donation_id, '_give_payment_purchase_key', true),
92 92
 	'display' => $give_receipt_args['payment_key'],
93 93
 );
94 94
 
95 95
 $give_receipt_args['donation_receipt']['payment_method'] = array(
96
-	'name'    => __( 'Payment Method', 'give' ),
97
-	'value'   => give_get_gateway_checkout_label( give_get_payment_gateway( $donation_id ) ),
96
+	'name'    => __('Payment Method', 'give'),
97
+	'value'   => give_get_gateway_checkout_label(give_get_payment_gateway($donation_id)),
98 98
 	'display' => $give_receipt_args['payment_method'],
99 99
 );
100 100
 
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
  *
110 110
  * @since 1.8.8
111 111
  */
112
-$give_receipt_args['donation_receipt'] = apply_filters( 'give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id );
112
+$give_receipt_args['donation_receipt'] = apply_filters('give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id);
113 113
 
114 114
 // When the donation were made through offline donation, We won't show receipt and payment status though.
115
-if ( 'offline' === give_get_payment_gateway( $payment->ID ) && 'pending' === $status ) {
115
+if ('offline' === give_get_payment_gateway($payment->ID) && 'pending' === $status) {
116 116
 
117 117
 	/**
118 118
 	 * Before the offline donation receipt content starts.
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
 	 * @param Give_Payment $payment           Donation payment object.
123 123
 	 * @param array        $give_receipt_args Receipt Arguments.
124 124
 	 */
125
-	do_action( 'give_receipt_before_offline_payment', $payment, $give_receipt_args );
125
+	do_action('give_receipt_before_offline_payment', $payment, $give_receipt_args);
126 126
 	?>
127
-	<h2><?php echo apply_filters( 'give_receipt_offline_payment_heading', __( 'Your Donation is Almost Complete!', 'give' ) ); ?></h2>
128
-	<div id="give_donation_receipt" class="<?php echo esc_attr( apply_filters( 'give_receipt_offline_payment_classes', 'give_receipt_offline_payment' ) ); ?>">
127
+	<h2><?php echo apply_filters('give_receipt_offline_payment_heading', __('Your Donation is Almost Complete!', 'give')); ?></h2>
128
+	<div id="give_donation_receipt" class="<?php echo esc_attr(apply_filters('give_receipt_offline_payment_classes', 'give_receipt_offline_payment')); ?>">
129 129
 		<?php
130 130
 		// Instruction for offline donation.
131
-		$offline_instruction = give_get_offline_payment_instruction( $form_id, true );
131
+		$offline_instruction = give_get_offline_payment_instruction($form_id, true);
132 132
 
133 133
 		/**
134 134
 		 * Instruction for the offline donation.
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		 * @param Give_Payment $payment             Payment object.
140 140
 		 * @param integer      $form_id             Donation form id.
141 141
 		 */
142
-		echo apply_filters( 'give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id );
142
+		echo apply_filters('give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id);
143 143
 		?>
144 144
 	</div>
145 145
 	<?php
@@ -151,52 +151,52 @@  discard block
 block discarded – undo
151 151
 	 * @param Give_Payment $payment           Donation payment object.
152 152
 	 * @param array        $give_receipt_args Receipt Arguments.
153 153
 	 */
154
-	do_action( 'give_receipt_after_offline_payment', $payment, $give_receipt_args );
154
+	do_action('give_receipt_after_offline_payment', $payment, $give_receipt_args);
155 155
 
156 156
 	return;
157 157
 }
158 158
 
159 159
 // Show payment status notice based on shortcode attribute.
160
-if ( filter_var( $give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN ) ) {
160
+if (filter_var($give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN)) {
161 161
 	$notice_message = '';
162 162
 	$notice_type    = 'warning';
163 163
 
164
-	switch ( $status ) {
164
+	switch ($status) {
165 165
 		case 'publish':
166
-			$notice_message = __( 'Payment Complete: Thank you for your donation.', 'give' );
166
+			$notice_message = __('Payment Complete: Thank you for your donation.', 'give');
167 167
 			$notice_type    = 'success';
168 168
 			break;
169 169
 		case 'pending':
170
-			$notice_message = __( 'Payment Pending: Your donation is currently processing.', 'give' );
170
+			$notice_message = __('Payment Pending: Your donation is currently processing.', 'give');
171 171
 			$notice_type    = 'warning';
172 172
 			break;
173 173
 		case 'refunded':
174
-			$notice_message = __( 'Payment Refunded: Your donation has been refunded.', 'give' );
174
+			$notice_message = __('Payment Refunded: Your donation has been refunded.', 'give');
175 175
 			$notice_type    = 'warning';
176 176
 			break;
177 177
 		case 'preapproval':
178
-			$notice_message = __( 'Payment Preapproved: Thank you for your donation.', 'give' );
178
+			$notice_message = __('Payment Preapproved: Thank you for your donation.', 'give');
179 179
 			$notice_type    = 'warning';
180 180
 			break;
181 181
 		case 'failed':
182
-			$notice_message = __( 'Payment Failed: Please contact the site owner for assistance.', 'give' );
182
+			$notice_message = __('Payment Failed: Please contact the site owner for assistance.', 'give');
183 183
 			$notice_type    = 'error';
184 184
 			break;
185 185
 		case 'cancelled':
186
-			$notice_message = __( 'Payment Cancelled: Your donation has been cancelled.', 'give' );
186
+			$notice_message = __('Payment Cancelled: Your donation has been cancelled.', 'give');
187 187
 			$notice_type    = 'error';
188 188
 			break;
189 189
 		case 'abandoned':
190
-			$notice_message = __( 'Payment Abandoned: This donation has not been completed.', 'give' );
190
+			$notice_message = __('Payment Abandoned: This donation has not been completed.', 'give');
191 191
 			$notice_type    = 'error';
192 192
 			break;
193 193
 		case 'revoked':
194
-			$notice_message = __( 'Payment Revoked: Please contact the site owner for assistance.', 'give' );
194
+			$notice_message = __('Payment Revoked: Please contact the site owner for assistance.', 'give');
195 195
 			$notice_type    = 'error';
196 196
 			break;
197 197
 	}
198 198
 
199
-	if ( ! empty( $notice_message ) ) {
199
+	if ( ! empty($notice_message)) {
200 200
 		/**
201 201
 		 * Filters payment status notice for receipts.
202 202
 		 *
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 		 * @param string $status Payment status.
212 212
 		 * @param int $donation_id Donation ID.
213 213
 		 */
214
-		echo apply_filters( 'give_receipt_status_notice', Give()->notices->print_frontend_notice( $notice_message, false, $notice_type ), $id, $status, $donation_id );
214
+		echo apply_filters('give_receipt_status_notice', Give()->notices->print_frontend_notice($notice_message, false, $notice_type), $id, $status, $donation_id);
215 215
 	}
216 216
 }// End if().
217 217
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
  * @param object $payment           The payment object.
226 226
  * @param array  $give_receipt_args Receipt_argument.
227 227
  */
228
-do_action( 'give_payment_receipt_before_table', $payment, $give_receipt_args );
228
+do_action('give_payment_receipt_before_table', $payment, $give_receipt_args);
229 229
 ?>
230 230
 
231 231
 <table id="give_donation_receipt" class="give-table">
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
 	 * @param object $payment           The payment object.
242 242
 	 * @param array  $give_receipt_args Receipt_argument.
243 243
 	 */
244
-	do_action( 'give_payment_receipt_header_before', $payment, $give_receipt_args );
244
+	do_action('give_payment_receipt_header_before', $payment, $give_receipt_args);
245 245
 	?>
246 246
 	<tr>
247 247
 		<th scope="colgroup" colspan="2">
248
-			<span class="give-receipt-thead-text"><?php esc_html_e( 'Donation Receipt', 'give' ) ?></span>
248
+			<span class="give-receipt-thead-text"><?php esc_html_e('Donation Receipt', 'give') ?></span>
249 249
 		</th>
250 250
 	</tr>
251 251
 	<?php
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	 * @param object $payment           The payment object.
260 260
 	 * @param array  $give_receipt_args Receipt_argument.
261 261
 	 */
262
-	do_action( 'give_payment_receipt_header_after', $payment, $give_receipt_args );
262
+	do_action('give_payment_receipt_header_after', $payment, $give_receipt_args);
263 263
 	?>
264 264
 	</thead>
265 265
 
@@ -275,11 +275,11 @@  discard block
 block discarded – undo
275 275
 	 * @param object $payment           The payment object.
276 276
 	 * @param array  $give_receipt_args Receipt_argument.
277 277
 	 */
278
-	do_action( 'give_payment_receipt_before', $payment, $give_receipt_args );
278
+	do_action('give_payment_receipt_before', $payment, $give_receipt_args);
279 279
 	?>
280 280
 
281
-	<?php foreach ( $give_receipt_args['donation_receipt'] as $receipt_item ) { ?>
282
-		<?php if ( filter_var( $receipt_item['display'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
281
+	<?php foreach ($give_receipt_args['donation_receipt'] as $receipt_item) { ?>
282
+		<?php if (filter_var($receipt_item['display'], FILTER_VALIDATE_BOOLEAN)) : ?>
283 283
 			<tr>
284 284
 				<td scope="row"><strong><?php echo $receipt_item['name']; ?></strong></td>
285 285
 				<td><?php echo $receipt_item['value']; ?></td>
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 	 * @param object $payment           The payment object.
299 299
 	 * @param array  $give_receipt_args Receipt_argument.
300 300
 	 */
301
-	do_action( 'give_payment_receipt_after', $payment, $give_receipt_args );
301
+	do_action('give_payment_receipt_after', $payment, $give_receipt_args);
302 302
 	?>
303 303
 	</tbody>
304 304
 </table>
@@ -314,5 +314,5 @@  discard block
 block discarded – undo
314 314
  * @param object $payment           The payment object.
315 315
  * @param array  $give_receipt_args Receipt_argument.
316 316
  */
317
-do_action( 'give_payment_receipt_after_table', $payment, $give_receipt_args );
317
+do_action('give_payment_receipt_after_table', $payment, $give_receipt_args);
318 318
 ?>
Please login to merge, or discard this patch.
templates/shortcode-form-grid.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  */
5 5
 
6 6
 // Exit if accessed directly.
7
-if ( ! defined( 'ABSPATH' ) ) {
7
+if ( ! defined('ABSPATH')) {
8 8
 	exit;
9 9
 }
10 10
 
@@ -19,16 +19,16 @@  discard block
 block discarded – undo
19 19
 <div class="give-grid__item">
20 20
 	<?php
21 21
 	// Print the opening anchor tag based on display style.
22
-	if ( 'redirect' === $atts['display_style'] ) {
22
+	if ('redirect' === $atts['display_style']) {
23 23
 		printf(
24 24
 			'<a id="give-card-%1$s" class="give-card" href="%2$s">',
25
-			esc_attr( $form_id ),
26
-			esc_attr( get_the_permalink() )
25
+			esc_attr($form_id),
26
+			esc_attr(get_the_permalink())
27 27
 		);
28
-	} elseif ( 'modal_reveal' === $atts['display_style'] ) {
28
+	} elseif ('modal_reveal' === $atts['display_style']) {
29 29
 		printf(
30 30
 			'<a id="give-card-%1$s" class="give-card js-give-grid-modal-launcher" data-effect="mfp-zoom-out" href="#give-modal-form-%1$s">',
31
-			esc_attr( $form_id )
31
+			esc_attr($form_id)
32 32
 		);
33 33
 	}
34 34
 	?>
@@ -36,46 +36,46 @@  discard block
 block discarded – undo
36 36
 		<div class="give-card__body">
37 37
 			<?php
38 38
 			// Maybe display the form title.
39
-			if ( true === $atts['show_title'] ) {
40
-				the_title( '<h3 class="give-card__title">', '</h3>' );
39
+			if (true === $atts['show_title']) {
40
+				the_title('<h3 class="give-card__title">', '</h3>');
41 41
 			}
42 42
 
43 43
 			// Maybe display the form excerpt.
44
-			if ( true === $atts['show_excerpt'] ) {
45
-				if ( has_excerpt( $form_id ) ) {
44
+			if (true === $atts['show_excerpt']) {
45
+				if (has_excerpt($form_id)) {
46 46
 					// Get excerpt from the form post's excerpt field.
47
-					$raw_content      = get_the_excerpt( $form_id );
47
+					$raw_content      = get_the_excerpt($form_id);
48 48
 					$stripped_content = wp_strip_all_tags(
49
-						strip_shortcodes( $raw_content )
49
+						strip_shortcodes($raw_content)
50 50
 					);
51 51
 				} else {
52 52
 					// Get content from the form post's content field.
53
-					$raw_content = give_get_meta( $form_id, '_give_form_content', true );
53
+					$raw_content = give_get_meta($form_id, '_give_form_content', true);
54 54
 
55
-					if ( ! empty( $raw_content ) ) {
55
+					if ( ! empty($raw_content)) {
56 56
 						$stripped_content = wp_strip_all_tags(
57
-							strip_shortcodes( $raw_content )
57
+							strip_shortcodes($raw_content)
58 58
 						);
59 59
 					}
60 60
 				}
61 61
 
62 62
 				// Maybe truncate excerpt.
63
-				if ( 0 < $atts['excerpt_length'] ) {
64
-					$excerpt = wp_trim_words( $stripped_content, $atts['excerpt_length'] );
63
+				if (0 < $atts['excerpt_length']) {
64
+					$excerpt = wp_trim_words($stripped_content, $atts['excerpt_length']);
65 65
 				} else {
66 66
 					$excerpt = $stripped_content;
67 67
 				}
68 68
 
69
-				printf( '<p class="give-card__text">%s</p>', $excerpt );
69
+				printf('<p class="give-card__text">%s</p>', $excerpt);
70 70
 			}
71 71
 
72 72
 			// Maybe display the goal progess bar.
73 73
 			if (
74
-				give_is_setting_enabled( get_post_meta( $form_id, '_give_goal_option', true ) )
74
+				give_is_setting_enabled(get_post_meta($form_id, '_give_goal_option', true))
75 75
 				&& true === $atts['show_goal']
76 76
 			) {
77 77
 				echo '<div class="give-card__progress">';
78
-					give_show_goal_progress( $form_id );
78
+					give_show_goal_progress($form_id);
79 79
 				echo '</div>';
80 80
 			}
81 81
 			?>
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		<?php
85 85
 		// Maybe display the featured image.
86 86
 		if (
87
-			give_is_setting_enabled( $give_settings['form_featured_img'] )
87
+			give_is_setting_enabled($give_settings['form_featured_img'])
88 88
 			&& has_post_thumbnail()
89 89
 			&& true === $atts['show_featured_image']
90 90
 		) {
@@ -94,28 +94,28 @@  discard block
 block discarded – undo
94 94
 			 * @param string The image size.
95 95
 			 * @param array  Form grid attributes.
96 96
 			 */
97
-			$image_size = apply_filters( 'give_form_grid_image_size', $atts['image_size'], $atts );
97
+			$image_size = apply_filters('give_form_grid_image_size', $atts['image_size'], $atts);
98 98
 			$image_attr = '';
99 99
 
100 100
 			echo '<div class="give-card__media">';
101
-				if ( 'auto' !== $atts['image_height'] ) {
101
+				if ('auto' !== $atts['image_height']) {
102 102
 					$image_attr = array(
103
-						'style' => 'height: ' . $atts['image_height'],
103
+						'style' => 'height: '.$atts['image_height'],
104 104
 					);
105 105
 				}
106
-				the_post_thumbnail( $image_size, $image_attr );
106
+				the_post_thumbnail($image_size, $image_attr);
107 107
 			echo '</div>';
108 108
 		}
109 109
 		?>
110 110
 	</a>
111 111
 	<?php
112 112
 	// If modal, print form in hidden container until it is time to be revealed.
113
-	if ( 'modal_reveal' === $atts['display_style'] ) {
113
+	if ('modal_reveal' === $atts['display_style']) {
114 114
 		printf(
115 115
 			'<div id="give-modal-form-%1$s" class="give-donation-grid-item-form give-modal--slide mfp-hide">',
116 116
 			$form_id
117 117
 		);
118
-		give_get_donation_form( $form_id );
118
+		give_get_donation_form($form_id);
119 119
 		echo '</div>';
120 120
 	}
121 121
 	?>
Please login to merge, or discard this patch.
templates/shortcode-goal.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
 
9 9
 // Sanity check - ensure form has pass all condition to show goal.
10 10
 if ( ( isset( $args['show_goal'] ) && ! filter_var( $args['show_goal'], FILTER_VALIDATE_BOOLEAN ) )
11
-     || empty( $form->ID )
12
-     || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) )
13
-     || ! give_is_setting_enabled( $goal_option ) || 0 === $form->goal ) {
11
+	 || empty( $form->ID )
12
+	 || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) )
13
+	 || ! give_is_setting_enabled( $goal_option ) || 0 === $form->goal ) {
14 14
 	return false;
15 15
 }
16 16
 
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -3,59 +3,59 @@  discard block
 block discarded – undo
3 3
  * This template is used to display the goal with [give_goal]
4 4
  */
5 5
 
6
-$form        = new Give_Donate_Form( $form_id );
7
-$goal_option = give_get_meta( $form->ID, '_give_goal_option', true );
6
+$form        = new Give_Donate_Form($form_id);
7
+$goal_option = give_get_meta($form->ID, '_give_goal_option', true);
8 8
 
9 9
 // Sanity check - ensure form has pass all condition to show goal.
10
-if ( ( isset( $args['show_goal'] ) && ! filter_var( $args['show_goal'], FILTER_VALIDATE_BOOLEAN ) )
11
-     || empty( $form->ID )
12
-     || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) )
13
-     || ! give_is_setting_enabled( $goal_option ) || 0 === $form->goal ) {
10
+if ((isset($args['show_goal']) && ! filter_var($args['show_goal'], FILTER_VALIDATE_BOOLEAN))
11
+     || empty($form->ID)
12
+     || (is_singular('give_forms') && ! give_is_setting_enabled($goal_option))
13
+     || ! give_is_setting_enabled($goal_option) || 0 === $form->goal) {
14 14
 	return false;
15 15
 }
16 16
 
17
-$goal_format = give_get_meta( $form_id, '_give_goal_format', true );
18
-$price       = give_get_meta( $form_id, '_give_set_price', true );
19
-$color       = give_get_meta( $form_id, '_give_goal_color', true );
20
-$show_text   = isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true;
21
-$show_bar    = isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true;
17
+$goal_format = give_get_meta($form_id, '_give_goal_format', true);
18
+$price       = give_get_meta($form_id, '_give_set_price', true);
19
+$color       = give_get_meta($form_id, '_give_goal_color', true);
20
+$show_text   = isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true;
21
+$show_bar    = isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true;
22 22
 
23 23
 /**
24 24
  * Filter the form income
25 25
  *
26 26
  * @since 1.8.8
27 27
  */
28
-$income = apply_filters( 'give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form );
28
+$income = apply_filters('give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form);
29 29
 
30 30
 /**
31 31
  * Filter the form
32 32
  *
33 33
  * @since 1.8.8
34 34
  */
35
-$goal = apply_filters( 'give_goal_amount_target_output', $form->goal, $form_id, $form );
35
+$goal = apply_filters('give_goal_amount_target_output', $form->goal, $form_id, $form);
36 36
 
37
-switch ( $goal_format ) {
37
+switch ($goal_format) {
38 38
 
39 39
 	case  'donation':
40
-		$donations_completed = give_get_form_sales_stats( $form_id );
41
-		$donations_goal      = give_get_meta( $form_id, '_give_number_of_donation_goal', true );
42
-		$progress            = round( ( $donations_completed / $donations_goal ) * 100, 2 );
40
+		$donations_completed = give_get_form_sales_stats($form_id);
41
+		$donations_goal      = give_get_meta($form_id, '_give_number_of_donation_goal', true);
42
+		$progress            = round(($donations_completed / $donations_goal) * 100, 2);
43 43
 		$progress_bar_value  = $donations_completed >= $donations_goal ? 100 : $progress;
44 44
 		break;
45 45
 
46 46
 	case 'donors':
47
-		$donor_goal = give_get_meta( $form_id, '_give_number_of_donor_goal', true );
48
-		$donors     = give_get_form_donor_count( $form_id );
49
-		$progress   = $progress_bar_value = round( ( $donors / $donor_goal ) * 100, 2 );
47
+		$donor_goal = give_get_meta($form_id, '_give_number_of_donor_goal', true);
48
+		$donors     = give_get_form_donor_count($form_id);
49
+		$progress   = $progress_bar_value = round(($donors / $donor_goal) * 100, 2);
50 50
 		break;
51 51
 
52 52
 	case 'percentage':
53
-		$progress           = round( ( $income / $goal ) * 100, 2 );
53
+		$progress           = round(($income / $goal) * 100, 2);
54 54
 		$progress_bar_value = $income >= $goal ? 100 : $progress;
55 55
 		break;
56 56
 
57 57
 	default :
58
-		$progress            = round( ( $income / $goal ) * 100, 2 );
58
+		$progress = round(($income / $goal) * 100, 2);
59 59
 		$progress_bar_value = $income >= $goal ? 100 : $progress;
60 60
 		break;
61 61
 
@@ -66,64 +66,64 @@  discard block
 block discarded – undo
66 66
  *
67 67
  * @since 1.8.8
68 68
  */
69
-$progress = apply_filters( 'give_goal_amount_funded_percentage_output', $progress, $form_id, $form );
69
+$progress = apply_filters('give_goal_amount_funded_percentage_output', $progress, $form_id, $form);
70 70
 ?>
71 71
 <div class="give-goal-progress">
72
-	<?php if ( ! empty( $show_text ) ) : ?>
72
+	<?php if ( ! empty($show_text)) : ?>
73 73
 		<div class="raised">
74 74
 			<?php
75
-			if ( 'amount' === $goal_format ) :
75
+			if ('amount' === $goal_format) :
76 76
 
77 77
 				/**
78 78
 				 * Filter the give currency.
79 79
 				 *
80 80
 				 * @since 1.8.17
81 81
 				 */
82
-				$form_currency = apply_filters( 'give_goal_form_currency', give_get_currency( $form_id ), $form_id );
82
+				$form_currency = apply_filters('give_goal_form_currency', give_get_currency($form_id), $form_id);
83 83
 
84 84
 				/**
85 85
 				 * Filter the income formatting arguments.
86 86
 				 *
87 87
 				 * @since 1.8.17
88 88
 				 */
89
-				$income_format_args = apply_filters( 'give_goal_income_format_args', array(
89
+				$income_format_args = apply_filters('give_goal_income_format_args', array(
90 90
 					'sanitize' => false,
91 91
 					'currency' => $form_currency,
92 92
 					'decimal'  => false
93
-				), $form_id );
93
+				), $form_id);
94 94
 
95 95
 				/**
96 96
 				 * Filter the goal formatting arguments.
97 97
 				 *
98 98
 				 * @since 1.8.17
99 99
 				 */
100
-				$goal_format_args = apply_filters( 'give_goal_amount_format_args', array(
100
+				$goal_format_args = apply_filters('give_goal_amount_format_args', array(
101 101
 					'sanitize' => false,
102 102
 					'currency' => $form_currency,
103 103
 					'decimal'  => false
104
-				), $form_id );
104
+				), $form_id);
105 105
 
106 106
 				// Get formatted amount.
107
-				$income = give_human_format_large_amount( give_format_amount( $income, $income_format_args ), array( 'currency' => $form_currency ) );
108
-				$goal   = give_human_format_large_amount( give_format_amount( $goal, $goal_format_args ), array( 'currency' => $form_currency ) );
107
+				$income = give_human_format_large_amount(give_format_amount($income, $income_format_args), array('currency' => $form_currency));
108
+				$goal   = give_human_format_large_amount(give_format_amount($goal, $goal_format_args), array('currency' => $form_currency));
109 109
 
110 110
 				echo sprintf( /* translators: 1: amount of income raised 2: goal target amount. */
111
-					__( '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> raised', 'give' ), give_currency_filter( $income, array( 'form_id' => $form_id ) ), give_currency_filter( $goal, array( 'form_id' => $form_id ) ) );
111
+					__('<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> raised', 'give'), give_currency_filter($income, array('form_id' => $form_id)), give_currency_filter($goal, array('form_id' => $form_id)) );
112 112
 
113
-			elseif ( 'percentage' === $goal_format ) :
113
+			elseif ('percentage' === $goal_format) :
114 114
 
115 115
 				echo sprintf( /* translators: %s: percentage of the amount raised compared to the goal target */
116
-					__( '<span class="give-percentage">%s%%</span> funded', 'give' ), round( $progress ) );
116
+					__('<span class="give-percentage">%s%%</span> funded', 'give'), round($progress) );
117 117
 
118
-			elseif ( 'donation' === $goal_format ) :
118
+			elseif ('donation' === $goal_format) :
119 119
 
120 120
 				echo sprintf( /* translators: 1: total number of donations completed 2: total number of donations set as goal */
121
-					_n( '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donations', $donations_goal, 'give' ), $donations_completed, $donations_goal );
121
+					_n('<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donations', $donations_goal, 'give'), $donations_completed, $donations_goal );
122 122
 
123
-			elseif ( 'donors' === $goal_format ) :
123
+			elseif ('donors' === $goal_format) :
124 124
 
125 125
 				echo sprintf( /* translators: 1: total number of donors completed 2: total number of donors set as goal */
126
-					_n( '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donors', $donor_goal, 'give' ), $donors, $donor_goal );
126
+					_n('<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donors', $donor_goal, 'give'), $donors, $donor_goal );
127 127
 
128 128
 			endif;
129 129
 			?>
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 	<?php endif; ?>
132 132
 
133 133
 
134
-	<?php if ( ! empty( $show_bar ) ) : ?>
134
+	<?php if ( ! empty($show_bar)) : ?>
135 135
 		<div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"
136
-			 aria-valuenow="<?php echo esc_attr( $progress_bar_value ); ?>">
137
-			<span style="width: <?php echo esc_attr( $progress_bar_value ); ?>%;<?php if ( ! empty( $color ) ) {
138
-				echo 'background-color:' . $color;
136
+			 aria-valuenow="<?php echo esc_attr($progress_bar_value); ?>">
137
+			<span style="width: <?php echo esc_attr($progress_bar_value); ?>%;<?php if ( ! empty($color)) {
138
+				echo 'background-color:'.$color;
139 139
 			} ?>"></span>
140 140
 		</div><!-- /.give-progress-bar -->
141 141
 	<?php endif; ?>
Please login to merge, or discard this patch.
includes/class-give-scripts.php 1 patch
Spacing   +154 added lines, -154 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,11 +74,11 @@  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
 		// Frontend.
80
-		if ( give_is_setting_enabled( give_get_option( 'css' ) ) ) {
81
-			wp_register_style( 'give-styles', $this->get_frontend_stylesheet_uri(), array(), GIVE_VERSION, 'all' );
80
+		if (give_is_setting_enabled(give_get_option('css'))) {
81
+			wp_register_style('give-styles', $this->get_frontend_stylesheet_uri(), array(), GIVE_VERSION, 'all');
82 82
 		}
83 83
 	}
84 84
 
@@ -90,15 +90,15 @@  discard block
 block discarded – undo
90 90
 	public function register_scripts() {
91 91
 
92 92
 		// WP-Admin.
93
-		wp_register_script( 'give-admin-scripts', GIVE_PLUGIN_URL . 'assets/dist/js/admin.js', array(
93
+		wp_register_script('give-admin-scripts', GIVE_PLUGIN_URL.'assets/dist/js/admin.js', array(
94 94
 			'jquery',
95 95
 			'jquery-ui-datepicker',
96 96
 			'wp-color-picker',
97 97
 			'jquery-query',
98
-		), GIVE_VERSION );
98
+		), GIVE_VERSION);
99 99
 
100 100
 		// Frontend.
101
-		wp_register_script( 'give', GIVE_PLUGIN_URL . 'assets/dist/js/give.js', array( 'jquery' ), GIVE_VERSION, $this->scripts_footer );
101
+		wp_register_script('give', GIVE_PLUGIN_URL.'assets/dist/js/give.js', array('jquery'), GIVE_VERSION, $this->scripts_footer);
102 102
 	}
103 103
 
104 104
 	/**
@@ -108,20 +108,20 @@  discard block
 block discarded – undo
108 108
 	 *
109 109
 	 * @param string $hook Page hook.
110 110
 	 */
111
-	public function admin_enqueue_styles( $hook ) {
111
+	public function admin_enqueue_styles($hook) {
112 112
 
113 113
 		// Give Admin Only.
114
-		if ( ! apply_filters( 'give_load_admin_styles', give_is_admin_page(), $hook ) ) {
114
+		if ( ! apply_filters('give_load_admin_styles', give_is_admin_page(), $hook)) {
115 115
 			return;
116 116
 		}
117 117
 
118 118
 		// Give enqueues.
119
-		wp_enqueue_style( 'give-admin-styles' );
120
-		wp_enqueue_style( 'give-admin-bar-notification' );
119
+		wp_enqueue_style('give-admin-styles');
120
+		wp_enqueue_style('give-admin-bar-notification');
121 121
 
122 122
 		// WP Core enqueues.
123
-		wp_enqueue_style( 'wp-color-picker' );
124
-		wp_enqueue_style( 'thickbox' ); // @TODO remove once we have modal API.
123
+		wp_enqueue_style('wp-color-picker');
124
+		wp_enqueue_style('thickbox'); // @TODO remove once we have modal API.
125 125
 
126 126
 	}
127 127
 
@@ -132,21 +132,21 @@  discard block
 block discarded – undo
132 132
 	 *
133 133
 	 * @param string $hook Page hook.
134 134
 	 */
135
-	public function admin_enqueue_scripts( $hook ) {
135
+	public function admin_enqueue_scripts($hook) {
136 136
 
137 137
 		// Give Admin Only.
138
-		if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) {
138
+		if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
139 139
 			return;
140 140
 		}
141 141
 
142 142
 		// WP Scripts.
143
-		wp_enqueue_script( 'wp-color-picker' );
144
-		wp_enqueue_script( 'jquery-ui-datepicker' );
145
-		wp_enqueue_script( 'thickbox' );
143
+		wp_enqueue_script('wp-color-picker');
144
+		wp_enqueue_script('jquery-ui-datepicker');
145
+		wp_enqueue_script('thickbox');
146 146
 		wp_enqueue_media();
147 147
 
148 148
 		// Give admin scripts.
149
-		wp_enqueue_script( 'give-admin-scripts' );
149
+		wp_enqueue_script('give-admin-scripts');
150 150
 
151 151
 		// Localize admin scripts
152 152
 		$this->admin_localize_scripts();
@@ -166,111 +166,111 @@  discard block
 block discarded – undo
166 166
 		$decimal_separator  = give_get_price_decimal_separator();
167 167
 
168 168
 		// Localize strings & variables for JS.
169
-		wp_localize_script( 'give-admin-scripts', 'give_vars', array(
170
-			'post_id'                           => isset( $post->ID ) ? $post->ID : null,
169
+		wp_localize_script('give-admin-scripts', 'give_vars', array(
170
+			'post_id'                           => isset($post->ID) ? $post->ID : null,
171 171
 			'give_version'                      => GIVE_VERSION,
172 172
 			'thousands_separator'               => $thousand_separator,
173 173
 			'decimal_separator'                 => $decimal_separator,
174
-			'quick_edit_warning'                => __( 'Not available for variable priced forms.', 'give' ),
175
-			'delete_payment'                    => __( 'Are you sure you want to <strong>permanently</strong> delete this donation?', 'give' ),
176
-			'delete_payment_note'               => __( 'Are you sure you want to delete this note?', 'give' ),
177
-			'revoke_api_key'                    => __( 'Are you sure you want to revoke this API key?', 'give' ),
178
-			'regenerate_api_key'                => __( 'Are you sure you want to regenerate this API key?', 'give' ),
179
-			'resend_receipt'                    => __( 'Are you sure you want to resend the donation receipt?', 'give' ),
180
-			'disconnect_user'                   => __( 'Are you sure you want to disconnect the user from this donor?', 'give' ),
181
-			'one_option'                        => __( 'Choose a form', 'give' ),
182
-			'one_or_more_option'                => __( 'Choose one or more forms', 'give' ),
183
-			'currency_sign'                     => give_currency_filter( '' ),
184
-			'currency_pos'                      => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
174
+			'quick_edit_warning'                => __('Not available for variable priced forms.', 'give'),
175
+			'delete_payment'                    => __('Are you sure you want to <strong>permanently</strong> delete this donation?', 'give'),
176
+			'delete_payment_note'               => __('Are you sure you want to delete this note?', 'give'),
177
+			'revoke_api_key'                    => __('Are you sure you want to revoke this API key?', 'give'),
178
+			'regenerate_api_key'                => __('Are you sure you want to regenerate this API key?', 'give'),
179
+			'resend_receipt'                    => __('Are you sure you want to resend the donation receipt?', 'give'),
180
+			'disconnect_user'                   => __('Are you sure you want to disconnect the user from this donor?', 'give'),
181
+			'one_option'                        => __('Choose a form', 'give'),
182
+			'one_or_more_option'                => __('Choose one or more forms', 'give'),
183
+			'currency_sign'                     => give_currency_filter(''),
184
+			'currency_pos'                      => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
185 185
 			'currency_decimals'                 => give_get_price_decimals(),
186
-			'ok'                                => __( 'Ok', 'give' ),
187
-			'cancel'                            => __( 'Cancel', 'give' ),
188
-			'close'                             => __( 'Close', 'give' ),
189
-			'confirm'                           => __( 'Confirm', 'give' ),
190
-			'confirm_action'                    => __( 'Confirm Action', 'give' ),
191
-			'confirm_deletion'                  => __( 'Confirm Deletion', 'give' ),
192
-			'confirm_delete_donation'           => __( 'Confirm Delete Donation', 'give' ),
193
-			'confirm_resend'                    => __( 'Confirm re-send', 'give' ),
194
-			'confirm_bulk_action'               => __( 'Confirm bulk action', 'give' ),
195
-			'restart_upgrade'                   => __( 'Do you want to restart the update process?', 'give' ),
196
-			'restart_update'                    => __( 'It is recommended that you backup your database before proceeding. Do you want to run the update now?', 'give' ),
197
-			'stop_upgrade'                      => __( 'Do you want to stop the update process now?', 'give' ),
198
-			'import_failed'                     => __( 'Import failed', 'give' ),
199
-			'flush_success'                     => __( 'Flush success', 'give' ),
200
-			'flush_error'                       => __( 'Flush error', 'give' ),
201
-			'batch_export_no_class'             => __( 'You must choose a method.', 'give' ),
202
-			'batch_export_no_reqs'              => __( 'Required fields not completed.', 'give' ),
203
-			'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' ),
204
-			'delete_test_donor'                 => __( 'Are you sure you want to delete all the test donors? This process will also delete test donations as well.', 'give' ),
205
-			'delete_import_donor'               => __( 'Are you sure you want to delete all the imported donors? This process will also delete imported donations as well.', 'give' ),
206
-			'price_format_guide'                => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ),
186
+			'ok'                                => __('Ok', 'give'),
187
+			'cancel'                            => __('Cancel', 'give'),
188
+			'close'                             => __('Close', 'give'),
189
+			'confirm'                           => __('Confirm', 'give'),
190
+			'confirm_action'                    => __('Confirm Action', 'give'),
191
+			'confirm_deletion'                  => __('Confirm Deletion', 'give'),
192
+			'confirm_delete_donation'           => __('Confirm Delete Donation', 'give'),
193
+			'confirm_resend'                    => __('Confirm re-send', 'give'),
194
+			'confirm_bulk_action'               => __('Confirm bulk action', 'give'),
195
+			'restart_upgrade'                   => __('Do you want to restart the update process?', 'give'),
196
+			'restart_update'                    => __('It is recommended that you backup your database before proceeding. Do you want to run the update now?', 'give'),
197
+			'stop_upgrade'                      => __('Do you want to stop the update process now?', 'give'),
198
+			'import_failed'                     => __('Import failed', 'give'),
199
+			'flush_success'                     => __('Flush success', 'give'),
200
+			'flush_error'                       => __('Flush error', 'give'),
201
+			'batch_export_no_class'             => __('You must choose a method.', 'give'),
202
+			'batch_export_no_reqs'              => __('Required fields not completed.', 'give'),
203
+			'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'),
204
+			'delete_test_donor'                 => __('Are you sure you want to delete all the test donors? This process will also delete test donations as well.', 'give'),
205
+			'delete_import_donor'               => __('Are you sure you want to delete all the imported donors? This process will also delete imported donations as well.', 'give'),
206
+			'price_format_guide'                => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator),
207 207
 			/* translators : %s: Donation form options metabox */
208
-			'confirm_before_remove_row_text'    => __( 'Do you want to delete this item?', 'give' ),
209
-			'matched_success_failure_page'      => __( 'You cannot set the success and failed pages to the same page', 'give' ),
210
-			'dismiss_notice_text'               => __( 'Dismiss this notice.', 'give' ),
211
-			'search_placeholder'                => __( 'Type to search all forms', 'give' ),
212
-			'search_placeholder_donor'          => __( 'Type to search all donors', 'give' ),
213
-			'search_placeholder_country'        => __( 'Type to search all countries', 'give' ),
214
-			'search_placeholder_state'          => __( 'Type to search all states/provinces', 'give' ),
215
-			'unlock_donor_fields_title'         => __( 'Action forbidden', 'give' ),
216
-			'unlock_donor_fields_message'               => __( 'To edit first name and last name, please go to user profile of the donor.', 'give' ),
217
-			'remove_from_bulk_delete'           => __( 'Remove from Bulk Delete', 'give' ),
208
+			'confirm_before_remove_row_text'    => __('Do you want to delete this item?', 'give'),
209
+			'matched_success_failure_page'      => __('You cannot set the success and failed pages to the same page', 'give'),
210
+			'dismiss_notice_text'               => __('Dismiss this notice.', 'give'),
211
+			'search_placeholder'                => __('Type to search all forms', 'give'),
212
+			'search_placeholder_donor'          => __('Type to search all donors', 'give'),
213
+			'search_placeholder_country'        => __('Type to search all countries', 'give'),
214
+			'search_placeholder_state'          => __('Type to search all states/provinces', 'give'),
215
+			'unlock_donor_fields_title'         => __('Action forbidden', 'give'),
216
+			'unlock_donor_fields_message'               => __('To edit first name and last name, please go to user profile of the donor.', 'give'),
217
+			'remove_from_bulk_delete'           => __('Remove from Bulk Delete', 'give'),
218 218
 			'donors_bulk_action'                => array(
219 219
 				'no_donor_selected'  => array(
220
-					'title' => __( 'No donors selected', 'give' ),
221
-					'desc'  => __( 'You must choose at least one or more donors to delete.', 'give' )
220
+					'title' => __('No donors selected', 'give'),
221
+					'desc'  => __('You must choose at least one or more donors to delete.', 'give')
222 222
 				),
223 223
 				'no_action_selected' => array(
224
-					'title' => __( 'No action selected', 'give' ),
225
-					'desc'  => __( 'You must select a bulk action to proceed.', 'give' ),
224
+					'title' => __('No action selected', 'give'),
225
+					'desc'  => __('You must select a bulk action to proceed.', 'give'),
226 226
 				),
227 227
 			),
228 228
 			'donations_bulk_action'             => array(
229 229
 				'titles'         => array(
230
-					'zero' => __( 'No payments selected', 'give' ),
230
+					'zero' => __('No payments selected', 'give'),
231 231
 				),
232 232
 				'delete'         => array(
233
-					'zero'     => __( 'You must choose at least one or more donations to delete.', 'give' ),
234
-					'single'   => __( 'Are you sure you want to permanently delete this donation?', 'give' ),
235
-					'multiple' => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ),
233
+					'zero'     => __('You must choose at least one or more donations to delete.', 'give'),
234
+					'single'   => __('Are you sure you want to permanently delete this donation?', 'give'),
235
+					'multiple' => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'),
236 236
 				),
237 237
 				'resend-receipt' => array(
238
-					'zero'     => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ),
239
-					'single'   => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ),
240
-					'multiple' => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ),
238
+					'zero'     => __('You must choose at least one or more recipients to resend the email receipt.', 'give'),
239
+					'single'   => __('Are you sure you want to resend the email receipt to this recipient?', 'give'),
240
+					'multiple' => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'),
241 241
 				),
242 242
 				'set-to-status'  => array(
243
-					'zero'     => __( 'You must choose at least one or more donations to set status to {status}.', 'give' ),
244
-					'single'   => __( 'Are you sure you want to set status of this donation to {status}?', 'give' ),
245
-					'multiple' => __( 'Are you sure you want to set status of {payment_count} donations to {status}?', 'give' ),
243
+					'zero'     => __('You must choose at least one or more donations to set status to {status}.', 'give'),
244
+					'single'   => __('Are you sure you want to set status of this donation to {status}?', 'give'),
245
+					'multiple' => __('Are you sure you want to set status of {payment_count} donations to {status}?', 'give'),
246 246
 				),
247 247
 			),
248 248
 			'updates'                           => array(
249
-				'ajax_error' => __( 'Please reload this page and try again', 'give' ),
249
+				'ajax_error' => __('Please reload this page and try again', 'give'),
250 250
 			),
251 251
 			'metabox_fields'                    => array(
252 252
 				'media' => array(
253
-					'button_title' => __( 'Choose Image', 'give' ),
253
+					'button_title' => __('Choose Image', 'give'),
254 254
 				),
255 255
 				'file'  => array(
256
-					'button_title' => __( 'Choose File', 'give' ),
256
+					'button_title' => __('Choose File', 'give'),
257 257
 				),
258 258
 			),
259 259
 			'chosen'                            => array(
260
-				'no_results_msg'  => __( 'No results match {search_term}', 'give' ),
261
-				'ajax_search_msg' => __( 'Searching results for match {search_term}', 'give' ),
260
+				'no_results_msg'  => __('No results match {search_term}', 'give'),
261
+				'ajax_search_msg' => __('Searching results for match {search_term}', 'give'),
262 262
 			),
263
-			'db_update_confirmation_msg_button' => __( 'Run Updates', 'give' ),
264
-			'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' ),
265
-			'error_message'                     => __( 'Something went wrong kindly try again!', 'give' ),
263
+			'db_update_confirmation_msg_button' => __('Run Updates', 'give'),
264
+			'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'),
265
+			'error_message'                     => __('Something went wrong kindly try again!', 'give'),
266 266
 			'give_donation_import'              => 'give_donation_import',
267 267
 			'core_settings_import'              => 'give_core_settings_import',
268
-			'setting_not_save_message'          => __( 'Changes you made may not be saved.', 'give' ),
268
+			'setting_not_save_message'          => __('Changes you made may not be saved.', 'give'),
269 269
 			'give_donation_amounts'             => array(
270
-				'minimum' => apply_filters( 'give_donation_minimum_limit', 1 ),
271
-				'maximum' => apply_filters( 'give_donation_maximum_limit', 999999.99 ),
270
+				'minimum' => apply_filters('give_donation_minimum_limit', 1),
271
+				'maximum' => apply_filters('give_donation_maximum_limit', 999999.99),
272 272
 			),
273
-		) );
273
+		));
274 274
 	}
275 275
 
276 276
 	/**
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
 		<style type="text/css" media="screen">
282 282
 			@font-face {
283 283
 				font-family: 'give-icomoon';
284
-				src: url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.eot?ngjl88'; ?>');
285
-				src: url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
286
-				url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
287
-				url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
284
+				src: url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.eot?ngjl88'; ?>');
285
+				src: url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
286
+				url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
287
+				url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
288 288
 				font-weight: normal;
289 289
 				font-style: normal;
290 290
 			}
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	 * @since 2.1.0
308 308
 	 */
309 309
 	public function public_enqueue_styles() {
310
-		wp_enqueue_style( 'give-styles' );
310
+		wp_enqueue_style('give-styles');
311 311
 	}
312 312
 
313 313
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 	 * @since 2.1.0
318 318
 	 */
319 319
 	public function public_enqueue_scripts() {
320
-		wp_enqueue_script( 'give' );
320
+		wp_enqueue_script('give');
321 321
 
322 322
 		$this->public_localize_scripts();
323 323
 	}
@@ -327,19 +327,19 @@  discard block
 block discarded – undo
327 327
 	 */
328 328
 	public function public_localize_scripts() {
329 329
 
330
-		$localize_give_vars = apply_filters( 'give_global_script_vars', array(
330
+		$localize_give_vars = apply_filters('give_global_script_vars', array(
331 331
 			'ajaxurl'                    => give_get_ajax_url(),
332
-			'checkout_nonce'             => wp_create_nonce( 'give_checkout_nonce' ), // Do not use this nonce. Its deprecated.
332
+			'checkout_nonce'             => wp_create_nonce('give_checkout_nonce'), // Do not use this nonce. Its deprecated.
333 333
 			'currency'                   => give_get_currency(),
334
-			'currency_sign'              => give_currency_filter( '' ),
334
+			'currency_sign'              => give_currency_filter(''),
335 335
 			'currency_pos'               => give_get_currency_position(),
336 336
 			'thousands_separator'        => give_get_price_thousand_separator(),
337 337
 			'decimal_separator'          => give_get_price_decimal_separator(),
338
-			'no_gateway'                 => __( 'Please select a payment method.', 'give' ),
339
-			'bad_minimum'                => __( 'The minimum custom donation amount for this form is', 'give' ),
340
-			'bad_maximum'                => __( 'The maximum custom donation amount for this form is', 'give' ),
341
-			'general_loading'            => __( 'Loading...', 'give' ),
342
-			'purchase_loading'           => __( 'Please Wait...', 'give' ),
338
+			'no_gateway'                 => __('Please select a payment method.', 'give'),
339
+			'bad_minimum'                => __('The minimum custom donation amount for this form is', 'give'),
340
+			'bad_maximum'                => __('The maximum custom donation amount for this form is', 'give'),
341
+			'general_loading'            => __('Loading...', 'give'),
342
+			'purchase_loading'           => __('Please Wait...', 'give'),
343 343
 			'number_decimals'            => give_get_price_decimals(),
344 344
 			'give_version'               => GIVE_VERSION,
345 345
 			'magnific_options'           => apply_filters(
@@ -353,30 +353,30 @@  discard block
 block discarded – undo
353 353
 				'give_form_translation_js',
354 354
 				array(
355 355
 					// Field name               Validation message.
356
-					'payment-mode'           => __( 'Please select payment mode.', 'give' ),
357
-					'give_first'             => __( 'Please enter your first name.', 'give' ),
358
-					'give_email'             => __( 'Please enter a valid email address.', 'give' ),
359
-					'give_user_login'        => __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ),
360
-					'give_user_pass'         => __( 'Enter a password.', 'give' ),
361
-					'give_user_pass_confirm' => __( 'Enter the password confirmation.', 'give' ),
362
-					'give_agree_to_terms'    => __( 'You must agree to the terms and conditions.', 'give' ),
356
+					'payment-mode'           => __('Please select payment mode.', 'give'),
357
+					'give_first'             => __('Please enter your first name.', 'give'),
358
+					'give_email'             => __('Please enter a valid email address.', 'give'),
359
+					'give_user_login'        => __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'),
360
+					'give_user_pass'         => __('Enter a password.', 'give'),
361
+					'give_user_pass_confirm' => __('Enter the password confirmation.', 'give'),
362
+					'give_agree_to_terms'    => __('You must agree to the terms and conditions.', 'give'),
363 363
 				)
364 364
 			),
365
-			'confirm_email_sent_message' => __( 'Please check your email and click on the link to access your complete donation history.', 'give' ),
366
-			'ajax_vars'                  => apply_filters( 'give_global_ajax_vars', array(
365
+			'confirm_email_sent_message' => __('Please check your email and click on the link to access your complete donation history.', 'give'),
366
+			'ajax_vars'                  => apply_filters('give_global_ajax_vars', array(
367 367
 				'ajaxurl'         => give_get_ajax_url(),
368
-				'ajaxNonce'       => wp_create_nonce( 'give_ajax_nonce' ),
369
-				'loading'         => __( 'Loading', 'give' ),
368
+				'ajaxNonce'       => wp_create_nonce('give_ajax_nonce'),
369
+				'loading'         => __('Loading', 'give'),
370 370
 				// General loading message.
371
-				'select_option'   => __( 'Please select an option', 'give' ),
371
+				'select_option'   => __('Please select an option', 'give'),
372 372
 				// Variable pricing error with multi-donation option enabled.
373
-				'default_gateway' => give_get_default_gateway( null ),
374
-				'permalinks'      => get_option( 'permalink_structure' ) ? '1' : '0',
373
+				'default_gateway' => give_get_default_gateway(null),
374
+				'permalinks'      => get_option('permalink_structure') ? '1' : '0',
375 375
 				'number_decimals' => give_get_price_decimals(),
376
-			) ),
377
-		) );
376
+			)),
377
+		));
378 378
 
379
-		wp_localize_script( 'give', 'give_global_vars', $localize_give_vars );
379
+		wp_localize_script('give', 'give_global_vars', $localize_give_vars);
380 380
 
381 381
 	}
382 382
 
@@ -390,15 +390,15 @@  discard block
 block discarded – undo
390 390
 	 */
391 391
 	public function get_frontend_stylesheet_uri() {
392 392
 
393
-		$file          = 'give' . $this->direction . '.css';
393
+		$file          = 'give'.$this->direction.'.css';
394 394
 		$templates_dir = give_get_theme_template_dir_name();
395 395
 
396 396
 		// Directory paths to CSS files to support checking via file_exists().
397
-		$child_theme_style_sheet    = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file;
398
-		$child_theme_style_sheet_2  = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give' . $this->direction . '.css';
399
-		$parent_theme_style_sheet   = trailingslashit( get_template_directory() ) . $templates_dir . $file;
400
-		$parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give' . $this->direction . '.css';
401
-		$give_plugin_style_sheet    = trailingslashit( GIVE_PLUGIN_DIR ) . 'assets/dist/css/' . $file;
397
+		$child_theme_style_sheet    = trailingslashit(get_stylesheet_directory()).$templates_dir.$file;
398
+		$child_theme_style_sheet_2  = trailingslashit(get_stylesheet_directory()).$templates_dir.'give'.$this->direction.'.css';
399
+		$parent_theme_style_sheet   = trailingslashit(get_template_directory()).$templates_dir.$file;
400
+		$parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give'.$this->direction.'.css';
401
+		$give_plugin_style_sheet    = trailingslashit(GIVE_PLUGIN_DIR).'assets/dist/css/'.$file;
402 402
 		$uri                        = false;
403 403
 
404 404
 		/**
@@ -409,23 +409,23 @@  discard block
 block discarded – undo
409 409
 		 * c. followed by non minified version, even if SCRIPT_DEBUG is not enabled. This allows users to copy just give.css to their theme.
410 410
 		 * d. Finally, fallback to the standard Give version. This is the default styles included within the plugin.
411 411
 		 */
412
-		if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) {
413
-			if ( ! empty( $nonmin ) ) {
414
-				$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give' . $this->direction . '.css';
412
+		if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) {
413
+			if ( ! empty($nonmin)) {
414
+				$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give'.$this->direction.'.css';
415 415
 			} else {
416
-				$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file;
416
+				$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file;
417 417
 			}
418
-		} elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) {
419
-			if ( ! empty( $nonmin ) ) {
420
-				$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give' . $this->direction . '.css';
418
+		} elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) {
419
+			if ( ! empty($nonmin)) {
420
+				$uri = trailingslashit(get_template_directory_uri()).$templates_dir.'give'.$this->direction.'.css';
421 421
 			} else {
422
-				$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file;
422
+				$uri = trailingslashit(get_template_directory_uri()).$templates_dir.$file;
423 423
 			}
424
-		} elseif ( file_exists( $give_plugin_style_sheet ) ) {
425
-			$uri = trailingslashit( GIVE_PLUGIN_URL ) . 'assets/dist/css/' . $file;
424
+		} elseif (file_exists($give_plugin_style_sheet)) {
425
+			$uri = trailingslashit(GIVE_PLUGIN_URL).'assets/dist/css/'.$file;
426 426
 		}
427 427
 
428
-		return apply_filters( 'give_get_stylesheet_uri', $uri );
428
+		return apply_filters('give_get_stylesheet_uri', $uri);
429 429
 
430 430
 	}
431 431
 
@@ -437,19 +437,19 @@  discard block
 block discarded – undo
437 437
 		// Enqueue the bundled block JS file
438 438
 		wp_enqueue_script(
439 439
 			'give-blocks-js',
440
-			GIVE_PLUGIN_URL . 'assets/dist/js/gutenberg.js',
441
-			array( 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api' ),
440
+			GIVE_PLUGIN_URL.'assets/dist/js/gutenberg.js',
441
+			array('wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api'),
442 442
 			GIVE_VERSION
443 443
 		);
444 444
 
445 445
 		// Enqueue public styles
446
-		wp_enqueue_style( 'give-styles' );
446
+		wp_enqueue_style('give-styles');
447 447
 
448 448
 		// Enqueue the bundled block css file
449 449
 		wp_enqueue_style(
450 450
 			'give-blocks-css',
451
-			GIVE_PLUGIN_URL . 'assets/dist/css/gutenberg.css',
452
-			array( 'wp-blocks' ),
451
+			GIVE_PLUGIN_URL.'assets/dist/css/gutenberg.css',
452
+			array('wp-blocks'),
453 453
 			GIVE_VERSION
454 454
 		);
455 455
 
Please login to merge, or discard this patch.
includes/emails/functions.php 1 patch
Spacing   +70 added lines, -70 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
 
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * @return void
28 28
  */
29
-function give_email_donation_receipt( $payment_id, $admin_notice = true ) {
29
+function give_email_donation_receipt($payment_id, $admin_notice = true) {
30 30
 	/**
31 31
 	 * Fire the action
32 32
 	 */
33
-	do_action( 'give_donation-receipt_email_notification', $payment_id );
33
+	do_action('give_donation-receipt_email_notification', $payment_id);
34 34
 
35 35
 	// If admin notifications are on, send the admin notice.
36
-	if ( $admin_notice && give_is_setting_enabled( Give_Email_Notification::get_instance('new-donation' )->get_notification_status() ) ) {
36
+	if ($admin_notice && give_is_setting_enabled(Give_Email_Notification::get_instance('new-donation')->get_notification_status())) {
37 37
 		/**
38 38
 		 * Fires in the donation email receipt.
39 39
 		 *
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		 * @param int   $payment_id   Payment id.
45 45
 		 * @param mixed $payment_data Payment meta data.
46 46
 		 */
47
-		do_action( 'give_new-donation_email_notification', $payment_id, give_get_payment_meta( $payment_id ) );
47
+		do_action('give_new-donation_email_notification', $payment_id, give_get_payment_meta($payment_id));
48 48
 	}
49 49
 }
50 50
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
  *
58 58
  * @return void
59 59
  */
60
-function give_admin_email_notice( $payment_id ) {
60
+function give_admin_email_notice($payment_id) {
61 61
 	/**
62 62
 	 * Fires in the donation email receipt.
63 63
 	 *
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
 	 * @param int   $payment_id   Payment id.
69 69
 	 * @param mixed $payment_data Payment meta data.
70 70
 	 */
71
-	do_action( 'give_new-donation_email_notification', $payment_id );
71
+	do_action('give_new-donation_email_notification', $payment_id);
72 72
 }
73 73
 
74
-add_action( 'give_admin_donation_email', 'give_admin_email_notice' );
74
+add_action('give_admin_donation_email', 'give_admin_email_notice');
75 75
 
76 76
 
77 77
 /**
@@ -84,16 +84,16 @@  discard block
 block discarded – undo
84 84
  */
85 85
 function give_get_default_donation_notification_email() {
86 86
 
87
-	$default_email_body = __( 'Hi there,', 'give' ) . "\n\n";
88
-	$default_email_body .= __( 'This email is to inform you that a new donation has been made on your website:', 'give' ) . ' <a href="' . get_bloginfo( 'url' ) . '" target="_blank">' . get_bloginfo( 'url' ) . '</a>' . ".\n\n";
89
-	$default_email_body .= '<strong>' . __( 'Donor:', 'give' ) . '</strong> {name}' . "\n";
90
-	$default_email_body .= '<strong>' . __( 'Donation:', 'give' ) . '</strong> {donation}' . "\n";
91
-	$default_email_body .= '<strong>' . __( 'Amount:', 'give' ) . '</strong> {amount}' . "\n";
92
-	$default_email_body .= '<strong>' . __( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n\n";
93
-	$default_email_body .= __( 'Thank you,', 'give' ) . "\n\n";
94
-	$default_email_body .= '{sitename}' . "\n";
87
+	$default_email_body = __('Hi there,', 'give')."\n\n";
88
+	$default_email_body .= __('This email is to inform you that a new donation has been made on your website:', 'give').' <a href="'.get_bloginfo('url').'" target="_blank">'.get_bloginfo('url').'</a>'.".\n\n";
89
+	$default_email_body .= '<strong>'.__('Donor:', 'give').'</strong> {name}'."\n";
90
+	$default_email_body .= '<strong>'.__('Donation:', 'give').'</strong> {donation}'."\n";
91
+	$default_email_body .= '<strong>'.__('Amount:', 'give').'</strong> {amount}'."\n";
92
+	$default_email_body .= '<strong>'.__('Payment Method:', 'give').'</strong> {payment_method}'."\n\n";
93
+	$default_email_body .= __('Thank you,', 'give')."\n\n";
94
+	$default_email_body .= '{sitename}'."\n";
95 95
 
96
-	return apply_filters( 'give_default_donation_notification_email', $default_email_body );
96
+	return apply_filters('give_default_donation_notification_email', $default_email_body);
97 97
 }
98 98
 
99 99
 
@@ -107,21 +107,21 @@  discard block
 block discarded – undo
107 107
  */
108 108
 function give_get_default_donation_receipt_email() {
109 109
 
110
-	$default_email_body = __( 'Dear', 'give' ) . " {name},\n\n";
111
-	$default_email_body .= __( 'Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give' ) . "\n\n";
112
-	$default_email_body .= '<strong>' . __( 'Donor:', 'give' ) . '</strong> {fullname}' . "\n";
113
-	$default_email_body .= '<strong>' . __( 'Donation:', 'give' ) . '</strong> {donation}' . "\n";
114
-	$default_email_body .= '<strong>' . __( 'Donation Date:', 'give' ) . '</strong> {date}' . "\n";
115
-	$default_email_body .= '<strong>' . __( 'Amount:', 'give' ) . '</strong> {amount}' . "\n";
116
-	$default_email_body .= '<strong>' . __( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n";
117
-	$default_email_body .= '<strong>' . __( 'Payment ID:', 'give' ) . '</strong> {payment_id}' . "\n";
118
-	$default_email_body .= '<strong>' . __( 'Receipt ID:', 'give' ) . '</strong> {receipt_id}' . "\n\n";
119
-	$default_email_body .= '{receipt_link}' . "\n\n";
110
+	$default_email_body = __('Dear', 'give')." {name},\n\n";
111
+	$default_email_body .= __('Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give')."\n\n";
112
+	$default_email_body .= '<strong>'.__('Donor:', 'give').'</strong> {fullname}'."\n";
113
+	$default_email_body .= '<strong>'.__('Donation:', 'give').'</strong> {donation}'."\n";
114
+	$default_email_body .= '<strong>'.__('Donation Date:', 'give').'</strong> {date}'."\n";
115
+	$default_email_body .= '<strong>'.__('Amount:', 'give').'</strong> {amount}'."\n";
116
+	$default_email_body .= '<strong>'.__('Payment Method:', 'give').'</strong> {payment_method}'."\n";
117
+	$default_email_body .= '<strong>'.__('Payment ID:', 'give').'</strong> {payment_id}'."\n";
118
+	$default_email_body .= '<strong>'.__('Receipt ID:', 'give').'</strong> {receipt_id}'."\n\n";
119
+	$default_email_body .= '{receipt_link}'."\n\n";
120 120
 	$default_email_body .= "\n\n";
121
-	$default_email_body .= __( 'Sincerely,', 'give' ) . "\n";
122
-	$default_email_body .= '{sitename}' . "\n";
121
+	$default_email_body .= __('Sincerely,', 'give')."\n";
122
+	$default_email_body .= '{sitename}'."\n";
123 123
 
124
-	return apply_filters( 'give_default_donation_receipt_email', $default_email_body );
124
+	return apply_filters('give_default_donation_receipt_email', $default_email_body);
125 125
 }
126 126
 
127 127
 /**
@@ -134,22 +134,22 @@  discard block
 block discarded – undo
134 134
  *
135 135
  * @return array $email_names
136 136
  */
137
-function give_get_email_names( $user_info, $payment = false ) {
137
+function give_get_email_names($user_info, $payment = false) {
138 138
 	$email_names = array();
139 139
 
140
-	if ( is_a( $payment, 'Give_Payment' ) ) {
140
+	if (is_a($payment, 'Give_Payment')) {
141 141
 
142
-		if ( $payment->user_id > 0 ) {
142
+		if ($payment->user_id > 0) {
143 143
 
144
-			$user_data               = get_userdata( $payment->user_id );
144
+			$user_data               = get_userdata($payment->user_id);
145 145
 			$email_names['name']     = $payment->first_name;
146
-			$email_names['fullname'] = trim( $payment->first_name . ' ' . $payment->last_name );
146
+			$email_names['fullname'] = trim($payment->first_name.' '.$payment->last_name);
147 147
 			$email_names['username'] = $user_data->user_login;
148 148
 
149
-		} elseif ( ! empty( $payment->first_name ) ) {
149
+		} elseif ( ! empty($payment->first_name)) {
150 150
 
151 151
 			$email_names['name']     = $payment->first_name;
152
-			$email_names['fullname'] = trim( $payment->first_name . ' ' . $payment->last_name );
152
+			$email_names['fullname'] = trim($payment->first_name.' '.$payment->last_name);
153 153
 			$email_names['username'] = $payment->first_name;
154 154
 
155 155
 		} else {
@@ -162,30 +162,30 @@  discard block
 block discarded – undo
162 162
 	} else {
163 163
 
164 164
 		// Support for old serialized data.
165
-		if ( is_serialized( $user_info ) ) {
165
+		if (is_serialized($user_info)) {
166 166
 
167 167
 			// Security check.
168
-			preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $user_info, $matches );
169
-			if ( ! empty( $matches ) ) {
168
+			preg_match('/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $user_info, $matches);
169
+			if ( ! empty($matches)) {
170 170
 				return array(
171 171
 					'name'     => '',
172 172
 					'fullname' => '',
173 173
 					'username' => '',
174 174
 				);
175 175
 			} else {
176
-				$user_info = maybe_unserialize( $user_info );
176
+				$user_info = maybe_unserialize($user_info);
177 177
 			}
178 178
 
179 179
 		}
180 180
 
181
-		if ( isset( $user_info['id'] ) && $user_info['id'] > 0 && isset( $user_info['first_name'] ) ) {
182
-			$user_data               = get_userdata( $user_info['id'] );
181
+		if (isset($user_info['id']) && $user_info['id'] > 0 && isset($user_info['first_name'])) {
182
+			$user_data               = get_userdata($user_info['id']);
183 183
 			$email_names['name']     = $user_info['first_name'];
184
-			$email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
184
+			$email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name'];
185 185
 			$email_names['username'] = $user_data->user_login;
186
-		} elseif ( isset( $user_info['first_name'] ) ) {
186
+		} elseif (isset($user_info['first_name'])) {
187 187
 			$email_names['name']     = $user_info['first_name'];
188
-			$email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
188
+			$email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name'];
189 189
 			$email_names['username'] = $user_info['first_name'];
190 190
 		} else {
191 191
 			$email_names['name']     = $user_info['email'];
@@ -205,37 +205,37 @@  discard block
 block discarded – undo
205 205
  *
206 206
  * @since 1.8.14
207 207
  */
208
-function give_admin_email_user_donor_disconnection( $user_id, $donor_id ) {
208
+function give_admin_email_user_donor_disconnection($user_id, $donor_id) {
209 209
 
210
-	$user_id  = absint( $user_id );
211
-	$donor_id = absint( $donor_id );
210
+	$user_id  = absint($user_id);
211
+	$donor_id = absint($donor_id);
212 212
 
213 213
 	// Bail Out, if user id doesn't exists.
214
-	if ( empty( $user_id ) ) {
214
+	if (empty($user_id)) {
215 215
 		return;
216 216
 	}
217 217
 
218 218
 	// Bail Out, if donor id doesn't exists.
219
-	if ( empty( $donor_id ) ) {
219
+	if (empty($donor_id)) {
220 220
 		return;
221 221
 	}
222 222
 
223
-	$from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) );
223
+	$from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
224 224
 
225
-	$from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) );
225
+	$from_email = give_get_option('from_email', get_bloginfo('admin_email'));
226 226
 
227 227
 	/* translators: %s: payment id */
228
-	$subject = __( 'Attention: User tries to login whose Donor profile is disconnected!', 'give' );
228
+	$subject = __('Attention: User tries to login whose Donor profile is disconnected!', 'give');
229 229
 
230 230
 	/**
231 231
 	 * Filters the Donor-User Disconnection notification subject.
232 232
 	 *
233 233
 	 * @since 1.8.14
234 234
 	 */
235
-	$subject = apply_filters( 'give_admin_donor_user_disconnection_notification_subject', wp_strip_all_tags( $subject ) );
235
+	$subject = apply_filters('give_admin_donor_user_disconnection_notification_subject', wp_strip_all_tags($subject));
236 236
 
237
-	$headers = "From: " . stripslashes_deep( html_entity_decode( $from_name, ENT_COMPAT, 'UTF-8' ) ) . " <$from_email>\r\n";
238
-	$headers .= "Reply-To: " . $from_email . "\r\n";
237
+	$headers = "From: ".stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8'))." <$from_email>\r\n";
238
+	$headers .= "Reply-To: ".$from_email."\r\n";
239 239
 	$headers .= "Content-Type: text/html; charset=utf-8\r\n";
240 240
 
241 241
 	/**
@@ -243,25 +243,25 @@  discard block
 block discarded – undo
243 243
 	 *
244 244
 	 * @since 1.8.14
245 245
 	 */
246
-	$headers = apply_filters( 'give_admin_donor_user_disconnection_notification_headers', $headers );
246
+	$headers = apply_filters('give_admin_donor_user_disconnection_notification_headers', $headers);
247 247
 
248
-	$message = __( 'Hi Admin,', 'give' ) . "\n\n";
249
-	$message .= __( 'This email is to inform you that a user has tried logging in. But, User was unable to login due to User-Donor profile disconnection.', 'give' ) . "\n\n";
250
-	$message .= __( 'Do you want to reconnect User and Donor profile again?', 'give' ) . "\n\n";
248
+	$message = __('Hi Admin,', 'give')."\n\n";
249
+	$message .= __('This email is to inform you that a user has tried logging in. But, User was unable to login due to User-Donor profile disconnection.', 'give')."\n\n";
250
+	$message .= __('Do you want to reconnect User and Donor profile again?', 'give')."\n\n";
251 251
 	$message .= sprintf(
252 252
 		'<a href="%1$s">%2$s</a>',
253
-		esc_url( admin_url() . 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor_id . '&user_id=' . $user_id . '&give-message=reconnect-user' ),
254
-		__( 'Reconnect User', 'give' ) . "\n\n"
253
+		esc_url(admin_url().'edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor_id.'&user_id='.$user_id.'&give-message=reconnect-user'),
254
+		__('Reconnect User', 'give')."\n\n"
255 255
 	);
256
-	$message .= __( 'Thank you,', 'give' ) . "\n\n";
257
-	$message .= '{sitename}' . "\n";
256
+	$message .= __('Thank you,', 'give')."\n\n";
257
+	$message .= '{sitename}'."\n";
258 258
 
259 259
 	$emails = Give()->emails;
260
-	$emails->__set( 'from_name', $from_name );
261
-	$emails->__set( 'from_email', $from_email );
262
-	$emails->__set( 'headers', $headers );
263
-	$emails->__set( 'heading', __( 'User - Donor Profile Disconnection', 'give' ) );
260
+	$emails->__set('from_name', $from_name);
261
+	$emails->__set('from_email', $from_email);
262
+	$emails->__set('headers', $headers);
263
+	$emails->__set('heading', __('User - Donor Profile Disconnection', 'give'));
264 264
 
265
-	$emails->send( give_get_admin_notice_emails(), $subject, give_do_email_tags( $message ) );
265
+	$emails->send(give_get_admin_notice_emails(), $subject, give_do_email_tags($message));
266 266
 
267 267
 }
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-advanced.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Advanced' ) ) :
16
+if ( ! class_exists('Give_Settings_Advanced')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Advanced.
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'advanced';
30
-			$this->label = __( 'Advanced', 'give' );
30
+			$this->label = __('Advanced', 'give');
31 31
 
32 32
 			$this->default_tab = 'advanced-options';
33 33
 
34
-			if ( $this->id === give_get_current_setting_tab() ) {
35
-				add_action( 'give_admin_field_remove_cache_button', array( $this, 'render_remove_cache_button' ), 10, 1 );
34
+			if ($this->id === give_get_current_setting_tab()) {
35
+				add_action('give_admin_field_remove_cache_button', array($this, 'render_remove_cache_button'), 10, 1);
36 36
 			}
37 37
 
38 38
 			parent::__construct();
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 			$current_section = give_get_current_setting_section();
51 51
 
52
-			switch ( $current_section ) {
52
+			switch ($current_section) {
53 53
 				case 'advanced-options':
54 54
 					$settings = array(
55 55
 						array(
@@ -57,19 +57,19 @@  discard block
 block discarded – undo
57 57
 							'type' => 'title',
58 58
 						),
59 59
 						array(
60
-							'name'    => __( 'Remove Data on Uninstall', 'give' ),
61
-							'desc'    => __( 'When the plugin is deleted, completely remove all Give data. This includes all Give settings, forms, form meta, donor, donor data, donations. Everything.', 'give' ),
60
+							'name'    => __('Remove Data on Uninstall', 'give'),
61
+							'desc'    => __('When the plugin is deleted, completely remove all Give data. This includes all Give settings, forms, form meta, donor, donor data, donations. Everything.', 'give'),
62 62
 							'id'      => 'uninstall_on_delete',
63 63
 							'type'    => 'radio_inline',
64 64
 							'default' => 'disabled',
65 65
 							'options' => array(
66
-								'enabled'  => __( 'Yes, Remove all data', 'give' ),
67
-								'disabled' => __( 'No, keep my Give settings and donation data', 'give' ),
66
+								'enabled'  => __('Yes, Remove all data', 'give'),
67
+								'disabled' => __('No, keep my Give settings and donation data', 'give'),
68 68
 							),
69 69
 						),
70 70
 						array(
71
-							'name'    => __( 'Default User Role', 'give' ),
72
-							'desc'    => __( 'Assign default user roles for donors when donors opt to register as a WP User.', 'give' ),
71
+							'name'    => __('Default User Role', 'give'),
72
+							'desc'    => __('Assign default user roles for donors when donors opt to register as a WP User.', 'give'),
73 73
 							'id'      => 'donor_default_user_role',
74 74
 							'type'    => 'select',
75 75
 							'default' => 'give_donor',
@@ -77,51 +77,51 @@  discard block
 block discarded – undo
77 77
 						),
78 78
 						array(
79 79
 							/* translators: %s: the_content */
80
-							'name'    => sprintf( __( '%s filter', 'give' ), '<code>the_content</code>' ),
80
+							'name'    => sprintf(__('%s filter', 'give'), '<code>the_content</code>'),
81 81
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
82
-							'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>' ),
82
+							'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>'),
83 83
 							'id'      => 'the_content_filter',
84 84
 							'default' => 'enabled',
85 85
 							'type'    => 'radio_inline',
86 86
 							'options' => array(
87
-								'enabled'  => __( 'Enabled', 'give' ),
88
-								'disabled' => __( 'Disabled', 'give' ),
87
+								'enabled'  => __('Enabled', 'give'),
88
+								'disabled' => __('Disabled', 'give'),
89 89
 							),
90 90
 						),
91 91
 						array(
92
-							'name'    => __( 'Script Loading Location', 'give' ),
93
-							'desc'    => __( 'This allows you to load your Give scripts either in the <code>&lt;head&gt;</code> or footer of your website.', 'give' ),
92
+							'name'    => __('Script Loading Location', 'give'),
93
+							'desc'    => __('This allows you to load your Give scripts either in the <code>&lt;head&gt;</code> or footer of your website.', 'give'),
94 94
 							'id'      => 'scripts_footer',
95 95
 							'type'    => 'radio_inline',
96 96
 							'default' => 'disabled',
97 97
 							'options' => array(
98
-								'disabled' => __( 'Head', 'give' ),
99
-								'enabled'  => __( 'Footer', 'give' ),
98
+								'disabled' => __('Head', 'give'),
99
+								'enabled'  => __('Footer', 'give'),
100 100
 							),
101 101
 						),
102 102
 						array(
103
-							'name'    => __( 'Akismet SPAM Protection', 'give' ),
104
-							'desc'    => __( 'Add a layer of SPAM protection to your donation submissions with Akismet. When enabled, donation submissions will be first sent to Akismet\'s API if you have the plugin activated and configured.', 'give' ),
103
+							'name'    => __('Akismet SPAM Protection', 'give'),
104
+							'desc'    => __('Add a layer of SPAM protection to your donation submissions with Akismet. When enabled, donation submissions will be first sent to Akismet\'s API if you have the plugin activated and configured.', 'give'),
105 105
 							'id'      => 'akismet_spam_protection',
106 106
 							'type'    => 'radio_inline',
107
-							'default' => ( give_check_akismet_key() ) ? 'enabled' : 'disabled',
107
+							'default' => (give_check_akismet_key()) ? 'enabled' : 'disabled',
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
 						array(
114 114
 							'name'        => 'Give Cache',
115 115
 							'id'          => 'give-clear-cache',
116
-							'buttonTitle' => __( 'Clear Cache', 'give' ),
117
-							'desc'        => __( 'Click this button if you want to clear Give\'s cache. The plugin stores common settings and queries in cache to optimize performance. Clearing cache will remove and begin rebuilding these saved queries.', 'give' ),
116
+							'buttonTitle' => __('Clear Cache', 'give'),
117
+							'desc'        => __('Click this button if you want to clear Give\'s cache. The plugin stores common settings and queries in cache to optimize performance. Clearing cache will remove and begin rebuilding these saved queries.', 'give'),
118 118
 							'type'        => 'remove_cache_button'
119 119
 						),
120 120
 						array(
121
-							'name'  => __( 'Advanced Settings Docs Link', 'give' ),
121
+							'name'  => __('Advanced Settings Docs Link', 'give'),
122 122
 							'id'    => 'advanced_settings_docs_link',
123
-							'url'   => esc_url( 'http://docs.givewp.com/settings-advanced' ),
124
-							'title' => __( 'Advanced Settings', 'give' ),
123
+							'url'   => esc_url('http://docs.givewp.com/settings-advanced'),
124
+							'title' => __('Advanced Settings', 'give'),
125 125
 							'type'  => 'give_docs_link',
126 126
 						),
127 127
 						array(
@@ -137,20 +137,20 @@  discard block
 block discarded – undo
137 137
 			 *
138 138
 			 * @since 2.0
139 139
 			 */
140
-			if ( apply_filters( 'give_settings_advanced_show_cache_setting', false ) ) {
141
-				array_splice( $settings, 1, 0, array(
140
+			if (apply_filters('give_settings_advanced_show_cache_setting', false)) {
141
+				array_splice($settings, 1, 0, array(
142 142
 					array(
143
-						'name'    => __( 'Cache', 'give' ),
144
-						'desc'    => __( 'If caching is enabled the plugin will start caching custom post type related queries and reduce the overall load time.', 'give' ),
143
+						'name'    => __('Cache', 'give'),
144
+						'desc'    => __('If caching is enabled the plugin will start caching custom post type related queries and reduce the overall load time.', 'give'),
145 145
 						'id'      => 'cache',
146 146
 						'type'    => 'radio_inline',
147 147
 						'default' => 'enabled',
148 148
 						'options' => array(
149
-							'enabled'  => __( 'Enabled', 'give' ),
150
-							'disabled' => __( 'Disabled', 'give' ),
149
+							'enabled'  => __('Enabled', 'give'),
150
+							'disabled' => __('Disabled', 'give'),
151 151
 						),
152 152
 					)
153
-				) );
153
+				));
154 154
 			}
155 155
 
156 156
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 			 * Filter the advanced settings.
159 159
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
160 160
 			 */
161
-			$settings = apply_filters( 'give_settings_advanced', $settings );
161
+			$settings = apply_filters('give_settings_advanced', $settings);
162 162
 
163 163
 			/**
164 164
 			 * Filter the settings.
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 			 *
168 168
 			 * @param  array $settings
169 169
 			 */
170
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
170
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
171 171
 
172 172
 			// Output.
173 173
 			return $settings;
@@ -181,10 +181,10 @@  discard block
 block discarded – undo
181 181
 		 */
182 182
 		public function get_sections() {
183 183
 			$sections = array(
184
-				'advanced-options' => __( 'Advanced Options', 'give' ),
184
+				'advanced-options' => __('Advanced Options', 'give'),
185 185
 			);
186 186
 
187
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
187
+			return apply_filters('give_get_sections_'.$this->id, $sections);
188 188
 		}
189 189
 
190 190
 
@@ -196,17 +196,17 @@  discard block
 block discarded – undo
196 196
 		 *
197 197
 		 * @param array $field
198 198
 		 */
199
-		public function render_remove_cache_button( $field ) {
199
+		public function render_remove_cache_button($field) {
200 200
 			?>
201
-			<tr valign="top" <?php echo ! empty( $field['wrapper_class'] ) ? 'class="' . $field['wrapper_class'] . '"' : '' ?>>
201
+			<tr valign="top" <?php echo ! empty($field['wrapper_class']) ? 'class="'.$field['wrapper_class'].'"' : '' ?>>
202 202
 				<th scope="row" class="titledesc">
203 203
 					<label
204
-						for="<?php echo esc_attr( $field['id'] ); ?>"><?php echo esc_html( $field['name'] ) ?></label>
204
+						for="<?php echo esc_attr($field['id']); ?>"><?php echo esc_html($field['name']) ?></label>
205 205
 				</th>
206 206
 				<td class="give-forminp">
207
-					<button type="button" id="<?php echo esc_attr( $field['id'] ); ?>"
208
-					        class="button button-secondary"><?php echo esc_html( $field['buttonTitle'] ) ?></button>
209
-					<?php echo Give_Admin_Settings::get_field_description( $field ); ?>
207
+					<button type="button" id="<?php echo esc_attr($field['id']); ?>"
208
+					        class="button button-secondary"><?php echo esc_html($field['buttonTitle']) ?></button>
209
+					<?php echo Give_Admin_Settings::get_field_description($field); ?>
210 210
 				</td>
211 211
 			</tr>
212 212
 			<?php
Please login to merge, or discard this patch.