@@ -42,16 +42,16 @@ |
||
42 | 42 | 'minWidth' => 320, |
43 | 43 | 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ), |
44 | 44 | ), |
45 | - array( |
|
46 | - 'type' => 'container', |
|
47 | - 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ), |
|
48 | - ), |
|
49 | - array( |
|
50 | - 'type' => 'textbox', |
|
51 | - 'name' => 'logout-redirect', |
|
52 | - 'minWidth' => 320, |
|
53 | - 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ), |
|
54 | - ), |
|
45 | + array( |
|
46 | + 'type' => 'container', |
|
47 | + 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ), |
|
48 | + ), |
|
49 | + array( |
|
50 | + 'type' => 'textbox', |
|
51 | + 'name' => 'logout-redirect', |
|
52 | + 'minWidth' => 320, |
|
53 | + 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ), |
|
54 | + ), |
|
55 | 55 | ); |
56 | 56 | } |
57 | 57 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Login extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['title'] = esc_html__( 'Login', 'give' ); |
|
22 | - $this->shortcode['label'] = esc_html__( 'Login', 'give' ); |
|
21 | + $this->shortcode['title'] = esc_html__('Login', 'give'); |
|
22 | + $this->shortcode['label'] = esc_html__('Login', 'give'); |
|
23 | 23 | |
24 | - parent::__construct( 'give_login' ); |
|
24 | + parent::__construct('give_login'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -34,23 +34,23 @@ discard block |
||
34 | 34 | return array( |
35 | 35 | array( |
36 | 36 | 'type' => 'container', |
37 | - 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Login Redirect URL (optional):', 'give' ) ), |
|
37 | + 'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Login Redirect URL (optional):', 'give')), |
|
38 | 38 | ), |
39 | 39 | array( |
40 | 40 | 'type' => 'textbox', |
41 | 41 | 'name' => 'login-redirect', |
42 | 42 | 'minWidth' => 320, |
43 | - 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ), |
|
43 | + 'tooltip' => esc_attr__('Enter an URL here to redirect to after login.', 'give'), |
|
44 | 44 | ), |
45 | 45 | array( |
46 | 46 | 'type' => 'container', |
47 | - 'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ), |
|
47 | + 'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Logout Redirect URL (optional):', 'give')), |
|
48 | 48 | ), |
49 | 49 | array( |
50 | 50 | 'type' => 'textbox', |
51 | 51 | 'name' => 'logout-redirect', |
52 | 52 | 'minWidth' => 320, |
53 | - 'tooltip' => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ), |
|
53 | + 'tooltip' => esc_attr__('Enter an URL here to redirect to after logout.', 'give'), |
|
54 | 54 | ), |
55 | 55 | ); |
56 | 56 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @since 1.3.0 |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) or exit; |
|
12 | +defined('ABSPATH') or exit; |
|
13 | 13 | |
14 | 14 | class Give_Shortcode_Donation_History extends Give_Shortcode_Generator { |
15 | 15 | |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - $this->shortcode['label'] = esc_attr__( 'Donation History', 'give' ); |
|
21 | + $this->shortcode['label'] = esc_attr__('Donation History', 'give'); |
|
22 | 22 | |
23 | - parent::__construct( 'donation_history' ); |
|
23 | + parent::__construct('donation_history'); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 |
@@ -248,8 +248,8 @@ |
||
248 | 248 | |
249 | 249 | // do not reindex array! |
250 | 250 | $field['options'] = array( |
251 | - '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ), |
|
252 | - ) + $field['options']; |
|
251 | + '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ), |
|
252 | + ) + $field['options']; |
|
253 | 253 | |
254 | 254 | foreach ( $field['options'] as $value => $text ) { |
255 | 255 | $new_listbox['values'][] = array( |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @since 1.3.0 |
12 | 12 | */ |
13 | 13 | |
14 | -defined( 'ABSPATH' ) or exit; |
|
14 | +defined('ABSPATH') or exit; |
|
15 | 15 | |
16 | 16 | abstract class Give_Shortcode_Generator { |
17 | 17 | |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @since 1.0 |
59 | 59 | */ |
60 | - public function __construct( $shortcode ) { |
|
60 | + public function __construct($shortcode) { |
|
61 | 61 | |
62 | 62 | |
63 | 63 | $this->shortcode_tag = $shortcode; |
64 | 64 | |
65 | - add_action( 'admin_init', array( $this, 'init' ) ); |
|
65 | + add_action('admin_init', array($this, 'init')); |
|
66 | 66 | |
67 | 67 | } |
68 | 68 | |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function init() { |
75 | 75 | |
76 | - if ( $this->shortcode_tag ) { |
|
76 | + if ($this->shortcode_tag) { |
|
77 | 77 | |
78 | - $this->self = get_class( $this ); |
|
78 | + $this->self = get_class($this); |
|
79 | 79 | |
80 | 80 | $this->errors = array(); |
81 | 81 | $this->required = array(); |
@@ -84,18 +84,18 @@ discard block |
||
84 | 84 | $fields = $this->get_fields(); |
85 | 85 | |
86 | 86 | $defaults = array( |
87 | - 'btn_close' => esc_html__( 'Close', 'give' ), |
|
88 | - 'btn_okay' => esc_html__( 'Insert Shortcode', 'give' ), |
|
87 | + 'btn_close' => esc_html__('Close', 'give'), |
|
88 | + 'btn_okay' => esc_html__('Insert Shortcode', 'give'), |
|
89 | 89 | 'errors' => $this->errors, |
90 | 90 | 'fields' => $fields, |
91 | - 'label' => '[' . $this->shortcode_tag . ']', |
|
91 | + 'label' => '['.$this->shortcode_tag.']', |
|
92 | 92 | 'required' => $this->required, |
93 | - 'title' => esc_html__( 'Insert Shortcode', 'give' ), |
|
93 | + 'title' => esc_html__('Insert Shortcode', 'give'), |
|
94 | 94 | ); |
95 | 95 | |
96 | - if ( user_can_richedit() ) { |
|
96 | + if (user_can_richedit()) { |
|
97 | 97 | |
98 | - Give_Shortcode_Button::$shortcodes[ $this->shortcode_tag ] = wp_parse_args( $this->shortcode, $defaults ); |
|
98 | + Give_Shortcode_Button::$shortcodes[$this->shortcode_tag] = wp_parse_args($this->shortcode, $defaults); |
|
99 | 99 | |
100 | 100 | } |
101 | 101 | } |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | * |
125 | 125 | * @since 1.0 |
126 | 126 | */ |
127 | - protected function generate_fields( $defined_fields ) { |
|
127 | + protected function generate_fields($defined_fields) { |
|
128 | 128 | |
129 | 129 | $fields = array(); |
130 | 130 | |
131 | - if ( is_array( $defined_fields ) ) { |
|
131 | + if (is_array($defined_fields)) { |
|
132 | 132 | |
133 | - foreach ( $defined_fields as $field ) { |
|
133 | + foreach ($defined_fields as $field) { |
|
134 | 134 | |
135 | 135 | $defaults = array( |
136 | 136 | 'label' => false, |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | 'type' => '', |
142 | 142 | ); |
143 | 143 | |
144 | - $field = wp_parse_args( (array) $field, $defaults ); |
|
145 | - $method = 'generate_' . strtolower( $field['type'] ); |
|
144 | + $field = wp_parse_args((array) $field, $defaults); |
|
145 | + $method = 'generate_'.strtolower($field['type']); |
|
146 | 146 | |
147 | - if ( method_exists( $this, $method ) ) { |
|
147 | + if (method_exists($this, $method)) { |
|
148 | 148 | |
149 | - $field = call_user_func( array( $this, $method ), $field ); |
|
149 | + $field = call_user_func(array($this, $method), $field); |
|
150 | 150 | |
151 | - if ( $field ) { |
|
151 | + if ($field) { |
|
152 | 152 | $fields[] = $field; |
153 | 153 | } |
154 | 154 | } |
@@ -168,22 +168,22 @@ discard block |
||
168 | 168 | protected function get_fields() { |
169 | 169 | |
170 | 170 | $defined_fields = $this->define_fields(); |
171 | - $generated_fields = $this->generate_fields( $defined_fields ); |
|
171 | + $generated_fields = $this->generate_fields($defined_fields); |
|
172 | 172 | |
173 | 173 | $errors = array(); |
174 | 174 | |
175 | - if ( ! empty( $this->errors ) ) { |
|
176 | - foreach ( $this->required as $name => $alert ) { |
|
177 | - if ( false === array_search( $name, array_column( $generated_fields, 'name' ) ) ) { |
|
175 | + if ( ! empty($this->errors)) { |
|
176 | + foreach ($this->required as $name => $alert) { |
|
177 | + if (false === array_search($name, array_column($generated_fields, 'name'))) { |
|
178 | 178 | |
179 | - $errors[] = $this->errors[ $name ]; |
|
179 | + $errors[] = $this->errors[$name]; |
|
180 | 180 | } |
181 | 181 | } |
182 | 182 | |
183 | 183 | $this->errors = $errors; |
184 | 184 | } |
185 | 185 | |
186 | - if ( ! empty( $errors ) ) { |
|
186 | + if ( ! empty($errors)) { |
|
187 | 187 | |
188 | 188 | return $errors; |
189 | 189 | } |
@@ -200,9 +200,9 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @since 1.0 |
202 | 202 | */ |
203 | - protected function generate_container( $field ) { |
|
203 | + protected function generate_container($field) { |
|
204 | 204 | |
205 | - if ( array_key_exists( 'html', $field ) ) { |
|
205 | + if (array_key_exists('html', $field)) { |
|
206 | 206 | |
207 | 207 | return array( |
208 | 208 | 'type' => $field['type'], |
@@ -222,36 +222,36 @@ discard block |
||
222 | 222 | * |
223 | 223 | * @since 1.0 |
224 | 224 | */ |
225 | - protected function generate_listbox( $field ) { |
|
225 | + protected function generate_listbox($field) { |
|
226 | 226 | |
227 | - $listbox = shortcode_atts( array( |
|
227 | + $listbox = shortcode_atts(array( |
|
228 | 228 | 'label' => '', |
229 | 229 | 'minWidth' => '', |
230 | 230 | 'name' => false, |
231 | 231 | 'tooltip' => '', |
232 | 232 | 'type' => '', |
233 | 233 | 'value' => '', |
234 | - ), $field ); |
|
234 | + ), $field); |
|
235 | 235 | |
236 | - if ( $this->validate( $field ) ) { |
|
236 | + if ($this->validate($field)) { |
|
237 | 237 | |
238 | 238 | $new_listbox = array(); |
239 | 239 | |
240 | - foreach ( $listbox as $key => $value ) { |
|
240 | + foreach ($listbox as $key => $value) { |
|
241 | 241 | |
242 | - if ( $key == 'value' && empty( $value ) ) { |
|
243 | - $new_listbox[ $key ] = $listbox['name']; |
|
244 | - } else if ( $value ) { |
|
245 | - $new_listbox[ $key ] = $value; |
|
242 | + if ($key == 'value' && empty($value)) { |
|
243 | + $new_listbox[$key] = $listbox['name']; |
|
244 | + } else if ($value) { |
|
245 | + $new_listbox[$key] = $value; |
|
246 | 246 | } |
247 | 247 | } |
248 | 248 | |
249 | 249 | // do not reindex array! |
250 | 250 | $field['options'] = array( |
251 | - '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ), |
|
251 | + '' => ($field['placeholder'] ? $field['placeholder'] : esc_attr__('- Select -', 'give')), |
|
252 | 252 | ) + $field['options']; |
253 | 253 | |
254 | - foreach ( $field['options'] as $value => $text ) { |
|
254 | + foreach ($field['options'] as $value => $text) { |
|
255 | 255 | $new_listbox['values'][] = array( |
256 | 256 | 'text' => $text, |
257 | 257 | 'value' => $value, |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | * |
274 | 274 | * @since 1.0 |
275 | 275 | */ |
276 | - protected function generate_post( $field ) { |
|
276 | + protected function generate_post($field) { |
|
277 | 277 | |
278 | 278 | $args = array( |
279 | 279 | 'post_type' => 'post', |
@@ -282,23 +282,23 @@ discard block |
||
282 | 282 | 'posts_per_page' => 30, |
283 | 283 | ); |
284 | 284 | |
285 | - $args = wp_parse_args( (array) $field['query_args'], $args ); |
|
286 | - $posts = get_posts( $args ); |
|
285 | + $args = wp_parse_args((array) $field['query_args'], $args); |
|
286 | + $posts = get_posts($args); |
|
287 | 287 | $options = array(); |
288 | 288 | |
289 | - if ( $posts ) { |
|
290 | - foreach ( $posts as $post ) { |
|
291 | - $options[ absint( $post->ID ) ] = esc_html( $post->post_title ); |
|
289 | + if ($posts) { |
|
290 | + foreach ($posts as $post) { |
|
291 | + $options[absint($post->ID)] = esc_html($post->post_title); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | $field['type'] = 'listbox'; |
295 | 295 | $field['options'] = $options; |
296 | 296 | |
297 | - return $this->generate_listbox( $field ); |
|
297 | + return $this->generate_listbox($field); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | // perform validation here before returning false |
301 | - $this->validate( $field ); |
|
301 | + $this->validate($field); |
|
302 | 302 | |
303 | 303 | return false; |
304 | 304 | } |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | * |
313 | 313 | * @since 1.0 |
314 | 314 | */ |
315 | - protected function generate_textbox( $field ) { |
|
315 | + protected function generate_textbox($field) { |
|
316 | 316 | |
317 | - $textbox = shortcode_atts( array( |
|
317 | + $textbox = shortcode_atts(array( |
|
318 | 318 | 'label' => '', |
319 | 319 | 'maxLength' => '', |
320 | 320 | 'minHeight' => '', |
@@ -324,10 +324,10 @@ discard block |
||
324 | 324 | 'tooltip' => '', |
325 | 325 | 'type' => '', |
326 | 326 | 'value' => '', |
327 | - ), $field ); |
|
327 | + ), $field); |
|
328 | 328 | |
329 | - if ( $this->validate( $field ) ) { |
|
330 | - return array_filter( $textbox, array( $this, 'return_textbox_value' ) ); |
|
329 | + if ($this->validate($field)) { |
|
330 | + return array_filter($textbox, array($this, 'return_textbox_value')); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | return false; |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | * |
341 | 341 | * @return bool |
342 | 342 | */ |
343 | - function return_textbox_value( $value ) { |
|
343 | + function return_textbox_value($value) { |
|
344 | 344 | return $value !== ''; |
345 | 345 | } |
346 | 346 | |
@@ -356,9 +356,9 @@ discard block |
||
356 | 356 | * |
357 | 357 | * @since 1.0 |
358 | 358 | */ |
359 | - protected function validate( $field ) { |
|
359 | + protected function validate($field) { |
|
360 | 360 | |
361 | - extract( shortcode_atts( |
|
361 | + extract(shortcode_atts( |
|
362 | 362 | array( |
363 | 363 | 'name' => false, |
364 | 364 | 'required' => false, |
@@ -366,36 +366,36 @@ discard block |
||
366 | 366 | ), $field ) |
367 | 367 | ); |
368 | 368 | |
369 | - if ( $name ) { |
|
369 | + if ($name) { |
|
370 | 370 | |
371 | - if ( isset( $required['error'] ) ) { |
|
371 | + if (isset($required['error'])) { |
|
372 | 372 | |
373 | 373 | $error = array( |
374 | 374 | 'type' => 'container', |
375 | 375 | 'html' => $required['error'], |
376 | 376 | ); |
377 | 377 | |
378 | - $this->errors[ $name ] = $this->generate_container( $error ); |
|
378 | + $this->errors[$name] = $this->generate_container($error); |
|
379 | 379 | } |
380 | 380 | |
381 | - if ( ! ! $required || is_array( $required ) ) { |
|
381 | + if ( ! ! $required || is_array($required)) { |
|
382 | 382 | |
383 | - $alert = esc_html__( 'Some of the Shortcode options are required.', 'give' ); |
|
383 | + $alert = esc_html__('Some of the Shortcode options are required.', 'give'); |
|
384 | 384 | |
385 | - if ( isset( $required['alert'] ) ) { |
|
385 | + if (isset($required['alert'])) { |
|
386 | 386 | |
387 | 387 | $alert = $required['alert']; |
388 | 388 | |
389 | - } else if ( ! empty( $label ) ) { |
|
389 | + } else if ( ! empty($label)) { |
|
390 | 390 | |
391 | 391 | $alert = sprintf( |
392 | 392 | /* translators: %s: option lable */ |
393 | - __( 'The "%s" option is required.', 'give' ), |
|
394 | - str_replace( ':', '', $label ) |
|
393 | + __('The "%s" option is required.', 'give'), |
|
394 | + str_replace(':', '', $label) |
|
395 | 395 | ); |
396 | 396 | } |
397 | 397 | |
398 | - $this->required[ $name ] = $alert; |
|
398 | + $this->required[$name] = $alert; |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | return true; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @since 1.0 |
36 | 36 | */ |
37 | 37 | public function __construct() { |
38 | - add_action( 'admin_menu', array( $this, 'admin_menus' ) ); |
|
39 | - add_action( 'admin_head', array( $this, 'admin_head' ) ); |
|
40 | - add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
38 | + add_action('admin_menu', array($this, 'admin_menus')); |
|
39 | + add_action('admin_head', array($this, 'admin_head')); |
|
40 | + add_action('admin_init', array($this, 'welcome')); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -51,38 +51,38 @@ discard block |
||
51 | 51 | public function admin_menus() { |
52 | 52 | // About Page |
53 | 53 | add_dashboard_page( |
54 | - esc_html__( 'Welcome to Give', 'give' ), |
|
55 | - esc_html__( 'Welcome to Give', 'give' ), |
|
54 | + esc_html__('Welcome to Give', 'give'), |
|
55 | + esc_html__('Welcome to Give', 'give'), |
|
56 | 56 | $this->minimum_capability, |
57 | 57 | 'give-about', |
58 | - array( $this, 'about_screen' ) |
|
58 | + array($this, 'about_screen') |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | // Changelog Page |
62 | 62 | add_dashboard_page( |
63 | - esc_html__( 'Give Changelog', 'give' ), |
|
64 | - esc_html__( 'Give Changelog', 'give' ), |
|
63 | + esc_html__('Give Changelog', 'give'), |
|
64 | + esc_html__('Give Changelog', 'give'), |
|
65 | 65 | $this->minimum_capability, |
66 | 66 | 'give-changelog', |
67 | - array( $this, 'changelog_screen' ) |
|
67 | + array($this, 'changelog_screen') |
|
68 | 68 | ); |
69 | 69 | |
70 | 70 | // Getting Started Page |
71 | 71 | add_dashboard_page( |
72 | - esc_html__( 'Getting started with Give', 'give' ), |
|
73 | - esc_html__( 'Getting started with Give', 'give' ), |
|
72 | + esc_html__('Getting started with Give', 'give'), |
|
73 | + esc_html__('Getting started with Give', 'give'), |
|
74 | 74 | $this->minimum_capability, |
75 | 75 | 'give-getting-started', |
76 | - array( $this, 'getting_started_screen' ) |
|
76 | + array($this, 'getting_started_screen') |
|
77 | 77 | ); |
78 | 78 | |
79 | 79 | // Credits Page |
80 | 80 | add_dashboard_page( |
81 | - esc_html__( 'The people that build Give', 'give' ), |
|
82 | - esc_html__( 'The people that build Give', 'give' ), |
|
81 | + esc_html__('The people that build Give', 'give'), |
|
82 | + esc_html__('The people that build Give', 'give'), |
|
83 | 83 | $this->minimum_capability, |
84 | 84 | 'give-credits', |
85 | - array( $this, 'credits_screen' ) |
|
85 | + array($this, 'credits_screen') |
|
86 | 86 | ); |
87 | 87 | } |
88 | 88 | |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function admin_head() { |
97 | 97 | |
98 | - remove_submenu_page( 'index.php', 'give-about' ); |
|
99 | - remove_submenu_page( 'index.php', 'give-changelog' ); |
|
100 | - remove_submenu_page( 'index.php', 'give-getting-started' ); |
|
101 | - remove_submenu_page( 'index.php', 'give-credits' ); |
|
98 | + remove_submenu_page('index.php', 'give-about'); |
|
99 | + remove_submenu_page('index.php', 'give-changelog'); |
|
100 | + remove_submenu_page('index.php', 'give-getting-started'); |
|
101 | + remove_submenu_page('index.php', 'give-credits'); |
|
102 | 102 | |
103 | 103 | // Badge for welcome page |
104 | - $badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png'; |
|
104 | + $badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png'; |
|
105 | 105 | |
106 | 106 | ?> |
107 | 107 | <style type="text/css" media="screen"> |
@@ -215,20 +215,20 @@ discard block |
||
215 | 215 | * @return void |
216 | 216 | */ |
217 | 217 | public function tabs() { |
218 | - $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about'; |
|
218 | + $selected = isset($_GET['page']) ? $_GET['page'] : 'give-about'; |
|
219 | 219 | ?> |
220 | 220 | <h1 class="nav-tab-wrapper"> |
221 | - <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>"> |
|
222 | - <?php esc_html_e( 'About Give', 'give' ); ?> |
|
221 | + <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>"> |
|
222 | + <?php esc_html_e('About Give', 'give'); ?> |
|
223 | 223 | </a> |
224 | - <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>"> |
|
225 | - <?php esc_html_e( 'Getting Started', 'give' ); ?> |
|
224 | + <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>"> |
|
225 | + <?php esc_html_e('Getting Started', 'give'); ?> |
|
226 | 226 | </a> |
227 | - <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>"> |
|
228 | - <?php esc_html_e( 'Credits', 'give' ); ?> |
|
227 | + <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>"> |
|
228 | + <?php esc_html_e('Credits', 'give'); ?> |
|
229 | 229 | </a> |
230 | - <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>"> |
|
231 | - <?php esc_html_e( 'Add-ons', 'give' ); ?> |
|
230 | + <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>"> |
|
231 | + <?php esc_html_e('Add-ons', 'give'); ?> |
|
232 | 232 | </a> |
233 | 233 | </h1> |
234 | 234 | <?php |
@@ -242,13 +242,13 @@ discard block |
||
242 | 242 | * @return void |
243 | 243 | */ |
244 | 244 | public function about_screen() { |
245 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
245 | + list($display_version) = explode('-', GIVE_VERSION); |
|
246 | 246 | ?> |
247 | 247 | <div class="wrap about-wrap"> |
248 | 248 | <h1 class="welcome-h1"><?php |
249 | 249 | printf( |
250 | 250 | /* translators: %s: Give version */ |
251 | - esc_html__( 'Welcome to Give %s', 'give' ), |
|
251 | + esc_html__('Welcome to Give %s', 'give'), |
|
252 | 252 | $display_version |
253 | 253 | ); |
254 | 254 | ?></h1> |
@@ -258,20 +258,20 @@ discard block |
||
258 | 258 | <div class="about-text"><?php |
259 | 259 | printf( |
260 | 260 | /* translators: 1: https://givewp.com/documenation/ 2: title attribute text */ |
261 | - __( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ), |
|
262 | - esc_url( 'https://givewp.com/documenation/' ), |
|
263 | - esc_attr__( 'View the Give plugin documentation online', 'give' ) |
|
261 | + __('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'), |
|
262 | + esc_url('https://givewp.com/documenation/'), |
|
263 | + esc_attr__('View the Give plugin documentation online', 'give') |
|
264 | 264 | ); |
265 | 265 | ?></div> |
266 | 266 | |
267 | - <p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p> |
|
267 | + <p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p> |
|
268 | 268 | |
269 | 269 | <?php give_get_newsletter() ?> |
270 | 270 | |
271 | 271 | <div class="give-badge"><?php |
272 | 272 | printf( |
273 | 273 | /* translators: %s: Give version */ |
274 | - esc_html__( 'Version %s', 'give' ), |
|
274 | + esc_html__('Version %s', 'give'), |
|
275 | 275 | $display_version |
276 | 276 | ); |
277 | 277 | ?></div> |
@@ -283,15 +283,15 @@ discard block |
||
283 | 283 | <div class="feature-section clearfix introduction"> |
284 | 284 | |
285 | 285 | <div class="video feature-section-item"> |
286 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form"> |
|
286 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form"> |
|
287 | 287 | |
288 | 288 | </div> |
289 | 289 | |
290 | 290 | <div class="content feature-section-item last-feature"> |
291 | 291 | |
292 | - <h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3> |
|
292 | + <h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3> |
|
293 | 293 | |
294 | - <p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p> |
|
294 | + <p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p> |
|
295 | 295 | <a href="https://givewp.com" target="_blank" class="button-secondary" title="Visit the Give Website">Learn More |
296 | 296 | <span class="dashicons dashicons-external"></span></a> |
297 | 297 | |
@@ -304,9 +304,9 @@ discard block |
||
304 | 304 | |
305 | 305 | <div class="content feature-section-item"> |
306 | 306 | |
307 | - <h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3> |
|
307 | + <h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3> |
|
308 | 308 | |
309 | - <p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p> |
|
309 | + <p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p> |
|
310 | 310 | <a href="https://givewp.com/documentation" target="_blank" class="button-secondary" title="Visit the Give Website">View Documentation |
311 | 311 | <span class="dashicons dashicons-external"></span></a> |
312 | 312 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | |
315 | 315 | <div class="content feature-section-item last-feature"> |
316 | 316 | |
317 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give"> |
|
317 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give"> |
|
318 | 318 | |
319 | 319 | </div> |
320 | 320 | |
@@ -334,22 +334,22 @@ discard block |
||
334 | 334 | * @return void |
335 | 335 | */ |
336 | 336 | public function changelog_screen() { |
337 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
337 | + list($display_version) = explode('-', GIVE_VERSION); |
|
338 | 338 | ?> |
339 | 339 | <div class="wrap about-wrap"> |
340 | - <h1><?php esc_html_e( 'Give Changelog', 'give' ); ?></h1> |
|
340 | + <h1><?php esc_html_e('Give Changelog', 'give'); ?></h1> |
|
341 | 341 | |
342 | 342 | <div class="about-text"><?php |
343 | 343 | printf( |
344 | 344 | /* translators: %s: Give version */ |
345 | - esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ), |
|
345 | + esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'), |
|
346 | 346 | $display_version |
347 | 347 | ); |
348 | 348 | ?></div> |
349 | 349 | <div class="give-badge"><?php |
350 | 350 | printf( |
351 | 351 | /* translators: %s: Give version */ |
352 | - esc_html__( 'Version %s', 'give' ), |
|
352 | + esc_html__('Version %s', 'give'), |
|
353 | 353 | $display_version |
354 | 354 | ); |
355 | 355 | ?></div> |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | <?php $this->tabs(); ?> |
358 | 358 | |
359 | 359 | <div class="changelog"> |
360 | - <h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3> |
|
360 | + <h3><?php esc_html_e('Full Changelog', 'give'); ?></h3> |
|
361 | 361 | |
362 | 362 | <div class="feature-section"> |
363 | 363 | <?php echo $this->parse_readme(); ?> |
@@ -365,10 +365,10 @@ discard block |
||
365 | 365 | </div> |
366 | 366 | |
367 | 367 | <div class="return-to-dashboard"> |
368 | - <a href="<?php echo esc_url( admin_url( add_query_arg( array( |
|
368 | + <a href="<?php echo esc_url(admin_url(add_query_arg(array( |
|
369 | 369 | 'post_type' => 'give_forms', |
370 | 370 | 'page' => 'give-settings' |
371 | - ), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Go to Give Settings', 'give' ); ?></a> |
|
371 | + ), 'edit.php'))); ?>"><?php esc_html_e('Go to Give Settings', 'give'); ?></a> |
|
372 | 372 | </div> |
373 | 373 | </div> |
374 | 374 | <?php |
@@ -382,29 +382,29 @@ discard block |
||
382 | 382 | * @return void |
383 | 383 | */ |
384 | 384 | public function getting_started_screen() { |
385 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
385 | + list($display_version) = explode('-', GIVE_VERSION); |
|
386 | 386 | ?> |
387 | 387 | <div class="wrap about-wrap get-started"> |
388 | 388 | <h1 class="welcome-h1"><?php |
389 | 389 | printf( |
390 | 390 | /* translators: %s: Give version */ |
391 | - esc_html__( 'Give %s - Getting Started Guide', 'give' ), |
|
391 | + esc_html__('Give %s - Getting Started Guide', 'give'), |
|
392 | 392 | $display_version |
393 | 393 | ); |
394 | 394 | ?></h1> |
395 | 395 | |
396 | 396 | <?php give_social_media_elements() ?> |
397 | 397 | |
398 | - <div class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></div> |
|
398 | + <div class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></div> |
|
399 | 399 | |
400 | - <p class="newsletter-intro"><?php esc_html_e( 'Don\'t forget to sign up for the newsletter!', 'give' ); ?>.</p> |
|
400 | + <p class="newsletter-intro"><?php esc_html_e('Don\'t forget to sign up for the newsletter!', 'give'); ?>.</p> |
|
401 | 401 | |
402 | 402 | <?php give_get_newsletter() ?> |
403 | 403 | |
404 | 404 | <div class="give-badge"><?php |
405 | 405 | printf( |
406 | 406 | /* translators: %s: Give version */ |
407 | - esc_html__( 'Version %s', 'give' ), |
|
407 | + esc_html__('Version %s', 'give'), |
|
408 | 408 | $display_version |
409 | 409 | ); |
410 | 410 | ?></div> |
@@ -412,17 +412,17 @@ discard block |
||
412 | 412 | <?php $this->tabs(); ?> |
413 | 413 | |
414 | 414 | |
415 | - <div class="about-text"><?php printf( esc_html__( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></div> |
|
415 | + <div class="about-text"><?php printf(esc_html__('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></div> |
|
416 | 416 | |
417 | 417 | |
418 | 418 | <div class="feature-section clearfix"> |
419 | 419 | |
420 | 420 | <div class="content feature-section-item"> |
421 | - <h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3> |
|
421 | + <h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3> |
|
422 | 422 | |
423 | - <p><?php esc_html_e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p> |
|
423 | + <p><?php esc_html_e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p> |
|
424 | 424 | |
425 | - <p><?php esc_html_e( 'But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give' ); ?></p> |
|
425 | + <p><?php esc_html_e('But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give'); ?></p> |
|
426 | 426 | </div> |
427 | 427 | |
428 | 428 | <div class="content feature-section-item last-feature"> |
@@ -439,9 +439,9 @@ discard block |
||
439 | 439 | </div> |
440 | 440 | |
441 | 441 | <div class="content feature-section-item last-feature"> |
442 | - <h3><?php esc_html_e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3> |
|
442 | + <h3><?php esc_html_e('STEP 2: Choose Your Levels', 'give'); ?></h3> |
|
443 | 443 | |
444 | - <p><?php esc_html_e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p> |
|
444 | + <p><?php esc_html_e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p> |
|
445 | 445 | </div> |
446 | 446 | |
447 | 447 | </div> |
@@ -450,11 +450,11 @@ discard block |
||
450 | 450 | <div class="feature-section clearfix"> |
451 | 451 | |
452 | 452 | <div class="content feature-section-item add-content"> |
453 | - <h3><?php esc_html_e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3> |
|
453 | + <h3><?php esc_html_e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3> |
|
454 | 454 | |
455 | - <p><?php esc_html_e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p> |
|
455 | + <p><?php esc_html_e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p> |
|
456 | 456 | |
457 | - <p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p> |
|
457 | + <p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p> |
|
458 | 458 | </div> |
459 | 459 | |
460 | 460 | <div class="content feature-section-item last-feature"> |
@@ -471,9 +471,9 @@ discard block |
||
471 | 471 | </div> |
472 | 472 | |
473 | 473 | <div class="content feature-section-item last-feature"> |
474 | - <h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3> |
|
474 | + <h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3> |
|
475 | 475 | |
476 | - <p><?php esc_html_e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p> |
|
476 | + <p><?php esc_html_e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p> |
|
477 | 477 | </div> |
478 | 478 | |
479 | 479 | |
@@ -493,38 +493,38 @@ discard block |
||
493 | 493 | * @return void |
494 | 494 | */ |
495 | 495 | public function credits_screen() { |
496 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
496 | + list($display_version) = explode('-', GIVE_VERSION); |
|
497 | 497 | ?> |
498 | 498 | <div class="wrap about-wrap"> |
499 | 499 | <h1 class="welcome-h1"><?php |
500 | 500 | printf( |
501 | 501 | /* translators: %s: Give version */ |
502 | - esc_html__( 'Give %s - Credits', 'give' ), |
|
502 | + esc_html__('Give %s - Credits', 'give'), |
|
503 | 503 | $display_version |
504 | 504 | ); |
505 | 505 | ?></h1> |
506 | 506 | |
507 | 507 | <?php give_social_media_elements() ?> |
508 | 508 | |
509 | - <div class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly. ', 'give' ); ?></div> |
|
509 | + <div class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly. ', 'give'); ?></div> |
|
510 | 510 | |
511 | - <div class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></div> |
|
511 | + <div class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></div> |
|
512 | 512 | |
513 | - <p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p> |
|
513 | + <p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p> |
|
514 | 514 | |
515 | 515 | <?php give_get_newsletter() ?> |
516 | 516 | |
517 | 517 | <div class="give-badge"><?php |
518 | 518 | printf( |
519 | 519 | /* translators: %s: Give version */ |
520 | - esc_html__( 'Version %s', 'give' ), |
|
520 | + esc_html__('Version %s', 'give'), |
|
521 | 521 | $display_version |
522 | 522 | ); |
523 | 523 | ?></div> |
524 | 524 | |
525 | 525 | <?php $this->tabs(); ?> |
526 | 526 | |
527 | - <p class="about-description"><?php printf( __( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ), esc_url( 'https://github.com/WordImpress/give' ) ); ?></p> |
|
527 | + <p class="about-description"><?php printf(__('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'), esc_url('https://github.com/WordImpress/give')); ?></p> |
|
528 | 528 | |
529 | 529 | <?php echo $this->contributors(); ?> |
530 | 530 | </div> |
@@ -539,21 +539,21 @@ discard block |
||
539 | 539 | * @return string $readme HTML formatted readme file |
540 | 540 | */ |
541 | 541 | public function parse_readme() { |
542 | - $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
542 | + $file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null; |
|
543 | 543 | |
544 | - if ( ! $file ) { |
|
545 | - $readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>'; |
|
544 | + if ( ! $file) { |
|
545 | + $readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>'; |
|
546 | 546 | } else { |
547 | - $readme = file_get_contents( $file ); |
|
548 | - $readme = nl2br( esc_html( $readme ) ); |
|
549 | - $readme = explode( '== Changelog ==', $readme ); |
|
550 | - $readme = end( $readme ); |
|
551 | - |
|
552 | - $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme ); |
|
553 | - $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme ); |
|
554 | - $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme ); |
|
555 | - $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme ); |
|
556 | - $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme ); |
|
547 | + $readme = file_get_contents($file); |
|
548 | + $readme = nl2br(esc_html($readme)); |
|
549 | + $readme = explode('== Changelog ==', $readme); |
|
550 | + $readme = end($readme); |
|
551 | + |
|
552 | + $readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme); |
|
553 | + $readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme); |
|
554 | + $readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme); |
|
555 | + $readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme); |
|
556 | + $readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme); |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | return $readme; |
@@ -570,27 +570,27 @@ discard block |
||
570 | 570 | public function contributors() { |
571 | 571 | $contributors = $this->get_contributors(); |
572 | 572 | |
573 | - if ( empty( $contributors ) ) { |
|
573 | + if (empty($contributors)) { |
|
574 | 574 | return ''; |
575 | 575 | } |
576 | 576 | |
577 | 577 | $contributor_list = '<ul class="wp-people-group">'; |
578 | 578 | |
579 | - foreach ( $contributors as $contributor ) { |
|
579 | + foreach ($contributors as $contributor) { |
|
580 | 580 | $contributor_list .= '<li class="wp-person">'; |
581 | - $contributor_list .= sprintf( '<a href="%s" title="%s">', |
|
582 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
581 | + $contributor_list .= sprintf('<a href="%s" title="%s">', |
|
582 | + esc_url('https://github.com/'.$contributor->login), |
|
583 | 583 | esc_html( |
584 | 584 | sprintf( |
585 | 585 | /* translators: %s: github contributor */ |
586 | - esc_html__( 'View %s', 'give' ), |
|
586 | + esc_html__('View %s', 'give'), |
|
587 | 587 | $contributor->login |
588 | 588 | ) |
589 | 589 | ) |
590 | 590 | ); |
591 | - $contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) ); |
|
591 | + $contributor_list .= sprintf('<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url($contributor->avatar_url), esc_html($contributor->login)); |
|
592 | 592 | $contributor_list .= '</a>'; |
593 | - $contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) ); |
|
593 | + $contributor_list .= sprintf('<a class="web" href="%s">%s</a>', esc_url('https://github.com/'.$contributor->login), esc_html($contributor->login)); |
|
594 | 594 | $contributor_list .= '</a>'; |
595 | 595 | $contributor_list .= '</li>'; |
596 | 596 | } |
@@ -608,25 +608,25 @@ discard block |
||
608 | 608 | * @return array $contributors List of contributors |
609 | 609 | */ |
610 | 610 | public function get_contributors() { |
611 | - $contributors = get_transient( 'give_contributors' ); |
|
611 | + $contributors = get_transient('give_contributors'); |
|
612 | 612 | |
613 | - if ( false !== $contributors ) { |
|
613 | + if (false !== $contributors) { |
|
614 | 614 | return $contributors; |
615 | 615 | } |
616 | 616 | |
617 | - $response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) ); |
|
617 | + $response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false)); |
|
618 | 618 | |
619 | - if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { |
|
619 | + if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) { |
|
620 | 620 | return array(); |
621 | 621 | } |
622 | 622 | |
623 | - $contributors = json_decode( wp_remote_retrieve_body( $response ) ); |
|
623 | + $contributors = json_decode(wp_remote_retrieve_body($response)); |
|
624 | 624 | |
625 | - if ( ! is_array( $contributors ) ) { |
|
625 | + if ( ! is_array($contributors)) { |
|
626 | 626 | return array(); |
627 | 627 | } |
628 | 628 | |
629 | - set_transient( 'give_contributors', $contributors, 3600 ); |
|
629 | + set_transient('give_contributors', $contributors, 3600); |
|
630 | 630 | |
631 | 631 | return $contributors; |
632 | 632 | } |
@@ -645,24 +645,24 @@ discard block |
||
645 | 645 | |
646 | 646 | |
647 | 647 | // Bail if no activation redirect |
648 | - if ( ! get_transient( '_give_activation_redirect' ) ) { |
|
648 | + if ( ! get_transient('_give_activation_redirect')) { |
|
649 | 649 | return; |
650 | 650 | } |
651 | 651 | |
652 | 652 | // Delete the redirect transient |
653 | - delete_transient( '_give_activation_redirect' ); |
|
653 | + delete_transient('_give_activation_redirect'); |
|
654 | 654 | |
655 | 655 | // Bail if activating from network, or bulk |
656 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
656 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
657 | 657 | return; |
658 | 658 | } |
659 | 659 | |
660 | - $upgrade = get_option( 'give_version_upgraded_from' ); |
|
660 | + $upgrade = get_option('give_version_upgraded_from'); |
|
661 | 661 | |
662 | - if ( ! $upgrade ) { // First time install |
|
663 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
662 | + if ( ! $upgrade) { // First time install |
|
663 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
664 | 664 | exit; |
665 | - } elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings |
|
665 | + } elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings |
|
666 | 666 | |
667 | 667 | } else { // Welcome is NOT disabled in settings |
668 | 668 | wp_safe_redirect(admin_url('index.php?page=give-about')); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | // Exit if accessed directly |
11 | -if ( ! defined( 'ABSPATH' ) ) { |
|
11 | +if ( ! defined('ABSPATH')) { |
|
12 | 12 | exit; |
13 | 13 | } |
14 | 14 | |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @param $_banner_details |
28 | 28 | */ |
29 | - function __construct( $_banner_details ) { |
|
29 | + function __construct($_banner_details) { |
|
30 | 30 | |
31 | 31 | global $current_user; |
32 | 32 | $this->banner_details = $_banner_details; |
33 | - $this->test_mode = ( $this->banner_details['testing'] == 'true' ) ? true : false; |
|
34 | - $this->nag_meta_key = 'give_addon_activation_ignore_' . sanitize_title( $this->banner_details['name'] ); |
|
33 | + $this->test_mode = ($this->banner_details['testing'] == 'true') ? true : false; |
|
34 | + $this->nag_meta_key = 'give_addon_activation_ignore_'.sanitize_title($this->banner_details['name']); |
|
35 | 35 | |
36 | 36 | //Get current user |
37 | 37 | $this->user_id = $current_user->ID; |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | public function init() { |
51 | 51 | |
52 | 52 | //Testing? |
53 | - if ( $this->test_mode ) { |
|
54 | - delete_user_meta( $this->user_id, $this->nag_meta_key ); |
|
53 | + if ($this->test_mode) { |
|
54 | + delete_user_meta($this->user_id, $this->nag_meta_key); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | //Get the current page to add the notice to |
58 | - add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) ); |
|
59 | - add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) ); |
|
58 | + add_action('current_screen', array($this, 'give_addon_notice_ignore')); |
|
59 | + add_action('admin_notices', array($this, 'give_addon_activation_admin_notice')); |
|
60 | 60 | |
61 | 61 | |
62 | 62 | } |
@@ -71,13 +71,13 @@ discard block |
||
71 | 71 | global $pagenow; |
72 | 72 | |
73 | 73 | //Make sure we're on the plugins page. |
74 | - if ( $pagenow !== 'plugins.php' ) { |
|
74 | + if ($pagenow !== 'plugins.php') { |
|
75 | 75 | return false; |
76 | 76 | } |
77 | 77 | |
78 | 78 | // If the user hasn't already dismissed our alert, |
79 | 79 | // Output the activation banner |
80 | - if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) { ?> |
|
80 | + if ( ! get_user_meta($this->user_id, $this->nag_meta_key)) { ?> |
|
81 | 81 | |
82 | 82 | <!-- * I output inline styles here |
83 | 83 | * because there's no reason to keep these |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | <h3><?php |
158 | 158 | printf( |
159 | 159 | /* translators: %s: Add-on name */ |
160 | - __( "Thank you for installing Give's %s Add-on!", 'give' ), |
|
161 | - '<span>' . $this->banner_details['name'] . '</span>' |
|
160 | + __("Thank you for installing Give's %s Add-on!", 'give'), |
|
161 | + '<span>'.$this->banner_details['name'].'</span>' |
|
162 | 162 | ); |
163 | 163 | ?></h3> |
164 | 164 | |
165 | 165 | <a href="<?php |
166 | 166 | //The Dismiss Button |
167 | - $nag_admin_dismiss_url = 'plugins.php?' . $this->nag_meta_key . '=0'; |
|
168 | - echo admin_url( $nag_admin_dismiss_url ); ?>" class="dismiss"><span class="dashicons dashicons-dismiss"></span></a> |
|
167 | + $nag_admin_dismiss_url = 'plugins.php?'.$this->nag_meta_key.'=0'; |
|
168 | + echo admin_url($nag_admin_dismiss_url); ?>" class="dismiss"><span class="dashicons dashicons-dismiss"></span></a> |
|
169 | 169 | |
170 | 170 | <!-- * Now we output a few "actions" |
171 | 171 | * that the user can take from here --> |
@@ -173,21 +173,21 @@ discard block |
||
173 | 173 | <div class="alert-actions"> |
174 | 174 | |
175 | 175 | <?php //Point them to your settings page |
176 | - if ( isset( $this->banner_details['settings_url'] ) ) { ?> |
|
176 | + if (isset($this->banner_details['settings_url'])) { ?> |
|
177 | 177 | <a href="<?php echo $this->banner_details['settings_url']; ?>"> |
178 | - <span class="dashicons dashicons-admin-settings"></span><?php esc_html_e( 'Go to Settings', 'give' ); ?> |
|
178 | + <span class="dashicons dashicons-admin-settings"></span><?php esc_html_e('Go to Settings', 'give'); ?> |
|
179 | 179 | </a> |
180 | 180 | <?php } ?> |
181 | 181 | |
182 | 182 | <?php |
183 | 183 | // Show them how to configure the Addon |
184 | - if ( isset( $this->banner_details['documentation_url'] ) ) { ?> |
|
184 | + if (isset($this->banner_details['documentation_url'])) { ?> |
|
185 | 185 | <a href="<?php echo $this->banner_details['documentation_url'] ?>" target="_blank"> |
186 | 186 | <span class="dashicons dashicons-media-text"></span> |
187 | 187 | <?php |
188 | 188 | printf( |
189 | 189 | /* translators: %s: Add-on name */ |
190 | - esc_html__( 'Documentation: %s Add-on', 'give' ), |
|
190 | + esc_html__('Documentation: %s Add-on', 'give'), |
|
191 | 191 | $this->banner_details['name'] |
192 | 192 | ); |
193 | 193 | ?> |
@@ -195,10 +195,10 @@ discard block |
||
195 | 195 | <?php } ?> |
196 | 196 | <?php |
197 | 197 | //Let them signup for plugin updates |
198 | - if ( isset( $this->banner_details['support_url'] ) ) { ?> |
|
198 | + if (isset($this->banner_details['support_url'])) { ?> |
|
199 | 199 | |
200 | 200 | <a href="<?php echo $this->banner_details['support_url'] ?>" target="_blank"> |
201 | - <span class="dashicons dashicons-sos"></span><?php esc_html_e( 'Get Support', 'give' ); ?> |
|
201 | + <span class="dashicons dashicons-sos"></span><?php esc_html_e('Get Support', 'give'); ?> |
|
202 | 202 | </a> |
203 | 203 | |
204 | 204 | <?php } ?> |
@@ -220,13 +220,13 @@ discard block |
||
220 | 220 | /* If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not. |
221 | 221 | * See here: http://codex.wordpress.org/Function_Reference/add_user_meta |
222 | 222 | */ |
223 | - if ( isset( $_GET[ $this->nag_meta_key ] ) && '0' == $_GET[ $this->nag_meta_key ] ) { |
|
223 | + if (isset($_GET[$this->nag_meta_key]) && '0' == $_GET[$this->nag_meta_key]) { |
|
224 | 224 | |
225 | 225 | //Get the global user |
226 | 226 | global $current_user; |
227 | 227 | $user_id = $current_user->ID; |
228 | 228 | |
229 | - add_user_meta( $user_id, $this->nag_meta_key, 'true', true ); |
|
229 | + add_user_meta($user_id, $this->nag_meta_key, 'true', true); |
|
230 | 230 | } |
231 | 231 | } |
232 | 232 |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
18 | -require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export.php'; |
|
19 | -require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/export-actions.php'; |
|
18 | +require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export.php'; |
|
19 | +require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/export-actions.php'; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Process batch exports via ajax |
@@ -26,79 +26,79 @@ discard block |
||
26 | 26 | */ |
27 | 27 | function give_do_ajax_export() { |
28 | 28 | |
29 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php'; |
|
29 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php'; |
|
30 | 30 | |
31 | - parse_str( $_POST['form'], $form ); |
|
31 | + parse_str($_POST['form'], $form); |
|
32 | 32 | |
33 | 33 | $_REQUEST = $form = (array) $form; |
34 | 34 | |
35 | - if ( ! wp_verify_nonce( $_REQUEST['give_ajax_export'], 'give_ajax_export' ) ) { |
|
36 | - die( '-2' ); |
|
35 | + if ( ! wp_verify_nonce($_REQUEST['give_ajax_export'], 'give_ajax_export')) { |
|
36 | + die('-2'); |
|
37 | 37 | } |
38 | 38 | |
39 | - do_action( 'give_batch_export_class_include', $form['give-export-class'] ); |
|
39 | + do_action('give_batch_export_class_include', $form['give-export-class']); |
|
40 | 40 | |
41 | - $step = absint( $_POST['step'] ); |
|
42 | - $class = sanitize_text_field( $form['give-export-class'] ); |
|
41 | + $step = absint($_POST['step']); |
|
42 | + $class = sanitize_text_field($form['give-export-class']); |
|
43 | 43 | |
44 | - $export = new $class( $step ); |
|
44 | + $export = new $class($step); |
|
45 | 45 | |
46 | - if ( ! $export->can_export() ) { |
|
47 | - die( '-1' ); |
|
46 | + if ( ! $export->can_export()) { |
|
47 | + die('-1'); |
|
48 | 48 | } |
49 | 49 | |
50 | - if ( ! $export->is_writable ) { |
|
50 | + if ( ! $export->is_writable) { |
|
51 | 51 | $json_args = array( |
52 | 52 | 'error' => true, |
53 | - 'message' => esc_html__( 'Export location or file not writable.', 'give' ) |
|
53 | + 'message' => esc_html__('Export location or file not writable.', 'give') |
|
54 | 54 | ); |
55 | 55 | echo json_encode($json_args); |
56 | 56 | exit; |
57 | 57 | } |
58 | 58 | |
59 | - $export->set_properties( $_REQUEST ); |
|
59 | + $export->set_properties($_REQUEST); |
|
60 | 60 | |
61 | 61 | $export->pre_fetch(); |
62 | 62 | |
63 | - $ret = $export->process_step( $step ); |
|
63 | + $ret = $export->process_step($step); |
|
64 | 64 | |
65 | 65 | $percentage = $export->get_percentage_complete(); |
66 | 66 | |
67 | - if ( $ret ) { |
|
67 | + if ($ret) { |
|
68 | 68 | |
69 | 69 | $step += 1; |
70 | - echo json_encode( array( 'step' => $step, 'percentage' => $percentage ) ); |
|
70 | + echo json_encode(array('step' => $step, 'percentage' => $percentage)); |
|
71 | 71 | exit; |
72 | 72 | |
73 | - } elseif ( true === $export->is_empty ) { |
|
73 | + } elseif (true === $export->is_empty) { |
|
74 | 74 | |
75 | - echo json_encode( array( |
|
75 | + echo json_encode(array( |
|
76 | 76 | 'error' => true, |
77 | - 'message' => esc_html__( 'No data found for export parameters.', 'give' ) |
|
78 | - ) ); |
|
77 | + 'message' => esc_html__('No data found for export parameters.', 'give') |
|
78 | + )); |
|
79 | 79 | exit; |
80 | 80 | |
81 | - } elseif ( true === $export->done && true === $export->is_void ) { |
|
81 | + } elseif (true === $export->done && true === $export->is_void) { |
|
82 | 82 | |
83 | - $message = ! empty( $export->message ) ? $export->message : esc_html__( 'Batch Processing Complete.', 'give' ); |
|
84 | - echo json_encode( array( 'success' => true, 'message' => $message ) ); |
|
83 | + $message = ! empty($export->message) ? $export->message : esc_html__('Batch Processing Complete.', 'give'); |
|
84 | + echo json_encode(array('success' => true, 'message' => $message)); |
|
85 | 85 | exit; |
86 | 86 | |
87 | 87 | } else { |
88 | 88 | |
89 | - $args = array_merge( $_REQUEST, array( |
|
89 | + $args = array_merge($_REQUEST, array( |
|
90 | 90 | 'step' => $step, |
91 | 91 | 'class' => $class, |
92 | - 'nonce' => wp_create_nonce( 'give-batch-export' ), |
|
92 | + 'nonce' => wp_create_nonce('give-batch-export'), |
|
93 | 93 | 'give_action' => 'form_batch_export', |
94 | - ) ); |
|
94 | + )); |
|
95 | 95 | |
96 | - $download_url = add_query_arg( $args, admin_url() ); |
|
96 | + $download_url = add_query_arg($args, admin_url()); |
|
97 | 97 | |
98 | - echo json_encode( array( 'step' => 'done', 'url' => $download_url ) ); |
|
98 | + echo json_encode(array('step' => 'done', 'url' => $download_url)); |
|
99 | 99 | exit; |
100 | 100 | |
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | -add_action( 'wp_ajax_give_do_ajax_export', 'give_do_ajax_export' ); |
|
104 | +add_action('wp_ajax_give_do_ajax_export', 'give_do_ajax_export'); |
@@ -10,13 +10,13 @@ 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 | |
17 | 17 | // Load WP_List_Table if not loaded |
18 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
19 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
18 | +if ( ! class_exists('WP_List_Table')) { |
|
19 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | global $status, $page; |
46 | 46 | |
47 | 47 | // Set parent defaults |
48 | - parent::__construct( array( |
|
49 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
50 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
48 | + parent::__construct(array( |
|
49 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
50 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
51 | 51 | 'ajax' => false // Does this table support ajax? |
52 | - ) ); |
|
52 | + )); |
|
53 | 53 | |
54 | 54 | } |
55 | 55 | |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return string Column Name |
66 | 66 | */ |
67 | - public function column_default( $item, $column_name ) { |
|
68 | - switch ( $column_name ) { |
|
67 | + public function column_default($item, $column_name) { |
|
68 | + switch ($column_name) { |
|
69 | 69 | default: |
70 | - return $item[ $column_name ]; |
|
70 | + return $item[$column_name]; |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function get_columns() { |
82 | 82 | $columns = array( |
83 | - 'label' => esc_html__( 'Gateway', 'give' ), |
|
84 | - 'complete_sales' => esc_html__( 'Complete Transactions', 'give' ), |
|
85 | - 'pending_sales' => esc_html__( 'Pending / Failed Transactions', 'give' ), |
|
86 | - 'total_sales' => esc_html__( 'Total Transactions', 'give' ), |
|
87 | - 'total_donations' => esc_html__( 'Total Donations', 'give' ) |
|
83 | + 'label' => esc_html__('Gateway', 'give'), |
|
84 | + 'complete_sales' => esc_html__('Complete Transactions', 'give'), |
|
85 | + 'pending_sales' => esc_html__('Pending / Failed Transactions', 'give'), |
|
86 | + 'total_sales' => esc_html__('Total Transactions', 'give'), |
|
87 | + 'total_donations' => esc_html__('Total Donations', 'give') |
|
88 | 88 | ); |
89 | 89 | |
90 | 90 | return $columns; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @return int Current page number |
100 | 100 | */ |
101 | 101 | public function get_paged() { |
102 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
102 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @since 1.0 |
111 | 111 | * @return void |
112 | 112 | */ |
113 | - public function bulk_actions( $which = '' ) { |
|
113 | + public function bulk_actions($which = '') { |
|
114 | 114 | // These aren't really bulk actions but this outputs the markup in the right place |
115 | 115 | give_report_views(); |
116 | 116 | } |
@@ -123,23 +123,23 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @param string $which |
125 | 125 | */ |
126 | - protected function display_tablenav( $which ) { |
|
126 | + protected function display_tablenav($which) { |
|
127 | 127 | |
128 | - if ( 'top' == $which ) { |
|
129 | - wp_nonce_field( 'bulk-' . $this->_args['plural'] ); |
|
128 | + if ('top' == $which) { |
|
129 | + wp_nonce_field('bulk-'.$this->_args['plural']); |
|
130 | 130 | } |
131 | 131 | ?> |
132 | - <div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr( $which ); ?>"> |
|
132 | + <div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr($which); ?>"> |
|
133 | 133 | |
134 | - <h3 class="alignleft reports-earnings-title"><span><?php esc_html_e( 'Payment Methods Report', 'give' ); ?></span></h3> |
|
134 | + <h3 class="alignleft reports-earnings-title"><span><?php esc_html_e('Payment Methods Report', 'give'); ?></span></h3> |
|
135 | 135 | |
136 | 136 | <div class="alignright tablenav-right"> |
137 | 137 | <div class="actions bulkactions"> |
138 | - <?php $this->bulk_actions( $which ); ?> |
|
138 | + <?php $this->bulk_actions($which); ?> |
|
139 | 139 | </div> |
140 | 140 | <?php |
141 | - $this->extra_tablenav( $which ); |
|
142 | - $this->pagination( $which ); |
|
141 | + $this->extra_tablenav($which); |
|
142 | + $this->pagination($which); |
|
143 | 143 | ?> |
144 | 144 | </div> |
145 | 145 | |
@@ -164,18 +164,18 @@ discard block |
||
164 | 164 | $gateways = give_get_payment_gateways(); |
165 | 165 | $stats = new Give_Payment_Stats(); |
166 | 166 | |
167 | - foreach ( $gateways as $gateway_id => $gateway ) { |
|
167 | + foreach ($gateways as $gateway_id => $gateway) { |
|
168 | 168 | |
169 | - $complete_count = give_count_sales_by_gateway( $gateway_id, 'publish' ); |
|
170 | - $pending_count = give_count_sales_by_gateway( $gateway_id, array( 'pending', 'failed' ) ); |
|
169 | + $complete_count = give_count_sales_by_gateway($gateway_id, 'publish'); |
|
170 | + $pending_count = give_count_sales_by_gateway($gateway_id, array('pending', 'failed')); |
|
171 | 171 | |
172 | 172 | $reports_data[] = array( |
173 | 173 | 'ID' => $gateway_id, |
174 | 174 | 'label' => $gateway['admin_label'], |
175 | - 'complete_sales' => give_format_amount( $complete_count, false ), |
|
176 | - 'pending_sales' => give_format_amount( $pending_count, false ), |
|
177 | - 'total_sales' => give_format_amount( $complete_count + $pending_count, false ), |
|
178 | - 'total_donations' => give_currency_filter( give_format_amount( $stats->get_earnings( 0, 0, 0, $gateway_id ) ) ) |
|
175 | + 'complete_sales' => give_format_amount($complete_count, false), |
|
176 | + 'pending_sales' => give_format_amount($pending_count, false), |
|
177 | + 'total_sales' => give_format_amount($complete_count + $pending_count, false), |
|
178 | + 'total_donations' => give_currency_filter(give_format_amount($stats->get_earnings(0, 0, 0, $gateway_id))) |
|
179 | 179 | ); |
180 | 180 | } |
181 | 181 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $columns = $this->get_columns(); |
198 | 198 | $hidden = array(); // No hidden columns |
199 | 199 | $sortable = $this->get_sortable_columns(); |
200 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
200 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
201 | 201 | $this->items = $this->reports_data(); |
202 | 202 | |
203 | 203 | } |
@@ -9,13 +9,13 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | // Exit if accessed directly |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; |
14 | 14 | } |
15 | 15 | |
16 | 16 | // Load WP_List_Table if not loaded |
17 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
18 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
17 | +if ( ! class_exists('WP_List_Table')) { |
|
18 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | global $status, $page; |
46 | 46 | |
47 | 47 | // Set parent defaults |
48 | - parent::__construct( array( |
|
49 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
50 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
48 | + parent::__construct(array( |
|
49 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
50 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
51 | 51 | 'ajax' => false // Does this table support ajax? |
52 | - ) ); |
|
52 | + )); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @return string Column Name |
65 | 65 | */ |
66 | - public function column_default( $item, $column_name ) { |
|
67 | - switch ( $column_name ) { |
|
66 | + public function column_default($item, $column_name) { |
|
67 | + switch ($column_name) { |
|
68 | 68 | case 'ID' : |
69 | 69 | return $item['ID_label']; |
70 | 70 | case 'error' : |
71 | - return get_the_title( $item['ID'] ) ? get_the_title( $item['ID'] ) : esc_html__( 'Payment Error', 'give' ); |
|
71 | + return get_the_title($item['ID']) ? get_the_title($item['ID']) : esc_html__('Payment Error', 'give'); |
|
72 | 72 | default: |
73 | - return $item[ $column_name ]; |
|
73 | + return $item[$column_name]; |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
@@ -84,29 +84,29 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @return void |
86 | 86 | */ |
87 | - public function column_message( $item ) { |
|
87 | + public function column_message($item) { |
|
88 | 88 | |
89 | 89 | ?> |
90 | - <a href="#TB_inline?width=640&inlineId=log-message-<?php echo $item['ID']; ?>" class="thickbox" title="<?php esc_attr_e( 'View Log Message', 'give' ); ?> "><?php esc_html_e( 'View Log Message', 'give' ); ?></a> |
|
90 | + <a href="#TB_inline?width=640&inlineId=log-message-<?php echo $item['ID']; ?>" class="thickbox" title="<?php esc_attr_e('View Log Message', 'give'); ?> "><?php esc_html_e('View Log Message', 'give'); ?></a> |
|
91 | 91 | <div id="log-message-<?php echo $item['ID']; ?>" style="display:none;"> |
92 | 92 | <?php |
93 | 93 | |
94 | - $log_message = get_post_field( 'post_content', $item['ID'] ); |
|
94 | + $log_message = get_post_field('post_content', $item['ID']); |
|
95 | 95 | |
96 | - $serialized = strpos( $log_message, '{"' ); |
|
96 | + $serialized = strpos($log_message, '{"'); |
|
97 | 97 | |
98 | 98 | // Check to see if the log message contains serialized information |
99 | - if ( $serialized !== false ) { |
|
100 | - $length = strlen( $log_message ) - $serialized; |
|
101 | - $intro = substr( $log_message, 0, - $length ); |
|
102 | - $data = substr( $log_message, $serialized, strlen( $log_message ) - 1 ); |
|
99 | + if ($serialized !== false) { |
|
100 | + $length = strlen($log_message) - $serialized; |
|
101 | + $intro = substr($log_message, 0, - $length); |
|
102 | + $data = substr($log_message, $serialized, strlen($log_message) - 1); |
|
103 | 103 | |
104 | - echo wpautop( $intro ); |
|
105 | - echo wpautop( '<strong>' . esc_html__( 'Log data:', 'give' ) . '</strong>' ); |
|
106 | - echo '<div style="word-wrap: break-word;">' . wpautop( $data ) . '</div>'; |
|
104 | + echo wpautop($intro); |
|
105 | + echo wpautop('<strong>'.esc_html__('Log data:', 'give').'</strong>'); |
|
106 | + echo '<div style="word-wrap: break-word;">'.wpautop($data).'</div>'; |
|
107 | 107 | } else { |
108 | 108 | // No serialized data found |
109 | - echo wpautop( $log_message ); |
|
109 | + echo wpautop($log_message); |
|
110 | 110 | } |
111 | 111 | ?> |
112 | 112 | </div> |
@@ -122,12 +122,12 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function get_columns() { |
124 | 124 | $columns = array( |
125 | - 'ID' => esc_html__( 'Log ID', 'give' ), |
|
126 | - 'payment_id' => esc_html__( 'Payment ID', 'give' ), |
|
127 | - 'error' => esc_html__( 'Error', 'give' ), |
|
128 | - 'message' => esc_html__( 'Error Message', 'give' ), |
|
129 | - 'gateway' => esc_html__( 'Gateway', 'give' ), |
|
130 | - 'date' => esc_html__( 'Date', 'give' ) |
|
125 | + 'ID' => esc_html__('Log ID', 'give'), |
|
126 | + 'payment_id' => esc_html__('Payment ID', 'give'), |
|
127 | + 'error' => esc_html__('Error', 'give'), |
|
128 | + 'message' => esc_html__('Error Message', 'give'), |
|
129 | + 'gateway' => esc_html__('Gateway', 'give'), |
|
130 | + 'date' => esc_html__('Date', 'give') |
|
131 | 131 | ); |
132 | 132 | |
133 | 133 | return $columns; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * @return int Current page number |
142 | 142 | */ |
143 | 143 | public function get_paged() { |
144 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
144 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @since 1.0 |
152 | 152 | * @return void |
153 | 153 | */ |
154 | - public function bulk_actions( $which = '' ) { |
|
154 | + public function bulk_actions($which = '') { |
|
155 | 155 | give_log_views(); |
156 | 156 | } |
157 | 157 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | global $give_logs; |
168 | 168 | |
169 | 169 | // Prevent the queries from getting cached. Without this there are occasional memory issues for some installs |
170 | - wp_suspend_cache_addition( true ); |
|
170 | + wp_suspend_cache_addition(true); |
|
171 | 171 | |
172 | 172 | $logs_data = array(); |
173 | 173 | $paged = $this->get_paged(); |
@@ -176,17 +176,17 @@ discard block |
||
176 | 176 | 'paged' => $paged |
177 | 177 | ); |
178 | 178 | |
179 | - $logs = $give_logs->get_connected_logs( $log_query ); |
|
179 | + $logs = $give_logs->get_connected_logs($log_query); |
|
180 | 180 | |
181 | - if ( $logs ) { |
|
182 | - foreach ( $logs as $log ) { |
|
181 | + if ($logs) { |
|
182 | + foreach ($logs as $log) { |
|
183 | 183 | |
184 | 184 | $logs_data[] = array( |
185 | 185 | 'ID' => $log->ID, |
186 | - 'ID_label' => '<span class=\'give-item-label give-item-label-gray\'>' . $log->ID . '</span>', |
|
186 | + 'ID_label' => '<span class=\'give-item-label give-item-label-gray\'>'.$log->ID.'</span>', |
|
187 | 187 | 'payment_id' => $log->post_parent, |
188 | 188 | 'error' => 'error', |
189 | - 'gateway' => give_get_payment_gateway( $log->post_parent ), |
|
189 | + 'gateway' => give_get_payment_gateway($log->post_parent), |
|
190 | 190 | 'date' => $log->post_date |
191 | 191 | ); |
192 | 192 | } |
@@ -207,19 +207,19 @@ discard block |
||
207 | 207 | * |
208 | 208 | * @param string $which |
209 | 209 | */ |
210 | - protected function display_tablenav( $which ) { |
|
211 | - if ( 'top' === $which ) { |
|
212 | - wp_nonce_field( 'bulk-' . $this->_args['plural'] ); |
|
210 | + protected function display_tablenav($which) { |
|
211 | + if ('top' === $which) { |
|
212 | + wp_nonce_field('bulk-'.$this->_args['plural']); |
|
213 | 213 | } |
214 | 214 | ?> |
215 | - <div class="tablenav <?php echo esc_attr( $which ); ?>"> |
|
215 | + <div class="tablenav <?php echo esc_attr($which); ?>"> |
|
216 | 216 | |
217 | 217 | <div class="alignleft actions bulkactions"> |
218 | - <?php $this->bulk_actions( $which ); ?> |
|
218 | + <?php $this->bulk_actions($which); ?> |
|
219 | 219 | </div> |
220 | 220 | <?php |
221 | - $this->extra_tablenav( $which ); |
|
222 | - $this->pagination( $which ); |
|
221 | + $this->extra_tablenav($which); |
|
222 | + $this->pagination($which); |
|
223 | 223 | ?> |
224 | 224 | |
225 | 225 | <br class="clear"/> |
@@ -246,15 +246,15 @@ discard block |
||
246 | 246 | $columns = $this->get_columns(); |
247 | 247 | $hidden = array(); // No hidden columns |
248 | 248 | $sortable = $this->get_sortable_columns(); |
249 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
249 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
250 | 250 | $current_page = $this->get_pagenum(); |
251 | 251 | $this->items = $this->get_logs(); |
252 | - $total_items = $give_logs->get_log_count( 0, 'gateway_error' ); |
|
252 | + $total_items = $give_logs->get_log_count(0, 'gateway_error'); |
|
253 | 253 | |
254 | - $this->set_pagination_args( array( |
|
254 | + $this->set_pagination_args(array( |
|
255 | 255 | 'total_items' => $total_items, |
256 | 256 | 'per_page' => $this->per_page, |
257 | - 'total_pages' => ceil( $total_items / $this->per_page ) |
|
257 | + 'total_pages' => ceil($total_items / $this->per_page) |
|
258 | 258 | ) |
259 | 259 | ); |
260 | 260 | } |
@@ -10,13 +10,13 @@ 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 | |
17 | 17 | // Load WP_List_Table if not loaded |
18 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
19 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
18 | +if ( ! class_exists('WP_List_Table')) { |
|
19 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | global $status, $page; |
51 | 51 | |
52 | 52 | // Set parent defaults |
53 | - parent::__construct( array( |
|
54 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
55 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
53 | + parent::__construct(array( |
|
54 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
55 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
56 | 56 | 'ajax' => false // Does this table support ajax? |
57 | - ) ); |
|
57 | + )); |
|
58 | 58 | |
59 | - add_action( 'give_report_view_actions', array( $this, 'category_filter' ) ); |
|
59 | + add_action('give_report_view_actions', array($this, 'category_filter')); |
|
60 | 60 | $this->query(); |
61 | 61 | |
62 | 62 | } |
@@ -72,18 +72,18 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @return string Column Name |
74 | 74 | */ |
75 | - public function column_default( $item, $column_name ) { |
|
76 | - switch ( $column_name ) { |
|
75 | + public function column_default($item, $column_name) { |
|
76 | + switch ($column_name) { |
|
77 | 77 | case 'earnings' : |
78 | - return give_currency_filter( give_format_amount( $item[ $column_name ] ) ); |
|
78 | + return give_currency_filter(give_format_amount($item[$column_name])); |
|
79 | 79 | case 'average_sales' : |
80 | - return round( $item[ $column_name ] ); |
|
80 | + return round($item[$column_name]); |
|
81 | 81 | case 'average_earnings' : |
82 | - return give_currency_filter( give_format_amount( $item[ $column_name ] ) ); |
|
82 | + return give_currency_filter(give_format_amount($item[$column_name])); |
|
83 | 83 | case 'details' : |
84 | - return '<a href="' . admin_url( 'edit.php?post_type=give_forms&page=give-reports&view=forms&form-id=' . $item['ID'] ) . '">' . esc_html__( 'View Detailed Report', 'give' ) . '</a>'; |
|
84 | + return '<a href="'.admin_url('edit.php?post_type=give_forms&page=give-reports&view=forms&form-id='.$item['ID']).'">'.esc_html__('View Detailed Report', 'give').'</a>'; |
|
85 | 85 | default: |
86 | - return $item[ $column_name ]; |
|
86 | + return $item[$column_name]; |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | public function get_columns() { |
98 | 98 | $columns = array( |
99 | 99 | 'title' => give_get_forms_label_singular(), |
100 | - 'sales' => esc_html__( 'Donations', 'give' ), |
|
101 | - 'earnings' => esc_html__( 'Income', 'give' ), |
|
102 | - 'average_sales' => esc_html__( 'Monthly Average Donations', 'give' ), |
|
103 | - 'average_earnings' => esc_html__( 'Monthly Average Income', 'give' ), |
|
104 | - 'details' => esc_html__( 'Detailed Report', 'give' ) |
|
100 | + 'sales' => esc_html__('Donations', 'give'), |
|
101 | + 'earnings' => esc_html__('Income', 'give'), |
|
102 | + 'average_sales' => esc_html__('Monthly Average Donations', 'give'), |
|
103 | + 'average_earnings' => esc_html__('Monthly Average Income', 'give'), |
|
104 | + 'details' => esc_html__('Detailed Report', 'give') |
|
105 | 105 | ); |
106 | 106 | |
107 | 107 | return $columns; |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function get_sortable_columns() { |
118 | 118 | return array( |
119 | - 'title' => array( 'title', true ), |
|
120 | - 'sales' => array( 'sales', false ), |
|
121 | - 'earnings' => array( 'earnings', false ), |
|
119 | + 'title' => array('title', true), |
|
120 | + 'sales' => array('sales', false), |
|
121 | + 'earnings' => array('earnings', false), |
|
122 | 122 | ); |
123 | 123 | } |
124 | 124 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @return int Current page number |
131 | 131 | */ |
132 | 132 | public function get_paged() { |
133 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
133 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @return int Category ID |
143 | 143 | */ |
144 | 144 | public function get_category() { |
145 | - return isset( $_GET['category'] ) ? absint( $_GET['category'] ) : 0; |
|
145 | + return isset($_GET['category']) ? absint($_GET['category']) : 0; |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function get_total_forms() { |
157 | 157 | $total = 0; |
158 | - $counts = wp_count_posts( 'give_forms', 'readable' ); |
|
159 | - foreach ( $counts as $status => $count ) { |
|
158 | + $counts = wp_count_posts('give_forms', 'readable'); |
|
159 | + foreach ($counts as $status => $count) { |
|
160 | 160 | $total += $count; |
161 | 161 | } |
162 | 162 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * @since 1.0 |
171 | 171 | * @return void |
172 | 172 | */ |
173 | - public function bulk_actions( $which = '' ) { |
|
173 | + public function bulk_actions($which = '') { |
|
174 | 174 | // These aren't really bulk actions but this outputs the markup in the right place |
175 | 175 | give_report_views(); |
176 | 176 | } |
@@ -183,23 +183,23 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @param string $which |
185 | 185 | */ |
186 | - protected function display_tablenav( $which ) { |
|
186 | + protected function display_tablenav($which) { |
|
187 | 187 | |
188 | - if ( 'top' == $which ) { |
|
189 | - wp_nonce_field( 'bulk-' . $this->_args['plural'] ); |
|
188 | + if ('top' == $which) { |
|
189 | + wp_nonce_field('bulk-'.$this->_args['plural']); |
|
190 | 190 | } |
191 | 191 | ?> |
192 | - <div class="tablenav give-clearfix <?php echo esc_attr( $which ); ?>"> |
|
192 | + <div class="tablenav give-clearfix <?php echo esc_attr($which); ?>"> |
|
193 | 193 | |
194 | - <h3 class="alignleft reports-earnings-title"><span><?php esc_html_e( 'Donation Forms Report', 'give' ); ?></span></h3> |
|
194 | + <h3 class="alignleft reports-earnings-title"><span><?php esc_html_e('Donation Forms Report', 'give'); ?></span></h3> |
|
195 | 195 | |
196 | 196 | <div class="alignright tablenav-right"> |
197 | 197 | <div class="actions bulkactions"> |
198 | - <?php $this->bulk_actions( $which ); ?> |
|
198 | + <?php $this->bulk_actions($which); ?> |
|
199 | 199 | </div> |
200 | 200 | <?php |
201 | - $this->extra_tablenav( $which ); |
|
202 | - $this->pagination( $which ); |
|
201 | + $this->extra_tablenav($which); |
|
202 | + $this->pagination($which); |
|
203 | 203 | ?> |
204 | 204 | </div> |
205 | 205 | |
@@ -219,9 +219,9 @@ discard block |
||
219 | 219 | */ |
220 | 220 | public function category_filter() { |
221 | 221 | |
222 | - $categories = get_terms( 'form_category' ); |
|
223 | - if ( $categories && ! is_wp_error( $categories ) ) { |
|
224 | - echo Give()->html->category_dropdown( 'category', $this->get_category() ); |
|
222 | + $categories = get_terms('form_category'); |
|
223 | + if ($categories && ! is_wp_error($categories)) { |
|
224 | + echo Give()->html->category_dropdown('category', $this->get_category()); |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public function query() { |
237 | 237 | |
238 | - $orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : 'title'; |
|
239 | - $order = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC'; |
|
238 | + $orderby = isset($_GET['orderby']) ? $_GET['orderby'] : 'title'; |
|
239 | + $order = isset($_GET['order']) ? $_GET['order'] : 'DESC'; |
|
240 | 240 | $category = $this->get_category(); |
241 | 241 | |
242 | 242 | $args = array( |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | 'suppress_filters' => true |
250 | 250 | ); |
251 | 251 | |
252 | - if ( ! empty( $category ) ) { |
|
252 | + if ( ! empty($category)) { |
|
253 | 253 | $args['tax_query'] = array( |
254 | 254 | array( |
255 | 255 | 'taxonomy' => 'form_category', |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | ); |
259 | 259 | } |
260 | 260 | |
261 | - switch ( $orderby ) : |
|
261 | + switch ($orderby) : |
|
262 | 262 | case 'title' : |
263 | 263 | $args['orderby'] = 'title'; |
264 | 264 | break; |
@@ -274,9 +274,9 @@ discard block |
||
274 | 274 | break; |
275 | 275 | endswitch; |
276 | 276 | |
277 | - $args = apply_filters( 'give_form_reports_prepare_items_args', $args, $this ); |
|
277 | + $args = apply_filters('give_form_reports_prepare_items_args', $args, $this); |
|
278 | 278 | |
279 | - $this->products = new WP_Query( $args ); |
|
279 | + $this->products = new WP_Query($args); |
|
280 | 280 | |
281 | 281 | } |
282 | 282 | |
@@ -292,15 +292,15 @@ discard block |
||
292 | 292 | |
293 | 293 | $give_forms = $this->products->posts; |
294 | 294 | |
295 | - if ( $give_forms ) { |
|
296 | - foreach ( $give_forms as $form ) { |
|
295 | + if ($give_forms) { |
|
296 | + foreach ($give_forms as $form) { |
|
297 | 297 | $reports_data[] = array( |
298 | 298 | 'ID' => $form, |
299 | - 'title' => get_the_title( $form ), |
|
300 | - 'sales' => give_get_form_sales_stats( $form ), |
|
301 | - 'earnings' => give_get_form_earnings_stats( $form ), |
|
302 | - 'average_sales' => give_get_average_monthly_form_sales( $form ), |
|
303 | - 'average_earnings' => give_get_average_monthly_form_earnings( $form ) |
|
299 | + 'title' => get_the_title($form), |
|
300 | + 'sales' => give_get_form_sales_stats($form), |
|
301 | + 'earnings' => give_get_form_earnings_stats($form), |
|
302 | + 'average_sales' => give_get_average_monthly_form_sales($form), |
|
303 | + 'average_earnings' => give_get_average_monthly_form_earnings($form) |
|
304 | 304 | ); |
305 | 305 | } |
306 | 306 | } |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | |
329 | 329 | $sortable = $this->get_sortable_columns(); |
330 | 330 | |
331 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
331 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
332 | 332 | |
333 | 333 | $data = $this->reports_data(); |
334 | 334 | |
@@ -336,10 +336,10 @@ discard block |
||
336 | 336 | |
337 | 337 | $this->items = $data; |
338 | 338 | |
339 | - $this->set_pagination_args( array( |
|
339 | + $this->set_pagination_args(array( |
|
340 | 340 | 'total_items' => $total_items, |
341 | 341 | 'per_page' => $this->per_page, |
342 | - 'total_pages' => ceil( $total_items / $this->per_page ) |
|
342 | + 'total_pages' => ceil($total_items / $this->per_page) |
|
343 | 343 | ) |
344 | 344 | ); |
345 | 345 | } |