@@ -10,7 +10,7 @@ discard block |
||
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 | |
@@ -20,27 +20,27 @@ discard block |
||
20 | 20 | * @since 1.0 |
21 | 21 | * @return void |
22 | 22 | */ |
23 | -if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
24 | - wp_die( esc_html__( 'Donation ID not supplied. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
23 | +if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
24 | + wp_die(esc_html__('Donation ID not supplied. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | // Setup the variables |
28 | -$payment_id = absint( $_GET['id'] ); |
|
29 | -$payment = new Give_Payment( $payment_id ); |
|
28 | +$payment_id = absint($_GET['id']); |
|
29 | +$payment = new Give_Payment($payment_id); |
|
30 | 30 | |
31 | 31 | // Sanity check... fail if donation ID is invalid |
32 | 32 | $payment_exists = $payment->ID; |
33 | -if ( empty( $payment_exists ) ) { |
|
34 | - wp_die( esc_html__( 'The specified ID does not belong to a donation. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
|
33 | +if (empty($payment_exists)) { |
|
34 | + wp_die(esc_html__('The specified ID does not belong to a donation. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400)); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $number = $payment->number; |
38 | 38 | $payment_meta = $payment->get_meta(); |
39 | -$transaction_id = esc_attr( $payment->transaction_id ); |
|
39 | +$transaction_id = esc_attr($payment->transaction_id); |
|
40 | 40 | $user_id = $payment->user_id; |
41 | 41 | $donor_id = $payment->customer_id; |
42 | -$payment_date = strtotime( $payment->date ); |
|
43 | -$user_info = give_get_payment_meta_user_info( $payment_id ); |
|
42 | +$payment_date = strtotime($payment->date); |
|
43 | +$user_info = give_get_payment_meta_user_info($payment_id); |
|
44 | 44 | $address = $payment->address; |
45 | 45 | $currency_code = $payment->currency; |
46 | 46 | $gateway = $payment->gateway; |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | <h1 id="transaction-details-heading"><?php |
53 | 53 | printf( |
54 | 54 | /* translators: %s: donation number */ |
55 | - esc_html__( 'Donation %s', 'give' ), |
|
55 | + esc_html__('Donation %s', 'give'), |
|
56 | 56 | $number |
57 | 57 | ); |
58 | - if ( $payment_mode == 'test' ) { |
|
59 | - echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html__( 'Test Donation', 'give' ) . '</span>'; |
|
58 | + if ($payment_mode == 'test') { |
|
59 | + echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'" data-tooltip-my-position="center left" data-tooltip-target-position="center right">'.esc_html__('Test Donation', 'give').'</span>'; |
|
60 | 60 | } |
61 | 61 | ?></h1> |
62 | 62 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @param int $payment_id Payment id. |
70 | 70 | */ |
71 | - do_action( 'give_view_order_details_before', $payment_id ); |
|
71 | + do_action('give_view_order_details_before', $payment_id); |
|
72 | 72 | ?> |
73 | 73 | <form id="give-edit-order-form" method="post"> |
74 | 74 | <?php |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * |
80 | 80 | * @param int $payment_id Payment id. |
81 | 81 | */ |
82 | - do_action( 'give_view_order_details_form_top', $payment_id ); |
|
82 | + do_action('give_view_order_details_form_top', $payment_id); |
|
83 | 83 | ?> |
84 | 84 | <div id="poststuff"> |
85 | 85 | <div id="give-dashboard-widgets-wrap"> |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | * |
96 | 96 | * @param int $payment_id Payment id. |
97 | 97 | */ |
98 | - do_action( 'give_view_order_details_sidebar_before', $payment_id ); |
|
98 | + do_action('give_view_order_details_sidebar_before', $payment_id); |
|
99 | 99 | ?> |
100 | 100 | |
101 | 101 | <div id="give-order-update" class="postbox give-order-data"> |
102 | 102 | |
103 | - <h3 class="hndle"><?php esc_html_e( 'Update Donation', 'give' ); ?></h3> |
|
103 | + <h3 class="hndle"><?php esc_html_e('Update Donation', 'give'); ?></h3> |
|
104 | 104 | |
105 | 105 | <div class="inside"> |
106 | 106 | <div class="give-admin-box"> |
@@ -113,33 +113,33 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @param int $payment_id Payment id. |
115 | 115 | */ |
116 | - do_action( 'give_view_order_details_totals_before', $payment_id ); |
|
116 | + do_action('give_view_order_details_totals_before', $payment_id); |
|
117 | 117 | ?> |
118 | 118 | |
119 | 119 | <div class="give-admin-box-inside"> |
120 | 120 | <p> |
121 | - <label for="give-payment-status" class="strong"><?php esc_html_e( 'Status:', 'give' ); ?></label> |
|
121 | + <label for="give-payment-status" class="strong"><?php esc_html_e('Status:', 'give'); ?></label> |
|
122 | 122 | <select id="give-payment-status" name="give-payment-status" class="medium-text"> |
123 | - <?php foreach ( give_get_payment_statuses() as $key => $status ) : ?> |
|
124 | - <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option> |
|
123 | + <?php foreach (give_get_payment_statuses() as $key => $status) : ?> |
|
124 | + <option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option> |
|
125 | 125 | <?php endforeach; ?> |
126 | 126 | </select> |
127 | - <span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span> |
|
127 | + <span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span> |
|
128 | 128 | </p> |
129 | 129 | </div> |
130 | 130 | |
131 | 131 | <div class="give-admin-box-inside"> |
132 | 132 | <p> |
133 | - <label for="give-payment-date" class="strong"><?php esc_html_e( 'Date:', 'give' ); ?></label> |
|
134 | - <input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/> |
|
133 | + <label for="give-payment-date" class="strong"><?php esc_html_e('Date:', 'give'); ?></label> |
|
134 | + <input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/> |
|
135 | 135 | </p> |
136 | 136 | </div> |
137 | 137 | |
138 | 138 | <div class="give-admin-box-inside"> |
139 | 139 | <p> |
140 | - <label for="give-payment-time-hour" class="strong"><?php esc_html_e( 'Time:', 'give' ); ?></label> |
|
141 | - <input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/> : |
|
142 | - <input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/> |
|
140 | + <label for="give-payment-time-hour" class="strong"><?php esc_html_e('Time:', 'give'); ?></label> |
|
141 | + <input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/> : |
|
142 | + <input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/> |
|
143 | 143 | </p> |
144 | 144 | </div> |
145 | 145 | |
@@ -153,13 +153,13 @@ discard block |
||
153 | 153 | * |
154 | 154 | * @param int $payment_id Payment id. |
155 | 155 | */ |
156 | - do_action( 'give_view_order_details_update_inner', $payment_id ); ?> |
|
156 | + do_action('give_view_order_details_update_inner', $payment_id); ?> |
|
157 | 157 | |
158 | 158 | <div class="give-order-payment give-admin-box-inside"> |
159 | 159 | <p> |
160 | - <label for="give-payment-total" class="strong"><?php esc_html_e( 'Total Donation:', 'give' ); ?></label> |
|
161 | - <?php echo give_currency_symbol( $payment->currency ); ?> |
|
162 | - <input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_get_payment_amount( $payment_id ) ) ); ?>"/> |
|
160 | + <label for="give-payment-total" class="strong"><?php esc_html_e('Total Donation:', 'give'); ?></label> |
|
161 | + <?php echo give_currency_symbol($payment->currency); ?> |
|
162 | + <input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_get_payment_amount($payment_id))); ?>"/> |
|
163 | 163 | </p> |
164 | 164 | </div> |
165 | 165 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * |
172 | 172 | * @param int $payment_id Payment id. |
173 | 173 | */ |
174 | - do_action( 'give_view_order_details_totals_after', $payment_id ); |
|
174 | + do_action('give_view_order_details_totals_after', $payment_id); |
|
175 | 175 | ?> |
176 | 176 | |
177 | 177 | </div> |
@@ -189,17 +189,17 @@ discard block |
||
189 | 189 | * |
190 | 190 | * @param int $payment_id Payment id. |
191 | 191 | */ |
192 | - do_action( 'give_view_order_details_update_before', $payment_id ); |
|
192 | + do_action('give_view_order_details_update_before', $payment_id); |
|
193 | 193 | ?> |
194 | 194 | |
195 | 195 | <div id="major-publishing-actions"> |
196 | 196 | <div id="publishing-action"> |
197 | - <input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Donation', 'give' ); ?>"/> |
|
198 | - <?php if ( give_is_payment_complete( $payment_id ) ) : ?> |
|
199 | - <a href="<?php echo esc_url( add_query_arg( array( |
|
197 | + <input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Donation', 'give'); ?>"/> |
|
198 | + <?php if (give_is_payment_complete($payment_id)) : ?> |
|
199 | + <a href="<?php echo esc_url(add_query_arg(array( |
|
200 | 200 | 'give-action' => 'email_links', |
201 | 201 | 'purchase_id' => $payment_id, |
202 | - ) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a> |
|
202 | + ))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a> |
|
203 | 203 | <?php endif; ?> |
204 | 204 | </div> |
205 | 205 | <div class="clear"></div> |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * |
214 | 214 | * @param int $payment_id Payment id. |
215 | 215 | */ |
216 | - do_action( 'give_view_order_details_update_after', $payment_id ); |
|
216 | + do_action('give_view_order_details_update_after', $payment_id); |
|
217 | 217 | ?> |
218 | 218 | |
219 | 219 | </div> |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | |
225 | 225 | <div id="give-order-details" class="postbox give-order-data"> |
226 | 226 | |
227 | - <h3 class="hndle"><?php esc_html_e( 'Donation Meta', 'give' ); ?></h3> |
|
227 | + <h3 class="hndle"><?php esc_html_e('Donation Meta', 'give'); ?></h3> |
|
228 | 228 | |
229 | 229 | <div class="inside"> |
230 | 230 | <div class="give-admin-box"> |
@@ -237,44 +237,44 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @param int $payment_id Payment id. |
239 | 239 | */ |
240 | - do_action( 'give_view_order_details_payment_meta_before', $payment_id ); |
|
240 | + do_action('give_view_order_details_payment_meta_before', $payment_id); |
|
241 | 241 | |
242 | - $gateway = give_get_payment_gateway( $payment_id ); |
|
243 | - if ( $gateway ) : ?> |
|
242 | + $gateway = give_get_payment_gateway($payment_id); |
|
243 | + if ($gateway) : ?> |
|
244 | 244 | <div class="give-order-gateway give-admin-box-inside"> |
245 | 245 | <p> |
246 | - <strong><?php esc_html_e( 'Gateway:', 'give' ); ?></strong> |
|
247 | - <?php echo give_get_gateway_admin_label( $gateway ); ?> |
|
246 | + <strong><?php esc_html_e('Gateway:', 'give'); ?></strong> |
|
247 | + <?php echo give_get_gateway_admin_label($gateway); ?> |
|
248 | 248 | </p> |
249 | 249 | </div> |
250 | 250 | <?php endif; ?> |
251 | 251 | |
252 | 252 | <div class="give-order-payment-key give-admin-box-inside"> |
253 | 253 | <p> |
254 | - <strong><?php esc_html_e( 'Key:', 'give' ); ?></strong> |
|
255 | - <?php echo give_get_payment_key( $payment_id ); ?> |
|
254 | + <strong><?php esc_html_e('Key:', 'give'); ?></strong> |
|
255 | + <?php echo give_get_payment_key($payment_id); ?> |
|
256 | 256 | </p> |
257 | 257 | </div> |
258 | 258 | |
259 | 259 | <div class="give-order-ip give-admin-box-inside"> |
260 | 260 | <p> |
261 | - <strong><?php esc_html_e( 'IP:', 'give' ); ?></strong> |
|
262 | - <?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?> |
|
261 | + <strong><?php esc_html_e('IP:', 'give'); ?></strong> |
|
262 | + <?php echo esc_html(give_get_payment_user_ip($payment_id)); ?> |
|
263 | 263 | </p> |
264 | 264 | </div> |
265 | 265 | |
266 | - <?php if ( $transaction_id ) : ?> |
|
266 | + <?php if ($transaction_id) : ?> |
|
267 | 267 | <div class="give-order-tx-id give-admin-box-inside"> |
268 | 268 | <p> |
269 | - <strong><?php esc_html_e( 'Donation ID:', 'give' ); ?></strong> |
|
270 | - <?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?> |
|
269 | + <strong><?php esc_html_e('Donation ID:', 'give'); ?></strong> |
|
270 | + <?php echo apply_filters("give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id); ?> |
|
271 | 271 | </p> |
272 | 272 | </div> |
273 | 273 | <?php endif; ?> |
274 | 274 | |
275 | 275 | <div class="give-admin-box-inside"> |
276 | - <p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( esc_attr( give_get_payment_user_email( $payment_id ) ) ) ); ?> |
|
277 | - <a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor »', 'give' ); ?></a> |
|
276 | + <p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode(esc_attr(give_get_payment_user_email($payment_id)))); ?> |
|
277 | + <a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor »', 'give'); ?></a> |
|
278 | 278 | </p> |
279 | 279 | </div> |
280 | 280 | |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | * |
287 | 287 | * @param int $payment_id Payment id. |
288 | 288 | */ |
289 | - do_action( 'give_view_order_details_payment_meta_after', $payment_id ); |
|
289 | + do_action('give_view_order_details_payment_meta_after', $payment_id); |
|
290 | 290 | ?> |
291 | 291 | |
292 | 292 | </div> |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * |
307 | 307 | * @param int $payment_id Payment id. |
308 | 308 | */ |
309 | - do_action( 'give_view_order_details_sidebar_after', $payment_id ); |
|
309 | + do_action('give_view_order_details_sidebar_after', $payment_id); |
|
310 | 310 | ?> |
311 | 311 | |
312 | 312 | </div> |
@@ -326,56 +326,56 @@ discard block |
||
326 | 326 | * |
327 | 327 | * @param int $payment_id Payment id. |
328 | 328 | */ |
329 | - do_action( 'give_view_order_details_main_before', $payment_id ); |
|
329 | + do_action('give_view_order_details_main_before', $payment_id); |
|
330 | 330 | ?> |
331 | 331 | |
332 | 332 | <?php $column_count = 'columns-3'; ?> |
333 | 333 | <div id="give-donation-overview" class="postbox <?php echo $column_count; ?>"> |
334 | - <h3 class="hndle"><?php esc_html_e( 'Donation Information', 'give' ); ?></h3> |
|
334 | + <h3 class="hndle"><?php esc_html_e('Donation Information', 'give'); ?></h3> |
|
335 | 335 | |
336 | 336 | <div class="inside"> |
337 | 337 | |
338 | 338 | <div class="column-container"> |
339 | 339 | <div class="column"> |
340 | 340 | <p> |
341 | - <strong><?php esc_html_e( 'Donation Form ID:', 'give' ); ?></strong><br> |
|
341 | + <strong><?php esc_html_e('Donation Form ID:', 'give'); ?></strong><br> |
|
342 | 342 | <?php |
343 | - if ( $payment_meta['form_id'] ) : |
|
343 | + if ($payment_meta['form_id']) : |
|
344 | 344 | printf( |
345 | 345 | '<a href="%1$s" target="_blank">#%2$s</a>', |
346 | - admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ), |
|
346 | + admin_url('post.php?action=edit&post='.$payment_meta['form_id']), |
|
347 | 347 | $payment_meta['form_id'] |
348 | 348 | ); |
349 | 349 | endif; |
350 | 350 | ?> |
351 | 351 | </p> |
352 | 352 | <p> |
353 | - <strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br> |
|
354 | - <?php echo Give()->html->forms_dropdown( array( |
|
353 | + <strong><?php esc_html_e('Donation Form Title:', 'give'); ?></strong><br> |
|
354 | + <?php echo Give()->html->forms_dropdown(array( |
|
355 | 355 | 'selected' => $payment_meta['form_id'], |
356 | 356 | 'name' => 'give-payment-form-select', |
357 | 357 | 'id' => 'give-payment-form-select', |
358 | 358 | 'chosen' => true, |
359 | - ) ); ?> |
|
359 | + )); ?> |
|
360 | 360 | </p> |
361 | 361 | </div> |
362 | 362 | <div class="column"> |
363 | 363 | <p> |
364 | - <strong><?php esc_html_e( 'Donation Date:', 'give' ); ?></strong><br> |
|
365 | - <?php echo date_i18n( give_date_format(), $payment_date ); ?> |
|
364 | + <strong><?php esc_html_e('Donation Date:', 'give'); ?></strong><br> |
|
365 | + <?php echo date_i18n(give_date_format(), $payment_date); ?> |
|
366 | 366 | </p> |
367 | 367 | <p> |
368 | - <strong><?php esc_html_e( 'Donation Level:', 'give' ); ?></strong><br> |
|
368 | + <strong><?php esc_html_e('Donation Level:', 'give'); ?></strong><br> |
|
369 | 369 | <span class="give-donation-level"> |
370 | 370 | <?php |
371 | - $var_prices = give_has_variable_prices( $payment_meta['form_id'] ); |
|
372 | - if ( empty( $var_prices ) ) { |
|
373 | - esc_html_e( 'n/a', 'give' ); |
|
371 | + $var_prices = give_has_variable_prices($payment_meta['form_id']); |
|
372 | + if (empty($var_prices)) { |
|
373 | + esc_html_e('n/a', 'give'); |
|
374 | 374 | } else { |
375 | 375 | $prices_atts = ''; |
376 | - if( $variable_prices = give_get_variable_prices( $payment_meta['form_id'] ) ) { |
|
377 | - foreach ( $variable_prices as $variable_price ) { |
|
378 | - $prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount( $variable_price['_give_amount'] ); |
|
376 | + if ($variable_prices = give_get_variable_prices($payment_meta['form_id'])) { |
|
377 | + foreach ($variable_prices as $variable_price) { |
|
378 | + $prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount']); |
|
379 | 379 | } |
380 | 380 | } |
381 | 381 | // Variable price dropdown options. |
@@ -385,11 +385,11 @@ discard block |
||
385 | 385 | 'chosen' => true, |
386 | 386 | 'show_option_all' => '', |
387 | 387 | 'show_option_none' => '', |
388 | - 'select_atts' => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ), |
|
388 | + 'select_atts' => 'data-prices='.esc_attr(json_encode($prices_atts)), |
|
389 | 389 | 'selected' => $payment_meta['price_id'], |
390 | 390 | ); |
391 | 391 | // Render variable prices select tag html. |
392 | - give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true ); |
|
392 | + give_get_form_variable_price_dropdown($variable_price_dropdown_option, true); |
|
393 | 393 | } |
394 | 394 | ?> |
395 | 395 | </span> |
@@ -397,8 +397,8 @@ discard block |
||
397 | 397 | </div> |
398 | 398 | <div class="column"> |
399 | 399 | <p> |
400 | - <strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br> |
|
401 | - <?php echo give_currency_filter( give_format_amount( $payment->total ), give_get_payment_currency_code( $payment->ID ) ); ?> |
|
400 | + <strong><?php esc_html_e('Total Donation:', 'give'); ?></strong><br> |
|
401 | + <?php echo give_currency_filter(give_format_amount($payment->total), give_get_payment_currency_code($payment->ID)); ?> |
|
402 | 402 | </p> |
403 | 403 | <p> |
404 | 404 | <?php |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * |
412 | 412 | * @param int $payment_id Payment id. |
413 | 413 | */ |
414 | - do_action( 'give_donation_details_thead_before', $payment_id ); |
|
414 | + do_action('give_donation_details_thead_before', $payment_id); |
|
415 | 415 | |
416 | 416 | |
417 | 417 | /** |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | * |
424 | 424 | * @param int $payment_id Payment id. |
425 | 425 | */ |
426 | - do_action( 'give_donation_details_thead_after', $payment_id ); |
|
426 | + do_action('give_donation_details_thead_after', $payment_id); |
|
427 | 427 | |
428 | 428 | /** |
429 | 429 | * Fires in order details page, in the donation-information metabox, before the body elements. |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | * |
435 | 435 | * @param int $payment_id Payment id. |
436 | 436 | */ |
437 | - do_action( 'give_donation_details_tbody_before', $payment_id ); |
|
437 | + do_action('give_donation_details_tbody_before', $payment_id); |
|
438 | 438 | |
439 | 439 | /** |
440 | 440 | * Fires in order details page, in the donation-information metabox, after the body elements. |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | * |
446 | 446 | * @param int $payment_id Payment id. |
447 | 447 | */ |
448 | - do_action( 'give_donation_details_tbody_after', $payment_id ); |
|
448 | + do_action('give_donation_details_tbody_after', $payment_id); |
|
449 | 449 | ?> |
450 | 450 | </p> |
451 | 451 | </div> |
@@ -465,67 +465,67 @@ discard block |
||
465 | 465 | * |
466 | 466 | * @param int $payment_id Payment id. |
467 | 467 | */ |
468 | - do_action( 'give_view_order_details_files_after', $payment_id ); |
|
468 | + do_action('give_view_order_details_files_after', $payment_id); |
|
469 | 469 | ?> |
470 | 470 | |
471 | 471 | <div id="give-donor-details" class="postbox"> |
472 | - <h3 class="hndle"><?php esc_html_e( 'Donor Details', 'give' ); ?></h3> |
|
472 | + <h3 class="hndle"><?php esc_html_e('Donor Details', 'give'); ?></h3> |
|
473 | 473 | |
474 | 474 | <div class="inside"> |
475 | 475 | |
476 | - <?php $donor = new Give_Donor( $donor_id ); ?> |
|
476 | + <?php $donor = new Give_Donor($donor_id); ?> |
|
477 | 477 | |
478 | 478 | <div class="column-container donor-info"> |
479 | 479 | <div class="column"> |
480 | 480 | <p> |
481 | - <strong><?php esc_html_e( 'Donor ID:', 'give' ); ?></strong><br> |
|
481 | + <strong><?php esc_html_e('Donor ID:', 'give'); ?></strong><br> |
|
482 | 482 | <?php |
483 | - if ( ! empty( $donor->id ) ) { |
|
483 | + if ( ! empty($donor->id)) { |
|
484 | 484 | printf( |
485 | 485 | '<a href="%1$s" target="_blank">#%2$s</a>', |
486 | - admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ), |
|
486 | + admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id), |
|
487 | 487 | $donor->id |
488 | 488 | ); |
489 | 489 | } |
490 | 490 | ?> |
491 | 491 | </p> |
492 | 492 | <p> |
493 | - <strong><?php esc_html_e( 'Donor Since:', 'give' ); ?></strong><br> |
|
494 | - <?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?> |
|
493 | + <strong><?php esc_html_e('Donor Since:', 'give'); ?></strong><br> |
|
494 | + <?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?> |
|
495 | 495 | </p> |
496 | 496 | </div> |
497 | 497 | <div class="column"> |
498 | 498 | <p> |
499 | - <strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br> |
|
499 | + <strong><?php esc_html_e('Donor Name:', 'give'); ?></strong><br> |
|
500 | 500 | <?php |
501 | - $donor_billing_name = give_get_donor_name_by( $payment_id, 'donation' ); |
|
502 | - $donor_name = give_get_donor_name_by( $donor_id, 'donor' ); |
|
501 | + $donor_billing_name = give_get_donor_name_by($payment_id, 'donation'); |
|
502 | + $donor_name = give_get_donor_name_by($donor_id, 'donor'); |
|
503 | 503 | |
504 | 504 | // Check whether the donor name and WP_User name is same or not. |
505 | - if( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ){ |
|
506 | - echo $donor_billing_name . ' (<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id" ) ) . '">' . $donor_name . '</a>)'; |
|
507 | - }else{ |
|
505 | + if (sanitize_title($donor_billing_name) != sanitize_title($donor_name)) { |
|
506 | + echo $donor_billing_name.' (<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id")).'">'.$donor_name.'</a>)'; |
|
507 | + } else { |
|
508 | 508 | echo $donor_name; |
509 | 509 | } |
510 | 510 | ?> |
511 | 511 | </p> |
512 | 512 | <p> |
513 | - <strong><?php esc_html_e( 'Donor Email:', 'give' ); ?></strong><br> |
|
513 | + <strong><?php esc_html_e('Donor Email:', 'give'); ?></strong><br> |
|
514 | 514 | <?php echo $donor->email; ?> |
515 | 515 | </p> |
516 | 516 | </div> |
517 | 517 | <div class="column"> |
518 | 518 | <p> |
519 | - <strong><?php esc_html_e( 'Change Donor:', 'give' ); ?></strong><br> |
|
519 | + <strong><?php esc_html_e('Change Donor:', 'give'); ?></strong><br> |
|
520 | 520 | <?php |
521 | - echo Give()->html->donor_dropdown( array( |
|
521 | + echo Give()->html->donor_dropdown(array( |
|
522 | 522 | 'selected' => $donor->id, |
523 | 523 | 'name' => 'donor-id', |
524 | - ) ); |
|
524 | + )); |
|
525 | 525 | ?> |
526 | 526 | </p> |
527 | 527 | <p> |
528 | - <a href="#new" class="give-payment-new-donor"><?php esc_html_e( 'Create New Donor', 'give' ); ?></a> |
|
528 | + <a href="#new" class="give-payment-new-donor"><?php esc_html_e('Create New Donor', 'give'); ?></a> |
|
529 | 529 | </p> |
530 | 530 | </div> |
531 | 531 | </div> |
@@ -533,13 +533,13 @@ discard block |
||
533 | 533 | <div class="column-container new-donor" style="display: none"> |
534 | 534 | <div class="column"> |
535 | 535 | <p> |
536 | - <label for="give-new-donor-name"><?php esc_html_e( 'New Donor Name:', 'give' ); ?></label> |
|
536 | + <label for="give-new-donor-name"><?php esc_html_e('New Donor Name:', 'give'); ?></label> |
|
537 | 537 | <input id="give-new-donor-name" type="text" name="give-new-donor-name" value="" class="medium-text"/> |
538 | 538 | </p> |
539 | 539 | </div> |
540 | 540 | <div class="column"> |
541 | 541 | <p> |
542 | - <label for="give-new-donor-email"><?php esc_html_e( 'New Donor Email:', 'give' ); ?></label> |
|
542 | + <label for="give-new-donor-email"><?php esc_html_e('New Donor Email:', 'give'); ?></label> |
|
543 | 543 | <input id="give-new-donor-email" type="email" name="give-new-donor-email" value="" class="medium-text"/> |
544 | 544 | </p> |
545 | 545 | </div> |
@@ -547,9 +547,9 @@ discard block |
||
547 | 547 | <p> |
548 | 548 | <input type="hidden" name="give-current-donor" value="<?php echo $donor->id; ?>"/> |
549 | 549 | <input type="hidden" id="give-new-donor" name="give-new-donor" value="0"/> |
550 | - <a href="#cancel" class="give-payment-new-donor-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
550 | + <a href="#cancel" class="give-payment-new-donor-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
551 | 551 | <br> |
552 | - <em><?php esc_html_e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em> |
|
552 | + <em><?php esc_html_e('Click "Save Donation" to create new donor.', 'give'); ?></em> |
|
553 | 553 | </p> |
554 | 554 | </div> |
555 | 555 | </div> |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | * @param array $payment_meta Payment meta. |
566 | 566 | * @param array $user_info User information. |
567 | 567 | */ |
568 | - do_action( 'give_payment_personal_details_list', $payment_meta, $user_info ); |
|
568 | + do_action('give_payment_personal_details_list', $payment_meta, $user_info); |
|
569 | 569 | |
570 | 570 | /** |
571 | 571 | * Fires on the donation details page, in the donor-details metabox. |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | * |
575 | 575 | * @param int $payment_id Payment id. |
576 | 576 | */ |
577 | - do_action( 'give_payment_view_details', $payment_id ); |
|
577 | + do_action('give_payment_view_details', $payment_id); |
|
578 | 578 | ?> |
579 | 579 | |
580 | 580 | </div> |
@@ -590,11 +590,11 @@ discard block |
||
590 | 590 | * |
591 | 591 | * @param int $payment_id Payment id. |
592 | 592 | */ |
593 | - do_action( 'give_view_order_details_billing_before', $payment_id ); |
|
593 | + do_action('give_view_order_details_billing_before', $payment_id); |
|
594 | 594 | ?> |
595 | 595 | |
596 | 596 | <div id="give-billing-details" class="postbox"> |
597 | - <h3 class="hndle"><?php esc_html_e( 'Billing Address', 'give' ); ?></h3> |
|
597 | + <h3 class="hndle"><?php esc_html_e('Billing Address', 'give'); ?></h3> |
|
598 | 598 | |
599 | 599 | <div class="inside"> |
600 | 600 | |
@@ -604,59 +604,59 @@ discard block |
||
604 | 604 | <div class="data column-container"> |
605 | 605 | <div class="column"> |
606 | 606 | <div class="give-wrap-address-line1"> |
607 | - <label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Address 1:', 'give' ); ?></label> |
|
608 | - <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/> |
|
607 | + <label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e('Address 1:', 'give'); ?></label> |
|
608 | + <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/> |
|
609 | 609 | </div> |
610 | 610 | <div class="give-wrap-address-line2"> |
611 | - <label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Address 2:', 'give' ); ?></label> |
|
612 | - <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/> |
|
611 | + <label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e('Address 2:', 'give'); ?></label> |
|
612 | + <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/> |
|
613 | 613 | </div> |
614 | 614 | </div> |
615 | 615 | <div class="column"> |
616 | 616 | <div class="give-wrap-address-city"> |
617 | - <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label> |
|
618 | - <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/> |
|
617 | + <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label> |
|
618 | + <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/> |
|
619 | 619 | </div> |
620 | 620 | <div class="give-wrap-address-zip"> |
621 | - <label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label> |
|
622 | - <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/> |
|
621 | + <label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></label> |
|
622 | + <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/> |
|
623 | 623 | |
624 | 624 | </div> |
625 | 625 | </div> |
626 | 626 | <div class="column"> |
627 | 627 | <div id="give-order-address-country-wrap"> |
628 | - <label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label> |
|
628 | + <label class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></label> |
|
629 | 629 | <?php |
630 | - echo Give()->html->select( array( |
|
630 | + echo Give()->html->select(array( |
|
631 | 631 | 'options' => give_get_country_list(), |
632 | 632 | 'name' => 'give-payment-address[0][country]', |
633 | 633 | 'selected' => $address['country'], |
634 | 634 | 'show_option_all' => false, |
635 | 635 | 'show_option_none' => false, |
636 | 636 | 'chosen' => true, |
637 | - 'placeholder' => esc_attr__( 'Select a country', 'give' ), |
|
638 | - 'data' => array( 'search-type' => 'no_ajax' ), |
|
639 | - ) ); |
|
637 | + 'placeholder' => esc_attr__('Select a country', 'give'), |
|
638 | + 'data' => array('search-type' => 'no_ajax'), |
|
639 | + )); |
|
640 | 640 | ?> |
641 | 641 | </div> |
642 | 642 | <div id="give-order-address-state-wrap"> |
643 | - <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province / County:', 'give' ); ?></label> |
|
643 | + <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province / County:', 'give'); ?></label> |
|
644 | 644 | <?php |
645 | - $states = give_get_states( $address['country'] ); |
|
646 | - if ( ! empty( $states ) ) { |
|
647 | - echo Give()->html->select( array( |
|
645 | + $states = give_get_states($address['country']); |
|
646 | + if ( ! empty($states)) { |
|
647 | + echo Give()->html->select(array( |
|
648 | 648 | 'options' => $states, |
649 | 649 | 'name' => 'give-payment-address[0][state]', |
650 | 650 | 'selected' => $address['state'], |
651 | 651 | 'show_option_all' => false, |
652 | 652 | 'show_option_none' => false, |
653 | 653 | 'chosen' => true, |
654 | - 'placeholder' => esc_attr__( 'Select a state', 'give' ), |
|
655 | - 'data' => array( 'search-type' => 'no_ajax' ), |
|
656 | - ) ); |
|
654 | + 'placeholder' => esc_attr__('Select a state', 'give'), |
|
655 | + 'data' => array('search-type' => 'no_ajax'), |
|
656 | + )); |
|
657 | 657 | } else { |
658 | 658 | ?> |
659 | - <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/> |
|
659 | + <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/> |
|
660 | 660 | <?php |
661 | 661 | } ?> |
662 | 662 | </div> |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | * |
677 | 677 | * @param int $payment_id Payment id. |
678 | 678 | */ |
679 | - do_action( 'give_payment_billing_details', $payment_id ); |
|
679 | + do_action('give_payment_billing_details', $payment_id); |
|
680 | 680 | ?> |
681 | 681 | |
682 | 682 | </div> |
@@ -692,32 +692,32 @@ discard block |
||
692 | 692 | * |
693 | 693 | * @param int $payment_id Payment id. |
694 | 694 | */ |
695 | - do_action( 'give_view_order_details_billing_after', $payment_id ); |
|
695 | + do_action('give_view_order_details_billing_after', $payment_id); |
|
696 | 696 | ?> |
697 | 697 | |
698 | 698 | <div id="give-payment-notes" class="postbox"> |
699 | - <h3 class="hndle"><?php esc_html_e( 'Donation Notes', 'give' ); ?></h3> |
|
699 | + <h3 class="hndle"><?php esc_html_e('Donation Notes', 'give'); ?></h3> |
|
700 | 700 | |
701 | 701 | <div class="inside"> |
702 | 702 | <div id="give-payment-notes-inner"> |
703 | 703 | <?php |
704 | - $notes = give_get_payment_notes( $payment_id ); |
|
705 | - if ( ! empty( $notes ) ) { |
|
704 | + $notes = give_get_payment_notes($payment_id); |
|
705 | + if ( ! empty($notes)) { |
|
706 | 706 | $no_notes_display = ' style="display:none;"'; |
707 | - foreach ( $notes as $note ) : |
|
707 | + foreach ($notes as $note) : |
|
708 | 708 | |
709 | - echo give_get_payment_note_html( $note, $payment_id ); |
|
709 | + echo give_get_payment_note_html($note, $payment_id); |
|
710 | 710 | |
711 | 711 | endforeach; |
712 | 712 | } else { |
713 | 713 | $no_notes_display = ''; |
714 | 714 | } |
715 | - echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>'; ?> |
|
715 | + echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No donation notes.', 'give').'</p>'; ?> |
|
716 | 716 | </div> |
717 | 717 | <textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea> |
718 | 718 | |
719 | 719 | <div class="give-clearfix"> |
720 | - <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button> |
|
720 | + <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php esc_html_e('Add Note', 'give'); ?></button> |
|
721 | 721 | </div> |
722 | 722 | |
723 | 723 | </div> |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | * |
734 | 734 | * @param int $payment_id Payment id. |
735 | 735 | */ |
736 | - do_action( 'give_view_order_details_main_after', $payment_id ); |
|
736 | + do_action('give_view_order_details_main_after', $payment_id); |
|
737 | 737 | ?> |
738 | 738 | |
739 | 739 | </div> |
@@ -755,11 +755,11 @@ discard block |
||
755 | 755 | * |
756 | 756 | * @param int $payment_id Payment id. |
757 | 757 | */ |
758 | - do_action( 'give_view_order_details_form_bottom', $payment_id ); |
|
758 | + do_action('give_view_order_details_form_bottom', $payment_id); |
|
759 | 759 | |
760 | - wp_nonce_field( 'give_update_payment_details_nonce' ); |
|
760 | + wp_nonce_field('give_update_payment_details_nonce'); |
|
761 | 761 | ?> |
762 | - <input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/> |
|
762 | + <input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/> |
|
763 | 763 | <input type="hidden" name="give_action" value="update_payment_details"/> |
764 | 764 | </form> |
765 | 765 | <?php |
@@ -770,6 +770,6 @@ discard block |
||
770 | 770 | * |
771 | 771 | * @param int $payment_id Payment id. |
772 | 772 | */ |
773 | - do_action( 'give_view_order_details_after', $payment_id ); |
|
773 | + do_action('give_view_order_details_after', $payment_id); |
|
774 | 774 | ?> |
775 | 775 | </div><!-- /.wrap --> |
@@ -10,7 +10,7 @@ discard block |
||
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 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function give_get_logs_tab() { |
24 | 24 | |
25 | - require( GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php' ); |
|
25 | + require(GIVE_PLUGIN_DIR.'includes/admin/tools/logs/logs.php'); |
|
26 | 26 | |
27 | 27 | // Get current section. |
28 | 28 | $current_section = $_GET['section'] = give_get_current_setting_section(); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @since 1.0 |
34 | 34 | */ |
35 | - do_action( "give_logs_view_{$current_section}" ); |
|
35 | + do_action("give_logs_view_{$current_section}"); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | function give_logs_view_sales() { |
48 | 48 | |
49 | - include GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/class-sales-logs-list-table.php'; |
|
49 | + include GIVE_PLUGIN_DIR.'includes/admin/tools/logs/class-sales-logs-list-table.php'; |
|
50 | 50 | |
51 | 51 | $logs_table = new Give_Sales_Log_Table(); |
52 | 52 | $logs_table->prepare_items(); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * |
60 | 60 | * @since 1.8.12 |
61 | 61 | */ |
62 | - do_action( 'give_logs_donations_top' ); |
|
62 | + do_action('give_logs_donations_top'); |
|
63 | 63 | |
64 | 64 | $logs_table->display(); ?> |
65 | 65 | <input type="hidden" name="post_type" value="give_forms"/> |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @since 1.8.12 |
75 | 75 | */ |
76 | - do_action( 'give_logs_donations_bottom' ); |
|
76 | + do_action('give_logs_donations_bottom'); |
|
77 | 77 | ?> |
78 | 78 | |
79 | 79 | </div> |
80 | 80 | <?php |
81 | 81 | } |
82 | 82 | |
83 | -add_action( 'give_logs_view_sales', 'give_logs_view_sales' ); |
|
83 | +add_action('give_logs_view_sales', 'give_logs_view_sales'); |
|
84 | 84 | |
85 | 85 | |
86 | 86 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @return void |
93 | 93 | */ |
94 | 94 | function give_logs_view_gateway_errors() { |
95 | - include( GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/class-gateway-error-logs-list-table.php' ); |
|
95 | + include(GIVE_PLUGIN_DIR.'includes/admin/tools/logs/class-gateway-error-logs-list-table.php'); |
|
96 | 96 | |
97 | 97 | $logs_table = new Give_Gateway_Error_Log_Table(); |
98 | 98 | $logs_table->prepare_items(); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * |
106 | 106 | * @since 1.8.12 |
107 | 107 | */ |
108 | - do_action( 'give_logs_payment_error_top' ); |
|
108 | + do_action('give_logs_payment_error_top'); |
|
109 | 109 | |
110 | 110 | $logs_table->display(); ?> |
111 | 111 | <input type="hidden" name="post_type" value="give_forms"/> |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | * |
120 | 120 | * @since 1.8.12 |
121 | 121 | */ |
122 | - do_action( 'give_logs_payment_error_bottom' ); |
|
122 | + do_action('give_logs_payment_error_bottom'); |
|
123 | 123 | ?> |
124 | 124 | |
125 | 125 | </div> |
126 | 126 | <?php |
127 | 127 | } |
128 | 128 | |
129 | -add_action( 'give_logs_view_gateway_errors', 'give_logs_view_gateway_errors' ); |
|
129 | +add_action('give_logs_view_gateway_errors', 'give_logs_view_gateway_errors'); |
|
130 | 130 | |
131 | 131 | /** |
132 | 132 | * API Request Logs |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * @return void |
139 | 139 | */ |
140 | 140 | function give_logs_view_api_requests() { |
141 | - include( GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/class-api-requests-logs-list-table.php' ); |
|
141 | + include(GIVE_PLUGIN_DIR.'includes/admin/tools/logs/class-api-requests-logs-list-table.php'); |
|
142 | 142 | |
143 | 143 | $logs_table = new Give_API_Request_Log_Table(); |
144 | 144 | $logs_table->prepare_items(); |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | * |
152 | 152 | * @since 1.0 |
153 | 153 | */ |
154 | - do_action( 'give_logs_api_requests_top' ); |
|
154 | + do_action('give_logs_api_requests_top'); |
|
155 | 155 | |
156 | - $logs_table->search_box( esc_html__( 'Search', 'give' ), 'give-api-requests' ); |
|
156 | + $logs_table->search_box(esc_html__('Search', 'give'), 'give-api-requests'); |
|
157 | 157 | $logs_table->display(); |
158 | 158 | ?> |
159 | 159 | <input type="hidden" name="post_type" value="give_forms"/> |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | * |
168 | 168 | * @since 1.0 |
169 | 169 | */ |
170 | - do_action( 'give_logs_api_requests_bottom' ); |
|
170 | + do_action('give_logs_api_requests_bottom'); |
|
171 | 171 | ?> |
172 | 172 | |
173 | 173 | </div> |
174 | 174 | <?php |
175 | 175 | } |
176 | 176 | |
177 | -add_action( 'give_logs_view_api_requests', 'give_logs_view_api_requests' ); |
|
177 | +add_action('give_logs_view_api_requests', 'give_logs_view_api_requests'); |
|
178 | 178 | |
179 | 179 | /** |
180 | 180 | * Renders the log views drop down. |
@@ -186,11 +186,11 @@ discard block |
||
186 | 186 | $current_section = give_get_current_setting_section(); |
187 | 187 | |
188 | 188 | // If there are not any event attach to action then do not show form. |
189 | - if ( ! has_action( 'give_log_view_actions' ) ) { |
|
189 | + if ( ! has_action('give_log_view_actions')) { |
|
190 | 190 | return; |
191 | 191 | } |
192 | 192 | ?> |
193 | - <form id="give-logs-filter" method="get" action="<?php echo 'edit.php?post_type=give_forms&page=give-tools&tab=logs§ion=' . $current_section; ?>"> |
|
193 | + <form id="give-logs-filter" method="get" action="<?php echo 'edit.php?post_type=give_forms&page=give-tools&tab=logs§ion='.$current_section; ?>"> |
|
194 | 194 | <?php |
195 | 195 | /** |
196 | 196 | * Fires after displaying the reports page views drop down. |
@@ -199,14 +199,14 @@ discard block |
||
199 | 199 | * |
200 | 200 | * @since 1.0 |
201 | 201 | */ |
202 | - do_action( 'give_log_view_actions' ); |
|
202 | + do_action('give_log_view_actions'); |
|
203 | 203 | ?> |
204 | 204 | |
205 | 205 | <input type="hidden" name="post_type" value="give_forms"/> |
206 | 206 | <input type="hidden" name="page" value="give-tools"/> |
207 | 207 | <input type="hidden" name="tab" value="logs"/> |
208 | 208 | |
209 | - <?php submit_button( esc_html__( 'Apply', 'give' ), 'secondary', 'submit', false ); ?> |
|
209 | + <?php submit_button(esc_html__('Apply', 'give'), 'secondary', 'submit', false); ?> |
|
210 | 210 | </form> |
211 | 211 | <?php |
212 | 212 | } |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * |
219 | 219 | * @return string |
220 | 220 | */ |
221 | -function give_tools_set_form_method( $method ) { |
|
221 | +function give_tools_set_form_method($method) { |
|
222 | 222 | return 'get'; |
223 | 223 | } |
224 | -add_filter( 'give-tools_form_method_tab_logs', 'give_tools_set_form_method', 10 ); |
|
224 | +add_filter('give-tools_form_method_tab_logs', 'give_tools_set_form_method', 10); |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Admin View: System Info |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
6 | +if ( ! defined('ABSPATH')) { |
|
7 | 7 | exit; |
8 | 8 | } |
9 | 9 | |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | ?> |
23 | 23 | |
24 | 24 | <div class="give-debug-report-wrapper updated"> |
25 | - <p><?php _e( 'Please copy and paste this information in your ticket when contacting support:', 'give' ); ?> </p> |
|
25 | + <p><?php _e('Please copy and paste this information in your ticket when contacting support:', 'give'); ?> </p> |
|
26 | 26 | <p class="submit"> |
27 | - <a class="button-primary js-give-debug-report-button" href="#"><?php _e( 'Get System Report', 'give' ); ?></a> |
|
28 | - <a class="button-secondary docs" href="http://docs.givewp.com/settings-system-info" target="_blank"><?php _e( 'Understanding the System Report', 'give' ); ?></a> |
|
27 | + <a class="button-primary js-give-debug-report-button" href="#"><?php _e('Get System Report', 'give'); ?></a> |
|
28 | + <a class="button-secondary docs" href="http://docs.givewp.com/settings-system-info" target="_blank"><?php _e('Understanding the System Report', 'give'); ?></a> |
|
29 | 29 | </p> |
30 | 30 | <div class="give-debug-report js-give-debug-report"> |
31 | 31 | <textarea readonly="readonly"></textarea> |
@@ -35,55 +35,55 @@ discard block |
||
35 | 35 | <table class="give-status-table widefat" cellspacing="0" id="status"> |
36 | 36 | <thead> |
37 | 37 | <tr> |
38 | - <th colspan="3" data-export-label="WordPress Environment"><h2><?php _e( 'WordPress Environment', 'give' ); ?></h2></th> |
|
38 | + <th colspan="3" data-export-label="WordPress Environment"><h2><?php _e('WordPress Environment', 'give'); ?></h2></th> |
|
39 | 39 | </tr> |
40 | 40 | </thead> |
41 | 41 | <tbody> |
42 | 42 | <tr> |
43 | - <td data-export-label="Home URL"><?php _e( 'Home URL', 'give' ); ?>:</td> |
|
44 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The URL of your site\'s homepage.', 'give' ) ); ?>"></span></td> |
|
45 | - <td><?php form_option( 'home' ); ?></td> |
|
43 | + <td data-export-label="Home URL"><?php _e('Home URL', 'give'); ?>:</td> |
|
44 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The URL of your site\'s homepage.', 'give')); ?>"></span></td> |
|
45 | + <td><?php form_option('home'); ?></td> |
|
46 | 46 | </tr> |
47 | 47 | <tr> |
48 | - <td data-export-label="Site URL"><?php _e( 'Site URL', 'give' ); ?>:</td> |
|
49 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The root URL of your site.', 'give' ) ); ?>"></span></td> |
|
50 | - <td><?php form_option( 'siteurl' ); ?></td> |
|
48 | + <td data-export-label="Site URL"><?php _e('Site URL', 'give'); ?>:</td> |
|
49 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The root URL of your site.', 'give')); ?>"></span></td> |
|
50 | + <td><?php form_option('siteurl'); ?></td> |
|
51 | 51 | </tr> |
52 | 52 | <tr> |
53 | - <td data-export-label="WP Version"><?php _e( 'WP Version', 'give' ); ?>:</td> |
|
54 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of WordPress installed on your site.', 'give' ) ); ?>"></span></td> |
|
53 | + <td data-export-label="WP Version"><?php _e('WP Version', 'give'); ?>:</td> |
|
54 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of WordPress installed on your site.', 'give')); ?>"></span></td> |
|
55 | 55 | <td><?php bloginfo('version'); ?></td> |
56 | 56 | </tr> |
57 | 57 | <tr> |
58 | - <td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'give' ); ?>:</td> |
|
59 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether or not you have WordPress Multisite enabled.', 'give' ) ); ?>"></span></td> |
|
60 | - <td><?php if ( is_multisite() ) echo '<span class="dashicons dashicons-yes"></span>'; else echo '–'; ?></td> |
|
58 | + <td data-export-label="WP Multisite"><?php _e('WP Multisite', 'give'); ?>:</td> |
|
59 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether or not you have WordPress Multisite enabled.', 'give')); ?>"></span></td> |
|
60 | + <td><?php if (is_multisite()) echo '<span class="dashicons dashicons-yes"></span>'; else echo '–'; ?></td> |
|
61 | 61 | </tr> |
62 | 62 | <tr> |
63 | - <td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit', 'give' ); ?>:</td> |
|
64 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The maximum amount of memory (RAM) that your site can use at one time.', 'give' ) ); ?>"></span></td> |
|
63 | + <td data-export-label="WP Memory Limit"><?php _e('WP Memory Limit', 'give'); ?>:</td> |
|
64 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The maximum amount of memory (RAM) that your site can use at one time.', 'give')); ?>"></span></td> |
|
65 | 65 | <td> |
66 | 66 | <?php |
67 | - $memory = give_let_to_num( WP_MEMORY_LIMIT ); |
|
67 | + $memory = give_let_to_num(WP_MEMORY_LIMIT); |
|
68 | 68 | |
69 | - if ( function_exists( 'memory_get_usage' ) ) { |
|
70 | - $system_memory = give_let_to_num( @ini_get( 'memory_limit' ) ); |
|
71 | - $memory = max( $memory, $system_memory ); |
|
69 | + if (function_exists('memory_get_usage')) { |
|
70 | + $system_memory = give_let_to_num(@ini_get('memory_limit')); |
|
71 | + $memory = max($memory, $system_memory); |
|
72 | 72 | } |
73 | 73 | |
74 | - if ( $memory < 67108864 ) { |
|
75 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend setting memory to at least 64 MB. See: %s', 'give' ), size_format( $memory ), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">' . __( 'Increasing memory allocated to PHP', 'give' ) . '</a>' ) . '</mark>'; |
|
74 | + if ($memory < 67108864) { |
|
75 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend setting memory to at least 64 MB. See: %s', 'give'), size_format($memory), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">'.__('Increasing memory allocated to PHP', 'give').'</a>').'</mark>'; |
|
76 | 76 | } else { |
77 | - echo '<mark class="yes">' . size_format( $memory ) . '</mark>'; |
|
77 | + echo '<mark class="yes">'.size_format($memory).'</mark>'; |
|
78 | 78 | } |
79 | 79 | ?> |
80 | 80 | </td> |
81 | 81 | </tr> |
82 | 82 | <tr> |
83 | - <td data-export-label="WP Debug Mode"><?php _e( 'WP Debug Mode', 'give' ); ?>:</td> |
|
84 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Displays whether or not WordPress is in Debug Mode.', 'give' ) ); ?>"></span></td> |
|
83 | + <td data-export-label="WP Debug Mode"><?php _e('WP Debug Mode', 'give'); ?>:</td> |
|
84 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Displays whether or not WordPress is in Debug Mode.', 'give')); ?>"></span></td> |
|
85 | 85 | <td> |
86 | - <?php if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) : ?> |
|
86 | + <?php if (defined('WP_DEBUG') && WP_DEBUG) : ?> |
|
87 | 87 | <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
88 | 88 | <?php else : ?> |
89 | 89 | <mark class="no">–</mark> |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | </td> |
92 | 92 | </tr> |
93 | 93 | <tr> |
94 | - <td data-export-label="WP Cron"><?php _e( 'WP Cron', 'give' ); ?>:</td> |
|
95 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Displays whether or not WP Cron Jobs are enabled.', 'give' ) ); ?>"></span></td> |
|
94 | + <td data-export-label="WP Cron"><?php _e('WP Cron', 'give'); ?>:</td> |
|
95 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Displays whether or not WP Cron Jobs are enabled.', 'give')); ?>"></span></td> |
|
96 | 96 | <td> |
97 | - <?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?> |
|
97 | + <?php if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) : ?> |
|
98 | 98 | <mark class="no">–</mark> |
99 | 99 | <?php else : ?> |
100 | 100 | <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
@@ -102,55 +102,55 @@ discard block |
||
102 | 102 | </td> |
103 | 103 | </tr> |
104 | 104 | <tr> |
105 | - <td data-export-label="Language"><?php _e( 'Language', 'give' ); ?>:</td> |
|
106 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The current language used by WordPress. Default = English', 'give' ) ); ?>"></span></td> |
|
105 | + <td data-export-label="Language"><?php _e('Language', 'give'); ?>:</td> |
|
106 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The current language used by WordPress. Default = English', 'give')); ?>"></span></td> |
|
107 | 107 | <td><?php echo get_locale(); ?></td> |
108 | 108 | </tr> |
109 | 109 | <tr> |
110 | - <td data-export-label="Permalink Structure"><?php _e( 'Permalink Structure', 'give' ); ?>:</td> |
|
111 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The permalink structure as defined in Settings.', 'give' ) ); ?>"></span></td> |
|
112 | - <td><?php echo esc_html( get_option( 'permalink_structure', __( 'Default', 'give' ) ) ); ?></td> |
|
110 | + <td data-export-label="Permalink Structure"><?php _e('Permalink Structure', 'give'); ?>:</td> |
|
111 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The permalink structure as defined in Settings.', 'give')); ?>"></span></td> |
|
112 | + <td><?php echo esc_html(get_option('permalink_structure', __('Default', 'give'))); ?></td> |
|
113 | 113 | </tr> |
114 | 114 | <tr> |
115 | - <td data-export-label="Show on Front"><?php _e( 'Show on Front', 'give' ); ?>:</td> |
|
116 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether your front page is set to show posts or a static page.', 'give' ) ); ?>"></span></td> |
|
117 | - <td><?php echo esc_html( get_option( 'show_on_front', '–' ) ); ?></td> |
|
115 | + <td data-export-label="Show on Front"><?php _e('Show on Front', 'give'); ?>:</td> |
|
116 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether your front page is set to show posts or a static page.', 'give')); ?>"></span></td> |
|
117 | + <td><?php echo esc_html(get_option('show_on_front', '–')); ?></td> |
|
118 | 118 | </tr> |
119 | - <?php if ( 'page' === get_option( 'show_on_front' ) ) : ?> |
|
119 | + <?php if ('page' === get_option('show_on_front')) : ?> |
|
120 | 120 | <?php |
121 | - $front_page_id = absint( get_option( 'page_on_front' ) ); |
|
122 | - $blog_page_id = absint( get_option( 'page_for_posts' ) ); |
|
121 | + $front_page_id = absint(get_option('page_on_front')); |
|
122 | + $blog_page_id = absint(get_option('page_for_posts')); |
|
123 | 123 | ?> |
124 | 124 | <tr> |
125 | - <td data-export-label="Page on Front"><?php _e( 'Page on Front', 'give' ); ?>:</td> |
|
126 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page set to display as your front page.', 'give' ) ); ?>"></span></td> |
|
127 | - <td><?php echo 0 !== $front_page_id ? esc_html( get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' ) : __( 'Unset', 'give' ); ?></td> |
|
125 | + <td data-export-label="Page on Front"><?php _e('Page on Front', 'give'); ?>:</td> |
|
126 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page set to display as your front page.', 'give')); ?>"></span></td> |
|
127 | + <td><?php echo 0 !== $front_page_id ? esc_html(get_the_title($front_page_id).' (#'.$front_page_id.')') : __('Unset', 'give'); ?></td> |
|
128 | 128 | </tr> |
129 | 129 | <tr> |
130 | - <td data-export-label="Page for Posts"><?php _e( 'Page for Posts', 'give' ); ?>:</td> |
|
131 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page set to display your posts.', 'give' ) ); ?>"></span></td> |
|
132 | - <td><?php echo 0 !== $blog_page_id ? esc_html( get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' ) : __( 'Unset', 'give' ); ?></td> |
|
130 | + <td data-export-label="Page for Posts"><?php _e('Page for Posts', 'give'); ?>:</td> |
|
131 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page set to display your posts.', 'give')); ?>"></span></td> |
|
132 | + <td><?php echo 0 !== $blog_page_id ? esc_html(get_the_title($blog_page_id).' (#'.$blog_page_id.')') : __('Unset', 'give'); ?></td> |
|
133 | 133 | </tr> |
134 | - <?php endif;?> |
|
134 | + <?php endif; ?> |
|
135 | 135 | <tr> |
136 | - <td data-export-label="Table Prefix Length"><?php _e( 'Table Prefix Length', 'give' ); ?>:</td> |
|
137 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The length of the table prefix used in your WordPress database.', 'give' ) ); ?>"></span></td> |
|
138 | - <td><?php echo esc_html( strlen( $wpdb->prefix ) ); ?></td> |
|
136 | + <td data-export-label="Table Prefix Length"><?php _e('Table Prefix Length', 'give'); ?>:</td> |
|
137 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The length of the table prefix used in your WordPress database.', 'give')); ?>"></span></td> |
|
138 | + <td><?php echo esc_html(strlen($wpdb->prefix)); ?></td> |
|
139 | 139 | </tr> |
140 | 140 | <tr> |
141 | - <td data-export-label="Table Prefix Status"><?php _e( 'Table Prefix Status', 'give' ); ?>:</td> |
|
142 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The status of the table prefix used in your WordPress database.', 'give' ) ); ?>"></span></td> |
|
143 | - <td><?php echo strlen( $wpdb->prefix ) > 16 ? esc_html( 'Error: Too long', 'give' ) : esc_html( 'Acceptable', 'give' ); ?></td> |
|
141 | + <td data-export-label="Table Prefix Status"><?php _e('Table Prefix Status', 'give'); ?>:</td> |
|
142 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The status of the table prefix used in your WordPress database.', 'give')); ?>"></span></td> |
|
143 | + <td><?php echo strlen($wpdb->prefix) > 16 ? esc_html('Error: Too long', 'give') : esc_html('Acceptable', 'give'); ?></td> |
|
144 | 144 | </tr> |
145 | 145 | <tr> |
146 | - <td data-export-label="Admin AJAX"><?php _e( 'Admin AJAX', 'give' ); ?>:</td> |
|
147 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether Admin AJAX is accessible.', 'give' ) ); ?>"></span></td> |
|
148 | - <td><?php echo give_test_ajax_works() ? __( 'Accessible', 'give' ) : __( 'Inaccessible', 'give' ); ?></td> |
|
146 | + <td data-export-label="Admin AJAX"><?php _e('Admin AJAX', 'give'); ?>:</td> |
|
147 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether Admin AJAX is accessible.', 'give')); ?>"></span></td> |
|
148 | + <td><?php echo give_test_ajax_works() ? __('Accessible', 'give') : __('Inaccessible', 'give'); ?></td> |
|
149 | 149 | </tr> |
150 | 150 | <tr> |
151 | - <td data-export-label="Registered Post Stati"><?php _e( 'Registered Post Stati', 'give' ); ?>:</td> |
|
152 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'A list of all registered post stati.', 'give' ) ); ?>"></span></td> |
|
153 | - <td><?php echo esc_html( implode( ', ', get_post_stati() ) ); ?></td> |
|
151 | + <td data-export-label="Registered Post Stati"><?php _e('Registered Post Stati', 'give'); ?>:</td> |
|
152 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('A list of all registered post stati.', 'give')); ?>"></span></td> |
|
153 | + <td><?php echo esc_html(implode(', ', get_post_stati())); ?></td> |
|
154 | 154 | </tr> |
155 | 155 | </tbody> |
156 | 156 | </table> |
@@ -158,90 +158,90 @@ discard block |
||
158 | 158 | <table class="give-status-table widefat" cellspacing="0"> |
159 | 159 | <thead> |
160 | 160 | <tr> |
161 | - <th colspan="3" data-export-label="Server Environment"><h2><?php _e( 'Server Environment', 'give' ); ?></h2></th> |
|
161 | + <th colspan="3" data-export-label="Server Environment"><h2><?php _e('Server Environment', 'give'); ?></h2></th> |
|
162 | 162 | </tr> |
163 | 163 | </thead> |
164 | 164 | <tbody> |
165 | 165 | <tr> |
166 | - <td data-export-label="Hosting Provider"><?php _e( 'Hosting Provider', 'give' ); ?>:</td> |
|
167 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The hosting provider for this WordPress installation.', 'give' ) ); ?>"></span></td> |
|
168 | - <td><?php echo give_get_host() ? esc_html( give_get_host() ) : __( 'Unknown', 'give' ); ?></td> |
|
166 | + <td data-export-label="Hosting Provider"><?php _e('Hosting Provider', 'give'); ?>:</td> |
|
167 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The hosting provider for this WordPress installation.', 'give')); ?>"></span></td> |
|
168 | + <td><?php echo give_get_host() ? esc_html(give_get_host()) : __('Unknown', 'give'); ?></td> |
|
169 | 169 | </tr> |
170 | 170 | <tr> |
171 | - <td data-export-label="TLS Connection"><?php _e( 'TLS Connection', 'give' ); ?>:</td> |
|
172 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Most payment gateway APIs only support connections using the TLS 1.2 security protocol.', 'give' ) ); ?>"></span></td> |
|
171 | + <td data-export-label="TLS Connection"><?php _e('TLS Connection', 'give'); ?>:</td> |
|
172 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Most payment gateway APIs only support connections using the TLS 1.2 security protocol.', 'give')); ?>"></span></td> |
|
173 | 173 | <td><?php |
174 | - $tls_check = wp_remote_post( 'https://www.howsmyssl.com/a/check' ); |
|
175 | - if ( ! is_wp_error( $tls_check ) ) { |
|
176 | - $tls_check = json_decode( wp_remote_retrieve_body( $tls_check ) ); |
|
174 | + $tls_check = wp_remote_post('https://www.howsmyssl.com/a/check'); |
|
175 | + if ( ! is_wp_error($tls_check)) { |
|
176 | + $tls_check = json_decode(wp_remote_retrieve_body($tls_check)); |
|
177 | 177 | /* translators: %s: SSL connection response */ |
178 | - printf( __('Connection uses %s', 'give'), esc_html( $tls_check->tls_version )) ; |
|
178 | + printf(__('Connection uses %s', 'give'), esc_html($tls_check->tls_version)); |
|
179 | 179 | } |
180 | 180 | ?></td> |
181 | 181 | </tr> |
182 | 182 | <tr> |
183 | - <td data-export-label="TLS Connection"><?php _e( 'TLS Rating', 'give' ); ?>:</td> |
|
184 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The server\'s connection as rated by https://www.howsmyssl.com/', 'give' ) ); ?>"></span></td> |
|
185 | - <td><?php if ( ! is_wp_error( $tls_check ) ) { |
|
186 | - esc_html_e( $tls_check->rating); |
|
183 | + <td data-export-label="TLS Connection"><?php _e('TLS Rating', 'give'); ?>:</td> |
|
184 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The server\'s connection as rated by https://www.howsmyssl.com/', 'give')); ?>"></span></td> |
|
185 | + <td><?php if ( ! is_wp_error($tls_check)) { |
|
186 | + esc_html_e($tls_check->rating); |
|
187 | 187 | } ?></td> |
188 | 188 | </tr> |
189 | 189 | <tr> |
190 | - <td data-export-label="Server Info"><?php _e( 'Server Info', 'give' ); ?>:</td> |
|
191 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Information about the web server that is currently hosting your site.', 'give' ) ); ?>"></span></td> |
|
192 | - <td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td> |
|
190 | + <td data-export-label="Server Info"><?php _e('Server Info', 'give'); ?>:</td> |
|
191 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Information about the web server that is currently hosting your site.', 'give')); ?>"></span></td> |
|
192 | + <td><?php echo esc_html($_SERVER['SERVER_SOFTWARE']); ?></td> |
|
193 | 193 | </tr> |
194 | 194 | <tr> |
195 | - <td data-export-label="PHP Version"><?php _e( 'PHP Version', 'give' ); ?>:</td> |
|
196 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of PHP installed on your hosting server.', 'give' ) ); ?>"></span></td> |
|
195 | + <td data-export-label="PHP Version"><?php _e('PHP Version', 'give'); ?>:</td> |
|
196 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of PHP installed on your hosting server.', 'give')); ?>"></span></td> |
|
197 | 197 | <td><?php |
198 | 198 | // Check if phpversion function exists. |
199 | - if ( function_exists( 'phpversion' ) ) { |
|
199 | + if (function_exists('phpversion')) { |
|
200 | 200 | $php_version = phpversion(); |
201 | 201 | |
202 | - if ( version_compare( $php_version, '5.6', '<' ) ) { |
|
203 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum PHP version of 5.6. See: %s', 'give' ), esc_html( $php_version ), '<a href="http://docs.givewp.com/settings-system-info" target="_blank">' . __( 'PHP Requirements in Give', 'give' ) . '</a>' ) . '</mark>'; |
|
202 | + if (version_compare($php_version, '5.6', '<')) { |
|
203 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum PHP version of 5.6. See: %s', 'give'), esc_html($php_version), '<a href="http://docs.givewp.com/settings-system-info" target="_blank">'.__('PHP Requirements in Give', 'give').'</a>').'</mark>'; |
|
204 | 204 | } else { |
205 | - echo '<mark class="yes">' . esc_html( $php_version ) . '</mark>'; |
|
205 | + echo '<mark class="yes">'.esc_html($php_version).'</mark>'; |
|
206 | 206 | } |
207 | 207 | } else { |
208 | - _e( "Couldn't determine PHP version because phpversion() doesn't exist.", 'give' ); |
|
208 | + _e("Couldn't determine PHP version because phpversion() doesn't exist.", 'give'); |
|
209 | 209 | } |
210 | 210 | ?></td> |
211 | 211 | </tr> |
212 | - <?php if ( function_exists( 'ini_get' ) ) : ?> |
|
212 | + <?php if (function_exists('ini_get')) : ?> |
|
213 | 213 | <tr> |
214 | - <td data-export-label="PHP Post Max Size"><?php _e( 'PHP Post Max Size', 'give' ); ?>:</td> |
|
215 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The largest filesize that can be contained in one post.', 'give' ) ); ?>"></span></td> |
|
216 | - <td><?php echo size_format( give_let_to_num( ini_get( 'post_max_size' ) ) ); ?></td> |
|
214 | + <td data-export-label="PHP Post Max Size"><?php _e('PHP Post Max Size', 'give'); ?>:</td> |
|
215 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The largest filesize that can be contained in one post.', 'give')); ?>"></span></td> |
|
216 | + <td><?php echo size_format(give_let_to_num(ini_get('post_max_size'))); ?></td> |
|
217 | 217 | </tr> |
218 | 218 | <tr> |
219 | - <td data-export-label="PHP Time Limit"><?php _e( 'PHP Time Limit', 'give' ); ?>:</td> |
|
220 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups).', 'give' ) ); ?>"></span></td> |
|
221 | - <td><?php echo ini_get( 'max_execution_time' ); ?></td> |
|
219 | + <td data-export-label="PHP Time Limit"><?php _e('PHP Time Limit', 'give'); ?>:</td> |
|
220 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups).', 'give')); ?>"></span></td> |
|
221 | + <td><?php echo ini_get('max_execution_time'); ?></td> |
|
222 | 222 | </tr> |
223 | 223 | <tr> |
224 | - <td data-export-label="PHP Max Input Vars"><?php _e( 'PHP Max Input Vars', 'give' ); ?>:</td> |
|
225 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The maximum number of variables your server can use for a single function to avoid overloads.', 'give' ) ); ?>"></span></td> |
|
226 | - <td><?php echo ini_get( 'max_input_vars' ); ?></td> |
|
224 | + <td data-export-label="PHP Max Input Vars"><?php _e('PHP Max Input Vars', 'give'); ?>:</td> |
|
225 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The maximum number of variables your server can use for a single function to avoid overloads.', 'give')); ?>"></span></td> |
|
226 | + <td><?php echo ini_get('max_input_vars'); ?></td> |
|
227 | 227 | </tr> |
228 | 228 | <tr> |
229 | - <td data-export-label="PHP Max Upload Size"><?php _e( 'PHP Max Upload Size', 'give' ); ?>:</td> |
|
230 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The largest filesize that can be uploaded to your WordPress installation.', 'give' ) ); ?>"></span></td> |
|
231 | - <td><?php echo size_format( wp_max_upload_size() ); ?></td> |
|
229 | + <td data-export-label="PHP Max Upload Size"><?php _e('PHP Max Upload Size', 'give'); ?>:</td> |
|
230 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The largest filesize that can be uploaded to your WordPress installation.', 'give')); ?>"></span></td> |
|
231 | + <td><?php echo size_format(wp_max_upload_size()); ?></td> |
|
232 | 232 | </tr> |
233 | 233 | <tr> |
234 | - <td data-export-label="cURL Version"><?php _e( 'cURL Version', 'give' ); ?>:</td> |
|
235 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of cURL installed on your server.', 'give' ) ); ?>"></span></td> |
|
234 | + <td data-export-label="cURL Version"><?php _e('cURL Version', 'give'); ?>:</td> |
|
235 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of cURL installed on your server.', 'give')); ?>"></span></td> |
|
236 | 236 | <td> |
237 | 237 | <?php |
238 | - if ( function_exists( 'curl_version' ) ) { |
|
238 | + if (function_exists('curl_version')) { |
|
239 | 239 | $curl_version = curl_version(); |
240 | 240 | |
241 | - if ( version_compare( $curl_version['version'], '7.40', '<' ) ) { |
|
242 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum cURL version of 7.40.', 'give' ), esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) ) . '</mark>'; |
|
241 | + if (version_compare($curl_version['version'], '7.40', '<')) { |
|
242 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum cURL version of 7.40.', 'give'), esc_html($curl_version['version'].', '.$curl_version['ssl_version'])).'</mark>'; |
|
243 | 243 | } else { |
244 | - echo '<mark class="yes">' . esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) . '</mark>'; |
|
244 | + echo '<mark class="yes">'.esc_html($curl_version['version'].', '.$curl_version['ssl_version']).'</mark>'; |
|
245 | 245 | } |
246 | 246 | } else { |
247 | 247 | echo '&ndash'; |
@@ -250,42 +250,42 @@ discard block |
||
250 | 250 | </td> |
251 | 251 | </tr> |
252 | 252 | <tr> |
253 | - <td data-export-label="SUHOSIN Installed"><?php _e( 'SUHOSIN Installed', 'give' ); ?>:</td> |
|
254 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'give' ) ); ?>"></span></td> |
|
255 | - <td><?php echo extension_loaded( 'suhosin' ) ? '<span class="dashicons dashicons-yes"></span>' : '–'; ?></td> |
|
253 | + <td data-export-label="SUHOSIN Installed"><?php _e('SUHOSIN Installed', 'give'); ?>:</td> |
|
254 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'give')); ?>"></span></td> |
|
255 | + <td><?php echo extension_loaded('suhosin') ? '<span class="dashicons dashicons-yes"></span>' : '–'; ?></td> |
|
256 | 256 | </tr> |
257 | 257 | <?php endif; |
258 | 258 | |
259 | - if ( $wpdb->use_mysqli ) { |
|
260 | - $ver = mysqli_get_server_info( $wpdb->dbh ); |
|
259 | + if ($wpdb->use_mysqli) { |
|
260 | + $ver = mysqli_get_server_info($wpdb->dbh); |
|
261 | 261 | } else { |
262 | 262 | $ver = mysql_get_server_info(); |
263 | 263 | } |
264 | 264 | |
265 | - if ( ! empty( $wpdb->is_mysql ) && ! stristr( $ver, 'MariaDB' ) ) : ?> |
|
265 | + if ( ! empty($wpdb->is_mysql) && ! stristr($ver, 'MariaDB')) : ?> |
|
266 | 266 | <tr> |
267 | - <td data-export-label="MySQL Version"><?php _e( 'MySQL Version', 'give' ); ?>:</td> |
|
268 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of MySQL installed on your hosting server.', 'give' ) ); ?>"></span></td> |
|
267 | + <td data-export-label="MySQL Version"><?php _e('MySQL Version', 'give'); ?>:</td> |
|
268 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of MySQL installed on your hosting server.', 'give')); ?>"></span></td> |
|
269 | 269 | <td> |
270 | 270 | <?php |
271 | 271 | $mysql_version = $wpdb->db_version(); |
272 | 272 | |
273 | - if ( version_compare( $mysql_version, '5.6', '<' ) ) { |
|
274 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum MySQL version of 5.6. See: %s', 'give' ), esc_html( $mysql_version ), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . __( 'WordPress Requirements', 'give' ) . '</a>' ) . '</mark>'; |
|
273 | + if (version_compare($mysql_version, '5.6', '<')) { |
|
274 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum MySQL version of 5.6. See: %s', 'give'), esc_html($mysql_version), '<a href="https://wordpress.org/about/requirements/" target="_blank">'.__('WordPress Requirements', 'give').'</a>').'</mark>'; |
|
275 | 275 | } else { |
276 | - echo '<mark class="yes">' . esc_html( $mysql_version ) . '</mark>'; |
|
276 | + echo '<mark class="yes">'.esc_html($mysql_version).'</mark>'; |
|
277 | 277 | } |
278 | 278 | ?> |
279 | 279 | </td> |
280 | 280 | </tr> |
281 | 281 | <?php endif; ?> |
282 | 282 | <tr> |
283 | - <td data-export-label="Default Timezone is UTC"><?php _e( 'Default Timezone is UTC', 'give' ); ?>:</td> |
|
284 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The default timezone for your server.', 'give' ) ); ?>"></span></td> |
|
283 | + <td data-export-label="Default Timezone is UTC"><?php _e('Default Timezone is UTC', 'give'); ?>:</td> |
|
284 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The default timezone for your server.', 'give')); ?>"></span></td> |
|
285 | 285 | <td><?php |
286 | 286 | $default_timezone = date_default_timezone_get(); |
287 | - if ( 'UTC' !== $default_timezone ) { |
|
288 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( 'Default timezone is %s - it should be UTC', 'give' ), $default_timezone ) . '</mark>'; |
|
287 | + if ('UTC' !== $default_timezone) { |
|
288 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('Default timezone is %s - it should be UTC', 'give'), $default_timezone).'</mark>'; |
|
289 | 289 | } else { |
290 | 290 | echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
291 | 291 | } ?> |
@@ -296,118 +296,118 @@ discard block |
||
296 | 296 | |
297 | 297 | // fsockopen/cURL. |
298 | 298 | $posting['fsockopen_curl']['name'] = 'fsockopen/cURL'; |
299 | - $posting['fsockopen_curl']['help'] = __( 'Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'give' ); |
|
299 | + $posting['fsockopen_curl']['help'] = __('Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'give'); |
|
300 | 300 | |
301 | - if ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) { |
|
301 | + if (function_exists('fsockopen') || function_exists('curl_init')) { |
|
302 | 302 | $posting['fsockopen_curl']['success'] = true; |
303 | 303 | } else { |
304 | 304 | $posting['fsockopen_curl']['success'] = false; |
305 | - $posting['fsockopen_curl']['note'] = __( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'give' ); |
|
305 | + $posting['fsockopen_curl']['note'] = __('Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'give'); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | // SOAP. |
309 | 309 | $posting['soap_client']['name'] = 'SoapClient'; |
310 | - $posting['soap_client']['help'] = __( 'Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'give' ); |
|
310 | + $posting['soap_client']['help'] = __('Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'give'); |
|
311 | 311 | |
312 | - if ( class_exists( 'SoapClient' ) ) { |
|
312 | + if (class_exists('SoapClient')) { |
|
313 | 313 | $posting['soap_client']['success'] = true; |
314 | 314 | } else { |
315 | 315 | $posting['soap_client']['success'] = false; |
316 | - $posting['soap_client']['note'] = sprintf( __( 'Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'give' ), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>' ); |
|
316 | + $posting['soap_client']['note'] = sprintf(__('Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'give'), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>'); |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | // DOMDocument. |
320 | 320 | $posting['dom_document']['name'] = 'DOMDocument'; |
321 | - $posting['dom_document']['help'] = __( 'HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'give' ); |
|
321 | + $posting['dom_document']['help'] = __('HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'give'); |
|
322 | 322 | |
323 | - if ( class_exists( 'DOMDocument' ) ) { |
|
323 | + if (class_exists('DOMDocument')) { |
|
324 | 324 | $posting['dom_document']['success'] = true; |
325 | 325 | } else { |
326 | 326 | $posting['dom_document']['success'] = false; |
327 | - $posting['dom_document']['note'] = sprintf( __( 'Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'give' ), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>' ); |
|
327 | + $posting['dom_document']['note'] = sprintf(__('Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'give'), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>'); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | // gzip. |
331 | 331 | $posting['gzip']['name'] = 'gzip'; |
332 | - $posting['gzip']['help'] = __( 'gzip is used for file compression and decompression.', 'give' ); |
|
332 | + $posting['gzip']['help'] = __('gzip is used for file compression and decompression.', 'give'); |
|
333 | 333 | |
334 | - if ( is_callable( 'gzopen' ) ) { |
|
334 | + if (is_callable('gzopen')) { |
|
335 | 335 | $posting['gzip']['success'] = true; |
336 | 336 | } else { |
337 | 337 | $posting['gzip']['success'] = false; |
338 | - $posting['gzip']['note'] = sprintf( __( 'Your server does not support the %s function - this is used for file compression and decompression.', 'give' ), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>' ); |
|
338 | + $posting['gzip']['note'] = sprintf(__('Your server does not support the %s function - this is used for file compression and decompression.', 'give'), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>'); |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | // GD Graphics Library. |
342 | 342 | $posting['gd']['name'] = 'GD Graphics Library'; |
343 | - $posting['gd']['help'] = __( 'GD Graphics Library is used for dynamically manipulating images.', 'give' ); |
|
344 | - $posting['gd']['success'] = extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ? true : false; |
|
343 | + $posting['gd']['help'] = __('GD Graphics Library is used for dynamically manipulating images.', 'give'); |
|
344 | + $posting['gd']['success'] = extension_loaded('gd') && function_exists('gd_info') ? true : false; |
|
345 | 345 | |
346 | 346 | // Multibyte String. |
347 | 347 | $posting['mbstring']['name'] = 'Multibyte String'; |
348 | - $posting['mbstring']['help'] = __( 'Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'give' ); |
|
348 | + $posting['mbstring']['help'] = __('Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'give'); |
|
349 | 349 | |
350 | - if ( extension_loaded( 'mbstring' ) ) { |
|
350 | + if (extension_loaded('mbstring')) { |
|
351 | 351 | $posting['mbstring']['success'] = true; |
352 | 352 | } else { |
353 | 353 | $posting['mbstring']['success'] = false; |
354 | - $posting['mbstring']['note'] = sprintf( __( 'Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'give' ), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>' ); |
|
354 | + $posting['mbstring']['note'] = sprintf(__('Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'give'), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>'); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | // WP Remote Post Check. |
358 | - $posting['wp_remote_post']['name'] = __( 'Remote Post', 'give'); |
|
359 | - $posting['wp_remote_post']['help'] = __( 'PayPal uses this method of communicating when sending back transaction information.', 'give' ); |
|
358 | + $posting['wp_remote_post']['name'] = __('Remote Post', 'give'); |
|
359 | + $posting['wp_remote_post']['help'] = __('PayPal uses this method of communicating when sending back transaction information.', 'give'); |
|
360 | 360 | |
361 | - $response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array( |
|
361 | + $response = wp_safe_remote_post('https://www.paypal.com/cgi-bin/webscr', array( |
|
362 | 362 | 'timeout' => 60, |
363 | - 'user-agent' => 'Give/' . GIVE_VERSION, |
|
363 | + 'user-agent' => 'Give/'.GIVE_VERSION, |
|
364 | 364 | 'httpversion' => '1.1', |
365 | 365 | 'body' => array( |
366 | 366 | 'cmd' => '_notify-validate' |
367 | 367 | ) |
368 | - ) ); |
|
368 | + )); |
|
369 | 369 | |
370 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
370 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
371 | 371 | $posting['wp_remote_post']['success'] = true; |
372 | 372 | } else { |
373 | - $posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'give' ); |
|
374 | - if ( is_wp_error( $response ) ) { |
|
375 | - $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), sanitize_text_field( $response->get_error_message() ) ); |
|
373 | + $posting['wp_remote_post']['note'] = __('wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'give'); |
|
374 | + if (is_wp_error($response)) { |
|
375 | + $posting['wp_remote_post']['note'] .= ' '.sprintf(__('Error: %s', 'give'), sanitize_text_field($response->get_error_message())); |
|
376 | 376 | } else { |
377 | - $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), sanitize_text_field( $response['response']['code'] ) ); |
|
377 | + $posting['wp_remote_post']['note'] .= ' '.sprintf(__('Status code: %s', 'give'), sanitize_text_field($response['response']['code'])); |
|
378 | 378 | } |
379 | 379 | $posting['wp_remote_post']['success'] = false; |
380 | 380 | } |
381 | 381 | |
382 | 382 | // WP Remote Get Check. |
383 | - $posting['wp_remote_get']['name'] = __( 'Remote Get', 'give'); |
|
384 | - $posting['wp_remote_get']['help'] = __( 'Give plugins may use this method of communication when checking for plugin updates.', 'give' ); |
|
383 | + $posting['wp_remote_get']['name'] = __('Remote Get', 'give'); |
|
384 | + $posting['wp_remote_get']['help'] = __('Give plugins may use this method of communication when checking for plugin updates.', 'give'); |
|
385 | 385 | |
386 | - $response = wp_safe_remote_get( 'https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . ( is_multisite() ? '1' : '0' ) ); |
|
386 | + $response = wp_safe_remote_get('https://woocommerce.com/wc-api/product-key-api?request=ping&network='.(is_multisite() ? '1' : '0')); |
|
387 | 387 | |
388 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
388 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
389 | 389 | $posting['wp_remote_get']['success'] = true; |
390 | 390 | } else { |
391 | - $posting['wp_remote_get']['note'] = __( 'wp_remote_get() failed. The Give plugin updater won\'t work with your server. Contact your hosting provider.', 'give' ); |
|
392 | - if ( is_wp_error( $response ) ) { |
|
393 | - $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), give_clean( $response->get_error_message() ) ); |
|
391 | + $posting['wp_remote_get']['note'] = __('wp_remote_get() failed. The Give plugin updater won\'t work with your server. Contact your hosting provider.', 'give'); |
|
392 | + if (is_wp_error($response)) { |
|
393 | + $posting['wp_remote_get']['note'] .= ' '.sprintf(__('Error: %s', 'give'), give_clean($response->get_error_message())); |
|
394 | 394 | } else { |
395 | - $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), give_clean( $response['response']['code'] ) ); |
|
395 | + $posting['wp_remote_get']['note'] .= ' '.sprintf(__('Status code: %s', 'give'), give_clean($response['response']['code'])); |
|
396 | 396 | } |
397 | 397 | $posting['wp_remote_get']['success'] = false; |
398 | 398 | } |
399 | 399 | |
400 | - $posting = apply_filters( 'give_debug_posting', $posting ); |
|
400 | + $posting = apply_filters('give_debug_posting', $posting); |
|
401 | 401 | |
402 | - foreach ( $posting as $post ) { |
|
403 | - $mark = ! empty( $post['success'] ) ? 'yes' : 'error'; |
|
402 | + foreach ($posting as $post) { |
|
403 | + $mark = ! empty($post['success']) ? 'yes' : 'error'; |
|
404 | 404 | ?> |
405 | 405 | <tr> |
406 | - <td data-export-label="<?php echo esc_html( $post['name'] ); ?>"><?php echo esc_html( $post['name'] ); ?>:</td> |
|
407 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( isset( $post['help'] ) ? $post['help'] : '' ); ?>"></span></td> |
|
406 | + <td data-export-label="<?php echo esc_html($post['name']); ?>"><?php echo esc_html($post['name']); ?>:</td> |
|
407 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(isset($post['help']) ? $post['help'] : ''); ?>"></span></td> |
|
408 | 408 | <td> |
409 | 409 | <mark class="<?php echo $mark; ?>"> |
410 | - <?php echo ! empty( $post['success'] ) ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no-alt"></span>'; ?> <?php echo ! empty( $post['note'] ) ? wp_kses_data( $post['note'] ) : ''; ?> |
|
410 | + <?php echo ! empty($post['success']) ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no-alt"></span>'; ?> <?php echo ! empty($post['note']) ? wp_kses_data($post['note']) : ''; ?> |
|
411 | 411 | </mark> |
412 | 412 | </td> |
413 | 413 | </tr> |
@@ -420,122 +420,122 @@ discard block |
||
420 | 420 | <table class="give-status-table widefat" cellspacing="0"> |
421 | 421 | <thead> |
422 | 422 | <tr> |
423 | - <th colspan="3" data-export-label="Give Configuration"><h2><?php _e( 'Give Configuration', 'give' ); ?></h2></th> |
|
423 | + <th colspan="3" data-export-label="Give Configuration"><h2><?php _e('Give Configuration', 'give'); ?></h2></th> |
|
424 | 424 | </tr> |
425 | 425 | </thead> |
426 | 426 | <tbody> |
427 | 427 | <tr> |
428 | - <td data-export-label="Give Version"><?php _e( 'Give Version', 'give' ); ?>:</td> |
|
429 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of Give installed on your site.', 'give' ) ); ?>"></span></td> |
|
430 | - <td><?php echo esc_html( GIVE_VERSION ); ?></td> |
|
428 | + <td data-export-label="Give Version"><?php _e('Give Version', 'give'); ?>:</td> |
|
429 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of Give installed on your site.', 'give')); ?>"></span></td> |
|
430 | + <td><?php echo esc_html(GIVE_VERSION); ?></td> |
|
431 | 431 | </tr> |
432 | 432 | <tr> |
433 | - <td data-export-label="Upgraded From"><?php _e( 'Upgraded From', 'give' ); ?>:</td> |
|
434 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of Give installed prior to the last update.', 'give' ) ); ?>"></span></td> |
|
435 | - <td><?php echo esc_html( get_option( 'give_version_upgraded_from', '–' ) ); ?></td> |
|
433 | + <td data-export-label="Upgraded From"><?php _e('Upgraded From', 'give'); ?>:</td> |
|
434 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of Give installed prior to the last update.', 'give')); ?>"></span></td> |
|
435 | + <td><?php echo esc_html(get_option('give_version_upgraded_from', '–')); ?></td> |
|
436 | 436 | </tr> |
437 | 437 | <tr> |
438 | - <td data-export-label="Test Mode"><?php _e( 'Test Mode', 'give' ); ?>:</td> |
|
439 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether Test Mode is enabled in Give settings.', 'give' ) ); ?>"></span></td> |
|
440 | - <td><?php echo give_is_test_mode() ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
438 | + <td data-export-label="Test Mode"><?php _e('Test Mode', 'give'); ?>:</td> |
|
439 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether Test Mode is enabled in Give settings.', 'give')); ?>"></span></td> |
|
440 | + <td><?php echo give_is_test_mode() ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
441 | 441 | </tr> |
442 | 442 | <tr> |
443 | - <td data-export-label="Currency Code"><?php _e( 'Currency Code', 'give' ); ?>:</td> |
|
444 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The currency code selected in Give settings.', 'give' ) ); ?>"></span></td> |
|
445 | - <td><?php echo esc_html( give_get_currency() ); ?></td> |
|
443 | + <td data-export-label="Currency Code"><?php _e('Currency Code', 'give'); ?>:</td> |
|
444 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The currency code selected in Give settings.', 'give')); ?>"></span></td> |
|
445 | + <td><?php echo esc_html(give_get_currency()); ?></td> |
|
446 | 446 | </tr> |
447 | 447 | <tr> |
448 | - <td data-export-label="Currency Position"><?php _e( 'Currency Position', 'give' ); ?>:</td> |
|
449 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The currency position selected in Give settings.', 'give' ) ); ?>"></span></td> |
|
450 | - <td><?php echo 'before' === give_get_option( 'currency_position' ) ? __( 'Before', 'give' ) : __( 'After', 'give' ); ?></td> |
|
448 | + <td data-export-label="Currency Position"><?php _e('Currency Position', 'give'); ?>:</td> |
|
449 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The currency position selected in Give settings.', 'give')); ?>"></span></td> |
|
450 | + <td><?php echo 'before' === give_get_option('currency_position') ? __('Before', 'give') : __('After', 'give'); ?></td> |
|
451 | 451 | </tr> |
452 | 452 | <tr> |
453 | - <td data-export-label="Decimal Separator"><?php _e( 'Decimal Separator', 'give' ); ?>:</td> |
|
454 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The decimal separator defined in Give settings.', 'give' ) ); ?>"></span></td> |
|
455 | - <td><?php echo esc_html( give_get_option( 'decimal_separator', '.' ) ); ?></td> |
|
453 | + <td data-export-label="Decimal Separator"><?php _e('Decimal Separator', 'give'); ?>:</td> |
|
454 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The decimal separator defined in Give settings.', 'give')); ?>"></span></td> |
|
455 | + <td><?php echo esc_html(give_get_option('decimal_separator', '.')); ?></td> |
|
456 | 456 | </tr> |
457 | 457 | <tr> |
458 | - <td data-export-label="Thousands Separator"><?php _e( 'Thousands Separator', 'give' ); ?>:</td> |
|
459 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The thousands separator defined in Give settings.', 'give' ) ); ?>"></span></td> |
|
460 | - <td><?php echo esc_html( give_get_option( 'thousands_separator', ',' ) ); ?></td> |
|
458 | + <td data-export-label="Thousands Separator"><?php _e('Thousands Separator', 'give'); ?>:</td> |
|
459 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The thousands separator defined in Give settings.', 'give')); ?>"></span></td> |
|
460 | + <td><?php echo esc_html(give_get_option('thousands_separator', ',')); ?></td> |
|
461 | 461 | </tr> |
462 | 462 | <tr> |
463 | - <td data-export-label="Success Page"><?php _e( 'Success Page', 'give' ); ?>:</td> |
|
464 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page where donors land following a successful transaction.', 'give' ) ); ?>"></span></td> |
|
465 | - <td><?php echo ! empty( $give_options['success_page'] ) ? esc_url( get_permalink( $give_options['success_page'] ) ) : '–'; ?></td> |
|
463 | + <td data-export-label="Success Page"><?php _e('Success Page', 'give'); ?>:</td> |
|
464 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page where donors land following a successful transaction.', 'give')); ?>"></span></td> |
|
465 | + <td><?php echo ! empty($give_options['success_page']) ? esc_url(get_permalink($give_options['success_page'])) : '–'; ?></td> |
|
466 | 466 | </tr> |
467 | 467 | <tr> |
468 | - <td data-export-label="Failure Page"><?php _e( 'Failure Page', 'give' ); ?>:</td> |
|
469 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page where donors land following a failed transaction.', 'give' ) ); ?>"></span></td> |
|
470 | - <td><?php echo ! empty( $give_options['failure_page'] ) ? esc_url( get_permalink( $give_options['failure_page'] ) ) : '–'; ?></td> |
|
468 | + <td data-export-label="Failure Page"><?php _e('Failure Page', 'give'); ?>:</td> |
|
469 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page where donors land following a failed transaction.', 'give')); ?>"></span></td> |
|
470 | + <td><?php echo ! empty($give_options['failure_page']) ? esc_url(get_permalink($give_options['failure_page'])) : '–'; ?></td> |
|
471 | 471 | </tr> |
472 | 472 | <tr> |
473 | - <td data-export-label="Donation History Page"><?php _e( 'Donation History Page', 'give' ); ?>:</td> |
|
474 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page where past donations are listed.', 'give' ) ); ?>"></span></td> |
|
475 | - <td><?php echo ! empty( $give_options['history_page'] ) ? esc_url( get_permalink( $give_options['history_page'] ) ) : '–'; ?></td> |
|
473 | + <td data-export-label="Donation History Page"><?php _e('Donation History Page', 'give'); ?>:</td> |
|
474 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page where past donations are listed.', 'give')); ?>"></span></td> |
|
475 | + <td><?php echo ! empty($give_options['history_page']) ? esc_url(get_permalink($give_options['history_page'])) : '–'; ?></td> |
|
476 | 476 | </tr> |
477 | 477 | <tr> |
478 | - <td data-export-label="Give Forms Slug"><?php _e( 'Give Forms Slug', 'give' ); ?>:</td> |
|
479 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The slug used for Give donation forms.', 'give' ) ); ?>"></span></td> |
|
480 | - <td><?php echo esc_html( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . '/' : '/donations/' ); ?></td> |
|
478 | + <td data-export-label="Give Forms Slug"><?php _e('Give Forms Slug', 'give'); ?>:</td> |
|
479 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The slug used for Give donation forms.', 'give')); ?>"></span></td> |
|
480 | + <td><?php echo esc_html(defined('GIVE_SLUG') ? '/'.GIVE_SLUG.'/' : '/donations/'); ?></td> |
|
481 | 481 | </tr> |
482 | 482 | <?php |
483 | 483 | $active_gateways = give_get_enabled_payment_gateways(); |
484 | 484 | $enabled_gateways = $default_gateway = ''; |
485 | 485 | |
486 | - if ( $active_gateways ) { |
|
487 | - $default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) ); |
|
486 | + if ($active_gateways) { |
|
487 | + $default_gateway_is_active = give_is_gateway_active(give_get_default_gateway(null)); |
|
488 | 488 | |
489 | - if ( $default_gateway_is_active ) { |
|
490 | - $default_gateway = give_get_default_gateway( null ); |
|
491 | - $default_gateway = $active_gateways[ $default_gateway ]['admin_label']; |
|
489 | + if ($default_gateway_is_active) { |
|
490 | + $default_gateway = give_get_default_gateway(null); |
|
491 | + $default_gateway = $active_gateways[$default_gateway]['admin_label']; |
|
492 | 492 | } else { |
493 | - $default_gateway = __( 'Test Donation', 'give' ); |
|
493 | + $default_gateway = __('Test Donation', 'give'); |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | $gateways = array(); |
497 | 497 | |
498 | - foreach ( $active_gateways as $gateway ) { |
|
498 | + foreach ($active_gateways as $gateway) { |
|
499 | 499 | $gateways[] = $gateway['admin_label']; |
500 | 500 | } |
501 | 501 | |
502 | - $enabled_gateways = implode( ', ', $gateways ); |
|
502 | + $enabled_gateways = implode(', ', $gateways); |
|
503 | 503 | } |
504 | 504 | ?> |
505 | 505 | <tr> |
506 | - <td data-export-label="Enabled Payment Gateways"><?php _e( 'Enabled Payment Gateways', 'give' ); ?>:</td> |
|
507 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'All payment gateways enabled in Give settings.', 'give' ) ); ?>"></span></td> |
|
508 | - <td><?php echo esc_html( ! empty( $enabled_gateways ) ? $enabled_gateways : '–' ); ?></td> |
|
506 | + <td data-export-label="Enabled Payment Gateways"><?php _e('Enabled Payment Gateways', 'give'); ?>:</td> |
|
507 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('All payment gateways enabled in Give settings.', 'give')); ?>"></span></td> |
|
508 | + <td><?php echo esc_html( ! empty($enabled_gateways) ? $enabled_gateways : '–'); ?></td> |
|
509 | 509 | </tr> |
510 | 510 | <tr> |
511 | - <td data-export-label="Default Payment Gateway"><?php _e( 'Default Payment Gateway', 'give' ); ?>:</td> |
|
512 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The default payment gateway selected in Give settings.', 'give' ) ); ?>"></span></td> |
|
513 | - <td><?php echo esc_html( ! empty( $default_gateway ) ? $default_gateway : '–' ); ?></td> |
|
511 | + <td data-export-label="Default Payment Gateway"><?php _e('Default Payment Gateway', 'give'); ?>:</td> |
|
512 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The default payment gateway selected in Give settings.', 'give')); ?>"></span></td> |
|
513 | + <td><?php echo esc_html( ! empty($default_gateway) ? $default_gateway : '–'); ?></td> |
|
514 | 514 | </tr> |
515 | 515 | <tr> |
516 | - <td data-export-label="PayPal IPN Verification"><?php _e( 'PayPal IPN Verification', 'give' ); ?>:</td> |
|
517 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether admins requires verification of IPN notifications with PayPal.', 'give' ) ); ?>"></span></td> |
|
518 | - <td><?php echo 'enabled' === give_get_option( 'paypal_verification' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
516 | + <td data-export-label="PayPal IPN Verification"><?php _e('PayPal IPN Verification', 'give'); ?>:</td> |
|
517 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether admins requires verification of IPN notifications with PayPal.', 'give')); ?>"></span></td> |
|
518 | + <td><?php echo 'enabled' === give_get_option('paypal_verification') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
519 | 519 | </tr> |
520 | 520 | <tr> |
521 | - <td data-export-label="PayPal IPN Notifications"><?php _e( 'PayPal IPN Notifications', 'give' ); ?>:</td> |
|
522 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Displays whether when last PayPal IPN is received with which donation or transaction.', 'give' ) ); ?>"></span></td> |
|
521 | + <td data-export-label="PayPal IPN Notifications"><?php _e('PayPal IPN Notifications', 'give'); ?>:</td> |
|
522 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Displays whether when last PayPal IPN is received with which donation or transaction.', 'give')); ?>"></span></td> |
|
523 | 523 | <td> |
524 | 524 | <?php |
525 | - $last_paypal_ipn_received = get_option( 'give_last_paypal_ipn_received' ); |
|
526 | - if( is_array( $last_paypal_ipn_received ) && count( $last_paypal_ipn_received ) > 0 ) { |
|
525 | + $last_paypal_ipn_received = get_option('give_last_paypal_ipn_received'); |
|
526 | + if (is_array($last_paypal_ipn_received) && count($last_paypal_ipn_received) > 0) { |
|
527 | 527 | $donation_id = $last_paypal_ipn_received['payment_id']; |
528 | - $ipn_timestamp = give_get_meta( $donation_id, 'give_last_paypal_ipn_received', true ); |
|
529 | - $transaction_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=' . $last_paypal_ipn_received['transaction_id']; |
|
530 | - $donation_url = site_url() . '/wp-admin/edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $donation_id; |
|
528 | + $ipn_timestamp = give_get_meta($donation_id, 'give_last_paypal_ipn_received', true); |
|
529 | + $transaction_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id='.$last_paypal_ipn_received['transaction_id']; |
|
530 | + $donation_url = site_url().'/wp-admin/edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$donation_id; |
|
531 | 531 | echo sprintf( |
532 | - __( 'IPN received for <a href="%s">#%s</a> ( <a href="%s" target="_blank">%s</a> ) on %s at %s. Status %s', 'give' ), |
|
532 | + __('IPN received for <a href="%s">#%s</a> ( <a href="%s" target="_blank">%s</a> ) on %s at %s. Status %s', 'give'), |
|
533 | 533 | $donation_url, |
534 | 534 | $donation_id, |
535 | 535 | $transaction_url, |
536 | 536 | $last_paypal_ipn_received['transaction_id'], |
537 | - date_i18n( 'm/d/Y', $ipn_timestamp ), |
|
538 | - date_i18n( 'H:i', $ipn_timestamp ), |
|
537 | + date_i18n('m/d/Y', $ipn_timestamp), |
|
538 | + date_i18n('H:i', $ipn_timestamp), |
|
539 | 539 | $last_paypal_ipn_received['auth_status'] |
540 | 540 | ); |
541 | 541 | } else { |
@@ -545,14 +545,14 @@ discard block |
||
545 | 545 | </td> |
546 | 546 | </tr> |
547 | 547 | <tr> |
548 | - <td data-export-label="Admin Email Notifications"><?php _e( 'Admin Email Notifications', 'give' ); ?>:</td> |
|
549 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether admins receive email notifications of transactions.', 'give' ) ); ?>"></span></td> |
|
550 | - <td><?php echo 'enabled' === give_get_option( 'admin_notices' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
548 | + <td data-export-label="Admin Email Notifications"><?php _e('Admin Email Notifications', 'give'); ?>:</td> |
|
549 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether admins receive email notifications of transactions.', 'give')); ?>"></span></td> |
|
550 | + <td><?php echo 'enabled' === give_get_option('admin_notices') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
551 | 551 | </tr> |
552 | 552 | <tr> |
553 | - <td data-export-label="Donor Email Access"><?php _e( 'Donor Email Access', 'give' ); ?>:</td> |
|
554 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether donors can access their donation history using only email.', 'give' ) ); ?>"></span></td> |
|
555 | - <td><?php echo 'enabled' === give_get_option( 'email_access' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
553 | + <td data-export-label="Donor Email Access"><?php _e('Donor Email Access', 'give'); ?>:</td> |
|
554 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether donors can access their donation history using only email.', 'give')); ?>"></span></td> |
|
555 | + <td><?php echo 'enabled' === give_get_option('email_access') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
556 | 556 | </tr> |
557 | 557 | </tbody> |
558 | 558 | </table> |
@@ -560,45 +560,45 @@ discard block |
||
560 | 560 | <table class="give-status-table widefat" cellspacing="0"> |
561 | 561 | <thead> |
562 | 562 | <tr> |
563 | - <th colspan="3" data-export-label="Session Configuration"><h2><?php _e( 'Session Configuration', 'give' ); ?></h2></th> |
|
563 | + <th colspan="3" data-export-label="Session Configuration"><h2><?php _e('Session Configuration', 'give'); ?></h2></th> |
|
564 | 564 | </tr> |
565 | 565 | </thead> |
566 | 566 | <tbody> |
567 | 567 | <tr> |
568 | - <td data-export-label="Give Use Sessions"><?php _e( 'Give Use Sessions', 'give' ); ?>:</td> |
|
569 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether PHP sessions are enforced, enabled, or disabled.', 'give' ) ); ?>"></span></td> |
|
570 | - <td><?php echo defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? __( 'Enforced', 'give' ) : ( Give()->session->use_php_sessions() ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ) ); ?></td> |
|
568 | + <td data-export-label="Give Use Sessions"><?php _e('Give Use Sessions', 'give'); ?>:</td> |
|
569 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether PHP sessions are enforced, enabled, or disabled.', 'give')); ?>"></span></td> |
|
570 | + <td><?php echo defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? __('Enforced', 'give') : (Give()->session->use_php_sessions() ? __('Enabled', 'give') : __('Disabled', 'give')); ?></td> |
|
571 | 571 | </tr> |
572 | 572 | <tr> |
573 | - <td data-export-label="Session"><?php _e( 'Session', 'give' ); ?>:</td> |
|
574 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether a PHP session is currently set.', 'give' ) ); ?>"></span></td> |
|
575 | - <td><?php echo isset( $_SESSION ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
573 | + <td data-export-label="Session"><?php _e('Session', 'give'); ?>:</td> |
|
574 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether a PHP session is currently set.', 'give')); ?>"></span></td> |
|
575 | + <td><?php echo isset($_SESSION) ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
576 | 576 | </tr> |
577 | - <?php if ( isset( $_SESSION ) ) { ?> |
|
577 | + <?php if (isset($_SESSION)) { ?> |
|
578 | 578 | <tr> |
579 | - <td data-export-label="Session Name"><?php _e( 'Session Name', 'give' ); ?>:</td> |
|
580 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The name of the current PHP session.', 'give' ) ); ?>"></span></td> |
|
581 | - <td><?php echo esc_html( ini_get( 'session.name' ) ); ?></td> |
|
579 | + <td data-export-label="Session Name"><?php _e('Session Name', 'give'); ?>:</td> |
|
580 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The name of the current PHP session.', 'give')); ?>"></span></td> |
|
581 | + <td><?php echo esc_html(ini_get('session.name')); ?></td> |
|
582 | 582 | </tr> |
583 | 583 | <tr> |
584 | - <td data-export-label="Cookie Path"><?php _e( 'Cookie Path', 'give' ); ?>:</td> |
|
585 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The cookie path of the current PHP session.', 'give' ) ); ?>"></span></td> |
|
586 | - <td><?php echo esc_html( ini_get( 'session.cookie_path' ) ); ?></td> |
|
584 | + <td data-export-label="Cookie Path"><?php _e('Cookie Path', 'give'); ?>:</td> |
|
585 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The cookie path of the current PHP session.', 'give')); ?>"></span></td> |
|
586 | + <td><?php echo esc_html(ini_get('session.cookie_path')); ?></td> |
|
587 | 587 | </tr> |
588 | 588 | <tr> |
589 | - <td data-export-label="Save Path"><?php _e( 'Save Path', 'give' ); ?>:</td> |
|
590 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The save path of the current PHP session.', 'give' ) ); ?>"></span></td> |
|
591 | - <td><?php echo esc_html( ini_get( 'session.save_path' ) ); ?></td> |
|
589 | + <td data-export-label="Save Path"><?php _e('Save Path', 'give'); ?>:</td> |
|
590 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The save path of the current PHP session.', 'give')); ?>"></span></td> |
|
591 | + <td><?php echo esc_html(ini_get('session.save_path')); ?></td> |
|
592 | 592 | </tr> |
593 | 593 | <tr> |
594 | - <td data-export-label="Use Cookies"><?php _e( 'Use Cookies', 'give' ); ?>:</td> |
|
595 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether the current PHP session is set to use cookies.', 'give' ) ); ?>"></span></td> |
|
596 | - <td><?php echo ini_get( 'session.use_cookies' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
594 | + <td data-export-label="Use Cookies"><?php _e('Use Cookies', 'give'); ?>:</td> |
|
595 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether the current PHP session is set to use cookies.', 'give')); ?>"></span></td> |
|
596 | + <td><?php echo ini_get('session.use_cookies') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
597 | 597 | </tr> |
598 | 598 | <tr> |
599 | - <td data-export-label="Use Only Cookies"><?php _e( 'Use Only Cookies', 'give' ); ?>:</td> |
|
600 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether the current PHP session is set to use only cookies.', 'give' ) ); ?>"></span></td> |
|
601 | - <td><?php echo ini_get( 'session.use_only_cookies' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
599 | + <td data-export-label="Use Only Cookies"><?php _e('Use Only Cookies', 'give'); ?>:</td> |
|
600 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether the current PHP session is set to use only cookies.', 'give')); ?>"></span></td> |
|
601 | + <td><?php echo ini_get('session.use_only_cookies') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
602 | 602 | </tr> |
603 | 603 | <?php } ?> |
604 | 604 | </tbody> |
@@ -607,13 +607,13 @@ discard block |
||
607 | 607 | <table class="give-status-table widefat" cellspacing="0"> |
608 | 608 | <thead> |
609 | 609 | <tr> |
610 | - <th colspan="3" data-export-label="Active Give Add-ons"><h2><?php _e( 'Active Give Add-ons', 'give' ); ?></h2></th> |
|
610 | + <th colspan="3" data-export-label="Active Give Add-ons"><h2><?php _e('Active Give Add-ons', 'give'); ?></h2></th> |
|
611 | 611 | </tr> |
612 | 612 | </thead> |
613 | 613 | <tbody> |
614 | 614 | <?php |
615 | - foreach ( $plugins as $plugin_data ) { |
|
616 | - if ( 'active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type'] ) { |
|
615 | + foreach ($plugins as $plugin_data) { |
|
616 | + if ('active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type']) { |
|
617 | 617 | continue; |
618 | 618 | } |
619 | 619 | |
@@ -621,30 +621,30 @@ discard block |
||
621 | 621 | $author_name = $plugin_data['Author']; |
622 | 622 | |
623 | 623 | // Link the plugin name to the plugin URL if available. |
624 | - if ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
625 | - $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
624 | + if ( ! empty($plugin_data['PluginURI'])) { |
|
625 | + $plugin_name = '<a href="'.esc_url($plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
626 | 626 | } |
627 | 627 | |
628 | 628 | // Link the author name to the author URL if available. |
629 | - if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
|
630 | - $author_name = '<a href="' . esc_url( $plugin_data['AuthorURI'] ) . '" title="' . esc_attr__( 'Visit author homepage' , 'give' ) . '">' . $author_name . '</a>'; |
|
629 | + if ( ! empty($plugin_data['AuthorURI'])) { |
|
630 | + $author_name = '<a href="'.esc_url($plugin_data['AuthorURI']).'" title="'.esc_attr__('Visit author homepage', 'give').'">'.$author_name.'</a>'; |
|
631 | 631 | } |
632 | 632 | ?> |
633 | 633 | <tr> |
634 | - <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td> |
|
634 | + <td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td> |
|
635 | 635 | <td class="help"> </td> |
636 | 636 | <td> |
637 | 637 | <?php |
638 | - if ( true === $plugin_data['License'] ) { |
|
639 | - echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> ' . __( 'Licensed', 'give' ); |
|
638 | + if (true === $plugin_data['License']) { |
|
639 | + echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> '.__('Licensed', 'give'); |
|
640 | 640 | } else { |
641 | - echo '<mark class="error"><span class="dashicons dashicons-no-alt"></span></mark> ' . __( 'Unlicensed', 'give' ); |
|
641 | + echo '<mark class="error"><span class="dashicons dashicons-no-alt"></span></mark> '.__('Unlicensed', 'give'); |
|
642 | 642 | } |
643 | 643 | |
644 | 644 | echo ' – ' |
645 | - . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) |
|
645 | + . sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))) |
|
646 | 646 | . ' – ' |
647 | - . esc_html( $plugin_data['Version'] ); |
|
647 | + . esc_html($plugin_data['Version']); |
|
648 | 648 | ?> |
649 | 649 | </td> |
650 | 650 | </tr> |
@@ -657,18 +657,18 @@ discard block |
||
657 | 657 | <table class="give-status-table widefat" cellspacing="0"> |
658 | 658 | <thead> |
659 | 659 | <tr> |
660 | - <th colspan="3" data-export-label="Other Active Plugins"><h2><?php _e( 'Other Active Plugins', 'give' ); ?></h2></th> |
|
660 | + <th colspan="3" data-export-label="Other Active Plugins"><h2><?php _e('Other Active Plugins', 'give'); ?></h2></th> |
|
661 | 661 | </tr> |
662 | 662 | </thead> |
663 | 663 | <tbody> |
664 | 664 | <?php |
665 | - foreach ( $plugins as $plugin_data ) { |
|
666 | - if ( 'active' != $plugin_data['Status'] || 'other' != $plugin_data['Type'] ) { |
|
665 | + foreach ($plugins as $plugin_data) { |
|
666 | + if ('active' != $plugin_data['Status'] || 'other' != $plugin_data['Type']) { |
|
667 | 667 | continue; |
668 | 668 | } |
669 | 669 | |
670 | 670 | // Do not show Give core plugin. |
671 | - if ( 'Give - Donation Plugin' === $plugin_data['Name'] ) { |
|
671 | + if ('Give - Donation Plugin' === $plugin_data['Name']) { |
|
672 | 672 | continue; |
673 | 673 | } |
674 | 674 | |
@@ -676,19 +676,19 @@ discard block |
||
676 | 676 | $author_name = $plugin_data['Author']; |
677 | 677 | |
678 | 678 | // Link the plugin name to the plugin URL if available. |
679 | - if ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
680 | - $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
679 | + if ( ! empty($plugin_data['PluginURI'])) { |
|
680 | + $plugin_name = '<a href="'.esc_url($plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
681 | 681 | } |
682 | 682 | |
683 | 683 | // Link the author name to the author URL if available. |
684 | - if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
|
685 | - $author_name = '<a href="' . esc_url( $plugin_data['AuthorURI'] ) . '" title="' . esc_attr__( 'Visit author homepage' , 'give' ) . '">' . $author_name . '</a>'; |
|
684 | + if ( ! empty($plugin_data['AuthorURI'])) { |
|
685 | + $author_name = '<a href="'.esc_url($plugin_data['AuthorURI']).'" title="'.esc_attr__('Visit author homepage', 'give').'">'.$author_name.'</a>'; |
|
686 | 686 | } |
687 | 687 | ?> |
688 | 688 | <tr> |
689 | - <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td> |
|
689 | + <td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td> |
|
690 | 690 | <td class="help"> </td> |
691 | - <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) . ' – ' . esc_html( $plugin_data['Version'] ); ?></td> |
|
691 | + <td><?php echo sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))).' – '.esc_html($plugin_data['Version']); ?></td> |
|
692 | 692 | </tr> |
693 | 693 | <?php |
694 | 694 | } |
@@ -699,13 +699,13 @@ discard block |
||
699 | 699 | <table class="give-status-table widefat" cellspacing="0"> |
700 | 700 | <thead> |
701 | 701 | <tr> |
702 | - <th colspan="3" data-export-label="Inactive Plugins"><h2><?php _e( 'Inactive Plugins', 'give' ); ?></h2></th> |
|
702 | + <th colspan="3" data-export-label="Inactive Plugins"><h2><?php _e('Inactive Plugins', 'give'); ?></h2></th> |
|
703 | 703 | </tr> |
704 | 704 | </thead> |
705 | 705 | <tbody> |
706 | 706 | <?php |
707 | - foreach ( $plugins as $plugin_data ) { |
|
708 | - if ( 'inactive' != $plugin_data['Status'] ) { |
|
707 | + foreach ($plugins as $plugin_data) { |
|
708 | + if ('inactive' != $plugin_data['Status']) { |
|
709 | 709 | continue; |
710 | 710 | } |
711 | 711 | |
@@ -713,19 +713,19 @@ discard block |
||
713 | 713 | $author_name = $plugin_data['Author']; |
714 | 714 | |
715 | 715 | // Link the plugin name to the plugin URL if available. |
716 | - if ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
717 | - $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
716 | + if ( ! empty($plugin_data['PluginURI'])) { |
|
717 | + $plugin_name = '<a href="'.esc_url($plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
718 | 718 | } |
719 | 719 | |
720 | 720 | // Link the author name to the author URL if available. |
721 | - if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
|
722 | - $author_name = '<a href="' . esc_url( $plugin_data['AuthorURI'] ) . '" title="' . esc_attr__( 'Visit author homepage' , 'give' ) . '">' . $author_name . '</a>'; |
|
721 | + if ( ! empty($plugin_data['AuthorURI'])) { |
|
722 | + $author_name = '<a href="'.esc_url($plugin_data['AuthorURI']).'" title="'.esc_attr__('Visit author homepage', 'give').'">'.$author_name.'</a>'; |
|
723 | 723 | } |
724 | 724 | ?> |
725 | 725 | <tr> |
726 | - <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td> |
|
726 | + <td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td> |
|
727 | 727 | <td class="help"> </td> |
728 | - <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) . ' – ' . esc_html( $plugin_data['Version'] ); ?></td> |
|
728 | + <td><?php echo sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))).' – '.esc_html($plugin_data['Version']); ?></td> |
|
729 | 729 | </tr> |
730 | 730 | <?php |
731 | 731 | } |
@@ -735,37 +735,37 @@ discard block |
||
735 | 735 | |
736 | 736 | <?php |
737 | 737 | $active_mu_plugins = (array) get_mu_plugins(); |
738 | -if ( ! empty( $active_mu_plugins ) ) { |
|
738 | +if ( ! empty($active_mu_plugins)) { |
|
739 | 739 | ?> |
740 | 740 | <table class="give-status-table widefat" cellspacing="0"> |
741 | 741 | <thead> |
742 | 742 | <tr> |
743 | - <th colspan="3" data-export-label="Active MU Plugins"><h2><?php _e( 'Active MU Plugins', 'give' ); ?></h2></th> |
|
743 | + <th colspan="3" data-export-label="Active MU Plugins"><h2><?php _e('Active MU Plugins', 'give'); ?></h2></th> |
|
744 | 744 | </tr> |
745 | 745 | </thead> |
746 | 746 | <tbody> |
747 | 747 | <?php |
748 | 748 | |
749 | - foreach ( $active_mu_plugins as $mu_plugin_data ) { |
|
750 | - if ( ! empty( $mu_plugin_data['Name'] ) ) { |
|
749 | + foreach ($active_mu_plugins as $mu_plugin_data) { |
|
750 | + if ( ! empty($mu_plugin_data['Name'])) { |
|
751 | 751 | // Link the plugin name to the plugin URL if available. |
752 | - $plugin_name = esc_html( $mu_plugin_data['Name'] ); |
|
752 | + $plugin_name = esc_html($mu_plugin_data['Name']); |
|
753 | 753 | |
754 | - if ( ! empty( $mu_plugin_data['PluginURI'] ) ) { |
|
755 | - $plugin_name = '<a href="' . esc_url( $mu_plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
754 | + if ( ! empty($mu_plugin_data['PluginURI'])) { |
|
755 | + $plugin_name = '<a href="'.esc_url($mu_plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
756 | 756 | } |
757 | 757 | |
758 | 758 | // Link the author name to the author URL if available. |
759 | - $author_name = esc_html( $mu_plugin_data['Author'] ); |
|
759 | + $author_name = esc_html($mu_plugin_data['Author']); |
|
760 | 760 | |
761 | - if ( ! empty( $mu_plugin_data['AuthorURI'] ) ) { |
|
762 | - $author_name = '<a href="' . esc_url( $mu_plugin_data['AuthorURI'] ) . '">' . $author_name . '</a>'; |
|
761 | + if ( ! empty($mu_plugin_data['AuthorURI'])) { |
|
762 | + $author_name = '<a href="'.esc_url($mu_plugin_data['AuthorURI']).'">'.$author_name.'</a>'; |
|
763 | 763 | } |
764 | 764 | ?> |
765 | 765 | <tr> |
766 | 766 | <td><?php echo $plugin_name; ?></td> |
767 | 767 | <td class="help"> </td> |
768 | - <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), $author_name ) . ' – ' . esc_html( $mu_plugin_data['Version'] ); ?></td> |
|
768 | + <td><?php echo sprintf(_x('by %s', 'by author', 'give'), $author_name).' – '.esc_html($mu_plugin_data['Version']); ?></td> |
|
769 | 769 | </tr> |
770 | 770 | <?php |
771 | 771 | } |
@@ -778,53 +778,53 @@ discard block |
||
778 | 778 | <table class="give-status-table widefat" cellspacing="0"> |
779 | 779 | <thead> |
780 | 780 | <tr> |
781 | - <th colspan="3" data-export-label="Theme"><h2><?php _e( 'Theme', 'give' ); ?></h2></th> |
|
781 | + <th colspan="3" data-export-label="Theme"><h2><?php _e('Theme', 'give'); ?></h2></th> |
|
782 | 782 | </tr> |
783 | 783 | </thead> |
784 | 784 | <?php |
785 | - include_once( ABSPATH . 'wp-admin/includes/theme-install.php' ); |
|
785 | + include_once(ABSPATH.'wp-admin/includes/theme-install.php'); |
|
786 | 786 | $active_theme = wp_get_theme(); |
787 | 787 | ?> |
788 | 788 | <tbody> |
789 | 789 | <tr> |
790 | - <td data-export-label="Name"><?php _e( 'Name', 'give' ); ?>:</td> |
|
791 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The name of the current active theme.', 'give' ) ); ?>"></span></td> |
|
792 | - <td><?php echo esc_html( $active_theme->Name ); ?></td> |
|
790 | + <td data-export-label="Name"><?php _e('Name', 'give'); ?>:</td> |
|
791 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The name of the current active theme.', 'give')); ?>"></span></td> |
|
792 | + <td><?php echo esc_html($active_theme->Name); ?></td> |
|
793 | 793 | </tr> |
794 | 794 | <tr> |
795 | - <td data-export-label="Version"><?php _e( 'Version', 'give' ); ?>:</td> |
|
796 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The installed version of the current active theme.', 'give' ) ); ?>"></span></td> |
|
797 | - <td><?php echo esc_html( $active_theme->Version ); ?></td> |
|
795 | + <td data-export-label="Version"><?php _e('Version', 'give'); ?>:</td> |
|
796 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The installed version of the current active theme.', 'give')); ?>"></span></td> |
|
797 | + <td><?php echo esc_html($active_theme->Version); ?></td> |
|
798 | 798 | </tr> |
799 | 799 | <tr> |
800 | - <td data-export-label="Author URL"><?php _e( 'Author URL', 'give' ); ?>:</td> |
|
801 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The theme developer\'s URL.', 'give' ) ); ?>"></span></td> |
|
800 | + <td data-export-label="Author URL"><?php _e('Author URL', 'give'); ?>:</td> |
|
801 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The theme developer\'s URL.', 'give')); ?>"></span></td> |
|
802 | 802 | <td><?php echo $active_theme->{'Author URI'}; ?></td> |
803 | 803 | </tr> |
804 | 804 | <tr> |
805 | - <td data-export-label="Child Theme"><?php _e( 'Child Theme', 'give' ); ?>:</td> |
|
806 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether the current theme is a child theme.', 'give' ) ); ?>"></span></td> |
|
805 | + <td data-export-label="Child Theme"><?php _e('Child Theme', 'give'); ?>:</td> |
|
806 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether the current theme is a child theme.', 'give')); ?>"></span></td> |
|
807 | 807 | <td><?php |
808 | - echo is_child_theme() ? __( 'Yes', 'give' ) : __( 'No', 'give' ) . ' – ' . sprintf( __( 'If you\'re modifying Give on a parent theme you didn\'t build personally, then we recommend using a child theme. See: <a href="%s" target="_blank">How to Create a Child Theme</a>', 'give' ), 'https://codex.wordpress.org/Child_Themes' ); |
|
808 | + echo is_child_theme() ? __('Yes', 'give') : __('No', 'give').' – '.sprintf(__('If you\'re modifying Give on a parent theme you didn\'t build personally, then we recommend using a child theme. See: <a href="%s" target="_blank">How to Create a Child Theme</a>', 'give'), 'https://codex.wordpress.org/Child_Themes'); |
|
809 | 809 | ?></td> |
810 | 810 | </tr> |
811 | 811 | <?php |
812 | - if( is_child_theme() ) { |
|
813 | - $parent_theme = wp_get_theme( $active_theme->Template ); |
|
812 | + if (is_child_theme()) { |
|
813 | + $parent_theme = wp_get_theme($active_theme->Template); |
|
814 | 814 | ?> |
815 | 815 | <tr> |
816 | - <td data-export-label="Parent Theme Name"><?php _e( 'Parent Theme Name', 'give' ); ?>:</td> |
|
817 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The name of the parent theme.', 'give' ) ); ?>"></span></td> |
|
818 | - <td><?php echo esc_html( $parent_theme->Name ); ?></td> |
|
816 | + <td data-export-label="Parent Theme Name"><?php _e('Parent Theme Name', 'give'); ?>:</td> |
|
817 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The name of the parent theme.', 'give')); ?>"></span></td> |
|
818 | + <td><?php echo esc_html($parent_theme->Name); ?></td> |
|
819 | 819 | </tr> |
820 | 820 | <tr> |
821 | - <td data-export-label="Parent Theme Version"><?php _e( 'Parent Theme Version', 'give' ); ?>:</td> |
|
822 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The installed version of the parent theme.', 'give' ) ); ?>"></span></td> |
|
823 | - <td><?php echo esc_html( $parent_theme->Version ); ?></td> |
|
821 | + <td data-export-label="Parent Theme Version"><?php _e('Parent Theme Version', 'give'); ?>:</td> |
|
822 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The installed version of the parent theme.', 'give')); ?>"></span></td> |
|
823 | + <td><?php echo esc_html($parent_theme->Version); ?></td> |
|
824 | 824 | </tr> |
825 | 825 | <tr> |
826 | - <td data-export-label="Parent Theme Author URL"><?php _e( 'Parent Theme Author URL', 'give' ); ?>:</td> |
|
827 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The parent theme developers URL.', 'give' ) ); ?>"></span></td> |
|
826 | + <td data-export-label="Parent Theme Author URL"><?php _e('Parent Theme Author URL', 'give'); ?>:</td> |
|
827 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The parent theme developers URL.', 'give')); ?>"></span></td> |
|
828 | 828 | <td><?php echo $parent_theme->{'Author URI'}; ?></td> |
829 | 829 | </tr> |
830 | 830 | <?php } ?> |
@@ -9,11 +9,11 @@ discard block |
||
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_Logs' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Logs')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Logs. |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'logs'; |
46 | - $this->label = __( 'Logs', 'give' ); |
|
46 | + $this->label = __('Logs', 'give'); |
|
47 | 47 | |
48 | 48 | $this->default_tab = 'sales'; |
49 | 49 | |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return array |
62 | 62 | */ |
63 | - public function add_settings_page( $pages ) { |
|
64 | - $pages[ $this->id ] = $this->label; |
|
63 | + public function add_settings_page($pages) { |
|
64 | + $pages[$this->id] = $this->label; |
|
65 | 65 | |
66 | 66 | return $pages; |
67 | 67 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $GLOBALS['give_hide_save_button'] = true; |
78 | 78 | |
79 | 79 | // Get settings. |
80 | - $settings = apply_filters( 'give_settings_logs', array( |
|
80 | + $settings = apply_filters('give_settings_logs', array( |
|
81 | 81 | array( |
82 | 82 | 'id' => 'give_tools_logs', |
83 | 83 | 'type' => 'title', |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ), |
86 | 86 | array( |
87 | 87 | 'id' => 'api', |
88 | - 'name' => __( 'Log', 'give' ), |
|
88 | + 'name' => __('Log', 'give'), |
|
89 | 89 | 'type' => 'logs', |
90 | 90 | |
91 | 91 | ), |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | 'type' => 'sectionend', |
95 | 95 | 'table_html' => false, |
96 | 96 | ), |
97 | - ) ); |
|
97 | + )); |
|
98 | 98 | |
99 | 99 | /** |
100 | 100 | * Filter the settings. |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @param array $settings |
105 | 105 | */ |
106 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
106 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
107 | 107 | |
108 | 108 | // Output. |
109 | 109 | return $settings; |
@@ -117,14 +117,14 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function get_sections() { |
119 | 119 | $sections = array( |
120 | - 'sales' => __( 'Donations', 'give' ), |
|
121 | - 'gateway_errors' => __( 'Payment Errors', 'give' ), |
|
122 | - 'api_requests' => __( 'API Requests', 'give' ), |
|
120 | + 'sales' => __('Donations', 'give'), |
|
121 | + 'gateway_errors' => __('Payment Errors', 'give'), |
|
122 | + 'api_requests' => __('API Requests', 'give'), |
|
123 | 123 | ); |
124 | 124 | |
125 | - $sections = apply_filters( 'give_log_views', $sections ); |
|
125 | + $sections = apply_filters('give_log_views', $sections); |
|
126 | 126 | |
127 | - return apply_filters( 'give_get_sections_' . $this->id, $sections ); |
|
127 | + return apply_filters('give_get_sections_'.$this->id, $sections); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | public function output() { |
137 | 137 | $settings = $this->get_settings(); |
138 | 138 | |
139 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
139 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 |
@@ -9,11 +9,11 @@ discard block |
||
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_System_Info' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_System_Info')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_System_Info. |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'system-info'; |
46 | - $this->label = esc_html__( 'System Info', 'give' ); |
|
46 | + $this->label = esc_html__('System Info', 'give'); |
|
47 | 47 | |
48 | - add_filter( 'give-tools_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
49 | - add_action( "give-tools_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
48 | + add_filter('give-tools_tabs_array', array($this, 'add_settings_page'), 20); |
|
49 | + add_action("give-tools_settings_{$this->id}_page", array($this, 'output')); |
|
50 | 50 | |
51 | 51 | // Do not use main form for this tab. |
52 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
53 | - add_action( "give-tools_open_form", '__return_empty_string' ); |
|
54 | - add_action( "give-tools_close_form", '__return_empty_string' ); |
|
52 | + if (give_get_current_setting_tab() === $this->id) { |
|
53 | + add_action("give-tools_open_form", '__return_empty_string'); |
|
54 | + add_action("give-tools_close_form", '__return_empty_string'); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return array |
66 | 66 | */ |
67 | - public function add_settings_page( $pages ) { |
|
68 | - $pages[ $this->id ] = $this->label; |
|
67 | + public function add_settings_page($pages) { |
|
68 | + $pages[$this->id] = $this->label; |
|
69 | 69 | |
70 | 70 | return $pages; |
71 | 71 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function output() { |
80 | 80 | $GLOBALS['give_hide_save_button'] = true; |
81 | - include_once( 'views/html-admin-page-system-info.php' ); |
|
81 | + include_once('views/html-admin-page-system-info.php'); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 |
@@ -10,7 +10,7 @@ discard block |
||
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 | |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | */ |
25 | 25 | function give_donors_page() { |
26 | 26 | $default_views = give_donor_views(); |
27 | - $requested_view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : 'donors'; |
|
28 | - if ( array_key_exists( $requested_view, $default_views ) && function_exists( $default_views[ $requested_view ] ) ) { |
|
29 | - give_render_donor_view( $requested_view, $default_views ); |
|
27 | + $requested_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : 'donors'; |
|
28 | + if (array_key_exists($requested_view, $default_views) && function_exists($default_views[$requested_view])) { |
|
29 | + give_render_donor_view($requested_view, $default_views); |
|
30 | 30 | } else { |
31 | 31 | give_donors_list(); |
32 | 32 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $views = array(); |
44 | 44 | |
45 | - return apply_filters( 'give_donor_views', $views ); |
|
45 | + return apply_filters('give_donor_views', $views); |
|
46 | 46 | |
47 | 47 | } |
48 | 48 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $tabs = array(); |
58 | 58 | |
59 | - return apply_filters( 'give_donor_tabs', $tabs ); |
|
59 | + return apply_filters('give_donor_tabs', $tabs); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return void |
68 | 68 | */ |
69 | 69 | function give_donors_list() { |
70 | - include dirname( __FILE__ ) . '/class-donor-table.php'; |
|
70 | + include dirname(__FILE__).'/class-donor-table.php'; |
|
71 | 71 | |
72 | 72 | $donors_table = new Give_Donor_List_Table(); |
73 | 73 | $donors_table->prepare_items(); |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @since 1.0 |
82 | 82 | */ |
83 | - do_action( 'give_donors_table_top' ); |
|
83 | + do_action('give_donors_table_top'); |
|
84 | 84 | ?> |
85 | - <form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>"> |
|
85 | + <form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>"> |
|
86 | 86 | <?php |
87 | - $donors_table->search_box( esc_html__( 'Search Donors', 'give' ), 'give-donors' ); |
|
87 | + $donors_table->search_box(esc_html__('Search Donors', 'give'), 'give-donors'); |
|
88 | 88 | $donors_table->display(); |
89 | 89 | ?> |
90 | 90 | <input type="hidden" name="post_type" value="give_forms" /> |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @since 1.0 |
99 | 99 | */ |
100 | - do_action( 'give_donors_table_bottom' ); |
|
100 | + do_action('give_donors_table_bottom'); |
|
101 | 101 | ?> |
102 | 102 | </div> |
103 | 103 | <?php |
@@ -113,27 +113,27 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return void |
115 | 115 | */ |
116 | -function give_render_donor_view( $view, $callbacks ) { |
|
116 | +function give_render_donor_view($view, $callbacks) { |
|
117 | 117 | |
118 | 118 | $render = true; |
119 | 119 | |
120 | - $donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' ); |
|
120 | + $donor_view_role = apply_filters('give_view_donors_role', 'view_give_reports'); |
|
121 | 121 | |
122 | - if ( ! current_user_can( $donor_view_role ) ) { |
|
123 | - give_set_error( 'give-no-access', __( 'You are not permitted to view this data.', 'give' ) ); |
|
122 | + if ( ! current_user_can($donor_view_role)) { |
|
123 | + give_set_error('give-no-access', __('You are not permitted to view this data.', 'give')); |
|
124 | 124 | $render = false; |
125 | 125 | } |
126 | 126 | |
127 | - if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
128 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
127 | + if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
128 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
129 | 129 | $render = false; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $donor_id = (int) $_GET['id']; |
133 | - $donor = new Give_Donor( $donor_id ); |
|
133 | + $donor = new Give_Donor($donor_id); |
|
134 | 134 | |
135 | - if ( empty( $donor->id ) ) { |
|
136 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
135 | + if (empty($donor->id)) { |
|
136 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
137 | 137 | $render = false; |
138 | 138 | } |
139 | 139 | |
@@ -142,34 +142,34 @@ discard block |
||
142 | 142 | |
143 | 143 | <div class='wrap'> |
144 | 144 | |
145 | - <?php if ( give_get_errors() ) : ?> |
|
145 | + <?php if (give_get_errors()) : ?> |
|
146 | 146 | <div class="error settings-error"> |
147 | - <?php Give()->notices->render_frontend_notices( 0 ); ?> |
|
147 | + <?php Give()->notices->render_frontend_notices(0); ?> |
|
148 | 148 | </div> |
149 | 149 | <?php endif; ?> |
150 | 150 | |
151 | - <h1 class="screen-reader-text"><?php esc_html_e( 'Donor', 'give' ); ?></h1> |
|
151 | + <h1 class="screen-reader-text"><?php esc_html_e('Donor', 'give'); ?></h1> |
|
152 | 152 | |
153 | - <?php if ( $donor && $render ) : ?> |
|
153 | + <?php if ($donor && $render) : ?> |
|
154 | 154 | |
155 | 155 | <h2 class="nav-tab-wrapper"> |
156 | 156 | <?php |
157 | - foreach ( $donor_tabs as $key => $tab ) : |
|
157 | + foreach ($donor_tabs as $key => $tab) : |
|
158 | 158 | $active = $key === $view ? true : false; |
159 | 159 | $class = $active ? 'nav-tab nav-tab-active' : 'nav-tab'; |
160 | 160 | printf( |
161 | - '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>' . "\n", |
|
162 | - esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $donor->id ) ), |
|
163 | - esc_attr( $class ), |
|
164 | - sanitize_html_class( $tab['dashicon'] ), |
|
165 | - esc_html( $tab['title'] ) |
|
161 | + '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>'."\n", |
|
162 | + esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$donor->id)), |
|
163 | + esc_attr($class), |
|
164 | + sanitize_html_class($tab['dashicon']), |
|
165 | + esc_html($tab['title']) |
|
166 | 166 | ); |
167 | 167 | endforeach; |
168 | 168 | ?> |
169 | 169 | </h2> |
170 | 170 | |
171 | 171 | <div id="give-donor-card-wrapper"> |
172 | - <?php $callbacks[ $view ]( $donor ) ?> |
|
172 | + <?php $callbacks[$view]($donor) ?> |
|
173 | 173 | </div> |
174 | 174 | |
175 | 175 | <?php endif; ?> |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | * |
190 | 190 | * @return void |
191 | 191 | */ |
192 | -function give_donor_view( $donor ) { |
|
192 | +function give_donor_view($donor) { |
|
193 | 193 | |
194 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
194 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Fires in donor profile screen, above the donor card. |
@@ -200,32 +200,32 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @param object $donor The donor object being displayed. |
202 | 202 | */ |
203 | - do_action( 'give_donor_card_top', $donor ); |
|
203 | + do_action('give_donor_card_top', $donor); |
|
204 | 204 | ?> |
205 | 205 | |
206 | 206 | <div id="donor-summary" class="info-wrapper donor-section postbox"> |
207 | 207 | |
208 | - <form id="edit-donor-info" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>"> |
|
208 | + <form id="edit-donor-info" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>"> |
|
209 | 209 | |
210 | 210 | <div class="donor-info"> |
211 | 211 | |
212 | 212 | <div class="donor-bio-header clearfix"> |
213 | 213 | |
214 | 214 | <div class="avatar-wrap left" id="donor-avatar"> |
215 | - <?php echo get_avatar( $donor->email ); ?> |
|
215 | + <?php echo get_avatar($donor->email); ?> |
|
216 | 216 | </div> |
217 | 217 | |
218 | 218 | <div id="donor-name-wrap" class="left"> |
219 | 219 | <span class="donor-id">#<?php echo $donor->id; ?></span> |
220 | - <span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr( $donor->name ); ?>" placeholder="<?php esc_attr_e( 'Donor Name', 'give' ); ?>" /></span> |
|
220 | + <span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr($donor->name); ?>" placeholder="<?php esc_attr_e('Donor Name', 'give'); ?>" /></span> |
|
221 | 221 | <span class="donor-name info-item editable"><span data-key="name"><?php echo $donor->name; ?></span></span> |
222 | 222 | </div> |
223 | 223 | <p class="donor-since info-item"> |
224 | - <?php esc_html_e( 'Donor since', 'give' ); ?> |
|
225 | - <?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?> |
|
224 | + <?php esc_html_e('Donor since', 'give'); ?> |
|
225 | + <?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?> |
|
226 | 226 | </p> |
227 | - <?php if ( current_user_can( $donor_edit_role ) ) : ?> |
|
228 | - <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php esc_html_e( 'Edit Donor', 'give' ); ?></a> |
|
227 | + <?php if (current_user_can($donor_edit_role)) : ?> |
|
228 | + <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php esc_html_e('Edit Donor', 'give'); ?></a> |
|
229 | 229 | <?php endif; ?> |
230 | 230 | </div> |
231 | 231 | <!-- /donor-bio-header --> |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | <table class="widefat"> |
236 | 236 | <tbody> |
237 | 237 | <tr class="alternate"> |
238 | - <th scope="col"><label for="tablecell"><?php esc_html_e( 'User:', 'give' ); ?></label></th> |
|
238 | + <th scope="col"><label for="tablecell"><?php esc_html_e('User:', 'give'); ?></label></th> |
|
239 | 239 | <td> |
240 | 240 | <span class="donor-user-id info-item edit-item"> |
241 | 241 | <?php |
@@ -252,37 +252,37 @@ discard block |
||
252 | 252 | 'data' => $data_atts, |
253 | 253 | ); |
254 | 254 | |
255 | - if ( ! empty( $user_id ) ) { |
|
256 | - $userdata = get_userdata( $user_id ); |
|
255 | + if ( ! empty($user_id)) { |
|
256 | + $userdata = get_userdata($user_id); |
|
257 | 257 | $user_args['selected'] = $user_id; |
258 | 258 | } |
259 | 259 | |
260 | - echo Give()->html->ajax_user_search( $user_args ); |
|
260 | + echo Give()->html->ajax_user_search($user_args); |
|
261 | 261 | ?> |
262 | 262 | </span> |
263 | 263 | |
264 | 264 | <span class="donor-user-id info-item editable"> |
265 | - <?php if ( ! empty( $userdata ) ) { ?> |
|
266 | - <span data-key="user_id">#<?php echo $donor->user_id . ' - ' . $userdata->display_name; ?></span> |
|
265 | + <?php if ( ! empty($userdata)) { ?> |
|
266 | + <span data-key="user_id">#<?php echo $donor->user_id.' - '.$userdata->display_name; ?></span> |
|
267 | 267 | <?php } else { ?> |
268 | - <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span> |
|
268 | + <span data-key="user_id"><?php esc_html_e('None', 'give'); ?></span> |
|
269 | 269 | <?php } ?> |
270 | - <?php if ( current_user_can( $donor_edit_role ) && intval( $donor->user_id ) > 0 ) { ?> |
|
271 | - <span class="disconnect-user"> - <a id="disconnect-donor" href="#disconnect" aria-label="<?php esc_attr_e( 'Disconnects the current user ID from this donor record.', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span> |
|
270 | + <?php if (current_user_can($donor_edit_role) && intval($donor->user_id) > 0) { ?> |
|
271 | + <span class="disconnect-user"> - <a id="disconnect-donor" href="#disconnect" aria-label="<?php esc_attr_e('Disconnects the current user ID from this donor record.', 'give'); ?>"><?php esc_html_e('Disconnect User', 'give'); ?></a></span> |
|
272 | 272 | <?php } ?> |
273 | 273 | </span> |
274 | 274 | </td> |
275 | 275 | </tr> |
276 | - <?php if ( isset( $donor->user_id ) && $donor->user_id > 0 ) : ?> |
|
276 | + <?php if (isset($donor->user_id) && $donor->user_id > 0) : ?> |
|
277 | 277 | |
278 | 278 | <tr> |
279 | - <th scope="col"><?php esc_html_e( 'Address:', 'give' ); ?></th> |
|
279 | + <th scope="col"><?php esc_html_e('Address:', 'give'); ?></th> |
|
280 | 280 | <td class="row-title"> |
281 | 281 | |
282 | 282 | <div class="donor-address-wrapper"> |
283 | 283 | |
284 | 284 | <?php |
285 | - $address = get_user_meta( $donor->user_id, '_give_user_address', true ); |
|
285 | + $address = get_user_meta($donor->user_id, '_give_user_address', true); |
|
286 | 286 | $defaults = array( |
287 | 287 | 'line1' => '', |
288 | 288 | 'line2' => '', |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | 'zip' => '', |
293 | 293 | ); |
294 | 294 | |
295 | - $address = wp_parse_args( $address, $defaults ); |
|
295 | + $address = wp_parse_args($address, $defaults); |
|
296 | 296 | ?> |
297 | 297 | |
298 | - <?php if ( ! empty( $address ) ) { ?> |
|
298 | + <?php if ( ! empty($address)) { ?> |
|
299 | 299 | <span class="donor-address info-item editable"> |
300 | 300 | <span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span> |
301 | 301 | <span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span> |
@@ -306,43 +306,43 @@ discard block |
||
306 | 306 | </span> |
307 | 307 | <?php } ?> |
308 | 308 | <span class="donor-address info-item edit-item"> |
309 | - <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | - <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | - <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" /> |
|
309 | + <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | + <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | + <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" /> |
|
312 | 312 | <select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item"> |
313 | 313 | <?php |
314 | 314 | |
315 | 315 | $selected_country = $address['country']; |
316 | 316 | |
317 | 317 | $countries = give_get_country_list(); |
318 | - foreach ( $countries as $country_code => $country ) { |
|
319 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
318 | + foreach ($countries as $country_code => $country) { |
|
319 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
320 | 320 | } |
321 | 321 | ?> |
322 | 322 | </select> |
323 | 323 | <?php |
324 | 324 | $selected_state = give_get_state(); |
325 | - $states = give_get_states( $selected_country ); |
|
325 | + $states = give_get_states($selected_country); |
|
326 | 326 | |
327 | - $selected_state = isset( $address['state'] ) ? $address['state'] : $selected_state; |
|
327 | + $selected_state = isset($address['state']) ? $address['state'] : $selected_state; |
|
328 | 328 | |
329 | - if ( ! empty( $states ) ) { |
|
329 | + if ( ! empty($states)) { |
|
330 | 330 | ?> |
331 | 331 | <select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item"> |
332 | 332 | <?php |
333 | - foreach ( $states as $state_code => $state ) { |
|
334 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
333 | + foreach ($states as $state_code => $state) { |
|
334 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
335 | 335 | } |
336 | 336 | ?> |
337 | 337 | </select> |
338 | 338 | <?php |
339 | 339 | } else { |
340 | 340 | ?> |
341 | - <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e( 'State / Province / County', 'give' ); ?>" /> |
|
341 | + <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e('State / Province / County', 'give'); ?>" /> |
|
342 | 342 | <?php |
343 | 343 | } |
344 | 344 | ?> |
345 | - <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>" value="<?php echo $address['zip']; ?>" /> |
|
345 | + <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>" value="<?php echo $address['zip']; ?>" /> |
|
346 | 346 | </span> |
347 | 347 | |
348 | 348 | </div> |
@@ -358,10 +358,10 @@ discard block |
||
358 | 358 | |
359 | 359 | <span id="donor-edit-actions" class="edit-item"> |
360 | 360 | <input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $donor->id; ?>" /> |
361 | - <?php wp_nonce_field( 'edit-donor', '_wpnonce', false, true ); ?> |
|
361 | + <?php wp_nonce_field('edit-donor', '_wpnonce', false, true); ?> |
|
362 | 362 | <input type="hidden" name="give_action" value="edit-donor" /> |
363 | - <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php esc_attr_e( 'Update Donor', 'give' ); ?>" /> |
|
364 | - <a id="give-edit-donor-cancel" href="" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
363 | + <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php esc_attr_e('Update Donor', 'give'); ?>" /> |
|
364 | + <a id="give-edit-donor-cancel" href="" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
365 | 365 | </span> |
366 | 366 | |
367 | 367 | </form> |
@@ -376,24 +376,24 @@ discard block |
||
376 | 376 | * |
377 | 377 | * @param object $donor The donor object being displayed. |
378 | 378 | */ |
379 | - do_action( 'give_donor_before_stats', $donor ); |
|
379 | + do_action('give_donor_before_stats', $donor); |
|
380 | 380 | ?> |
381 | 381 | |
382 | 382 | <div id="donor-stats-wrapper" class="donor-section postbox clear"> |
383 | 383 | <ul> |
384 | 384 | <li> |
385 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $donor->email ) ); ?>"> |
|
385 | + <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($donor->email)); ?>"> |
|
386 | 386 | <span class="dashicons dashicons-heart"></span> |
387 | 387 | <?php |
388 | 388 | // Completed Donations |
389 | - $completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give' ), $donor->purchase_count ); |
|
390 | - echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $donor ); |
|
389 | + $completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give'), $donor->purchase_count); |
|
390 | + echo apply_filters('give_donor_completed_donations', $completed_donations_text, $donor); |
|
391 | 391 | ?> |
392 | 392 | </a> |
393 | 393 | </li> |
394 | 394 | <li> |
395 | 395 | <span class="dashicons dashicons-chart-area"></span> |
396 | - <?php echo give_currency_filter( give_format_amount( $donor->purchase_value ) ); ?> <?php esc_html_e( 'Lifetime Donations', 'give' ); ?> |
|
396 | + <?php echo give_currency_filter(give_format_amount($donor->purchase_value)); ?> <?php esc_html_e('Lifetime Donations', 'give'); ?> |
|
397 | 397 | </li> |
398 | 398 | <?php |
399 | 399 | /** |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | * |
406 | 406 | * @param object $donor The donor object being displayed. |
407 | 407 | */ |
408 | - do_action( 'give_donor_stats_list', $donor ); |
|
408 | + do_action('give_donor_stats_list', $donor); |
|
409 | 409 | ?> |
410 | 410 | </ul> |
411 | 411 | </div> |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | * |
419 | 419 | * @param object $donor The donor object being displayed. |
420 | 420 | */ |
421 | - do_action( 'give_donor_before_tables_wrapper', $donor ); |
|
421 | + do_action('give_donor_before_tables_wrapper', $donor); |
|
422 | 422 | ?> |
423 | 423 | |
424 | 424 | <div id="donor-tables-wrapper" class="donor-section"> |
@@ -431,46 +431,46 @@ discard block |
||
431 | 431 | * |
432 | 432 | * @param object $donor The donor object being displayed. |
433 | 433 | */ |
434 | - do_action( 'give_donor_before_tables', $donor ); |
|
434 | + do_action('give_donor_before_tables', $donor); |
|
435 | 435 | ?> |
436 | 436 | |
437 | - <h3><?php _e( 'Donor Emails', 'give' ); ?></h3> |
|
437 | + <h3><?php _e('Donor Emails', 'give'); ?></h3> |
|
438 | 438 | |
439 | 439 | <table class="wp-list-table widefat striped emails"> |
440 | 440 | <thead> |
441 | 441 | <tr> |
442 | - <th><?php _e( 'Email', 'give' ); ?></th> |
|
443 | - <th><?php _e( 'Actions', 'give' ); ?></th> |
|
442 | + <th><?php _e('Email', 'give'); ?></th> |
|
443 | + <th><?php _e('Actions', 'give'); ?></th> |
|
444 | 444 | </tr> |
445 | 445 | </thead> |
446 | 446 | |
447 | 447 | <tbody> |
448 | - <?php if ( ! empty( $donor->emails ) ) { ?> |
|
448 | + <?php if ( ! empty($donor->emails)) { ?> |
|
449 | 449 | |
450 | - <?php foreach ( $donor->emails as $key => $email ) : ?> |
|
450 | + <?php foreach ($donor->emails as $key => $email) : ?> |
|
451 | 451 | <tr data-key="<?php echo $key; ?>"> |
452 | 452 | <td> |
453 | 453 | <?php echo $email; ?> |
454 | - <?php if ( 'primary' === $key ) : ?> |
|
454 | + <?php if ('primary' === $key) : ?> |
|
455 | 455 | <span class="dashicons dashicons-star-filled primary-email-icon"></span> |
456 | 456 | <?php endif; ?> |
457 | 457 | </td> |
458 | 458 | <td> |
459 | - <?php if ( 'primary' !== $key ) : ?> |
|
459 | + <?php if ('primary' !== $key) : ?> |
|
460 | 460 | <?php |
461 | - $base_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); |
|
462 | - $promote_url = wp_nonce_url( add_query_arg( array( |
|
463 | - 'email' => rawurlencode( $email ), |
|
461 | + $base_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); |
|
462 | + $promote_url = wp_nonce_url(add_query_arg(array( |
|
463 | + 'email' => rawurlencode($email), |
|
464 | 464 | 'give_action' => 'set_donor_primary_email', |
465 | - ), $base_url ), 'give-set-donor-primary-email' ); |
|
466 | - $remove_url = wp_nonce_url( add_query_arg( array( |
|
467 | - 'email' => rawurlencode( $email ), |
|
465 | + ), $base_url), 'give-set-donor-primary-email'); |
|
466 | + $remove_url = wp_nonce_url(add_query_arg(array( |
|
467 | + 'email' => rawurlencode($email), |
|
468 | 468 | 'give_action' => 'remove_donor_email', |
469 | - ), $base_url ), 'give-remove-donor-email' ); |
|
469 | + ), $base_url), 'give-remove-donor-email'); |
|
470 | 470 | ?> |
471 | - <a href="<?php echo $promote_url; ?>"><?php _e( 'Make Primary', 'give' ); ?></a> |
|
471 | + <a href="<?php echo $promote_url; ?>"><?php _e('Make Primary', 'give'); ?></a> |
|
472 | 472 | | |
473 | - <a href="<?php echo $remove_url; ?>" class="delete"><?php _e( 'Remove', 'give' ); ?></a> |
|
473 | + <a href="<?php echo $remove_url; ?>" class="delete"><?php _e('Remove', 'give'); ?></a> |
|
474 | 474 | <?php endif; ?> |
475 | 475 | </td> |
476 | 476 | </tr> |
@@ -480,59 +480,59 @@ discard block |
||
480 | 480 | <td colspan="2" class="add-donor-email-td"> |
481 | 481 | <div class="add-donor-email-wrapper"> |
482 | 482 | <input type="hidden" name="donor-id" value="<?php echo $donor->id; ?>" /> |
483 | - <?php wp_nonce_field( 'give_add_donor_email', 'add_email_nonce', false, true ); ?> |
|
484 | - <input type="email" name="additional-email" value="" placeholder="<?php _e( 'Email Address', 'give' ); ?>" /> |
|
485 | - <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e( 'Make Primary', 'give' ); ?></label> |
|
486 | - <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e( 'Add Email', 'give' ); ?></button> |
|
483 | + <?php wp_nonce_field('give_add_donor_email', 'add_email_nonce', false, true); ?> |
|
484 | + <input type="email" name="additional-email" value="" placeholder="<?php _e('Email Address', 'give'); ?>" /> |
|
485 | + <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e('Make Primary', 'give'); ?></label> |
|
486 | + <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e('Add Email', 'give'); ?></button> |
|
487 | 487 | <span class="spinner"></span> |
488 | 488 | </div> |
489 | 489 | <div class="notice-wrap"></div> |
490 | 490 | </td> |
491 | 491 | </tr> |
492 | 492 | <?php } else { ?> |
493 | - <tr><td colspan="2"><?php _e( 'No Emails Found', 'give' ); ?></td></tr> |
|
493 | + <tr><td colspan="2"><?php _e('No Emails Found', 'give'); ?></td></tr> |
|
494 | 494 | <?php }// End if(). |
495 | 495 | ?> |
496 | 496 | </tbody> |
497 | 497 | </table> |
498 | 498 | |
499 | - <h3><?php esc_html_e( 'Recent Donations', 'give' ); ?></h3> |
|
499 | + <h3><?php esc_html_e('Recent Donations', 'give'); ?></h3> |
|
500 | 500 | <?php |
501 | - $payment_ids = explode( ',', $donor->payment_ids ); |
|
502 | - $payments = give_get_payments( array( |
|
501 | + $payment_ids = explode(',', $donor->payment_ids); |
|
502 | + $payments = give_get_payments(array( |
|
503 | 503 | 'post__in' => $payment_ids, |
504 | - ) ); |
|
505 | - $payments = array_slice( $payments, 0, 10 ); |
|
504 | + )); |
|
505 | + $payments = array_slice($payments, 0, 10); |
|
506 | 506 | ?> |
507 | 507 | <table class="wp-list-table widefat striped payments"> |
508 | 508 | <thead> |
509 | 509 | <tr> |
510 | - <th scope="col"><?php esc_html_e( 'ID', 'give' ); ?></th> |
|
511 | - <th scope="col"><?php esc_html_e( 'Amount', 'give' ); ?></th> |
|
512 | - <th scope="col"><?php esc_html_e( 'Date', 'give' ); ?></th> |
|
513 | - <th scope="col"><?php esc_html_e( 'Status', 'give' ); ?></th> |
|
514 | - <th scope="col"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
510 | + <th scope="col"><?php esc_html_e('ID', 'give'); ?></th> |
|
511 | + <th scope="col"><?php esc_html_e('Amount', 'give'); ?></th> |
|
512 | + <th scope="col"><?php esc_html_e('Date', 'give'); ?></th> |
|
513 | + <th scope="col"><?php esc_html_e('Status', 'give'); ?></th> |
|
514 | + <th scope="col"><?php esc_html_e('Actions', 'give'); ?></th> |
|
515 | 515 | </tr> |
516 | 516 | </thead> |
517 | 517 | <tbody> |
518 | - <?php if ( ! empty( $payments ) ) { ?> |
|
519 | - <?php foreach ( $payments as $payment ) : ?> |
|
518 | + <?php if ( ! empty($payments)) { ?> |
|
519 | + <?php foreach ($payments as $payment) : ?> |
|
520 | 520 | <tr> |
521 | 521 | <td><?php echo $payment->ID; ?></td> |
522 | - <td><?php echo give_payment_amount( $payment->ID ); ?></td> |
|
523 | - <td><?php echo date_i18n( give_date_format(), strtotime( $payment->post_date ) ); ?></td> |
|
524 | - <td><?php echo give_get_payment_status( $payment, true ); ?></td> |
|
522 | + <td><?php echo give_payment_amount($payment->ID); ?></td> |
|
523 | + <td><?php echo date_i18n(give_date_format(), strtotime($payment->post_date)); ?></td> |
|
524 | + <td><?php echo give_get_payment_status($payment, true); ?></td> |
|
525 | 525 | <td> |
526 | 526 | <?php |
527 | 527 | printf( |
528 | 528 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
529 | - admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment->ID ), |
|
529 | + admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$payment->ID), |
|
530 | 530 | sprintf( |
531 | 531 | /* translators: %s: Donation ID */ |
532 | - esc_attr__( 'View Donation %s.', 'give' ), |
|
532 | + esc_attr__('View Donation %s.', 'give'), |
|
533 | 533 | $payment->ID |
534 | 534 | ), |
535 | - esc_html__( 'View Donation', 'give' ) |
|
535 | + esc_html__('View Donation', 'give') |
|
536 | 536 | ); |
537 | 537 | ?> |
538 | 538 | |
@@ -547,47 +547,47 @@ discard block |
||
547 | 547 | * @param object $donor The donor object being displayed. |
548 | 548 | * @param object $payment The payment object being displayed. |
549 | 549 | */ |
550 | - do_action( 'give_donor_recent_purchases_actions', $donor, $payment ); |
|
550 | + do_action('give_donor_recent_purchases_actions', $donor, $payment); |
|
551 | 551 | ?> |
552 | 552 | </td> |
553 | 553 | </tr> |
554 | 554 | <?php endforeach; ?> |
555 | 555 | <?php } else { ?> |
556 | 556 | <tr> |
557 | - <td colspan="5"><?php esc_html_e( 'No donations found.', 'give' ); ?></td> |
|
557 | + <td colspan="5"><?php esc_html_e('No donations found.', 'give'); ?></td> |
|
558 | 558 | </tr> |
559 | 559 | <?php }// End if(). |
560 | 560 | ?> |
561 | 561 | </tbody> |
562 | 562 | </table> |
563 | 563 | |
564 | - <h3><?php esc_html_e( 'Completed Forms', 'give' ); ?></h3> |
|
564 | + <h3><?php esc_html_e('Completed Forms', 'give'); ?></h3> |
|
565 | 565 | <?php |
566 | - $donations = give_get_users_completed_donations( $donor->email ); |
|
566 | + $donations = give_get_users_completed_donations($donor->email); |
|
567 | 567 | ?> |
568 | 568 | <table class="wp-list-table widefat striped donations"> |
569 | 569 | <thead> |
570 | 570 | <tr> |
571 | - <th scope="col"><?php esc_html_e( 'Form', 'give' ); ?></th> |
|
572 | - <th scope="col" width="120px"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
571 | + <th scope="col"><?php esc_html_e('Form', 'give'); ?></th> |
|
572 | + <th scope="col" width="120px"><?php esc_html_e('Actions', 'give'); ?></th> |
|
573 | 573 | </tr> |
574 | 574 | </thead> |
575 | 575 | <tbody> |
576 | - <?php if ( ! empty( $donations ) ) { ?> |
|
577 | - <?php foreach ( $donations as $donation ) : ?> |
|
576 | + <?php if ( ! empty($donations)) { ?> |
|
577 | + <?php foreach ($donations as $donation) : ?> |
|
578 | 578 | <tr> |
579 | 579 | <td><?php echo $donation->post_title; ?></td> |
580 | 580 | <td> |
581 | 581 | <?php |
582 | 582 | printf( |
583 | 583 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
584 | - esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) ), |
|
584 | + esc_url(admin_url('post.php?action=edit&post='.$donation->ID)), |
|
585 | 585 | sprintf( |
586 | 586 | /* translators: %s: form name */ |
587 | - esc_attr__( 'View Form %s.', 'give' ), |
|
587 | + esc_attr__('View Form %s.', 'give'), |
|
588 | 588 | $donation->post_title |
589 | 589 | ), |
590 | - esc_html__( 'View Form', 'give' ) |
|
590 | + esc_html__('View Form', 'give') |
|
591 | 591 | ); |
592 | 592 | ?> |
593 | 593 | </td> |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | <?php endforeach; ?> |
596 | 596 | <?php } else { ?> |
597 | 597 | <tr> |
598 | - <td colspan="2"><?php esc_html_e( 'No completed donations found.', 'give' ); ?></td> |
|
598 | + <td colspan="2"><?php esc_html_e('No completed donations found.', 'give'); ?></td> |
|
599 | 599 | </tr> |
600 | 600 | <?php } ?> |
601 | 601 | </tbody> |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | * |
610 | 610 | * @param object $donor The donor object being displayed. |
611 | 611 | */ |
612 | - do_action( 'give_donor_after_tables', $donor ); |
|
612 | + do_action('give_donor_after_tables', $donor); |
|
613 | 613 | ?> |
614 | 614 | |
615 | 615 | </div> |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | * |
623 | 623 | * @param object $donor The donor object being displayed. |
624 | 624 | */ |
625 | - do_action( 'give_donor_card_bottom', $donor ); |
|
625 | + do_action('give_donor_card_bottom', $donor); |
|
626 | 626 | |
627 | 627 | } |
628 | 628 | |
@@ -635,30 +635,30 @@ discard block |
||
635 | 635 | * |
636 | 636 | * @return void |
637 | 637 | */ |
638 | -function give_donor_notes_view( $donor ) { |
|
638 | +function give_donor_notes_view($donor) { |
|
639 | 639 | |
640 | - $paged = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1; |
|
641 | - $paged = absint( $paged ); |
|
640 | + $paged = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1; |
|
641 | + $paged = absint($paged); |
|
642 | 642 | $note_count = $donor->get_notes_count(); |
643 | - $per_page = apply_filters( 'give_donor_notes_per_page', 20 ); |
|
644 | - $total_pages = ceil( $note_count / $per_page ); |
|
645 | - $donor_notes = $donor->get_notes( $per_page, $paged ); |
|
643 | + $per_page = apply_filters('give_donor_notes_per_page', 20); |
|
644 | + $total_pages = ceil($note_count / $per_page); |
|
645 | + $donor_notes = $donor->get_notes($per_page, $paged); |
|
646 | 646 | ?> |
647 | 647 | |
648 | 648 | <div id="donor-notes-wrapper"> |
649 | 649 | <div class="donor-notes-header"> |
650 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
650 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
651 | 651 | </div> |
652 | - <h3><?php esc_html_e( 'Notes', 'give' ); ?></h3> |
|
652 | + <h3><?php esc_html_e('Notes', 'give'); ?></h3> |
|
653 | 653 | |
654 | - <?php if ( 1 == $paged ) : ?> |
|
654 | + <?php if (1 == $paged) : ?> |
|
655 | 655 | <div style="display: block; margin-bottom: 55px;"> |
656 | - <form id="give-add-donor-note" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor->id ); ?>"> |
|
656 | + <form id="give-add-donor-note" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$donor->id); ?>"> |
|
657 | 657 | <textarea id="donor-note" name="donor_note" class="donor-note-input" rows="10"></textarea> |
658 | 658 | <br /> |
659 | 659 | <input type="hidden" id="donor-id" name="customer_id" value="<?php echo $donor->id; ?>" /> |
660 | 660 | <input type="hidden" name="give_action" value="add-donor-note" /> |
661 | - <?php wp_nonce_field( 'add-donor-note', 'add_donor_note_nonce', true, true ); ?> |
|
661 | + <?php wp_nonce_field('add-donor-note', 'add_donor_note_nonce', true, true); ?> |
|
662 | 662 | <input id="add-donor-note" class="right button-primary" type="submit" value="Add Note" /> |
663 | 663 | </form> |
664 | 664 | </div> |
@@ -673,26 +673,26 @@ discard block |
||
673 | 673 | 'show_all' => true, |
674 | 674 | ); |
675 | 675 | |
676 | - echo paginate_links( $pagination_args ); |
|
676 | + echo paginate_links($pagination_args); |
|
677 | 677 | ?> |
678 | 678 | |
679 | 679 | <div id="give-donor-notes" class="postbox"> |
680 | - <?php if ( count( $donor_notes ) > 0 ) { ?> |
|
681 | - <?php foreach ( $donor_notes as $key => $note ) : ?> |
|
680 | + <?php if (count($donor_notes) > 0) { ?> |
|
681 | + <?php foreach ($donor_notes as $key => $note) : ?> |
|
682 | 682 | <div class="donor-note-wrapper dashboard-comment-wrap comment-item"> |
683 | 683 | <span class="note-content-wrap"> |
684 | - <?php echo stripslashes( $note ); ?> |
|
684 | + <?php echo stripslashes($note); ?> |
|
685 | 685 | </span> |
686 | 686 | </div> |
687 | 687 | <?php endforeach; ?> |
688 | 688 | <?php } else { ?> |
689 | 689 | <div class="give-no-donor-notes"> |
690 | - <?php esc_html_e( 'No donor notes found.', 'give' ); ?> |
|
690 | + <?php esc_html_e('No donor notes found.', 'give'); ?> |
|
691 | 691 | </div> |
692 | 692 | <?php } ?> |
693 | 693 | </div> |
694 | 694 | |
695 | - <?php echo paginate_links( $pagination_args ); ?> |
|
695 | + <?php echo paginate_links($pagination_args); ?> |
|
696 | 696 | |
697 | 697 | </div> |
698 | 698 | |
@@ -708,9 +708,9 @@ discard block |
||
708 | 708 | * |
709 | 709 | * @return void |
710 | 710 | */ |
711 | -function give_donor_delete_view( $donor ) { |
|
711 | +function give_donor_delete_view($donor) { |
|
712 | 712 | |
713 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
713 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
714 | 714 | |
715 | 715 | /** |
716 | 716 | * Fires in donor delete screen, above the content. |
@@ -719,15 +719,15 @@ discard block |
||
719 | 719 | * |
720 | 720 | * @param object $donor The donor object being displayed. |
721 | 721 | */ |
722 | - do_action( 'give_donor_delete_top', $donor ); |
|
722 | + do_action('give_donor_delete_top', $donor); |
|
723 | 723 | ?> |
724 | 724 | |
725 | 725 | <div class="info-wrapper donor-section"> |
726 | 726 | |
727 | - <form id="delete-donor" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $donor->id ); ?>"> |
|
727 | + <form id="delete-donor" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$donor->id); ?>"> |
|
728 | 728 | |
729 | 729 | <div class="donor-notes-header"> |
730 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
730 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
731 | 731 | </div> |
732 | 732 | |
733 | 733 | |
@@ -735,20 +735,20 @@ discard block |
||
735 | 735 | |
736 | 736 | <span class="delete-donor-options"> |
737 | 737 | <p> |
738 | - <?php echo Give()->html->checkbox( array( |
|
738 | + <?php echo Give()->html->checkbox(array( |
|
739 | 739 | 'name' => 'give-donor-delete-confirm', |
740 | - ) ); ?> |
|
741 | - <label for="give-donor-delete-confirm"><?php esc_html_e( 'Are you sure you want to delete this donor?', 'give' ); ?></label> |
|
740 | + )); ?> |
|
741 | + <label for="give-donor-delete-confirm"><?php esc_html_e('Are you sure you want to delete this donor?', 'give'); ?></label> |
|
742 | 742 | </p> |
743 | 743 | |
744 | 744 | <p> |
745 | - <?php echo Give()->html->checkbox( array( |
|
745 | + <?php echo Give()->html->checkbox(array( |
|
746 | 746 | 'name' => 'give-donor-delete-records', |
747 | 747 | 'options' => array( |
748 | 748 | 'disabled' => true, |
749 | 749 | ), |
750 | - ) ); ?> |
|
751 | - <label for="give-donor-delete-records"><?php esc_html_e( 'Delete all associated donations and records?', 'give' ); ?></label> |
|
750 | + )); ?> |
|
751 | + <label for="give-donor-delete-records"><?php esc_html_e('Delete all associated donations and records?', 'give'); ?></label> |
|
752 | 752 | </p> |
753 | 753 | |
754 | 754 | <?php |
@@ -761,16 +761,16 @@ discard block |
||
761 | 761 | * |
762 | 762 | * @param object $donor The donor object being displayed. |
763 | 763 | */ |
764 | - do_action( 'give_donor_delete_inputs', $donor ); |
|
764 | + do_action('give_donor_delete_inputs', $donor); |
|
765 | 765 | ?> |
766 | 766 | </span> |
767 | 767 | |
768 | 768 | <span id="donor-edit-actions"> |
769 | 769 | <input type="hidden" name="customer_id" value="<?php echo $donor->id; ?>" /> |
770 | - <?php wp_nonce_field( 'delete-donor', '_wpnonce', false, true ); ?> |
|
770 | + <?php wp_nonce_field('delete-donor', '_wpnonce', false, true); ?> |
|
771 | 771 | <input type="hidden" name="give_action" value="delete-donor" /> |
772 | - <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php esc_attr_e( 'Delete Donor', 'give' ); ?>" /> |
|
773 | - <a id="give-delete-donor-cancel" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
772 | + <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php esc_attr_e('Delete Donor', 'give'); ?>" /> |
|
773 | + <a id="give-delete-donor-cancel" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
774 | 774 | </span> |
775 | 775 | |
776 | 776 | </div> |
@@ -786,5 +786,5 @@ discard block |
||
786 | 786 | * |
787 | 787 | * @param object $donor The donor object being displayed. |
788 | 788 | */ |
789 | - do_action( 'give_donor_delete_bottom', $donor ); |
|
789 | + do_action('give_donor_delete_bottom', $donor); |
|
790 | 790 | } |
@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // Exit if accessed directly. |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
19 | 19 | // Load WP_List_Table if not loaded |
20 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
21 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
20 | +if ( ! class_exists('WP_List_Table')) { |
|
21 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | public function __construct() { |
62 | 62 | |
63 | 63 | // Set parent defaults |
64 | - parent::__construct( array( |
|
65 | - 'singular' => __( 'Donor', 'give' ), // Singular name of the listed records. |
|
66 | - 'plural' => __( 'Donors', 'give' ), // Plural name of the listed records. |
|
67 | - 'ajax' => false,// Does this table support ajax?. |
|
68 | - ) ); |
|
64 | + parent::__construct(array( |
|
65 | + 'singular' => __('Donor', 'give'), // Singular name of the listed records. |
|
66 | + 'plural' => __('Donors', 'give'), // Plural name of the listed records. |
|
67 | + 'ajax' => false, // Does this table support ajax?. |
|
68 | + )); |
|
69 | 69 | |
70 | 70 | } |
71 | 71 | |
@@ -80,22 +80,22 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return void |
82 | 82 | */ |
83 | - public function search_box( $text, $input_id ) { |
|
84 | - $input_id = $input_id . '-search-input'; |
|
83 | + public function search_box($text, $input_id) { |
|
84 | + $input_id = $input_id.'-search-input'; |
|
85 | 85 | |
86 | - if ( ! empty( $_REQUEST['orderby'] ) ) { |
|
87 | - echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />'; |
|
86 | + if ( ! empty($_REQUEST['orderby'])) { |
|
87 | + echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />'; |
|
88 | 88 | } |
89 | - if ( ! empty( $_REQUEST['order'] ) ) { |
|
90 | - echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />'; |
|
89 | + if ( ! empty($_REQUEST['order'])) { |
|
90 | + echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />'; |
|
91 | 91 | } |
92 | 92 | ?> |
93 | 93 | <p class="search-box" role="search"> |
94 | 94 | <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label> |
95 | 95 | <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/> |
96 | - <?php submit_button( $text, 'button', false, false, array( |
|
96 | + <?php submit_button($text, 'button', false, false, array( |
|
97 | 97 | 'ID' => 'search-submit', |
98 | - ) ); ?> |
|
98 | + )); ?> |
|
99 | 99 | </p> |
100 | 100 | <?php |
101 | 101 | } |
@@ -111,27 +111,27 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @return string Column Name. |
113 | 113 | */ |
114 | - public function column_default( $donor, $column_name ) { |
|
115 | - switch ( $column_name ) { |
|
114 | + public function column_default($donor, $column_name) { |
|
115 | + switch ($column_name) { |
|
116 | 116 | |
117 | 117 | case 'num_donations' : |
118 | - $value = '<a href="' . admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . urlencode( $donor['id'] ) ) . '&status=publish' . ' ">' . esc_html( $donor['num_donations'] ) . '</a>'; |
|
118 | + $value = '<a href="'.admin_url('edit.php?post_type=give_forms&page=give-payment-history&donor='.urlencode($donor['id'])).'&status=publish'.' ">'.esc_html($donor['num_donations']).'</a>'; |
|
119 | 119 | break; |
120 | 120 | |
121 | 121 | case 'amount_spent' : |
122 | - $value = give_currency_filter( give_format_amount( $donor[ $column_name ] ) ); |
|
122 | + $value = give_currency_filter(give_format_amount($donor[$column_name])); |
|
123 | 123 | break; |
124 | 124 | |
125 | 125 | case 'date_created' : |
126 | - $value = date_i18n( give_date_format(), strtotime( $donor['date_created'] ) ); |
|
126 | + $value = date_i18n(give_date_format(), strtotime($donor['date_created'])); |
|
127 | 127 | break; |
128 | 128 | |
129 | 129 | default: |
130 | - $value = isset( $donor[ $column_name ] ) ? $donor[ $column_name ] : null; |
|
130 | + $value = isset($donor[$column_name]) ? $donor[$column_name] : null; |
|
131 | 131 | break; |
132 | 132 | } |
133 | 133 | |
134 | - return apply_filters( "give_report_column_{$column_name}", $value, $donor['id'] ); |
|
134 | + return apply_filters("give_report_column_{$column_name}", $value, $donor['id']); |
|
135 | 135 | |
136 | 136 | } |
137 | 137 | |
@@ -142,13 +142,13 @@ discard block |
||
142 | 142 | * |
143 | 143 | * @return string |
144 | 144 | */ |
145 | - public function column_name( $donor ) { |
|
146 | - $name = '#' . $donor['id'] . ' '; |
|
147 | - $name .= ! empty( $donor['name'] ) ? $donor['name'] : '<em>' . esc_html__( 'Unnamed Donor', 'give' ) . '</em>'; |
|
148 | - $view_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor['id'] ); |
|
149 | - $actions = $this->get_row_actions( $donor ); |
|
145 | + public function column_name($donor) { |
|
146 | + $name = '#'.$donor['id'].' '; |
|
147 | + $name .= ! empty($donor['name']) ? $donor['name'] : '<em>'.esc_html__('Unnamed Donor', 'give').'</em>'; |
|
148 | + $view_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor['id']); |
|
149 | + $actions = $this->get_row_actions($donor); |
|
150 | 150 | |
151 | - return '<a href="' . esc_url( $view_url ) . '">' . $name . '</a>' . $this->row_actions( $actions ); |
|
151 | + return '<a href="'.esc_url($view_url).'">'.$name.'</a>'.$this->row_actions($actions); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function get_columns() { |
162 | 162 | $columns = array( |
163 | - 'name' => __( 'Name', 'give' ), |
|
164 | - 'email' => __( 'Email', 'give' ), |
|
165 | - 'num_donations' => __( 'Donations', 'give' ), |
|
166 | - 'amount_spent' => __( 'Total Donated', 'give' ), |
|
167 | - 'date_created' => __( 'Date Created', 'give' ), |
|
163 | + 'name' => __('Name', 'give'), |
|
164 | + 'email' => __('Email', 'give'), |
|
165 | + 'num_donations' => __('Donations', 'give'), |
|
166 | + 'amount_spent' => __('Total Donated', 'give'), |
|
167 | + 'date_created' => __('Date Created', 'give'), |
|
168 | 168 | ); |
169 | 169 | |
170 | - return apply_filters( 'give_list_donors_columns', $columns ); |
|
170 | + return apply_filters('give_list_donors_columns', $columns); |
|
171 | 171 | |
172 | 172 | } |
173 | 173 | |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | public function get_sortable_columns() { |
182 | 182 | |
183 | 183 | $columns = array( |
184 | - 'date_created' => array( 'date_created', true ), |
|
185 | - 'name' => array( 'name', true ), |
|
186 | - 'num_donations' => array( 'purchase_count', false ), |
|
187 | - 'amount_spent' => array( 'purchase_value', false ), |
|
184 | + 'date_created' => array('date_created', true), |
|
185 | + 'name' => array('name', true), |
|
186 | + 'num_donations' => array('purchase_count', false), |
|
187 | + 'amount_spent' => array('purchase_value', false), |
|
188 | 188 | ); |
189 | 189 | |
190 | - return apply_filters( 'give_list_donors_sortable_columns', $columns ); |
|
190 | + return apply_filters('give_list_donors_sortable_columns', $columns); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -200,19 +200,19 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @return array An array of action links. |
202 | 202 | */ |
203 | - public function get_row_actions( $donor ) { |
|
203 | + public function get_row_actions($donor) { |
|
204 | 204 | |
205 | 205 | $actions = array( |
206 | 206 | |
207 | - 'view' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor['id'] ), sprintf( esc_attr__( 'View "%s"', 'give' ), $donor['name'] ), __( 'View Donor', 'give' ) ), |
|
207 | + 'view' => sprintf('<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor['id']), sprintf(esc_attr__('View "%s"', 'give'), $donor['name']), __('View Donor', 'give')), |
|
208 | 208 | |
209 | - 'notes' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor['id'] ), sprintf( esc_attr__( 'Notes for "%s"', 'give' ), $donor['name'] ), __( 'Notes', 'give' ) ), |
|
209 | + 'notes' => sprintf('<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$donor['id']), sprintf(esc_attr__('Notes for "%s"', 'give'), $donor['name']), __('Notes', 'give')), |
|
210 | 210 | |
211 | - 'delete' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $donor['id'] ), sprintf( esc_attr__( 'Delete "%s"', 'give' ), $donor['name'] ), __( 'Delete', 'give' ) ), |
|
211 | + 'delete' => sprintf('<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$donor['id']), sprintf(esc_attr__('Delete "%s"', 'give'), $donor['name']), __('Delete', 'give')), |
|
212 | 212 | |
213 | 213 | ); |
214 | 214 | |
215 | - return apply_filters( 'give_donor_row_actions', $actions, $donor ); |
|
215 | + return apply_filters('give_donor_row_actions', $actions, $donor); |
|
216 | 216 | |
217 | 217 | } |
218 | 218 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @since 1.0 |
227 | 227 | * @return void |
228 | 228 | */ |
229 | - public function bulk_actions( $which = '' ) { |
|
229 | + public function bulk_actions($which = '') { |
|
230 | 230 | // These aren't really bulk actions but this outputs the markup in the right place. |
231 | 231 | } |
232 | 232 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | * @return int Current page number. |
239 | 239 | */ |
240 | 240 | public function get_paged() { |
241 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
241 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * @return mixed string If search is present, false otherwise. |
250 | 250 | */ |
251 | 251 | public function get_search() { |
252 | - return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false; |
|
252 | + return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false; |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
@@ -266,13 +266,13 @@ discard block |
||
266 | 266 | |
267 | 267 | // Get donor query. |
268 | 268 | $args = $this->get_donor_query(); |
269 | - $donors = Give()->donors->get_donors( $args ); |
|
269 | + $donors = Give()->donors->get_donors($args); |
|
270 | 270 | |
271 | - if ( $donors ) { |
|
271 | + if ($donors) { |
|
272 | 272 | |
273 | - foreach ( $donors as $donor ) { |
|
273 | + foreach ($donors as $donor) { |
|
274 | 274 | |
275 | - $user_id = ! empty( $donor->user_id ) ? intval( $donor->user_id ) : 0; |
|
275 | + $user_id = ! empty($donor->user_id) ? intval($donor->user_id) : 0; |
|
276 | 276 | |
277 | 277 | $data[] = array( |
278 | 278 | 'id' => $donor->id, |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | } |
287 | 287 | } |
288 | 288 | |
289 | - return apply_filters( 'give_donors_column_query_data', $data ); |
|
289 | + return apply_filters('give_donors_column_query_data', $data); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
@@ -301,9 +301,9 @@ discard block |
||
301 | 301 | |
302 | 302 | $_donor_query['number'] = - 1; |
303 | 303 | $_donor_query['offset'] = 0; |
304 | - $donors = Give()->donors->get_donors( $_donor_query ); |
|
304 | + $donors = Give()->donors->get_donors($_donor_query); |
|
305 | 305 | |
306 | - return count( $donors ); |
|
306 | + return count($donors); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | /** |
@@ -315,10 +315,10 @@ discard block |
||
315 | 315 | */ |
316 | 316 | public function get_donor_query() { |
317 | 317 | $paged = $this->get_paged(); |
318 | - $offset = $this->per_page * ( $paged - 1 ); |
|
318 | + $offset = $this->per_page * ($paged - 1); |
|
319 | 319 | $search = $this->get_search(); |
320 | - $order = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'DESC'; |
|
321 | - $orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'id'; |
|
320 | + $order = isset($_GET['order']) ? sanitize_text_field($_GET['order']) : 'DESC'; |
|
321 | + $orderby = isset($_GET['orderby']) ? sanitize_text_field($_GET['orderby']) : 'id'; |
|
322 | 322 | |
323 | 323 | $args = array( |
324 | 324 | 'number' => $this->per_page, |
@@ -327,10 +327,10 @@ discard block |
||
327 | 327 | 'orderby' => $orderby, |
328 | 328 | ); |
329 | 329 | |
330 | - if ( $search ) { |
|
331 | - if ( is_email( $search ) ) { |
|
330 | + if ($search) { |
|
331 | + if (is_email($search)) { |
|
332 | 332 | $args['email'] = $search; |
333 | - } elseif ( is_numeric( $search ) ) { |
|
333 | + } elseif (is_numeric($search)) { |
|
334 | 334 | $args['id'] = $search; |
335 | 335 | } else { |
336 | 336 | $args['name'] = $search; |
@@ -353,16 +353,16 @@ discard block |
||
353 | 353 | $hidden = array(); // No hidden columns. |
354 | 354 | $sortable = $this->get_sortable_columns(); |
355 | 355 | |
356 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
356 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
357 | 357 | |
358 | 358 | $this->items = $this->donor_data(); |
359 | 359 | |
360 | 360 | $this->total = $this->get_donor_count(); |
361 | 361 | |
362 | - $this->set_pagination_args( array( |
|
362 | + $this->set_pagination_args(array( |
|
363 | 363 | 'total_items' => $this->total, |
364 | 364 | 'per_page' => $this->per_page, |
365 | - 'total_pages' => ceil( $this->total / $this->per_page ), |
|
366 | - ) ); |
|
365 | + 'total_pages' => ceil($this->total / $this->per_page), |
|
366 | + )); |
|
367 | 367 | } |
368 | 368 | } |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Admin_Settings' ) ) : |
|
16 | +if ( ! class_exists('Give_Admin_Settings')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Admin_Settings Class. |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @param array $settings Array of settings class object. |
74 | 74 | */ |
75 | - self::$settings = apply_filters( self::$setting_filter_prefix . '_get_settings_pages', array() ); |
|
75 | + self::$settings = apply_filters(self::$setting_filter_prefix.'_get_settings_pages', array()); |
|
76 | 76 | |
77 | 77 | return self::$settings; |
78 | 78 | } |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | public static function save() { |
87 | 87 | $current_tab = give_get_current_setting_tab(); |
88 | 88 | |
89 | - if ( empty( $_REQUEST['_give-save-settings'] ) || ! wp_verify_nonce( $_REQUEST['_give-save-settings'], 'give-save-settings' ) ) { |
|
90 | - echo '<div class="notice error"><p>' . __( 'Action failed. Please refresh the page and retry.', 'give' ) . '</p></div>'; |
|
89 | + if (empty($_REQUEST['_give-save-settings']) || ! wp_verify_nonce($_REQUEST['_give-save-settings'], 'give-save-settings')) { |
|
90 | + echo '<div class="notice error"><p>'.__('Action failed. Please refresh the page and retry.', 'give').'</p></div>'; |
|
91 | 91 | die(); |
92 | 92 | } |
93 | 93 | |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @since 1.8 |
102 | 102 | */ |
103 | - do_action( self::$setting_filter_prefix . '_save_' . $current_tab ); |
|
103 | + do_action(self::$setting_filter_prefix.'_save_'.$current_tab); |
|
104 | 104 | |
105 | - self::add_message( 'give-setting-updated', __( 'Your settings have been saved.', 'give' ) ); |
|
105 | + self::add_message('give-setting-updated', __('Your settings have been saved.', 'give')); |
|
106 | 106 | |
107 | 107 | /** |
108 | 108 | * Trigger Action. |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @since 1.8 |
115 | 115 | */ |
116 | - do_action( self::$setting_filter_prefix . '_saved' ); |
|
116 | + do_action(self::$setting_filter_prefix.'_saved'); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | * |
127 | 127 | * @return void |
128 | 128 | */ |
129 | - public static function add_message( $code, $message ) { |
|
130 | - self::$messages[ $code ] = $message; |
|
129 | + public static function add_message($code, $message) { |
|
130 | + self::$messages[$code] = $message; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | * |
141 | 141 | * @return void |
142 | 142 | */ |
143 | - public static function add_error( $code, $message ) { |
|
144 | - self::$errors[ $code ] = $message; |
|
143 | + public static function add_error($code, $message) { |
|
144 | + self::$errors[$code] = $message; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -154,18 +154,18 @@ discard block |
||
154 | 154 | $notice_html = ''; |
155 | 155 | $classes = 'give-notice settings-error notice is-dismissible'; |
156 | 156 | |
157 | - self::$errors = apply_filters( self::$setting_filter_prefix . '_error_notices', self::$errors ); |
|
158 | - self::$messages = apply_filters( self::$setting_filter_prefix . '_update_notices', self::$messages ); |
|
157 | + self::$errors = apply_filters(self::$setting_filter_prefix.'_error_notices', self::$errors); |
|
158 | + self::$messages = apply_filters(self::$setting_filter_prefix.'_update_notices', self::$messages); |
|
159 | 159 | |
160 | - if ( 0 < count( self::$errors ) ) { |
|
161 | - foreach ( self::$errors as $code => $message ) { |
|
162 | - $notice_html .= '<div id="setting-error-' . $code . '" class="' . $classes . ' error"><p><strong>' . $message . '</strong></p></div>'; |
|
160 | + if (0 < count(self::$errors)) { |
|
161 | + foreach (self::$errors as $code => $message) { |
|
162 | + $notice_html .= '<div id="setting-error-'.$code.'" class="'.$classes.' error"><p><strong>'.$message.'</strong></p></div>'; |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | |
166 | - if ( 0 < count( self::$messages ) ) { |
|
167 | - foreach ( self::$messages as $code => $message ) { |
|
168 | - $notice_html .= '<div id="setting-error-' . $code . '" class="' . $classes . ' updated"><p><strong>' . $message . '</strong></p></div>'; |
|
166 | + if (0 < count(self::$messages)) { |
|
167 | + foreach (self::$messages as $code => $message) { |
|
168 | + $notice_html .= '<div id="setting-error-'.$code.'" class="'.$classes.' updated"><p><strong>'.$message.'</strong></p></div>'; |
|
169 | 169 | } |
170 | 170 | } |
171 | 171 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | self::$setting_filter_prefix = give_get_current_setting_page(); |
186 | 186 | |
187 | 187 | // Bailout: Exit if setting page is not defined. |
188 | - if ( empty( self::$setting_filter_prefix ) ) { |
|
188 | + if (empty(self::$setting_filter_prefix)) { |
|
189 | 189 | return false; |
190 | 190 | } |
191 | 191 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * |
199 | 199 | * @since 1.8 |
200 | 200 | */ |
201 | - do_action( self::$setting_filter_prefix . '_start' ); |
|
201 | + do_action(self::$setting_filter_prefix.'_start'); |
|
202 | 202 | |
203 | 203 | $current_tab = give_get_current_setting_tab(); |
204 | 204 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | self::get_settings_pages(); |
207 | 207 | |
208 | 208 | // Save settings if data has been posted. |
209 | - if ( ! empty( $_POST ) ) { |
|
209 | + if ( ! empty($_POST)) { |
|
210 | 210 | self::save(); |
211 | 211 | } |
212 | 212 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * |
220 | 220 | * @since 1.8 |
221 | 221 | */ |
222 | - $tabs = apply_filters( self::$setting_filter_prefix . '_tabs_array', array() ); |
|
222 | + $tabs = apply_filters(self::$setting_filter_prefix.'_tabs_array', array()); |
|
223 | 223 | |
224 | 224 | include 'views/html-admin-settings.php'; |
225 | 225 | |
@@ -237,25 +237,25 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @return string|bool |
239 | 239 | */ |
240 | - public static function get_option( $option_name = '', $field_id = '', $default = false ) { |
|
240 | + public static function get_option($option_name = '', $field_id = '', $default = false) { |
|
241 | 241 | // Bailout. |
242 | - if ( empty( $option_name ) && empty( $field_id ) ) { |
|
242 | + if (empty($option_name) && empty($field_id)) { |
|
243 | 243 | return false; |
244 | 244 | } |
245 | 245 | |
246 | - if ( ! empty( $field_id ) && ! empty( $option_name ) ) { |
|
246 | + if ( ! empty($field_id) && ! empty($option_name)) { |
|
247 | 247 | // Get field value if any. |
248 | - $option_value = get_option( $option_name ); |
|
248 | + $option_value = get_option($option_name); |
|
249 | 249 | |
250 | - $option_value = ( is_array( $option_value ) && array_key_exists( $field_id, $option_value ) ) |
|
251 | - ? $option_value[ $field_id ] |
|
250 | + $option_value = (is_array($option_value) && array_key_exists($field_id, $option_value)) |
|
251 | + ? $option_value[$field_id] |
|
252 | 252 | : $default; |
253 | 253 | } else { |
254 | 254 | // If option name is empty but not field name then this means, setting is direct store to option table under there field name. |
255 | 255 | $option_name = ! $option_name ? $field_id : $option_name; |
256 | 256 | |
257 | 257 | // Get option value if any. |
258 | - $option_value = get_option( $option_name, $default ); |
|
258 | + $option_value = get_option($option_name, $default); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | return $option_value; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | * |
274 | 274 | * @return void |
275 | 275 | */ |
276 | - public static function output_fields( $options, $option_name = '' ) { |
|
276 | + public static function output_fields($options, $option_name = '') { |
|
277 | 277 | $current_tab = give_get_current_setting_tab(); |
278 | 278 | |
279 | 279 | // Field Default values. |
@@ -286,52 +286,52 @@ discard block |
||
286 | 286 | 'table_html' => true, |
287 | 287 | ); |
288 | 288 | |
289 | - foreach ( $options as $value ) { |
|
290 | - if ( ! isset( $value['type'] ) ) { |
|
289 | + foreach ($options as $value) { |
|
290 | + if ( ! isset($value['type'])) { |
|
291 | 291 | continue; |
292 | 292 | } |
293 | 293 | |
294 | 294 | // Set title. |
295 | - $defaults['title'] = isset( $value['name'] ) ? $value['name'] : ''; |
|
295 | + $defaults['title'] = isset($value['name']) ? $value['name'] : ''; |
|
296 | 296 | |
297 | 297 | // Set default setting. |
298 | - $value = wp_parse_args( $value, $defaults ); |
|
298 | + $value = wp_parse_args($value, $defaults); |
|
299 | 299 | |
300 | 300 | // Colorpicker field. |
301 | - $value['class'] = ( 'colorpicker' === $value['type'] ? trim( $value['class'] ) . ' give-colorpicker' : $value['class'] ); |
|
302 | - $value['type'] = ( 'colorpicker' === $value['type'] ? 'text' : $value['type'] ); |
|
301 | + $value['class'] = ('colorpicker' === $value['type'] ? trim($value['class']).' give-colorpicker' : $value['class']); |
|
302 | + $value['type'] = ('colorpicker' === $value['type'] ? 'text' : $value['type']); |
|
303 | 303 | |
304 | 304 | |
305 | 305 | // Custom attribute handling. |
306 | 306 | $custom_attributes = array(); |
307 | 307 | |
308 | - if ( ! empty( $value['attributes'] ) && is_array( $value['attributes'] ) ) { |
|
309 | - foreach ( $value['attributes'] as $attribute => $attribute_value ) { |
|
310 | - $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"'; |
|
308 | + if ( ! empty($value['attributes']) && is_array($value['attributes'])) { |
|
309 | + foreach ($value['attributes'] as $attribute => $attribute_value) { |
|
310 | + $custom_attributes[] = esc_attr($attribute).'="'.esc_attr($attribute_value).'"'; |
|
311 | 311 | } |
312 | 312 | } |
313 | 313 | |
314 | 314 | // Description handling. |
315 | - $description = self::get_field_description( $value ); |
|
315 | + $description = self::get_field_description($value); |
|
316 | 316 | |
317 | 317 | // Switch based on type. |
318 | - switch ( $value['type'] ) { |
|
318 | + switch ($value['type']) { |
|
319 | 319 | |
320 | 320 | // Section Titles |
321 | 321 | case 'title': |
322 | - if ( ! empty( $value['title'] ) ) { |
|
323 | - echo '<div class="give-setting-tab-header give-setting-tab-header-' . $current_tab . '"><h2>' . self::get_field_title( $value ) . '</h2><hr></div>'; |
|
322 | + if ( ! empty($value['title'])) { |
|
323 | + echo '<div class="give-setting-tab-header give-setting-tab-header-'.$current_tab.'"><h2>'.self::get_field_title($value).'</h2><hr></div>'; |
|
324 | 324 | } |
325 | 325 | |
326 | - if ( ! empty( $value['desc'] ) ) { |
|
327 | - echo wpautop( wptexturize( wp_kses_post( $value['desc'] ) ) ); |
|
326 | + if ( ! empty($value['desc'])) { |
|
327 | + echo wpautop(wptexturize(wp_kses_post($value['desc']))); |
|
328 | 328 | } |
329 | 329 | |
330 | - if ( $value['table_html'] ) { |
|
331 | - echo '<table class="form-table give-setting-tab-body give-setting-tab-body-' . $current_tab . '">' . "\n\n"; |
|
330 | + if ($value['table_html']) { |
|
331 | + echo '<table class="form-table give-setting-tab-body give-setting-tab-body-'.$current_tab.'">'."\n\n"; |
|
332 | 332 | } |
333 | 333 | |
334 | - if ( ! empty( $value['id'] ) ) { |
|
334 | + if ( ! empty($value['id'])) { |
|
335 | 335 | |
336 | 336 | /** |
337 | 337 | * Trigger Action. |
@@ -340,14 +340,14 @@ discard block |
||
340 | 340 | * |
341 | 341 | * @since 1.8 |
342 | 342 | */ |
343 | - do_action( 'give_settings_' . sanitize_title( $value['id'] ) ); |
|
343 | + do_action('give_settings_'.sanitize_title($value['id'])); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | break; |
347 | 347 | |
348 | 348 | // Section Ends. |
349 | 349 | case 'sectionend': |
350 | - if ( ! empty( $value['id'] ) ) { |
|
350 | + if ( ! empty($value['id'])) { |
|
351 | 351 | |
352 | 352 | /** |
353 | 353 | * Trigger Action. |
@@ -356,14 +356,14 @@ discard block |
||
356 | 356 | * |
357 | 357 | * @since 1.8 |
358 | 358 | */ |
359 | - do_action( 'give_settings_' . sanitize_title( $value['id'] ) . '_end' ); |
|
359 | + do_action('give_settings_'.sanitize_title($value['id']).'_end'); |
|
360 | 360 | } |
361 | 361 | |
362 | - if ( $value['table_html'] ) { |
|
362 | + if ($value['table_html']) { |
|
363 | 363 | echo '</table>'; |
364 | 364 | } |
365 | 365 | |
366 | - if ( ! empty( $value['id'] ) ) { |
|
366 | + if ( ! empty($value['id'])) { |
|
367 | 367 | |
368 | 368 | /** |
369 | 369 | * Trigger Action. |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | * |
373 | 373 | * @since 1.8 |
374 | 374 | */ |
375 | - do_action( 'give_settings_' . sanitize_title( $value['id'] ) . '_after' ); |
|
375 | + do_action('give_settings_'.sanitize_title($value['id']).'_after'); |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | break; |
@@ -385,22 +385,22 @@ discard block |
||
385 | 385 | case 'password' : |
386 | 386 | |
387 | 387 | $type = $value['type']; |
388 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
388 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
389 | 389 | |
390 | 390 | ?> |
391 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
391 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
392 | 392 | <th scope="row" class="titledesc"> |
393 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
393 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
394 | 394 | </th> |
395 | - <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>"> |
|
395 | + <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>"> |
|
396 | 396 | <input |
397 | - name="<?php echo esc_attr( $value['id'] ); ?>" |
|
398 | - id="<?php echo esc_attr( $value['id'] ); ?>" |
|
399 | - type="<?php echo esc_attr( $type ); ?>" |
|
400 | - style="<?php echo esc_attr( $value['css'] ); ?>" |
|
401 | - value="<?php echo esc_attr( $option_value ); ?>" |
|
402 | - class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_attr( $value['class'] ) ); ?>" |
|
403 | - <?php echo implode( ' ', $custom_attributes ); ?> |
|
397 | + name="<?php echo esc_attr($value['id']); ?>" |
|
398 | + id="<?php echo esc_attr($value['id']); ?>" |
|
399 | + type="<?php echo esc_attr($type); ?>" |
|
400 | + style="<?php echo esc_attr($value['css']); ?>" |
|
401 | + value="<?php echo esc_attr($option_value); ?>" |
|
402 | + class="give-input-field<?php echo(empty($value['class']) ? '' : ' '.esc_attr($value['class'])); ?>" |
|
403 | + <?php echo implode(' ', $custom_attributes); ?> |
|
404 | 404 | /> <?php echo $description; ?> |
405 | 405 | </td> |
406 | 406 | </tr><?php |
@@ -409,23 +409,23 @@ discard block |
||
409 | 409 | // Textarea. |
410 | 410 | case 'textarea': |
411 | 411 | |
412 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
412 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
413 | 413 | |
414 | 414 | ?> |
415 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
415 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
416 | 416 | <th scope="row" class="titledesc"> |
417 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
417 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
418 | 418 | </th> |
419 | - <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>"> |
|
419 | + <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>"> |
|
420 | 420 | <textarea |
421 | - name="<?php echo esc_attr( $value['id'] ); ?>" |
|
422 | - id="<?php echo esc_attr( $value['id'] ); ?>" |
|
423 | - style="<?php echo esc_attr( $value['css'] ); ?>" |
|
424 | - class="<?php echo esc_attr( $value['class'] ); ?>" |
|
421 | + name="<?php echo esc_attr($value['id']); ?>" |
|
422 | + id="<?php echo esc_attr($value['id']); ?>" |
|
423 | + style="<?php echo esc_attr($value['css']); ?>" |
|
424 | + class="<?php echo esc_attr($value['class']); ?>" |
|
425 | 425 | rows="10" |
426 | 426 | cols="60" |
427 | - <?php echo implode( ' ', $custom_attributes ); ?> |
|
428 | - ><?php echo esc_textarea( $option_value ); ?></textarea> |
|
427 | + <?php echo implode(' ', $custom_attributes); ?> |
|
428 | + ><?php echo esc_textarea($option_value); ?></textarea> |
|
429 | 429 | <?php echo $description; ?> |
430 | 430 | </td> |
431 | 431 | </tr><?php |
@@ -435,35 +435,35 @@ discard block |
||
435 | 435 | case 'select' : |
436 | 436 | case 'multiselect' : |
437 | 437 | |
438 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
438 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
439 | 439 | |
440 | 440 | ?> |
441 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
441 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
442 | 442 | <th scope="row" class="titledesc"> |
443 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
443 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
444 | 444 | </th> |
445 | - <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>"> |
|
445 | + <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>"> |
|
446 | 446 | <select |
447 | - name="<?php echo esc_attr( $value['id'] ); ?><?php if ( $value['type'] == 'multiselect' ) { |
|
447 | + name="<?php echo esc_attr($value['id']); ?><?php if ($value['type'] == 'multiselect') { |
|
448 | 448 | echo '[]'; |
449 | 449 | } ?>" |
450 | - id="<?php echo esc_attr( $value['id'] ); ?>" |
|
451 | - style="<?php echo esc_attr( $value['css'] ); ?>" |
|
452 | - class="<?php echo esc_attr( $value['class'] ); ?>" |
|
453 | - <?php echo implode( ' ', $custom_attributes ); ?> |
|
454 | - <?php echo ( 'multiselect' == $value['type'] ) ? 'multiple="multiple"' : ''; ?> |
|
450 | + id="<?php echo esc_attr($value['id']); ?>" |
|
451 | + style="<?php echo esc_attr($value['css']); ?>" |
|
452 | + class="<?php echo esc_attr($value['class']); ?>" |
|
453 | + <?php echo implode(' ', $custom_attributes); ?> |
|
454 | + <?php echo ('multiselect' == $value['type']) ? 'multiple="multiple"' : ''; ?> |
|
455 | 455 | > |
456 | 456 | |
457 | 457 | <?php |
458 | - if ( ! empty( $value['options'] ) ) { |
|
459 | - foreach ( $value['options'] as $key => $val ) { |
|
458 | + if ( ! empty($value['options'])) { |
|
459 | + foreach ($value['options'] as $key => $val) { |
|
460 | 460 | ?> |
461 | - <option value="<?php echo esc_attr( $key ); ?>" <?php |
|
461 | + <option value="<?php echo esc_attr($key); ?>" <?php |
|
462 | 462 | |
463 | - if ( is_array( $option_value ) ) { |
|
464 | - selected( in_array( $key, $option_value ), true ); |
|
463 | + if (is_array($option_value)) { |
|
464 | + selected(in_array($key, $option_value), true); |
|
465 | 465 | } else { |
466 | - selected( $option_value, $key ); |
|
466 | + selected($option_value, $key); |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | ?>><?php echo $val ?></option> |
@@ -479,28 +479,28 @@ discard block |
||
479 | 479 | |
480 | 480 | // Radio inputs. |
481 | 481 | case 'radio_inline' : |
482 | - $value['class'] = empty( $value['class'] ) ? 'give-radio-inline' : $value['class'] . ' give-radio-inline'; |
|
482 | + $value['class'] = empty($value['class']) ? 'give-radio-inline' : $value['class'].' give-radio-inline'; |
|
483 | 483 | case 'radio' : |
484 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
484 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
485 | 485 | ?> |
486 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
486 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
487 | 487 | <th scope="row" class="titledesc"> |
488 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
488 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
489 | 489 | </th> |
490 | - <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo( ! empty( $value['class'] ) ? $value['class'] : '' ); ?>"> |
|
490 | + <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?> <?php echo( ! empty($value['class']) ? $value['class'] : ''); ?>"> |
|
491 | 491 | <fieldset> |
492 | 492 | <ul> |
493 | 493 | <?php |
494 | - foreach ( $value['options'] as $key => $val ) { |
|
494 | + foreach ($value['options'] as $key => $val) { |
|
495 | 495 | ?> |
496 | 496 | <li> |
497 | 497 | <label><input |
498 | - name="<?php echo esc_attr( $value['id'] ); ?>" |
|
498 | + name="<?php echo esc_attr($value['id']); ?>" |
|
499 | 499 | value="<?php echo $key; ?>" |
500 | 500 | type="radio" |
501 | - style="<?php echo esc_attr( $value['css'] ); ?>" |
|
502 | - <?php echo implode( ' ', $custom_attributes ); ?> |
|
503 | - <?php checked( $key, $option_value ); ?> |
|
501 | + style="<?php echo esc_attr($value['css']); ?>" |
|
502 | + <?php echo implode(' ', $custom_attributes); ?> |
|
503 | + <?php checked($key, $option_value); ?> |
|
504 | 504 | /> <?php echo $val ?></label> |
505 | 505 | </li> |
506 | 506 | <?php |
@@ -514,21 +514,21 @@ discard block |
||
514 | 514 | |
515 | 515 | // Checkbox input. |
516 | 516 | case 'checkbox' : |
517 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
517 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
518 | 518 | ?> |
519 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
519 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
520 | 520 | <th scope="row" class="titledesc"> |
521 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
521 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
522 | 522 | </th> |
523 | 523 | <td class="give-forminp"> |
524 | 524 | <input |
525 | - name="<?php echo esc_attr( $value['id'] ); ?>" |
|
526 | - id="<?php echo esc_attr( $value['id'] ); ?>" |
|
525 | + name="<?php echo esc_attr($value['id']); ?>" |
|
526 | + id="<?php echo esc_attr($value['id']); ?>" |
|
527 | 527 | type="checkbox" |
528 | - class="<?php echo esc_attr( isset( $value['class'] ) ? $value['class'] : '' ); ?>" |
|
528 | + class="<?php echo esc_attr(isset($value['class']) ? $value['class'] : ''); ?>" |
|
529 | 529 | value="1" |
530 | - <?php checked( $option_value, 'on' ); ?> |
|
531 | - <?php echo implode( ' ', $custom_attributes ); ?> |
|
530 | + <?php checked($option_value, 'on'); ?> |
|
531 | + <?php echo implode(' ', $custom_attributes); ?> |
|
532 | 532 | /> |
533 | 533 | <?php echo $description; ?> |
534 | 534 | </td> |
@@ -538,28 +538,28 @@ discard block |
||
538 | 538 | |
539 | 539 | // Multi Checkbox input. |
540 | 540 | case 'multicheck' : |
541 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
542 | - $option_value = is_array( $option_value ) ? $option_value : array(); |
|
541 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
542 | + $option_value = is_array($option_value) ? $option_value : array(); |
|
543 | 543 | ?> |
544 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
544 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
545 | 545 | <th scope="row" class="titledesc"> |
546 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
546 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
547 | 547 | </th> |
548 | - <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo( ! empty( $value['class'] ) ? $value['class'] : '' ); ?>"> |
|
548 | + <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?> <?php echo( ! empty($value['class']) ? $value['class'] : ''); ?>"> |
|
549 | 549 | <fieldset> |
550 | 550 | <ul> |
551 | 551 | <?php |
552 | - foreach ( $value['options'] as $key => $val ) { |
|
552 | + foreach ($value['options'] as $key => $val) { |
|
553 | 553 | ?> |
554 | 554 | <li> |
555 | 555 | <label> |
556 | 556 | <input |
557 | - name="<?php echo esc_attr( $value['id'] ); ?>[]" |
|
557 | + name="<?php echo esc_attr($value['id']); ?>[]" |
|
558 | 558 | value="<?php echo $key; ?>" |
559 | 559 | type="checkbox" |
560 | - style="<?php echo esc_attr( $value['css'] ); ?>" |
|
561 | - <?php echo implode( ' ', $custom_attributes ); ?> |
|
562 | - <?php if ( in_array( $key, $option_value ) ) { |
|
560 | + style="<?php echo esc_attr($value['css']); ?>" |
|
561 | + <?php echo implode(' ', $custom_attributes); ?> |
|
562 | + <?php if (in_array($key, $option_value)) { |
|
563 | 563 | echo 'checked="checked"'; |
564 | 564 | } ?> |
565 | 565 | /> <?php echo $val ?> |
@@ -578,35 +578,35 @@ discard block |
||
578 | 578 | // File input field. |
579 | 579 | case 'file' : |
580 | 580 | case 'media' : |
581 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
582 | - $button_label = esc_html__( sprintf( 'Add or Upload %s', ( 'file' === $value['type'] ? 'File' : 'Image' ) ), 'give' ); |
|
583 | - $fvalue = empty( $value['fvalue'] ) ? 'url' : $value['fvalue']; |
|
584 | - |
|
585 | - $allow_media_preview_tags = array( 'jpg', 'jpeg', 'png', 'gif', 'ico' ); |
|
586 | - $preview_image_src = $option_value ? ( 'id' === $fvalue ? wp_get_attachment_url( $option_value ) : $option_value ) : '#'; |
|
587 | - $preview_image_extension = $preview_image_src ? pathinfo( $preview_image_src, PATHINFO_EXTENSION ) : ''; |
|
588 | - $is_show_preview = in_array( $preview_image_extension, $allow_media_preview_tags ); |
|
581 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
582 | + $button_label = esc_html__(sprintf('Add or Upload %s', ('file' === $value['type'] ? 'File' : 'Image')), 'give'); |
|
583 | + $fvalue = empty($value['fvalue']) ? 'url' : $value['fvalue']; |
|
584 | + |
|
585 | + $allow_media_preview_tags = array('jpg', 'jpeg', 'png', 'gif', 'ico'); |
|
586 | + $preview_image_src = $option_value ? ('id' === $fvalue ? wp_get_attachment_url($option_value) : $option_value) : '#'; |
|
587 | + $preview_image_extension = $preview_image_src ? pathinfo($preview_image_src, PATHINFO_EXTENSION) : ''; |
|
588 | + $is_show_preview = in_array($preview_image_extension, $allow_media_preview_tags); |
|
589 | 589 | ?> |
590 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
590 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
591 | 591 | <th scope="row" class="titledesc"> |
592 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
592 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
593 | 593 | </th> |
594 | 594 | <td class="give-forminp"> |
595 | 595 | <div class="give-field-wrap"> |
596 | 596 | <label for="<?php echo $value['id'] ?>"> |
597 | 597 | <input |
598 | - name="<?php echo esc_attr( $value['id'] ); ?>" |
|
599 | - id="<?php echo esc_attr( $value['id'] ); ?>" |
|
598 | + name="<?php echo esc_attr($value['id']); ?>" |
|
599 | + id="<?php echo esc_attr($value['id']); ?>" |
|
600 | 600 | type="text" |
601 | - class="give-input-field<?php echo esc_attr( isset( $value['class'] ) ? ' ' . $value['class'] : '' ); ?>" |
|
601 | + class="give-input-field<?php echo esc_attr(isset($value['class']) ? ' '.$value['class'] : ''); ?>" |
|
602 | 602 | value="<?php echo $option_value; ?>" |
603 | - style="<?php echo esc_attr( $value['css'] ); ?>" |
|
604 | - <?php echo implode( ' ', $custom_attributes ); ?> |
|
603 | + style="<?php echo esc_attr($value['css']); ?>" |
|
604 | + <?php echo implode(' ', $custom_attributes); ?> |
|
605 | 605 | /> <input class="give-upload-button button" type="button" data-fvalue="<?php echo $fvalue; ?>" data-field-type="<?php echo $value['type']; ?>" value="<?php echo $button_label; ?>"> |
606 | 606 | <?php echo $description ?> |
607 | 607 | <div class="give-image-thumb<?php echo ! $option_value || ! $is_show_preview ? ' give-hidden' : ''; ?>"> |
608 | 608 | <span class="give-delete-image-thumb dashicons dashicons-no-alt"></span> |
609 | - <img src="<?php echo $preview_image_src ; ?>" alt=""> |
|
609 | + <img src="<?php echo $preview_image_src; ?>" alt=""> |
|
610 | 610 | </div> |
611 | 611 | </label> |
612 | 612 | </div> |
@@ -618,17 +618,17 @@ discard block |
||
618 | 618 | // WordPress Editor. |
619 | 619 | case 'wysiwyg' : |
620 | 620 | // Get option value. |
621 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
621 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
622 | 622 | |
623 | 623 | // Get editor settings. |
624 | - $editor_settings = ! empty( $value['options'] ) ? $value['options'] : array(); |
|
624 | + $editor_settings = ! empty($value['options']) ? $value['options'] : array(); |
|
625 | 625 | ?> |
626 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
626 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
627 | 627 | <th scope="row" class="titledesc"> |
628 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
628 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
629 | 629 | </th> |
630 | 630 | <td class="give-forminp"> |
631 | - <?php wp_editor( $option_value, $value['id'], $editor_settings ); ?> |
|
631 | + <?php wp_editor($option_value, $value['id'], $editor_settings); ?> |
|
632 | 632 | <?php echo $description; ?> |
633 | 633 | </td> |
634 | 634 | </tr><?php |
@@ -637,9 +637,9 @@ discard block |
||
637 | 637 | // Custom: System setting field. |
638 | 638 | case 'system_info' : |
639 | 639 | ?> |
640 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
640 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
641 | 641 | <th scope="row" class="titledesc"> |
642 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
642 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
643 | 643 | </th> |
644 | 644 | <td class="give-forminp"> |
645 | 645 | <?php give_system_info_callback(); ?> |
@@ -650,14 +650,14 @@ discard block |
||
650 | 650 | |
651 | 651 | // Custom: Default gateways setting field. |
652 | 652 | case 'default_gateway' : |
653 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
653 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
654 | 654 | ?> |
655 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
655 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
656 | 656 | <th scope="row" class="titledesc"> |
657 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
657 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
658 | 658 | </th> |
659 | 659 | <td class="give-forminp"> |
660 | - <?php give_default_gateway_callback( $value, $option_value ); ?> |
|
660 | + <?php give_default_gateway_callback($value, $option_value); ?> |
|
661 | 661 | <?php echo $description; ?> |
662 | 662 | </td> |
663 | 663 | </tr><?php |
@@ -665,14 +665,14 @@ discard block |
||
665 | 665 | |
666 | 666 | // Custom: Enable gateways setting field. |
667 | 667 | case 'enabled_gateways' : |
668 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
668 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
669 | 669 | ?> |
670 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
670 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
671 | 671 | <th scope="row" class="titledesc"> |
672 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
672 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
673 | 673 | </th> |
674 | 674 | <td class="give-forminp"> |
675 | - <?php give_enabled_gateways_callback( $value, $option_value ); ?> |
|
675 | + <?php give_enabled_gateways_callback($value, $option_value); ?> |
|
676 | 676 | <?php echo $description; ?> |
677 | 677 | </td> |
678 | 678 | </tr><?php |
@@ -681,9 +681,9 @@ discard block |
||
681 | 681 | // Custom: Email preview buttons field. |
682 | 682 | case 'email_preview_buttons' : |
683 | 683 | ?> |
684 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
684 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
685 | 685 | <th scope="row" class="titledesc"> |
686 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
686 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
687 | 687 | </th> |
688 | 688 | <td class="give-forminp"> |
689 | 689 | <?php give_email_preview_buttons_callback(); ?> |
@@ -700,22 +700,22 @@ discard block |
||
700 | 700 | |
701 | 701 | // Custom: Gateway API key. |
702 | 702 | case 'api_key' : |
703 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
704 | - $type = ! empty( $option_value ) ? 'password' : 'text'; |
|
703 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
704 | + $type = ! empty($option_value) ? 'password' : 'text'; |
|
705 | 705 | ?> |
706 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
706 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
707 | 707 | <th scope="row" class="titledesc"> |
708 | - <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label> |
|
708 | + <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label> |
|
709 | 709 | </th> |
710 | - <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>"> |
|
710 | + <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>"> |
|
711 | 711 | <input |
712 | - name="<?php echo esc_attr( $value['id'] ); ?>" |
|
713 | - id="<?php echo esc_attr( $value['id'] ); ?>" |
|
714 | - type="<?php echo esc_attr( $type ); ?>" |
|
715 | - style="<?php echo esc_attr( $value['css'] ); ?>" |
|
716 | - value="<?php echo esc_attr( trim( $option_value ) ); ?>" |
|
717 | - class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_attr( $value['class'] ) ); ?>" |
|
718 | - <?php echo implode( ' ', $custom_attributes ); ?> |
|
712 | + name="<?php echo esc_attr($value['id']); ?>" |
|
713 | + id="<?php echo esc_attr($value['id']); ?>" |
|
714 | + type="<?php echo esc_attr($type); ?>" |
|
715 | + style="<?php echo esc_attr($value['css']); ?>" |
|
716 | + value="<?php echo esc_attr(trim($option_value)); ?>" |
|
717 | + class="give-input-field<?php echo(empty($value['class']) ? '' : ' '.esc_attr($value['class'])); ?>" |
|
718 | + <?php echo implode(' ', $custom_attributes); ?> |
|
719 | 719 | /> <?php echo $description; ?> |
720 | 720 | </td> |
721 | 721 | </tr><?php |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | * |
733 | 733 | * @since 1.0 |
734 | 734 | */ |
735 | - do_action( "give_logs_view_{$current_section}" ); |
|
735 | + do_action("give_logs_view_{$current_section}"); |
|
736 | 736 | |
737 | 737 | echo $description; |
738 | 738 | break; |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | // Custom: Data field. |
741 | 741 | case 'data' : |
742 | 742 | |
743 | - include GIVE_PLUGIN_DIR . 'includes/admin/tools/views/html-admin-page-data.php'; |
|
743 | + include GIVE_PLUGIN_DIR.'includes/admin/tools/views/html-admin-page-data.php'; |
|
744 | 744 | |
745 | 745 | echo $description; |
746 | 746 | break; |
@@ -748,12 +748,12 @@ discard block |
||
748 | 748 | // Custom: Give Docs Link field type. |
749 | 749 | case 'give_docs_link' : |
750 | 750 | ?> |
751 | - <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>> |
|
751 | + <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>> |
|
752 | 752 | <td class="give-docs-link" colspan="2"> |
753 | 753 | <?php |
754 | - echo '<p class="give-docs-link"><a href="' . esc_url( $value['url'] ) |
|
754 | + echo '<p class="give-docs-link"><a href="'.esc_url($value['url']) |
|
755 | 755 | . '" target="_blank">' |
756 | - . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $value['title'] ) |
|
756 | + . sprintf(esc_html__('Need Help? See docs on "%s"', 'give'), $value['title']) |
|
757 | 757 | . '<span class="dashicons dashicons-editor-help"></span></a></p>'; |
758 | 758 | ?> |
759 | 759 | </td> |
@@ -764,8 +764,8 @@ discard block |
||
764 | 764 | // You can add or handle your custom field action. |
765 | 765 | default: |
766 | 766 | // Get option value. |
767 | - $option_value = self::get_option( $option_name, $value['id'], $value['default'] ); |
|
768 | - do_action( 'give_admin_field_' . $value['type'], $value, $option_value ); |
|
767 | + $option_value = self::get_option($option_name, $value['id'], $value['default']); |
|
768 | + do_action('give_admin_field_'.$value['type'], $value, $option_value); |
|
769 | 769 | break; |
770 | 770 | } |
771 | 771 | } |
@@ -781,15 +781,15 @@ discard block |
||
781 | 781 | * |
782 | 782 | * @return string The HTML description of the field. |
783 | 783 | */ |
784 | - public static function get_field_description( $value ) { |
|
784 | + public static function get_field_description($value) { |
|
785 | 785 | $description = ''; |
786 | 786 | |
787 | 787 | // Support for both 'description' and 'desc' args. |
788 | - $description_key = isset( $value['description'] ) ? 'description' : 'desc'; |
|
789 | - $value = ( isset( $value[ $description_key ] ) && ! empty( $value[ $description_key ] ) ) ? $value[ $description_key ] : ''; |
|
788 | + $description_key = isset($value['description']) ? 'description' : 'desc'; |
|
789 | + $value = (isset($value[$description_key]) && ! empty($value[$description_key])) ? $value[$description_key] : ''; |
|
790 | 790 | |
791 | - if ( ! empty( $value ) ) { |
|
792 | - $description = '<p class="give-field-description">' . wp_kses_post( $value ) . '</p>'; |
|
791 | + if ( ! empty($value)) { |
|
792 | + $description = '<p class="give-field-description">'.wp_kses_post($value).'</p>'; |
|
793 | 793 | } |
794 | 794 | |
795 | 795 | return $description; |
@@ -806,11 +806,11 @@ discard block |
||
806 | 806 | * |
807 | 807 | * @return array The description and tip as a 2 element array |
808 | 808 | */ |
809 | - public static function get_field_title( $value ) { |
|
810 | - $title = esc_html( $value['title'] ); |
|
809 | + public static function get_field_title($value) { |
|
810 | + $title = esc_html($value['title']); |
|
811 | 811 | |
812 | 812 | // If html tag detected then allow them to print. |
813 | - if ( strip_tags( $title ) ) { |
|
813 | + if (strip_tags($title)) { |
|
814 | 814 | $title = $value['title']; |
815 | 815 | } |
816 | 816 | |
@@ -829,8 +829,8 @@ discard block |
||
829 | 829 | * |
830 | 830 | * @return bool |
831 | 831 | */ |
832 | - public static function save_fields( $options, $option_name = '' ) { |
|
833 | - if ( empty( $_POST ) ) { |
|
832 | + public static function save_fields($options, $option_name = '') { |
|
833 | + if (empty($_POST)) { |
|
834 | 834 | return false; |
835 | 835 | } |
836 | 836 | |
@@ -838,37 +838,37 @@ discard block |
||
838 | 838 | $update_options = array(); |
839 | 839 | |
840 | 840 | // Loop options and get values to save. |
841 | - foreach ( $options as $option ) { |
|
842 | - if ( ! isset( $option['id'] ) || ! isset( $option['type'] ) ) { |
|
841 | + foreach ($options as $option) { |
|
842 | + if ( ! isset($option['id']) || ! isset($option['type'])) { |
|
843 | 843 | continue; |
844 | 844 | } |
845 | 845 | |
846 | 846 | // Get posted value. |
847 | - if ( strstr( $option['id'], '[' ) ) { |
|
848 | - parse_str( $option['id'], $option_name_array ); |
|
849 | - $field_option_name = current( array_keys( $option_name_array ) ); |
|
850 | - $setting_name = key( $option_name_array[ $field_option_name ] ); |
|
851 | - $raw_value = isset( $_POST[ $field_option_name ][ $setting_name ] ) ? wp_unslash( $_POST[ $field_option_name ][ $setting_name ] ) : null; |
|
847 | + if (strstr($option['id'], '[')) { |
|
848 | + parse_str($option['id'], $option_name_array); |
|
849 | + $field_option_name = current(array_keys($option_name_array)); |
|
850 | + $setting_name = key($option_name_array[$field_option_name]); |
|
851 | + $raw_value = isset($_POST[$field_option_name][$setting_name]) ? wp_unslash($_POST[$field_option_name][$setting_name]) : null; |
|
852 | 852 | } else { |
853 | 853 | $field_option_name = $option['id']; |
854 | 854 | $setting_name = ''; |
855 | - $raw_value = isset( $_POST[ $option['id'] ] ) ? wp_unslash( $_POST[ $option['id'] ] ) : null; |
|
855 | + $raw_value = isset($_POST[$option['id']]) ? wp_unslash($_POST[$option['id']]) : null; |
|
856 | 856 | } |
857 | 857 | |
858 | 858 | // Format the value based on option type. |
859 | - switch ( $option['type'] ) { |
|
859 | + switch ($option['type']) { |
|
860 | 860 | case 'checkbox' : |
861 | - $value = is_null( $raw_value ) ? '' : 'on'; |
|
861 | + $value = is_null($raw_value) ? '' : 'on'; |
|
862 | 862 | break; |
863 | 863 | case 'wysiwyg' : |
864 | 864 | case 'textarea' : |
865 | - $value = wp_kses_post( trim( $raw_value ) ); |
|
865 | + $value = wp_kses_post(trim($raw_value)); |
|
866 | 866 | break; |
867 | 867 | case 'multiselect' : |
868 | - $value = array_filter( array_map( 'give_clean', (array) $raw_value ) ); |
|
868 | + $value = array_filter(array_map('give_clean', (array) $raw_value)); |
|
869 | 869 | break; |
870 | 870 | default : |
871 | - $value = give_clean( $raw_value ); |
|
871 | + $value = give_clean($raw_value); |
|
872 | 872 | break; |
873 | 873 | } |
874 | 874 | |
@@ -877,37 +877,37 @@ discard block |
||
877 | 877 | * |
878 | 878 | * @since 1.8 |
879 | 879 | */ |
880 | - $value = apply_filters( 'give_admin_settings_sanitize_option', $value, $option, $raw_value ); |
|
880 | + $value = apply_filters('give_admin_settings_sanitize_option', $value, $option, $raw_value); |
|
881 | 881 | |
882 | 882 | /** |
883 | 883 | * Sanitize the value of an option by option name. |
884 | 884 | * |
885 | 885 | * @since 1.8 |
886 | 886 | */ |
887 | - $value = apply_filters( "give_admin_settings_sanitize_option_{$field_option_name}", $value, $option, $raw_value ); |
|
887 | + $value = apply_filters("give_admin_settings_sanitize_option_{$field_option_name}", $value, $option, $raw_value); |
|
888 | 888 | |
889 | - if ( is_null( $value ) ) { |
|
889 | + if (is_null($value)) { |
|
890 | 890 | continue; |
891 | 891 | } |
892 | 892 | |
893 | 893 | // Check if option is an array and handle that differently to single values. |
894 | - if ( $field_option_name && $setting_name ) { |
|
895 | - if ( ! isset( $update_options[ $field_option_name ] ) ) { |
|
896 | - $update_options[ $field_option_name ] = get_option( $field_option_name, array() ); |
|
894 | + if ($field_option_name && $setting_name) { |
|
895 | + if ( ! isset($update_options[$field_option_name])) { |
|
896 | + $update_options[$field_option_name] = get_option($field_option_name, array()); |
|
897 | 897 | } |
898 | - if ( ! is_array( $update_options[ $field_option_name ] ) ) { |
|
899 | - $update_options[ $field_option_name ] = array(); |
|
898 | + if ( ! is_array($update_options[$field_option_name])) { |
|
899 | + $update_options[$field_option_name] = array(); |
|
900 | 900 | } |
901 | - $update_options[ $field_option_name ][ $setting_name ] = $value; |
|
901 | + $update_options[$field_option_name][$setting_name] = $value; |
|
902 | 902 | } else { |
903 | - $update_options[ $field_option_name ] = $value; |
|
903 | + $update_options[$field_option_name] = $value; |
|
904 | 904 | } |
905 | 905 | } |
906 | 906 | |
907 | 907 | // Save all options in our array or there own option name i.e. option id. |
908 | - if ( empty( $option_name ) ) { |
|
909 | - foreach ( $update_options as $name => $value ) { |
|
910 | - update_option( $name, $value ); |
|
908 | + if (empty($option_name)) { |
|
909 | + foreach ($update_options as $name => $value) { |
|
910 | + update_option($name, $value); |
|
911 | 911 | |
912 | 912 | /** |
913 | 913 | * Trigger action. |
@@ -916,13 +916,13 @@ discard block |
||
916 | 916 | * |
917 | 917 | * @since 1.8 |
918 | 918 | */ |
919 | - do_action( "give_save_option_{$name}", $value, $name ); |
|
919 | + do_action("give_save_option_{$name}", $value, $name); |
|
920 | 920 | } |
921 | 921 | } else { |
922 | - $old_options = ( $old_options = get_option( $option_name ) ) ? $old_options : array(); |
|
923 | - $update_options = array_merge( $old_options, $update_options ); |
|
922 | + $old_options = ($old_options = get_option($option_name)) ? $old_options : array(); |
|
923 | + $update_options = array_merge($old_options, $update_options); |
|
924 | 924 | |
925 | - update_option( $option_name, $update_options ); |
|
925 | + update_option($option_name, $update_options); |
|
926 | 926 | |
927 | 927 | /** |
928 | 928 | * Trigger action. |
@@ -931,7 +931,7 @@ discard block |
||
931 | 931 | * |
932 | 932 | * @since 1.8 |
933 | 933 | */ |
934 | - do_action( "give_save_settings_{$option_name}", $update_options, $option_name ); |
|
934 | + do_action("give_save_settings_{$option_name}", $update_options, $option_name); |
|
935 | 935 | } |
936 | 936 | |
937 | 937 | return true; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | // Exit if accessed directly. |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
@@ -26,26 +26,26 @@ discard block |
||
26 | 26 | function give_test_ajax_works() { |
27 | 27 | |
28 | 28 | // Check if the Airplane Mode plugin is installed. |
29 | - if ( class_exists( 'Airplane_Mode_Core' ) ) { |
|
29 | + if (class_exists('Airplane_Mode_Core')) { |
|
30 | 30 | |
31 | 31 | $airplane = Airplane_Mode_Core::getInstance(); |
32 | 32 | |
33 | - if ( method_exists( $airplane, 'enabled' ) ) { |
|
33 | + if (method_exists($airplane, 'enabled')) { |
|
34 | 34 | |
35 | - if ( $airplane->enabled() ) { |
|
35 | + if ($airplane->enabled()) { |
|
36 | 36 | return true; |
37 | 37 | } |
38 | 38 | } else { |
39 | 39 | |
40 | - if ( 'on' === $airplane->check_status() ) { |
|
40 | + if ('on' === $airplane->check_status()) { |
|
41 | 41 | return true; |
42 | 42 | } |
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
46 | - add_filter( 'block_local_requests', '__return_false' ); |
|
46 | + add_filter('block_local_requests', '__return_false'); |
|
47 | 47 | |
48 | - if ( Give_Cache::get( '_give_ajax_works', true ) ) { |
|
48 | + if (Give_Cache::get('_give_ajax_works', true)) { |
|
49 | 49 | return true; |
50 | 50 | } |
51 | 51 | |
@@ -57,35 +57,35 @@ discard block |
||
57 | 57 | ), |
58 | 58 | ); |
59 | 59 | |
60 | - $ajax = wp_remote_post( give_get_ajax_url(), $params ); |
|
60 | + $ajax = wp_remote_post(give_get_ajax_url(), $params); |
|
61 | 61 | |
62 | 62 | $works = true; |
63 | 63 | |
64 | - if ( is_wp_error( $ajax ) ) { |
|
64 | + if (is_wp_error($ajax)) { |
|
65 | 65 | |
66 | 66 | $works = false; |
67 | 67 | |
68 | 68 | } else { |
69 | 69 | |
70 | - if ( empty( $ajax['response'] ) ) { |
|
70 | + if (empty($ajax['response'])) { |
|
71 | 71 | $works = false; |
72 | 72 | } |
73 | 73 | |
74 | - if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) { |
|
74 | + if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) { |
|
75 | 75 | $works = false; |
76 | 76 | } |
77 | 77 | |
78 | - if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) { |
|
78 | + if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) { |
|
79 | 79 | $works = false; |
80 | 80 | } |
81 | 81 | |
82 | - if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) { |
|
82 | + if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) { |
|
83 | 83 | $works = false; |
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | - if ( $works ) { |
|
88 | - Give_Cache::set( '_give_ajax_works', '1', DAY_IN_SECONDS, true ); |
|
87 | + if ($works) { |
|
88 | + Give_Cache::set('_give_ajax_works', '1', DAY_IN_SECONDS, true); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | return $works; |
@@ -100,16 +100,16 @@ discard block |
||
100 | 100 | * @return string |
101 | 101 | */ |
102 | 102 | function give_get_ajax_url() { |
103 | - $scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin'; |
|
103 | + $scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin'; |
|
104 | 104 | |
105 | 105 | $current_url = give_get_current_page_url(); |
106 | - $ajax_url = admin_url( 'admin-ajax.php', $scheme ); |
|
106 | + $ajax_url = admin_url('admin-ajax.php', $scheme); |
|
107 | 107 | |
108 | - if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) { |
|
109 | - $ajax_url = preg_replace( '/^http/', 'https', $ajax_url ); |
|
108 | + if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) { |
|
109 | + $ajax_url = preg_replace('/^http/', 'https', $ajax_url); |
|
110 | 110 | } |
111 | 111 | |
112 | - return apply_filters( 'give_ajax_url', $ajax_url ); |
|
112 | + return apply_filters('give_ajax_url', $ajax_url); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -125,12 +125,12 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @since 1.7 |
127 | 127 | */ |
128 | - do_action( 'give_donation_form_login_fields' ); |
|
128 | + do_action('give_donation_form_login_fields'); |
|
129 | 129 | |
130 | 130 | give_die(); |
131 | 131 | } |
132 | 132 | |
133 | -add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' ); |
|
133 | +add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields'); |
|
134 | 134 | |
135 | 135 | /** |
136 | 136 | * Load Checkout Fields |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @return void |
141 | 141 | */ |
142 | 142 | function give_load_checkout_fields() { |
143 | - $form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : ''; |
|
143 | + $form_id = isset($_POST['form_id']) ? $_POST['form_id'] : ''; |
|
144 | 144 | |
145 | 145 | ob_start(); |
146 | 146 | |
@@ -149,18 +149,18 @@ discard block |
||
149 | 149 | * |
150 | 150 | * @since 1.7 |
151 | 151 | */ |
152 | - do_action( 'give_donation_form_register_login_fields', $form_id ); |
|
152 | + do_action('give_donation_form_register_login_fields', $form_id); |
|
153 | 153 | |
154 | 154 | $fields = ob_get_clean(); |
155 | 155 | |
156 | - wp_send_json( array( |
|
157 | - 'fields' => wp_json_encode( $fields ), |
|
158 | - 'submit' => wp_json_encode( give_get_donation_form_submit_button( $form_id ) ), |
|
159 | - ) ); |
|
156 | + wp_send_json(array( |
|
157 | + 'fields' => wp_json_encode($fields), |
|
158 | + 'submit' => wp_json_encode(give_get_donation_form_submit_button($form_id)), |
|
159 | + )); |
|
160 | 160 | } |
161 | 161 | |
162 | -add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' ); |
|
163 | -add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' ); |
|
162 | +add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields'); |
|
163 | +add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields'); |
|
164 | 164 | |
165 | 165 | /** |
166 | 166 | * Get Form Title via AJAX (used only in WordPress Admin) |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | * @return void |
171 | 171 | */ |
172 | 172 | function give_ajax_get_form_title() { |
173 | - if ( isset( $_POST['form_id'] ) ) { |
|
174 | - $title = get_the_title( $_POST['form_id'] ); |
|
175 | - if ( $title ) { |
|
173 | + if (isset($_POST['form_id'])) { |
|
174 | + $title = get_the_title($_POST['form_id']); |
|
175 | + if ($title) { |
|
176 | 176 | echo $title; |
177 | 177 | } else { |
178 | 178 | echo 'fail'; |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | give_die(); |
182 | 182 | } |
183 | 183 | |
184 | -add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' ); |
|
185 | -add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' ); |
|
184 | +add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title'); |
|
185 | +add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title'); |
|
186 | 186 | |
187 | 187 | /** |
188 | 188 | * Retrieve a states drop down |
@@ -195,26 +195,26 @@ discard block |
||
195 | 195 | $states_found = false; |
196 | 196 | $show_field = true; |
197 | 197 | // Get the Country code from the $_POST. |
198 | - $country = sanitize_text_field( $_POST['country'] ); |
|
198 | + $country = sanitize_text_field($_POST['country']); |
|
199 | 199 | |
200 | 200 | // Get the field name from the $_POST. |
201 | - $field_name = sanitize_text_field( $_POST['field_name'] ); |
|
201 | + $field_name = sanitize_text_field($_POST['field_name']); |
|
202 | 202 | |
203 | - if ( empty( $country ) ) { |
|
203 | + if (empty($country)) { |
|
204 | 204 | $country = give_get_country(); |
205 | 205 | } |
206 | 206 | |
207 | - $states = give_get_states( $country ); |
|
208 | - if ( ! empty( $states ) ) { |
|
207 | + $states = give_get_states($country); |
|
208 | + if ( ! empty($states)) { |
|
209 | 209 | $args = array( |
210 | 210 | 'name' => $field_name, |
211 | 211 | 'id' => $field_name, |
212 | - 'class' => $field_name . ' give-select', |
|
212 | + 'class' => $field_name.' give-select', |
|
213 | 213 | 'options' => $states, |
214 | 214 | 'show_option_all' => false, |
215 | 215 | 'show_option_none' => false, |
216 | 216 | ); |
217 | - $data = Give()->html->select( $args ); |
|
217 | + $data = Give()->html->select($args); |
|
218 | 218 | $states_found = true; |
219 | 219 | } else { |
220 | 220 | $data = 'nostates'; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $no_states_country = give_no_states_country_list(); |
224 | 224 | |
225 | 225 | // Check if $country code exists in the array key. |
226 | - if ( array_key_exists( $country, $no_states_country ) ) { |
|
226 | + if (array_key_exists($country, $no_states_country)) { |
|
227 | 227 | $show_field = false; |
228 | 228 | } |
229 | 229 | } |
@@ -233,10 +233,10 @@ discard block |
||
233 | 233 | 'show_field' => $show_field, |
234 | 234 | 'data' => $data, |
235 | 235 | ); |
236 | - wp_send_json( $response ); |
|
236 | + wp_send_json($response); |
|
237 | 237 | } |
238 | -add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' ); |
|
239 | -add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' ); |
|
238 | +add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field'); |
|
239 | +add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field'); |
|
240 | 240 | |
241 | 241 | /** |
242 | 242 | * Retrieve donation forms via AJAX for chosen dropdown search field. |
@@ -248,19 +248,19 @@ discard block |
||
248 | 248 | function give_ajax_form_search() { |
249 | 249 | global $wpdb; |
250 | 250 | |
251 | - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); |
|
252 | - $excludes = ( isset( $_GET['current_id'] ) ? (array) $_GET['current_id'] : array() ); |
|
251 | + $search = esc_sql(sanitize_text_field($_GET['s'])); |
|
252 | + $excludes = (isset($_GET['current_id']) ? (array) $_GET['current_id'] : array()); |
|
253 | 253 | |
254 | 254 | $results = array(); |
255 | - if ( current_user_can( 'edit_give_forms' ) ) { |
|
256 | - $items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" ); |
|
255 | + if (current_user_can('edit_give_forms')) { |
|
256 | + $items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50"); |
|
257 | 257 | } else { |
258 | - $items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50" ); |
|
258 | + $items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50"); |
|
259 | 259 | } |
260 | 260 | |
261 | - if ( $items ) { |
|
261 | + if ($items) { |
|
262 | 262 | |
263 | - foreach ( $items as $item ) { |
|
263 | + foreach ($items as $item) { |
|
264 | 264 | |
265 | 265 | $results[] = array( |
266 | 266 | 'id' => $item->ID, |
@@ -271,18 +271,18 @@ discard block |
||
271 | 271 | |
272 | 272 | $items[] = array( |
273 | 273 | 'id' => 0, |
274 | - 'name' => __( 'No forms found.', 'give' ), |
|
274 | + 'name' => __('No forms found.', 'give'), |
|
275 | 275 | ); |
276 | 276 | |
277 | 277 | } |
278 | 278 | |
279 | - echo json_encode( $results ); |
|
279 | + echo json_encode($results); |
|
280 | 280 | |
281 | 281 | give_die(); |
282 | 282 | } |
283 | 283 | |
284 | -add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' ); |
|
285 | -add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' ); |
|
284 | +add_action('wp_ajax_give_form_search', 'give_ajax_form_search'); |
|
285 | +add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search'); |
|
286 | 286 | |
287 | 287 | /** |
288 | 288 | * Search the donors database via Ajax |
@@ -294,38 +294,38 @@ discard block |
||
294 | 294 | function give_ajax_donor_search() { |
295 | 295 | global $wpdb; |
296 | 296 | |
297 | - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); |
|
297 | + $search = esc_sql(sanitize_text_field($_GET['s'])); |
|
298 | 298 | $results = array(); |
299 | - if ( ! current_user_can( 'view_give_reports' ) ) { |
|
299 | + if ( ! current_user_can('view_give_reports')) { |
|
300 | 300 | $donors = array(); |
301 | 301 | } else { |
302 | - $donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" ); |
|
302 | + $donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50"); |
|
303 | 303 | } |
304 | 304 | |
305 | - if ( $donors ) { |
|
305 | + if ($donors) { |
|
306 | 306 | |
307 | - foreach ( $donors as $donor ) { |
|
307 | + foreach ($donors as $donor) { |
|
308 | 308 | |
309 | 309 | $results[] = array( |
310 | 310 | 'id' => $donor->id, |
311 | - 'name' => $donor->name . ' (' . $donor->email . ')', |
|
311 | + 'name' => $donor->name.' ('.$donor->email.')', |
|
312 | 312 | ); |
313 | 313 | } |
314 | 314 | } else { |
315 | 315 | |
316 | 316 | $donors[] = array( |
317 | 317 | 'id' => 0, |
318 | - 'name' => __( 'No donors found.', 'give' ), |
|
318 | + 'name' => __('No donors found.', 'give'), |
|
319 | 319 | ); |
320 | 320 | |
321 | 321 | } |
322 | 322 | |
323 | - echo json_encode( $results ); |
|
323 | + echo json_encode($results); |
|
324 | 324 | |
325 | 325 | give_die(); |
326 | 326 | } |
327 | 327 | |
328 | -add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' ); |
|
328 | +add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search'); |
|
329 | 329 | |
330 | 330 | |
331 | 331 | /** |
@@ -337,39 +337,39 @@ discard block |
||
337 | 337 | */ |
338 | 338 | function give_ajax_search_users() { |
339 | 339 | |
340 | - if ( current_user_can( 'manage_give_settings' ) ) { |
|
340 | + if (current_user_can('manage_give_settings')) { |
|
341 | 341 | |
342 | - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); |
|
342 | + $search = esc_sql(sanitize_text_field($_GET['s'])); |
|
343 | 343 | |
344 | 344 | $get_users_args = array( |
345 | 345 | 'number' => 9999, |
346 | - 'search' => $search . '*', |
|
346 | + 'search' => $search.'*', |
|
347 | 347 | ); |
348 | 348 | |
349 | - $get_users_args = apply_filters( 'give_search_users_args', $get_users_args ); |
|
349 | + $get_users_args = apply_filters('give_search_users_args', $get_users_args); |
|
350 | 350 | |
351 | - $found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search ); |
|
351 | + $found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search); |
|
352 | 352 | $results = array(); |
353 | 353 | |
354 | - if ( $found_users ) { |
|
354 | + if ($found_users) { |
|
355 | 355 | |
356 | - foreach ( $found_users as $user ) { |
|
356 | + foreach ($found_users as $user) { |
|
357 | 357 | |
358 | 358 | $results[] = array( |
359 | 359 | 'id' => $user->ID, |
360 | - 'name' => esc_html( $user->user_login . ' (' . $user->user_email . ')' ), |
|
360 | + 'name' => esc_html($user->user_login.' ('.$user->user_email.')'), |
|
361 | 361 | ); |
362 | 362 | } |
363 | 363 | } else { |
364 | 364 | |
365 | 365 | $results[] = array( |
366 | 366 | 'id' => 0, |
367 | - 'name' => __( 'No users found.', 'give' ), |
|
367 | + 'name' => __('No users found.', 'give'), |
|
368 | 368 | ); |
369 | 369 | |
370 | 370 | } |
371 | 371 | |
372 | - echo json_encode( $results ); |
|
372 | + echo json_encode($results); |
|
373 | 373 | |
374 | 374 | }// End if(). |
375 | 375 | |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | |
378 | 378 | } |
379 | 379 | |
380 | -add_action( 'wp_ajax_give_user_search', 'give_ajax_search_users' ); |
|
380 | +add_action('wp_ajax_give_user_search', 'give_ajax_search_users'); |
|
381 | 381 | |
382 | 382 | |
383 | 383 | /** |
@@ -389,32 +389,32 @@ discard block |
||
389 | 389 | */ |
390 | 390 | function give_check_for_form_price_variations() { |
391 | 391 | |
392 | - if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) { |
|
393 | - die( '-1' ); |
|
392 | + if ( ! current_user_can('edit_give_forms', get_current_user_id())) { |
|
393 | + die('-1'); |
|
394 | 394 | } |
395 | 395 | |
396 | - $form_id = intval( $_POST['form_id'] ); |
|
397 | - $form = get_post( $form_id ); |
|
396 | + $form_id = intval($_POST['form_id']); |
|
397 | + $form = get_post($form_id); |
|
398 | 398 | |
399 | - if ( 'give_forms' != $form->post_type ) { |
|
400 | - die( '-2' ); |
|
399 | + if ('give_forms' != $form->post_type) { |
|
400 | + die('-2'); |
|
401 | 401 | } |
402 | 402 | |
403 | - if ( give_has_variable_prices( $form_id ) ) { |
|
404 | - $variable_prices = give_get_variable_prices( $form_id ); |
|
403 | + if (give_has_variable_prices($form_id)) { |
|
404 | + $variable_prices = give_get_variable_prices($form_id); |
|
405 | 405 | |
406 | - if ( $variable_prices ) { |
|
406 | + if ($variable_prices) { |
|
407 | 407 | $ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">'; |
408 | 408 | |
409 | - if ( isset( $_POST['all_prices'] ) ) { |
|
410 | - $ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>'; |
|
409 | + if (isset($_POST['all_prices'])) { |
|
410 | + $ajax_response .= '<option value="all">'.esc_html__('All Levels', 'give').'</option>'; |
|
411 | 411 | } |
412 | 412 | |
413 | - foreach ( $variable_prices as $key => $price ) { |
|
413 | + foreach ($variable_prices as $key => $price) { |
|
414 | 414 | |
415 | - $level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'] ) ); |
|
415 | + $level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount'])); |
|
416 | 416 | |
417 | - $ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>'; |
|
417 | + $ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>'; |
|
418 | 418 | } |
419 | 419 | $ajax_response .= '</select>'; |
420 | 420 | echo $ajax_response; |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | give_die(); |
425 | 425 | } |
426 | 426 | |
427 | -add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' ); |
|
427 | +add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations'); |
|
428 | 428 | |
429 | 429 | |
430 | 430 | /** |
@@ -435,25 +435,25 @@ discard block |
||
435 | 435 | * @return void |
436 | 436 | */ |
437 | 437 | function give_check_for_form_price_variations_html() { |
438 | - if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) { |
|
438 | + if ( ! current_user_can('edit_give_payments', get_current_user_id())) { |
|
439 | 439 | wp_die(); |
440 | 440 | } |
441 | 441 | |
442 | - $form_id = ! empty( $_POST['form_id'] ) ? intval( $_POST['form_id'] ) : 0; |
|
443 | - $payment_id = ! empty( $_POST['payment_id'] ) ? intval( $_POST['payment_id'] ) : 0; |
|
444 | - $form = get_post( $form_id ); |
|
442 | + $form_id = ! empty($_POST['form_id']) ? intval($_POST['form_id']) : 0; |
|
443 | + $payment_id = ! empty($_POST['payment_id']) ? intval($_POST['payment_id']) : 0; |
|
444 | + $form = get_post($form_id); |
|
445 | 445 | |
446 | - if ( 'give_forms' != $form->post_type ) { |
|
446 | + if ('give_forms' != $form->post_type) { |
|
447 | 447 | wp_die(); |
448 | 448 | } |
449 | 449 | |
450 | - if ( ! give_has_variable_prices( $form_id ) || ! $form_id ) { |
|
451 | - esc_html_e( 'n/a', 'give' ); |
|
450 | + if ( ! give_has_variable_prices($form_id) || ! $form_id) { |
|
451 | + esc_html_e('n/a', 'give'); |
|
452 | 452 | } else { |
453 | 453 | $prices_atts = ''; |
454 | - if ( $variable_prices = give_get_variable_prices( $form_id ) ) { |
|
455 | - foreach ( $variable_prices as $variable_price ) { |
|
456 | - $prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'] ); |
|
454 | + if ($variable_prices = give_get_variable_prices($form_id)) { |
|
455 | + foreach ($variable_prices as $variable_price) { |
|
456 | + $prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount']); |
|
457 | 457 | } |
458 | 458 | } |
459 | 459 | |
@@ -464,12 +464,12 @@ discard block |
||
464 | 464 | 'chosen' => true, |
465 | 465 | 'show_option_all' => '', |
466 | 466 | 'show_option_none' => '', |
467 | - 'select_atts' => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ), |
|
467 | + 'select_atts' => 'data-prices='.esc_attr(json_encode($prices_atts)), |
|
468 | 468 | ); |
469 | 469 | |
470 | - if ( $payment_id ) { |
|
470 | + if ($payment_id) { |
|
471 | 471 | // Payment object. |
472 | - $payment = new Give_Payment( $payment_id ); |
|
472 | + $payment = new Give_Payment($payment_id); |
|
473 | 473 | |
474 | 474 | // Payment meta. |
475 | 475 | $payment_meta = $payment->get_meta(); |
@@ -477,10 +477,10 @@ discard block |
||
477 | 477 | } |
478 | 478 | |
479 | 479 | // Render variable prices select tag html. |
480 | - give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true ); |
|
480 | + give_get_form_variable_price_dropdown($variable_price_dropdown_option, true); |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | give_die(); |
484 | 484 | } |
485 | 485 | |
486 | -add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' ); |
|
486 | +add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html'); |