@@ -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,15 +26,15 @@ discard block |
||
26 | 26 | * @global $wpdb |
27 | 27 | * @return void |
28 | 28 | */ |
29 | -function give_install( $network_wide = false ) { |
|
29 | +function give_install($network_wide = false) { |
|
30 | 30 | |
31 | 31 | global $wpdb; |
32 | 32 | |
33 | - if ( is_multisite() && $network_wide ) { |
|
33 | + if (is_multisite() && $network_wide) { |
|
34 | 34 | |
35 | - foreach ( $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs LIMIT 100" ) as $blog_id ) { |
|
35 | + foreach ($wpdb->get_col("SELECT blog_id FROM $wpdb->blogs LIMIT 100") as $blog_id) { |
|
36 | 36 | |
37 | - switch_to_blog( $blog_id ); |
|
37 | + switch_to_blog($blog_id); |
|
38 | 38 | give_run_install(); |
39 | 39 | restore_current_blog(); |
40 | 40 | |
@@ -61,31 +61,31 @@ discard block |
||
61 | 61 | give_setup_post_types(); |
62 | 62 | |
63 | 63 | // Add Upgraded From Option. |
64 | - $current_version = get_option( 'give_version' ); |
|
65 | - if ( $current_version ) { |
|
66 | - update_option( 'give_version_upgraded_from', $current_version ); |
|
64 | + $current_version = get_option('give_version'); |
|
65 | + if ($current_version) { |
|
66 | + update_option('give_version_upgraded_from', $current_version); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | // Setup some default options. |
70 | 70 | $options = array(); |
71 | 71 | |
72 | 72 | //Fresh Install? Setup Test Mode, Base Country (US), Test Gateway, Currency. |
73 | - if ( empty( $current_version ) ) { |
|
74 | - $options = array_merge( $options, give_get_default_settings() ); |
|
73 | + if (empty($current_version)) { |
|
74 | + $options = array_merge($options, give_get_default_settings()); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | // Populate the default values. |
78 | - update_option( 'give_settings', array_merge( $give_options, $options ) ); |
|
78 | + update_option('give_settings', array_merge($give_options, $options)); |
|
79 | 79 | |
80 | 80 | /** |
81 | 81 | * Run plugin upgrades. |
82 | 82 | * |
83 | 83 | * @since 1.8 |
84 | 84 | */ |
85 | - do_action( 'give_upgrades' ); |
|
85 | + do_action('give_upgrades'); |
|
86 | 86 | |
87 | - if ( GIVE_VERSION !== get_option( 'give_version' ) ) { |
|
88 | - update_option( 'give_version', GIVE_VERSION ); |
|
87 | + if (GIVE_VERSION !== get_option('give_version')) { |
|
88 | + update_option('give_version', GIVE_VERSION); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // Create Give roles. |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | // Set api version, end point and refresh permalink. |
97 | 97 | $api = new Give_API(); |
98 | 98 | $api->add_endpoint(); |
99 | - update_option( 'give_default_api_version', 'v' . $api->get_version() ); |
|
99 | + update_option('give_default_api_version', 'v'.$api->get_version()); |
|
100 | 100 | |
101 | 101 | flush_rewrite_rules(); |
102 | 102 | |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | $give_sessions->use_php_sessions(); |
106 | 106 | |
107 | 107 | // Add a temporary option to note that Give pages have been created. |
108 | - Give_Cache::set( '_give_installed', $options, 30, true ); |
|
108 | + Give_Cache::set('_give_installed', $options, 30, true); |
|
109 | 109 | |
110 | - if ( ! $current_version ) { |
|
110 | + if ( ! $current_version) { |
|
111 | 111 | |
112 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
|
112 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php'; |
|
113 | 113 | |
114 | 114 | // When new upgrade routines are added, mark them as complete on fresh install. |
115 | 115 | $upgrade_routines = array( |
@@ -127,18 +127,18 @@ discard block |
||
127 | 127 | 'v1817_cleanup_user_roles' |
128 | 128 | ); |
129 | 129 | |
130 | - foreach ( $upgrade_routines as $upgrade ) { |
|
131 | - give_set_upgrade_complete( $upgrade ); |
|
130 | + foreach ($upgrade_routines as $upgrade) { |
|
131 | + give_set_upgrade_complete($upgrade); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
135 | 135 | // Bail if activating from network, or bulk. |
136 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
136 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
140 | 140 | // Add the transient to redirect. |
141 | - Give_Cache::set( '_give_activation_redirect', true, 30, true ); |
|
141 | + Give_Cache::set('_give_activation_redirect', true, 30, true); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
@@ -155,11 +155,11 @@ discard block |
||
155 | 155 | * @param int $site_id The Site ID. |
156 | 156 | * @param array $meta Blog Meta. |
157 | 157 | */ |
158 | -function give_on_create_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { |
|
158 | +function give_on_create_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) { |
|
159 | 159 | |
160 | - if ( is_plugin_active_for_network( GIVE_PLUGIN_BASENAME ) ) { |
|
160 | + if (is_plugin_active_for_network(GIVE_PLUGIN_BASENAME)) { |
|
161 | 161 | |
162 | - switch_to_blog( $blog_id ); |
|
162 | + switch_to_blog($blog_id); |
|
163 | 163 | give_install(); |
164 | 164 | restore_current_blog(); |
165 | 165 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | } |
169 | 169 | |
170 | -add_action( 'wpmu_new_blog', 'give_on_create_blog', 10, 6 ); |
|
170 | +add_action('wpmu_new_blog', 'give_on_create_blog', 10, 6); |
|
171 | 171 | |
172 | 172 | |
173 | 173 | /** |
@@ -180,13 +180,13 @@ discard block |
||
180 | 180 | * |
181 | 181 | * @return array The tables to drop. |
182 | 182 | */ |
183 | -function give_wpmu_drop_tables( $tables, $blog_id ) { |
|
183 | +function give_wpmu_drop_tables($tables, $blog_id) { |
|
184 | 184 | |
185 | - switch_to_blog( $blog_id ); |
|
185 | + switch_to_blog($blog_id); |
|
186 | 186 | $donors_db = new Give_DB_Donors(); |
187 | 187 | $donor_meta_db = new Give_DB_Donor_Meta(); |
188 | 188 | |
189 | - if ( $donors_db->installed() ) { |
|
189 | + if ($donors_db->installed()) { |
|
190 | 190 | $tables[] = $donors_db->table_name; |
191 | 191 | $tables[] = $donor_meta_db->table_name; |
192 | 192 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | } |
198 | 198 | |
199 | -add_filter( 'wpmu_drop_tables', 'give_wpmu_drop_tables', 10, 2 ); |
|
199 | +add_filter('wpmu_drop_tables', 'give_wpmu_drop_tables', 10, 2); |
|
200 | 200 | |
201 | 201 | /** |
202 | 202 | * Post-installation |
@@ -208,16 +208,16 @@ discard block |
||
208 | 208 | */ |
209 | 209 | function give_after_install() { |
210 | 210 | |
211 | - if ( ! is_admin() ) { |
|
211 | + if ( ! is_admin()) { |
|
212 | 212 | return; |
213 | 213 | } |
214 | 214 | |
215 | - $give_options = Give_Cache::get( '_give_installed', true ); |
|
216 | - $give_table_check = get_option( '_give_table_check', false ); |
|
215 | + $give_options = Give_Cache::get('_give_installed', true); |
|
216 | + $give_table_check = get_option('_give_table_check', false); |
|
217 | 217 | |
218 | - if ( false === $give_table_check || current_time( 'timestamp' ) > $give_table_check ) { |
|
218 | + if (false === $give_table_check || current_time('timestamp') > $give_table_check) { |
|
219 | 219 | |
220 | - if ( ! @Give()->donor_meta->installed() ) { |
|
220 | + if ( ! @Give()->donor_meta->installed()) { |
|
221 | 221 | |
222 | 222 | // Create the donor meta database. |
223 | 223 | // (this ensures it creates it on multisite instances where it is network activated). |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | |
226 | 226 | } |
227 | 227 | |
228 | - if ( ! @Give()->donors->installed() ) { |
|
228 | + if ( ! @Give()->donors->installed()) { |
|
229 | 229 | // Create the donor database. |
230 | 230 | // (this ensures it creates it on multisite instances where it is network activated). |
231 | 231 | @Give()->donors->create_table(); |
@@ -237,22 +237,22 @@ discard block |
||
237 | 237 | * |
238 | 238 | * @param array $give_options Give plugin options. |
239 | 239 | */ |
240 | - do_action( 'give_after_install', $give_options ); |
|
240 | + do_action('give_after_install', $give_options); |
|
241 | 241 | } |
242 | 242 | |
243 | - update_option( '_give_table_check', ( current_time( 'timestamp' ) + WEEK_IN_SECONDS ) ); |
|
243 | + update_option('_give_table_check', (current_time('timestamp') + WEEK_IN_SECONDS)); |
|
244 | 244 | |
245 | 245 | } |
246 | 246 | |
247 | 247 | // Delete the transient |
248 | - if ( false !== $give_options ) { |
|
249 | - Give_Cache::delete( Give_Cache::get_key( '_give_installed' ) ); |
|
248 | + if (false !== $give_options) { |
|
249 | + Give_Cache::delete(Give_Cache::get_key('_give_installed')); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | |
253 | 253 | } |
254 | 254 | |
255 | -add_action( 'admin_init', 'give_after_install' ); |
|
255 | +add_action('admin_init', 'give_after_install'); |
|
256 | 256 | |
257 | 257 | |
258 | 258 | /** |
@@ -267,11 +267,11 @@ discard block |
||
267 | 267 | |
268 | 268 | global $wp_roles; |
269 | 269 | |
270 | - if ( ! is_object( $wp_roles ) ) { |
|
270 | + if ( ! is_object($wp_roles)) { |
|
271 | 271 | return; |
272 | 272 | } |
273 | 273 | |
274 | - if ( ! array_key_exists( 'give_manager', $wp_roles->roles ) ) { |
|
274 | + if ( ! array_key_exists('give_manager', $wp_roles->roles)) { |
|
275 | 275 | |
276 | 276 | // Create Give plugin roles |
277 | 277 | $roles = new Give_Roles(); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | } |
284 | 284 | |
285 | -add_action( 'admin_init', 'give_install_roles_on_network' ); |
|
285 | +add_action('admin_init', 'give_install_roles_on_network'); |
|
286 | 286 | |
287 | 287 | /** |
288 | 288 | * Default core setting values. |
@@ -320,14 +320,14 @@ discard block |
||
320 | 320 | 'uninstall_on_delete' => 'disabled', |
321 | 321 | 'the_content_filter' => 'enabled', |
322 | 322 | 'scripts_footer' => 'disabled', |
323 | - 'agree_to_terms_label' => __( 'Agree to Terms?', 'give' ), |
|
323 | + 'agree_to_terms_label' => __('Agree to Terms?', 'give'), |
|
324 | 324 | 'agreement_text' => give_get_default_agreement_text(), |
325 | 325 | |
326 | 326 | // Paypal IPN verification. |
327 | 327 | 'paypal_verification' => 'enabled', |
328 | 328 | |
329 | 329 | // Default is manual gateway. |
330 | - 'gateways' => array( 'manual' => 1, 'offline' => 1 ), |
|
330 | + 'gateways' => array('manual' => 1, 'offline' => 1), |
|
331 | 331 | 'default_gateway' => 'manual', |
332 | 332 | |
333 | 333 | // Offline gateway setup. |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | function give_get_default_agreement_text() { |
357 | 357 | |
358 | - $org_name = get_bloginfo( 'name' ); |
|
358 | + $org_name = get_bloginfo('name'); |
|
359 | 359 | |
360 | 360 | $agreement = sprintf( |
361 | 361 | '<p>Acceptance of any contribution, gift or grant is at the discretion of the %1$s. The %1$s will not accept any gift unless it can be used or expended consistently with the purpose and mission of the %1$s.</p> |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $org_name |
370 | 370 | ); |
371 | 371 | |
372 | - return apply_filters( 'give_get_default_agreement_text', $agreement, $org_name ); |
|
372 | + return apply_filters('give_get_default_agreement_text', $agreement, $org_name); |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | |
@@ -378,22 +378,22 @@ discard block |
||
378 | 378 | * |
379 | 379 | * @since 1.8.11 |
380 | 380 | */ |
381 | -function give_create_pages(){ |
|
381 | +function give_create_pages() { |
|
382 | 382 | |
383 | 383 | // Bailout if pages already created. |
384 | - if( get_option( 'give_install_pages_created') ) { |
|
384 | + if (get_option('give_install_pages_created')) { |
|
385 | 385 | return false; |
386 | 386 | } |
387 | 387 | |
388 | 388 | $options = array(); |
389 | 389 | |
390 | 390 | // Checks if the Success Page option exists AND that the page exists. |
391 | - if ( ! get_post( give_get_option( 'success_page' ) ) ) { |
|
391 | + if ( ! get_post(give_get_option('success_page'))) { |
|
392 | 392 | |
393 | 393 | // Donation Confirmation (Success) Page |
394 | 394 | $success = wp_insert_post( |
395 | 395 | array( |
396 | - 'post_title' => esc_html__( 'Donation Confirmation', 'give' ), |
|
396 | + 'post_title' => esc_html__('Donation Confirmation', 'give'), |
|
397 | 397 | 'post_content' => '[give_receipt]', |
398 | 398 | 'post_status' => 'publish', |
399 | 399 | 'post_author' => 1, |
@@ -407,13 +407,13 @@ discard block |
||
407 | 407 | } |
408 | 408 | |
409 | 409 | // Checks if the Failure Page option exists AND that the page exists. |
410 | - if ( ! get_post( give_get_option( 'failure_page' ) ) ) { |
|
410 | + if ( ! get_post(give_get_option('failure_page'))) { |
|
411 | 411 | |
412 | 412 | // Failed Donation Page |
413 | 413 | $failed = wp_insert_post( |
414 | 414 | array( |
415 | - 'post_title' => esc_html__( 'Donation Failed', 'give' ), |
|
416 | - 'post_content' => esc_html__( 'We\'re sorry, your donation failed to process. Please try again or contact site support.', 'give' ), |
|
415 | + 'post_title' => esc_html__('Donation Failed', 'give'), |
|
416 | + 'post_content' => esc_html__('We\'re sorry, your donation failed to process. Please try again or contact site support.', 'give'), |
|
417 | 417 | 'post_status' => 'publish', |
418 | 418 | 'post_author' => 1, |
419 | 419 | 'post_type' => 'page', |
@@ -425,11 +425,11 @@ discard block |
||
425 | 425 | } |
426 | 426 | |
427 | 427 | // Checks if the History Page option exists AND that the page exists. |
428 | - if ( ! get_post( give_get_option( 'history_page' ) ) ) { |
|
428 | + if ( ! get_post(give_get_option('history_page'))) { |
|
429 | 429 | // Donation History Page |
430 | 430 | $history = wp_insert_post( |
431 | 431 | array( |
432 | - 'post_title' => esc_html__( 'Donation History', 'give' ), |
|
432 | + 'post_title' => esc_html__('Donation History', 'give'), |
|
433 | 433 | 'post_content' => '[donation_history]', |
434 | 434 | 'post_status' => 'publish', |
435 | 435 | 'post_author' => 1, |
@@ -441,10 +441,10 @@ discard block |
||
441 | 441 | $options['history_page'] = $history; |
442 | 442 | } |
443 | 443 | |
444 | - if( ! empty( $options ) ) { |
|
445 | - update_option( 'give_settings', array_merge( give_get_settings(), $options ) ); |
|
444 | + if ( ! empty($options)) { |
|
445 | + update_option('give_settings', array_merge(give_get_settings(), $options)); |
|
446 | 446 | } |
447 | 447 | |
448 | - add_option( 'give_install_pages_created', 1, '', 'no' ); |
|
448 | + add_option('give_install_pages_created', 1, '', 'no'); |
|
449 | 449 | } |
450 | -add_action( 'admin_init', 'give_create_pages', -1 ); |
|
450 | +add_action('admin_init', 'give_create_pages', -1); |
@@ -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_Earnings_Report' ) ) : |
|
16 | +if ( ! class_exists('Give_Earnings_Report')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Earnings_Report. |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function __construct() { |
37 | 37 | $this->id = 'earnings'; |
38 | - $this->label = esc_html__( 'Income', 'give' ); |
|
38 | + $this->label = esc_html__('Income', 'give'); |
|
39 | 39 | |
40 | 40 | parent::__construct(); |
41 | 41 | |
42 | - add_action( 'give_admin_field_report_earnings', array( $this, 'render_report_earnings_field' ), 10, 2 ); |
|
42 | + add_action('give_admin_field_report_earnings', array($this, 'render_report_earnings_field'), 10, 2); |
|
43 | 43 | |
44 | 44 | // Do not use main form for this tab. |
45 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
46 | - add_action( 'give-reports_open_form', '__return_empty_string' ); |
|
47 | - add_action( 'give-reports_close_form', '__return_empty_string' ); |
|
45 | + if (give_get_current_setting_tab() === $this->id) { |
|
46 | + add_action('give-reports_open_form', '__return_empty_string'); |
|
47 | + add_action('give-reports_close_form', '__return_empty_string'); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @param array $settings |
65 | 65 | */ |
66 | 66 | $settings = apply_filters( |
67 | - 'give_get_settings_' . $this->id, |
|
67 | + 'give_get_settings_'.$this->id, |
|
68 | 68 | array( |
69 | 69 | array( |
70 | 70 | 'id' => 'give_tools_earnings', |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | ), |
74 | 74 | array( |
75 | 75 | 'id' => 'earnings', |
76 | - 'name' => esc_html__( 'Income', 'give' ), |
|
76 | + 'name' => esc_html__('Income', 'give'), |
|
77 | 77 | 'type' => 'report_earnings', |
78 | 78 | ), |
79 | 79 | array( |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | * @param $field |
98 | 98 | * @param $option_value |
99 | 99 | */ |
100 | - public function render_report_earnings_field( $field, $option_value ) { |
|
101 | - do_action( 'give_reports_view_earnings' ); |
|
100 | + public function render_report_earnings_field($field, $option_value) { |
|
101 | + do_action('give_reports_view_earnings'); |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 |
@@ -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_Forms_Report' ) ) : |
|
16 | +if ( ! class_exists('Give_Forms_Report')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Forms_Report. |
@@ -34,16 +34,16 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function __construct() { |
36 | 36 | $this->id = 'forms'; |
37 | - $this->label = esc_html__( 'Forms', 'give' ); |
|
37 | + $this->label = esc_html__('Forms', 'give'); |
|
38 | 38 | |
39 | 39 | parent::__construct(); |
40 | 40 | |
41 | - add_action( 'give_admin_field_report_forms', array( $this, 'render_report_forms_field' ), 10, 2 ); |
|
41 | + add_action('give_admin_field_report_forms', array($this, 'render_report_forms_field'), 10, 2); |
|
42 | 42 | |
43 | 43 | // Do not use main form for this tab. |
44 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
45 | - add_action( 'give-reports_open_form', '__return_empty_string' ); |
|
46 | - add_action( 'give-reports_close_form', '__return_empty_string' ); |
|
44 | + if (give_get_current_setting_tab() === $this->id) { |
|
45 | + add_action('give-reports_open_form', '__return_empty_string'); |
|
46 | + add_action('give-reports_close_form', '__return_empty_string'); |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @param array $settings |
64 | 64 | */ |
65 | 65 | $settings = apply_filters( |
66 | - 'give_get_settings_' . $this->id, |
|
66 | + 'give_get_settings_'.$this->id, |
|
67 | 67 | array( |
68 | 68 | array( |
69 | 69 | 'id' => 'give_reports_forms', |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | ), |
73 | 73 | array( |
74 | 74 | 'id' => 'forms', |
75 | - 'name' => esc_html__( 'Forms', 'give' ), |
|
75 | + 'name' => esc_html__('Forms', 'give'), |
|
76 | 76 | 'type' => 'report_forms', |
77 | 77 | ), |
78 | 78 | array( |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | * @param $field |
97 | 97 | * @param $option_value |
98 | 98 | */ |
99 | - public function render_report_forms_field( $field, $option_value ) { |
|
100 | - do_action( 'give_reports_view_forms' ); |
|
99 | + public function render_report_forms_field($field, $option_value) { |
|
100 | + do_action('give_reports_view_forms'); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | // Exit if accessed directly. |
19 | -if ( ! defined( 'ABSPATH' ) ) { |
|
19 | +if ( ! defined('ABSPATH')) { |
|
20 | 20 | exit; |
21 | 21 | } |
22 | 22 | |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | * @return void |
30 | 30 | */ |
31 | 31 | function give_reports_page() { |
32 | - $current_page = admin_url( 'edit.php?post_type=give_forms&page=give-reports' ); |
|
33 | - $active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : 'earnings'; |
|
32 | + $current_page = admin_url('edit.php?post_type=give_forms&page=give-reports'); |
|
33 | + $active_tab = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : 'earnings'; |
|
34 | 34 | $views = give_reports_default_views(); |
35 | 35 | ?> |
36 | 36 | <div class="wrap give-settings-page"> |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | <h1 class="screen-reader-text"><?php echo get_admin_page_title(); ?></h1> |
39 | 39 | |
40 | 40 | <h2 class="nav-tab-wrapper"> |
41 | - <?php foreach ( $views as $tab => $label ) { ?> |
|
42 | - <a href="<?php echo esc_url( add_query_arg( array( |
|
41 | + <?php foreach ($views as $tab => $label) { ?> |
|
42 | + <a href="<?php echo esc_url(add_query_arg(array( |
|
43 | 43 | 'tab' => $tab, |
44 | 44 | 'settings-updated' => false, |
45 | - ), $current_page ) ); ?>" class="nav-tab <?php echo $tab === $active_tab ? esc_attr( 'nav-tab-active' ) : ''; ?>"><?php echo esc_html( $label ); ?></a> |
|
45 | + ), $current_page)); ?>" class="nav-tab <?php echo $tab === $active_tab ? esc_attr('nav-tab-active') : ''; ?>"><?php echo esc_html($label); ?></a> |
|
46 | 46 | <?php } ?> |
47 | - <?php if ( current_user_can( 'export_give_reports' ) ) { ?> |
|
48 | - <a href="<?php echo esc_url( add_query_arg( array( |
|
47 | + <?php if (current_user_can('export_give_reports')) { ?> |
|
48 | + <a href="<?php echo esc_url(add_query_arg(array( |
|
49 | 49 | 'tab' => 'export', |
50 | 50 | 'settings-updated' => false, |
51 | - ), $current_page ) ); ?>" class="nav-tab <?php echo 'export' === $active_tab ? esc_attr( 'nav-tab-active' ) : ''; ?>"><?php esc_html_e( 'Export', 'give' ); ?></a> |
|
51 | + ), $current_page)); ?>" class="nav-tab <?php echo 'export' === $active_tab ? esc_attr('nav-tab-active') : ''; ?>"><?php esc_html_e('Export', 'give'); ?></a> |
|
52 | 52 | <?php } |
53 | 53 | /** |
54 | 54 | * Fires in the report tabs. |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @since 1.0 |
59 | 59 | */ |
60 | - do_action( 'give_reports_tabs' ); |
|
60 | + do_action('give_reports_tabs'); |
|
61 | 61 | ?> |
62 | 62 | </h2> |
63 | 63 | |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @since 1.0 |
69 | 69 | */ |
70 | - do_action( 'give_reports_page_top' ); |
|
70 | + do_action('give_reports_page_top'); |
|
71 | 71 | |
72 | 72 | // Set $active_tab prior to hook firing. |
73 | - if ( in_array( $active_tab, array_keys( $views ) ) ) { |
|
73 | + if (in_array($active_tab, array_keys($views))) { |
|
74 | 74 | $active_tab = 'reports'; |
75 | 75 | } |
76 | 76 | |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | * |
80 | 80 | * @since 1.0 |
81 | 81 | */ |
82 | - do_action( "give_reports_tab_{$active_tab}" ); |
|
82 | + do_action("give_reports_tab_{$active_tab}"); |
|
83 | 83 | |
84 | 84 | /** |
85 | 85 | * Fires after the report page. |
86 | 86 | * |
87 | 87 | * @since 1.0 |
88 | 88 | */ |
89 | - do_action( 'give_reports_page_bottom' ); |
|
89 | + do_action('give_reports_page_bottom'); |
|
90 | 90 | ?> |
91 | 91 | </div><!-- .wrap --> |
92 | 92 | <?php |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | */ |
101 | 101 | function give_reports_default_views() { |
102 | 102 | $views = array( |
103 | - 'earnings' => esc_html__( 'Income', 'give' ), |
|
104 | - 'forms' => esc_html__( 'Forms', 'give' ), |
|
105 | - 'gateways' => esc_html__( 'Donation Methods', 'give' ), |
|
103 | + 'earnings' => esc_html__('Income', 'give'), |
|
104 | + 'forms' => esc_html__('Forms', 'give'), |
|
105 | + 'gateways' => esc_html__('Donation Methods', 'give'), |
|
106 | 106 | ); |
107 | 107 | |
108 | - $views = apply_filters( 'give_report_views', $views ); |
|
108 | + $views = apply_filters('give_report_views', $views); |
|
109 | 109 | |
110 | 110 | return $views; |
111 | 111 | } |
@@ -120,15 +120,15 @@ discard block |
||
120 | 120 | * @since 1.0 |
121 | 121 | * @return string $view Report View |
122 | 122 | */ |
123 | -function give_get_reporting_view( $default = 'earnings' ) { |
|
123 | +function give_get_reporting_view($default = 'earnings') { |
|
124 | 124 | |
125 | - if ( ! isset( $_GET['view'] ) || ! in_array( $_GET['view'], array_keys( give_reports_default_views() ) ) ) { |
|
125 | + if ( ! isset($_GET['view']) || ! in_array($_GET['view'], array_keys(give_reports_default_views()))) { |
|
126 | 126 | $view = $default; |
127 | 127 | } else { |
128 | 128 | $view = $_GET['view']; |
129 | 129 | } |
130 | 130 | |
131 | - return apply_filters( 'give_get_reporting_view', $view ); |
|
131 | + return apply_filters('give_get_reporting_view', $view); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | */ |
140 | 140 | function give_reports_tab_reports() { |
141 | 141 | |
142 | - if( ! current_user_can( 'view_give_reports' ) ) { |
|
143 | - wp_die( __( 'You do not have permission to access this report', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
142 | + if ( ! current_user_can('view_give_reports')) { |
|
143 | + wp_die(__('You do not have permission to access this report', 'give'), __('Error', 'give'), array('response' => 403)); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | $current_view = 'earnings'; |
147 | 147 | $views = give_reports_default_views(); |
148 | 148 | |
149 | - if ( isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $views ) ) { |
|
149 | + if (isset($_GET['tab']) && array_key_exists($_GET['tab'], $views)) { |
|
150 | 150 | $current_view = $_GET['tab']; |
151 | 151 | } |
152 | 152 | |
@@ -155,10 +155,10 @@ discard block |
||
155 | 155 | * |
156 | 156 | * @since 1.0 |
157 | 157 | */ |
158 | - do_action( "give_reports_view_{$current_view}" ); |
|
158 | + do_action("give_reports_view_{$current_view}"); |
|
159 | 159 | } |
160 | 160 | |
161 | -add_action( 'give_reports_tab_reports', 'give_reports_tab_reports' ); |
|
161 | +add_action('give_reports_tab_reports', 'give_reports_tab_reports'); |
|
162 | 162 | |
163 | 163 | /** |
164 | 164 | * Renders the Reports Page Views Drop Downs |
@@ -168,19 +168,19 @@ discard block |
||
168 | 168 | */ |
169 | 169 | function give_report_views() { |
170 | 170 | $views = give_reports_default_views(); |
171 | - $current_view = isset( $_GET['view'] ) ? $_GET['view'] : 'earnings'; |
|
171 | + $current_view = isset($_GET['view']) ? $_GET['view'] : 'earnings'; |
|
172 | 172 | /** |
173 | 173 | * Fires before the report page actions form. |
174 | 174 | * |
175 | 175 | * @since 1.0 |
176 | 176 | */ |
177 | - do_action( 'give_report_view_actions_before' ); |
|
177 | + do_action('give_report_view_actions_before'); |
|
178 | 178 | ?> |
179 | 179 | <form id="give-reports-filter" method="get"> |
180 | 180 | <select id="give-reports-view" name="view"> |
181 | - <option value="-1"><?php esc_html_e( 'Report Type', 'give' ); ?></option> |
|
182 | - <?php foreach ( $views as $view_id => $label ) : ?> |
|
183 | - <option value="<?php echo esc_attr( $view_id ); ?>" <?php selected( $view_id, $current_view ); ?>><?php echo $label; ?></option> |
|
181 | + <option value="-1"><?php esc_html_e('Report Type', 'give'); ?></option> |
|
182 | + <?php foreach ($views as $view_id => $label) : ?> |
|
183 | + <option value="<?php echo esc_attr($view_id); ?>" <?php selected($view_id, $current_view); ?>><?php echo $label; ?></option> |
|
184 | 184 | <?php endforeach; ?> |
185 | 185 | </select> |
186 | 186 | |
@@ -192,12 +192,12 @@ discard block |
||
192 | 192 | * |
193 | 193 | * @since 1.0 |
194 | 194 | */ |
195 | - do_action( 'give_report_view_actions' ); |
|
195 | + do_action('give_report_view_actions'); |
|
196 | 196 | ?> |
197 | 197 | |
198 | 198 | <input type="hidden" name="post_type" value="give_forms"/> |
199 | 199 | <input type="hidden" name="page" value="give-reports"/> |
200 | - <?php submit_button( esc_html__( 'Show', 'give' ), 'secondary', 'submit', false ); ?> |
|
200 | + <?php submit_button(esc_html__('Show', 'give'), 'secondary', 'submit', false); ?> |
|
201 | 201 | </form> |
202 | 202 | <?php |
203 | 203 | /** |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | * |
206 | 206 | * @since 1.0 |
207 | 207 | */ |
208 | - do_action( 'give_report_view_actions_after' ); |
|
208 | + do_action('give_report_view_actions_after'); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -218,11 +218,11 @@ discard block |
||
218 | 218 | */ |
219 | 219 | function give_reports_forms_table() { |
220 | 220 | |
221 | - if ( isset( $_GET['form-id'] ) ) { |
|
221 | + if (isset($_GET['form-id'])) { |
|
222 | 222 | return; |
223 | 223 | } |
224 | 224 | |
225 | - include( dirname( __FILE__ ) . '/class-form-reports-table.php' ); |
|
225 | + include(dirname(__FILE__).'/class-form-reports-table.php'); |
|
226 | 226 | |
227 | 227 | $give_table = new Give_Form_Reports_Table(); |
228 | 228 | $give_table->prepare_items(); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | <?php |
235 | 235 | } |
236 | 236 | |
237 | -add_action( 'give_reports_view_forms', 'give_reports_forms_table' ); |
|
237 | +add_action('give_reports_view_forms', 'give_reports_forms_table'); |
|
238 | 238 | |
239 | 239 | /** |
240 | 240 | * Renders the detailed report for a specific give form. |
@@ -243,20 +243,20 @@ discard block |
||
243 | 243 | * @return void |
244 | 244 | */ |
245 | 245 | function give_reports_form_details() { |
246 | - if ( ! isset( $_GET['form-id'] ) ) { |
|
246 | + if ( ! isset($_GET['form-id'])) { |
|
247 | 247 | return; |
248 | 248 | } |
249 | 249 | ?> |
250 | 250 | <div class="tablenav top reports-forms-details-wrap"> |
251 | 251 | <div class="actions bulkactions"> |
252 | - <button onclick="history.go(-1);" class="button-secondary"><?php esc_html_e( 'Go Back', 'give' ); ?></button> |
|
252 | + <button onclick="history.go(-1);" class="button-secondary"><?php esc_html_e('Go Back', 'give'); ?></button> |
|
253 | 253 | </div> |
254 | 254 | </div> |
255 | 255 | <?php |
256 | - give_reports_graph_of_form( absint( $_GET['form-id'] ) ); |
|
256 | + give_reports_graph_of_form(absint($_GET['form-id'])); |
|
257 | 257 | } |
258 | 258 | |
259 | -add_action( 'give_reports_view_forms', 'give_reports_form_details' ); |
|
259 | +add_action('give_reports_view_forms', 'give_reports_form_details'); |
|
260 | 260 | |
261 | 261 | /** |
262 | 262 | * Renders the Gateways Table |
@@ -267,14 +267,14 @@ discard block |
||
267 | 267 | * @return void |
268 | 268 | */ |
269 | 269 | function give_reports_gateways_table() { |
270 | - include( dirname( __FILE__ ) . '/class-gateways-reports-table.php' ); |
|
270 | + include(dirname(__FILE__).'/class-gateways-reports-table.php'); |
|
271 | 271 | |
272 | 272 | $give_table = new Give_Gateway_Reports_Table(); |
273 | 273 | $give_table->prepare_items(); |
274 | 274 | $give_table->display(); |
275 | 275 | } |
276 | 276 | |
277 | -add_action( 'give_reports_view_gateways', 'give_reports_gateways_table' ); |
|
277 | +add_action('give_reports_view_gateways', 'give_reports_gateways_table'); |
|
278 | 278 | |
279 | 279 | /** |
280 | 280 | * Renders the Reports Earnings Graphs |
@@ -285,13 +285,13 @@ discard block |
||
285 | 285 | function give_reports_earnings() { |
286 | 286 | ?> |
287 | 287 | <div class="tablenav top reports-table-nav"> |
288 | - <h2 class="reports-earnings-title screen-reader-text"><?php _e( 'Income Report', 'give' ); ?></h2> |
|
288 | + <h2 class="reports-earnings-title screen-reader-text"><?php _e('Income Report', 'give'); ?></h2> |
|
289 | 289 | </div> |
290 | 290 | <?php |
291 | 291 | give_reports_graph(); |
292 | 292 | } |
293 | 293 | |
294 | -add_action( 'give_reports_view_earnings', 'give_reports_earnings' ); |
|
294 | +add_action('give_reports_view_earnings', 'give_reports_earnings'); |
|
295 | 295 | |
296 | 296 | |
297 | 297 | /** |
@@ -302,9 +302,9 @@ discard block |
||
302 | 302 | */ |
303 | 303 | function give_estimated_monthly_stats() { |
304 | 304 | |
305 | - $estimated = Give_Cache::get( 'give_estimated_monthly_stats', true ); |
|
305 | + $estimated = Give_Cache::get('give_estimated_monthly_stats', true); |
|
306 | 306 | |
307 | - if ( false === $estimated ) { |
|
307 | + if (false === $estimated) { |
|
308 | 308 | |
309 | 309 | $estimated = array( |
310 | 310 | 'earnings' => 0, |
@@ -313,22 +313,22 @@ discard block |
||
313 | 313 | |
314 | 314 | $stats = new Give_Payment_Stats; |
315 | 315 | |
316 | - $to_date_earnings = $stats->get_earnings( 0, 'this_month' ); |
|
317 | - $to_date_sales = $stats->get_sales( 0, 'this_month' ); |
|
316 | + $to_date_earnings = $stats->get_earnings(0, 'this_month'); |
|
317 | + $to_date_sales = $stats->get_sales(0, 'this_month'); |
|
318 | 318 | |
319 | - $current_day = date( 'd', current_time( 'timestamp' ) ); |
|
320 | - $current_month = date( 'n', current_time( 'timestamp' ) ); |
|
321 | - $current_year = date( 'Y', current_time( 'timestamp' ) ); |
|
322 | - $days_in_month = cal_days_in_month( CAL_GREGORIAN, $current_month, $current_year ); |
|
319 | + $current_day = date('d', current_time('timestamp')); |
|
320 | + $current_month = date('n', current_time('timestamp')); |
|
321 | + $current_year = date('Y', current_time('timestamp')); |
|
322 | + $days_in_month = cal_days_in_month(CAL_GREGORIAN, $current_month, $current_year); |
|
323 | 323 | |
324 | - $estimated['earnings'] = ( $to_date_earnings / $current_day ) * $days_in_month; |
|
325 | - $estimated['sales'] = ( $to_date_sales / $current_day ) * $days_in_month; |
|
324 | + $estimated['earnings'] = ($to_date_earnings / $current_day) * $days_in_month; |
|
325 | + $estimated['sales'] = ($to_date_sales / $current_day) * $days_in_month; |
|
326 | 326 | |
327 | 327 | // Cache for one day |
328 | - Give_Cache::set( 'give_estimated_monthly_stats', $estimated, DAY_IN_SECONDS, true ); |
|
328 | + Give_Cache::set('give_estimated_monthly_stats', $estimated, DAY_IN_SECONDS, true); |
|
329 | 329 | } |
330 | 330 | |
331 | - return maybe_unserialize( $estimated ); |
|
331 | + return maybe_unserialize($estimated); |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | /** |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | function give_reports_set_form_method() { |
342 | 342 | return 'get'; |
343 | 343 | } |
344 | -add_filter( 'give-reports_form_method_tab_forms', 'give_reports_set_form_method', 10 ); |
|
345 | -add_filter( 'give-reports_form_method_tab_donors', 'give_reports_set_form_method', 10 ); |
|
344 | +add_filter('give-reports_form_method_tab_forms', 'give_reports_set_form_method', 10); |
|
345 | +add_filter('give-reports_form_method_tab_donors', 'give_reports_set_form_method', 10); |
|
346 | 346 | |
347 | 347 | // @TODO: After release 1.8 Donations -> Reports generates with new setting api, so we can remove some old code from this file. |
@@ -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_Gateways_Report' ) ) : |
|
16 | +if ( ! class_exists('Give_Gateways_Report')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Gateways_Report. |
@@ -34,16 +34,16 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function __construct() { |
36 | 36 | $this->id = 'gateways'; |
37 | - $this->label = esc_html__( 'Donation Methods', 'give' ); |
|
37 | + $this->label = esc_html__('Donation Methods', 'give'); |
|
38 | 38 | |
39 | 39 | parent::__construct(); |
40 | 40 | |
41 | - add_action( 'give_admin_field_report_gateways', array( $this, 'render_report_gateways_field' ), 10, 2 ); |
|
41 | + add_action('give_admin_field_report_gateways', array($this, 'render_report_gateways_field'), 10, 2); |
|
42 | 42 | |
43 | 43 | // Do not use main form for this tab. |
44 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
45 | - add_action( 'give-reports_open_form', '__return_empty_string' ); |
|
46 | - add_action( 'give-reports_close_form', '__return_empty_string' ); |
|
44 | + if (give_get_current_setting_tab() === $this->id) { |
|
45 | + add_action('give-reports_open_form', '__return_empty_string'); |
|
46 | + add_action('give-reports_close_form', '__return_empty_string'); |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param array $settings |
76 | 76 | */ |
77 | 77 | $settings = apply_filters( |
78 | - 'give_get_settings_' . $this->id, |
|
78 | + 'give_get_settings_'.$this->id, |
|
79 | 79 | array( |
80 | 80 | array( |
81 | 81 | 'id' => 'give_reports_gateways', |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ), |
85 | 85 | array( |
86 | 86 | 'id' => 'gateways', |
87 | - 'name' => esc_html__( 'Gateways', 'give' ), |
|
87 | + 'name' => esc_html__('Gateways', 'give'), |
|
88 | 88 | 'type' => 'report_gateways', |
89 | 89 | ), |
90 | 90 | array( |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | * @param $field |
109 | 109 | * @param $option_value |
110 | 110 | */ |
111 | - public function render_report_gateways_field( $field, $option_value ) { |
|
112 | - do_action( 'give_reports_view_gateways' ); |
|
111 | + public function render_report_gateways_field($field, $option_value) { |
|
112 | + do_action('give_reports_view_gateways'); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 |
@@ -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 | /** |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | global $status, $page; |
57 | 57 | |
58 | 58 | // Set parent defaults |
59 | - parent::__construct( array( |
|
60 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records. |
|
61 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records. |
|
59 | + parent::__construct(array( |
|
60 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records. |
|
61 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records. |
|
62 | 62 | 'ajax' => false // Does this table support ajax? |
63 | - ) ); |
|
63 | + )); |
|
64 | 64 | |
65 | - add_action( 'give_report_view_actions', array( $this, 'category_filter' ) ); |
|
65 | + add_action('give_report_view_actions', array($this, 'category_filter')); |
|
66 | 66 | $this->query(); |
67 | 67 | |
68 | 68 | } |
@@ -78,32 +78,32 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @return string Column Name |
80 | 80 | */ |
81 | - public function column_default( $item, $column_name ) { |
|
82 | - switch ( $column_name ) { |
|
81 | + public function column_default($item, $column_name) { |
|
82 | + switch ($column_name) { |
|
83 | 83 | case 'title': |
84 | - $title = empty( $item['title'] ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $item['ID'] ) : $item['title']; |
|
84 | + $title = empty($item['title']) ? sprintf(__('Untitled (#%s)', 'give'), $item['ID']) : $item['title']; |
|
85 | 85 | |
86 | 86 | return sprintf( |
87 | 87 | '<a href="%s">%s</a>', |
88 | - get_edit_post_link( $item['ID'] ), |
|
88 | + get_edit_post_link($item['ID']), |
|
89 | 89 | $title |
90 | 90 | ); |
91 | 91 | case 'sales': |
92 | 92 | return sprintf( |
93 | 93 | '<a href="%s">%s</a>', |
94 | - admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&form_id=' . urlencode( $item['ID'] ) ), |
|
94 | + admin_url('edit.php?post_type=give_forms&page=give-payment-history&form_id='.urlencode($item['ID'])), |
|
95 | 95 | $item['sales'] |
96 | 96 | ); |
97 | 97 | case 'earnings' : |
98 | - return give_currency_filter( give_format_amount( $item[ $column_name ], array( 'sanitize' => false ) ) ); |
|
98 | + return give_currency_filter(give_format_amount($item[$column_name], array('sanitize' => false))); |
|
99 | 99 | case 'average_sales' : |
100 | - return round( $item[ $column_name ] ); |
|
100 | + return round($item[$column_name]); |
|
101 | 101 | case 'average_earnings' : |
102 | - return give_currency_filter( give_format_amount( $item[ $column_name ], array( 'sanitize' => false ) ) ); |
|
102 | + return give_currency_filter(give_format_amount($item[$column_name], array('sanitize' => false))); |
|
103 | 103 | case 'details' : |
104 | - return '<a href="' . admin_url( 'edit.php?post_type=give_forms&page=give-reports&tab=forms&form-id=' . $item['ID'] ) . '">' . esc_html__( 'View Detailed Report', 'give' ) . '</a>'; |
|
104 | + return '<a href="'.admin_url('edit.php?post_type=give_forms&page=give-reports&tab=forms&form-id='.$item['ID']).'">'.esc_html__('View Detailed Report', 'give').'</a>'; |
|
105 | 105 | default: |
106 | - return $item[ $column_name ]; |
|
106 | + return $item[$column_name]; |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function get_columns() { |
119 | 119 | $columns = array( |
120 | - 'title' => esc_html__( 'Form', 'give' ), |
|
121 | - 'sales' => esc_html__( 'Donations', 'give' ), |
|
122 | - 'earnings' => esc_html__( 'Income', 'give' ), |
|
123 | - 'average_sales' => esc_html__( 'Monthly Average Donations', 'give' ), |
|
124 | - 'average_earnings' => esc_html__( 'Monthly Average Income', 'give' ), |
|
125 | - 'details' => esc_html__( 'Detailed Report', 'give' ) |
|
120 | + 'title' => esc_html__('Form', 'give'), |
|
121 | + 'sales' => esc_html__('Donations', 'give'), |
|
122 | + 'earnings' => esc_html__('Income', 'give'), |
|
123 | + 'average_sales' => esc_html__('Monthly Average Donations', 'give'), |
|
124 | + 'average_earnings' => esc_html__('Monthly Average Income', 'give'), |
|
125 | + 'details' => esc_html__('Detailed Report', 'give') |
|
126 | 126 | ); |
127 | 127 | |
128 | 128 | return $columns; |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function get_sortable_columns() { |
140 | 140 | return array( |
141 | - 'title' => array( 'title', true ), |
|
142 | - 'sales' => array( 'sales', false ), |
|
143 | - 'earnings' => array( 'earnings', false ), |
|
141 | + 'title' => array('title', true), |
|
142 | + 'sales' => array('sales', false), |
|
143 | + 'earnings' => array('earnings', false), |
|
144 | 144 | ); |
145 | 145 | } |
146 | 146 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @return int Current page number |
154 | 154 | */ |
155 | 155 | public function get_paged() { |
156 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
156 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @return int Category ID |
166 | 166 | */ |
167 | 167 | public function get_category() { |
168 | - return isset( $_GET['category'] ) ? absint( $_GET['category'] ) : 0; |
|
168 | + return isset($_GET['category']) ? absint($_GET['category']) : 0; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * |
177 | 177 | * @return void |
178 | 178 | */ |
179 | - public function bulk_actions( $which = '' ) { |
|
179 | + public function bulk_actions($which = '') { |
|
180 | 180 | |
181 | 181 | } |
182 | 182 | |
@@ -188,27 +188,27 @@ discard block |
||
188 | 188 | * |
189 | 189 | * @param string $which |
190 | 190 | */ |
191 | - protected function display_tablenav( $which ) { |
|
191 | + protected function display_tablenav($which) { |
|
192 | 192 | |
193 | - if ( 'top' === $which ) { |
|
194 | - wp_nonce_field( 'bulk-' . $this->_args['plural'] ); |
|
193 | + if ('top' === $which) { |
|
194 | + wp_nonce_field('bulk-'.$this->_args['plural']); |
|
195 | 195 | } |
196 | 196 | ?> |
197 | - <div class="tablenav give-clearfix <?php echo esc_attr( $which ); ?>"> |
|
197 | + <div class="tablenav give-clearfix <?php echo esc_attr($which); ?>"> |
|
198 | 198 | |
199 | - <?php if ( 'top' === $which ) { ?> |
|
199 | + <?php if ('top' === $which) { ?> |
|
200 | 200 | <h2 class="alignleft reports-earnings-title screen-reader-text"> |
201 | - <?php _e( 'Donation Forms Report', 'give' ); ?> |
|
201 | + <?php _e('Donation Forms Report', 'give'); ?> |
|
202 | 202 | </h2> |
203 | 203 | <?php } ?> |
204 | 204 | |
205 | 205 | <div class="alignright tablenav-right"> |
206 | 206 | <div class="actions bulkactions"> |
207 | - <?php $this->bulk_actions( $which ); ?> |
|
207 | + <?php $this->bulk_actions($which); ?> |
|
208 | 208 | </div> |
209 | 209 | <?php |
210 | - $this->extra_tablenav( $which ); |
|
211 | - $this->pagination( $which ); |
|
210 | + $this->extra_tablenav($which); |
|
211 | + $this->pagination($which); |
|
212 | 212 | ?> |
213 | 213 | </div> |
214 | 214 | |
@@ -228,9 +228,9 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function category_filter() { |
230 | 230 | |
231 | - $categories = get_terms( 'form_category' ); |
|
232 | - if ( $categories && ! is_wp_error( $categories ) ) { |
|
233 | - echo Give()->html->category_dropdown( 'category', $this->get_category() ); |
|
231 | + $categories = get_terms('form_category'); |
|
232 | + if ($categories && ! is_wp_error($categories)) { |
|
233 | + echo Give()->html->category_dropdown('category', $this->get_category()); |
|
234 | 234 | } |
235 | 235 | } |
236 | 236 | |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function query() { |
246 | 246 | |
247 | - $orderby = isset( $_GET['orderby'] ) ? $_GET['orderby'] : 'title'; |
|
248 | - $order = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC'; |
|
247 | + $orderby = isset($_GET['orderby']) ? $_GET['orderby'] : 'title'; |
|
248 | + $order = isset($_GET['order']) ? $_GET['order'] : 'DESC'; |
|
249 | 249 | $category = $this->get_category(); |
250 | 250 | |
251 | 251 | $args = array( |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | 'suppress_filters' => true |
259 | 259 | ); |
260 | 260 | |
261 | - if ( ! empty( $category ) ) { |
|
261 | + if ( ! empty($category)) { |
|
262 | 262 | $args['tax_query'] = array( |
263 | 263 | array( |
264 | 264 | 'taxonomy' => 'form_category', |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | ); |
268 | 268 | } |
269 | 269 | |
270 | - switch ( $orderby ) : |
|
270 | + switch ($orderby) : |
|
271 | 271 | case 'title' : |
272 | 272 | $args['orderby'] = 'title'; |
273 | 273 | break; |
@@ -283,9 +283,9 @@ discard block |
||
283 | 283 | break; |
284 | 284 | endswitch; |
285 | 285 | |
286 | - $args = apply_filters( 'give_form_reports_prepare_items_args', $args, $this ); |
|
286 | + $args = apply_filters('give_form_reports_prepare_items_args', $args, $this); |
|
287 | 287 | |
288 | - $this->donation_forms = new WP_Query( $args ); |
|
288 | + $this->donation_forms = new WP_Query($args); |
|
289 | 289 | |
290 | 290 | // Store total number of donation forms count. |
291 | 291 | $this->count = $this->donation_forms->found_posts; |
@@ -305,15 +305,15 @@ discard block |
||
305 | 305 | |
306 | 306 | $give_forms = $this->donation_forms->posts; |
307 | 307 | |
308 | - if ( $give_forms ) { |
|
309 | - foreach ( $give_forms as $form ) { |
|
308 | + if ($give_forms) { |
|
309 | + foreach ($give_forms as $form) { |
|
310 | 310 | $reports_data[] = array( |
311 | 311 | 'ID' => $form, |
312 | - 'title' => get_the_title( $form ), |
|
313 | - 'sales' => give_get_form_sales_stats( $form ), |
|
314 | - 'earnings' => give_get_form_earnings_stats( $form ), |
|
315 | - 'average_sales' => give_get_average_monthly_form_sales( $form ), |
|
316 | - 'average_earnings' => give_get_average_monthly_form_earnings( $form ) |
|
312 | + 'title' => get_the_title($form), |
|
313 | + 'sales' => give_get_form_sales_stats($form), |
|
314 | + 'earnings' => give_get_form_earnings_stats($form), |
|
315 | + 'average_sales' => give_get_average_monthly_form_sales($form), |
|
316 | + 'average_earnings' => give_get_average_monthly_form_earnings($form) |
|
317 | 317 | ); |
318 | 318 | } |
319 | 319 | } |
@@ -338,14 +338,14 @@ discard block |
||
338 | 338 | $columns = $this->get_columns(); |
339 | 339 | $hidden = array(); // No hidden columns |
340 | 340 | $sortable = $this->get_sortable_columns(); |
341 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
341 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
342 | 342 | $this->items = $this->reports_data(); |
343 | 343 | $total_items = $this->count; |
344 | 344 | |
345 | - $this->set_pagination_args( array( |
|
345 | + $this->set_pagination_args(array( |
|
346 | 346 | 'total_items' => $total_items, |
347 | 347 | 'per_page' => $this->per_page, |
348 | - 'total_pages' => ceil( $total_items / $this->per_page ) |
|
348 | + 'total_pages' => ceil($total_items / $this->per_page) |
|
349 | 349 | ) |
350 | 350 | ); |
351 | 351 | } |
@@ -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,15 +64,15 @@ 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 | case 'complete_sales': |
70 | - $value = $item[ $column_name ]; |
|
70 | + $value = $item[$column_name]; |
|
71 | 71 | |
72 | 72 | break; |
73 | 73 | |
74 | 74 | default: |
75 | - $value = $item[ $column_name ]; |
|
75 | + $value = $item[$column_name]; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | return $value; |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function get_columns() { |
89 | 89 | $columns = array( |
90 | - 'label' => esc_attr__( 'Gateway', 'give' ), |
|
91 | - 'complete_sales' => esc_attr__( 'Complete Payments', 'give' ), |
|
92 | - 'pending_sales' => esc_attr__( 'Pending / Failed Payments', 'give' ), |
|
93 | - 'total_sales' => esc_attr__( 'Total Payments', 'give' ), |
|
94 | - 'total_donations' => esc_attr__( 'Total Donated', 'give' ) |
|
90 | + 'label' => esc_attr__('Gateway', 'give'), |
|
91 | + 'complete_sales' => esc_attr__('Complete Payments', 'give'), |
|
92 | + 'pending_sales' => esc_attr__('Pending / Failed Payments', 'give'), |
|
93 | + 'total_sales' => esc_attr__('Total Payments', 'give'), |
|
94 | + 'total_donations' => esc_attr__('Total Donated', 'give') |
|
95 | 95 | ); |
96 | 96 | |
97 | 97 | return $columns; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function get_sortable_columns() { |
108 | 108 | return array( |
109 | - 'total_donations' => array( 'total_donations', false ) |
|
109 | + 'total_donations' => array('total_donations', false) |
|
110 | 110 | ); |
111 | 111 | } |
112 | 112 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * @return int Current page number |
120 | 120 | */ |
121 | 121 | public function get_paged() { |
122 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
122 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @since 1.0 |
131 | 131 | * @return void |
132 | 132 | */ |
133 | - public function bulk_actions( $which = '' ) { |
|
133 | + public function bulk_actions($which = '') { |
|
134 | 134 | |
135 | 135 | } |
136 | 136 | |
@@ -142,27 +142,27 @@ discard block |
||
142 | 142 | * |
143 | 143 | * @param string $which |
144 | 144 | */ |
145 | - protected function display_tablenav( $which ) { |
|
145 | + protected function display_tablenav($which) { |
|
146 | 146 | |
147 | - if ( 'top' === $which ) { |
|
148 | - wp_nonce_field( 'bulk-' . $this->_args['plural'] ); |
|
147 | + if ('top' === $which) { |
|
148 | + wp_nonce_field('bulk-'.$this->_args['plural']); |
|
149 | 149 | } |
150 | 150 | ?> |
151 | - <div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr( $which ); ?>"> |
|
151 | + <div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr($which); ?>"> |
|
152 | 152 | |
153 | - <?php if ( 'top' === $which ) { ?> |
|
153 | + <?php if ('top' === $which) { ?> |
|
154 | 154 | <h2 class="alignleft reports-earnings-title screen-reader-text"> |
155 | - <?php _e( 'Donation Methods Report', 'give' ); ?> |
|
155 | + <?php _e('Donation Methods Report', 'give'); ?> |
|
156 | 156 | </h2> |
157 | 157 | <?php } ?> |
158 | 158 | |
159 | 159 | <div class="alignright tablenav-right"> |
160 | 160 | <div class="actions bulkactions"> |
161 | - <?php $this->bulk_actions( $which ); ?> |
|
161 | + <?php $this->bulk_actions($which); ?> |
|
162 | 162 | </div> |
163 | 163 | <?php |
164 | - $this->extra_tablenav( $which ); |
|
165 | - $this->pagination( $which ); |
|
164 | + $this->extra_tablenav($which); |
|
165 | + $this->pagination($which); |
|
166 | 166 | ?> |
167 | 167 | </div> |
168 | 168 | |
@@ -184,17 +184,17 @@ discard block |
||
184 | 184 | * |
185 | 185 | * @return int |
186 | 186 | */ |
187 | - public function give_sort_total_donations( $old_value, $new_value ) { |
|
187 | + public function give_sort_total_donations($old_value, $new_value) { |
|
188 | 188 | // If no sort, default to label. |
189 | - $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'label'; |
|
189 | + $orderby = ( ! empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'label'; |
|
190 | 190 | |
191 | 191 | //If no order, default to asc. |
192 | - $order = ( ! empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'asc'; |
|
192 | + $order = ( ! empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; |
|
193 | 193 | |
194 | 194 | //Determine sort order. |
195 | - $result = strcmp( $old_value[ $orderby ], $new_value[ $orderby ] ); |
|
195 | + $result = strcmp($old_value[$orderby], $new_value[$orderby]); |
|
196 | 196 | |
197 | - return ( $order === 'asc' ) ? $result : -$result; |
|
197 | + return ($order === 'asc') ? $result : -$result; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | |
@@ -211,10 +211,10 @@ discard block |
||
211 | 211 | $gateways = give_get_payment_gateways(); |
212 | 212 | $stats = new Give_Payment_Stats(); |
213 | 213 | |
214 | - foreach ( $gateways as $gateway_id => $gateway ) { |
|
214 | + foreach ($gateways as $gateway_id => $gateway) { |
|
215 | 215 | |
216 | - $complete_count = give_count_sales_by_gateway( $gateway_id, 'publish' ); |
|
217 | - $pending_count = give_count_sales_by_gateway( $gateway_id, array( 'pending', 'failed' ) ); |
|
216 | + $complete_count = give_count_sales_by_gateway($gateway_id, 'publish'); |
|
217 | + $pending_count = give_count_sales_by_gateway($gateway_id, array('pending', 'failed')); |
|
218 | 218 | |
219 | 219 | $reports_data[] = array( |
220 | 220 | 'ID' => $gateway_id, |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | 'complete_sales' => $complete_count, |
223 | 223 | 'pending_sales' => $pending_count, |
224 | 224 | 'total_sales' => $complete_count + $pending_count, |
225 | - 'total_donations' => give_currency_filter( give_format_amount( $stats->get_earnings( 0, strtotime('04/13/2015' ), current_time('timestamp' ), $gateway_id ), array( 'sanitize' => false ) ) ), |
|
225 | + 'total_donations' => give_currency_filter(give_format_amount($stats->get_earnings(0, strtotime('04/13/2015'), current_time('timestamp'), $gateway_id), array('sanitize' => false))), |
|
226 | 226 | ); |
227 | 227 | } |
228 | 228 | |
@@ -243,11 +243,11 @@ discard block |
||
243 | 243 | $columns = $this->get_columns(); |
244 | 244 | $hidden = array(); // No hidden columns |
245 | 245 | $sortable = $this->get_sortable_columns(); |
246 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
246 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
247 | 247 | $this->items = $this->reports_data(); |
248 | 248 | |
249 | 249 | // Sort Array when we are sorting data in array. |
250 | - usort( $this->items, array( $this, 'give_sort_total_donations' ) ); |
|
250 | + usort($this->items, array($this, 'give_sort_total_donations')); |
|
251 | 251 | |
252 | 252 | } |
253 | 253 | } |
@@ -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 | |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | * @return void |
22 | 22 | */ |
23 | 23 | function give_register_dashboard_widgets() { |
24 | - if ( current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) { |
|
25 | - wp_add_dashboard_widget( 'give_dashboard_sales', __( 'Give: Donation Statistics', 'give' ), 'give_dashboard_sales_widget' ); |
|
24 | + if (current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) { |
|
25 | + wp_add_dashboard_widget('give_dashboard_sales', __('Give: Donation Statistics', 'give'), 'give_dashboard_sales_widget'); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
29 | -add_action( 'wp_dashboard_setup', 'give_register_dashboard_widgets', 10 ); |
|
29 | +add_action('wp_dashboard_setup', 'give_register_dashboard_widgets', 10); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Sales Summary Dashboard Widget |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | function give_dashboard_sales_widget() { |
40 | 40 | |
41 | - if ( ! current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) { |
|
41 | + if ( ! current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) { |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 | $stats = new Give_Payment_Stats(); ?> |
@@ -46,27 +46,27 @@ discard block |
||
46 | 46 | <div class="give-dashboard-widget"> |
47 | 47 | |
48 | 48 | <div class="give-dashboard-today give-clearfix"> |
49 | - <h3 class="give-dashboard-date-today"><?php echo date( _x( 'F j, Y', 'dashboard widget', 'give' ) ); ?></h3> |
|
49 | + <h3 class="give-dashboard-date-today"><?php echo date(_x('F j, Y', 'dashboard widget', 'give')); ?></h3> |
|
50 | 50 | |
51 | 51 | <p class="give-dashboard-happy-day"><?php |
52 | 52 | printf( |
53 | 53 | /* translators: %s: day of the week */ |
54 | - __( 'Happy %s!', 'give' ), |
|
55 | - date( 'l', current_time( 'timestamp' ) ) |
|
54 | + __('Happy %s!', 'give'), |
|
55 | + date('l', current_time('timestamp')) |
|
56 | 56 | ); |
57 | 57 | ?></p> |
58 | 58 | |
59 | 59 | <p class="give-dashboard-today-earnings"><?php |
60 | - $earnings_today = $stats->get_earnings( 0, 'today', false ); |
|
61 | - echo give_currency_filter( give_format_amount( $earnings_today, array( 'sanitize' => false ) ) ); |
|
60 | + $earnings_today = $stats->get_earnings(0, 'today', false); |
|
61 | + echo give_currency_filter(give_format_amount($earnings_today, array('sanitize' => false))); |
|
62 | 62 | ?></p> |
63 | 63 | |
64 | 64 | <p class="give-donations-today"><?php |
65 | - $donations_today = $stats->get_sales( 0, 'today', false ); |
|
65 | + $donations_today = $stats->get_sales(0, 'today', false); |
|
66 | 66 | printf( |
67 | 67 | /* translators: %s: daily donation count */ |
68 | - __( '%s donations today', 'give' ), |
|
69 | - give_format_amount( $donations_today, array( 'decimal' => false, 'sanitize' => false ) ) |
|
68 | + __('%s donations today', 'give'), |
|
69 | + give_format_amount($donations_today, array('decimal' => false, 'sanitize' => false)) |
|
70 | 70 | ); |
71 | 71 | ?></p> |
72 | 72 | |
@@ -76,34 +76,34 @@ discard block |
||
76 | 76 | <table class="give-table-stats"> |
77 | 77 | <thead style="display: none;"> |
78 | 78 | <tr> |
79 | - <th><?php _e( 'This Week', 'give' ); ?></th> |
|
80 | - <th><?php _e( 'This Month', 'give' ); ?></th> |
|
81 | - <th><?php _e( 'Past 30 Days', 'give' ); ?></th> |
|
79 | + <th><?php _e('This Week', 'give'); ?></th> |
|
80 | + <th><?php _e('This Month', 'give'); ?></th> |
|
81 | + <th><?php _e('Past 30 Days', 'give'); ?></th> |
|
82 | 82 | </tr> |
83 | 83 | </thead> |
84 | 84 | <tbody> |
85 | 85 | <tr id="give-table-stats-tr-1"> |
86 | 86 | <td> |
87 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_week' ), array( 'sanitize' => false ) ) ); ?></p> |
|
87 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_week'), array('sanitize' => false))); ?></p> |
|
88 | 88 | |
89 | - <p class="give-dashboard-stat-total-label"><?php _e( 'This Week', 'give' ); ?></p> |
|
89 | + <p class="give-dashboard-stat-total-label"><?php _e('This Week', 'give'); ?></p> |
|
90 | 90 | </td> |
91 | 91 | <td> |
92 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_month' ), array( 'sanitize' => false ) ) ); ?></p> |
|
92 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_month'), array('sanitize' => false))); ?></p> |
|
93 | 93 | |
94 | - <p class="give-dashboard-stat-total-label"><?php _e( 'This Month', 'give' ); ?></p> |
|
94 | + <p class="give-dashboard-stat-total-label"><?php _e('This Month', 'give'); ?></p> |
|
95 | 95 | </td> |
96 | 96 | </tr> |
97 | 97 | <tr id="give-table-stats-tr-2"> |
98 | 98 | <td> |
99 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'last_month' ), array( 'sanitize' => false ) ) ) ?></p> |
|
99 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'last_month'), array('sanitize' => false))) ?></p> |
|
100 | 100 | |
101 | - <p class="give-dashboard-stat-total-label"><?php _e( 'Last Month', 'give' ); ?></p> |
|
101 | + <p class="give-dashboard-stat-total-label"><?php _e('Last Month', 'give'); ?></p> |
|
102 | 102 | </td> |
103 | 103 | <td> |
104 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( give_get_total_earnings(), array( 'sanitize' => false ) ) ) ?></p> |
|
104 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount(give_get_total_earnings(), array('sanitize' => false))) ?></p> |
|
105 | 105 | |
106 | - <p class="give-dashboard-stat-total-label"><?php _e( 'This Year', 'give' ); ?></p> |
|
106 | + <p class="give-dashboard-stat-total-label"><?php _e('This Year', 'give'); ?></p> |
|
107 | 107 | </td> |
108 | 108 | </tr> |
109 | 109 | </tbody> |
@@ -123,24 +123,24 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @return array |
125 | 125 | */ |
126 | -function give_dashboard_at_a_glance_widget( $items ) { |
|
126 | +function give_dashboard_at_a_glance_widget($items) { |
|
127 | 127 | |
128 | - $num_posts = wp_count_posts( 'give_forms' ); |
|
128 | + $num_posts = wp_count_posts('give_forms'); |
|
129 | 129 | |
130 | - if ( $num_posts && $num_posts->publish ) { |
|
130 | + if ($num_posts && $num_posts->publish) { |
|
131 | 131 | |
132 | 132 | $text = sprintf( |
133 | 133 | /* translators: %s: number of posts published */ |
134 | - _n( '%s Give Form', '%s Give Forms', $num_posts->publish, 'give' ), |
|
134 | + _n('%s Give Form', '%s Give Forms', $num_posts->publish, 'give'), |
|
135 | 135 | $num_posts->publish |
136 | 136 | ); |
137 | 137 | |
138 | - $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); |
|
138 | + $text = sprintf($text, number_format_i18n($num_posts->publish)); |
|
139 | 139 | |
140 | - if ( current_user_can( 'edit_give_forms', get_current_user_id() ) ) { |
|
140 | + if (current_user_can('edit_give_forms', get_current_user_id())) { |
|
141 | 141 | $text = sprintf( |
142 | 142 | '<a class="give-forms-count" href="%1$s">%2$s</a>', |
143 | - admin_url( 'edit.php?post_type=give_forms' ), |
|
143 | + admin_url('edit.php?post_type=give_forms'), |
|
144 | 144 | $text |
145 | 145 | ); |
146 | 146 | } else { |
@@ -156,4 +156,4 @@ discard block |
||
156 | 156 | return $items; |
157 | 157 | } |
158 | 158 | |
159 | -add_filter( 'dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1 ); |
|
159 | +add_filter('dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1); |
@@ -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 | /** |
@@ -49,45 +49,45 @@ discard block |
||
49 | 49 | * @return void |
50 | 50 | */ |
51 | 51 | public function admin_menus() { |
52 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
52 | + list($display_version) = explode('-', GIVE_VERSION); |
|
53 | 53 | |
54 | 54 | // About Page |
55 | 55 | add_dashboard_page( |
56 | 56 | /* translators: %s: Give version */ |
57 | - sprintf( esc_html__( 'Welcome to Give %s', 'give' ), $display_version ), |
|
58 | - esc_html__( 'Welcome to Give', 'give' ), |
|
57 | + sprintf(esc_html__('Welcome to Give %s', 'give'), $display_version), |
|
58 | + esc_html__('Welcome to Give', 'give'), |
|
59 | 59 | $this->minimum_capability, |
60 | 60 | 'give-about', |
61 | - array( $this, 'about_screen' ) |
|
61 | + array($this, 'about_screen') |
|
62 | 62 | ); |
63 | 63 | |
64 | 64 | // Changelog Page |
65 | 65 | add_dashboard_page( |
66 | - esc_html__( 'Give Changelog', 'give' ), |
|
67 | - esc_html__( 'Give Changelog', 'give' ), |
|
66 | + esc_html__('Give Changelog', 'give'), |
|
67 | + esc_html__('Give Changelog', 'give'), |
|
68 | 68 | $this->minimum_capability, |
69 | 69 | 'give-changelog', |
70 | - array( $this, 'changelog_screen' ) |
|
70 | + array($this, 'changelog_screen') |
|
71 | 71 | ); |
72 | 72 | |
73 | 73 | // Getting Started Page |
74 | 74 | add_dashboard_page( |
75 | 75 | /* translators: %s: Give version */ |
76 | - sprintf( esc_html__( 'Give %s - Getting Started Guide', 'give' ), $display_version ), |
|
77 | - esc_html__( 'Getting started with Give', 'give' ), |
|
76 | + sprintf(esc_html__('Give %s - Getting Started Guide', 'give'), $display_version), |
|
77 | + esc_html__('Getting started with Give', 'give'), |
|
78 | 78 | $this->minimum_capability, |
79 | 79 | 'give-getting-started', |
80 | - array( $this, 'getting_started_screen' ) |
|
80 | + array($this, 'getting_started_screen') |
|
81 | 81 | ); |
82 | 82 | |
83 | 83 | // Credits Page |
84 | 84 | add_dashboard_page( |
85 | 85 | /* translators: %s: Give version */ |
86 | - sprintf( esc_html__( 'Give %s - Credits', 'give' ), $display_version ), |
|
87 | - esc_html__( 'The people that build Give', 'give' ), |
|
86 | + sprintf(esc_html__('Give %s - Credits', 'give'), $display_version), |
|
87 | + esc_html__('The people that build Give', 'give'), |
|
88 | 88 | $this->minimum_capability, |
89 | 89 | 'give-credits', |
90 | - array( $this, 'credits_screen' ) |
|
90 | + array($this, 'credits_screen') |
|
91 | 91 | ); |
92 | 92 | } |
93 | 93 | |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function admin_head() { |
102 | 102 | |
103 | - remove_submenu_page( 'index.php', 'give-about' ); |
|
104 | - remove_submenu_page( 'index.php', 'give-changelog' ); |
|
105 | - remove_submenu_page( 'index.php', 'give-getting-started' ); |
|
106 | - remove_submenu_page( 'index.php', 'give-credits' ); |
|
103 | + remove_submenu_page('index.php', 'give-about'); |
|
104 | + remove_submenu_page('index.php', 'give-changelog'); |
|
105 | + remove_submenu_page('index.php', 'give-getting-started'); |
|
106 | + remove_submenu_page('index.php', 'give-credits'); |
|
107 | 107 | |
108 | 108 | } |
109 | 109 | |
@@ -115,24 +115,24 @@ discard block |
||
115 | 115 | * @return void |
116 | 116 | */ |
117 | 117 | public function tabs() { |
118 | - $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about'; |
|
118 | + $selected = isset($_GET['page']) ? $_GET['page'] : 'give-about'; |
|
119 | 119 | ?> |
120 | 120 | <h2 class="nav-tab-wrapper"> |
121 | 121 | <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" |
122 | - href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>"> |
|
123 | - <?php esc_html_e( 'About Give', 'give' ); ?> |
|
122 | + href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>"> |
|
123 | + <?php esc_html_e('About Give', 'give'); ?> |
|
124 | 124 | </a> |
125 | 125 | <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" |
126 | - href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>"> |
|
127 | - <?php esc_html_e( 'Getting Started', 'give' ); ?> |
|
126 | + href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>"> |
|
127 | + <?php esc_html_e('Getting Started', 'give'); ?> |
|
128 | 128 | </a> |
129 | 129 | <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" |
130 | - href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>"> |
|
131 | - <?php esc_html_e( 'Credits', 'give' ); ?> |
|
130 | + href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>"> |
|
131 | + <?php esc_html_e('Credits', 'give'); ?> |
|
132 | 132 | </a> |
133 | 133 | <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" |
134 | - href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-addons' ) ); ?>"> |
|
135 | - <?php esc_html_e( 'Add-ons', 'give' ); ?> |
|
134 | + href="<?php echo esc_url(admin_url('edit.php?post_type=give_forms&page=give-addons')); ?>"> |
|
135 | + <?php esc_html_e('Add-ons', 'give'); ?> |
|
136 | 136 | </a> |
137 | 137 | </h2> |
138 | 138 | <?php |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @return void |
147 | 147 | */ |
148 | 148 | public function about_screen() { |
149 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
149 | + list($display_version) = explode('-', GIVE_VERSION); |
|
150 | 150 | ?> |
151 | 151 | <div class="wrap about-wrap"> |
152 | 152 | |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | <p class="about-text"><?php |
156 | 156 | printf( |
157 | 157 | /* translators: %s: http://docs.givewp.com/docs */ |
158 | - __( '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. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ), |
|
159 | - esc_url( 'http://docs.givewp.com/docs' ) |
|
158 | + __('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. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'), |
|
159 | + esc_url('http://docs.givewp.com/docs') |
|
160 | 160 | ); |
161 | 161 | ?></p> |
162 | 162 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | <div class="give-badge"><?php |
166 | 166 | printf( |
167 | 167 | /* translators: %s: Give version */ |
168 | - esc_html__( 'Version %s', 'give' ), |
|
168 | + esc_html__('Version %s', 'give'), |
|
169 | 169 | $display_version |
170 | 170 | ); |
171 | 171 | ?></div> |
@@ -175,17 +175,17 @@ discard block |
||
175 | 175 | <div class="feature-section clearfix introduction"> |
176 | 176 | |
177 | 177 | <div class="video feature-section-item"> |
178 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" |
|
179 | - alt="<?php esc_attr_e( 'Give', 'give' ); ?>"> |
|
178 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" |
|
179 | + alt="<?php esc_attr_e('Give', 'give'); ?>"> |
|
180 | 180 | </div> |
181 | 181 | |
182 | 182 | <div class="content feature-section-item last-feature"> |
183 | 183 | |
184 | - <h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3> |
|
184 | + <h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3> |
|
185 | 185 | |
186 | - <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> |
|
186 | + <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> |
|
187 | 187 | <a href="https://givewp.com" target="_blank" class="button-secondary"> |
188 | - <?php esc_html_e( 'Learn More', 'give' ); ?> |
|
188 | + <?php esc_html_e('Learn More', 'give'); ?> |
|
189 | 189 | <span class="dashicons dashicons-external"></span> |
190 | 190 | </a> |
191 | 191 | |
@@ -198,22 +198,22 @@ discard block |
||
198 | 198 | |
199 | 199 | <div class="content feature-section-item"> |
200 | 200 | |
201 | - <h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3> |
|
201 | + <h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3> |
|
202 | 202 | |
203 | - <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 a 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> |
|
203 | + <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 a 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> |
|
204 | 204 | |
205 | 205 | <h4>Find Out More:</h4> |
206 | 206 | <ul class="ul-disc"> |
207 | - <li><a href="https://givewp.com/" target="_blank"><?php esc_html_e( 'Visit the Give Website', 'give' ); ?></a></li> |
|
208 | - <li><a href="https://givewp.com/features/" target="_blank"><?php esc_html_e( 'View the Give Features', 'give' ); ?></a></li> |
|
209 | - <li><a href="https://givewp.com/documentation/" target="_blank"><?php esc_html_e( 'Read the Documentation', 'give' ); ?></a></li> |
|
207 | + <li><a href="https://givewp.com/" target="_blank"><?php esc_html_e('Visit the Give Website', 'give'); ?></a></li> |
|
208 | + <li><a href="https://givewp.com/features/" target="_blank"><?php esc_html_e('View the Give Features', 'give'); ?></a></li> |
|
209 | + <li><a href="https://givewp.com/documentation/" target="_blank"><?php esc_html_e('Read the Documentation', 'give'); ?></a></li> |
|
210 | 210 | </ul> |
211 | 211 | |
212 | 212 | </div> |
213 | 213 | |
214 | 214 | <div class="content feature-section-item last-feature"> |
215 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/admin/give-form-mockup.png' ?>" |
|
216 | - alt="<?php esc_attr_e( 'A Give donation form', 'give' ); ?>"> |
|
215 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/admin/give-form-mockup.png' ?>" |
|
216 | + alt="<?php esc_attr_e('A Give donation form', 'give'); ?>"> |
|
217 | 217 | </div> |
218 | 218 | |
219 | 219 | </div> |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @return void |
233 | 233 | */ |
234 | 234 | public function changelog_screen() { |
235 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
235 | + list($display_version) = explode('-', GIVE_VERSION); |
|
236 | 236 | ?> |
237 | 237 | <div class="wrap about-wrap"> |
238 | 238 | <h1><?php echo get_admin_page_title(); ?></h1> |
@@ -240,14 +240,14 @@ discard block |
||
240 | 240 | <p class="about-text"><?php |
241 | 241 | printf( |
242 | 242 | /* translators: %s: Give version */ |
243 | - esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ), |
|
243 | + esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'), |
|
244 | 244 | $display_version |
245 | 245 | ); |
246 | 246 | ?></p> |
247 | 247 | <div class="give-badge"><?php |
248 | 248 | printf( |
249 | 249 | /* translators: %s: Give version */ |
250 | - esc_html__( 'Version %s', 'give' ), |
|
250 | + esc_html__('Version %s', 'give'), |
|
251 | 251 | $display_version |
252 | 252 | ); |
253 | 253 | ?></div> |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | <?php $this->tabs(); ?> |
256 | 256 | |
257 | 257 | <div class="changelog"> |
258 | - <h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3> |
|
258 | + <h3><?php esc_html_e('Full Changelog', 'give'); ?></h3> |
|
259 | 259 | |
260 | 260 | <div class="feature-section"> |
261 | 261 | <?php echo $this->parse_readme(); ?> |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | </div> |
264 | 264 | |
265 | 265 | <div class="return-to-dashboard"> |
266 | - <a href="<?php echo esc_url( admin_url( add_query_arg( array( |
|
266 | + <a href="<?php echo esc_url(admin_url(add_query_arg(array( |
|
267 | 267 | 'post_type' => 'give_forms', |
268 | 268 | 'page' => 'give-settings' |
269 | - ), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Give Settings', 'give' ); ?></a> |
|
269 | + ), 'edit.php'))); ?>"><?php esc_html_e('Give Settings', 'give'); ?></a> |
|
270 | 270 | </div> |
271 | 271 | </div> |
272 | 272 | <?php |
@@ -280,36 +280,36 @@ discard block |
||
280 | 280 | * @return void |
281 | 281 | */ |
282 | 282 | public function getting_started_screen() { |
283 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
283 | + list($display_version) = explode('-', GIVE_VERSION); |
|
284 | 284 | ?> |
285 | 285 | <div class="wrap about-wrap get-started"> |
286 | 286 | |
287 | 287 | <?php $this->get_welcome_header() ?> |
288 | 288 | |
289 | - <p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p> |
|
289 | + <p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p> |
|
290 | 290 | |
291 | 291 | <?php give_get_newsletter(); ?> |
292 | 292 | |
293 | 293 | <div class="give-badge"><?php |
294 | 294 | printf( |
295 | 295 | /* translators: %s: Give version */ |
296 | - esc_html__( 'Version %s', 'give' ), |
|
296 | + esc_html__('Version %s', 'give'), |
|
297 | 297 | $display_version |
298 | 298 | ); |
299 | 299 | ?></div> |
300 | 300 | |
301 | 301 | <?php $this->tabs(); ?> |
302 | 302 | |
303 | - <p 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 ); ?></p> |
|
303 | + <p 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); ?></p> |
|
304 | 304 | |
305 | 305 | <div class="feature-section clearfix"> |
306 | 306 | |
307 | 307 | <div class="content feature-section-item"> |
308 | - <h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3> |
|
308 | + <h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3> |
|
309 | 309 | |
310 | - <p><?php esc_html_e( 'Give is driven by it\'s powerful donation form building features. However, it is much more than just a "donation form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give' ); ?></p> |
|
310 | + <p><?php esc_html_e('Give is driven by it\'s powerful donation form building features. However, it is much more than just a "donation form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give'); ?></p> |
|
311 | 311 | |
312 | - <p><?php esc_html_e( 'All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give' ); ?></p> |
|
312 | + <p><?php esc_html_e('All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give'); ?></p> |
|
313 | 313 | </div> |
314 | 314 | |
315 | 315 | <div class="content feature-section-item last-feature"> |
@@ -326,9 +326,9 @@ discard block |
||
326 | 326 | </div> |
327 | 327 | |
328 | 328 | <div class="content feature-section-item last-feature"> |
329 | - <h3><?php esc_html_e( 'STEP 2: Customize Your Donation Forms', 'give' ); ?></h3> |
|
329 | + <h3><?php esc_html_e('STEP 2: Customize Your Donation Forms', 'give'); ?></h3> |
|
330 | 330 | |
331 | - <p><?php esc_html_e( 'Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give' ); ?></p> |
|
331 | + <p><?php esc_html_e('Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give'); ?></p> |
|
332 | 332 | </div> |
333 | 333 | |
334 | 334 | </div> |
@@ -337,11 +337,11 @@ discard block |
||
337 | 337 | <div class="feature-section clearfix"> |
338 | 338 | |
339 | 339 | <div class="content feature-section-item add-content"> |
340 | - <h3><?php esc_html_e( 'STEP 3: Add Additional Content', 'give' ); ?></h3> |
|
340 | + <h3><?php esc_html_e('STEP 3: Add Additional Content', 'give'); ?></h3> |
|
341 | 341 | |
342 | - <p><?php esc_html_e( 'Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give' ); ?></p> |
|
342 | + <p><?php esc_html_e('Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give'); ?></p> |
|
343 | 343 | |
344 | - <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> |
|
344 | + <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> |
|
345 | 345 | </div> |
346 | 346 | |
347 | 347 | <div class="content feature-section-item last-feature"> |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | </div> |
359 | 359 | |
360 | 360 | <div class="content feature-section-item last-feature"> |
361 | - <h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3> |
|
361 | + <h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3> |
|
362 | 362 | |
363 | - <p><?php esc_html_e( 'Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give' ); ?></p> |
|
363 | + <p><?php esc_html_e('Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give'); ?></p> |
|
364 | 364 | </div> |
365 | 365 | |
366 | 366 | |
@@ -380,20 +380,20 @@ discard block |
||
380 | 380 | * @return void |
381 | 381 | */ |
382 | 382 | public function credits_screen() { |
383 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
383 | + list($display_version) = explode('-', GIVE_VERSION); |
|
384 | 384 | ?> |
385 | 385 | <div class="wrap about-wrap"> |
386 | 386 | |
387 | 387 | <?php $this->get_welcome_header() ?> |
388 | 388 | |
389 | - <p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p> |
|
389 | + <p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly.', 'give'); ?></p> |
|
390 | 390 | |
391 | 391 | <?php give_get_newsletter(); ?> |
392 | 392 | |
393 | 393 | <div class="give-badge"><?php |
394 | 394 | printf( |
395 | 395 | /* translators: %s: Give version */ |
396 | - esc_html__( 'Version %s', 'give' ), |
|
396 | + esc_html__('Version %s', 'give'), |
|
397 | 397 | $display_version |
398 | 398 | ); |
399 | 399 | ?></div> |
@@ -403,8 +403,8 @@ discard block |
||
403 | 403 | <p class="about-description"><?php |
404 | 404 | printf( |
405 | 405 | /* translators: %s: https://github.com/WordImpress/give */ |
406 | - __( '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' ), |
|
407 | - esc_url( 'https://github.com/WordImpress/give' ) |
|
406 | + __('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'), |
|
407 | + esc_url('https://github.com/WordImpress/give') |
|
408 | 408 | ); |
409 | 409 | ?></p> |
410 | 410 | |
@@ -421,21 +421,21 @@ discard block |
||
421 | 421 | * @return string $readme HTML formatted readme file |
422 | 422 | */ |
423 | 423 | public function parse_readme() { |
424 | - $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
424 | + $file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
425 | 425 | |
426 | - if ( ! $file ) { |
|
427 | - $readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>'; |
|
426 | + if ( ! $file) { |
|
427 | + $readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>'; |
|
428 | 428 | } else { |
429 | - $readme = file_get_contents( $file ); |
|
430 | - $readme = nl2br( esc_html( $readme ) ); |
|
431 | - $readme = explode( '== Changelog ==', $readme ); |
|
432 | - $readme = end( $readme ); |
|
433 | - |
|
434 | - $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme ); |
|
435 | - $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme ); |
|
436 | - $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme ); |
|
437 | - $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme ); |
|
438 | - $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme ); |
|
429 | + $readme = file_get_contents($file); |
|
430 | + $readme = nl2br(esc_html($readme)); |
|
431 | + $readme = explode('== Changelog ==', $readme); |
|
432 | + $readme = end($readme); |
|
433 | + |
|
434 | + $readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme); |
|
435 | + $readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme); |
|
436 | + $readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme); |
|
437 | + $readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme); |
|
438 | + $readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | return $readme; |
@@ -452,24 +452,24 @@ discard block |
||
452 | 452 | public function contributors() { |
453 | 453 | $contributors = $this->get_contributors(); |
454 | 454 | |
455 | - if ( empty( $contributors ) ) { |
|
455 | + if (empty($contributors)) { |
|
456 | 456 | return ''; |
457 | 457 | } |
458 | 458 | |
459 | 459 | $contributor_list = '<ul class="wp-people-group">'; |
460 | 460 | |
461 | - foreach ( $contributors as $contributor ) { |
|
461 | + foreach ($contributors as $contributor) { |
|
462 | 462 | $contributor_list .= '<li class="wp-person">'; |
463 | 463 | $contributor_list .= sprintf( |
464 | 464 | '<a href="%1$s" target="_blank"><img src="%2$s" width="64" height="64" class="gravatar" alt="%3$s" /></a>', |
465 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
466 | - esc_url( $contributor->avatar_url ), |
|
467 | - esc_attr( $contributor->login ) |
|
465 | + esc_url('https://github.com/'.$contributor->login), |
|
466 | + esc_url($contributor->avatar_url), |
|
467 | + esc_attr($contributor->login) |
|
468 | 468 | ); |
469 | 469 | $contributor_list .= sprintf( |
470 | 470 | '<a class="web" target="_blank" href="%1$s">%2$s</a>', |
471 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
472 | - esc_html( $contributor->login ) |
|
471 | + esc_url('https://github.com/'.$contributor->login), |
|
472 | + esc_html($contributor->login) |
|
473 | 473 | ); |
474 | 474 | $contributor_list .= '</li>'; |
475 | 475 | } |
@@ -487,25 +487,25 @@ discard block |
||
487 | 487 | * @return array $contributors List of contributors |
488 | 488 | */ |
489 | 489 | public function get_contributors() { |
490 | - $contributors = Give_Cache::get( 'give_contributors', true ); |
|
490 | + $contributors = Give_Cache::get('give_contributors', true); |
|
491 | 491 | |
492 | - if ( false !== $contributors ) { |
|
492 | + if (false !== $contributors) { |
|
493 | 493 | return $contributors; |
494 | 494 | } |
495 | 495 | |
496 | - $response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) ); |
|
496 | + $response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false)); |
|
497 | 497 | |
498 | - if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { |
|
498 | + if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) { |
|
499 | 499 | return array(); |
500 | 500 | } |
501 | 501 | |
502 | - $contributors = json_decode( wp_remote_retrieve_body( $response ) ); |
|
502 | + $contributors = json_decode(wp_remote_retrieve_body($response)); |
|
503 | 503 | |
504 | - if ( ! is_array( $contributors ) ) { |
|
504 | + if ( ! is_array($contributors)) { |
|
505 | 505 | return array(); |
506 | 506 | } |
507 | 507 | |
508 | - Give_Cache::set( 'give_contributors', $contributors, HOUR_IN_SECONDS, true ); |
|
508 | + Give_Cache::set('give_contributors', $contributors, HOUR_IN_SECONDS, true); |
|
509 | 509 | |
510 | 510 | return $contributors; |
511 | 511 | } |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | */ |
518 | 518 | public function get_welcome_header() { |
519 | 519 | // Badge for welcome page |
520 | - $badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png'; |
|
520 | + $badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png'; |
|
521 | 521 | ?> |
522 | 522 | <h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1> |
523 | 523 | <?php $this->social_media_elements(); ?> |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | <a href="https://twitter.com/givewp" class="twitter-follow-button" data-show-count="false"><?php |
611 | 611 | printf( |
612 | 612 | /* translators: %s: Give twitter user @givewp */ |
613 | - esc_html_e( 'Follow %s', 'give' ), |
|
613 | + esc_html_e('Follow %s', 'give'), |
|
614 | 614 | '@givewp' |
615 | 615 | ); |
616 | 616 | ?></a> |
@@ -644,27 +644,27 @@ discard block |
||
644 | 644 | public function welcome() { |
645 | 645 | |
646 | 646 | // Bail if no activation redirect |
647 | - if ( ! Give_Cache::get( '_give_activation_redirect', true ) ) { |
|
647 | + if ( ! Give_Cache::get('_give_activation_redirect', true)) { |
|
648 | 648 | return; |
649 | 649 | } |
650 | 650 | |
651 | 651 | // Delete the redirect transient |
652 | - Give_Cache::delete( Give_Cache::get_key( '_give_activation_redirect' ) ); |
|
652 | + Give_Cache::delete(Give_Cache::get_key('_give_activation_redirect')); |
|
653 | 653 | |
654 | 654 | // Bail if activating from network, or bulk |
655 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
655 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
656 | 656 | return; |
657 | 657 | } |
658 | 658 | |
659 | - $upgrade = get_option( 'give_version_upgraded_from' ); |
|
659 | + $upgrade = get_option('give_version_upgraded_from'); |
|
660 | 660 | |
661 | - if ( ! $upgrade ) { // First time install |
|
662 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
661 | + if ( ! $upgrade) { // First time install |
|
662 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
663 | 663 | exit; |
664 | - } elseif ( ! give_is_setting_enabled( give_get_option( 'welcome' ) ) ) { // Welcome is disabled in settings |
|
664 | + } elseif ( ! give_is_setting_enabled(give_get_option('welcome'))) { // Welcome is disabled in settings |
|
665 | 665 | |
666 | 666 | } else { // Welcome is NOT disabled in settings |
667 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
667 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
668 | 668 | exit; |
669 | 669 | } |
670 | 670 | } |