@@ -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 | |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @return void |
28 | 28 | */ |
29 | -function give_email_donation_receipt( $payment_id, $admin_notice = true ) { |
|
29 | +function give_email_donation_receipt($payment_id, $admin_notice = true) { |
|
30 | 30 | |
31 | - $payment_data = give_get_payment_meta( $payment_id ); |
|
31 | + $payment_data = give_get_payment_meta($payment_id); |
|
32 | 32 | |
33 | - $from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); |
|
33 | + $from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)); |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Filters the from name. |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @since 1.0 |
42 | 42 | */ |
43 | - $from_name = apply_filters( 'give_donation_from_name', $from_name, $payment_id, $payment_data ); |
|
43 | + $from_name = apply_filters('give_donation_from_name', $from_name, $payment_id, $payment_data); |
|
44 | 44 | |
45 | - $from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); |
|
45 | + $from_email = give_get_option('from_email', get_bloginfo('admin_email')); |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Filters the from email. |
@@ -52,19 +52,19 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @since 1.0 |
54 | 54 | */ |
55 | - $from_email = apply_filters( 'give_donation_from_address', $from_email, $payment_id, $payment_data ); |
|
55 | + $from_email = apply_filters('give_donation_from_address', $from_email, $payment_id, $payment_data); |
|
56 | 56 | |
57 | - $to_email = give_get_payment_user_email( $payment_id ); |
|
57 | + $to_email = give_get_payment_user_email($payment_id); |
|
58 | 58 | |
59 | - $subject = give_get_option( 'donation_subject', esc_html__( 'Donation Receipt', 'give' ) ); |
|
59 | + $subject = give_get_option('donation_subject', esc_html__('Donation Receipt', 'give')); |
|
60 | 60 | |
61 | 61 | /** |
62 | 62 | * Filters the donation email receipt subject. |
63 | 63 | * |
64 | 64 | * @since 1.0 |
65 | 65 | */ |
66 | - $subject = apply_filters( 'give_donation_subject', wp_strip_all_tags( $subject ), $payment_id ); |
|
67 | - $subject = give_do_email_tags( $subject, $payment_id ); |
|
66 | + $subject = apply_filters('give_donation_subject', wp_strip_all_tags($subject), $payment_id); |
|
67 | + $subject = give_do_email_tags($subject, $payment_id); |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * Filters the donation email receipt attachments. By default, there is no attachment but plugins can hook in to provide one more multiple for the donor. Examples would be a printable ticket or PDF receipt. |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @since 1.0 |
76 | 76 | */ |
77 | - $attachments = apply_filters( 'give_receipt_attachments', array(), $payment_id, $payment_data ); |
|
78 | - $message = give_do_email_tags( give_get_email_body_content( $payment_id, $payment_data ), $payment_id ); |
|
77 | + $attachments = apply_filters('give_receipt_attachments', array(), $payment_id, $payment_data); |
|
78 | + $message = give_do_email_tags(give_get_email_body_content($payment_id, $payment_data), $payment_id); |
|
79 | 79 | |
80 | 80 | $emails = Give()->emails; |
81 | 81 | |
82 | - $emails->__set( 'from_name', $from_name ); |
|
83 | - $emails->__set( 'from_email', $from_email ); |
|
84 | - $emails->__set( 'heading', esc_html__( 'Donation Receipt', 'give' ) ); |
|
82 | + $emails->__set('from_name', $from_name); |
|
83 | + $emails->__set('from_email', $from_email); |
|
84 | + $emails->__set('heading', esc_html__('Donation Receipt', 'give')); |
|
85 | 85 | |
86 | 86 | /** |
87 | 87 | * Filters the donation receipt's email headers. |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @since 1.0 |
93 | 93 | */ |
94 | - $headers = apply_filters( 'give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data ); |
|
95 | - $emails->__set( 'headers', $headers ); |
|
94 | + $headers = apply_filters('give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data); |
|
95 | + $emails->__set('headers', $headers); |
|
96 | 96 | |
97 | 97 | //Send the donation receipt. |
98 | - $emails->send( $to_email, $subject, $message, $attachments ); |
|
98 | + $emails->send($to_email, $subject, $message, $attachments); |
|
99 | 99 | |
100 | 100 | //If admin notifications are on, send the admin notice. |
101 | - if ( $admin_notice && ! give_admin_notices_disabled( $payment_id ) ) { |
|
101 | + if ($admin_notice && ! give_admin_notices_disabled($payment_id)) { |
|
102 | 102 | /** |
103 | 103 | * Fires in the donation email receipt. |
104 | 104 | * |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @param int $payment_id Payment id. |
110 | 110 | * @param mixed $payment_data Payment meta data. |
111 | 111 | */ |
112 | - do_action( 'give_admin_donation_email', $payment_id, $payment_data ); |
|
112 | + do_action('give_admin_donation_email', $payment_id, $payment_data); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -122,41 +122,41 @@ discard block |
||
122 | 122 | */ |
123 | 123 | function give_email_test_donation_receipt() { |
124 | 124 | |
125 | - $from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); |
|
125 | + $from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)); |
|
126 | 126 | |
127 | 127 | /** |
128 | 128 | * Filters the from name. |
129 | 129 | * |
130 | 130 | * @since 1.7 |
131 | 131 | */ |
132 | - $from_name = apply_filters( 'give_donation_from_name', $from_name, 0, array() ); |
|
132 | + $from_name = apply_filters('give_donation_from_name', $from_name, 0, array()); |
|
133 | 133 | |
134 | - $from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); |
|
134 | + $from_email = give_get_option('from_email', get_bloginfo('admin_email')); |
|
135 | 135 | |
136 | 136 | /** |
137 | 137 | * Filters the from email. |
138 | 138 | * |
139 | 139 | * @since 1.7 |
140 | 140 | */ |
141 | - $from_email = apply_filters( 'give_donation_from_address', $from_email, 0, array() ); |
|
141 | + $from_email = apply_filters('give_donation_from_address', $from_email, 0, array()); |
|
142 | 142 | |
143 | - $subject = give_get_option( 'donation_subject', esc_html__( 'Donation Receipt', 'give' ) ); |
|
144 | - $subject = apply_filters( 'give_donation_subject', wp_strip_all_tags( $subject ), 0 ); |
|
145 | - $subject = give_do_email_tags( $subject, 0 ); |
|
143 | + $subject = give_get_option('donation_subject', esc_html__('Donation Receipt', 'give')); |
|
144 | + $subject = apply_filters('give_donation_subject', wp_strip_all_tags($subject), 0); |
|
145 | + $subject = give_do_email_tags($subject, 0); |
|
146 | 146 | |
147 | - $attachments = apply_filters( 'give_receipt_attachments', array(), 0, array() ); |
|
147 | + $attachments = apply_filters('give_receipt_attachments', array(), 0, array()); |
|
148 | 148 | |
149 | - $message = give_email_preview_template_tags( give_get_email_body_content( 0, array() ) ); |
|
149 | + $message = give_email_preview_template_tags(give_get_email_body_content(0, array())); |
|
150 | 150 | |
151 | 151 | $emails = Give()->emails; |
152 | - $emails->__set( 'from_name', $from_name ); |
|
153 | - $emails->__set( 'from_email', $from_email ); |
|
154 | - $emails->__set( 'heading', esc_html__( 'Donation Receipt', 'give' ) ); |
|
152 | + $emails->__set('from_name', $from_name); |
|
153 | + $emails->__set('from_email', $from_email); |
|
154 | + $emails->__set('heading', esc_html__('Donation Receipt', 'give')); |
|
155 | 155 | |
156 | - $headers = apply_filters( 'give_receipt_headers', $emails->get_headers(), 0, array() ); |
|
157 | - $emails->__set( 'headers', $headers ); |
|
156 | + $headers = apply_filters('give_receipt_headers', $emails->get_headers(), 0, array()); |
|
157 | + $emails->__set('headers', $headers); |
|
158 | 158 | |
159 | - $emails->send( give_get_admin_notice_emails(), $subject, $message, $attachments ); |
|
159 | + $emails->send(give_get_admin_notice_emails(), $subject, $message, $attachments); |
|
160 | 160 | |
161 | 161 | } |
162 | 162 | |
@@ -170,49 +170,49 @@ discard block |
||
170 | 170 | * |
171 | 171 | * @return void |
172 | 172 | */ |
173 | -function give_admin_email_notice( $payment_id = 0, $payment_data = array() ) { |
|
173 | +function give_admin_email_notice($payment_id = 0, $payment_data = array()) { |
|
174 | 174 | |
175 | - $payment_id = absint( $payment_id ); |
|
175 | + $payment_id = absint($payment_id); |
|
176 | 176 | |
177 | - if ( empty( $payment_id ) ) { |
|
177 | + if (empty($payment_id)) { |
|
178 | 178 | return; |
179 | 179 | } |
180 | 180 | |
181 | - if ( ! give_get_payment_by( 'id', $payment_id ) ) { |
|
181 | + if ( ! give_get_payment_by('id', $payment_id)) { |
|
182 | 182 | return; |
183 | 183 | } |
184 | 184 | |
185 | - $from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); |
|
185 | + $from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES)); |
|
186 | 186 | |
187 | 187 | /** |
188 | 188 | * Filters the from name. |
189 | 189 | * |
190 | 190 | * @since 1.0 |
191 | 191 | */ |
192 | - $from_name = apply_filters( 'give_donation_from_name', $from_name, $payment_id, $payment_data ); |
|
192 | + $from_name = apply_filters('give_donation_from_name', $from_name, $payment_id, $payment_data); |
|
193 | 193 | |
194 | - $from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); |
|
194 | + $from_email = give_get_option('from_email', get_bloginfo('admin_email')); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Filters the from email. |
198 | 198 | * |
199 | 199 | * @since 1.0 |
200 | 200 | */ |
201 | - $from_email = apply_filters( 'give_donation_from_address', $from_email, $payment_id, $payment_data ); |
|
201 | + $from_email = apply_filters('give_donation_from_address', $from_email, $payment_id, $payment_data); |
|
202 | 202 | |
203 | 203 | /* translators: %s: payment id */ |
204 | - $subject = give_get_option( 'donation_notification_subject', sprintf( esc_html__( 'New Donation - Payment #%s', 'give' ), $payment_id ) ); |
|
204 | + $subject = give_get_option('donation_notification_subject', sprintf(esc_html__('New Donation - Payment #%s', 'give'), $payment_id)); |
|
205 | 205 | |
206 | 206 | /** |
207 | 207 | * Filters the donation notification subject. |
208 | 208 | * |
209 | 209 | * @since 1.0 |
210 | 210 | */ |
211 | - $subject = apply_filters( 'give_admin_donation_notification_subject', wp_strip_all_tags( $subject ), $payment_id ); |
|
212 | - $subject = give_do_email_tags( $subject, $payment_id ); |
|
211 | + $subject = apply_filters('give_admin_donation_notification_subject', wp_strip_all_tags($subject), $payment_id); |
|
212 | + $subject = give_do_email_tags($subject, $payment_id); |
|
213 | 213 | |
214 | - $headers = "From: " . stripslashes_deep( html_entity_decode( $from_name, ENT_COMPAT, 'UTF-8' ) ) . " <$from_email>\r\n"; |
|
215 | - $headers .= "Reply-To: " . $from_email . "\r\n"; |
|
214 | + $headers = "From: ".stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8'))." <$from_email>\r\n"; |
|
215 | + $headers .= "Reply-To: ".$from_email."\r\n"; |
|
216 | 216 | //$headers .= "MIME-Version: 1.0\r\n"; |
217 | 217 | $headers .= "Content-Type: text/html; charset=utf-8\r\n"; |
218 | 218 | |
@@ -221,28 +221,28 @@ discard block |
||
221 | 221 | * |
222 | 222 | * @since 1.0 |
223 | 223 | */ |
224 | - $headers = apply_filters( 'give_admin_donation_notification_headers', $headers, $payment_id, $payment_data ); |
|
224 | + $headers = apply_filters('give_admin_donation_notification_headers', $headers, $payment_id, $payment_data); |
|
225 | 225 | |
226 | 226 | /** |
227 | 227 | * Filters the donation notification email attachments. By default, there is no attachment but plugins can hook in to provide one more multiple. |
228 | 228 | * |
229 | 229 | * @since 1.0 |
230 | 230 | */ |
231 | - $attachments = apply_filters( 'give_admin_donation_notification_attachments', array(), $payment_id, $payment_data ); |
|
231 | + $attachments = apply_filters('give_admin_donation_notification_attachments', array(), $payment_id, $payment_data); |
|
232 | 232 | |
233 | - $message = give_get_donation_notification_body_content( $payment_id, $payment_data ); |
|
233 | + $message = give_get_donation_notification_body_content($payment_id, $payment_data); |
|
234 | 234 | |
235 | 235 | $emails = Give()->emails; |
236 | - $emails->__set( 'from_name', $from_name ); |
|
237 | - $emails->__set( 'from_email', $from_email ); |
|
238 | - $emails->__set( 'headers', $headers ); |
|
239 | - $emails->__set( 'heading', esc_html__( 'New Donation!', 'give' ) ); |
|
236 | + $emails->__set('from_name', $from_name); |
|
237 | + $emails->__set('from_email', $from_email); |
|
238 | + $emails->__set('headers', $headers); |
|
239 | + $emails->__set('heading', esc_html__('New Donation!', 'give')); |
|
240 | 240 | |
241 | - $emails->send( give_get_admin_notice_emails(), $subject, $message, $attachments ); |
|
241 | + $emails->send(give_get_admin_notice_emails(), $subject, $message, $attachments); |
|
242 | 242 | |
243 | 243 | } |
244 | 244 | |
245 | -add_action( 'give_admin_donation_email', 'give_admin_email_notice', 10, 2 ); |
|
245 | +add_action('give_admin_donation_email', 'give_admin_email_notice', 10, 2); |
|
246 | 246 | |
247 | 247 | /** |
248 | 248 | * Retrieves the emails for which admin notifications are sent to (these can be changed in the Give Settings). |
@@ -252,12 +252,12 @@ discard block |
||
252 | 252 | */ |
253 | 253 | function give_get_admin_notice_emails() { |
254 | 254 | |
255 | - $email_option = give_get_option( 'admin_notice_emails' ); |
|
255 | + $email_option = give_get_option('admin_notice_emails'); |
|
256 | 256 | |
257 | - $emails = ! empty( $email_option ) && strlen( trim( $email_option ) ) > 0 ? $email_option : get_bloginfo( 'admin_email' ); |
|
258 | - $emails = array_map( 'trim', explode( "\n", $emails ) ); |
|
257 | + $emails = ! empty($email_option) && strlen(trim($email_option)) > 0 ? $email_option : get_bloginfo('admin_email'); |
|
258 | + $emails = array_map('trim', explode("\n", $emails)); |
|
259 | 259 | |
260 | - return apply_filters( 'give_admin_notice_emails', $emails ); |
|
260 | + return apply_filters('give_admin_notice_emails', $emails); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | /** |
@@ -269,11 +269,11 @@ discard block |
||
269 | 269 | * |
270 | 270 | * @return mixed |
271 | 271 | */ |
272 | -function give_admin_notices_disabled( $payment_id = 0 ) { |
|
272 | +function give_admin_notices_disabled($payment_id = 0) { |
|
273 | 273 | |
274 | 274 | return apply_filters( |
275 | 275 | 'give_admin_notices_disabled', |
276 | - ! give_is_setting_enabled( give_get_option( 'admin_notices' ) ), |
|
276 | + ! give_is_setting_enabled(give_get_option('admin_notices')), |
|
277 | 277 | $payment_id |
278 | 278 | ); |
279 | 279 | } |
@@ -288,19 +288,19 @@ discard block |
||
288 | 288 | */ |
289 | 289 | function give_get_default_donation_notification_email() { |
290 | 290 | |
291 | - $default_email_body = esc_html__( 'Hi there,', 'give' ) . "\n\n"; |
|
292 | - $default_email_body .= esc_html__( 'This email is to inform you that a new donation has been made on your website:', 'give' ) . ' <a href="' . get_bloginfo( 'url' ) . '" target="_blank">' . get_bloginfo( 'url' ) . '</a>' . ".\n\n"; |
|
293 | - $default_email_body .= '<strong>' . esc_html__( 'Donor:', 'give' ) . '</strong> {name}' . "\n"; |
|
294 | - $default_email_body .= '<strong>' . esc_html__( 'Donation:', 'give' ) . '</strong> {donation}' . "\n"; |
|
295 | - $default_email_body .= '<strong>' . esc_html__( 'Amount:', 'give' ) . '</strong> {amount}' . "\n"; |
|
296 | - $default_email_body .= '<strong>' . esc_html__( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n\n"; |
|
297 | - $default_email_body .= esc_html__( 'Thank you,', 'give' ) . "\n\n"; |
|
298 | - $default_email_body .= '{sitename}' . "\n"; |
|
291 | + $default_email_body = esc_html__('Hi there,', 'give')."\n\n"; |
|
292 | + $default_email_body .= esc_html__('This email is to inform you that a new donation has been made on your website:', 'give').' <a href="'.get_bloginfo('url').'" target="_blank">'.get_bloginfo('url').'</a>'.".\n\n"; |
|
293 | + $default_email_body .= '<strong>'.esc_html__('Donor:', 'give').'</strong> {name}'."\n"; |
|
294 | + $default_email_body .= '<strong>'.esc_html__('Donation:', 'give').'</strong> {donation}'."\n"; |
|
295 | + $default_email_body .= '<strong>'.esc_html__('Amount:', 'give').'</strong> {amount}'."\n"; |
|
296 | + $default_email_body .= '<strong>'.esc_html__('Payment Method:', 'give').'</strong> {payment_method}'."\n\n"; |
|
297 | + $default_email_body .= esc_html__('Thank you,', 'give')."\n\n"; |
|
298 | + $default_email_body .= '{sitename}'."\n"; |
|
299 | 299 | |
300 | - $custom_message = give_get_option( 'donation_notification' ); |
|
301 | - $message = ! empty( $custom_message ) ? $custom_message : $default_email_body; |
|
300 | + $custom_message = give_get_option('donation_notification'); |
|
301 | + $message = ! empty($custom_message) ? $custom_message : $default_email_body; |
|
302 | 302 | |
303 | - return apply_filters( 'give_default_donation_notification_email', $message ); |
|
303 | + return apply_filters('give_default_donation_notification_email', $message); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | |
@@ -314,25 +314,25 @@ discard block |
||
314 | 314 | */ |
315 | 315 | function give_get_default_donation_receipt_email() { |
316 | 316 | |
317 | - $default_email_body = esc_html__( 'Dear', 'give' ) . " {name},\n\n"; |
|
318 | - $default_email_body .= esc_html__( 'Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give' ) . "\n\n"; |
|
319 | - $default_email_body .= '<strong>' . esc_html__( 'Donor:', 'give' ) . '</strong> {fullname}' . "\n"; |
|
320 | - $default_email_body .= '<strong>' . esc_html__( 'Donation:', 'give' ) . '</strong> {donation}' . "\n"; |
|
321 | - $default_email_body .= '<strong>' . esc_html__( 'Donation Date:', 'give' ) . '</strong> {date}' . "\n"; |
|
322 | - $default_email_body .= '<strong>' . esc_html__( 'Amount:', 'give' ) . '</strong> {amount}' . "\n"; |
|
323 | - $default_email_body .= '<strong>' . esc_html__( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n"; |
|
324 | - $default_email_body .= '<strong>' . esc_html__( 'Payment ID:', 'give' ) . '</strong> {payment_id}' . "\n"; |
|
325 | - $default_email_body .= '<strong>' . esc_html__( 'Receipt ID:', 'give' ) . '</strong> {receipt_id}' . "\n\n"; |
|
326 | - $default_email_body .= '{receipt_link}' . "\n\n"; |
|
317 | + $default_email_body = esc_html__('Dear', 'give')." {name},\n\n"; |
|
318 | + $default_email_body .= esc_html__('Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give')."\n\n"; |
|
319 | + $default_email_body .= '<strong>'.esc_html__('Donor:', 'give').'</strong> {fullname}'."\n"; |
|
320 | + $default_email_body .= '<strong>'.esc_html__('Donation:', 'give').'</strong> {donation}'."\n"; |
|
321 | + $default_email_body .= '<strong>'.esc_html__('Donation Date:', 'give').'</strong> {date}'."\n"; |
|
322 | + $default_email_body .= '<strong>'.esc_html__('Amount:', 'give').'</strong> {amount}'."\n"; |
|
323 | + $default_email_body .= '<strong>'.esc_html__('Payment Method:', 'give').'</strong> {payment_method}'."\n"; |
|
324 | + $default_email_body .= '<strong>'.esc_html__('Payment ID:', 'give').'</strong> {payment_id}'."\n"; |
|
325 | + $default_email_body .= '<strong>'.esc_html__('Receipt ID:', 'give').'</strong> {receipt_id}'."\n\n"; |
|
326 | + $default_email_body .= '{receipt_link}'."\n\n"; |
|
327 | 327 | $default_email_body .= "\n\n"; |
328 | - $default_email_body .= esc_html__( 'Sincerely,', 'give' ) . "\n"; |
|
329 | - $default_email_body .= '{sitename}' . "\n"; |
|
328 | + $default_email_body .= esc_html__('Sincerely,', 'give')."\n"; |
|
329 | + $default_email_body .= '{sitename}'."\n"; |
|
330 | 330 | |
331 | - $custom_message = give_get_option( 'donation_receipt' ); |
|
331 | + $custom_message = give_get_option('donation_receipt'); |
|
332 | 332 | |
333 | - $message = ! empty( $custom_message ) ? $custom_message : $default_email_body; |
|
333 | + $message = ! empty($custom_message) ? $custom_message : $default_email_body; |
|
334 | 334 | |
335 | - return apply_filters( 'give_default_donation_receipt_email', $message ); |
|
335 | + return apply_filters('give_default_donation_receipt_email', $message); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
@@ -344,19 +344,19 @@ discard block |
||
344 | 344 | * |
345 | 345 | * @return array $email_names |
346 | 346 | */ |
347 | -function give_get_email_names( $user_info ) { |
|
347 | +function give_get_email_names($user_info) { |
|
348 | 348 | $email_names = array(); |
349 | - $user_info = maybe_unserialize( $user_info ); |
|
349 | + $user_info = maybe_unserialize($user_info); |
|
350 | 350 | |
351 | 351 | $email_names['fullname'] = ''; |
352 | - if ( isset( $user_info['id'] ) && $user_info['id'] > 0 && isset( $user_info['first_name'] ) ) { |
|
353 | - $user_data = get_userdata( $user_info['id'] ); |
|
352 | + if (isset($user_info['id']) && $user_info['id'] > 0 && isset($user_info['first_name'])) { |
|
353 | + $user_data = get_userdata($user_info['id']); |
|
354 | 354 | $email_names['name'] = $user_info['first_name']; |
355 | - $email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
355 | + $email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name']; |
|
356 | 356 | $email_names['username'] = $user_data->user_login; |
357 | - } elseif ( isset( $user_info['first_name'] ) ) { |
|
357 | + } elseif (isset($user_info['first_name'])) { |
|
358 | 358 | $email_names['name'] = $user_info['first_name']; |
359 | - $email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
359 | + $email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name']; |
|
360 | 360 | $email_names['username'] = $user_info['first_name']; |
361 | 361 | } else { |
362 | 362 | $email_names['name'] = $user_info['email']; |
@@ -586,9 +586,9 @@ |
||
586 | 586 | } |
587 | 587 | |
588 | 588 | echo ' – ' |
589 | - . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) |
|
590 | - . ' – ' |
|
591 | - . esc_html( $plugin_data['Version'] ); |
|
589 | + . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) |
|
590 | + . ' – ' |
|
591 | + . esc_html( $plugin_data['Version'] ); |
|
592 | 592 | ?> |
593 | 593 | </td> |
594 | 594 | </tr> |
@@ -57,7 +57,12 @@ discard block |
||
57 | 57 | <tr> |
58 | 58 | <td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'give' ); ?>:</td> |
59 | 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> |
|
60 | + <td><?php if ( is_multisite() ) { |
|
61 | + echo '<span class="dashicons dashicons-yes"></span>'; |
|
62 | +} else { |
|
63 | + echo '–'; |
|
64 | +} |
|
65 | +?></td> |
|
61 | 66 | </tr> |
62 | 67 | <tr> |
63 | 68 | <td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit', 'give' ); ?>:</td> |
@@ -85,9 +90,12 @@ discard block |
||
85 | 90 | <td> |
86 | 91 | <?php if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) : ?> |
87 | 92 | <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
88 | - <?php else : ?> |
|
93 | + <?php else { |
|
94 | + : ?> |
|
89 | 95 | <mark class="no">–</mark> |
90 | - <?php endif; ?> |
|
96 | + <?php endif; |
|
97 | +} |
|
98 | +?> |
|
91 | 99 | </td> |
92 | 100 | </tr> |
93 | 101 | <tr> |
@@ -96,9 +104,12 @@ discard block |
||
96 | 104 | <td> |
97 | 105 | <?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?> |
98 | 106 | <mark class="no">–</mark> |
99 | - <?php else : ?> |
|
107 | + <?php else { |
|
108 | + : ?> |
|
100 | 109 | <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
101 | - <?php endif; ?> |
|
110 | + <?php endif; |
|
111 | +} |
|
112 | +?> |
|
102 | 113 | </td> |
103 | 114 | </tr> |
104 | 115 | <tr> |
@@ -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 Statuses"><?php _e( 'Registered Post Statuses', '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 statuses.', 'give' ) ); ?>"></span></td> |
|
153 | - <td><?php echo esc_html( implode( ', ', get_post_stati() ) ); ?></td> |
|
151 | + <td data-export-label="Registered Post Statuses"><?php _e('Registered Post Statuses', '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 statuses.', '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_price_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_price_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_price_thousand_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_price_thousand_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 } ?> |
@@ -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,7 +20,7 @@ discard block |
||
20 | 20 | * @since 1.0 |
21 | 21 | * @return void |
22 | 22 | */ |
23 | -add_action( 'give_manual_cc_form', '__return_false' ); |
|
23 | +add_action('give_manual_cc_form', '__return_false'); |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Processes the donation data and uses the Manual Payment gateway to record |
@@ -32,17 +32,17 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return void |
34 | 34 | */ |
35 | -function give_manual_payment( $purchase_data ) { |
|
35 | +function give_manual_payment($purchase_data) { |
|
36 | 36 | |
37 | - if ( ! wp_verify_nonce( $purchase_data['gateway_nonce'], 'give-gateway' ) ) { |
|
38 | - wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
37 | + if ( ! wp_verify_nonce($purchase_data['gateway_nonce'], 'give-gateway')) { |
|
38 | + wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | //Create payment_data array |
42 | 42 | $payment_data = array( |
43 | 43 | 'price' => $purchase_data['price'], |
44 | 44 | 'give_form_title' => $purchase_data['post_data']['give-form-title'], |
45 | - 'give_form_id' => intval( $purchase_data['post_data']['give-form-id'] ), |
|
45 | + 'give_form_id' => intval($purchase_data['post_data']['give-form-id']), |
|
46 | 46 | 'give_price_id' => isset($purchase_data['post_data']['give-price-id']) ? $purchase_data['post_data']['give-price-id'] : '', |
47 | 47 | 'date' => $purchase_data['date'], |
48 | 48 | 'user_email' => $purchase_data['user_email'], |
@@ -52,24 +52,24 @@ discard block |
||
52 | 52 | 'status' => 'pending' |
53 | 53 | ); |
54 | 54 | // Record the pending payment |
55 | - $payment = give_insert_payment( $payment_data ); |
|
55 | + $payment = give_insert_payment($payment_data); |
|
56 | 56 | |
57 | - if ( $payment ) { |
|
58 | - give_update_payment_status( $payment, 'publish' ); |
|
57 | + if ($payment) { |
|
58 | + give_update_payment_status($payment, 'publish'); |
|
59 | 59 | give_send_to_success_page(); |
60 | 60 | } else { |
61 | 61 | give_record_gateway_error( |
62 | - esc_html__( 'Payment Error', 'give' ), |
|
62 | + esc_html__('Payment Error', 'give'), |
|
63 | 63 | sprintf( |
64 | 64 | /* translators: %s: payment data */ |
65 | - esc_html__( 'The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give' ), |
|
66 | - json_encode( $payment_data ) |
|
65 | + esc_html__('The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give'), |
|
66 | + json_encode($payment_data) |
|
67 | 67 | ), |
68 | 68 | $payment |
69 | 69 | ); |
70 | 70 | // If errors are present, send the user back to the donation page so they can be corrected |
71 | - give_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['give-gateway'] ); |
|
71 | + give_send_back_to_checkout('?payment-mode='.$purchase_data['post_data']['give-gateway']); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | -add_action( 'give_gateway_manual', 'give_manual_payment' ); |
|
75 | +add_action('give_gateway_manual', 'give_manual_payment'); |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | * |
566 | 566 | * @since 1.6.3 |
567 | 567 | * |
568 | - * @param $pending_reason |
|
568 | + * @param string $pending_reason |
|
569 | 569 | * |
570 | 570 | * @return string |
571 | 571 | */ |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | * @param int $payment_id Payment ID |
643 | 643 | * @param array $payment_data Array of payment data. |
644 | 644 | * |
645 | - * @return mixed|string |
|
645 | + * @return string |
|
646 | 646 | */ |
647 | 647 | function give_build_paypal_url( $payment_id, $payment_data ) { |
648 | 648 | // Only send to PayPal if the pending payment is created successfully. |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.0 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; |
14 | 14 | } |
15 | 15 | |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | * |
23 | 23 | * @return bool |
24 | 24 | */ |
25 | -function give_paypal_standard_billing_fields( $form_id ) { |
|
25 | +function give_paypal_standard_billing_fields($form_id) { |
|
26 | 26 | |
27 | - if ( give_is_setting_enabled( give_get_option( 'paypal_standard_billing_details' ) ) ) { |
|
28 | - give_default_cc_address_fields( $form_id ); |
|
27 | + if (give_is_setting_enabled(give_get_option('paypal_standard_billing_details'))) { |
|
28 | + give_default_cc_address_fields($form_id); |
|
29 | 29 | |
30 | 30 | return true; |
31 | 31 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | } |
36 | 36 | |
37 | -add_action( 'give_paypal_cc_form', 'give_paypal_standard_billing_fields' ); |
|
37 | +add_action('give_paypal_cc_form', 'give_paypal_standard_billing_fields'); |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Process PayPal Payment. |
@@ -45,27 +45,27 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @return void |
47 | 47 | */ |
48 | -function give_process_paypal_payment( $payment_data ) { |
|
48 | +function give_process_paypal_payment($payment_data) { |
|
49 | 49 | |
50 | 50 | // Validate nonce. |
51 | - give_validate_nonce( $payment_data['gateway_nonce'], 'give-gateway' ); |
|
52 | - $payment_id = give_create_payment( $payment_data ); |
|
51 | + give_validate_nonce($payment_data['gateway_nonce'], 'give-gateway'); |
|
52 | + $payment_id = give_create_payment($payment_data); |
|
53 | 53 | |
54 | 54 | // Check payment. |
55 | - if ( empty( $payment_id ) ) { |
|
55 | + if (empty($payment_id)) { |
|
56 | 56 | // Record the error. |
57 | - give_record_gateway_error( __( 'Payment Error', 'give' ), sprintf( /* translators: %s: payment data */ |
|
58 | - __( 'Payment creation failed before sending donor to PayPal. Payment data: %s', 'give' ), json_encode( $payment_data ) ), $payment_id ); |
|
57 | + give_record_gateway_error(__('Payment Error', 'give'), sprintf( /* translators: %s: payment data */ |
|
58 | + __('Payment creation failed before sending donor to PayPal. Payment data: %s', 'give'), json_encode($payment_data) ), $payment_id); |
|
59 | 59 | // Problems? Send back. |
60 | - give_send_back_to_checkout( '?payment-mode=' . $payment_data['post_data']['give-gateway'] ); |
|
60 | + give_send_back_to_checkout('?payment-mode='.$payment_data['post_data']['give-gateway']); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // Redirect to PayPal. |
64 | - wp_redirect( give_build_paypal_url( $payment_id, $payment_data ) ); |
|
64 | + wp_redirect(give_build_paypal_url($payment_id, $payment_data)); |
|
65 | 65 | exit; |
66 | 66 | } |
67 | 67 | |
68 | -add_action( 'give_gateway_paypal', 'give_process_paypal_payment' ); |
|
68 | +add_action('give_gateway_paypal', 'give_process_paypal_payment'); |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * Listens for a PayPal IPN requests and then sends to the processing function. |
@@ -75,17 +75,17 @@ discard block |
||
75 | 75 | */ |
76 | 76 | function give_listen_for_paypal_ipn() { |
77 | 77 | // Regular PayPal IPN |
78 | - if ( isset( $_GET['give-listener'] ) && $_GET['give-listener'] == 'IPN' ) { |
|
78 | + if (isset($_GET['give-listener']) && $_GET['give-listener'] == 'IPN') { |
|
79 | 79 | /** |
80 | 80 | * Fires while verifying PayPal IPN |
81 | 81 | * |
82 | 82 | * @since 1.0 |
83 | 83 | */ |
84 | - do_action( 'give_verify_paypal_ipn' ); |
|
84 | + do_action('give_verify_paypal_ipn'); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | -add_action( 'init', 'give_listen_for_paypal_ipn' ); |
|
88 | +add_action('init', 'give_listen_for_paypal_ipn'); |
|
89 | 89 | |
90 | 90 | /** |
91 | 91 | * Process PayPal IPN |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | function give_process_paypal_ipn() { |
97 | 97 | |
98 | 98 | // Check the request method is POST. |
99 | - if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'POST' !== $_SERVER['REQUEST_METHOD'] ) { |
|
99 | + if (isset($_SERVER['REQUEST_METHOD']) && 'POST' !== $_SERVER['REQUEST_METHOD']) { |
|
100 | 100 | return; |
101 | 101 | } |
102 | 102 | |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | $post_data = ''; |
105 | 105 | |
106 | 106 | // Fallback just in case post_max_size is lower than needed. |
107 | - if ( ini_get( 'allow_url_fopen' ) ) { |
|
108 | - $post_data = file_get_contents( 'php://input' ); |
|
107 | + if (ini_get('allow_url_fopen')) { |
|
108 | + $post_data = file_get_contents('php://input'); |
|
109 | 109 | } else { |
110 | 110 | // If allow_url_fopen is not enabled, then make sure that post_max_size is large enough. |
111 | - ini_set( 'post_max_size', '12M' ); |
|
111 | + ini_set('post_max_size', '12M'); |
|
112 | 112 | } |
113 | 113 | // Start the encoded data collection with notification command. |
114 | 114 | $encoded_data = 'cmd=_notify-validate'; |
@@ -117,39 +117,39 @@ discard block |
||
117 | 117 | $arg_separator = give_get_php_arg_separator_output(); |
118 | 118 | |
119 | 119 | // Verify there is a post_data. |
120 | - if ( $post_data || strlen( $post_data ) > 0 ) { |
|
120 | + if ($post_data || strlen($post_data) > 0) { |
|
121 | 121 | // Append the data. |
122 | - $encoded_data .= $arg_separator . $post_data; |
|
122 | + $encoded_data .= $arg_separator.$post_data; |
|
123 | 123 | } else { |
124 | 124 | // Check if POST is empty. |
125 | - if ( empty( $_POST ) ) { |
|
125 | + if (empty($_POST)) { |
|
126 | 126 | // Nothing to do. |
127 | 127 | return; |
128 | 128 | } else { |
129 | 129 | // Loop through each POST. |
130 | - foreach ( $_POST as $key => $value ) { |
|
130 | + foreach ($_POST as $key => $value) { |
|
131 | 131 | // Encode the value and append the data. |
132 | - $encoded_data .= $arg_separator . "$key=" . urlencode( $value ); |
|
132 | + $encoded_data .= $arg_separator."$key=".urlencode($value); |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | 137 | // Convert collected post data to an array. |
138 | - parse_str( $encoded_data, $encoded_data_array ); |
|
138 | + parse_str($encoded_data, $encoded_data_array); |
|
139 | 139 | |
140 | - foreach ( $encoded_data_array as $key => $value ) { |
|
140 | + foreach ($encoded_data_array as $key => $value) { |
|
141 | 141 | |
142 | - if ( false !== strpos( $key, 'amp;' ) ) { |
|
143 | - $new_key = str_replace( '&', '&', $key ); |
|
144 | - $new_key = str_replace( 'amp;', '&', $new_key ); |
|
142 | + if (false !== strpos($key, 'amp;')) { |
|
143 | + $new_key = str_replace('&', '&', $key); |
|
144 | + $new_key = str_replace('amp;', '&', $new_key); |
|
145 | 145 | |
146 | - unset( $encoded_data_array[ $key ] ); |
|
147 | - $encoded_data_array[ $new_key ] = $value; |
|
146 | + unset($encoded_data_array[$key]); |
|
147 | + $encoded_data_array[$new_key] = $value; |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
151 | 151 | // Validate IPN request w/ PayPal if user hasn't disabled this security measure. |
152 | - if ( give_is_setting_enabled( give_get_option( 'paypal_verification' ) ) ) { |
|
152 | + if (give_is_setting_enabled(give_get_option('paypal_verification'))) { |
|
153 | 153 | |
154 | 154 | $remote_post_vars = array( |
155 | 155 | 'method' => 'POST', |
@@ -169,25 +169,25 @@ discard block |
||
169 | 169 | ); |
170 | 170 | |
171 | 171 | // Validate the IPN. |
172 | - $api_response = wp_remote_post( give_get_paypal_redirect(), $remote_post_vars ); |
|
172 | + $api_response = wp_remote_post(give_get_paypal_redirect(), $remote_post_vars); |
|
173 | 173 | |
174 | - if ( is_wp_error( $api_response ) ) { |
|
175 | - give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */ |
|
176 | - __( 'Invalid IPN verification response. IPN data: %s', 'give' ), json_encode( $api_response ) ) ); |
|
174 | + if (is_wp_error($api_response)) { |
|
175 | + give_record_gateway_error(__('IPN Error', 'give'), sprintf( /* translators: %s: Paypal IPN response */ |
|
176 | + __('Invalid IPN verification response. IPN data: %s', 'give'), json_encode($api_response) )); |
|
177 | 177 | |
178 | 178 | return; // Something went wrong |
179 | 179 | } |
180 | 180 | |
181 | - if ( 'VERIFIED' !== $api_response['body'] ) { |
|
182 | - give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */ |
|
183 | - __( 'Invalid IPN verification response. IPN data: %s', 'give' ), json_encode( $api_response ) ) ); |
|
181 | + if ('VERIFIED' !== $api_response['body']) { |
|
182 | + give_record_gateway_error(__('IPN Error', 'give'), sprintf( /* translators: %s: Paypal IPN response */ |
|
183 | + __('Invalid IPN verification response. IPN data: %s', 'give'), json_encode($api_response) )); |
|
184 | 184 | |
185 | 185 | return; // Response not okay. |
186 | 186 | } |
187 | 187 | }// End if(). |
188 | 188 | |
189 | 189 | // Check if $post_data_array has been populated. |
190 | - if ( ! is_array( $encoded_data_array ) && ! empty( $encoded_data_array ) ) { |
|
190 | + if ( ! is_array($encoded_data_array) && ! empty($encoded_data_array)) { |
|
191 | 191 | return; |
192 | 192 | } |
193 | 193 | |
@@ -196,28 +196,28 @@ discard block |
||
196 | 196 | 'payment_status' => '', |
197 | 197 | ); |
198 | 198 | |
199 | - $encoded_data_array = wp_parse_args( $encoded_data_array, $defaults ); |
|
199 | + $encoded_data_array = wp_parse_args($encoded_data_array, $defaults); |
|
200 | 200 | |
201 | - $payment_id = isset( $encoded_data_array['custom'] ) ? absint( $encoded_data_array['custom'] ) : 0; |
|
201 | + $payment_id = isset($encoded_data_array['custom']) ? absint($encoded_data_array['custom']) : 0; |
|
202 | 202 | $txn_type = $encoded_data_array['txn_type']; |
203 | 203 | |
204 | 204 | // Check for PayPal IPN Notifications and update data based on it. |
205 | - $current_timestamp = current_time( 'timestamp' ); |
|
205 | + $current_timestamp = current_time('timestamp'); |
|
206 | 206 | $paypal_ipn_vars = array( |
207 | - 'auth_status' => ( $api_response['body'] ) ? $api_response['body'] : 'N/A', |
|
207 | + 'auth_status' => ($api_response['body']) ? $api_response['body'] : 'N/A', |
|
208 | 208 | 'transaction_id' => $encoded_data_array['txn_id'], |
209 | 209 | 'payment_id' => $payment_id, |
210 | 210 | ); |
211 | - update_option( 'give_last_paypal_ipn_received', $paypal_ipn_vars ); |
|
212 | - give_insert_payment_note( $payment_id, sprintf( |
|
213 | - __( 'Last IPN received on %s at %s', 'give' ), |
|
214 | - date_i18n( 'm/d/Y', $current_timestamp ), |
|
215 | - date_i18n( 'H:i', $current_timestamp ) |
|
211 | + update_option('give_last_paypal_ipn_received', $paypal_ipn_vars); |
|
212 | + give_insert_payment_note($payment_id, sprintf( |
|
213 | + __('Last IPN received on %s at %s', 'give'), |
|
214 | + date_i18n('m/d/Y', $current_timestamp), |
|
215 | + date_i18n('H:i', $current_timestamp) |
|
216 | 216 | ) |
217 | 217 | ); |
218 | - give_update_meta( $payment_id, 'give_last_paypal_ipn_received', $current_timestamp ); |
|
218 | + give_update_meta($payment_id, 'give_last_paypal_ipn_received', $current_timestamp); |
|
219 | 219 | |
220 | - if ( has_action( 'give_paypal_' . $txn_type ) ) { |
|
220 | + if (has_action('give_paypal_'.$txn_type)) { |
|
221 | 221 | /** |
222 | 222 | * Fires while processing PayPal IPN $txn_type. |
223 | 223 | * |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * @param array $encoded_data_array Encoded data. |
229 | 229 | * @param int $payment_id Payment id. |
230 | 230 | */ |
231 | - do_action( "give_paypal_{$txn_type}", $encoded_data_array, $payment_id ); |
|
231 | + do_action("give_paypal_{$txn_type}", $encoded_data_array, $payment_id); |
|
232 | 232 | } else { |
233 | 233 | /** |
234 | 234 | * Fires while process PayPal IPN. |
@@ -240,12 +240,12 @@ discard block |
||
240 | 240 | * @param array $encoded_data_array Encoded data. |
241 | 241 | * @param int $payment_id Payment id. |
242 | 242 | */ |
243 | - do_action( 'give_paypal_web_accept', $encoded_data_array, $payment_id ); |
|
243 | + do_action('give_paypal_web_accept', $encoded_data_array, $payment_id); |
|
244 | 244 | } |
245 | 245 | exit; |
246 | 246 | } |
247 | 247 | |
248 | -add_action( 'give_verify_paypal_ipn', 'give_process_paypal_ipn' ); |
|
248 | +add_action('give_verify_paypal_ipn', 'give_process_paypal_ipn'); |
|
249 | 249 | |
250 | 250 | /** |
251 | 251 | * Process web accept (one time) payment IPNs. |
@@ -257,99 +257,99 @@ discard block |
||
257 | 257 | * |
258 | 258 | * @return void |
259 | 259 | */ |
260 | -function give_process_paypal_web_accept( $data, $payment_id ) { |
|
260 | +function give_process_paypal_web_accept($data, $payment_id) { |
|
261 | 261 | |
262 | 262 | // Only allow through these transaction types. |
263 | - if ( 'web_accept' !== $data['txn_type'] && 'cart' !== $data['txn_type'] && 'refunded' !== strtolower( $data['payment_status'] ) ) { |
|
263 | + if ('web_accept' !== $data['txn_type'] && 'cart' !== $data['txn_type'] && 'refunded' !== strtolower($data['payment_status'])) { |
|
264 | 264 | return; |
265 | 265 | } |
266 | 266 | |
267 | 267 | // Need $payment_id to continue. |
268 | - if ( empty( $payment_id ) ) { |
|
268 | + if (empty($payment_id)) { |
|
269 | 269 | return; |
270 | 270 | } |
271 | 271 | |
272 | 272 | // Collect donation payment details. |
273 | 273 | $paypal_amount = $data['mc_gross']; |
274 | - $payment_status = strtolower( $data['payment_status'] ); |
|
275 | - $currency_code = strtolower( $data['mc_currency'] ); |
|
276 | - $business_email = isset( $data['business'] ) && is_email( $data['business'] ) ? trim( $data['business'] ) : trim( $data['receiver_email'] ); |
|
277 | - $payment_meta = give_get_payment_meta( $payment_id ); |
|
274 | + $payment_status = strtolower($data['payment_status']); |
|
275 | + $currency_code = strtolower($data['mc_currency']); |
|
276 | + $business_email = isset($data['business']) && is_email($data['business']) ? trim($data['business']) : trim($data['receiver_email']); |
|
277 | + $payment_meta = give_get_payment_meta($payment_id); |
|
278 | 278 | |
279 | 279 | // Must be a PayPal standard IPN. |
280 | - if ( 'paypal' !== give_get_payment_gateway( $payment_id ) ) { |
|
280 | + if ('paypal' !== give_get_payment_gateway($payment_id)) { |
|
281 | 281 | return; |
282 | 282 | } |
283 | 283 | |
284 | 284 | // Verify payment recipient |
285 | - if ( strcasecmp( $business_email, trim( give_get_option( 'paypal_email' ) ) ) !== 0 ) { |
|
285 | + if (strcasecmp($business_email, trim(give_get_option('paypal_email'))) !== 0) { |
|
286 | 286 | |
287 | - give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */ |
|
288 | - __( 'Invalid business email in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id ); |
|
289 | - give_update_payment_status( $payment_id, 'failed' ); |
|
290 | - give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid PayPal business email.', 'give' ) ); |
|
287 | + give_record_gateway_error(__('IPN Error', 'give'), sprintf( /* translators: %s: Paypal IPN response */ |
|
288 | + __('Invalid business email in IPN response. IPN data: %s', 'give'), json_encode($data) ), $payment_id); |
|
289 | + give_update_payment_status($payment_id, 'failed'); |
|
290 | + give_insert_payment_note($payment_id, __('Payment failed due to invalid PayPal business email.', 'give')); |
|
291 | 291 | |
292 | 292 | return; |
293 | 293 | } |
294 | 294 | |
295 | 295 | // Verify payment currency. |
296 | - if ( $currency_code !== strtolower( $payment_meta['currency'] ) ) { |
|
296 | + if ($currency_code !== strtolower($payment_meta['currency'])) { |
|
297 | 297 | |
298 | - give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */ |
|
299 | - __( 'Invalid currency in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id ); |
|
300 | - give_update_payment_status( $payment_id, 'failed' ); |
|
301 | - give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid currency in PayPal IPN.', 'give' ) ); |
|
298 | + give_record_gateway_error(__('IPN Error', 'give'), sprintf( /* translators: %s: Paypal IPN response */ |
|
299 | + __('Invalid currency in IPN response. IPN data: %s', 'give'), json_encode($data) ), $payment_id); |
|
300 | + give_update_payment_status($payment_id, 'failed'); |
|
301 | + give_insert_payment_note($payment_id, __('Payment failed due to invalid currency in PayPal IPN.', 'give')); |
|
302 | 302 | |
303 | 303 | return; |
304 | 304 | } |
305 | 305 | |
306 | 306 | // Process refunds & reversed. |
307 | - if ( 'refunded' === $payment_status || 'reversed' === $payment_status ) { |
|
308 | - give_process_paypal_refund( $data, $payment_id ); |
|
307 | + if ('refunded' === $payment_status || 'reversed' === $payment_status) { |
|
308 | + give_process_paypal_refund($data, $payment_id); |
|
309 | 309 | |
310 | 310 | return; |
311 | 311 | } |
312 | 312 | |
313 | 313 | // Only complete payments once. |
314 | - if ( 'publish' === get_post_status( $payment_id ) ) { |
|
314 | + if ('publish' === get_post_status($payment_id)) { |
|
315 | 315 | return; |
316 | 316 | } |
317 | 317 | |
318 | 318 | // Retrieve the total donation amount (before PayPal). |
319 | - $payment_amount = give_get_payment_amount( $payment_id ); |
|
319 | + $payment_amount = give_get_payment_amount($payment_id); |
|
320 | 320 | |
321 | 321 | // Check that the donation PP and local db amounts match. |
322 | - if ( number_format( (float) $paypal_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) { |
|
322 | + if (number_format((float) $paypal_amount, 2) < number_format((float) $payment_amount, 2)) { |
|
323 | 323 | // The prices don't match |
324 | - give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */ |
|
325 | - __( 'Invalid payment amount in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id ); |
|
326 | - give_update_payment_status( $payment_id, 'failed' ); |
|
327 | - give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid amount in PayPal IPN.', 'give' ) ); |
|
324 | + give_record_gateway_error(__('IPN Error', 'give'), sprintf( /* translators: %s: Paypal IPN response */ |
|
325 | + __('Invalid payment amount in IPN response. IPN data: %s', 'give'), json_encode($data) ), $payment_id); |
|
326 | + give_update_payment_status($payment_id, 'failed'); |
|
327 | + give_insert_payment_note($payment_id, __('Payment failed due to invalid amount in PayPal IPN.', 'give')); |
|
328 | 328 | |
329 | 329 | return; |
330 | 330 | } |
331 | 331 | |
332 | 332 | // Process completed donations. |
333 | - if ( 'completed' === $payment_status || give_is_test_mode() ) { |
|
333 | + if ('completed' === $payment_status || give_is_test_mode()) { |
|
334 | 334 | |
335 | - give_insert_payment_note( $payment_id, sprintf( /* translators: %s: Paypal transaction ID */ |
|
336 | - __( 'PayPal Transaction ID: %s', 'give' ), $data['txn_id'] ) ); |
|
337 | - give_set_payment_transaction_id( $payment_id, $data['txn_id'] ); |
|
338 | - give_update_payment_status( $payment_id, 'publish' ); |
|
335 | + give_insert_payment_note($payment_id, sprintf( /* translators: %s: Paypal transaction ID */ |
|
336 | + __('PayPal Transaction ID: %s', 'give'), $data['txn_id'] )); |
|
337 | + give_set_payment_transaction_id($payment_id, $data['txn_id']); |
|
338 | + give_update_payment_status($payment_id, 'publish'); |
|
339 | 339 | |
340 | - } elseif ( 'pending' === $payment_status && isset( $data['pending_reason'] ) ) { |
|
340 | + } elseif ('pending' === $payment_status && isset($data['pending_reason'])) { |
|
341 | 341 | |
342 | 342 | // Look for possible pending reasons, such as an echeck. |
343 | - $note = give_paypal_get_pending_donation_note( strtolower( $data['pending_reason'] ) ); |
|
343 | + $note = give_paypal_get_pending_donation_note(strtolower($data['pending_reason'])); |
|
344 | 344 | |
345 | - if ( ! empty( $note ) ) { |
|
346 | - give_insert_payment_note( $payment_id, $note ); |
|
345 | + if ( ! empty($note)) { |
|
346 | + give_insert_payment_note($payment_id, $note); |
|
347 | 347 | } |
348 | 348 | } |
349 | 349 | |
350 | 350 | } |
351 | 351 | |
352 | -add_action( 'give_paypal_web_accept', 'give_process_paypal_web_accept', 10, 2 ); |
|
352 | +add_action('give_paypal_web_accept', 'give_process_paypal_web_accept', 10, 2); |
|
353 | 353 | |
354 | 354 | /** |
355 | 355 | * Process PayPal IPN Refunds |
@@ -361,35 +361,35 @@ discard block |
||
361 | 361 | * |
362 | 362 | * @return void |
363 | 363 | */ |
364 | -function give_process_paypal_refund( $data, $payment_id = 0 ) { |
|
364 | +function give_process_paypal_refund($data, $payment_id = 0) { |
|
365 | 365 | |
366 | 366 | // Collect payment details. |
367 | - if ( empty( $payment_id ) ) { |
|
367 | + if (empty($payment_id)) { |
|
368 | 368 | return; |
369 | 369 | } |
370 | 370 | |
371 | 371 | // Only refund payments once. |
372 | - if ( 'refunded' === get_post_status( $payment_id ) ) { |
|
372 | + if ('refunded' === get_post_status($payment_id)) { |
|
373 | 373 | return; |
374 | 374 | } |
375 | 375 | |
376 | - $payment_amount = give_get_payment_amount( $payment_id ); |
|
376 | + $payment_amount = give_get_payment_amount($payment_id); |
|
377 | 377 | $refund_amount = $data['payment_gross'] * - 1; |
378 | 378 | |
379 | - if ( number_format( (float) $refund_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) { |
|
379 | + if (number_format((float) $refund_amount, 2) < number_format((float) $payment_amount, 2)) { |
|
380 | 380 | |
381 | - give_insert_payment_note( $payment_id, sprintf( /* translators: %s: Paypal parent transaction ID */ |
|
382 | - __( 'Partial PayPal refund processed: %s', 'give' ), $data['parent_txn_id'] ) ); |
|
381 | + give_insert_payment_note($payment_id, sprintf( /* translators: %s: Paypal parent transaction ID */ |
|
382 | + __('Partial PayPal refund processed: %s', 'give'), $data['parent_txn_id'] )); |
|
383 | 383 | |
384 | 384 | return; // This is a partial refund |
385 | 385 | |
386 | 386 | } |
387 | 387 | |
388 | - give_insert_payment_note( $payment_id, sprintf( /* translators: 1: Paypal parent transaction ID 2. Paypal reason code */ |
|
389 | - __( 'PayPal Payment #%1$s Refunded for reason: %2$s', 'give' ), $data['parent_txn_id'], $data['reason_code'] ) ); |
|
390 | - give_insert_payment_note( $payment_id, sprintf( /* translators: %s: Paypal transaction ID */ |
|
391 | - __( 'PayPal Refund Transaction ID: %s', 'give' ), $data['txn_id'] ) ); |
|
392 | - give_update_payment_status( $payment_id, 'refunded' ); |
|
388 | + give_insert_payment_note($payment_id, sprintf( /* translators: 1: Paypal parent transaction ID 2. Paypal reason code */ |
|
389 | + __('PayPal Payment #%1$s Refunded for reason: %2$s', 'give'), $data['parent_txn_id'], $data['reason_code'] )); |
|
390 | + give_insert_payment_note($payment_id, sprintf( /* translators: %s: Paypal transaction ID */ |
|
391 | + __('PayPal Refund Transaction ID: %s', 'give'), $data['txn_id'] )); |
|
392 | + give_update_payment_status($payment_id, 'refunded'); |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | /** |
@@ -401,24 +401,24 @@ discard block |
||
401 | 401 | * |
402 | 402 | * @return string |
403 | 403 | */ |
404 | -function give_get_paypal_redirect( $ssl_check = false ) { |
|
404 | +function give_get_paypal_redirect($ssl_check = false) { |
|
405 | 405 | |
406 | - if ( is_ssl() || ! $ssl_check ) { |
|
406 | + if (is_ssl() || ! $ssl_check) { |
|
407 | 407 | $protocol = 'https://'; |
408 | 408 | } else { |
409 | 409 | $protocol = 'http://'; |
410 | 410 | } |
411 | 411 | |
412 | 412 | // Check the current payment mode |
413 | - if ( give_is_test_mode() ) { |
|
413 | + if (give_is_test_mode()) { |
|
414 | 414 | // Test mode |
415 | - $paypal_uri = $protocol . 'www.sandbox.paypal.com/cgi-bin/webscr'; |
|
415 | + $paypal_uri = $protocol.'www.sandbox.paypal.com/cgi-bin/webscr'; |
|
416 | 416 | } else { |
417 | 417 | // Live mode |
418 | - $paypal_uri = $protocol . 'www.paypal.com/cgi-bin/webscr'; |
|
418 | + $paypal_uri = $protocol.'www.paypal.com/cgi-bin/webscr'; |
|
419 | 419 | } |
420 | 420 | |
421 | - return apply_filters( 'give_paypal_uri', $paypal_uri ); |
|
421 | + return apply_filters('give_paypal_uri', $paypal_uri); |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
@@ -428,9 +428,9 @@ discard block |
||
428 | 428 | * @return string |
429 | 429 | */ |
430 | 430 | function give_get_paypal_page_style() { |
431 | - $page_style = trim( give_get_option( 'paypal_page_style', 'PayPal' ) ); |
|
431 | + $page_style = trim(give_get_option('paypal_page_style', 'PayPal')); |
|
432 | 432 | |
433 | - return apply_filters( 'give_paypal_page_style', $page_style ); |
|
433 | + return apply_filters('give_paypal_page_style', $page_style); |
|
434 | 434 | } |
435 | 435 | |
436 | 436 | /** |
@@ -444,26 +444,26 @@ discard block |
||
444 | 444 | * |
445 | 445 | * @return string |
446 | 446 | */ |
447 | -function give_paypal_success_page_content( $content ) { |
|
447 | +function give_paypal_success_page_content($content) { |
|
448 | 448 | |
449 | - if ( ! isset( $_GET['payment-id'] ) && ! give_get_purchase_session() ) { |
|
449 | + if ( ! isset($_GET['payment-id']) && ! give_get_purchase_session()) { |
|
450 | 450 | return $content; |
451 | 451 | } |
452 | 452 | |
453 | - $payment_id = isset( $_GET['payment-id'] ) ? absint( $_GET['payment-id'] ) : false; |
|
453 | + $payment_id = isset($_GET['payment-id']) ? absint($_GET['payment-id']) : false; |
|
454 | 454 | |
455 | - if ( ! $payment_id ) { |
|
455 | + if ( ! $payment_id) { |
|
456 | 456 | $session = give_get_purchase_session(); |
457 | - $payment_id = give_get_purchase_id_by_key( $session['purchase_key'] ); |
|
457 | + $payment_id = give_get_purchase_id_by_key($session['purchase_key']); |
|
458 | 458 | } |
459 | 459 | |
460 | - $payment = get_post( $payment_id ); |
|
461 | - if ( $payment && 'pending' === $payment->post_status ) { |
|
460 | + $payment = get_post($payment_id); |
|
461 | + if ($payment && 'pending' === $payment->post_status) { |
|
462 | 462 | |
463 | 463 | // Payment is still pending so show processing indicator to fix the race condition. |
464 | 464 | ob_start(); |
465 | 465 | |
466 | - give_get_template_part( 'payment', 'processing' ); |
|
466 | + give_get_template_part('payment', 'processing'); |
|
467 | 467 | |
468 | 468 | $content = ob_get_clean(); |
469 | 469 | |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | |
474 | 474 | } |
475 | 475 | |
476 | -add_filter( 'give_payment_confirm_paypal', 'give_paypal_success_page_content' ); |
|
476 | +add_filter('give_payment_confirm_paypal', 'give_paypal_success_page_content'); |
|
477 | 477 | |
478 | 478 | /** |
479 | 479 | * Given a Payment ID, extract the transaction ID |
@@ -484,22 +484,22 @@ discard block |
||
484 | 484 | * |
485 | 485 | * @return string Transaction ID |
486 | 486 | */ |
487 | -function give_paypal_get_payment_transaction_id( $payment_id ) { |
|
487 | +function give_paypal_get_payment_transaction_id($payment_id) { |
|
488 | 488 | |
489 | 489 | $transaction_id = ''; |
490 | - $notes = give_get_payment_notes( $payment_id ); |
|
490 | + $notes = give_get_payment_notes($payment_id); |
|
491 | 491 | |
492 | - foreach ( $notes as $note ) { |
|
493 | - if ( preg_match( '/^PayPal Transaction ID: ([^\s]+)/', $note->comment_content, $match ) ) { |
|
492 | + foreach ($notes as $note) { |
|
493 | + if (preg_match('/^PayPal Transaction ID: ([^\s]+)/', $note->comment_content, $match)) { |
|
494 | 494 | $transaction_id = $match[1]; |
495 | 495 | continue; |
496 | 496 | } |
497 | 497 | } |
498 | 498 | |
499 | - return apply_filters( 'give_paypal_set_payment_transaction_id', $transaction_id, $payment_id ); |
|
499 | + return apply_filters('give_paypal_set_payment_transaction_id', $transaction_id, $payment_id); |
|
500 | 500 | } |
501 | 501 | |
502 | -add_filter( 'give_get_payment_transaction_id-paypal', 'give_paypal_get_payment_transaction_id', 10, 1 ); |
|
502 | +add_filter('give_get_payment_transaction_id-paypal', 'give_paypal_get_payment_transaction_id', 10, 1); |
|
503 | 503 | |
504 | 504 | /** |
505 | 505 | * Given a transaction ID, generate a link to the PayPal transaction ID details |
@@ -511,16 +511,16 @@ discard block |
||
511 | 511 | * |
512 | 512 | * @return string A link to the PayPal transaction details |
513 | 513 | */ |
514 | -function give_paypal_link_transaction_id( $transaction_id, $payment_id ) { |
|
514 | +function give_paypal_link_transaction_id($transaction_id, $payment_id) { |
|
515 | 515 | |
516 | 516 | $paypal_base_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id='; |
517 | - $transaction_url = '<a href="' . esc_url( $paypal_base_url . $transaction_id ) . '" target="_blank">' . $transaction_id . '</a>'; |
|
517 | + $transaction_url = '<a href="'.esc_url($paypal_base_url.$transaction_id).'" target="_blank">'.$transaction_id.'</a>'; |
|
518 | 518 | |
519 | - return apply_filters( 'give_paypal_link_payment_details_transaction_id', $transaction_url ); |
|
519 | + return apply_filters('give_paypal_link_payment_details_transaction_id', $transaction_url); |
|
520 | 520 | |
521 | 521 | } |
522 | 522 | |
523 | -add_filter( 'give_payment_details_transaction_id-paypal', 'give_paypal_link_transaction_id', 10, 2 ); |
|
523 | +add_filter('give_payment_details_transaction_id-paypal', 'give_paypal_link_transaction_id', 10, 2); |
|
524 | 524 | |
525 | 525 | |
526 | 526 | /** |
@@ -532,64 +532,64 @@ discard block |
||
532 | 532 | * |
533 | 533 | * @return string |
534 | 534 | */ |
535 | -function give_paypal_get_pending_donation_note( $pending_reason ) { |
|
535 | +function give_paypal_get_pending_donation_note($pending_reason) { |
|
536 | 536 | |
537 | 537 | $note = ''; |
538 | 538 | |
539 | - switch ( $pending_reason ) { |
|
539 | + switch ($pending_reason) { |
|
540 | 540 | |
541 | 541 | case 'echeck' : |
542 | 542 | |
543 | - $note = __( 'Payment made via eCheck and will clear automatically in 5-8 days.', 'give' ); |
|
543 | + $note = __('Payment made via eCheck and will clear automatically in 5-8 days.', 'give'); |
|
544 | 544 | |
545 | 545 | break; |
546 | 546 | |
547 | 547 | case 'address' : |
548 | 548 | |
549 | - $note = __( 'Payment requires a confirmed donor address and must be accepted manually through PayPal.', 'give' ); |
|
549 | + $note = __('Payment requires a confirmed donor address and must be accepted manually through PayPal.', 'give'); |
|
550 | 550 | |
551 | 551 | break; |
552 | 552 | |
553 | 553 | case 'intl' : |
554 | 554 | |
555 | - $note = __( 'Payment must be accepted manually through PayPal due to international account regulations.', 'give' ); |
|
555 | + $note = __('Payment must be accepted manually through PayPal due to international account regulations.', 'give'); |
|
556 | 556 | |
557 | 557 | break; |
558 | 558 | |
559 | 559 | case 'multi-currency' : |
560 | 560 | |
561 | - $note = __( 'Payment received in non-shop currency and must be accepted manually through PayPal.', 'give' ); |
|
561 | + $note = __('Payment received in non-shop currency and must be accepted manually through PayPal.', 'give'); |
|
562 | 562 | |
563 | 563 | break; |
564 | 564 | |
565 | 565 | case 'paymentreview' : |
566 | 566 | case 'regulatory_review' : |
567 | 567 | |
568 | - $note = __( 'Payment is being reviewed by PayPal staff as high-risk or in possible violation of government regulations.', 'give' ); |
|
568 | + $note = __('Payment is being reviewed by PayPal staff as high-risk or in possible violation of government regulations.', 'give'); |
|
569 | 569 | |
570 | 570 | break; |
571 | 571 | |
572 | 572 | case 'unilateral' : |
573 | 573 | |
574 | - $note = __( 'Payment was sent to non-confirmed or non-registered email address.', 'give' ); |
|
574 | + $note = __('Payment was sent to non-confirmed or non-registered email address.', 'give'); |
|
575 | 575 | |
576 | 576 | break; |
577 | 577 | |
578 | 578 | case 'upgrade' : |
579 | 579 | |
580 | - $note = __( 'PayPal account must be upgraded before this payment can be accepted.', 'give' ); |
|
580 | + $note = __('PayPal account must be upgraded before this payment can be accepted.', 'give'); |
|
581 | 581 | |
582 | 582 | break; |
583 | 583 | |
584 | 584 | case 'verify' : |
585 | 585 | |
586 | - $note = __( 'PayPal account is not verified. Verify account in order to accept this donation.', 'give' ); |
|
586 | + $note = __('PayPal account is not verified. Verify account in order to accept this donation.', 'give'); |
|
587 | 587 | |
588 | 588 | break; |
589 | 589 | |
590 | 590 | case 'other' : |
591 | 591 | |
592 | - $note = __( 'Payment is pending for unknown reasons. Contact PayPal support for assistance.', 'give' ); |
|
592 | + $note = __('Payment is pending for unknown reasons. Contact PayPal support for assistance.', 'give'); |
|
593 | 593 | |
594 | 594 | break; |
595 | 595 | |
@@ -607,49 +607,49 @@ discard block |
||
607 | 607 | * |
608 | 608 | * @return mixed|string |
609 | 609 | */ |
610 | -function give_build_paypal_url( $payment_id, $payment_data ) { |
|
610 | +function give_build_paypal_url($payment_id, $payment_data) { |
|
611 | 611 | // Only send to PayPal if the pending payment is created successfully. |
612 | - $listener_url = add_query_arg( 'give-listener', 'IPN', home_url( 'index.php' ) ); |
|
612 | + $listener_url = add_query_arg('give-listener', 'IPN', home_url('index.php')); |
|
613 | 613 | |
614 | 614 | // Get the success url. |
615 | - $return_url = add_query_arg( array( |
|
615 | + $return_url = add_query_arg(array( |
|
616 | 616 | 'payment-confirmation' => 'paypal', |
617 | 617 | 'payment-id' => $payment_id, |
618 | 618 | |
619 | - ), get_permalink( give_get_option( 'success_page' ) ) ); |
|
619 | + ), get_permalink(give_get_option('success_page'))); |
|
620 | 620 | |
621 | 621 | // Get the PayPal redirect uri. |
622 | - $paypal_redirect = trailingslashit( give_get_paypal_redirect() ) . '?'; |
|
622 | + $paypal_redirect = trailingslashit(give_get_paypal_redirect()).'?'; |
|
623 | 623 | |
624 | 624 | // Item name. |
625 | - $item_name = give_build_paypal_item_title( $payment_data ); |
|
625 | + $item_name = give_build_paypal_item_title($payment_data); |
|
626 | 626 | |
627 | 627 | // Setup PayPal API params. |
628 | 628 | $paypal_args = array( |
629 | - 'business' => give_get_option( 'paypal_email', false ), |
|
629 | + 'business' => give_get_option('paypal_email', false), |
|
630 | 630 | 'first_name' => $payment_data['user_info']['first_name'], |
631 | 631 | 'last_name' => $payment_data['user_info']['last_name'], |
632 | 632 | 'email' => $payment_data['user_email'], |
633 | 633 | 'invoice' => $payment_data['purchase_key'], |
634 | 634 | 'amount' => $payment_data['price'], |
635 | - 'item_name' => stripslashes( $item_name ), |
|
635 | + 'item_name' => stripslashes($item_name), |
|
636 | 636 | 'no_shipping' => '1', |
637 | 637 | 'shipping' => '0', |
638 | 638 | 'no_note' => '1', |
639 | 639 | 'currency_code' => give_get_currency(), |
640 | - 'charset' => get_bloginfo( 'charset' ), |
|
640 | + 'charset' => get_bloginfo('charset'), |
|
641 | 641 | 'custom' => $payment_id, |
642 | 642 | 'rm' => '2', |
643 | 643 | 'return' => $return_url, |
644 | - 'cancel_return' => give_get_failed_transaction_uri( '?payment-id=' . $payment_id ), |
|
644 | + 'cancel_return' => give_get_failed_transaction_uri('?payment-id='.$payment_id), |
|
645 | 645 | 'notify_url' => $listener_url, |
646 | 646 | 'page_style' => give_get_paypal_page_style(), |
647 | - 'cbt' => get_bloginfo( 'name' ), |
|
647 | + 'cbt' => get_bloginfo('name'), |
|
648 | 648 | 'bn' => 'givewp_SP', |
649 | 649 | ); |
650 | 650 | |
651 | 651 | // Add user address if present. |
652 | - if ( ! empty( $payment_data['user_info']['address'] ) ) { |
|
652 | + if ( ! empty($payment_data['user_info']['address'])) { |
|
653 | 653 | $default_address = array( |
654 | 654 | 'line1' => '', |
655 | 655 | 'line2' => '', |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | 'country' => '', |
660 | 660 | ); |
661 | 661 | |
662 | - $address = wp_parse_args( $payment_data['user_info']['address'], $default_address ); |
|
662 | + $address = wp_parse_args($payment_data['user_info']['address'], $default_address); |
|
663 | 663 | |
664 | 664 | $paypal_args['address1'] = $address['line1']; |
665 | 665 | $paypal_args['address2'] = $address['line2']; |
@@ -680,13 +680,13 @@ discard block |
||
680 | 680 | * @param array $paypal_args |
681 | 681 | * @param array $payment_data |
682 | 682 | */ |
683 | - $paypal_args = apply_filters( 'give_paypal_redirect_args', $paypal_args, $payment_data ); |
|
683 | + $paypal_args = apply_filters('give_paypal_redirect_args', $paypal_args, $payment_data); |
|
684 | 684 | |
685 | 685 | // Build query. |
686 | - $paypal_redirect .= http_build_query( $paypal_args ); |
|
686 | + $paypal_redirect .= http_build_query($paypal_args); |
|
687 | 687 | |
688 | 688 | // Fix for some sites that encode the entities. |
689 | - $paypal_redirect = str_replace( '&', '&', $paypal_redirect ); |
|
689 | + $paypal_redirect = str_replace('&', '&', $paypal_redirect); |
|
690 | 690 | |
691 | 691 | return $paypal_redirect; |
692 | 692 | } |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | function give_get_paypal_button_type() { |
702 | 702 | // paypal_button_type can be donation or standard. |
703 | 703 | $paypal_button_type = '_donations'; |
704 | - if ( 'standard' === give_get_option( 'paypal_button_type' ) ) { |
|
704 | + if ('standard' === give_get_option('paypal_button_type')) { |
|
705 | 705 | $paypal_button_type = '_xclick'; |
706 | 706 | } |
707 | 707 | |
@@ -718,30 +718,30 @@ discard block |
||
718 | 718 | * |
719 | 719 | * @return string |
720 | 720 | */ |
721 | -function give_build_paypal_item_title( $payment_data ) { |
|
722 | - $form_id = intval( $payment_data['post_data']['give-form-id'] ); |
|
721 | +function give_build_paypal_item_title($payment_data) { |
|
722 | + $form_id = intval($payment_data['post_data']['give-form-id']); |
|
723 | 723 | $item_name = $payment_data['post_data']['give-form-title']; |
724 | 724 | |
725 | 725 | // Verify has variable prices. |
726 | - if ( give_has_variable_prices( $form_id ) && isset( $payment_data['post_data']['give-price-id'] ) ) { |
|
726 | + if (give_has_variable_prices($form_id) && isset($payment_data['post_data']['give-price-id'])) { |
|
727 | 727 | |
728 | - $item_price_level_text = give_get_price_option_name( $form_id, $payment_data['post_data']['give-price-id'] ); |
|
729 | - $price_level_amount = give_get_price_option_amount( $form_id, $payment_data['post_data']['give-price-id'] ); |
|
728 | + $item_price_level_text = give_get_price_option_name($form_id, $payment_data['post_data']['give-price-id']); |
|
729 | + $price_level_amount = give_get_price_option_amount($form_id, $payment_data['post_data']['give-price-id']); |
|
730 | 730 | |
731 | 731 | // Donation given doesn't match selected level (must be a custom amount). |
732 | - if ( $price_level_amount != give_maybe_sanitize_amount( $payment_data['price'] ) ) { |
|
733 | - $custom_amount_text = give_get_meta( $form_id, '_give_custom_amount_text', true ); |
|
732 | + if ($price_level_amount != give_maybe_sanitize_amount($payment_data['price'])) { |
|
733 | + $custom_amount_text = give_get_meta($form_id, '_give_custom_amount_text', true); |
|
734 | 734 | // user custom amount text if any, fallback to default if not. |
735 | - $item_name .= ' - ' . give_check_variable( $custom_amount_text, 'empty', __( 'Custom Amount', 'give' ) ); |
|
735 | + $item_name .= ' - '.give_check_variable($custom_amount_text, 'empty', __('Custom Amount', 'give')); |
|
736 | 736 | |
737 | - } elseif ( ! empty( $item_price_level_text ) ) { |
|
738 | - $item_name .= ' - ' . $item_price_level_text; |
|
737 | + } elseif ( ! empty($item_price_level_text)) { |
|
738 | + $item_name .= ' - '.$item_price_level_text; |
|
739 | 739 | } |
740 | 740 | } // End if(). |
741 | - elseif ( give_get_form_price( $form_id ) !== give_maybe_sanitize_amount( $payment_data['price'] ) ) { |
|
742 | - $custom_amount_text = give_get_meta( $form_id, '_give_custom_amount_text', true ); |
|
741 | + elseif (give_get_form_price($form_id) !== give_maybe_sanitize_amount($payment_data['price'])) { |
|
742 | + $custom_amount_text = give_get_meta($form_id, '_give_custom_amount_text', true); |
|
743 | 743 | // user custom amount text if any, fallback to default if not. |
744 | - $item_name .= ' - ' . give_check_variable( $custom_amount_text, 'empty', __( 'Custom Amount', 'give' ) ); |
|
744 | + $item_name .= ' - '.give_check_variable($custom_amount_text, 'empty', __('Custom Amount', 'give')); |
|
745 | 745 | } |
746 | 746 | |
747 | 747 | return $item_name; |
@@ -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_License' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_License')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_License. |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() { |
45 | 45 | $this->id = 'licenses'; |
46 | - $this->label = esc_html__( 'Licenses', 'give' ); |
|
46 | + $this->label = esc_html__('Licenses', 'give'); |
|
47 | 47 | |
48 | - add_filter( 'give-settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); |
|
49 | - add_action( "give-settings_settings_{$this->id}_page", array( $this, 'output' ) ); |
|
48 | + add_filter('give-settings_tabs_array', array($this, 'add_settings_page'), 20); |
|
49 | + add_action("give-settings_settings_{$this->id}_page", array($this, 'output')); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | * @param array $pages Lst of pages. |
57 | 57 | * @return array |
58 | 58 | */ |
59 | - public function add_settings_page( $pages ) { |
|
59 | + public function add_settings_page($pages) { |
|
60 | 60 | $setting = $this->get_settings(); |
61 | 61 | // Bailout: Do not add licenses setting tab if it does not contain any setting fields. |
62 | - if( ! empty( $setting ) ) { |
|
63 | - $pages[ $this->id ] = $this->label; |
|
62 | + if ( ! empty($setting)) { |
|
63 | + $pages[$this->id] = $this->label; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | return $pages; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * Filter the licenses settings. |
80 | 80 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
81 | 81 | */ |
82 | - $settings = apply_filters( 'give_settings_licenses', $settings ); |
|
82 | + $settings = apply_filters('give_settings_licenses', $settings); |
|
83 | 83 | |
84 | 84 | /** |
85 | 85 | * Filter the settings. |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @since 1.8 |
88 | 88 | * @param array $settings |
89 | 89 | */ |
90 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
90 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
91 | 91 | |
92 | 92 | // Output. |
93 | 93 | return $settings; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | public function output() { |
103 | 103 | $settings = $this->get_settings(); |
104 | 104 | |
105 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
105 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 |
@@ -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_Addon' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Addon')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Addon. |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function __construct() { |
28 | 28 | $this->id = 'addons'; |
29 | - $this->label = esc_html__( 'Add-ons', 'give' ); |
|
29 | + $this->label = esc_html__('Add-ons', 'give'); |
|
30 | 30 | |
31 | 31 | parent::__construct(); |
32 | 32 | } |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | * @param $setting_tab |
39 | 39 | * @return string |
40 | 40 | */ |
41 | - function set_default_setting_tab( $setting_tab ) { |
|
41 | + function set_default_setting_tab($setting_tab) { |
|
42 | 42 | $default_tab = ''; |
43 | 43 | |
44 | 44 | // Set default tab to first setting tab. |
45 | - if( $sections = array_keys( $this->get_sections() ) ) { |
|
46 | - $default_tab = current( $sections ); |
|
45 | + if ($sections = array_keys($this->get_sections())) { |
|
46 | + $default_tab = current($sections); |
|
47 | 47 | } |
48 | 48 | return $default_tab; |
49 | 49 | } |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | * @param array $pages Lst of pages. |
56 | 56 | * @return array |
57 | 57 | */ |
58 | - public function add_settings_page( $pages ) { |
|
58 | + public function add_settings_page($pages) { |
|
59 | 59 | $setting = $this->get_settings(); |
60 | 60 | // Bailout: Do not add addons setting tab if it does not contain any setting fields. |
61 | - if( ! empty( $setting ) ) { |
|
62 | - $pages[ $this->id ] = $this->label; |
|
61 | + if ( ! empty($setting)) { |
|
62 | + $pages[$this->id] = $this->label; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | return $pages; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * Filter the addons settings. |
79 | 79 | * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8 |
80 | 80 | */ |
81 | - $settings = apply_filters( 'give_settings_addons', $settings ); |
|
81 | + $settings = apply_filters('give_settings_addons', $settings); |
|
82 | 82 | |
83 | 83 | /** |
84 | 84 | * Filter the settings. |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @since 1.8 |
87 | 87 | * @param array $settings |
88 | 88 | */ |
89 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
89 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
90 | 90 | |
91 | 91 | // Output. |
92 | 92 | return $settings; |
@@ -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,19 +22,19 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function give_add_shortcode_to_publish_metabox() { |
24 | 24 | |
25 | - if ( 'give_forms' !== get_post_type() ) { |
|
25 | + if ('give_forms' !== get_post_type()) { |
|
26 | 26 | return false; |
27 | 27 | } |
28 | 28 | global $post; |
29 | 29 | |
30 | 30 | //Only enqueue scripts for CPT on post type screen |
31 | - if ( 'give_forms' === $post->post_type ) { |
|
31 | + if ('give_forms' === $post->post_type) { |
|
32 | 32 | //Shortcode column with select all input |
33 | - $shortcode = htmlentities( '[give_form id="' . $post->ID . '"]' ); |
|
34 | - echo '<div class="shortcode-wrap box-sizing"><label for="shortcode-input">' . esc_html__( 'Give Form Shortcode:', 'give' ) . '</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" name="shortcode-input" id="shortcode-input" class="shortcode-input" readonly value="' . $shortcode . '"></div>'; |
|
33 | + $shortcode = htmlentities('[give_form id="'.$post->ID.'"]'); |
|
34 | + echo '<div class="shortcode-wrap box-sizing"><label for="shortcode-input">'.esc_html__('Give Form Shortcode:', 'give').'</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" name="shortcode-input" id="shortcode-input" class="shortcode-input" readonly value="'.$shortcode.'"></div>'; |
|
35 | 35 | |
36 | 36 | } |
37 | 37 | |
38 | 38 | } |
39 | 39 | |
40 | -add_action( 'post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox' ); |
|
40 | +add_action('post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox'); |
@@ -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,14 +24,14 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @return string |
26 | 26 | */ |
27 | -function give_admin_rate_us( $footer_text ) { |
|
27 | +function give_admin_rate_us($footer_text) { |
|
28 | 28 | global $typenow; |
29 | 29 | |
30 | - if ( $typenow == 'give_forms' ) { |
|
30 | + if ($typenow == 'give_forms') { |
|
31 | 31 | $rate_text = sprintf( |
32 | 32 | /* translators: %s: Link to 5 star rating */ |
33 | - __( 'If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give' ), |
|
34 | - '<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" style="text-decoration:none;" data-rated="' . esc_attr__( 'Thanks :)', 'give' ) . '">★★★★★</a>' |
|
33 | + __('If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give'), |
|
34 | + '<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" style="text-decoration:none;" data-rated="'.esc_attr__('Thanks :)', 'give').'">★★★★★</a>' |
|
35 | 35 | ); |
36 | 36 | |
37 | 37 | return $rate_text; |
@@ -40,4 +40,4 @@ discard block |
||
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | -add_filter( 'admin_footer_text', 'give_admin_rate_us' ); |
|
43 | +add_filter('admin_footer_text', 'give_admin_rate_us'); |
@@ -463,7 +463,7 @@ |
||
463 | 463 | * @since 1.7 |
464 | 464 | * @access public |
465 | 465 | * |
466 | - * @return bool |
|
466 | + * @return false|null |
|
467 | 467 | */ |
468 | 468 | public function delete_cache() { |
469 | 469 | global $wpdb; |
@@ -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 | |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __setup_hooks() { |
45 | 45 | // Create the log post type |
46 | - add_action( 'init', array( $this, 'register_post_type' ), 1 ); |
|
46 | + add_action('init', array($this, 'register_post_type'), 1); |
|
47 | 47 | |
48 | 48 | // Create types taxonomy and default types |
49 | - add_action( 'init', array( $this, 'register_taxonomy' ), 1 ); |
|
49 | + add_action('init', array($this, 'register_taxonomy'), 1); |
|
50 | 50 | |
51 | - add_action( 'save_post_give_payment', array( $this, 'background_process_delete_cache' ) ); |
|
52 | - add_action( 'save_post_give_forms', array( $this, 'background_process_delete_cache' ) ); |
|
53 | - add_action( 'save_post_give_log', array( $this, 'background_process_delete_cache' ) ); |
|
54 | - add_action( 'give_delete_log_cache', array( $this, 'delete_cache' ) ); |
|
51 | + add_action('save_post_give_payment', array($this, 'background_process_delete_cache')); |
|
52 | + add_action('save_post_give_forms', array($this, 'background_process_delete_cache')); |
|
53 | + add_action('save_post_give_log', array($this, 'background_process_delete_cache')); |
|
54 | + add_action('give_delete_log_cache', array($this, 'delete_cache')); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | /* Logs post type */ |
69 | 69 | $log_args = array( |
70 | 70 | 'labels' => array( |
71 | - 'name' => esc_html__( 'Logs', 'give' ), |
|
71 | + 'name' => esc_html__('Logs', 'give'), |
|
72 | 72 | ), |
73 | 73 | 'public' => false, |
74 | 74 | 'exclude_from_search' => true, |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | 'query_var' => false, |
78 | 78 | 'rewrite' => false, |
79 | 79 | 'capability_type' => 'post', |
80 | - 'supports' => array( 'title', 'editor' ), |
|
80 | + 'supports' => array('title', 'editor'), |
|
81 | 81 | 'can_export' => true, |
82 | 82 | ); |
83 | 83 | |
84 | - register_post_type( 'give_log', $log_args ); |
|
84 | + register_post_type('give_log', $log_args); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | * @return void |
96 | 96 | */ |
97 | 97 | public function register_taxonomy() { |
98 | - register_taxonomy( 'give_log_type', 'give_log', array( |
|
98 | + register_taxonomy('give_log_type', 'give_log', array( |
|
99 | 99 | 'public' => false, |
100 | - ) ); |
|
100 | + )); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | 'api_request', |
118 | 118 | ); |
119 | 119 | |
120 | - return apply_filters( 'give_log_types', $terms ); |
|
120 | + return apply_filters('give_log_types', $terms); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | * |
133 | 133 | * @return bool Whether log type is valid. |
134 | 134 | */ |
135 | - public function valid_type( $type ) { |
|
136 | - return in_array( $type, $this->log_types() ); |
|
135 | + public function valid_type($type) { |
|
136 | + return in_array($type, $this->log_types()); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | * |
153 | 153 | * @return int Log ID. |
154 | 154 | */ |
155 | - public function add( $title = '', $message = '', $parent = 0, $type = null ) { |
|
155 | + public function add($title = '', $message = '', $parent = 0, $type = null) { |
|
156 | 156 | $log_data = array( |
157 | 157 | 'post_title' => $title, |
158 | 158 | 'post_content' => $message, |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | 'log_type' => $type, |
161 | 161 | ); |
162 | 162 | |
163 | - return $this->insert_log( $log_data ); |
|
163 | + return $this->insert_log($log_data); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -177,12 +177,12 @@ discard block |
||
177 | 177 | * |
178 | 178 | * @return array An array of the connected logs. |
179 | 179 | */ |
180 | - public function get_logs( $object_id = 0, $type = null, $paged = null ) { |
|
181 | - return $this->get_connected_logs( array( |
|
180 | + public function get_logs($object_id = 0, $type = null, $paged = null) { |
|
181 | + return $this->get_connected_logs(array( |
|
182 | 182 | 'post_parent' => $object_id, |
183 | 183 | 'paged' => $paged, |
184 | 184 | 'log_type' => $type, |
185 | - ) ); |
|
185 | + )); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * |
197 | 197 | * @return int The ID of the newly created log item. |
198 | 198 | */ |
199 | - public function insert_log( $log_data = array(), $log_meta = array() ) { |
|
199 | + public function insert_log($log_data = array(), $log_meta = array()) { |
|
200 | 200 | $defaults = array( |
201 | 201 | 'post_type' => 'give_log', |
202 | 202 | 'post_status' => 'publish', |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | 'log_type' => false, |
206 | 206 | ); |
207 | 207 | |
208 | - $args = wp_parse_args( $log_data, $defaults ); |
|
208 | + $args = wp_parse_args($log_data, $defaults); |
|
209 | 209 | |
210 | 210 | /** |
211 | 211 | * Fires before inserting log entry. |
@@ -215,20 +215,20 @@ discard block |
||
215 | 215 | * @param array $log_data Log entry data. |
216 | 216 | * @param array $log_meta Log entry meta. |
217 | 217 | */ |
218 | - do_action( 'give_pre_insert_log', $log_data, $log_meta ); |
|
218 | + do_action('give_pre_insert_log', $log_data, $log_meta); |
|
219 | 219 | |
220 | 220 | // Store the log entry |
221 | - $log_id = wp_insert_post( $args ); |
|
221 | + $log_id = wp_insert_post($args); |
|
222 | 222 | |
223 | 223 | // Set the log type, if any |
224 | - if ( $log_data['log_type'] && $this->valid_type( $log_data['log_type'] ) ) { |
|
225 | - wp_set_object_terms( $log_id, $log_data['log_type'], 'give_log_type', false ); |
|
224 | + if ($log_data['log_type'] && $this->valid_type($log_data['log_type'])) { |
|
225 | + wp_set_object_terms($log_id, $log_data['log_type'], 'give_log_type', false); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | // Set log meta, if any |
229 | - if ( $log_id && ! empty( $log_meta ) ) { |
|
230 | - foreach ( (array) $log_meta as $key => $meta ) { |
|
231 | - give_update_meta( $log_id, '_give_log_' . sanitize_key( $key ), $meta ); |
|
229 | + if ($log_id && ! empty($log_meta)) { |
|
230 | + foreach ((array) $log_meta as $key => $meta) { |
|
231 | + give_update_meta($log_id, '_give_log_'.sanitize_key($key), $meta); |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @param array $log_data Log entry data. |
242 | 242 | * @param array $log_meta Log entry meta. |
243 | 243 | */ |
244 | - do_action( 'give_post_insert_log', $log_id, $log_data, $log_meta ); |
|
244 | + do_action('give_post_insert_log', $log_id, $log_data, $log_meta); |
|
245 | 245 | |
246 | 246 | return $log_id; |
247 | 247 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * |
258 | 258 | * @return bool|null True if successful, false otherwise. |
259 | 259 | */ |
260 | - public function update_log( $log_data = array(), $log_meta = array() ) { |
|
260 | + public function update_log($log_data = array(), $log_meta = array()) { |
|
261 | 261 | |
262 | 262 | /** |
263 | 263 | * Fires before updating log entry. |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @param array $log_data Log entry data. |
268 | 268 | * @param array $log_meta Log entry meta. |
269 | 269 | */ |
270 | - do_action( 'give_pre_update_log', $log_data, $log_meta ); |
|
270 | + do_action('give_pre_update_log', $log_data, $log_meta); |
|
271 | 271 | |
272 | 272 | $defaults = array( |
273 | 273 | 'post_type' => 'give_log', |
@@ -275,15 +275,15 @@ discard block |
||
275 | 275 | 'post_parent' => 0, |
276 | 276 | ); |
277 | 277 | |
278 | - $args = wp_parse_args( $log_data, $defaults ); |
|
278 | + $args = wp_parse_args($log_data, $defaults); |
|
279 | 279 | |
280 | 280 | // Store the log entry |
281 | - $log_id = wp_update_post( $args ); |
|
281 | + $log_id = wp_update_post($args); |
|
282 | 282 | |
283 | - if ( $log_id && ! empty( $log_meta ) ) { |
|
284 | - foreach ( (array) $log_meta as $key => $meta ) { |
|
285 | - if ( ! empty( $meta ) ) { |
|
286 | - give_update_meta( $log_id, '_give_log_' . sanitize_key( $key ), $meta ); |
|
283 | + if ($log_id && ! empty($log_meta)) { |
|
284 | + foreach ((array) $log_meta as $key => $meta) { |
|
285 | + if ( ! empty($meta)) { |
|
286 | + give_update_meta($log_id, '_give_log_'.sanitize_key($key), $meta); |
|
287 | 287 | } |
288 | 288 | } |
289 | 289 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * @param array $log_data Log entry data. |
298 | 298 | * @param array $log_meta Log entry meta. |
299 | 299 | */ |
300 | - do_action( 'give_post_update_log', $log_id, $log_data, $log_meta ); |
|
300 | + do_action('give_post_update_log', $log_id, $log_data, $log_meta); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
@@ -312,20 +312,20 @@ discard block |
||
312 | 312 | * |
313 | 313 | * @return array|false Array if logs were found, false otherwise. |
314 | 314 | */ |
315 | - public function get_connected_logs( $args = array() ) { |
|
315 | + public function get_connected_logs($args = array()) { |
|
316 | 316 | |
317 | 317 | $defaults = array( |
318 | 318 | 'post_type' => 'give_log', |
319 | 319 | 'posts_per_page' => 20, |
320 | 320 | 'post_status' => 'publish', |
321 | - 'paged' => get_query_var( 'paged' ), |
|
321 | + 'paged' => get_query_var('paged'), |
|
322 | 322 | 'log_type' => false, |
323 | 323 | 'date_query' => null |
324 | 324 | ); |
325 | 325 | |
326 | - $query_args = wp_parse_args( $args, $defaults ); |
|
326 | + $query_args = wp_parse_args($args, $defaults); |
|
327 | 327 | |
328 | - if ( $query_args['log_type'] && $this->valid_type( $query_args['log_type'] ) ) { |
|
328 | + if ($query_args['log_type'] && $this->valid_type($query_args['log_type'])) { |
|
329 | 329 | $query_args['tax_query'] = array( |
330 | 330 | array( |
331 | 331 | 'taxonomy' => 'give_log_type', |
@@ -336,28 +336,28 @@ discard block |
||
336 | 336 | } |
337 | 337 | |
338 | 338 | // Retrieve logs based on specific timeframe |
339 | - if ( !empty ( $query_args['date_query'] ) && is_array( $query_args['date_query'] ) ) { |
|
340 | - if ( ! empty( $query_args['date_query']['start_date'] ) ) { |
|
341 | - $query_args['date_query']['after'] = array( |
|
342 | - 'year' => date( 'Y', strtotime( $query_args['date_query']['start_date'] ) ), |
|
343 | - 'month' => date( 'm', strtotime( $query_args['date_query']['start_date'] ) ), |
|
344 | - 'day' => date( 'd', strtotime( $query_args['date_query']['start_date'] ) ) |
|
339 | + if ( ! empty ($query_args['date_query']) && is_array($query_args['date_query'])) { |
|
340 | + if ( ! empty($query_args['date_query']['start_date'])) { |
|
341 | + $query_args['date_query']['after'] = array( |
|
342 | + 'year' => date('Y', strtotime($query_args['date_query']['start_date'])), |
|
343 | + 'month' => date('m', strtotime($query_args['date_query']['start_date'])), |
|
344 | + 'day' => date('d', strtotime($query_args['date_query']['start_date'])) |
|
345 | 345 | ); |
346 | 346 | } |
347 | 347 | |
348 | - if ( ! empty( $query_args['date_query']['end_date'] ) ) { |
|
349 | - $query_args['date_query']['before'] = array( |
|
350 | - 'year' => date( 'Y', strtotime( $query_args['date_query']['end_date'] ) ), |
|
351 | - 'month' => date( 'm', strtotime( $query_args['date_query']['end_date'] ) ), |
|
352 | - 'day' => date( 'd', strtotime( $query_args['date_query']['end_date'] ) ) |
|
348 | + if ( ! empty($query_args['date_query']['end_date'])) { |
|
349 | + $query_args['date_query']['before'] = array( |
|
350 | + 'year' => date('Y', strtotime($query_args['date_query']['end_date'])), |
|
351 | + 'month' => date('m', strtotime($query_args['date_query']['end_date'])), |
|
352 | + 'day' => date('d', strtotime($query_args['date_query']['end_date'])) |
|
353 | 353 | ); |
354 | 354 | } |
355 | 355 | $query_args['date_query']['inclusive'] = true; |
356 | 356 | } |
357 | 357 | |
358 | - $logs = get_posts( $query_args ); |
|
358 | + $logs = get_posts($query_args); |
|
359 | 359 | |
360 | - if ( $logs ) { |
|
360 | + if ($logs) { |
|
361 | 361 | return $logs; |
362 | 362 | } |
363 | 363 | |
@@ -380,20 +380,20 @@ discard block |
||
380 | 380 | * |
381 | 381 | * @return int Log count. |
382 | 382 | */ |
383 | - public function get_log_count( $object_id = 0, $type = null, $meta_query = null, $date_query = null ) { |
|
383 | + public function get_log_count($object_id = 0, $type = null, $meta_query = null, $date_query = null) { |
|
384 | 384 | |
385 | 385 | $query_args = array( |
386 | 386 | 'post_type' => 'give_log', |
387 | - 'posts_per_page' => - 1, |
|
387 | + 'posts_per_page' => -1, |
|
388 | 388 | 'post_status' => 'publish', |
389 | 389 | 'fields' => 'ids', |
390 | 390 | ); |
391 | 391 | |
392 | - if ( $object_id ) { |
|
392 | + if ($object_id) { |
|
393 | 393 | $query_args['post_parent'] = $object_id; |
394 | 394 | } |
395 | 395 | |
396 | - if ( ! empty( $type ) && $this->valid_type( $type ) ) { |
|
396 | + if ( ! empty($type) && $this->valid_type($type)) { |
|
397 | 397 | $query_args['tax_query'] = array( |
398 | 398 | array( |
399 | 399 | 'taxonomy' => 'give_log_type', |
@@ -403,24 +403,24 @@ discard block |
||
403 | 403 | ); |
404 | 404 | } |
405 | 405 | |
406 | - if ( ! empty( $meta_query ) ) { |
|
406 | + if ( ! empty($meta_query)) { |
|
407 | 407 | $query_args['meta_query'] = $meta_query; |
408 | 408 | } |
409 | 409 | |
410 | - if ( ! empty( $date_query ) ) { |
|
410 | + if ( ! empty($date_query)) { |
|
411 | 411 | $query_args['date_query'] = $date_query; |
412 | 412 | } |
413 | 413 | |
414 | 414 | // Get cache key for current query. |
415 | - $cache_key = Give_Cache::get_key( 'get_log_count', $query_args ); |
|
415 | + $cache_key = Give_Cache::get_key('get_log_count', $query_args); |
|
416 | 416 | |
417 | 417 | // check if cache already exist or not. |
418 | - if ( ! ( $logs_count = Give_Cache::get( $cache_key ) ) ) { |
|
419 | - $logs = new WP_Query( $query_args ); |
|
418 | + if ( ! ($logs_count = Give_Cache::get($cache_key))) { |
|
419 | + $logs = new WP_Query($query_args); |
|
420 | 420 | $logs_count = (int) $logs->post_count; |
421 | 421 | |
422 | 422 | // Cache results. |
423 | - Give_Cache::set( $cache_key, $logs_count ); |
|
423 | + Give_Cache::set($cache_key, $logs_count); |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | return $logs_count; |
@@ -440,16 +440,16 @@ discard block |
||
440 | 440 | * |
441 | 441 | * @return void |
442 | 442 | */ |
443 | - public function delete_logs( $object_id = 0, $type = null, $meta_query = null ) { |
|
443 | + public function delete_logs($object_id = 0, $type = null, $meta_query = null) { |
|
444 | 444 | $query_args = array( |
445 | 445 | 'post_parent' => $object_id, |
446 | 446 | 'post_type' => 'give_log', |
447 | - 'posts_per_page' => - 1, |
|
447 | + 'posts_per_page' => -1, |
|
448 | 448 | 'post_status' => 'publish', |
449 | 449 | 'fields' => 'ids', |
450 | 450 | ); |
451 | 451 | |
452 | - if ( ! empty( $type ) && $this->valid_type( $type ) ) { |
|
452 | + if ( ! empty($type) && $this->valid_type($type)) { |
|
453 | 453 | $query_args['tax_query'] = array( |
454 | 454 | array( |
455 | 455 | 'taxonomy' => 'give_log_type', |
@@ -459,15 +459,15 @@ discard block |
||
459 | 459 | ); |
460 | 460 | } |
461 | 461 | |
462 | - if ( ! empty( $meta_query ) ) { |
|
462 | + if ( ! empty($meta_query)) { |
|
463 | 463 | $query_args['meta_query'] = $meta_query; |
464 | 464 | } |
465 | 465 | |
466 | - $logs = get_posts( $query_args ); |
|
466 | + $logs = get_posts($query_args); |
|
467 | 467 | |
468 | - if ( $logs ) { |
|
469 | - foreach ( $logs as $log ) { |
|
470 | - wp_delete_post( $log, true ); |
|
468 | + if ($logs) { |
|
469 | + foreach ($logs as $log) { |
|
470 | + wp_delete_post($log, true); |
|
471 | 471 | } |
472 | 472 | } |
473 | 473 | } |
@@ -480,9 +480,9 @@ discard block |
||
480 | 480 | * |
481 | 481 | * @param int $post_id |
482 | 482 | */ |
483 | - public function background_process_delete_cache( $post_id ) { |
|
483 | + public function background_process_delete_cache($post_id) { |
|
484 | 484 | // Delete log cache immediately |
485 | - wp_schedule_single_event( time() - 5, 'give_delete_log_cache' ); |
|
485 | + wp_schedule_single_event(time() - 5, 'give_delete_log_cache'); |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | /** |
@@ -510,11 +510,11 @@ discard block |
||
510 | 510 | ); |
511 | 511 | |
512 | 512 | // Bailout. |
513 | - if ( empty( $cache_option_names ) ) { |
|
513 | + if (empty($cache_option_names)) { |
|
514 | 514 | return false; |
515 | 515 | } |
516 | 516 | |
517 | - Give_Cache::delete( $cache_option_names ); |
|
517 | + Give_Cache::delete($cache_option_names); |
|
518 | 518 | } |
519 | 519 | } |
520 | 520 | |
@@ -536,10 +536,10 @@ discard block |
||
536 | 536 | * |
537 | 537 | * @return int ID of the new log entry. |
538 | 538 | */ |
539 | -function give_record_log( $title = '', $message = '', $parent = 0, $type = null ) { |
|
539 | +function give_record_log($title = '', $message = '', $parent = 0, $type = null) { |
|
540 | 540 | /* @var Give_Logging $give_logs */ |
541 | 541 | global $give_logs; |
542 | - $log = $give_logs->add( $title, $message, $parent, $type ); |
|
542 | + $log = $give_logs->add($title, $message, $parent, $type); |
|
543 | 543 | |
544 | 544 | return $log; |
545 | 545 | } |