@@ -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 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @return Give_Donation_form_Grid_Block |
50 | 50 | */ |
51 | 51 | public static function get_instance() { |
52 | - if ( null === static::$instance ) { |
|
52 | + if (null === static::$instance) { |
|
53 | 53 | self::$instance = new static(); |
54 | 54 | |
55 | 55 | self::$instance->init(); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @access private |
68 | 68 | */ |
69 | 69 | private function init() { |
70 | - add_action( 'init', array( $this, 'register_block' ), 999 ); |
|
70 | + add_action('init', array($this, 'register_block'), 999); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function register_block() { |
80 | 80 | // Bailout. |
81 | - if( ! function_exists('register_block_type' ) ) { |
|
81 | + if ( ! function_exists('register_block_type')) { |
|
82 | 82 | return; |
83 | 83 | } |
84 | 84 | |
85 | 85 | // Register block. |
86 | - register_block_type( 'give/donation-form-grid', array( |
|
87 | - 'render_callback' => array( $this, 'render_block' ), |
|
86 | + register_block_type('give/donation-form-grid', array( |
|
87 | + 'render_callback' => array($this, 'render_block'), |
|
88 | 88 | 'attributes' => array( |
89 | 89 | 'columns' => array( |
90 | 90 | 'type' => 'string', |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | 'default' => 'redirect', |
108 | 108 | ), |
109 | 109 | ), |
110 | - ) ); |
|
110 | + )); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -118,16 +118,16 @@ discard block |
||
118 | 118 | * @access public |
119 | 119 | * @return string; |
120 | 120 | */ |
121 | - public function render_block( $attributes ) { |
|
121 | + public function render_block($attributes) { |
|
122 | 122 | $parameters = array( |
123 | - 'columns' => absint( $attributes['columns'] ), |
|
123 | + 'columns' => absint($attributes['columns']), |
|
124 | 124 | 'show_goal' => $attributes['showGoal'], |
125 | 125 | 'show_excerpt' => $attributes['showExcerpt'], |
126 | 126 | 'show_featured_image' => $attributes['showFeaturedImage'], |
127 | 127 | 'display_type' => $attributes['displayType'], |
128 | 128 | ); |
129 | 129 | |
130 | - return give_form_grid_shortcode( $parameters ); |
|
130 | + return give_form_grid_shortcode($parameters); |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 |
@@ -10,61 +10,61 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
13 | +if ( ! defined('WP_UNINSTALL_PLUGIN')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
17 | 17 | // Load Give file. |
18 | -include_once( 'give.php' ); |
|
18 | +include_once('give.php'); |
|
19 | 19 | |
20 | 20 | global $wpdb, $wp_roles; |
21 | 21 | |
22 | 22 | |
23 | -if ( give_is_setting_enabled( give_get_option( 'uninstall_on_delete' ) ) ) { |
|
23 | +if (give_is_setting_enabled(give_get_option('uninstall_on_delete'))) { |
|
24 | 24 | |
25 | 25 | // Delete All the Custom Post Types. |
26 | - $give_taxonomies = array( 'form_category', 'form_tag' ); |
|
27 | - $give_post_types = array( 'give_forms', 'give_payment' ); |
|
28 | - foreach ( $give_post_types as $post_type ) { |
|
26 | + $give_taxonomies = array('form_category', 'form_tag'); |
|
27 | + $give_post_types = array('give_forms', 'give_payment'); |
|
28 | + foreach ($give_post_types as $post_type) { |
|
29 | 29 | |
30 | - $give_taxonomies = array_merge( $give_taxonomies, get_object_taxonomies( $post_type ) ); |
|
31 | - $items = get_posts( array( |
|
30 | + $give_taxonomies = array_merge($give_taxonomies, get_object_taxonomies($post_type)); |
|
31 | + $items = get_posts(array( |
|
32 | 32 | 'post_type' => $post_type, |
33 | 33 | 'post_status' => 'any', |
34 | - 'numberposts' => - 1, |
|
34 | + 'numberposts' => -1, |
|
35 | 35 | 'fields' => 'ids', |
36 | - ) ); |
|
36 | + )); |
|
37 | 37 | |
38 | - if ( $items ) { |
|
39 | - foreach ( $items as $item ) { |
|
40 | - wp_delete_post( $item, true ); |
|
38 | + if ($items) { |
|
39 | + foreach ($items as $item) { |
|
40 | + wp_delete_post($item, true); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | 45 | // Delete All the Terms & Taxonomies. |
46 | - foreach ( array_unique( array_filter( $give_taxonomies ) ) as $taxonomy ) { |
|
46 | + foreach (array_unique(array_filter($give_taxonomies)) as $taxonomy) { |
|
47 | 47 | |
48 | - $terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy ) ); |
|
48 | + $terms = $wpdb->get_results($wpdb->prepare("SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy)); |
|
49 | 49 | |
50 | 50 | // Delete Terms. |
51 | - if ( $terms ) { |
|
52 | - foreach ( $terms as $term ) { |
|
53 | - $wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $term->term_taxonomy_id ) ); |
|
54 | - $wpdb->delete( $wpdb->terms, array( 'term_id' => $term->term_id ) ); |
|
51 | + if ($terms) { |
|
52 | + foreach ($terms as $term) { |
|
53 | + $wpdb->delete($wpdb->term_taxonomy, array('term_taxonomy_id' => $term->term_taxonomy_id)); |
|
54 | + $wpdb->delete($wpdb->terms, array('term_id' => $term->term_id)); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | 58 | // Delete Taxonomies. |
59 | - $wpdb->delete( $wpdb->term_taxonomy, array( 'taxonomy' => $taxonomy ), array( '%s' ) ); |
|
59 | + $wpdb->delete($wpdb->term_taxonomy, array('taxonomy' => $taxonomy), array('%s')); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | // Delete the Plugin Pages. |
63 | - $give_created_pages = array( 'success_page', 'failure_page', 'history_page' ); |
|
64 | - foreach ( $give_created_pages as $p ) { |
|
65 | - $page = give_get_option( $p, false ); |
|
66 | - if ( $page ) { |
|
67 | - wp_delete_post( $page, true ); |
|
63 | + $give_created_pages = array('success_page', 'failure_page', 'history_page'); |
|
64 | + foreach ($give_created_pages as $p) { |
|
65 | + $page = give_get_option($p, false); |
|
66 | + if ($page) { |
|
67 | + wp_delete_post($page, true); |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
@@ -73,27 +73,27 @@ discard block |
||
73 | 73 | Give()->roles->remove_caps(); |
74 | 74 | |
75 | 75 | // Delete the Roles. |
76 | - $give_roles = array( 'give_manager', 'give_accountant', 'give_worker', 'give_donor' ); |
|
77 | - foreach ( $give_roles as $role ) { |
|
78 | - remove_role( $role ); |
|
76 | + $give_roles = array('give_manager', 'give_accountant', 'give_worker', 'give_donor'); |
|
77 | + foreach ($give_roles as $role) { |
|
78 | + remove_role($role); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | // Remove all database tables. |
82 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_donors' ); |
|
83 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_donormeta' ); |
|
84 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_customers' ); |
|
85 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_customermeta' ); |
|
86 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_paymentmeta' ); |
|
87 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_formmeta' ); |
|
88 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_logs' ); |
|
89 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_logmeta' ); |
|
90 | - $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_sequential_ordering' ); |
|
82 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_donors'); |
|
83 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_donormeta'); |
|
84 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_customers'); |
|
85 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_customermeta'); |
|
86 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_paymentmeta'); |
|
87 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_formmeta'); |
|
88 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_logs'); |
|
89 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_logmeta'); |
|
90 | + $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_sequential_ordering'); |
|
91 | 91 | |
92 | 92 | // Cleanup Cron Events. |
93 | - wp_clear_scheduled_hook( 'give_daily_scheduled_events' ); |
|
94 | - wp_clear_scheduled_hook( 'give_weekly_scheduled_events' ); |
|
95 | - wp_clear_scheduled_hook( 'give_daily_cron' ); |
|
96 | - wp_clear_scheduled_hook( 'give_weekly_cron' ); |
|
93 | + wp_clear_scheduled_hook('give_daily_scheduled_events'); |
|
94 | + wp_clear_scheduled_hook('give_weekly_scheduled_events'); |
|
95 | + wp_clear_scheduled_hook('give_daily_cron'); |
|
96 | + wp_clear_scheduled_hook('give_weekly_cron'); |
|
97 | 97 | |
98 | 98 | // Get all options. |
99 | 99 | $give_option_names = $wpdb->get_col( |
@@ -103,16 +103,16 @@ discard block |
||
103 | 103 | ) |
104 | 104 | ); |
105 | 105 | |
106 | - if ( ! empty( $give_option_names ) ) { |
|
106 | + if ( ! empty($give_option_names)) { |
|
107 | 107 | // Convert option name to transient or option name. |
108 | 108 | $new_give_option_names = array(); |
109 | 109 | |
110 | 110 | // Delete all the Plugin Options. |
111 | - foreach ( $give_option_names as $option ) { |
|
112 | - if ( false !== strpos( $option, 'give_cache' ) ) { |
|
113 | - Give_Cache::delete( $option ); |
|
111 | + foreach ($give_option_names as $option) { |
|
112 | + if (false !== strpos($option, 'give_cache')) { |
|
113 | + Give_Cache::delete($option); |
|
114 | 114 | } else { |
115 | - delete_option( $option ); |
|
115 | + delete_option($option); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | } |
@@ -4,56 +4,56 @@ discard block |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | $donations = array(); |
7 | -$donation_history_args = Give()->session->get( 'give_donation_history_args' ); |
|
7 | +$donation_history_args = Give()->session->get('give_donation_history_args'); |
|
8 | 8 | |
9 | 9 | // User's Donations. |
10 | -if ( is_user_logged_in() ) { |
|
11 | - $donations = give_get_users_donations( get_current_user_id(), 20, true, 'any' ); |
|
12 | -} elseif ( Give()->email_access->token_exists ) { |
|
10 | +if (is_user_logged_in()) { |
|
11 | + $donations = give_get_users_donations(get_current_user_id(), 20, true, 'any'); |
|
12 | +} elseif (Give()->email_access->token_exists) { |
|
13 | 13 | // Email Access Token? |
14 | - $donations = give_get_users_donations( 0, 20, true, 'any' ); |
|
14 | + $donations = give_get_users_donations(0, 20, true, 'any'); |
|
15 | 15 | } elseif ( |
16 | 16 | false !== Give()->session->get_session_expiration() || |
17 | 17 | true === give_get_history_session() |
18 | 18 | ) { |
19 | 19 | // Session active? |
20 | - $email = Give()->session->get( 'give_email' ); |
|
21 | - $donor = Give()->donors->get_donor_by( 'email', $email ); |
|
22 | - $donations_count = count( explode( ',', $donor->payment_ids ) ); |
|
20 | + $email = Give()->session->get('give_email'); |
|
21 | + $donor = Give()->donors->get_donor_by('email', $email); |
|
22 | + $donations_count = count(explode(',', $donor->payment_ids)); |
|
23 | 23 | |
24 | - if ( $donations_count > give_get_limit_display_donations() ) { |
|
24 | + if ($donations_count > give_get_limit_display_donations()) { |
|
25 | 25 | |
26 | 26 | // Restrict Security Email Access option, if donation count of a donor is less than or equal to limit. |
27 | - if ( true !== Give_Cache::get( "give_cache_email_throttle_limit_exhausted_{$donor->id}" ) ) { |
|
28 | - add_action( 'give_donation_history_table_end', 'give_donation_history_table_end' ); |
|
27 | + if (true !== Give_Cache::get("give_cache_email_throttle_limit_exhausted_{$donor->id}")) { |
|
28 | + add_action('give_donation_history_table_end', 'give_donation_history_table_end'); |
|
29 | 29 | } else { |
30 | 30 | $value = Give()->email_access->verify_throttle / 60; |
31 | 31 | |
32 | - give_set_error( 'give-limited-throttle', sprintf( |
|
33 | - __( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ), |
|
34 | - sprintf( _n( '%s minute', '%s minutes', $value, 'give' ), $value ) |
|
35 | - ) ); |
|
32 | + give_set_error('give-limited-throttle', sprintf( |
|
33 | + __('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'), |
|
34 | + sprintf(_n('%s minute', '%s minutes', $value, 'give'), $value) |
|
35 | + )); |
|
36 | 36 | |
37 | 37 | } |
38 | 38 | |
39 | - $donations = give_get_users_donations( $email, give_get_limit_display_donations(), true, 'any' ); |
|
39 | + $donations = give_get_users_donations($email, give_get_limit_display_donations(), true, 'any'); |
|
40 | 40 | } else { |
41 | - $donations = give_get_users_donations( $email, 20, true, 'any' ); |
|
41 | + $donations = give_get_users_donations($email, 20, true, 'any'); |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | -Give()->notices->render_frontend_notices( 0 ); |
|
45 | +Give()->notices->render_frontend_notices(0); |
|
46 | 46 | |
47 | -if ( $donations ) : ?> |
|
47 | +if ($donations) : ?> |
|
48 | 48 | <?php |
49 | 49 | $table_headings = array( |
50 | - 'id' => __( 'ID', 'give' ), |
|
51 | - 'date' => __( 'Date', 'give' ), |
|
52 | - 'donor' => __( 'Donor', 'give' ), |
|
53 | - 'amount' => __( 'Amount', 'give' ), |
|
54 | - 'status' => __( 'Status', 'give' ), |
|
55 | - 'payment_method' => __( 'Payment Method', 'give' ), |
|
56 | - 'details' => __( 'Details', 'give' ), |
|
50 | + 'id' => __('ID', 'give'), |
|
51 | + 'date' => __('Date', 'give'), |
|
52 | + 'donor' => __('Donor', 'give'), |
|
53 | + 'amount' => __('Amount', 'give'), |
|
54 | + 'status' => __('Status', 'give'), |
|
55 | + 'payment_method' => __('Payment Method', 'give'), |
|
56 | + 'details' => __('Details', 'give'), |
|
57 | 57 | ); |
58 | 58 | ?> |
59 | 59 | <div class="give_user_history_main" > |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @since 1.7 |
71 | 71 | */ |
72 | - do_action( 'give_donation_history_header_before' ); |
|
72 | + do_action('give_donation_history_header_before'); |
|
73 | 73 | |
74 | - foreach ( $donation_history_args as $index => $value ) { |
|
75 | - if ( filter_var( $donation_history_args[ $index ], FILTER_VALIDATE_BOOLEAN ) ) : |
|
74 | + foreach ($donation_history_args as $index => $value) { |
|
75 | + if (filter_var($donation_history_args[$index], FILTER_VALIDATE_BOOLEAN)) : |
|
76 | 76 | echo sprintf( |
77 | 77 | '<th scope="col" class="give-donation-%1$s>">%2$s</th>', |
78 | 78 | $index, |
79 | - $table_headings[ $index ] |
|
79 | + $table_headings[$index] |
|
80 | 80 | ); |
81 | 81 | endif; |
82 | 82 | } |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @since 1.7 |
90 | 90 | */ |
91 | - do_action( 'give_donation_history_header_after' ); |
|
91 | + do_action('give_donation_history_header_after'); |
|
92 | 92 | ?> |
93 | 93 | </tr> |
94 | 94 | </thead> |
95 | - <?php foreach ( $donations as $post ) : |
|
96 | - setup_postdata( $post ); |
|
97 | - $donation_data = give_get_payment_meta( $post->ID ); ?> |
|
95 | + <?php foreach ($donations as $post) : |
|
96 | + setup_postdata($post); |
|
97 | + $donation_data = give_get_payment_meta($post->ID); ?> |
|
98 | 98 | <tr class="give-donation-row"> |
99 | 99 | <?php |
100 | 100 | /** |
@@ -107,37 +107,37 @@ discard block |
||
107 | 107 | * @param int $post_id The ID of the post. |
108 | 108 | * @param mixed $donation_data Payment meta data. |
109 | 109 | */ |
110 | - do_action( 'give_donation_history_row_start', $post->ID, $donation_data ); |
|
110 | + do_action('give_donation_history_row_start', $post->ID, $donation_data); |
|
111 | 111 | |
112 | - if ( filter_var( $donation_history_args['id'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
112 | + if (filter_var($donation_history_args['id'], FILTER_VALIDATE_BOOLEAN)) : |
|
113 | 113 | echo sprintf( |
114 | 114 | '<td class="give-donation-id"><span class="title-for-mobile">%2$s</span>%1$s</td>', |
115 | - give_get_payment_number( $post->ID ), esc_html( $table_headings['id'] ) |
|
115 | + give_get_payment_number($post->ID), esc_html($table_headings['id']) |
|
116 | 116 | ); |
117 | 117 | endif; |
118 | 118 | |
119 | - if ( filter_var( $donation_history_args['date'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
119 | + if (filter_var($donation_history_args['date'], FILTER_VALIDATE_BOOLEAN)) : |
|
120 | 120 | echo sprintf( |
121 | 121 | '<td class="give-donation-date"><span class="title-for-mobile">%2$s</span>%1$s</td>', |
122 | - date_i18n( give_date_format(), strtotime( get_post_field( 'post_date', $post->ID ) ) ), esc_html( $table_headings['date'] ) |
|
122 | + date_i18n(give_date_format(), strtotime(get_post_field('post_date', $post->ID))), esc_html($table_headings['date']) |
|
123 | 123 | ); |
124 | 124 | endif; |
125 | 125 | |
126 | - if ( filter_var( $donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
126 | + if (filter_var($donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN)) : |
|
127 | 127 | echo sprintf( |
128 | 128 | '<td class="give-donation-donor"><span class="title-for-mobile">%2$s</span>%1$s</td>', |
129 | - give_get_donor_name_by( $post->ID ), $table_headings['donor'] |
|
129 | + give_get_donor_name_by($post->ID), $table_headings['donor'] |
|
130 | 130 | ); |
131 | 131 | endif; |
132 | 132 | ?> |
133 | 133 | |
134 | - <?php if ( filter_var( $donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN ) ) : ?> |
|
134 | + <?php if (filter_var($donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN)) : ?> |
|
135 | 135 | <td class="give-donation-amount"> |
136 | - <?php printf( '<span class="title-for-mobile">%1$s</span>', esc_html( $table_headings['amount'] ) ); ?> |
|
136 | + <?php printf('<span class="title-for-mobile">%1$s</span>', esc_html($table_headings['amount'])); ?> |
|
137 | 137 | <span class="give-donation-amount"> |
138 | 138 | <?php |
139 | - $currency_code = give_get_payment_currency_code( $post->ID ); |
|
140 | - $donation_amount = give_donation_amount( $post->ID, true ); |
|
139 | + $currency_code = give_get_payment_currency_code($post->ID); |
|
140 | + $donation_amount = give_donation_amount($post->ID, true); |
|
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Filters the donation amount on Donation History Page. |
@@ -149,45 +149,45 @@ discard block |
||
149 | 149 | * |
150 | 150 | * @return int |
151 | 151 | */ |
152 | - echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID ); |
|
152 | + echo apply_filters('give_donation_history_row_amount', $donation_amount, $post->ID); |
|
153 | 153 | ?> |
154 | 154 | </span> |
155 | 155 | </td> |
156 | 156 | <?php endif; ?> |
157 | 157 | |
158 | 158 | <?php |
159 | - if ( filter_var( $donation_history_args['status'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
159 | + if (filter_var($donation_history_args['status'], FILTER_VALIDATE_BOOLEAN)) : |
|
160 | 160 | echo sprintf( |
161 | 161 | '<td class="give-donation-status"><span class="title-for-mobile">%2$s</span>%1$s</td>', |
162 | - give_get_payment_status( $post, true ), |
|
163 | - esc_html( $table_headings['status'] ) |
|
162 | + give_get_payment_status($post, true), |
|
163 | + esc_html($table_headings['status']) |
|
164 | 164 | ); |
165 | 165 | endif; |
166 | 166 | |
167 | - if ( filter_var( $donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN ) ) : |
|
167 | + if (filter_var($donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN)) : |
|
168 | 168 | echo sprintf( |
169 | 169 | '<td class="give-donation-payment-method"><span class="title-for-mobile">%2$s</span>%1$s</td>', |
170 | - give_get_gateway_checkout_label( give_get_payment_gateway( $post->ID ) ), |
|
171 | - esc_html( $table_headings['payment_method'] ) |
|
170 | + give_get_gateway_checkout_label(give_get_payment_gateway($post->ID)), |
|
171 | + esc_html($table_headings['payment_method']) |
|
172 | 172 | ); |
173 | 173 | endif; |
174 | 174 | ?> |
175 | 175 | <td class="give-donation-details"> |
176 | 176 | <?php |
177 | 177 | // Display View Receipt or. |
178 | - if ( 'publish' !== $post->post_status && 'subscription' !== $post->post_status ) : |
|
178 | + if ('publish' !== $post->post_status && 'subscription' !== $post->post_status) : |
|
179 | 179 | echo sprintf( |
180 | 180 | '<span class="title-for-mobile">%4$s</span><a href="%1$s"><span class="give-donation-status %2$s">%3$s</span></a>', |
181 | 181 | esc_url( |
182 | 182 | add_query_arg( |
183 | 183 | 'payment_key', |
184 | - give_get_payment_key( $post->ID ), |
|
184 | + give_get_payment_key($post->ID), |
|
185 | 185 | give_get_history_page_uri() |
186 | 186 | ) |
187 | 187 | ), |
188 | 188 | $post->post_status, |
189 | - __( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' »', |
|
190 | - esc_html( $table_headings['details'] ) |
|
189 | + __('View', 'give').' '.give_get_payment_status($post, true).' »', |
|
190 | + esc_html($table_headings['details']) |
|
191 | 191 | ); |
192 | 192 | |
193 | 193 | else : |
@@ -196,12 +196,12 @@ discard block |
||
196 | 196 | esc_url( |
197 | 197 | add_query_arg( |
198 | 198 | 'payment_key', |
199 | - give_get_payment_key( $post->ID ), |
|
199 | + give_get_payment_key($post->ID), |
|
200 | 200 | give_get_history_page_uri() |
201 | 201 | ) |
202 | 202 | ), |
203 | - __( 'View Receipt »', 'give' ), |
|
204 | - esc_html( $table_headings['details'] ) |
|
203 | + __('View Receipt »', 'give'), |
|
204 | + esc_html($table_headings['details']) |
|
205 | 205 | ); |
206 | 206 | |
207 | 207 | endif; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @param int $post_id The ID of the post. |
219 | 219 | * @param mixed $donation_data Payment meta data. |
220 | 220 | */ |
221 | - do_action( 'give_donation_history_row_end', $post->ID, $donation_data ); |
|
221 | + do_action('give_donation_history_row_end', $post->ID, $donation_data); |
|
222 | 222 | ?> |
223 | 223 | </tr> |
224 | 224 | <?php endforeach; ?> |
@@ -231,22 +231,22 @@ discard block |
||
231 | 231 | * |
232 | 232 | * @since 1.8.17 |
233 | 233 | */ |
234 | - do_action( 'give_donation_history_table_end' ); |
|
234 | + do_action('give_donation_history_table_end'); |
|
235 | 235 | ?> |
236 | 236 | </table> |
237 | 237 | <div id="give-donation-history-pagination" class="give_pagination navigation"> |
238 | 238 | <?php |
239 | 239 | $big = 999999; |
240 | - echo paginate_links( array( |
|
241 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
240 | + echo paginate_links(array( |
|
241 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
242 | 242 | 'format' => '?paged=%#%', |
243 | - 'current' => max( 1, get_query_var( 'paged' ) ), |
|
244 | - 'total' => ceil( give_count_donations_of_donor() / 20 ), // 20 items per page |
|
245 | - ) ); |
|
243 | + 'current' => max(1, get_query_var('paged')), |
|
244 | + 'total' => ceil(give_count_donations_of_donor() / 20), // 20 items per page |
|
245 | + )); |
|
246 | 246 | ?> |
247 | 247 | </div> |
248 | 248 | </div> |
249 | 249 | <?php wp_reset_postdata(); ?> |
250 | 250 | <?php else : ?> |
251 | - <?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?> |
|
251 | + <?php Give()->notices->print_frontend_notice(__('It looks like you haven\'t made any donations.', 'give'), true, 'success'); ?> |
|
252 | 252 | <?php endif; |
@@ -190,7 +190,8 @@ discard block |
||
190 | 190 | esc_html( $table_headings['details'] ) |
191 | 191 | ); |
192 | 192 | |
193 | - else : |
|
193 | + else { |
|
194 | + : |
|
194 | 195 | echo sprintf( |
195 | 196 | '<span class="title-for-mobile">%3$s</span><a href="%1$s">%2$s</a>', |
196 | 197 | esc_url( |
@@ -203,6 +204,7 @@ discard block |
||
203 | 204 | __( 'View Receipt »', 'give' ), |
204 | 205 | esc_html( $table_headings['details'] ) |
205 | 206 | ); |
207 | + } |
|
206 | 208 | |
207 | 209 | endif; |
208 | 210 | ?> |
@@ -247,6 +249,9 @@ discard block |
||
247 | 249 | </div> |
248 | 250 | </div> |
249 | 251 | <?php wp_reset_postdata(); ?> |
250 | -<?php else : ?> |
|
251 | - <?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?> |
|
252 | +<?php else { |
|
253 | + : ?> |
|
254 | + <?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); |
|
255 | +} |
|
256 | +?> |
|
252 | 257 | <?php endif; |
@@ -4,26 +4,26 @@ discard block |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | // Bail out if total goal is empty. |
7 | -if ( empty( $total_goal ) ) { |
|
7 | +if (empty($total_goal)) { |
|
8 | 8 | return false; |
9 | 9 | } |
10 | 10 | |
11 | 11 | // Set Give total progress bar color. |
12 | -$color = apply_filters( 'give_totals_progress_color', '#2bc253' ); |
|
12 | +$color = apply_filters('give_totals_progress_color', '#2bc253'); |
|
13 | 13 | |
14 | 14 | // Give total. |
15 | -$total = ! empty( $total ) ? $total : 0; |
|
15 | +$total = ! empty($total) ? $total : 0; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Filter the goal progress output |
19 | 19 | * |
20 | 20 | * @since 2.1 |
21 | 21 | */ |
22 | -$progress = round( ( $total / $total_goal ) * 100, 2 ); |
|
22 | +$progress = round(($total / $total_goal) * 100, 2); |
|
23 | 23 | |
24 | 24 | // Set progress to 100 percentage if total > total_goal |
25 | 25 | $progress = $total >= $total_goal ? 100 : $progress; |
26 | -$progress = apply_filters( 'give_goal_totals_funded_percentage_output', $progress, $total, $total_goal ); |
|
26 | +$progress = apply_filters('give_goal_totals_funded_percentage_output', $progress, $total, $total_goal); |
|
27 | 27 | |
28 | 28 | ?> |
29 | 29 | <div class="give-goal-progress"> |
@@ -31,16 +31,16 @@ discard block |
||
31 | 31 | <?php |
32 | 32 | echo sprintf( |
33 | 33 | /* translators: %s: percentage of the amount raised compared to the goal target */ |
34 | - __( '<span class="give-percentage">%s%%</span> funded', 'give' ), |
|
35 | - round( $progress ) |
|
34 | + __('<span class="give-percentage">%s%%</span> funded', 'give'), |
|
35 | + round($progress) |
|
36 | 36 | ); |
37 | 37 | ?> |
38 | 38 | </div> |
39 | 39 | |
40 | 40 | <div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" |
41 | - aria-valuenow="<?php echo esc_attr( $progress ); ?>"> |
|
42 | - <span style="width: <?php echo esc_attr( $progress ); ?>%;<?php if ( ! empty( $color ) ) { |
|
43 | - echo 'background-color:' . $color; |
|
41 | + aria-valuenow="<?php echo esc_attr($progress); ?>"> |
|
42 | + <span style="width: <?php echo esc_attr($progress); ?>%;<?php if ( ! empty($color)) { |
|
43 | + echo 'background-color:'.$color; |
|
44 | 44 | } ?>"></span> |
45 | 45 | </div><!-- /.give-progress-bar --> |
46 | 46 |
@@ -7,25 +7,25 @@ discard block |
||
7 | 7 | * @copyright Copyright (c) 2016, WordImpress |
8 | 8 | * @license https://opensource.org/licenses/gpl-license GNU Public License |
9 | 9 | */ |
10 | -$current_user = wp_get_current_user(); |
|
10 | +$current_user = wp_get_current_user(); |
|
11 | 11 | |
12 | -if ( is_user_logged_in() ) : |
|
12 | +if (is_user_logged_in()) : |
|
13 | 13 | $user_id = get_current_user_id(); |
14 | - $first_name = get_user_meta( $user_id, 'first_name', true ); |
|
15 | - $last_name = get_user_meta( $user_id, 'last_name', true ); |
|
16 | - $last_name = get_user_meta( $user_id, 'last_name', true ); |
|
14 | + $first_name = get_user_meta($user_id, 'first_name', true); |
|
15 | + $last_name = get_user_meta($user_id, 'last_name', true); |
|
16 | + $last_name = get_user_meta($user_id, 'last_name', true); |
|
17 | 17 | $display_name = $current_user->display_name; |
18 | - $address = give_get_donor_address( $user_id, array( 'address_type' => 'personal' ) ); |
|
18 | + $address = give_get_donor_address($user_id, array('address_type' => 'personal')); |
|
19 | 19 | |
20 | - $donor = new Give_Donor( $user_id, true ); |
|
21 | - $company_name = $donor->get_meta( '_give_donor_company', true ); |
|
20 | + $donor = new Give_Donor($user_id, true); |
|
21 | + $company_name = $donor->get_meta('_give_donor_company', true); |
|
22 | 22 | |
23 | - if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) : |
|
24 | - if ( isset( $_GET['update_code'] ) ) :?> |
|
23 | + if (isset($_GET['updated']) && 'true' === $_GET['updated'] && ! give_get_errors()) : |
|
24 | + if (isset($_GET['update_code'])) :?> |
|
25 | 25 | <?php |
26 | - switch ( $_GET['update_code'] ) { |
|
26 | + switch ($_GET['update_code']) { |
|
27 | 27 | case '1': |
28 | - printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile has been updated.', 'give' ) ); |
|
28 | + printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your profile has been updated.', 'give')); |
|
29 | 29 | break; |
30 | 30 | } |
31 | 31 | ?> |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | <?php endif; ?> |
34 | 34 | <?php endif; ?> |
35 | 35 | |
36 | - <?php Give()->notices->render_frontend_notices( 0 ); ?> |
|
36 | + <?php Give()->notices->render_frontend_notices(0); ?> |
|
37 | 37 | |
38 | 38 | <?php |
39 | 39 | /** |
@@ -43,59 +43,59 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @since 1.0 |
45 | 45 | */ |
46 | - do_action( 'give_profile_editor_before' ); |
|
46 | + do_action('give_profile_editor_before'); |
|
47 | 47 | ?> |
48 | 48 | |
49 | 49 | <form id="give_profile_editor_form" class="give-form" action="<?php echo give_get_current_page_url(); ?>" |
50 | 50 | method="post"> |
51 | 51 | |
52 | 52 | <fieldset> |
53 | - <legend id="give_profile_name_label"><?php _e( 'Profile', 'give' ); ?></legend> |
|
53 | + <legend id="give_profile_name_label"><?php _e('Profile', 'give'); ?></legend> |
|
54 | 54 | |
55 | 55 | <h3 id="give_personal_information_label" |
56 | - class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3> |
|
56 | + class="give-section-break"><?php _e('Change your Name', 'give'); ?></h3> |
|
57 | 57 | |
58 | 58 | <p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive"> |
59 | 59 | <label for="give_first_name"> |
60 | - <?php _e( 'First Name', 'give' ); ?> |
|
60 | + <?php _e('First Name', 'give'); ?> |
|
61 | 61 | <span class="give-required-indicator ">*</span> |
62 | 62 | </label> |
63 | 63 | <input name="give_first_name" id="give_first_name" class="text give-input" type="text" |
64 | - value="<?php echo esc_attr( $first_name ); ?>"/> |
|
64 | + value="<?php echo esc_attr($first_name); ?>"/> |
|
65 | 65 | </p> |
66 | 66 | |
67 | 67 | <p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive"> |
68 | - <label for="give_last_name"><?php _e( 'Last Name', 'give' ); ?></label> |
|
68 | + <label for="give_last_name"><?php _e('Last Name', 'give'); ?></label> |
|
69 | 69 | <input name="give_last_name" id="give_last_name" class="text give-input" type="text" |
70 | - value="<?php echo esc_attr( $last_name ); ?>"/> |
|
70 | + value="<?php echo esc_attr($last_name); ?>"/> |
|
71 | 71 | </p> |
72 | 72 | |
73 | - <?php if ( ! empty( $company_name ) ) : ?> |
|
73 | + <?php if ( ! empty($company_name)) : ?> |
|
74 | 74 | <p id="give_profile_company_name_wrap" class="form-row form-row-wide"> |
75 | - <label for="give_company_name"><?php _e( 'Company Name', 'give' ); ?></label> |
|
75 | + <label for="give_company_name"><?php _e('Company Name', 'give'); ?></label> |
|
76 | 76 | <input name="give_company_name" id="give_company_name" class="text give-input" type="text" |
77 | - value="<?php echo esc_attr( $company_name ); ?>"/> |
|
77 | + value="<?php echo esc_attr($company_name); ?>"/> |
|
78 | 78 | </p> |
79 | 79 | <?php endif; ?> |
80 | 80 | |
81 | 81 | <p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive"> |
82 | - <label for="give_display_name"><?php _e( 'Display Name', 'give' ); ?></label> |
|
82 | + <label for="give_display_name"><?php _e('Display Name', 'give'); ?></label> |
|
83 | 83 | <select name="give_display_name" id="give_display_name" class="select give-select"> |
84 | - <?php if ( ! empty( $current_user->first_name ) ): ?> |
|
85 | - <option <?php selected( $display_name, $current_user->first_name ); ?> |
|
86 | - value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option> |
|
84 | + <?php if ( ! empty($current_user->first_name)): ?> |
|
85 | + <option <?php selected($display_name, $current_user->first_name); ?> |
|
86 | + value="<?php echo esc_attr($current_user->first_name); ?>"><?php echo esc_html($current_user->first_name); ?></option> |
|
87 | 87 | <?php endif; ?> |
88 | - <option <?php selected( $display_name, $current_user->user_nicename ); ?> |
|
89 | - value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option> |
|
90 | - <?php if ( ! empty( $current_user->last_name ) ): ?> |
|
91 | - <option <?php selected( $display_name, $current_user->last_name ); ?> |
|
92 | - value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option> |
|
88 | + <option <?php selected($display_name, $current_user->user_nicename); ?> |
|
89 | + value="<?php echo esc_attr($current_user->user_nicename); ?>"><?php echo esc_html($current_user->user_nicename); ?></option> |
|
90 | + <?php if ( ! empty($current_user->last_name)): ?> |
|
91 | + <option <?php selected($display_name, $current_user->last_name); ?> |
|
92 | + value="<?php echo esc_attr($current_user->last_name); ?>"><?php echo esc_html($current_user->last_name); ?></option> |
|
93 | 93 | <?php endif; ?> |
94 | - <?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?> |
|
95 | - <option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?> |
|
96 | - value="<?php echo esc_attr( $current_user->first_name . ' ' . $current_user->last_name ); ?>"><?php echo esc_html( $current_user->first_name . ' ' . $current_user->last_name ); ?></option> |
|
97 | - <option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?> |
|
98 | - value="<?php echo esc_attr( $current_user->last_name . ' ' . $current_user->first_name ); ?>"><?php echo esc_html( $current_user->last_name . ' ' . $current_user->first_name ); ?></option> |
|
94 | + <?php if ( ! empty($current_user->first_name) && ! empty($current_user->last_name)): ?> |
|
95 | + <option <?php selected($display_name, $current_user->first_name.' '.$current_user->last_name); ?> |
|
96 | + value="<?php echo esc_attr($current_user->first_name.' '.$current_user->last_name); ?>"><?php echo esc_html($current_user->first_name.' '.$current_user->last_name); ?></option> |
|
97 | + <option <?php selected($display_name, $current_user->last_name.' '.$current_user->first_name); ?> |
|
98 | + value="<?php echo esc_attr($current_user->last_name.' '.$current_user->first_name); ?>"><?php echo esc_html($current_user->last_name.' '.$current_user->first_name); ?></option> |
|
99 | 99 | <?php endif; ?> |
100 | 100 | </select> |
101 | 101 | <?php |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @since 1.0 |
108 | 108 | */ |
109 | - do_action( 'give_profile_editor_name' ); |
|
109 | + do_action('give_profile_editor_name'); |
|
110 | 110 | ?> |
111 | 111 | </p> |
112 | 112 | |
@@ -118,16 +118,16 @@ discard block |
||
118 | 118 | * |
119 | 119 | * @since 1.0 |
120 | 120 | */ |
121 | - do_action( 'give_profile_editor_after_name' ); |
|
121 | + do_action('give_profile_editor_after_name'); |
|
122 | 122 | ?> |
123 | 123 | |
124 | 124 | <p class="form-row form-row-last form-row-responsive"> |
125 | 125 | <label for="give_email"> |
126 | - <?php _e( 'Email Address', 'give' ); ?> |
|
126 | + <?php _e('Email Address', 'give'); ?> |
|
127 | 127 | <span class="give-required-indicator ">*</span> |
128 | 128 | </label> |
129 | 129 | <input name="give_email" id="give_email" class="text give-input required" type="email" |
130 | - value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/> |
|
130 | + value="<?php echo esc_attr($current_user->user_email); ?>" required aria-required="true"/> |
|
131 | 131 | <?php |
132 | 132 | /** |
133 | 133 | * Fires in the profile editor shortcode, to the email section. |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * |
137 | 137 | * @since 1.0 |
138 | 138 | */ |
139 | - do_action( 'give_profile_editor_email' ); |
|
139 | + do_action('give_profile_editor_email'); |
|
140 | 140 | ?> |
141 | 141 | </p> |
142 | 142 | |
@@ -148,21 +148,21 @@ discard block |
||
148 | 148 | * |
149 | 149 | * @since 1.0 |
150 | 150 | */ |
151 | - do_action( 'give_profile_editor_after_email' ); |
|
151 | + do_action('give_profile_editor_after_email'); |
|
152 | 152 | ?> |
153 | 153 | |
154 | 154 | <h3 id="give_profile_password_label" |
155 | - class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3> |
|
155 | + class="give-section-break"><?php _e('Change your Password', 'give'); ?></h3> |
|
156 | 156 | |
157 | 157 | <div id="give_profile_password_wrap" class="give-clearfix"> |
158 | 158 | <p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive"> |
159 | - <label for="give_new_user_pass1"><?php _e( 'New Password', 'give' ); ?></label> |
|
159 | + <label for="give_new_user_pass1"><?php _e('New Password', 'give'); ?></label> |
|
160 | 160 | <input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input" |
161 | 161 | type="password"/> |
162 | 162 | </p> |
163 | 163 | |
164 | 164 | <p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive"> |
165 | - <label for="give_new_user_pass2"><?php _e( 'Re-enter Password', 'give' ); ?></label> |
|
165 | + <label for="give_new_user_pass2"><?php _e('Re-enter Password', 'give'); ?></label> |
|
166 | 166 | <input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input" |
167 | 167 | type="password"/> |
168 | 168 | <?php |
@@ -173,12 +173,12 @@ discard block |
||
173 | 173 | * |
174 | 174 | * @since 1.0 |
175 | 175 | */ |
176 | - do_action( 'give_profile_editor_password' ); |
|
176 | + do_action('give_profile_editor_password'); |
|
177 | 177 | ?> |
178 | 178 | </p> |
179 | 179 | </div> |
180 | 180 | |
181 | - <p class="give_password_change_notice"><?php _e( 'Please note after changing your password, you must log back in.', 'give' ); ?></p> |
|
181 | + <p class="give_password_change_notice"><?php _e('Please note after changing your password, you must log back in.', 'give'); ?></p> |
|
182 | 182 | |
183 | 183 | <?php |
184 | 184 | /** |
@@ -188,17 +188,17 @@ discard block |
||
188 | 188 | * |
189 | 189 | * @since 1.0 |
190 | 190 | */ |
191 | - do_action( 'give_profile_editor_after_password' ); |
|
191 | + do_action('give_profile_editor_after_password'); |
|
192 | 192 | ?> |
193 | 193 | |
194 | 194 | <p id="give_profile_submit_wrap"> |
195 | 195 | <input type="hidden" name="give_profile_editor_nonce" |
196 | - value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/> |
|
196 | + value="<?php echo wp_create_nonce('give-profile-editor-nonce'); ?>"/> |
|
197 | 197 | <input type="hidden" name="give_action" value="edit_user_profile"/> |
198 | 198 | <input type="hidden" name="give_redirect" |
199 | - value="<?php echo esc_url( give_get_current_page_url() ); ?>"/> |
|
199 | + value="<?php echo esc_url(give_get_current_page_url()); ?>"/> |
|
200 | 200 | <input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" |
201 | - class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/> |
|
201 | + class="give_submit" value="<?php _e('Save Changes', 'give'); ?>"/> |
|
202 | 202 | </p> |
203 | 203 | |
204 | 204 | </fieldset> |
@@ -213,23 +213,23 @@ discard block |
||
213 | 213 | * |
214 | 214 | * @since 1.0 |
215 | 215 | */ |
216 | - do_action( 'give_profile_editor_after' ); |
|
216 | + do_action('give_profile_editor_after'); |
|
217 | 217 | ?> |
218 | 218 | |
219 | 219 | <?php |
220 | 220 | else : |
221 | - if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) { |
|
222 | - if ( isset( $_GET['update_code'] ) ) { |
|
223 | - switch ( $_GET['update_code'] ) { |
|
221 | + if (isset($_GET['updated']) && 'true' === $_GET['updated'] && ! give_get_errors()) { |
|
222 | + if (isset($_GET['update_code'])) { |
|
223 | + switch ($_GET['update_code']) { |
|
224 | 224 | case '2': |
225 | - printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile and password has been updated.', 'give' ) ); |
|
226 | - _e( 'Login with your new credentials.', 'give' ); |
|
225 | + printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your profile and password has been updated.', 'give')); |
|
226 | + _e('Login with your new credentials.', 'give'); |
|
227 | 227 | echo give_login_form(); |
228 | 228 | break; |
229 | 229 | |
230 | 230 | case '3': |
231 | - printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your password has been updated.', 'give' ) ); |
|
232 | - _e( 'Login with your new credentials.', 'give' ); |
|
231 | + printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your password has been updated.', 'give')); |
|
232 | + _e('Login with your new credentials.', 'give'); |
|
233 | 233 | echo give_login_form(); |
234 | 234 | break; |
235 | 235 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | } |
239 | 239 | } |
240 | 240 | } else { |
241 | - _e( 'You need to login to edit your profile.', 'give' ); |
|
241 | + _e('You need to login to edit your profile.', 'give'); |
|
242 | 242 | echo give_login_form(); |
243 | 243 | } |
244 | 244 | endif; |
@@ -217,12 +217,14 @@ |
||
217 | 217 | ?> |
218 | 218 | |
219 | 219 | <?php |
220 | -else : |
|
220 | +else { |
|
221 | + : |
|
221 | 222 | if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) { |
222 | 223 | if ( isset( $_GET['update_code'] ) ) { |
223 | 224 | switch ( $_GET['update_code'] ) { |
224 | 225 | case '2': |
225 | 226 | printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile and password has been updated.', 'give' ) ); |
227 | +} |
|
226 | 228 | _e( 'Login with your new credentials.', 'give' ); |
227 | 229 | echo give_login_form(); |
228 | 230 | break; |
@@ -6,26 +6,26 @@ discard block |
||
6 | 6 | global $give_receipt_args, $payment; |
7 | 7 | |
8 | 8 | // Validation: Ensure $payment var is set. |
9 | -if ( empty( $payment ) ) { |
|
10 | - $payment = ! empty( $give_receipt_args['id'] ) ? get_post( $give_receipt_args['id'] ) : 0; |
|
9 | +if (empty($payment)) { |
|
10 | + $payment = ! empty($give_receipt_args['id']) ? get_post($give_receipt_args['id']) : 0; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | // Double-Validation: Check for $payment global. |
14 | -if ( empty( $payment ) ) { |
|
15 | - Give()->notices->print_frontend_notice( __( 'The specified receipt ID appears to be invalid.', 'give' ) ); |
|
14 | +if (empty($payment)) { |
|
15 | + Give()->notices->print_frontend_notice(__('The specified receipt ID appears to be invalid.', 'give')); |
|
16 | 16 | |
17 | 17 | return; |
18 | 18 | } |
19 | 19 | |
20 | 20 | $donation_id = $payment->ID; |
21 | -$donation_number = Give()->seq_donation_number->get_serial_code( $payment->ID ); |
|
22 | -$form_id = give_get_payment_meta( $donation_id, '_give_payment_form_id', true ); |
|
23 | -$donation = give_get_donation_form_title( $donation_id ); |
|
24 | -$user = give_get_payment_meta_user_info( $donation_id ); |
|
25 | -$email = give_get_payment_user_email( $donation_id ); |
|
21 | +$donation_number = Give()->seq_donation_number->get_serial_code($payment->ID); |
|
22 | +$form_id = give_get_payment_meta($donation_id, '_give_payment_form_id', true); |
|
23 | +$donation = give_get_donation_form_title($donation_id); |
|
24 | +$user = give_get_payment_meta_user_info($donation_id); |
|
25 | +$email = give_get_payment_user_email($donation_id); |
|
26 | 26 | $status = $payment->post_status; |
27 | -$status_label = give_get_payment_status( $payment, true ); |
|
28 | -$company_name = give_get_payment_meta( $donation_id, '_give_donation_company', true ); |
|
27 | +$status_label = give_get_payment_status($payment, true); |
|
28 | +$company_name = give_get_payment_meta($donation_id, '_give_donation_company', true); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Generate Donation Receipt Arguments. |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | * @since 1.8.8 |
37 | 37 | */ |
38 | 38 | $give_receipt_args['donation_receipt']['donor'] = array( |
39 | - 'name' => __( 'Donor', 'give' ), |
|
40 | - 'value' => $user['first_name'] . ' ' . $user['last_name'], |
|
39 | + 'name' => __('Donor', 'give'), |
|
40 | + 'value' => $user['first_name'].' '.$user['last_name'], |
|
41 | 41 | 'display' => $give_receipt_args['donor'], |
42 | 42 | ); |
43 | 43 | |
@@ -51,50 +51,50 @@ discard block |
||
51 | 51 | * @return bool show/hide company name in donation receipt page. |
52 | 52 | */ |
53 | 53 | $give_receipt_args['donation_receipt']['company_name'] = array( |
54 | - 'name' => __( 'Company Name', 'give' ), |
|
55 | - 'value' => esc_attr( $company_name ), |
|
54 | + 'name' => __('Company Name', 'give'), |
|
55 | + 'value' => esc_attr($company_name), |
|
56 | 56 | 'display' => $give_receipt_args['company_name'], |
57 | 57 | ); |
58 | 58 | |
59 | 59 | $give_receipt_args['donation_receipt']['date'] = array( |
60 | - 'name' => __( 'Date', 'give' ), |
|
61 | - 'value' => date_i18n( give_date_format(), strtotime( give_get_payment_completed_date( $donation_id ) ) ), |
|
60 | + 'name' => __('Date', 'give'), |
|
61 | + 'value' => date_i18n(give_date_format(), strtotime(give_get_payment_completed_date($donation_id))), |
|
62 | 62 | 'display' => $give_receipt_args['date'], |
63 | 63 | ); |
64 | 64 | |
65 | 65 | $give_receipt_args['donation_receipt']['total_donation'] = array( |
66 | - 'name' => __( 'Total Donation', 'give' ), |
|
67 | - 'value' => give_donation_amount( $donation_id, array( 'currency' => true, 'amount' => true, 'type' => 'receipt' ) ), |
|
66 | + 'name' => __('Total Donation', 'give'), |
|
67 | + 'value' => give_donation_amount($donation_id, array('currency' => true, 'amount' => true, 'type' => 'receipt')), |
|
68 | 68 | 'display' => $give_receipt_args['price'], |
69 | 69 | ); |
70 | 70 | |
71 | 71 | $give_receipt_args['donation_receipt']['donation'] = array( |
72 | - 'name' => __( 'Donation', 'give' ), |
|
72 | + 'name' => __('Donation', 'give'), |
|
73 | 73 | 'value' => $donation, |
74 | 74 | 'display' => true, |
75 | 75 | ); |
76 | 76 | |
77 | 77 | $give_receipt_args['donation_receipt']['donation_status'] = array( |
78 | - 'name' => __( 'Donation Status', 'give' ), |
|
79 | - 'value' => esc_attr( $status_label ), |
|
78 | + 'name' => __('Donation Status', 'give'), |
|
79 | + 'value' => esc_attr($status_label), |
|
80 | 80 | 'display' => $give_receipt_args['payment_status'], |
81 | 81 | ); |
82 | 82 | |
83 | 83 | $give_receipt_args['donation_receipt']['donation_id'] = array( |
84 | - 'name' => __( 'Donation ID', 'give' ), |
|
84 | + 'name' => __('Donation ID', 'give'), |
|
85 | 85 | 'value' => $donation_number, |
86 | 86 | 'display' => $give_receipt_args['payment_id'], |
87 | 87 | ); |
88 | 88 | |
89 | 89 | $give_receipt_args['donation_receipt']['payment_key'] = array( |
90 | - 'name' => __( 'Payment Key', 'give' ), |
|
91 | - 'value' => get_post_meta( $donation_id, '_give_payment_purchase_key', true ), |
|
90 | + 'name' => __('Payment Key', 'give'), |
|
91 | + 'value' => get_post_meta($donation_id, '_give_payment_purchase_key', true), |
|
92 | 92 | 'display' => $give_receipt_args['payment_key'], |
93 | 93 | ); |
94 | 94 | |
95 | 95 | $give_receipt_args['donation_receipt']['payment_method'] = array( |
96 | - 'name' => __( 'Payment Method', 'give' ), |
|
97 | - 'value' => give_get_gateway_checkout_label( give_get_payment_gateway( $donation_id ) ), |
|
96 | + 'name' => __('Payment Method', 'give'), |
|
97 | + 'value' => give_get_gateway_checkout_label(give_get_payment_gateway($donation_id)), |
|
98 | 98 | 'display' => $give_receipt_args['payment_method'], |
99 | 99 | ); |
100 | 100 | |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | * |
110 | 110 | * @since 1.8.8 |
111 | 111 | */ |
112 | -$give_receipt_args['donation_receipt'] = apply_filters( 'give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id ); |
|
112 | +$give_receipt_args['donation_receipt'] = apply_filters('give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id); |
|
113 | 113 | |
114 | 114 | // When the donation were made through offline donation, We won't show receipt and payment status though. |
115 | -if ( 'offline' === give_get_payment_gateway( $payment->ID ) && 'pending' === $status ) { |
|
115 | +if ('offline' === give_get_payment_gateway($payment->ID) && 'pending' === $status) { |
|
116 | 116 | |
117 | 117 | /** |
118 | 118 | * Before the offline donation receipt content starts. |
@@ -122,13 +122,13 @@ discard block |
||
122 | 122 | * @param Give_Payment $payment Donation payment object. |
123 | 123 | * @param array $give_receipt_args Receipt Arguments. |
124 | 124 | */ |
125 | - do_action( 'give_receipt_before_offline_payment', $payment, $give_receipt_args ); |
|
125 | + do_action('give_receipt_before_offline_payment', $payment, $give_receipt_args); |
|
126 | 126 | ?> |
127 | - <h2><?php echo apply_filters( 'give_receipt_offline_payment_heading', __( 'Your Donation is Almost Complete!', 'give' ) ); ?></h2> |
|
128 | - <div id="give_donation_receipt" class="<?php echo esc_attr( apply_filters( 'give_receipt_offline_payment_classes', 'give_receipt_offline_payment' ) ); ?>"> |
|
127 | + <h2><?php echo apply_filters('give_receipt_offline_payment_heading', __('Your Donation is Almost Complete!', 'give')); ?></h2> |
|
128 | + <div id="give_donation_receipt" class="<?php echo esc_attr(apply_filters('give_receipt_offline_payment_classes', 'give_receipt_offline_payment')); ?>"> |
|
129 | 129 | <?php |
130 | 130 | // Instruction for offline donation. |
131 | - $offline_instruction = give_get_offline_payment_instruction( $form_id, true ); |
|
131 | + $offline_instruction = give_get_offline_payment_instruction($form_id, true); |
|
132 | 132 | |
133 | 133 | /** |
134 | 134 | * Instruction for the offline donation. |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * @param Give_Payment $payment Payment object. |
140 | 140 | * @param integer $form_id Donation form id. |
141 | 141 | */ |
142 | - echo apply_filters( 'give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id ); |
|
142 | + echo apply_filters('give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id); |
|
143 | 143 | ?> |
144 | 144 | </div> |
145 | 145 | <?php |
@@ -151,52 +151,52 @@ discard block |
||
151 | 151 | * @param Give_Payment $payment Donation payment object. |
152 | 152 | * @param array $give_receipt_args Receipt Arguments. |
153 | 153 | */ |
154 | - do_action( 'give_receipt_after_offline_payment', $payment, $give_receipt_args ); |
|
154 | + do_action('give_receipt_after_offline_payment', $payment, $give_receipt_args); |
|
155 | 155 | |
156 | 156 | return; |
157 | 157 | } |
158 | 158 | |
159 | 159 | // Show payment status notice based on shortcode attribute. |
160 | -if ( filter_var( $give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN ) ) { |
|
160 | +if (filter_var($give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN)) { |
|
161 | 161 | $notice_message = ''; |
162 | 162 | $notice_type = 'warning'; |
163 | 163 | |
164 | - switch ( $status ) { |
|
164 | + switch ($status) { |
|
165 | 165 | case 'publish': |
166 | - $notice_message = __( 'Payment Complete: Thank you for your donation.', 'give' ); |
|
166 | + $notice_message = __('Payment Complete: Thank you for your donation.', 'give'); |
|
167 | 167 | $notice_type = 'success'; |
168 | 168 | break; |
169 | 169 | case 'pending': |
170 | - $notice_message = __( 'Payment Pending: Your donation is currently processing.', 'give' ); |
|
170 | + $notice_message = __('Payment Pending: Your donation is currently processing.', 'give'); |
|
171 | 171 | $notice_type = 'warning'; |
172 | 172 | break; |
173 | 173 | case 'refunded': |
174 | - $notice_message = __( 'Payment Refunded: Your donation has been refunded.', 'give' ); |
|
174 | + $notice_message = __('Payment Refunded: Your donation has been refunded.', 'give'); |
|
175 | 175 | $notice_type = 'warning'; |
176 | 176 | break; |
177 | 177 | case 'preapproval': |
178 | - $notice_message = __( 'Payment Preapproved: Thank you for your donation.', 'give' ); |
|
178 | + $notice_message = __('Payment Preapproved: Thank you for your donation.', 'give'); |
|
179 | 179 | $notice_type = 'warning'; |
180 | 180 | break; |
181 | 181 | case 'failed': |
182 | - $notice_message = __( 'Payment Failed: Please contact the site owner for assistance.', 'give' ); |
|
182 | + $notice_message = __('Payment Failed: Please contact the site owner for assistance.', 'give'); |
|
183 | 183 | $notice_type = 'error'; |
184 | 184 | break; |
185 | 185 | case 'cancelled': |
186 | - $notice_message = __( 'Payment Cancelled: Your donation has been cancelled.', 'give' ); |
|
186 | + $notice_message = __('Payment Cancelled: Your donation has been cancelled.', 'give'); |
|
187 | 187 | $notice_type = 'error'; |
188 | 188 | break; |
189 | 189 | case 'abandoned': |
190 | - $notice_message = __( 'Payment Abandoned: This donation has not been completed.', 'give' ); |
|
190 | + $notice_message = __('Payment Abandoned: This donation has not been completed.', 'give'); |
|
191 | 191 | $notice_type = 'error'; |
192 | 192 | break; |
193 | 193 | case 'revoked': |
194 | - $notice_message = __( 'Payment Revoked: Please contact the site owner for assistance.', 'give' ); |
|
194 | + $notice_message = __('Payment Revoked: Please contact the site owner for assistance.', 'give'); |
|
195 | 195 | $notice_type = 'error'; |
196 | 196 | break; |
197 | 197 | } |
198 | 198 | |
199 | - if ( ! empty( $notice_message ) ) { |
|
199 | + if ( ! empty($notice_message)) { |
|
200 | 200 | /** |
201 | 201 | * Filters payment status notice for receipts. |
202 | 202 | * |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * @param string $status Payment status. |
212 | 212 | * @param int $donation_id Donation ID. |
213 | 213 | */ |
214 | - echo apply_filters( 'give_receipt_status_notice', Give()->notices->print_frontend_notice( $notice_message, false, $notice_type ), $id, $status, $donation_id ); |
|
214 | + echo apply_filters('give_receipt_status_notice', Give()->notices->print_frontend_notice($notice_message, false, $notice_type), $id, $status, $donation_id); |
|
215 | 215 | } |
216 | 216 | }// End if(). |
217 | 217 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | * @param object $payment The payment object. |
226 | 226 | * @param array $give_receipt_args Receipt_argument. |
227 | 227 | */ |
228 | -do_action( 'give_payment_receipt_before_table', $payment, $give_receipt_args ); |
|
228 | +do_action('give_payment_receipt_before_table', $payment, $give_receipt_args); |
|
229 | 229 | ?> |
230 | 230 | |
231 | 231 | <table id="give_donation_receipt" class="give-table"> |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | * @param object $payment The payment object. |
242 | 242 | * @param array $give_receipt_args Receipt_argument. |
243 | 243 | */ |
244 | - do_action( 'give_payment_receipt_header_before', $payment, $give_receipt_args ); |
|
244 | + do_action('give_payment_receipt_header_before', $payment, $give_receipt_args); |
|
245 | 245 | ?> |
246 | 246 | <tr> |
247 | 247 | <th scope="colgroup" colspan="2"> |
248 | - <span class="give-receipt-thead-text"><?php esc_html_e( 'Donation Receipt', 'give' ) ?></span> |
|
248 | + <span class="give-receipt-thead-text"><?php esc_html_e('Donation Receipt', 'give') ?></span> |
|
249 | 249 | </th> |
250 | 250 | </tr> |
251 | 251 | <?php |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @param object $payment The payment object. |
260 | 260 | * @param array $give_receipt_args Receipt_argument. |
261 | 261 | */ |
262 | - do_action( 'give_payment_receipt_header_after', $payment, $give_receipt_args ); |
|
262 | + do_action('give_payment_receipt_header_after', $payment, $give_receipt_args); |
|
263 | 263 | ?> |
264 | 264 | </thead> |
265 | 265 | |
@@ -275,11 +275,11 @@ discard block |
||
275 | 275 | * @param object $payment The payment object. |
276 | 276 | * @param array $give_receipt_args Receipt_argument. |
277 | 277 | */ |
278 | - do_action( 'give_payment_receipt_before', $payment, $give_receipt_args ); |
|
278 | + do_action('give_payment_receipt_before', $payment, $give_receipt_args); |
|
279 | 279 | ?> |
280 | 280 | |
281 | - <?php foreach ( $give_receipt_args['donation_receipt'] as $receipt_item ) { ?> |
|
282 | - <?php if ( filter_var( $receipt_item['display'], FILTER_VALIDATE_BOOLEAN ) ) : ?> |
|
281 | + <?php foreach ($give_receipt_args['donation_receipt'] as $receipt_item) { ?> |
|
282 | + <?php if (filter_var($receipt_item['display'], FILTER_VALIDATE_BOOLEAN)) : ?> |
|
283 | 283 | <tr> |
284 | 284 | <td scope="row"><strong><?php echo $receipt_item['name']; ?></strong></td> |
285 | 285 | <td><?php echo $receipt_item['value']; ?></td> |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | * @param object $payment The payment object. |
299 | 299 | * @param array $give_receipt_args Receipt_argument. |
300 | 300 | */ |
301 | - do_action( 'give_payment_receipt_after', $payment, $give_receipt_args ); |
|
301 | + do_action('give_payment_receipt_after', $payment, $give_receipt_args); |
|
302 | 302 | ?> |
303 | 303 | </tbody> |
304 | 304 | </table> |
@@ -314,5 +314,5 @@ discard block |
||
314 | 314 | * @param object $payment The payment object. |
315 | 315 | * @param array $give_receipt_args Receipt_argument. |
316 | 316 | */ |
317 | -do_action( 'give_payment_receipt_after_table', $payment, $give_receipt_args ); |
|
317 | +do_action('give_payment_receipt_after_table', $payment, $give_receipt_args); |
|
318 | 318 | ?> |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | // Exit if accessed directly. |
7 | -if ( ! defined( 'ABSPATH' ) ) { |
|
7 | +if ( ! defined('ABSPATH')) { |
|
8 | 8 | exit; |
9 | 9 | } |
10 | 10 | |
@@ -19,16 +19,16 @@ discard block |
||
19 | 19 | <div class="give-grid__item"> |
20 | 20 | <?php |
21 | 21 | // Print the opening anchor tag based on display style. |
22 | - if ( 'redirect' === $atts['display_style'] ) { |
|
22 | + if ('redirect' === $atts['display_style']) { |
|
23 | 23 | printf( |
24 | 24 | '<a id="give-card-%1$s" class="give-card" href="%2$s">', |
25 | - esc_attr( $form_id ), |
|
26 | - esc_attr( get_the_permalink() ) |
|
25 | + esc_attr($form_id), |
|
26 | + esc_attr(get_the_permalink()) |
|
27 | 27 | ); |
28 | - } elseif ( 'modal_reveal' === $atts['display_style'] ) { |
|
28 | + } elseif ('modal_reveal' === $atts['display_style']) { |
|
29 | 29 | printf( |
30 | 30 | '<a id="give-card-%1$s" class="give-card js-give-grid-modal-launcher" data-effect="mfp-zoom-out" href="#give-modal-form-%1$s">', |
31 | - esc_attr( $form_id ) |
|
31 | + esc_attr($form_id) |
|
32 | 32 | ); |
33 | 33 | } |
34 | 34 | ?> |
@@ -36,46 +36,46 @@ discard block |
||
36 | 36 | <div class="give-card__body"> |
37 | 37 | <?php |
38 | 38 | // Maybe display the form title. |
39 | - if ( true === $atts['show_title'] ) { |
|
40 | - the_title( '<h3 class="give-card__title">', '</h3>' ); |
|
39 | + if (true === $atts['show_title']) { |
|
40 | + the_title('<h3 class="give-card__title">', '</h3>'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | // Maybe display the form excerpt. |
44 | - if ( true === $atts['show_excerpt'] ) { |
|
45 | - if ( has_excerpt( $form_id ) ) { |
|
44 | + if (true === $atts['show_excerpt']) { |
|
45 | + if (has_excerpt($form_id)) { |
|
46 | 46 | // Get excerpt from the form post's excerpt field. |
47 | - $raw_content = get_the_excerpt( $form_id ); |
|
47 | + $raw_content = get_the_excerpt($form_id); |
|
48 | 48 | $stripped_content = wp_strip_all_tags( |
49 | - strip_shortcodes( $raw_content ) |
|
49 | + strip_shortcodes($raw_content) |
|
50 | 50 | ); |
51 | 51 | } else { |
52 | 52 | // Get content from the form post's content field. |
53 | - $raw_content = give_get_meta( $form_id, '_give_form_content', true ); |
|
53 | + $raw_content = give_get_meta($form_id, '_give_form_content', true); |
|
54 | 54 | |
55 | - if ( ! empty( $raw_content ) ) { |
|
55 | + if ( ! empty($raw_content)) { |
|
56 | 56 | $stripped_content = wp_strip_all_tags( |
57 | - strip_shortcodes( $raw_content ) |
|
57 | + strip_shortcodes($raw_content) |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
62 | 62 | // Maybe truncate excerpt. |
63 | - if ( 0 < $atts['excerpt_length'] ) { |
|
64 | - $excerpt = wp_trim_words( $stripped_content, $atts['excerpt_length'] ); |
|
63 | + if (0 < $atts['excerpt_length']) { |
|
64 | + $excerpt = wp_trim_words($stripped_content, $atts['excerpt_length']); |
|
65 | 65 | } else { |
66 | 66 | $excerpt = $stripped_content; |
67 | 67 | } |
68 | 68 | |
69 | - printf( '<p class="give-card__text">%s</p>', $excerpt ); |
|
69 | + printf('<p class="give-card__text">%s</p>', $excerpt); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | // Maybe display the goal progess bar. |
73 | 73 | if ( |
74 | - give_is_setting_enabled( get_post_meta( $form_id, '_give_goal_option', true ) ) |
|
74 | + give_is_setting_enabled(get_post_meta($form_id, '_give_goal_option', true)) |
|
75 | 75 | && true === $atts['show_goal'] |
76 | 76 | ) { |
77 | 77 | echo '<div class="give-card__progress">'; |
78 | - give_show_goal_progress( $form_id ); |
|
78 | + give_show_goal_progress($form_id); |
|
79 | 79 | echo '</div>'; |
80 | 80 | } |
81 | 81 | ?> |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | <?php |
85 | 85 | // Maybe display the featured image. |
86 | 86 | if ( |
87 | - give_is_setting_enabled( $give_settings['form_featured_img'] ) |
|
87 | + give_is_setting_enabled($give_settings['form_featured_img']) |
|
88 | 88 | && has_post_thumbnail() |
89 | 89 | && true === $atts['show_featured_image'] |
90 | 90 | ) { |
@@ -94,28 +94,28 @@ discard block |
||
94 | 94 | * @param string The image size. |
95 | 95 | * @param array Form grid attributes. |
96 | 96 | */ |
97 | - $image_size = apply_filters( 'give_form_grid_image_size', $atts['image_size'], $atts ); |
|
97 | + $image_size = apply_filters('give_form_grid_image_size', $atts['image_size'], $atts); |
|
98 | 98 | $image_attr = ''; |
99 | 99 | |
100 | 100 | echo '<div class="give-card__media">'; |
101 | - if ( 'auto' !== $atts['image_height'] ) { |
|
101 | + if ('auto' !== $atts['image_height']) { |
|
102 | 102 | $image_attr = array( |
103 | - 'style' => 'height: ' . $atts['image_height'], |
|
103 | + 'style' => 'height: '.$atts['image_height'], |
|
104 | 104 | ); |
105 | 105 | } |
106 | - the_post_thumbnail( $image_size, $image_attr ); |
|
106 | + the_post_thumbnail($image_size, $image_attr); |
|
107 | 107 | echo '</div>'; |
108 | 108 | } |
109 | 109 | ?> |
110 | 110 | </a> |
111 | 111 | <?php |
112 | 112 | // If modal, print form in hidden container until it is time to be revealed. |
113 | - if ( 'modal_reveal' === $atts['display_style'] ) { |
|
113 | + if ('modal_reveal' === $atts['display_style']) { |
|
114 | 114 | printf( |
115 | 115 | '<div id="give-modal-form-%1$s" class="give-donation-grid-item-form give-modal--slide mfp-hide">', |
116 | 116 | $form_id |
117 | 117 | ); |
118 | - give_get_donation_form( $form_id ); |
|
118 | + give_get_donation_form($form_id); |
|
119 | 119 | echo '</div>'; |
120 | 120 | } |
121 | 121 | ?> |
@@ -8,9 +8,9 @@ |
||
8 | 8 | |
9 | 9 | // Sanity check - ensure form has pass all condition to show goal. |
10 | 10 | if ( ( isset( $args['show_goal'] ) && ! filter_var( $args['show_goal'], FILTER_VALIDATE_BOOLEAN ) ) |
11 | - || empty( $form->ID ) |
|
12 | - || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) ) |
|
13 | - || ! give_is_setting_enabled( $goal_option ) || 0 === $form->goal ) { |
|
11 | + || empty( $form->ID ) |
|
12 | + || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) ) |
|
13 | + || ! give_is_setting_enabled( $goal_option ) || 0 === $form->goal ) { |
|
14 | 14 | return false; |
15 | 15 | } |
16 | 16 |
@@ -3,59 +3,59 @@ discard block |
||
3 | 3 | * This template is used to display the goal with [give_goal] |
4 | 4 | */ |
5 | 5 | |
6 | -$form = new Give_Donate_Form( $form_id ); |
|
7 | -$goal_option = give_get_meta( $form->ID, '_give_goal_option', true ); |
|
6 | +$form = new Give_Donate_Form($form_id); |
|
7 | +$goal_option = give_get_meta($form->ID, '_give_goal_option', true); |
|
8 | 8 | |
9 | 9 | // Sanity check - ensure form has pass all condition to show goal. |
10 | -if ( ( isset( $args['show_goal'] ) && ! filter_var( $args['show_goal'], FILTER_VALIDATE_BOOLEAN ) ) |
|
11 | - || empty( $form->ID ) |
|
12 | - || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) ) |
|
13 | - || ! give_is_setting_enabled( $goal_option ) || 0 === $form->goal ) { |
|
10 | +if ((isset($args['show_goal']) && ! filter_var($args['show_goal'], FILTER_VALIDATE_BOOLEAN)) |
|
11 | + || empty($form->ID) |
|
12 | + || (is_singular('give_forms') && ! give_is_setting_enabled($goal_option)) |
|
13 | + || ! give_is_setting_enabled($goal_option) || 0 === $form->goal) { |
|
14 | 14 | return false; |
15 | 15 | } |
16 | 16 | |
17 | -$goal_format = give_get_meta( $form_id, '_give_goal_format', true ); |
|
18 | -$price = give_get_meta( $form_id, '_give_set_price', true ); |
|
19 | -$color = give_get_meta( $form_id, '_give_goal_color', true ); |
|
20 | -$show_text = isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
21 | -$show_bar = isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true; |
|
17 | +$goal_format = give_get_meta($form_id, '_give_goal_format', true); |
|
18 | +$price = give_get_meta($form_id, '_give_set_price', true); |
|
19 | +$color = give_get_meta($form_id, '_give_goal_color', true); |
|
20 | +$show_text = isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true; |
|
21 | +$show_bar = isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Filter the form income |
25 | 25 | * |
26 | 26 | * @since 1.8.8 |
27 | 27 | */ |
28 | -$income = apply_filters( 'give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form ); |
|
28 | +$income = apply_filters('give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Filter the form |
32 | 32 | * |
33 | 33 | * @since 1.8.8 |
34 | 34 | */ |
35 | -$goal = apply_filters( 'give_goal_amount_target_output', $form->goal, $form_id, $form ); |
|
35 | +$goal = apply_filters('give_goal_amount_target_output', $form->goal, $form_id, $form); |
|
36 | 36 | |
37 | -switch ( $goal_format ) { |
|
37 | +switch ($goal_format) { |
|
38 | 38 | |
39 | 39 | case 'donation': |
40 | - $donations_completed = give_get_form_sales_stats( $form_id ); |
|
41 | - $donations_goal = give_get_meta( $form_id, '_give_number_of_donation_goal', true ); |
|
42 | - $progress = round( ( $donations_completed / $donations_goal ) * 100, 2 ); |
|
40 | + $donations_completed = give_get_form_sales_stats($form_id); |
|
41 | + $donations_goal = give_get_meta($form_id, '_give_number_of_donation_goal', true); |
|
42 | + $progress = round(($donations_completed / $donations_goal) * 100, 2); |
|
43 | 43 | $progress_bar_value = $donations_completed >= $donations_goal ? 100 : $progress; |
44 | 44 | break; |
45 | 45 | |
46 | 46 | case 'donors': |
47 | - $donor_goal = give_get_meta( $form_id, '_give_number_of_donor_goal', true ); |
|
48 | - $donors = give_get_form_donor_count( $form_id ); |
|
49 | - $progress = $progress_bar_value = round( ( $donors / $donor_goal ) * 100, 2 ); |
|
47 | + $donor_goal = give_get_meta($form_id, '_give_number_of_donor_goal', true); |
|
48 | + $donors = give_get_form_donor_count($form_id); |
|
49 | + $progress = $progress_bar_value = round(($donors / $donor_goal) * 100, 2); |
|
50 | 50 | break; |
51 | 51 | |
52 | 52 | case 'percentage': |
53 | - $progress = round( ( $income / $goal ) * 100, 2 ); |
|
53 | + $progress = round(($income / $goal) * 100, 2); |
|
54 | 54 | $progress_bar_value = $income >= $goal ? 100 : $progress; |
55 | 55 | break; |
56 | 56 | |
57 | 57 | default : |
58 | - $progress = round( ( $income / $goal ) * 100, 2 ); |
|
58 | + $progress = round(($income / $goal) * 100, 2); |
|
59 | 59 | $progress_bar_value = $income >= $goal ? 100 : $progress; |
60 | 60 | break; |
61 | 61 | |
@@ -66,64 +66,64 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @since 1.8.8 |
68 | 68 | */ |
69 | -$progress = apply_filters( 'give_goal_amount_funded_percentage_output', $progress, $form_id, $form ); |
|
69 | +$progress = apply_filters('give_goal_amount_funded_percentage_output', $progress, $form_id, $form); |
|
70 | 70 | ?> |
71 | 71 | <div class="give-goal-progress"> |
72 | - <?php if ( ! empty( $show_text ) ) : ?> |
|
72 | + <?php if ( ! empty($show_text)) : ?> |
|
73 | 73 | <div class="raised"> |
74 | 74 | <?php |
75 | - if ( 'amount' === $goal_format ) : |
|
75 | + if ('amount' === $goal_format) : |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Filter the give currency. |
79 | 79 | * |
80 | 80 | * @since 1.8.17 |
81 | 81 | */ |
82 | - $form_currency = apply_filters( 'give_goal_form_currency', give_get_currency( $form_id ), $form_id ); |
|
82 | + $form_currency = apply_filters('give_goal_form_currency', give_get_currency($form_id), $form_id); |
|
83 | 83 | |
84 | 84 | /** |
85 | 85 | * Filter the income formatting arguments. |
86 | 86 | * |
87 | 87 | * @since 1.8.17 |
88 | 88 | */ |
89 | - $income_format_args = apply_filters( 'give_goal_income_format_args', array( |
|
89 | + $income_format_args = apply_filters('give_goal_income_format_args', array( |
|
90 | 90 | 'sanitize' => false, |
91 | 91 | 'currency' => $form_currency, |
92 | 92 | 'decimal' => false |
93 | - ), $form_id ); |
|
93 | + ), $form_id); |
|
94 | 94 | |
95 | 95 | /** |
96 | 96 | * Filter the goal formatting arguments. |
97 | 97 | * |
98 | 98 | * @since 1.8.17 |
99 | 99 | */ |
100 | - $goal_format_args = apply_filters( 'give_goal_amount_format_args', array( |
|
100 | + $goal_format_args = apply_filters('give_goal_amount_format_args', array( |
|
101 | 101 | 'sanitize' => false, |
102 | 102 | 'currency' => $form_currency, |
103 | 103 | 'decimal' => false |
104 | - ), $form_id ); |
|
104 | + ), $form_id); |
|
105 | 105 | |
106 | 106 | // Get formatted amount. |
107 | - $income = give_human_format_large_amount( give_format_amount( $income, $income_format_args ), array( 'currency' => $form_currency ) ); |
|
108 | - $goal = give_human_format_large_amount( give_format_amount( $goal, $goal_format_args ), array( 'currency' => $form_currency ) ); |
|
107 | + $income = give_human_format_large_amount(give_format_amount($income, $income_format_args), array('currency' => $form_currency)); |
|
108 | + $goal = give_human_format_large_amount(give_format_amount($goal, $goal_format_args), array('currency' => $form_currency)); |
|
109 | 109 | |
110 | 110 | echo sprintf( /* translators: 1: amount of income raised 2: goal target amount. */ |
111 | - __( '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> raised', 'give' ), give_currency_filter( $income, array( 'form_id' => $form_id ) ), give_currency_filter( $goal, array( 'form_id' => $form_id ) ) ); |
|
111 | + __('<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> raised', 'give'), give_currency_filter($income, array('form_id' => $form_id)), give_currency_filter($goal, array('form_id' => $form_id)) ); |
|
112 | 112 | |
113 | - elseif ( 'percentage' === $goal_format ) : |
|
113 | + elseif ('percentage' === $goal_format) : |
|
114 | 114 | |
115 | 115 | echo sprintf( /* translators: %s: percentage of the amount raised compared to the goal target */ |
116 | - __( '<span class="give-percentage">%s%%</span> funded', 'give' ), round( $progress ) ); |
|
116 | + __('<span class="give-percentage">%s%%</span> funded', 'give'), round($progress) ); |
|
117 | 117 | |
118 | - elseif ( 'donation' === $goal_format ) : |
|
118 | + elseif ('donation' === $goal_format) : |
|
119 | 119 | |
120 | 120 | echo sprintf( /* translators: 1: total number of donations completed 2: total number of donations set as goal */ |
121 | - _n( '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donations', $donations_goal, 'give' ), $donations_completed, $donations_goal ); |
|
121 | + _n('<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donations', $donations_goal, 'give'), $donations_completed, $donations_goal ); |
|
122 | 122 | |
123 | - elseif ( 'donors' === $goal_format ) : |
|
123 | + elseif ('donors' === $goal_format) : |
|
124 | 124 | |
125 | 125 | echo sprintf( /* translators: 1: total number of donors completed 2: total number of donors set as goal */ |
126 | - _n( '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donors', $donor_goal, 'give' ), $donors, $donor_goal ); |
|
126 | + _n('<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donors', $donor_goal, 'give'), $donors, $donor_goal ); |
|
127 | 127 | |
128 | 128 | endif; |
129 | 129 | ?> |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | <?php endif; ?> |
132 | 132 | |
133 | 133 | |
134 | - <?php if ( ! empty( $show_bar ) ) : ?> |
|
134 | + <?php if ( ! empty($show_bar)) : ?> |
|
135 | 135 | <div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" |
136 | - aria-valuenow="<?php echo esc_attr( $progress_bar_value ); ?>"> |
|
137 | - <span style="width: <?php echo esc_attr( $progress_bar_value ); ?>%;<?php if ( ! empty( $color ) ) { |
|
138 | - echo 'background-color:' . $color; |
|
136 | + aria-valuenow="<?php echo esc_attr($progress_bar_value); ?>"> |
|
137 | + <span style="width: <?php echo esc_attr($progress_bar_value); ?>%;<?php if ( ! empty($color)) { |
|
138 | + echo 'background-color:'.$color; |
|
139 | 139 | } ?>"></span> |
140 | 140 | </div><!-- /.give-progress-bar --> |
141 | 141 | <?php endif; ?> |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | */ |
40 | 40 | |
41 | 41 | // Exit if accessed directly. |
42 | -if ( ! defined( 'ABSPATH' ) ) { |
|
42 | +if ( ! defined('ABSPATH')) { |
|
43 | 43 | exit; |
44 | 44 | } |
45 | 45 | |
46 | -if ( ! class_exists( 'Give' ) ) : |
|
46 | +if ( ! class_exists('Give')) : |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Main Give Class |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * @return Give |
262 | 262 | */ |
263 | 263 | public static function instance() { |
264 | - if ( is_null( self::$_instance ) ) { |
|
264 | + if (is_null(self::$_instance)) { |
|
265 | 265 | self::$_instance = new self(); |
266 | 266 | } |
267 | 267 | |
@@ -273,13 +273,13 @@ discard block |
||
273 | 273 | */ |
274 | 274 | public function __construct() { |
275 | 275 | // PHP version |
276 | - if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) { |
|
277 | - define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' ); |
|
276 | + if ( ! defined('GIVE_REQUIRED_PHP_VERSION')) { |
|
277 | + define('GIVE_REQUIRED_PHP_VERSION', '5.3'); |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | // Bailout: Need minimum php version to load plugin. |
281 | - if ( function_exists( 'phpversion' ) && version_compare( GIVE_REQUIRED_PHP_VERSION, phpversion(), '>' ) ) { |
|
282 | - add_action( 'admin_notices', array( $this, 'minimum_phpversion_notice' ) ); |
|
281 | + if (function_exists('phpversion') && version_compare(GIVE_REQUIRED_PHP_VERSION, phpversion(), '>')) { |
|
282 | + add_action('admin_notices', array($this, 'minimum_phpversion_notice')); |
|
283 | 283 | |
284 | 284 | return; |
285 | 285 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $this->includes(); |
289 | 289 | $this->init_hooks(); |
290 | 290 | |
291 | - do_action( 'give_loaded' ); |
|
291 | + do_action('give_loaded'); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |
@@ -297,11 +297,11 @@ discard block |
||
297 | 297 | * @since 1.8.9 |
298 | 298 | */ |
299 | 299 | private function init_hooks() { |
300 | - register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' ); |
|
301 | - add_action( 'plugins_loaded', array( $this, 'init' ), 0 ); |
|
300 | + register_activation_hook(GIVE_PLUGIN_FILE, 'give_install'); |
|
301 | + add_action('plugins_loaded', array($this, 'init'), 0); |
|
302 | 302 | |
303 | 303 | // Set up localization on init Hook. |
304 | - add_action( 'init', array( $this, 'load_textdomain' ), 0 ); |
|
304 | + add_action('init', array($this, 'load_textdomain'), 0); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | * |
318 | 318 | * @since 1.8.9 |
319 | 319 | */ |
320 | - do_action( 'before_give_init' ); |
|
320 | + do_action('before_give_init'); |
|
321 | 321 | |
322 | 322 | // Set up localization. |
323 | 323 | $this->load_textdomain(); |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | * |
351 | 351 | * @since 1.8.7 |
352 | 352 | */ |
353 | - do_action( 'give_init', $this ); |
|
353 | + do_action('give_init', $this); |
|
354 | 354 | |
355 | 355 | } |
356 | 356 | |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | */ |
368 | 368 | public function __clone() { |
369 | 369 | // Cloning instances of the class is forbidden. |
370 | - give_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' ); |
|
370 | + give_doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0'); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | /** |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | */ |
381 | 381 | public function __wakeup() { |
382 | 382 | // Unserializing instances of the class is forbidden. |
383 | - give_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' ); |
|
383 | + give_doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0'); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | /** |
@@ -394,33 +394,33 @@ discard block |
||
394 | 394 | private function setup_constants() { |
395 | 395 | |
396 | 396 | // Plugin version |
397 | - if ( ! defined( 'GIVE_VERSION' ) ) { |
|
398 | - define( 'GIVE_VERSION', '2.1.0' ); |
|
397 | + if ( ! defined('GIVE_VERSION')) { |
|
398 | + define('GIVE_VERSION', '2.1.0'); |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | // Plugin Root File |
402 | - if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) { |
|
403 | - define( 'GIVE_PLUGIN_FILE', __FILE__ ); |
|
402 | + if ( ! defined('GIVE_PLUGIN_FILE')) { |
|
403 | + define('GIVE_PLUGIN_FILE', __FILE__); |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | // Plugin Folder Path |
407 | - if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) { |
|
408 | - define( 'GIVE_PLUGIN_DIR', plugin_dir_path( GIVE_PLUGIN_FILE ) ); |
|
407 | + if ( ! defined('GIVE_PLUGIN_DIR')) { |
|
408 | + define('GIVE_PLUGIN_DIR', plugin_dir_path(GIVE_PLUGIN_FILE)); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | // Plugin Folder URL |
412 | - if ( ! defined( 'GIVE_PLUGIN_URL' ) ) { |
|
413 | - define( 'GIVE_PLUGIN_URL', plugin_dir_url( GIVE_PLUGIN_FILE ) ); |
|
412 | + if ( ! defined('GIVE_PLUGIN_URL')) { |
|
413 | + define('GIVE_PLUGIN_URL', plugin_dir_url(GIVE_PLUGIN_FILE)); |
|
414 | 414 | } |
415 | 415 | |
416 | 416 | // Plugin Basename aka: "give/give.php" |
417 | - if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) { |
|
418 | - define( 'GIVE_PLUGIN_BASENAME', plugin_basename( GIVE_PLUGIN_FILE ) ); |
|
417 | + if ( ! defined('GIVE_PLUGIN_BASENAME')) { |
|
418 | + define('GIVE_PLUGIN_BASENAME', plugin_basename(GIVE_PLUGIN_FILE)); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | // Make sure CAL_GREGORIAN is defined |
422 | - if ( ! defined( 'CAL_GREGORIAN' ) ) { |
|
423 | - define( 'CAL_GREGORIAN', 1 ); |
|
422 | + if ( ! defined('CAL_GREGORIAN')) { |
|
423 | + define('CAL_GREGORIAN', 1); |
|
424 | 424 | } |
425 | 425 | } |
426 | 426 | |
@@ -438,160 +438,160 @@ discard block |
||
438 | 438 | /** |
439 | 439 | * Load libraries. |
440 | 440 | */ |
441 | - if ( ! class_exists( 'WP_Async_Request' ) ) { |
|
442 | - include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-async-request.php' ); |
|
441 | + if ( ! class_exists('WP_Async_Request')) { |
|
442 | + include_once(GIVE_PLUGIN_DIR.'includes/libraries/wp-async-request.php'); |
|
443 | 443 | } |
444 | 444 | |
445 | - if ( ! class_exists( 'WP_Background_Process' ) ) { |
|
446 | - include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-background-process.php' ); |
|
445 | + if ( ! class_exists('WP_Background_Process')) { |
|
446 | + include_once(GIVE_PLUGIN_DIR.'includes/libraries/wp-background-process.php'); |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
450 | 450 | * Load plugin files |
451 | 451 | */ |
452 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php'; |
|
453 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php'; |
|
452 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-settings.php'; |
|
453 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-give-settings.php'; |
|
454 | 454 | $give_options = give_get_settings(); |
455 | 455 | |
456 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php'; |
|
457 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-async-process.php'; |
|
458 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php'; |
|
459 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php'; |
|
460 | - require_once GIVE_PLUGIN_DIR . 'includes/post-types.php'; |
|
461 | - require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php'; |
|
462 | - require_once GIVE_PLUGIN_DIR . 'includes/actions.php'; |
|
463 | - require_once GIVE_PLUGIN_DIR . 'includes/filters.php'; |
|
464 | - require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php'; |
|
465 | - require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api-v2.php'; |
|
466 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php'; |
|
467 | - require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php'; |
|
468 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-translation.php'; |
|
469 | - |
|
470 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-scripts.php'; |
|
471 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php'; |
|
472 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php'; |
|
473 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php'; |
|
474 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php'; |
|
475 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-meta.php'; |
|
476 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php'; |
|
477 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php'; |
|
478 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php'; |
|
479 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php'; |
|
480 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php'; |
|
481 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php'; |
|
482 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php'; |
|
483 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php'; |
|
484 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php'; |
|
485 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-payment-meta.php'; |
|
486 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-form-meta.php'; |
|
487 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sequential-ordering.php'; |
|
488 | - |
|
489 | - require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php'; |
|
490 | - require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php'; |
|
491 | - require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php'; |
|
492 | - require_once GIVE_PLUGIN_DIR . 'includes/import-functions.php'; |
|
493 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php'; |
|
494 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php'; |
|
495 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php'; |
|
496 | - require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php'; |
|
497 | - require_once GIVE_PLUGIN_DIR . 'includes/formatting.php'; |
|
498 | - require_once GIVE_PLUGIN_DIR . 'includes/currency-functions.php'; |
|
499 | - require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php'; |
|
500 | - require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php'; |
|
501 | - require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php'; |
|
502 | - require_once GIVE_PLUGIN_DIR . 'includes/login-register.php'; |
|
503 | - require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php'; |
|
504 | - require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php'; |
|
505 | - require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php'; |
|
506 | - require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php'; |
|
507 | - require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php'; |
|
508 | - require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php'; |
|
509 | - |
|
510 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/backward-compatibility.php'; |
|
511 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php'; |
|
512 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php'; |
|
513 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php'; |
|
514 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php'; |
|
515 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php'; |
|
516 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-sequential-donation-number.php'; |
|
517 | - |
|
518 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php'; |
|
519 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php'; |
|
520 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php'; |
|
521 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php'; |
|
522 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php'; |
|
523 | - |
|
524 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php'; |
|
525 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php'; |
|
526 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notifications.php'; |
|
527 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php'; |
|
528 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php'; |
|
529 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php'; |
|
530 | - |
|
531 | - require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donors-query.php'; |
|
532 | - require_once GIVE_PLUGIN_DIR . 'includes/donors/backward-compatibility.php'; |
|
533 | - |
|
534 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/class-give-updates.php'; |
|
535 | - |
|
536 | - require_once GIVE_PLUGIN_DIR . 'blocks/load.php'; |
|
537 | - |
|
538 | - if ( defined( 'WP_CLI' ) && WP_CLI ) { |
|
539 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php'; |
|
456 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php'; |
|
457 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-async-process.php'; |
|
458 | + require_once GIVE_PLUGIN_DIR.'includes/admin/give-metabox-functions.php'; |
|
459 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-cache.php'; |
|
460 | + require_once GIVE_PLUGIN_DIR.'includes/post-types.php'; |
|
461 | + require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php'; |
|
462 | + require_once GIVE_PLUGIN_DIR.'includes/actions.php'; |
|
463 | + require_once GIVE_PLUGIN_DIR.'includes/filters.php'; |
|
464 | + require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php'; |
|
465 | + require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api-v2.php'; |
|
466 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-tooltips.php'; |
|
467 | + require_once GIVE_PLUGIN_DIR.'includes/class-notices.php'; |
|
468 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-translation.php'; |
|
469 | + |
|
470 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-scripts.php'; |
|
471 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php'; |
|
472 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php'; |
|
473 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php'; |
|
474 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php'; |
|
475 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-meta.php'; |
|
476 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donors.php'; |
|
477 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donor-meta.php'; |
|
478 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-donor.php'; |
|
479 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php'; |
|
480 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php'; |
|
481 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php'; |
|
482 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php'; |
|
483 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php'; |
|
484 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-email-access.php'; |
|
485 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-payment-meta.php'; |
|
486 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-form-meta.php'; |
|
487 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-sequential-ordering.php'; |
|
488 | + |
|
489 | + require_once GIVE_PLUGIN_DIR.'includes/country-functions.php'; |
|
490 | + require_once GIVE_PLUGIN_DIR.'includes/template-functions.php'; |
|
491 | + require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php'; |
|
492 | + require_once GIVE_PLUGIN_DIR.'includes/import-functions.php'; |
|
493 | + require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php'; |
|
494 | + require_once GIVE_PLUGIN_DIR.'includes/forms/template.php'; |
|
495 | + require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php'; |
|
496 | + require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php'; |
|
497 | + require_once GIVE_PLUGIN_DIR.'includes/formatting.php'; |
|
498 | + require_once GIVE_PLUGIN_DIR.'includes/currency-functions.php'; |
|
499 | + require_once GIVE_PLUGIN_DIR.'includes/price-functions.php'; |
|
500 | + require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php'; |
|
501 | + require_once GIVE_PLUGIN_DIR.'includes/process-donation.php'; |
|
502 | + require_once GIVE_PLUGIN_DIR.'includes/login-register.php'; |
|
503 | + require_once GIVE_PLUGIN_DIR.'includes/user-functions.php'; |
|
504 | + require_once GIVE_PLUGIN_DIR.'includes/plugin-compatibility.php'; |
|
505 | + require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-classes.php'; |
|
506 | + require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-functions.php'; |
|
507 | + require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-actions.php'; |
|
508 | + require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-filters.php'; |
|
509 | + |
|
510 | + require_once GIVE_PLUGIN_DIR.'includes/payments/backward-compatibility.php'; |
|
511 | + require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php'; |
|
512 | + require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php'; |
|
513 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php'; |
|
514 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php'; |
|
515 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-payment.php'; |
|
516 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-sequential-donation-number.php'; |
|
517 | + |
|
518 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php'; |
|
519 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php'; |
|
520 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php'; |
|
521 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php'; |
|
522 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php'; |
|
523 | + |
|
524 | + require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php'; |
|
525 | + require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php'; |
|
526 | + require_once GIVE_PLUGIN_DIR.'includes/admin/emails/class-email-notifications.php'; |
|
527 | + require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php'; |
|
528 | + require_once GIVE_PLUGIN_DIR.'includes/emails/template.php'; |
|
529 | + require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php'; |
|
530 | + |
|
531 | + require_once GIVE_PLUGIN_DIR.'includes/donors/class-give-donors-query.php'; |
|
532 | + require_once GIVE_PLUGIN_DIR.'includes/donors/backward-compatibility.php'; |
|
533 | + |
|
534 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/class-give-updates.php'; |
|
535 | + |
|
536 | + require_once GIVE_PLUGIN_DIR.'blocks/load.php'; |
|
537 | + |
|
538 | + if (defined('WP_CLI') && WP_CLI) { |
|
539 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-cli-commands.php'; |
|
540 | 540 | } |
541 | 541 | |
542 | - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
|
543 | - |
|
544 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php'; |
|
545 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php'; |
|
546 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php'; |
|
547 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php'; |
|
548 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php'; |
|
549 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php'; |
|
550 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php'; |
|
551 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php'; |
|
552 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php'; |
|
553 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php'; |
|
554 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-blank-slate.php'; |
|
555 | - |
|
556 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php'; |
|
557 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php'; |
|
558 | - |
|
559 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php'; |
|
560 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php'; |
|
561 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php'; |
|
562 | - |
|
563 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php'; |
|
564 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php'; |
|
565 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php'; |
|
566 | - |
|
567 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php'; |
|
568 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php'; |
|
569 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php'; |
|
570 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php'; |
|
571 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/give-export-donations-functions.php'; |
|
572 | - |
|
573 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/reports.php'; |
|
574 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/class-give-graph.php'; |
|
575 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/graphing.php'; |
|
576 | - |
|
577 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php'; |
|
578 | - |
|
579 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php'; |
|
580 | - |
|
581 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php'; |
|
582 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php'; |
|
583 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php'; |
|
584 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php'; |
|
585 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php'; |
|
586 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php'; |
|
587 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php'; |
|
588 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-grid.php'; |
|
589 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php'; |
|
590 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php'; |
|
591 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-totals.php'; |
|
542 | + if (is_admin() || (defined('WP_CLI') && WP_CLI)) { |
|
543 | + |
|
544 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php'; |
|
545 | + require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php'; |
|
546 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php'; |
|
547 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php'; |
|
548 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-i18n-module.php'; |
|
549 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php'; |
|
550 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-filters.php'; |
|
551 | + require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php'; |
|
552 | + require_once GIVE_PLUGIN_DIR.'includes/admin/plugins.php'; |
|
553 | + require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php'; |
|
554 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-blank-slate.php'; |
|
555 | + |
|
556 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php'; |
|
557 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php'; |
|
558 | + |
|
559 | + require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donors.php'; |
|
560 | + require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-functions.php'; |
|
561 | + require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-actions.php'; |
|
562 | + |
|
563 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php'; |
|
564 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/class-metabox-form-data.php'; |
|
565 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php'; |
|
566 | + |
|
567 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-functions.php'; |
|
568 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/class-export.php'; |
|
569 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-actions.php'; |
|
570 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/pdf-reports.php'; |
|
571 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/give-export-donations-functions.php'; |
|
572 | + |
|
573 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reports/reports.php'; |
|
574 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reports/class-give-graph.php'; |
|
575 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reports/graphing.php'; |
|
576 | + |
|
577 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/logs/logs.php'; |
|
578 | + |
|
579 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/data/tools-actions.php'; |
|
580 | + |
|
581 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php'; |
|
582 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php'; |
|
583 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php'; |
|
584 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php'; |
|
585 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php'; |
|
586 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php'; |
|
587 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php'; |
|
588 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-grid.php'; |
|
589 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php'; |
|
590 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php'; |
|
591 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-totals.php'; |
|
592 | 592 | }// End if(). |
593 | 593 | |
594 | - require_once GIVE_PLUGIN_DIR . 'includes/install.php'; |
|
594 | + require_once GIVE_PLUGIN_DIR.'includes/install.php'; |
|
595 | 595 | |
596 | 596 | } |
597 | 597 | |
@@ -606,16 +606,16 @@ discard block |
||
606 | 606 | public function load_textdomain() { |
607 | 607 | |
608 | 608 | // Set filter for Give's languages directory |
609 | - $give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/'; |
|
610 | - $give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir ); |
|
609 | + $give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/'; |
|
610 | + $give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir); |
|
611 | 611 | |
612 | 612 | // Traditional WordPress plugin locale filter. |
613 | - $locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale(); |
|
614 | - $locale = apply_filters( 'plugin_locale', $locale, 'give' ); |
|
613 | + $locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale(); |
|
614 | + $locale = apply_filters('plugin_locale', $locale, 'give'); |
|
615 | 615 | |
616 | - unload_textdomain( 'give' ); |
|
617 | - load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' ); |
|
618 | - load_plugin_textdomain( 'give', false, $give_lang_dir ); |
|
616 | + unload_textdomain('give'); |
|
617 | + load_textdomain('give', WP_LANG_DIR.'/give/give-'.$locale.'.mo'); |
|
618 | + load_plugin_textdomain('give', false, $give_lang_dir); |
|
619 | 619 | |
620 | 620 | } |
621 | 621 | |
@@ -628,21 +628,21 @@ discard block |
||
628 | 628 | */ |
629 | 629 | public function minimum_phpversion_notice() { |
630 | 630 | // Bailout. |
631 | - if ( ! is_admin() ) { |
|
631 | + if ( ! is_admin()) { |
|
632 | 632 | return; |
633 | 633 | } |
634 | 634 | |
635 | - $notice_desc = '<p><strong>' . __( 'Your site could be faster and more secure with a newer PHP version.', 'give' ) . '</strong></p>'; |
|
636 | - $notice_desc .= '<p>' . __( 'Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give' ) . '</p>'; |
|
637 | - $notice_desc .= '<p>' . __( 'Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give' ) . '</p>'; |
|
638 | - $notice_desc .= '<p><strong>' . __( 'To which version should I update?', 'give' ) . '</strong></p>'; |
|
639 | - $notice_desc .= '<p>' . __( 'You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give' ) . '</p>'; |
|
640 | - $notice_desc .= '<p><strong>' . __( 'Can\'t update? Ask your host!', 'give' ) . '</strong></p>'; |
|
641 | - $notice_desc .= '<p>' . sprintf( __( 'If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give' ), sprintf( '<a href="%1$s" target="_blank">', esc_url( 'https://wordpress.org/hosting/' ) ), '</a>' ) . '</p>'; |
|
635 | + $notice_desc = '<p><strong>'.__('Your site could be faster and more secure with a newer PHP version.', 'give').'</strong></p>'; |
|
636 | + $notice_desc .= '<p>'.__('Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give').'</p>'; |
|
637 | + $notice_desc .= '<p>'.__('Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give').'</p>'; |
|
638 | + $notice_desc .= '<p><strong>'.__('To which version should I update?', 'give').'</strong></p>'; |
|
639 | + $notice_desc .= '<p>'.__('You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give').'</p>'; |
|
640 | + $notice_desc .= '<p><strong>'.__('Can\'t update? Ask your host!', 'give').'</strong></p>'; |
|
641 | + $notice_desc .= '<p>'.sprintf(__('If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give'), sprintf('<a href="%1$s" target="_blank">', esc_url('https://wordpress.org/hosting/')), '</a>').'</p>'; |
|
642 | 642 | |
643 | 643 | echo sprintf( |
644 | 644 | '<div class="notice notice-error">%1$s</div>', |
645 | - wp_kses_post( $notice_desc ) |
|
645 | + wp_kses_post($notice_desc) |
|
646 | 646 | ); |
647 | 647 | } |
648 | 648 |